MDL-26869 admin: Added page to view admin categories and included in navigation with...
[moodle.git] / admin / settings / appearance.php
CommitLineData
11b749ca 1<?php
1ea1bcb3 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
e106013f 7 $ADMIN->add('appearance', new admin_category('themes', new lang_string('themes')));
220a90c5 8 // "themesettings" settingpage
e106013f
SH
9 $temp = new admin_settingpage('themesettings', new lang_string('themesettings', 'admin'));
10 $temp->add(new admin_setting_configtext('themelist', new lang_string('themelist', 'admin'), new lang_string('configthemelist','admin'), '', PARAM_NOTAGS));
11 $setting = new admin_setting_configcheckbox('themedesignermode', new lang_string('themedesignermode', 'admin'), new lang_string('configthemedesignermode', 'admin'), 0);
78946b9b
PS
12 $setting->set_updatedcallback('theme_reset_all_caches');
13 $temp->add($setting);
e106013f
SH
14 $temp->add(new admin_setting_configcheckbox('allowuserthemes', new lang_string('allowuserthemes', 'admin'), new lang_string('configallowuserthemes', 'admin'), 0));
15 $temp->add(new admin_setting_configcheckbox('allowcoursethemes', new lang_string('allowcoursethemes', 'admin'), new lang_string('configallowcoursethemes', 'admin'), 0));
16 $temp->add(new admin_setting_configcheckbox('allowcategorythemes', new lang_string('allowcategorythemes', 'admin'), new lang_string('configallowcategorythemes', 'admin'), 0));
17 $temp->add(new admin_setting_configcheckbox('allowthemechangeonurl', new lang_string('allowthemechangeonurl', 'admin'), new lang_string('configallowthemechangeonurl', 'admin'), 0));
18 $temp->add(new admin_setting_configcheckbox('allowuserblockhiding', new lang_string('allowuserblockhiding', 'admin'), new lang_string('configallowuserblockhiding', 'admin'), 1));
19 $temp->add(new admin_setting_configcheckbox('allowblockstodock', new lang_string('allowblockstodock', 'admin'), new lang_string('configallowblockstodock', 'admin'), 1));
20 $temp->add(new admin_setting_configtextarea('custommenuitems', new lang_string('custommenuitems', 'admin'), new lang_string('configcustommenuitems', 'admin'), '', PARAM_TEXT, '50', '10'));
21 $temp->add(new admin_setting_configcheckbox('enabledevicedetection', new lang_string('enabledevicedetection', 'admin'), new lang_string('configenabledevicedetection', 'admin'), 1));
22 $temp->add(new admin_setting_devicedetectregex('devicedetectregex', new lang_string('devicedetectregex', 'admin'), new lang_string('devicedetectregex_desc', 'admin'), ''));
220a90c5 23 $ADMIN->add('themes', $temp);
e106013f 24 $ADMIN->add('themes', new admin_externalpage('themeselector', new lang_string('themeselector','admin'), $CFG->wwwroot . '/theme/index.php'));
220a90c5 25
78946b9b
PS
26 // settings for each theme
27 foreach (get_plugin_list('theme') as $theme => $themedir) {
28 $settings_path = "$themedir/settings.php";
29 if (file_exists($settings_path)) {
e106013f 30 $settings = new admin_settingpage('themesetting'.$theme, new lang_string('pluginname', 'theme_'.$theme));
78946b9b 31 include($settings_path);
dbf9e4ba
PS
32 if ($settings) {
33 $ADMIN->add('themes', $settings);
34 }
78946b9b
PS
35 }
36 }
37
03d9401e 38
220a90c5 39 // calendar
e106013f 40 $temp = new admin_settingpage('calendar', new lang_string('calendarsettings','admin'));
220a90c5 41 $temp->add(new admin_setting_special_adminseesall());
42 //this is hacky because we do not want to include the stuff from calendar/lib.php
e106013f
SH
43 $temp->add(new admin_setting_configselect('calendar_site_timeformat', new lang_string('pref_timeformat', 'calendar'),
44 new lang_string('explain_site_timeformat', 'calendar'), '0',
45 array('0' => new lang_string('default', 'calendar'),
46 '%I:%M %p' => new lang_string('timeformat_12', 'calendar'),
47 '%H:%M' => new lang_string('timeformat_24', 'calendar'))));
48 $temp->add(new admin_setting_configselect('calendar_startwday', new lang_string('configstartwday', 'admin'), new lang_string('helpstartofweek', 'admin'), 0,
220a90c5 49 array(
e106013f
SH
50 0 => new lang_string('sunday', 'calendar'),
51 1 => new lang_string('monday', 'calendar'),
52 2 => new lang_string('tuesday', 'calendar'),
53 3 => new lang_string('wednesday', 'calendar'),
54 4 => new lang_string('thursday', 'calendar'),
55 5 => new lang_string('friday', 'calendar'),
56 6 => new lang_string('saturday', 'calendar')
220a90c5 57 )));
58 $temp->add(new admin_setting_special_calendar_weekend());
68ec4a27
ARN
59 $options = array();
60 for ($i=1; $i<=99; $i++) {
61 $options[$i] = $i;
62 }
e106013f 63 $temp->add(new admin_setting_configselect('calendar_lookahead',new lang_string('configlookahead','admin'),new lang_string('helpupcominglookahead', 'admin'),21,$options));
68ec4a27
ARN
64 $options = array();
65 for ($i=1; $i<=20; $i++) {
66 $options[$i] = $i;
67 }
e106013f
SH
68 $temp->add(new admin_setting_configselect('calendar_maxevents',new lang_string('configmaxevents','admin'),new lang_string('helpupcomingmaxevents', 'admin'),10,$options));
69 $temp->add(new admin_setting_configcheckbox('enablecalendarexport', new lang_string('enablecalendarexport', 'admin'), new lang_string('configenablecalendarexport','admin'), 1));
70 $temp->add(new admin_setting_configtext('calendar_exportsalt', new lang_string('calendarexportsalt','admin'), new lang_string('configcalendarexportsalt', 'admin'), random_string(60)));
220a90c5 71 $ADMIN->add('appearance', $temp);
72
cae83708 73 // blog
e106013f
SH
74 $temp = new admin_settingpage('blog', new lang_string('blog','blog'));
75 $temp->add(new admin_setting_configcheckbox('useblogassociations', new lang_string('useblogassociations', 'blog'), new lang_string('configuseblogassociations','blog'), 1));
76 $temp->add(new admin_setting_bloglevel('bloglevel', new lang_string('bloglevel', 'admin'), new lang_string('configbloglevel', 'admin'), 4, array(BLOG_GLOBAL_LEVEL => new lang_string('worldblogs','blog'),
77 BLOG_SITE_LEVEL => new lang_string('siteblogs','blog'),
78 BLOG_USER_LEVEL => new lang_string('personalblogs','blog'),
79 0 => new lang_string('disableblogs','blog'))));
80 $temp->add(new admin_setting_configcheckbox('useexternalblogs', new lang_string('useexternalblogs', 'blog'), new lang_string('configuseexternalblogs','blog'), 1));
81 $temp->add(new admin_setting_configselect('externalblogcrontime', new lang_string('externalblogcrontime', 'blog'), new lang_string('configexternalblogcrontime', 'blog'), 86400,
82 array(43200 => new lang_string('numhours', '', 12),
83 86400 => new lang_string('numhours', '', 24),
84 172800 => new lang_string('numdays', '', 2),
85 604800 => new lang_string('numdays', '', 7))));
86 $temp->add(new admin_setting_configtext('maxexternalblogsperuser', new lang_string('maxexternalblogsperuser','blog'), new lang_string('configmaxexternalblogsperuser', 'blog'), 1));
87 $temp->add(new admin_setting_configcheckbox('blogusecomments', new lang_string('enablecomments', 'admin'), new lang_string('configenablecomments', 'admin'), 1));
88 $temp->add(new admin_setting_configcheckbox('blogshowcommentscount', new lang_string('showcommentscount', 'admin'), new lang_string('configshowcommentscount', 'admin'), 1));
cae83708 89 $ADMIN->add('appearance', $temp);
90
da3ab9c4 91 // Navigation settings
e106013f 92 $temp = new admin_settingpage('navigation', new lang_string('navigation'));
89c51017 93 $choices = array(
e106013f
SH
94 HOMEPAGE_SITE => new lang_string('site'),
95 HOMEPAGE_MY => new lang_string('mymoodle', 'admin'),
96 HOMEPAGE_USER => new lang_string('userpreference', 'admin')
89c51017 97 );
e106013f
SH
98 $temp->add(new admin_setting_configselect('defaulthomepage', new lang_string('defaulthomepage', 'admin'), new lang_string('configdefaulthomepage', 'admin'), HOMEPAGE_SITE, $choices));
99 $temp->add(new admin_setting_configcheckbox('navshowcategories', new lang_string('navshowcategories', 'admin'), new lang_string('confignavshowcategories', 'admin'), 1));
100 $temp->add(new admin_setting_configcheckbox('navshowallcourses', new lang_string('navshowallcourses', 'admin'), new lang_string('confignavshowallcourses', 'admin'), 0));
101 $temp->add(new admin_setting_configtext('navcourselimit',new lang_string('navcourselimit','admin'),new lang_string('confignavcourselimit', 'admin'),20,PARAM_INT));
102 $temp->add(new admin_setting_configcheckbox('navlinkcoursesections', new lang_string('navlinkcoursesections', 'admin'), new lang_string('navlinkcoursesections_help', 'admin'), 0));
103 $temp->add(new admin_setting_configcheckbox('usesitenameforsitepages', new lang_string('usesitenameforsitepages', 'admin'), new lang_string('configusesitenameforsitepages', 'admin'), 0));
83f78f8d 104 $temp->add(new admin_setting_configcheckbox('linkadmincategories', new lang_string('linkadmincategories', 'admin'), new lang_string('linkadmincategories_help', 'admin'), 0));
e106013f 105 $temp->add(new admin_setting_configcheckbox('navadduserpostslinks', new lang_string('navadduserpostslinks', 'admin'), new lang_string('navadduserpostslinks_help', 'admin'), 1));
89c51017 106
da3ab9c4
SH
107 $ADMIN->add('appearance', $temp);
108
5ca3c838 109 // "htmlsettings" settingpage
e106013f
SH
110 $temp = new admin_settingpage('htmlsettings', new lang_string('htmlsettings', 'admin'));
111 $temp->add(new admin_setting_configcheckbox('formatstringstriptags', new lang_string('stripalltitletags', 'admin'), new lang_string('configstripalltitletags', 'admin'), 1));
c3ed4a5a 112 $temp->add(new admin_setting_emoticons());
8eb1d25f 113 $ADMIN->add('appearance', $temp);
e106013f 114 $ADMIN->add('appearance', new admin_externalpage('resetemoticons', new lang_string('emoticonsreset', 'admin'),
7680da6c 115 new moodle_url('/admin/resetemoticons.php'), 'moodle/site:config', true));
8eb1d25f 116
220a90c5 117 // "documentation" settingpage
e106013f
SH
118 $temp = new admin_settingpage('documentation', new lang_string('moodledocs'));
119 $temp->add(new admin_setting_configtext('docroot', new lang_string('docroot', 'admin'), new lang_string('configdocroot', 'admin'), 'http://docs.moodle.org', PARAM_URL));
120 $temp->add(new admin_setting_configcheckbox('doctonewwindow', new lang_string('doctonewwindow', 'admin'), new lang_string('configdoctonewwindow', 'admin'), 0));
220a90c5 121 $ADMIN->add('appearance', $temp);
122
e106013f 123 $temp = new admin_externalpage('mypage', new lang_string('mypage', 'admin'), $CFG->wwwroot . '/my/indexsys.php');
03d9401e
MD
124 $ADMIN->add('appearance', $temp);
125
e106013f 126 $temp = new admin_externalpage('profilepage', new lang_string('myprofile', 'admin'), $CFG->wwwroot . '/user/profilesys.php');
220a90c5 127 $ADMIN->add('appearance', $temp);
128
df997f84 129 // coursecontact is the person responsible for course - usually manages enrolments, receives notification, etc.
e106013f 130 $temp = new admin_settingpage('coursecontact', new lang_string('courses'));
df997f84 131 $temp->add(new admin_setting_special_coursecontact());
7fb46992 132 $temp->add(new admin_setting_configcheckbox('courselistshortnames',
e106013f
SH
133 new lang_string('courselistshortnames', 'admin'),
134 new lang_string('courselistshortnames_desc', 'admin'), 0));
220a90c5 135 $ADMIN->add('appearance', $temp);
136
e106013f
SH
137 $temp = new admin_settingpage('ajax', new lang_string('ajaxuse'));
138 $temp->add(new admin_setting_configcheckbox('enableajax', new lang_string('enableajax', 'admin'), new lang_string('configenableajax', 'admin'), 1));
139 $temp->add(new admin_setting_configcheckbox('useexternalyui', new lang_string('useexternalyui', 'admin'), new lang_string('configuseexternalyui', 'admin'), 0));
140 $temp->add(new admin_setting_configcheckbox('yuicomboloading', new lang_string('yuicomboloading', 'admin'), new lang_string('configyuicomboloading', 'admin'), 1));
141 $setting = new admin_setting_configcheckbox('cachejs', new lang_string('cachejs', 'admin'), new lang_string('cachejs_help', 'admin'), 1);
2288073a
PS
142 $setting->set_updatedcallback('js_reset_all_caches');
143 $temp->add($setting);
e106013f
SH
144 $temp->add(new admin_setting_configcheckbox('enablecourseajax', new lang_string('enablecourseajax', 'admin'),
145 new lang_string('enablecourseajax_desc', 'admin'), 1));
220a90c5 146 $ADMIN->add('appearance', $temp);
147
148 // link to tag management interface
e106013f 149 $ADMIN->add('appearance', new admin_externalpage('managetags', new lang_string('managetags', 'tag'), "$CFG->wwwroot/tag/manage.php"));
8f6c1f34 150
e106013f
SH
151 $temp = new admin_settingpage('additionalhtml', new lang_string('additionalhtml', 'admin'));
152 $temp->add(new admin_setting_heading('additionalhtml_heading', new lang_string('additionalhtml_heading', 'admin'), new lang_string('additionalhtml_desc', 'admin')));
153 $temp->add(new admin_setting_configtextarea('additionalhtmlhead', new lang_string('additionalhtmlhead', 'admin'), new lang_string('additionalhtmlhead_desc', 'admin'), '', PARAM_RAW));
154 $temp->add(new admin_setting_configtextarea('additionalhtmltopofbody', new lang_string('additionalhtmltopofbody', 'admin'), new lang_string('additionalhtmltopofbody_desc', 'admin'), '', PARAM_RAW));
155 $temp->add(new admin_setting_configtextarea('additionalhtmlfooter', new lang_string('additionalhtmlfooter', 'admin'), new lang_string('additionalhtmlfooter_desc', 'admin'), '', PARAM_RAW));
90e920c7 156 $ADMIN->add('appearance', $temp);
a559f630 157
158} // end of speedup
78946b9b 159