/
_create_survey_text.php
180 lines (169 loc) · 7.45 KB
/
_create_survey_text.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
<?php
/**
* General container for create survey action
* @var AdminController $this
* @var Survey $oSurvey
*/
?>
<script type="text/javascript">
var standardtemplaterooturl = '<?php echo Yii::app()->getConfig('standardtemplaterooturl');?>';
var templaterooturl = '<?php echo Yii::app()->getConfig('usertemplaterooturl');?>';
var jsonUrl = '';
var sAction = '';
var sParameter = '';
var sTargetQuestion = '';
var sNoParametersDefined = '';
var sAdminEmailAddressNeeded = '<?php eT("If you are using token functions or notifications emails you need to set an administrator email address."); ?>'
var sURLParameters = '';
var sAddParam = '';
</script>
<?php
$count = 0;
if(isset($scripts))
echo $scripts;
$aSurveyLanguageSettings = $aTabContents['aSurveyLanguageSettings'];
$surveyid = $aTabContents['surveyid'];
?>
<!-- Edition container -->
<div class="container-fluid">
<div class="row">
<div class="col-md-6">
<!-- Survey title -->
<div class="form-group">
<label class=" question-group-title control-label" for="surveyls_title">
<?php eT("Survey title:"); ?>
</label>
<div class="">
<?php echo CHtml::textField("surveyls_title",$aSurveyLanguageSettings['surveyls_title'],array('class'=>'form-control','size'=>"80",'id'=>"surveyls_title")); ?>
</div>
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="createsample" class=" control-label"><?php eT("Create example question group and question?") ?></label>
<!--<input type="checkbox" name="createsample" id="createsample" />-->
<div class="">
<?php $this->widget('yiiwheels.widgets.switch.WhSwitch', array(
'name' => 'createsample',
'value' => 0,
'onLabel'=>gT('On'),
'offLabel'=>gT('Off')
)); ?>
</div>
</div>
</div>
<hr class="col-sm-12" />
</div>
<div class="row">
<div class="col-sm-12 col-md-6">
<!-- Description -->
<div class="form-group">
<label class=" control-label" for="description">
<?php eT("Description:"); ?>
</label>
<div class="">
<div class="htmleditor input-group">
<?php echo CHtml::textArea("description",$aSurveyLanguageSettings['surveyls_description'],array('class'=>'form-control','cols'=>'80','rows'=>'15','id'=>"description")); ?>
<?php echo getEditor("survey-desc","description", "[".gT("Description:", "js")."](".$aSurveyLanguageSettings['surveyls_language'].")",$surveyid,'','',$action); ?>
</div>
</div>
</div>
</div>
<div class="col-sm-12 col-md-6">
<!-- End URL -->
<div class="form-group">
<label class="control-label ">
<?php eT("End URL:"); ?>
</label>
<div class="">
<?php echo CHtml::textField("url",$aSurveyLanguageSettings['surveyls_url'],array('class'=>'form-control','size'=>"80",'placeholder'=>'http://','id'=>"url")); ?>
</div>
</div>
<!-- URL description -->
<div class="form-group">
<label class="control-label ">
<?php eT("URL description:"); ?>
</label>
<div class="">
<?php echo CHtml::textField("urldescrip",$aSurveyLanguageSettings['surveyls_urldescription'],array('class'=>'form-control','size'=>"80",'id'=>"urldescrip")); ?>
</div>
</div>
<!-- Date format -->
<div class="form-group">
<label class="control-label ">
<?php eT("Date format:"); ?>
</label>
<div class="">
<select size='1' id='dateformat' name='dateformat' class="form-control">
<?php foreach (getDateFormatData(0,Yii::app()->session['adminlang']) as $index=>$dateformatdata): ?>
<option value='<?php echo $index; ?>' <?php if ($aSurveyLanguageSettings[ 'surveyls_dateformat']==$index): ?>
selected='selected'
<?php endif; ?>
>
<?php echo $dateformatdata['dateformat']; ?>
</option>
<?php endforeach; ?>
</select>
</div>
</div>
<!-- Decimal mark -->
<div class="form-group">
<label class="control-label ">
<?php eT("Decimal mark:"); ?>
</label>
<div class="">
<?php
$aRadixPoint=array();
foreach (getRadixPointData() as $index=>$radixptdata)
{
$aRadixPoint[$index]=html_entity_decode($radixptdata['desc']);
}
$this->widget('yiiwheels.widgets.buttongroup.WhButtonGroup', array(
'name' => 'numberformat_'.$aSurveyLanguageSettings['surveyls_language'],
'value'=> $aSurveyLanguageSettings['surveyls_numberformat'] ,
'selectOptions'=>$aRadixPoint,
'htmlOptions' => array(
"style" => "z-index:0"
)
));
?>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12 col-md-6">
<!-- Welcome message -->
<div class="form-group">
<label class=" control-label" for='welcome'>
<?php eT("Welcome message:"); ?>
</label>
<div class="">
<div class="htmleditor input-group">
<?php echo CHtml::textArea("welcome",$aSurveyLanguageSettings['surveyls_welcometext'],array('class'=>'form-control','cols'=>'80','rows'=>'15','id'=>"welcome")); ?>
<?php echo getEditor("survey-welc","welcome", "[".gT("Welcome:", "js")."](".$aSurveyLanguageSettings['surveyls_language'].")",$surveyid,'','',$action); ?>
</div>
</div>
</div>
</div>
<div class="col-sm-12 col-md-6">
<!-- End message -->
<div class="form-group">
<label class=" control-label" for='endtext'>
<?php eT("End message:"); ?>
</label>
<div class="">
<div class="htmleditor input-group">
<?php echo CHtml::textArea("endtext",$aSurveyLanguageSettings['surveyls_endtext'],array('class'=>'form-control','cols'=>'80','rows'=>'15','id'=>"endtext")); ?>
<?php echo getEditor("survey-endtext","endtext", "[".gT("End message:", "js")."](".$aSurveyLanguageSettings['surveyls_language'].")",$surveyid,'','',$action); ?>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function(){
$('#surveyls_title').focus();
})
</script>