MDL-29719 Option to display course shortname alongside fullname on course lists
[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
220a90c5 7 $ADMIN->add('appearance', new admin_category('themes', get_string('themes')));
8 // "themesettings" settingpage
9 $temp = new admin_settingpage('themesettings', get_string('themesettings', 'admin'));
10 $temp->add(new admin_setting_configtext('themelist', get_string('themelist', 'admin'), get_string('configthemelist','admin'), '', PARAM_NOTAGS));
78946b9b
PS
11 $setting = new admin_setting_configcheckbox('themedesignermode', get_string('themedesignermode', 'admin'), get_string('configthemedesignermode', 'admin'), 0);
12 $setting->set_updatedcallback('theme_reset_all_caches');
13 $temp->add($setting);
220a90c5 14 $temp->add(new admin_setting_configcheckbox('allowuserthemes', get_string('allowuserthemes', 'admin'), get_string('configallowuserthemes', 'admin'), 0));
15 $temp->add(new admin_setting_configcheckbox('allowcoursethemes', get_string('allowcoursethemes', 'admin'), get_string('configallowcoursethemes', 'admin'), 0));
16 $temp->add(new admin_setting_configcheckbox('allowcategorythemes', get_string('allowcategorythemes', 'admin'), get_string('configallowcategorythemes', 'admin'), 0));
b7009474 17 $temp->add(new admin_setting_configcheckbox('allowthemechangeonurl', get_string('allowthemechangeonurl', 'admin'), get_string('configallowthemechangeonurl', 'admin'), 0));
220a90c5 18 $temp->add(new admin_setting_configcheckbox('allowuserblockhiding', get_string('allowuserblockhiding', 'admin'), get_string('configallowuserblockhiding', 'admin'), 1));
d2c394f3 19 $temp->add(new admin_setting_configcheckbox('allowblockstodock', get_string('allowblockstodock', 'admin'), get_string('configallowblockstodock', 'admin'), 1));
d2dbd0c0 20 $temp->add(new admin_setting_configtextarea('custommenuitems', get_string('custommenuitems', 'admin'), get_string('configcustommenuitems', 'admin'), '', PARAM_TEXT, '50', '10'));
37959dd4
AF
21 $temp->add(new admin_setting_configcheckbox('enabledevicedetection', get_string('enabledevicedetection', 'admin'), get_string('configenabledevicedetection', 'admin'), 1));
22 $temp->add(new admin_setting_devicedetectregex('devicedetectregex', get_string('devicedetectregex', 'admin'), get_string('devicedetectregex_desc', 'admin'), ''));
220a90c5 23 $ADMIN->add('themes', $temp);
24 $ADMIN->add('themes', new admin_externalpage('themeselector', get_string('themeselector','admin'), $CFG->wwwroot . '/theme/index.php'));
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)) {
dbf9e4ba 30 $settings = new admin_settingpage('themesetting'.$theme, get_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
40 $temp = new admin_settingpage('calendar', get_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', get_string('pref_timeformat', 'calendar'),
44 get_string('explain_site_timeformat', 'calendar'), '0',
45 array('0' => get_string('default', 'calendar'),
46 '%I:%M %p' => get_string('timeformat_12', 'calendar'),
47 '%H:%M' => get_string('timeformat_24', 'calendar'))));
48 $temp->add(new admin_setting_configselect('calendar_startwday', get_string('configstartwday', 'admin'), get_string('helpstartofweek', 'admin'), 0,
49 array(
50 0 => get_string('sunday', 'calendar'),
51 1 => get_string('monday', 'calendar'),
52 2 => get_string('tuesday', 'calendar'),
53 3 => get_string('wednesday', 'calendar'),
54 4 => get_string('thursday', 'calendar'),
55 5 => get_string('friday', 'calendar'),
56 6 => get_string('saturday', 'calendar')
57 )));
58 $temp->add(new admin_setting_special_calendar_weekend());
59 $temp->add(new admin_setting_configtext('calendar_lookahead',get_string('configlookahead','admin'),get_string('helpupcominglookahead', 'admin'),21,PARAM_INT));
60 $temp->add(new admin_setting_configtext('calendar_maxevents',get_string('configmaxevents','admin'),get_string('helpupcomingmaxevents', 'admin'),10,PARAM_INT));
dbf9d4cb 61 $temp->add(new admin_setting_configcheckbox('enablecalendarexport', get_string('enablecalendarexport', 'admin'), get_string('configenablecalendarexport','admin'), 1));
7baf68d8 62 $temp->add(new admin_setting_configtext('calendar_exportsalt', get_string('calendarexportsalt','admin'), get_string('configcalendarexportsalt', 'admin'), random_string(60)));
220a90c5 63 $ADMIN->add('appearance', $temp);
64
cae83708 65 // blog
66 $temp = new admin_settingpage('blog', get_string('blog','blog'));
67 $temp->add(new admin_setting_configcheckbox('useblogassociations', get_string('useblogassociations', 'blog'), get_string('configuseblogassociations','blog'), 1));
8f6c1f34
PS
68 $temp->add(new admin_setting_bloglevel('bloglevel', get_string('bloglevel', 'admin'), get_string('configbloglevel', 'admin'), 4, array(BLOG_GLOBAL_LEVEL => get_string('worldblogs','blog'),
69 BLOG_SITE_LEVEL => get_string('siteblogs','blog'),
70 BLOG_USER_LEVEL => get_string('personalblogs','blog'),
71 0 => get_string('disableblogs','blog'))));
cae83708 72 $temp->add(new admin_setting_configcheckbox('useexternalblogs', get_string('useexternalblogs', 'blog'), get_string('configuseexternalblogs','blog'), 1));
73 $temp->add(new admin_setting_configselect('externalblogcrontime', get_string('externalblogcrontime', 'blog'), get_string('configexternalblogcrontime', 'blog'), 86400,
74 array(43200 => get_string('numhours', '', 12),
75 86400 => get_string('numhours', '', 24),
76 172800 => get_string('numdays', '', 2),
77 604800 => get_string('numdays', '', 7))));
78 $temp->add(new admin_setting_configtext('maxexternalblogsperuser', get_string('maxexternalblogsperuser','blog'), get_string('configmaxexternalblogsperuser', 'blog'), 1));
db954aba
DC
79 $temp->add(new admin_setting_configcheckbox('blogusecomments', get_string('enablecomments', 'admin'), get_string('configenablecomments', 'admin'), 1));
80 $temp->add(new admin_setting_configcheckbox('blogshowcommentscount', get_string('showcommentscount', 'admin'), get_string('configshowcommentscount', 'admin'), 1));
cae83708 81 $ADMIN->add('appearance', $temp);
82
da3ab9c4
SH
83 // Navigation settings
84 $temp = new admin_settingpage('navigation', get_string('navigation'));
89c51017
MD
85 $choices = array(
86 HOMEPAGE_SITE => get_string('site'),
87 HOMEPAGE_MY => get_string('mymoodle', 'admin'),
88 HOMEPAGE_USER => get_string('userpreference', 'admin')
89 );
90 $temp->add(new admin_setting_configselect('defaulthomepage', get_string('defaulthomepage', 'admin'), get_string('configdefaulthomepage', 'admin'), HOMEPAGE_SITE, $choices));
8958174c 91 $temp->add(new admin_setting_configcheckbox('navshowcategories', get_string('navshowcategories', 'admin'), get_string('confignavshowcategories', 'admin'), 1));
da3ab9c4 92 $temp->add(new admin_setting_configcheckbox('navshowallcourses', get_string('navshowallcourses', 'admin'), get_string('confignavshowallcourses', 'admin'), 0));
4766a50c 93 $temp->add(new admin_setting_configtext('navcourselimit',get_string('navcourselimit','admin'),get_string('confignavcourselimit', 'admin'),20,PARAM_INT));
ad470097 94 $temp->add(new admin_setting_configcheckbox('navlinkcoursesections', get_string('navlinkcoursesections', 'admin'), get_string('navlinkcoursesections_help', 'admin'), 0));
016ba638 95 $temp->add(new admin_setting_configcheckbox('usesitenameforsitepages', get_string('usesitenameforsitepages', 'admin'), get_string('configusesitenameforsitepages', 'admin'), 0));
356a6de3 96 $temp->add(new admin_setting_configcheckbox('navadduserpostslinks', get_string('navadduserpostslinks', 'admin'), get_string('navadduserpostslinks_help', 'admin'), 1));
89c51017 97
da3ab9c4
SH
98 $ADMIN->add('appearance', $temp);
99
5ca3c838 100 // "htmlsettings" settingpage
8eb1d25f 101 $temp = new admin_settingpage('htmlsettings', get_string('htmlsettings', 'admin'));
102 $temp->add(new admin_setting_configcheckbox('formatstringstriptags', get_string('stripalltitletags', 'admin'), get_string('configstripalltitletags', 'admin'), 1));
c3ed4a5a 103 $temp->add(new admin_setting_emoticons());
8eb1d25f 104 $ADMIN->add('appearance', $temp);
7680da6c
DM
105 $ADMIN->add('appearance', new admin_externalpage('resetemoticons', get_string('emoticonsreset', 'admin'),
106 new moodle_url('/admin/resetemoticons.php'), 'moodle/site:config', true));
8eb1d25f 107
220a90c5 108 // "documentation" settingpage
109 $temp = new admin_settingpage('documentation', get_string('moodledocs'));
110 $temp->add(new admin_setting_configtext('docroot', get_string('docroot', 'admin'), get_string('configdocroot', 'admin'), 'http://docs.moodle.org', PARAM_URL));
111 $temp->add(new admin_setting_configcheckbox('doctonewwindow', get_string('doctonewwindow', 'admin'), get_string('configdoctonewwindow', 'admin'), 0));
112 $ADMIN->add('appearance', $temp);
113
03d9401e
MD
114 $temp = new admin_externalpage('mypage', get_string('mypage', 'admin'), $CFG->wwwroot . '/my/indexsys.php');
115 $ADMIN->add('appearance', $temp);
116
117 $temp = new admin_externalpage('profilepage', get_string('myprofile', 'admin'), $CFG->wwwroot . '/user/profilesys.php');
220a90c5 118 $ADMIN->add('appearance', $temp);
119
df997f84 120 // coursecontact is the person responsible for course - usually manages enrolments, receives notification, etc.
7fb46992 121 $temp = new admin_settingpage('coursecontact', get_string('courses'));
df997f84 122 $temp->add(new admin_setting_special_coursecontact());
7fb46992 123 $temp->add(new admin_setting_configcheckbox('courselistshortnames',
124 get_string('courselistshortnames', 'admin'),
125 get_string('courselistshortnames_desc', 'admin'), 0));
220a90c5 126 $ADMIN->add('appearance', $temp);
127
220a90c5 128 $temp = new admin_settingpage('ajax', get_string('ajaxuse'));
6d77b23c 129 $temp->add(new admin_setting_configcheckbox('enableajax', get_string('enableajax', 'admin'), get_string('configenableajax', 'admin'), 1));
7f2a7c3c 130 $temp->add(new admin_setting_configcheckbox('useexternalyui', get_string('useexternalyui', 'admin'), get_string('configuseexternalyui', 'admin'), 0));
84d6e832 131 $temp->add(new admin_setting_configcheckbox('yuicomboloading', get_string('yuicomboloading', 'admin'), get_string('configyuicomboloading', 'admin'), 1));
2288073a
PS
132 $setting = new admin_setting_configcheckbox('cachejs', get_string('cachejs', 'admin'), get_string('cachejs_help', 'admin'), 1);
133 $setting->set_updatedcallback('js_reset_all_caches');
134 $temp->add($setting);
8b2918a4
DM
135 $temp->add(new admin_setting_configcheckbox('enablecourseajax', get_string('enablecourseajax', 'admin'),
136 get_string('enablecourseajax_desc', 'admin'), 1));
220a90c5 137 $ADMIN->add('appearance', $temp);
138
139 // link to tag management interface
140 $ADMIN->add('appearance', new admin_externalpage('managetags', get_string('managetags', 'tag'), "$CFG->wwwroot/tag/manage.php"));
8f6c1f34 141
90e920c7
SH
142 $temp = new admin_settingpage('additionalhtml', get_string('additionalhtml', 'admin'));
143 $temp->add(new admin_setting_heading('additionalhtml_heading', get_string('additionalhtml_heading', 'admin'), get_string('additionalhtml_desc', 'admin')));
144 $temp->add(new admin_setting_configtextarea('additionalhtmlhead', get_string('additionalhtmlhead', 'admin'), get_string('additionalhtmlhead_desc', 'admin'), '', PARAM_RAW));
145 $temp->add(new admin_setting_configtextarea('additionalhtmltopofbody', get_string('additionalhtmltopofbody', 'admin'), get_string('additionalhtmltopofbody_desc', 'admin'), '', PARAM_RAW));
146 $temp->add(new admin_setting_configtextarea('additionalhtmlfooter', get_string('additionalhtmlfooter', 'admin'), get_string('additionalhtmlfooter_desc', 'admin'), '', PARAM_RAW));
147 $ADMIN->add('appearance', $temp);
a559f630 148
149} // end of speedup
78946b9b 150