lib-navigation MDL-21113 Fixed minor javascript error when positioning sidepanel...
[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));
11 $temp->add(new admin_setting_configcheckbox('allowuserthemes', get_string('allowuserthemes', 'admin'), get_string('configallowuserthemes', 'admin'), 0));
12 $temp->add(new admin_setting_configcheckbox('allowcoursethemes', get_string('allowcoursethemes', 'admin'), get_string('configallowcoursethemes', 'admin'), 0));
13 $temp->add(new admin_setting_configcheckbox('allowcategorythemes', get_string('allowcategorythemes', 'admin'), get_string('configallowcategorythemes', 'admin'), 0));
b7009474 14 $temp->add(new admin_setting_configcheckbox('allowthemechangeonurl', get_string('allowthemechangeonurl', 'admin'), get_string('configallowthemechangeonurl', 'admin'), 0));
220a90c5 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));
17 $temp->add(new admin_setting_configselect('hideactivitytypenavlink', get_string('hideactivitytypenavlink', 'admin'), get_string('confighideactivitytypenavlink', 'admin'), 0,
18 array(
19 0 => get_string('hidefromnone', 'admin'),
20 1 => get_string('hidefromstudents', 'admin'),
21 2 => get_string('hidefromall', 'admin')
22 )));
23 $ADMIN->add('themes', $temp);
24 $ADMIN->add('themes', new admin_externalpage('themeselector', get_string('themeselector','admin'), $CFG->wwwroot . '/theme/index.php'));
25
26 // calendar
27 $temp = new admin_settingpage('calendar', get_string('calendarsettings','admin'));
28 $temp->add(new admin_setting_special_adminseesall());
29 //this is hacky because we do not want to include the stuff from calendar/lib.php
30 $temp->add(new admin_setting_configselect('calendar_site_timeformat', get_string('pref_timeformat', 'calendar'),
31 get_string('explain_site_timeformat', 'calendar'), '0',
32 array('0' => get_string('default', 'calendar'),
33 '%I:%M %p' => get_string('timeformat_12', 'calendar'),
34 '%H:%M' => get_string('timeformat_24', 'calendar'))));
35 $temp->add(new admin_setting_configselect('calendar_startwday', get_string('configstartwday', 'admin'), get_string('helpstartofweek', 'admin'), 0,
36 array(
37 0 => get_string('sunday', 'calendar'),
38 1 => get_string('monday', 'calendar'),
39 2 => get_string('tuesday', 'calendar'),
40 3 => get_string('wednesday', 'calendar'),
41 4 => get_string('thursday', 'calendar'),
42 5 => get_string('friday', 'calendar'),
43 6 => get_string('saturday', 'calendar')
44 )));
45 $temp->add(new admin_setting_special_calendar_weekend());
46 $temp->add(new admin_setting_configtext('calendar_lookahead',get_string('configlookahead','admin'),get_string('helpupcominglookahead', 'admin'),21,PARAM_INT));
47 $temp->add(new admin_setting_configtext('calendar_maxevents',get_string('configmaxevents','admin'),get_string('helpupcomingmaxevents', 'admin'),10,PARAM_INT));
dbf9d4cb 48 $temp->add(new admin_setting_configcheckbox('enablecalendarexport', get_string('enablecalendarexport', 'admin'), get_string('configenablecalendarexport','admin'), 1));
7baf68d8 49 $temp->add(new admin_setting_configtext('calendar_exportsalt', get_string('calendarexportsalt','admin'), get_string('configcalendarexportsalt', 'admin'), random_string(60)));
220a90c5 50 $ADMIN->add('appearance', $temp);
51
cae83708 52 // blog
53 $temp = new admin_settingpage('blog', get_string('blog','blog'));
54 $temp->add(new admin_setting_configcheckbox('useblogassociations', get_string('useblogassociations', 'blog'), get_string('configuseblogassociations','blog'), 1));
ca497f4f 55 $temp->add(new admin_setting_bloglevel('bloglevel', get_string('bloglevel', 'admin'), get_string('configbloglevel', 'admin'), 4, array(5 => get_string('worldblogs','blog'),
cae83708 56 4 => get_string('siteblogs','blog'),
57 1 => get_string('personalblogs','blog'),
58 0 => get_string('disableblogs','blog'))));
59 $temp->add(new admin_setting_configcheckbox('useexternalblogs', get_string('useexternalblogs', 'blog'), get_string('configuseexternalblogs','blog'), 1));
60 $temp->add(new admin_setting_configselect('externalblogcrontime', get_string('externalblogcrontime', 'blog'), get_string('configexternalblogcrontime', 'blog'), 86400,
61 array(43200 => get_string('numhours', '', 12),
62 86400 => get_string('numhours', '', 24),
63 172800 => get_string('numdays', '', 2),
64 604800 => get_string('numdays', '', 7))));
65 $temp->add(new admin_setting_configtext('maxexternalblogsperuser', get_string('maxexternalblogsperuser','blog'), get_string('configmaxexternalblogsperuser', 'blog'), 1));
66 $ADMIN->add('appearance', $temp);
67
da3ab9c4
SH
68 // Navigation settings
69 $temp = new admin_settingpage('navigation', get_string('navigation'));
8958174c 70 $temp->add(new admin_setting_configcheckbox('navshowcategories', get_string('navshowcategories', 'admin'), get_string('confignavshowcategories', 'admin'), 1));
da3ab9c4
SH
71 $temp->add(new admin_setting_configcheckbox('navshowallcourses', get_string('navshowallcourses', 'admin'), get_string('confignavshowallcourses', 'admin'), 0));
72 $ADMIN->add('appearance', $temp);
73
5ca3c838 74/* TODO: reimplement editor settings and preferences, editors are now full plugins ;-)
220a90c5 75 // "htmleditor" settingpage
c7b4be09 76 $ADMIN->add('appearance', new admin_category('htmleditor', get_string('htmleditor', 'admin')));
77
78 $temp = new admin_settingpage('htmleditorsettings', get_string('htmleditorsettings', 'admin'));
79
5ca3c838 80 $htmleditors = get_available_editors();
5fc97603 81
c7b4be09 82 $temp->add(new admin_setting_configselect('defaulthtmleditor', get_string('defaulthtmleditor', 'admin'), null, 'tinymce', $htmleditors));
0687e555 83 $temp->add(new admin_setting_configcheckbox('htmleditor', get_string('usehtmleditor', 'admin'), get_string('confightmleditor','admin'), 1));
e7a3f429 84 $temp->add(new admin_setting_emoticons());
c7b4be09 85 $ADMIN->add('htmleditor', $temp);
86
5ca3c838 87
88 TODO: before deleting these settings migrate or drop config values!
c7b4be09 89 $temp = new admin_settingpage('htmlarea', get_string('htmlarea', 'admin'));
220a90c5 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));
220a90c5 95 $temp->add(new admin_setting_special_editorhidebuttons());
c7b4be09 96 $ADMIN->add('htmleditor', $temp);
97
6bebbe45 98 $temp = new admin_settingpage('tinymce', 'TinyMCE');
c7b4be09 99 // add tinymce configuration options here
100 $ADMIN->add('htmleditor', $temp);
5ca3c838 101*/
220a90c5 102
5ca3c838 103 // "htmlsettings" settingpage
8eb1d25f 104 $temp = new admin_settingpage('htmlsettings', get_string('htmlsettings', 'admin'));
105 $temp->add(new admin_setting_configcheckbox('formatstringstriptags', get_string('stripalltitletags', 'admin'), get_string('configstripalltitletags', 'admin'), 1));
106 $ADMIN->add('appearance', $temp);
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
114 $temp = new admin_settingpage('mymoodle', get_string('mymoodle', 'admin'));
115 $temp->add(new admin_setting_configcheckbox('mymoodleredirect', get_string('mymoodleredirect', 'admin'), get_string('configmymoodleredirect', 'admin'), 0));
ebb1a1e8 116 $temp->add(new admin_setting_configtext('mycoursesperpage', get_string('mycoursesperpage', 'admin'), get_string('configmycoursesperpage', 'admin'), 21, PARAM_INT));
220a90c5 117 $ADMIN->add('appearance', $temp);
118
119 // new CFG variable for coursemanager (what roles to display)
120 $temp = new admin_settingpage('coursemanager', get_string('coursemanager', 'admin'));
121 $temp->add(new admin_setting_special_coursemanager());
122 $ADMIN->add('appearance', $temp);
123
220a90c5 124 $temp = new admin_settingpage('ajax', get_string('ajaxuse'));
6d77b23c 125 $temp->add(new admin_setting_configcheckbox('enableajax', get_string('enableajax', 'admin'), get_string('configenableajax', 'admin'), 1));
7f2a7c3c 126 $temp->add(new admin_setting_configcheckbox('useexternalyui', get_string('useexternalyui', 'admin'), get_string('configuseexternalyui', 'admin'), 0));
6d77b23c 127 $temp->add(new admin_setting_configcheckbox('disablecourseajax', get_string('disablecourseajax', 'admin'), get_string('configdisablecourseajax', 'admin'),
128 isset($CFG->disablecourseajax) ? 1 : empty($CFG->enableajax)));
220a90c5 129 $ADMIN->add('appearance', $temp);
130
131 // link to tag management interface
132 $ADMIN->add('appearance', new admin_externalpage('managetags', get_string('managetags', 'tag'), "$CFG->wwwroot/tag/manage.php"));
a559f630 133
134} // end of speedup