/
globalSettings_view.php
709 lines (699 loc) · 33.3 KB
/
globalSettings_view.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
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
<?php
$bDemoMode=Yii::app()->getConfig("demoMode");
$sStringDemoMode=$bDemoMode?'*':'';
$sClassDemoMode=$bDemoMode?'demomode':null;
?>
<div class='header ui-widget-header'><?php eT("Global settings"); ?></div>
<div id='tabs'>
<ul>
<li><a href='#overview'><?php eT("Overview & update"); ?></a></li>
<li><a href='#general'><?php eT("General"); ?></a></li>
<li><a href='#email'><?php eT("Email settings"); ?></a></li>
<li><a href='#bounce'><?php eT("Bounce settings"); ?></a></li>
<li><a href='#security'><?php eT("Security"); ?></a></li>
<li><a href='#presentation'><?php eT("Presentation"); ?></a></li>
<li><a href='#language'><?php eT("Language"); ?></a></li>
<li><a href='#interfaces'><?php eT("Interfaces"); ?></a></li>
</ul>
<?php echo CHtml::form(array("admin/globalsettings"), 'post', array('id'=>'frmglobalsettings','name'=>'frmglobalsettings','autocomplete'=>'off'));?>
<div id='overview'>
<?php
// Overview in 2 part : summary and update
// Summary
$sContentSummary= CHtml::openTag('table',array('class'=>'statisticssummary'))
. CHtml::openTag('tr').CHtml::tag('th',array(),gT("Users")).CHtml::tag('td',array(),$usercount).CHtml::closeTag('tr')
. CHtml::openTag('tr').CHtml::tag('th',array(),gT("Surveys")).CHtml::tag('td',array(),$surveycount).CHtml::closeTag('tr')
. CHtml::openTag('tr').CHtml::tag('th',array(),gT("Active surveys")).CHtml::tag('td',array(),$activesurveycount).CHtml::closeTag('tr')
. CHtml::openTag('tr').CHtml::tag('th',array(),gT("Deactivated result tables")).CHtml::tag('td',array(),$deactivatedsurveys).CHtml::closeTag('tr')
. CHtml::openTag('tr').CHtml::tag('th',array(),gT("Active token tables")).CHtml::tag('td',array(),$activetokens).CHtml::closeTag('tr');
if(Yii::app()->getConfig('iFileUploadTotalSpaceMB')>0)
{
$fUsed=calculateTotalFileUploadUsage();
$sContentSummary.= CHtml::openTag('tr').CHtml::tag('th',array(),gT("Used/free space for file uploads")).CHtml::tag('td',array(),sprintf('%01.2F',$fUsed)." MB / ".sprintf('%01.2F',Yii::app()->getConfig('iFileUploadTotalSpaceMB')-$fUsed)).CHtml::closeTag('tr');
}
$sContentSummary.= CHtml::closeTag('table',array('class'=>'statisticssummary'));
$aOverviewSettings=array(
'summary'=>array(
'type'=>'info',
'content'=>$sContentSummary,
),
'phpinfo'=>array(
'type'=>'link',
'label'=>gT('Show PHPInfo'),
'link'=>$this->createUrl('admin/globalsettings',array('sa'=>'showphpinfo')),
'text'=>gT('PHPInfo'),
'htmlOptions'=>array(
'target'=>'blank',
),
),
);
if (!Permission::model()->hasGlobalPermission('superadmin'))
{
unset($aOverviewSettings['phpinfo']);
}
$this->widget('ext.SettingsWidget.SettingsWidget', array(
//'id'=>'summary',
'title'=>gt("System overview"),
//'prefix' => 'globalSettings',
'form' => false,
'formHtmlOptions'=>array(
'class'=>'form-core',
),
'inlist'=>true,
'settings' => $aOverviewSettings,
));
// Update
$aSettingsUpdate=array(
'updatecheckperiod'=>array(
'type'=>'select',
'label'=>gT("Automatically check for updates"),
'options'=>array('0'=>gT("Never"),'1'=>gT("Every day"),'7'=>gT("Every week"),'14'=>gT("Every 2 weeks"),'30'=>gT("Every month")),
'current'=>$thisupdatecheckperiod,
'help'=>CHtml::link(gT("Check now"),$this->createUrl("admin/globalsettings",array('sa'=>"updatecheck")),array("class"=>"btn btn-link"))." ".CHtml::tag("em",array('id'=>"lastupdatecheck"),sprintf(gT("Last check: %s"),$updatelastcheck)),
),
'updatenotification'=>array(
'type'=>'select',
'label'=>gT("Show update notifications"),
'options'=>array('never'=>gT("Never"),'stable'=>gT("For stable versions"),'both'=>gT("For stable and unstable versions")),
'current'=>$sUpdateNotification,
),
);
if (isset($updateavailable) && $updateavailable==1 && is_array($aUpdateVersions))
{
$aSettingsUpdate['updateavailable']=array(
'type'=>'info',
'content'=>CHtml::tag('strong',array(),gT('The following LimeSurvey updates are available:')),
);
$aUpdateAvailable=array();
foreach($aUpdateVersions as $aUpdateVersion)
{
$sName="update_{$aUpdateVersion['versionnumber']}_{$aUpdateVersion['build']}";
$sLabel="{$aUpdateVersion['versionnumber']} ({$aUpdateVersion['build']}) ".($aUpdateVersion['branch']!='master'?gT('(unstable)'):gT('(stable)'));
$sDownloadLink=$aUpdateVersion['branch']!='master' ? "http://www.limesurvey.org/en/unstable-release/viewcategory/26-unstable-releases" : "http://www.limesurvey.org/en/stable-release";
$aSettingsUpdate[$sName]=array(
'type'=>'link',
'label'=>$sLabel,
'text'=>gt("Use ComfortUpdate"),
'link'=>$this->createUrl("admin/update",array('sa'=>'index','build'=>$aUpdateVersion['build'])),// Build is not needed
'htmlOptions'=>array(
'class'=>'button',
'target'=>'_top',
),
'help'=>sprintf(gT('You can %s and % manually or use the %s'),
CHtml::link(gT("download"),$sDownloadLink,array('target'=>'_blank')),
CHtml::link(gT("update"),"http://manual.limesurvey.org/Upgrading_from_a_previous_version",array('target'=>'_blank')),
CHtml::link(gT("3-Click ComfortUpdate"),"http://manual.limesurvey.org/ComfortUpdate",array('target'=>'_blank'))
),
);
}
}
elseif(isset($updateinfo['errorcode']))
{
$aSettingsUpdate['updateavailable']=array(
'type'=>'info',
'label'=>sprintf(gT('There was an error on update check (%s)'),$updateinfo['errorcode']),
'content'=>CHtml::tag('pre',array(),strip_tags($updateinfo['errorhtml'])),
);
}
elseif ($updatable)
{
$aSettingsUpdate['updateavailable']=array(
'type'=>'info',
'content'=>gT('There is currently no newer LimeSurvey version available.'),
);
}
else
{
$aSettingsUpdate['updateavailable']=array(
'type'=>'info',
'content'=>sprintf(gT('This is an unstable version and cannot be updated using ComfortUpdate. Please check %s regularly for a newer version.'),CHtml::link(gT("our website"),"http://www.limesurvey.org")),
);
}
$this->widget('ext.SettingsWidget.SettingsWidget', array(
//'id'=>'update',
'title'=>gt("Updates"),
//'prefix' => 'globalSettings',
'form' => false,
'formHtmlOptions'=>array(
'class'=>'form-core',
),
'inlist'=>true,
'settings' => $aSettingsUpdate,
));
?>
</div>
<?php
// General seetings in one part
// Preparing array
$aTemplateNames=array_keys(getTemplateList());
$aAdminThemes=array_keys(getAdminThemeList());
$dateformatdata=getDateFormatData(Yii::app()->session['dateformat']);
$aGeneralSettings=array(
'info_general'=>array(
// A place to put information : alternate solution use array_slice/array_push ?
),
'sitename'=>array(
'type'=>'string',
'label'=>gT("Site name").$sStringDemoMode,
'labelOptions'=>array(
'class'=>$sClassDemoMode,
),
'current'=>getGlobalSetting('sitename'),
'htmlOptions'=>array(
'readonly'=>$bDemoMode,
),
),
'defaulttemplate'=>array(
'type'=>'select',
'label'=>gT('Default template').$sStringDemoMode,
'labelOptions'=>array(
'class'=>$sClassDemoMode,
),
'htmlOptions'=>array(
'readonly'=>$bDemoMode,
),
'options'=>array_combine($aTemplateNames,$aTemplateNames),
'current'=>Template::templateNameFilter(getGlobalSetting('defaulttemplate')),
),
'admintheme'=>array(
'type'=>'select',
'label'=>gT('Administration template').$sStringDemoMode,
'labelOptions'=>array(
'class'=>$sClassDemoMode,
),
'htmlOptions'=>array(
'readonly'=>$bDemoMode,
),
'options'=>array_combine($aAdminThemes,$aAdminThemes),
'current'=>getGlobalSetting('admintheme'),
),
'defaulthtmleditormode'=>array(
'type'=>'select',
'label'=>gT('Default HTML editor mode').$sStringDemoMode,
'labelOptions'=>array(
'class'=>$sClassDemoMode,
),
'htmlOptions'=>array(
'readonly'=>$bDemoMode,
),
'options'=>array(
'none'=>gT("No HTML editor"),
'inline'=>gT("Inline HTML editor (default)"),
'popup'=>gT("Popup HTML editor")
),
'current'=>getGlobalSetting('defaulthtmleditormode'),
),
'defaultquestionselectormode'=>array(
'type'=>'select',
'label'=>gT('Question type selector').$sStringDemoMode,
'labelOptions'=>array(
'class'=>$sClassDemoMode,
),
'htmlOptions'=>array(
'readonly'=>$bDemoMode,
),
'options'=>array(
'default'=>gT("Full selector (default)"),
'none'=>gT("Simple selector"),
),
'current'=>getGlobalSetting('defaultquestionselectormode'),
),
'defaulttemplateeditormode'=>array(
'type'=>'select',
'label'=>gT('Template editor').$sStringDemoMode,
'labelOptions'=>array(
'class'=>$sClassDemoMode,
),
'htmlOptions'=>array(
'readonly'=>$bDemoMode,
),
'options'=>array(
'default'=>gT("Full template editor (default)"),
'none'=>gT("Simple template editor"),
),
'current'=>getGlobalSetting('defaulttemplateeditormode'),
),
'timeadjust'=>array(
'type'=>'float',
'label'=>gt("Time difference (in hours)"),
'current'=>str_replace(array('+',' hours',' minutes'),array('','',''),getGlobalSetting('timeadjust'))/60,
'help'=>sprintf(gT("Server time: %s - Corrected time: %s"),convertDateTimeFormat(date('Y-m-d H:i:s'),'Y-m-d H:i:s',$dateformatdata['phpdate'].' H:i'),convertDateTimeFormat(dateShift(date("Y-m-d H:i:s"), 'Y-m-d H:i:s', getGlobalSetting('timeadjust')),'Y-m-d H:i:s',$dateformatdata['phpdate'].' H:i'))
),
'iSessionExpirationTime'=>array(
// A place to put iSessionExpirationTime if needed
),
'GeoNamesUsername'=>array(
'type'=>'string',
'label'=>'GeoNames username for API',
'current'=>getGlobalSetting('GeoNamesUsername'),
'htmlOptions'=>array(
'size'=>'35',
)
),
'googleMapsAPIKey'=>array(
'type'=>'string',
'label'=>'Google Maps API key',
'current'=>getGlobalSetting('googleMapsAPIKey'),
'htmlOptions'=>array(
'size'=>'35',
)
),
'ipInfoDbAPIKey'=>array(
'type'=>'string',
'label'=>'IP Info DB API Key',
'current'=>getGlobalSetting('ipInfoDbAPIKey'),
'htmlOptions'=>array(
'size'=>'35',
)
),
'googleanalyticsapikey'=>array(
'type'=>'string',
'label'=>'Google Analytics API key',
'current'=>getGlobalSetting('googleanalyticsapikey'),
'htmlOptions'=>array(
'size'=>'35',
)
),
'googletranslateapikey'=>array(
'type'=>'string',
'label'=>'Google Translate API key',
'current'=>getGlobalSetting('googletranslateapikey'),
'htmlOptions'=>array(
'size'=>'35',
)
),
);
if(isset(Yii::app()->session->connectionID))
{
$aGeneralSettings["iSessionExpirationTime"] = array(
'type'=>'int',
'label'=>'Session lifetime for surveys (seconds)',
'current'=>getGlobalSetting('iSessionExpirationTime'),
'htmlOptions'=>array(
'style'=>'width:10em',
'min'=>1,
)
);
}
if($bDemoMode)
{
$aGeneralSettings['info_general']=array(
'type'=>'info',
'class'=>'alert',
'label'=>gt("Note"),
'content'=>gt("Demo mode is activated. Some settings can't be changed."),
);
}
$this->widget('ext.SettingsWidget.SettingsWidget', array(
'id'=>'general',
//'title'=>gt("General"),
//'prefix' => 'globalSettings',
'form' => false,
'formHtmlOptions'=>array(
'class'=>'form-core',
),
'inlist'=>true,
'settings' => $aGeneralSettings,
));
?>
<div id='email'>
<?php
// Email in 2 part : User and SMTP
$this->widget('ext.SettingsWidget.SettingsWidget', array(
//'id'=>'email',
//'title'=>gt("SMTP settings"),
//'prefix' => 'globalSettings',
'form' => false,
'formHtmlOptions'=>array(
'class'=>'form-core',
),
'inlist'=>true,
'settings' => array(
'siteadminemail'=>array(
'type'=>'email',
'label'=>gt("Default site admin email"),
'current'=>getGlobalSetting('siteadminemail'),
'htmlOptions'=>array(
'size'=>'50',
),
),
'siteadminname'=>array(
'type'=>'string',
'label'=>gt("Administrator name"),
'current'=>getGlobalSetting('siteadminname'),
'htmlOptions'=>array(
'size'=>'50',
),
),
),
));
$this->widget('ext.SettingsWidget.SettingsWidget', array(
'title'=>gt("SMTP configuration"),
'form' => false,
'formHtmlOptions'=>array(
'class'=>'form-core',
),
'inlist'=>true,
'settings' => array(
'emailmethod'=>array(
'type'=>'select',
'label'=>gt("Email method"),
'options'=>array(
'mail'=>gT("PHP (default)"),'smtp'=>gT("SMTP"),'sendmail'=>gT("Sendmail"),'qmail'=>gT("Qmail"),
),
'current'=>getGlobalSetting('emailmethod'),
),
'emailsmtphost'=>array(
'type'=>'string',
'class'=>array(
'smtp-on',
),
'label'=>gt("SMTP host"),
'current'=>getGlobalSetting('emailsmtphost'),
'htmlOptions'=>array(
'size'=>'50',
),
'help'=>gT("Enter your hostname and port, e.g.: my.smtp.com:25"),
),
'emailsmtpuser'=>array(
'type'=>'string',
'class'=>array(
'smtp-on',
),
'label'=>gt("SMTP username"),
'current'=>getGlobalSetting('emailsmtpuser'),
'htmlOptions'=>array(
'size'=>'50',
),
),
'emailsmtppassword'=>array(
'type'=>'password',
'class'=>array(
'smtp-on',
),
'label'=>gt("SMTP password"),
'current'=>getGlobalSetting('emailsmtppassword'),
'htmlOptions'=>array(
'size'=>'50',
),
),
'emailsmtpssl'=>array(
'type'=>'select',
'class'=>array(
'smtp-on',
),
'label'=>gt("SMTP SSL/TLS"),
'options'=>array(''=>gT("Off"),'ssl'=>gT("SSL"),'tls'=>gT("TLS")),
'current'=>getGlobalSetting('emailsmtpssl'),
'htmlOptions'=>array(
'size'=>'50',
),
),
'emailsmtpdebug'=>array(
'type'=>'select',
'label'=>gt("SMTP debug mode"),
'options'=>array('0'=>gT("Off"),'1'=>gT("On errors"),'2'=>gT("Always")),
'current'=>getGlobalSetting('emailsmtpdebug'),
'htmlOptions'=>array(
'size'=>'50',
),
),
'maxemails'=>array(
'type'=>'int',
'label'=>gt("Email batch size"),
'current'=>getGlobalSetting('maxemails'),
'htmlOptions'=>array(
'min'=>'1',
'style'=>'width:5em',
),
),
),
));
?>
</div>
<?php
// Bounce settings in one part
$this->widget('ext.SettingsWidget.SettingsWidget', array(
'id'=>'bounce',
//'title'=>gt("Bounce settings"),
'form' => false,
'formHtmlOptions'=>array(
'class'=>'form-core',
),
'inlist'=>true,
'settings' => array(
'siteadminbounce'=>array(
'type'=>'string',
'label'=>gT("Default site bounce email"),
'current'=>getGlobalSetting('siteadminbounce'),
),
'bounceaccounttype'=>array(
'type'=>'select',
'label'=>gT("Server type"),
'options'=>array('off'=>gT("Off"),'IMAP'=>gT("IMAP"),'POP'=>gT("POP")),
'current'=>getGlobalSetting('bounceaccounttype'),
),
'bounceaccounthost'=>array(
'type'=>'string',
'label'=>gT("Server name & port"),
'current'=>getGlobalSetting('bounceaccounthost'),
'help'=>sprintf(gt("Enter your hostname and port, e.g.: %s"),"imap.example.com:995"),
),
'bounceaccountuser'=>array(
'type'=>'string',
'label'=>gT("Bounce account user"),
'current'=>getGlobalSetting('bounceaccountuser'),
),
'bounceaccountpass'=>array(
'type'=>'password',
'label'=>gT("Bounce account password"),
'current'=>'enteredpassword', //getGlobalSetting('bounceaccountpass'),
),
'bounceencryption'=>array(
'type'=>'select',
'label'=>gT("Encryption type"),
'options'=>array('off'=>gT("Off"),'SSL'=>gT("SSL"),'TLS'=>gT("TLS")),
'current'=>getGlobalSetting('bounceencryption'),
),
)
));
?>
<?php
// Security settings in one part
if(getGlobalSetting('force_ssl')!='on')
{
$sForceSslHelp = CHtml::tag("div",array('class'=>'alert'),sprintf(gT('Warning: Before turning on HTTPS,%s .'),CHtml::link(gt("check if this link works"),array("admin/globalsettings"),array('title'=>gT('Test if your server has SSL enabled by clicking on this link.')))))
. CHtml::tag("div",array('class'=>'alert alert-error'),gT("If the link does not work and you turn on HTTPS, LimeSurvey will break and you won't be able to access it."));
}
else
{
$sForceSslHelp=null;
}
$this->widget('ext.SettingsWidget.SettingsWidget', array(
'id'=>'security',
'form' => false,
'formHtmlOptions'=>array(
'class'=>'form-core',
),
'settings'=>array(
'surveyPreview_require_Auth'=>array(
'type'=>'select',
'label'=>gt("Survey preview only for administration users"),
'options'=>array('1'=>gT("Yes"),'0'=>gT("No")),
'current'=>getGlobalSetting('surveyPreview_require_Auth'),
),
'filterxsshtml'=>array(
'type'=>'select',
'label'=>gt("Survey preview only for administration users").$sStringDemoMode,
'labelOptions'=>array(
'class'=>$sClassDemoMode,
),
'options'=>array('1'=>gT("Yes"),'0'=>gT("No")),
'current'=>getGlobalSetting('surveyPreview_require_Auth'),
'htmlOptions'=>array(
'readonly'=>$bDemoMode,
),
'help'=>gT("XSS filtering is always disabled for the superadministrator.")
),
'usercontrolSameGroupPolicy'=>array(
'type'=>'select',
'label'=>gt("Group member can only see own group"),
'options'=>array('1'=>gT("Yes"),'0'=>gT("No")),
'current'=>getGlobalSetting('usercontrolSameGroupPolicy'),
),
'force_ssl'=>array(
'type'=>'select',
'label'=>gt("Force HTTPS"),
'options'=>array('neither'=>gT("Don't force on or off"),'on'=>gT("On"),'off'=>gT('Off')),
'current'=>getGlobalSetting('force_ssl'),
'help'=>$sForceSslHelp,
),
),
));
?>
<?php
// Survey presentation settings in one part
$this->widget('ext.SettingsWidget.SettingsWidget', array(
'id'=>'presentation',
'form' => false,
'formHtmlOptions'=>array(
'class'=>'form-core',
),
'settings'=>array(
'shownoanswer'=>array(
'type'=>'select',
'label'=>gT("Show 'no answer' option for non-mandatory questions"),
'options'=>array("1"=>gT('Yes'),"0"=>gT('No'),"2"=>gT('Survey admin can choose')),
'current'=>getGlobalSetting('shownoanswer'),
),
'repeatheadings'=>array(
'type'=>'int',
'label'=>gT("Repeating headings in array questions every X subquestions"),
'current'=>getGlobalSetting('repeatheadings'),
'htmlOptions'=>array(
'style'=>'width:5em',
'min'=>0,
),
),
'showxquestions'=>array(
'type'=>'select',
'label'=>gT('Show "There are X questions in this survey"'),
'options'=>array('choose'=>gT('Survey admin can choose'),'show'=>gT('Yes'),'hide'=>gT('No')),
'current'=>getGlobalSetting('showxquestions'),
),
'showgroupinfo'=>array(
'type'=>'select',
'label'=>gT('Show question group name and/or description'),
'options'=>array('choose'=>gT('Survey admin can choose'),'show'=>gT('Show both'),'name'=>gT('Show group name only'),'description'=>gT('Show group description only'),'none'=>gT('Hide both')),
'current'=>getGlobalSetting('showgroupinfo'),
),
'showqnumcode'=>array(
'type'=>'select',
'label'=>gT('Show question number and/or question code'),
'options'=>array('choose'=>gT('Survey admin can choose'),'show'=>gT('Show both'),'number'=>gT('Show question number only'),'code'=>gT('Show question code only'),'none'=>gT('Hide both')),
'current'=>getGlobalSetting('showqnumcode'),
),
'pdffontsize'=>array(
'type'=>'int',
'label'=>gT("Font size of answers export PDFs"),
'current'=>getGlobalSetting('pdffontsize'),
'htmlOptions'=>array(
'size'=>'5',
),
),
'pdfshowheader'=>array(
'type'=>'select',
'label'=>gT("Show header in answers export PDFs?"),
'options'=>array(
'Y' => gT("Yes"),
'N' => gT("No"),
),
'current'=>getGlobalSetting('pdfshowheader'),
),
'pdflogowidth'=>array(
'type'=>'int',
'label'=>gT("Wigth of PDF header logo"),
'current'=>getGlobalSetting('pdflogowidth'),
),
'pdfheadertitle'=>array(
'type'=>'string',
'label'=>gT("PDF header title (if empty, site name will be used)"),
'current'=>getGlobalSetting('pdfheadertitle'),
'htmlOptions'=>array(
'maxlength'=>'256',
),
),
'pdfheaderstring'=>array(
'type'=>'string',
'label'=>gT("PDF header string (if empty, survey name will be used)"),
'current'=>getGlobalSetting('pdfheaderstring'),
'htmlOptions'=>array(
'maxlength'=>'256',
),
),
)
));
?>
<?php
// Language settings
$aLanguages=array();
foreach (getLanguageData(true) as $sLanguage=>$aLanguage)
{
$aLanguages[$sLanguage]="{$aLanguage['description']} (".html_entity_decode($aLanguage['nativedescription'], ENT_NOQUOTES, 'UTF-8').")";
}
$aAvailableLang=getLanguageDataRestricted ();
$this->widget('ext.SettingsWidget.SettingsWidget', array(
'id'=>'language',
'form' => false,
'formHtmlOptions'=>array(
'class'=>'form-core',
),
'settings'=>array(
'defaultlang'=>array(
'type'=>'select',
'label'=>gT("Default site language").$sStringDemoMode,
'labelOptions'=>array(
'class'=>$sClassDemoMode,
),
'options'=>$aLanguages,
'current'=>getGlobalSetting('defaultlang'),
),
'restrictToLanguages'=>array(
'type'=>'select',
'label'=>gT("Available languages").$sStringDemoMode,
'options'=>$aLanguages,
'current'=>array_keys(getLanguageDataRestricted ()),
'htmlOptions'=>array(
'multiple'=>true,
),
'selectOptions'=>array(
'width'=>'100%',
),
),
),
));
?>
<?php
// Remote control
$this->widget('ext.SettingsWidget.SettingsWidget', array(
'id'=>'interfaces',
'form' => false,
'formHtmlOptions'=>array(
'class'=>'form-core',
),
'settings'=>array(
'RPCInterface'=>array(
'type'=>'select',
'label'=>gT("RPC interface enabled"),
'options'=>array('off'=>gT("Off"),'json'=>gT("JSON-RPC"),'xml'=>gT("XML-RPC")),
'current'=>getGlobalSetting('RPCInterface'),
),
'RPCurl'=>array(
'type'=>'info',
'label'=>gt("URL of API"),
'content'=>CHtml::tag('code',array(),$this->createAbsoluteUrl("admin/remotecontrol")),
),
'rpc_publish_api'=>array(
'type'=>'select',
'label'=>gT("Publish API on /admin/remotecontrol"),
'options'=>array('0'=>gT("No"),'1'=>gT("Yes")),
'current'=>getGlobalSetting('rpc_publish_api'),
),
)
));
?>
<div class="hidden hide" id="submitglobalbutton">
<p>
<?php if(Yii::app()->session['refurl']) { ?>
<button type="submit" name="action" value='savequit'><?php eT("Save and quit"); ?></button>
<?php } ?>
<button type="submit" name="action" value='save'><?php eT("Save"); ?></button>
</p>
</div>
</form>
</div>
<div data-copy="submitglobalbutton"></div>
<?php if (Yii::app()->getConfig("demoMode")==true)
{ ?>
<p><?php eT("Note: Demo mode is activated. Marked (*) settings can't be changed."); ?></p>
<?php } ?>