MDL-12598 use user context instead of personal; merged from MOODLE_19_STABLE
[moodle.git] / admin / settings / appearance.php
CommitLineData
1ea1bcb3 1<?php // $Id$
2
3// This file defines settingpages and externalpages under the "appearance" category
4
a559f630 5if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
6
7
1ea1bcb3 8$ADMIN->add('appearance', new admin_category('themes', get_string('themes')));
9// "themesettings" settingpage
8f8ed475 10$temp = new admin_settingpage('themesettings', get_string('themesettings', 'admin'));
1ea1bcb3 11$temp->add(new admin_setting_configtext('themelist', get_string('themelist', 'admin'), get_string('configthemelist','admin'), '', PARAM_NOTAGS));
12$temp->add(new admin_setting_configcheckbox('allowuserthemes', get_string('allowuserthemes', 'admin'), get_string('configallowuserthemes', 'admin'), 0));
13$temp->add(new admin_setting_configcheckbox('allowcoursethemes', get_string('allowcoursethemes', 'admin'), get_string('configallowcoursethemes', 'admin'), 0));
a907c540 14$temp->add(new admin_setting_configcheckbox('allowcategorythemes', get_string('allowcategorythemes', 'admin'), get_string('configallowcategorythemes', 'admin'), 0));
1ea1bcb3 15$temp->add(new admin_setting_configcheckbox('allowuserblockhiding', get_string('allowuserblockhiding', 'admin'), get_string('configallowuserblockhiding', 'admin'), 1));
16$temp->add(new admin_setting_configcheckbox('showblocksonmodpages', get_string('showblocksonmodpages', 'admin'), get_string('configshowblocksonmodpages', 'admin'), 0));
3b27b0fe 17$temp->add(new admin_setting_configselect('hideactivitytypenavlink', get_string('hideactivitytypenavlink', 'admin'), get_string('confighideactivitytypenavlink', 'admin'), 0,
d91f99a6 18array(
19 0 => get_string('hidefromnone', 'admin'),
20 1 => get_string('hidefromstudents', 'admin'),
21 2 => get_string('hidefromall', 'admin')
22 )));
1ea1bcb3 23$ADMIN->add('themes', $temp);
24$ADMIN->add('themes', new admin_externalpage('themeselector', get_string('themeselector','admin'), $CFG->wwwroot . '/theme/index.php'));
25
c7dd2550 26# for CALENDAR_TF_12 and CALENDAR_TF_24 ...
27require_once($CFG->dirroot . '/calendar/lib.php');
1ea1bcb3 28
db51ddc5 29// calendar
3b904bc9 30$temp = new admin_settingpage('calendar', get_string('calendarsettings','admin'));
31$temp->add(new admin_setting_special_adminseesall());
c7dd2550 32$temp->add(new admin_setting_configselect('calendar_site_timeformat', get_string('pref_timeformat', 'calendar'), get_string('explain_site_timeformat', 'calendar'), '0',
33array( 0 => get_string('default', 'calendar'),
34 CALENDAR_TF_12 => get_string('timeformat_12', 'calendar'),
35 CALENDAR_TF_24 => get_string('timeformat_24', 'calendar')
36 )));
3b904bc9 37$temp->add(new admin_setting_configselect('calendar_startwday', get_string('configstartwday', 'admin'), get_string('helpstartofweek', 'admin'), 0,
38array(
39 0 => get_string('sunday', 'calendar'),
40 1 => get_string('monday', 'calendar'),
41 2 => get_string('tuesday', 'calendar'),
42 3 => get_string('wednesday', 'calendar'),
43 4 => get_string('thursday', 'calendar'),
44 5 => get_string('friday', 'calendar'),
45 6 => get_string('saturday', 'calendar')
46 )));
47$temp->add(new admin_setting_special_calendar_weekend());
48$temp->add(new admin_setting_configtext('calendar_lookahead',get_string('configlookahead','admin'),get_string('helpupcominglookahead', 'admin'),21,PARAM_INT));
49$temp->add(new admin_setting_configtext('calendar_maxevents',get_string('configmaxevents','admin'),get_string('helpupcomingmaxevents', 'admin'),10,PARAM_INT));
50$ADMIN->add('appearance', $temp);
1ea1bcb3 51
52// "filtersettings" settingpage
53$temp = new admin_settingpage('filtersettings', get_string('filtersettings', 'admin'));
54$temp->add(new admin_setting_configselect('cachetext', get_string('cachetext', 'admin'), get_string('configcachetext', 'admin'), 60, array(604800 => get_string('numdays','',7),
55 86400 => get_string('numdays','',1),
56 43200 => get_string('numhours','',12),
57 10800 => get_string('numhours','',3),
58 7200 => get_string('numhours','',2),
59 3600 => get_string('numhours','',1),
60 2700 => get_string('numminutes','',45),
61 1800 => get_string('numminutes','',30),
62 900 => get_string('numminutes','',15),
63 600 => get_string('numminutes','',10),
64 540 => get_string('numminutes','',9),
65 480 => get_string('numminutes','',8),
66 420 => get_string('numminutes','',7),
67 360 => get_string('numminutes','',6),
68 300 => get_string('numminutes','',5),
69 240 => get_string('numminutes','',4),
70 180 => get_string('numminutes','',3),
71 120 => get_string('numminutes','',2),
72 60 => get_string('numminutes','',1),
73 30 => get_string('numseconds','',30),
74 0 => get_string('no'))));
75$temp->add(new admin_setting_configselect('filteruploadedfiles', get_string('filteruploadedfiles', 'admin'), get_string('configfilteruploadedfiles', 'admin'), 0, array('0' => get_string('none'),
76 '1' => get_string('allfiles'),
61240489 77 '2' => get_string('htmlfilesonly'))));
1ea1bcb3 78$temp->add(new admin_setting_configcheckbox('filtermatchoneperpage', get_string('filtermatchoneperpage', 'admin'), get_string('configfiltermatchoneperpage', 'admin'), 0));
79$temp->add(new admin_setting_configcheckbox('filtermatchonepertext', get_string('filtermatchonepertext', 'admin'), get_string('configfiltermatchonepertext', 'admin'), 0));
80$temp->add(new admin_setting_configcheckbox('filterall', get_string('filterall', 'admin'), get_string('configfilterall', 'admin'), 0));
81$ADMIN->add('appearance', $temp);
82
83
84
85
86
87// "htmleditor" settingpage
88$temp = new admin_settingpage('htmleditor', get_string('htmleditor', 'admin'));
89$temp->add(new admin_setting_configcheckbox('htmleditor', get_string('usehtmleditor', 'admin'), get_string('confightmleditor','admin'), 1));
90$temp->add(new admin_setting_configtext('editorbackgroundcolor', get_string('editorbackgroundcolor', 'admin'), get_string('edhelpbgcolor'), '#ffffff', PARAM_NOTAGS));
91$temp->add(new admin_setting_configtext('editorfontfamily', get_string('editorfontfamily', 'admin'), get_string('edhelpfontfamily'), 'Trebuchet MS,Verdana,Arial,Helvetica,sans-serif', PARAM_NOTAGS));
92$temp->add(new admin_setting_configtext('editorfontsize', get_string('editorfontsize', 'admin'), get_string('edhelpfontsize'), '', PARAM_NOTAGS));
93$temp->add(new admin_setting_special_editorfontlist());
94$temp->add(new admin_setting_configcheckbox('editorkillword', get_string('editorkillword', 'admin'), get_string('edhelpcleanword'), 1));
95if (!empty($CFG->aspellpath)) { // make aspell settings disappear if path isn't set
96 $temp->add(new admin_setting_configcheckbox('editorspelling', get_string('editorspelling', 'admin'), get_string('editorspellinghelp', 'admin'), 0));
97 $temp->add(new admin_setting_special_editordictionary());
98}
99$temp->add(new admin_setting_special_editorhidebuttons());
93c61c18 100$temp->add(new admin_setting_emoticons());
1ea1bcb3 101$ADMIN->add('appearance', $temp);
102
103// "documentation" settingpage
104$temp = new admin_settingpage('documentation', get_string('moodledocs'));
105$temp->add(new admin_setting_configtext('docroot', get_string('docroot', 'admin'), get_string('configdocroot', 'admin'), 'http://docs.moodle.org', PARAM_URL));
106$temp->add(new admin_setting_configcheckbox('doctonewwindow', get_string('doctonewwindow', 'admin'), get_string('configdoctonewwindow', 'admin'), 0));
107$ADMIN->add('appearance', $temp);
108
109$temp = new admin_settingpage('mymoodle', get_string('mymoodle', 'admin'));
110$temp->add(new admin_setting_configcheckbox('mymoodleredirect', get_string('mymoodleredirect', 'admin'), get_string('configmymoodleredirect', 'admin'), 0));
111$ADMIN->add('appearance', $temp);
112
d42c64ba 113// new CFG variable for coursemanager (what roles to display)
114$temp = new admin_settingpage('coursemanager', get_string('coursemanager', 'admin'));
115$temp->add(new admin_setting_special_coursemanager());
116$ADMIN->add('appearance', $temp);
5a412dbf 117
36832f4d 118$ADMIN->add('appearance', new admin_externalpage('stickyblocks', get_string('stickyblocks', 'admin'), "$CFG->wwwroot/$CFG->admin/stickyblocks.php"));
119
501e725e 120$temp = new admin_settingpage('ajax', get_string('ajaxuse'));
121$temp->add(new admin_setting_configcheckbox('enableajax', get_string('enableajax', 'admin'), get_string('configenableajax', 'admin'), 0));
122$ADMIN->add('appearance', $temp);
1c63e174 123
124// link to tag management interface
125$ADMIN->add('appearance', new admin_externalpage('managetags', get_string('managetags', 'tag'), "$CFG->wwwroot/tag/manage.php"));
a559f630 126
127} // end of speedup
1ea1bcb3 128?>