3 // This file defines settingpages and externalpages under the "appearance" category
5 if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
7 $ADMIN->add('appearance', new admin_category('themes', new lang_string('themes')));
8 // "themesettings" settingpage
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);
12 $setting->set_updatedcallback('theme_reset_all_caches');
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'), ''));
23 $ADMIN->add('themes', $temp);
24 $ADMIN->add('themes', new admin_externalpage('themeselector', new lang_string('themeselector','admin'), $CFG->wwwroot . '/theme/index.php'));
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)) {
30 $settings = new admin_settingpage('themesetting'.$theme, new lang_string('pluginname', 'theme_'.$theme));
31 include($settings_path);
33 $ADMIN->add('themes', $settings);
40 $temp = new admin_settingpage('calendar', new lang_string('calendarsettings','admin'));
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
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,
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')
58 $temp->add(new admin_setting_special_calendar_weekend());
60 for ($i=1; $i<=99; $i++) {
63 $temp->add(new admin_setting_configselect('calendar_lookahead',new lang_string('configlookahead','admin'),new lang_string('helpupcominglookahead', 'admin'),21,$options));
65 for ($i=1; $i<=20; $i++) {
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)));
71 $ADMIN->add('appearance', $temp);
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));
89 $ADMIN->add('appearance', $temp);
91 // Navigation settings
92 $temp = new admin_settingpage('navigation', new lang_string('navigation'));
94 HOMEPAGE_SITE => new lang_string('site'),
95 HOMEPAGE_MY => new lang_string('mymoodle', 'admin'),
96 HOMEPAGE_USER => new lang_string('userpreference', 'admin')
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));
104 $temp->add(new admin_setting_configcheckbox('linkadmincategories', new lang_string('linkadmincategories', 'admin'), new lang_string('linkadmincategories_help', 'admin'), 0));
105 $temp->add(new admin_setting_configcheckbox('navshowfrontpagemods', new lang_string('navshowfrontpagemods', 'admin'), new lang_string('navshowfrontpagemods_help', 'admin'), 1));
106 $temp->add(new admin_setting_configcheckbox('navadduserpostslinks', new lang_string('navadduserpostslinks', 'admin'), new lang_string('navadduserpostslinks_help', 'admin'), 1));
108 $ADMIN->add('appearance', $temp);
110 // "htmlsettings" settingpage
111 $temp = new admin_settingpage('htmlsettings', new lang_string('htmlsettings', 'admin'));
112 $temp->add(new admin_setting_configcheckbox('formatstringstriptags', new lang_string('stripalltitletags', 'admin'), new lang_string('configstripalltitletags', 'admin'), 1));
113 $temp->add(new admin_setting_emoticons());
114 $ADMIN->add('appearance', $temp);
115 $ADMIN->add('appearance', new admin_externalpage('resetemoticons', new lang_string('emoticonsreset', 'admin'),
116 new moodle_url('/admin/resetemoticons.php'), 'moodle/site:config', true));
118 // "documentation" settingpage
119 $temp = new admin_settingpage('documentation', new lang_string('moodledocs'));
120 $temp->add(new admin_setting_configtext('docroot', new lang_string('docroot', 'admin'), new lang_string('configdocroot', 'admin'), 'http://docs.moodle.org', PARAM_URL));
121 $temp->add(new admin_setting_configcheckbox('doctonewwindow', new lang_string('doctonewwindow', 'admin'), new lang_string('configdoctonewwindow', 'admin'), 0));
122 $ADMIN->add('appearance', $temp);
124 $temp = new admin_externalpage('mypage', new lang_string('mypage', 'admin'), $CFG->wwwroot . '/my/indexsys.php');
125 $ADMIN->add('appearance', $temp);
127 $temp = new admin_externalpage('profilepage', new lang_string('myprofile', 'admin'), $CFG->wwwroot . '/user/profilesys.php');
128 $ADMIN->add('appearance', $temp);
130 // coursecontact is the person responsible for course - usually manages enrolments, receives notification, etc.
131 $temp = new admin_settingpage('coursecontact', new lang_string('courses'));
132 $temp->add(new admin_setting_special_coursecontact());
133 $temp->add(new admin_setting_configcheckbox('courselistshortnames',
134 new lang_string('courselistshortnames', 'admin'),
135 new lang_string('courselistshortnames_desc', 'admin'), 0));
136 $ADMIN->add('appearance', $temp);
138 $temp = new admin_settingpage('ajax', new lang_string('ajaxuse'));
139 $temp->add(new admin_setting_configcheckbox('enableajax', new lang_string('enableajax', 'admin'), new lang_string('configenableajax', 'admin'), 1));
140 $temp->add(new admin_setting_configcheckbox('useexternalyui', new lang_string('useexternalyui', 'admin'), new lang_string('configuseexternalyui', 'admin'), 0));
141 $temp->add(new admin_setting_configcheckbox('yuicomboloading', new lang_string('yuicomboloading', 'admin'), new lang_string('configyuicomboloading', 'admin'), 1));
142 $setting = new admin_setting_configcheckbox('cachejs', new lang_string('cachejs', 'admin'), new lang_string('cachejs_help', 'admin'), 1);
143 $setting->set_updatedcallback('js_reset_all_caches');
144 $temp->add($setting);
145 $temp->add(new admin_setting_configcheckbox('enablecourseajax', new lang_string('enablecourseajax', 'admin'),
146 new lang_string('enablecourseajax_desc', 'admin'), 1));
147 $ADMIN->add('appearance', $temp);
149 // link to tag management interface
150 $ADMIN->add('appearance', new admin_externalpage('managetags', new lang_string('managetags', 'tag'), "$CFG->wwwroot/tag/manage.php"));
152 $temp = new admin_settingpage('additionalhtml', new lang_string('additionalhtml', 'admin'));
153 $temp->add(new admin_setting_heading('additionalhtml_heading', new lang_string('additionalhtml_heading', 'admin'), new lang_string('additionalhtml_desc', 'admin')));
154 $temp->add(new admin_setting_configtextarea('additionalhtmlhead', new lang_string('additionalhtmlhead', 'admin'), new lang_string('additionalhtmlhead_desc', 'admin'), '', PARAM_RAW));
155 $temp->add(new admin_setting_configtextarea('additionalhtmltopofbody', new lang_string('additionalhtmltopofbody', 'admin'), new lang_string('additionalhtmltopofbody_desc', 'admin'), '', PARAM_RAW));
156 $temp->add(new admin_setting_configtextarea('additionalhtmlfooter', new lang_string('additionalhtmlfooter', 'admin'), new lang_string('additionalhtmlfooter_desc', 'admin'), '', PARAM_RAW));
157 $ADMIN->add('appearance', $temp);