MDL-34916 theme_formal_white: added support for relative path of logos
[moodle.git] / theme / formal_white / settings.php
CommitLineData
57bfc29a
AB
1<?php
2
3/**
dbf9e4ba 4 * Settings for the formal_white theme
57bfc29a
AB
5 */
6
dbf9e4ba
PS
7defined('MOODLE_INTERNAL') || die;
8
9if ($ADMIN->fulltree) {
b396e167 10 // font size reference
11 $name = 'theme_formal_white/fontsizereference';
12 $title = get_string('fontsizereference','theme_formal_white');
13 $description = get_string('fontsizereferencedesc', 'theme_formal_white');
14 $default = '13';
15 $choices = array(11=>'11px', 12=>'12px', 13=>'13px', 14=>'14px', 15=>'15px', 16=>'16px');
16 $setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
17 $settings->add($setting);
dbf9e4ba 18
4afb01db 19 // moodle 1.* like setting
20 $name = 'theme_formal_white/noframe';
21 $title = get_string('noframe','theme_formal_white');
22 $description = get_string('noframedesc', 'theme_formal_white');
0e412e87 23 $default = '0';
24 $setting = new admin_setting_configcheckbox($name, $title, $description, $default);
25 $settings->add($setting);
26
1bc47427
K
27 // Frame margin
28 $name = 'theme_formal_white/framemargin';
29 $title = get_string('framemargin','theme_formal_white');
25d42212 30 $description = get_string('framemargindesc', 'theme_formal_white', get_string('noframe','theme_formal_white'));
1bc47427
K
31 $default = '15';
32 $choices = array(0=>'0px', 5=>'5px', 10=>'10px', 15=>'15px', 20=>'20px', 25=>'25px', 30=>'30px', 35=>'35px', 40=>'40px', 45=>'45px', 50=>'50px');
33 $setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
34 $settings->add($setting);
35
b396e167 36 // Display logo or heading
9ad11a6c
K
37 $name = 'theme_formal_white/headercontent';
38 $title = get_string('headercontent','theme_formal_white');
39 $description = get_string('headercontentdesc', 'theme_formal_white');
b396e167 40 $default = '1';
9ad11a6c 41 $choices = array(1=>get_string('displaylogo', 'theme_formal_white'), 0=>get_string('displayheading', 'theme_formal_white'));
b396e167 42 $setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
43 $settings->add($setting);
44
ec140757 45 // Custom site logo setting
9ad11a6c
K
46 $name = 'theme_formal_white/customlogourl';
47 $title = get_string('customlogourl','theme_formal_white');
48 $description = get_string('customlogourldesc', 'theme_formal_white');
b396e167 49 $default = '';
e765d3c3 50 $setting = new admin_setting_configtext($name, $title, $description, $default, PARAM_RAW); // we want it accepting ../ at the beginning. Security is not at its top but Moodle trusts admins.
b396e167 51 $settings->add($setting);
52
ec140757 53 // Custom front page site logo setting
9ad11a6c
K
54 $name = 'theme_formal_white/frontpagelogourl';
55 $title = get_string('frontpagelogourl','theme_formal_white');
56 $description = get_string('frontpagelogourldesc', 'theme_formal_white');
ec140757 57 $default = '';
e765d3c3 58 $setting = new admin_setting_configtext($name, $title, $description, $default, PARAM_RAW); // we want it accepting ../ at the beginning. Security is not at its top but Moodle trusts admins.
ec140757
K
59 $settings->add($setting);
60
0e412e87 61 // page header background colour setting
62 $name = 'theme_formal_white/headerbgc';
63 $title = get_string('headerbgc','theme_formal_white');
64 $description = get_string('headerbgcdesc', 'theme_formal_white');
65 $default = '#E3DFD4';
66 $previewconfig = array('selector'=>'#page-header', 'style'=>'backgroundColor');
67 $setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig);
4afb01db 68 $settings->add($setting);
69
e0523b97 70 // creditstomoodleorg: ctmo
71 $name = 'theme_formal_white/creditstomoodleorg';
72 $title = get_string('creditstomoodleorg','theme_formal_white');
73 $description = get_string('creditstomoodleorgdesc', 'theme_formal_white');
74 $default = '2';
1924a86a
SH
75 $choices = array(2 => get_string('ctmo_ineverypage', 'theme_formal_white'), 1 => get_string('ctmo_onfrontpageonly', 'theme_formal_white'), 0 => get_string('ctmo_no', 'theme_formal_white'));
76 $setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
77 $settings->add($setting);
78
ec140757
K
79 // Block region width
80 $name = 'theme_formal_white/blockcolumnwidth';
81 $title = get_string('blockcolumnwidth','theme_formal_white');
82 $description = get_string('blockcolumnwidthdesc', 'theme_formal_white');
83 $default = '200';
84 $choices = array(150=>'150px', 170=>'170px', 200=>'200px', 240=>'240px', 290=>'290px', 350=>'350px', 420=>'420px');
85 $setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
86 $settings->add($setting);
87
e78356a0 88 // Block padding
f0a8c919
K
89 $name = 'theme_formal_white/blockpadding';
90 $title = get_string('blockpadding','theme_formal_white');
91 $description = get_string('blockpaddingdesc', 'theme_formal_white');
92 $default = '8';
93 $choices = array(1=>'1px', 2=>'2px', 4=>'4px', 8=>'8px', 12=>'12px', 16=>'16px');
94 $setting = new admin_setting_configselect($name, $title, $description, $default, $choices);
95 $settings->add($setting);
96
b396e167 97 // Block content background colour setting
4afb01db 98 $name = 'theme_formal_white/blockcontentbgc';
99 $title = get_string('blockcontentbgc','theme_formal_white');
100 $description = get_string('blockcontentbgcdesc', 'theme_formal_white');
101 $default = '#F6F6F6';
dbf9e4ba
PS
102 $previewconfig = array('selector'=>'.block .content', 'style'=>'backgroundColor');
103 $setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig);
104 $settings->add($setting);
105
b396e167 106 // Left column colour setting
107 $name = 'theme_formal_white/lblockcolumnbgc';
108 $title = get_string('lblockcolumnbgc','theme_formal_white');
109 $description = get_string('lblockcolumnbgcdesc', 'theme_formal_white');
4afb01db 110 $default = '#E3DFD4';
111 $previewconfig = array('selector'=>'#page-content, #page-content #region-pre, #page-content #region-post-box', 'style'=>'backgroundColor');
112 $setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig);
113 $settings->add($setting);
114
b396e167 115 // Right column colour setting
116 $name = 'theme_formal_white/rblockcolumnbgc';
117 $title = get_string('rblockcolumnbgc','theme_formal_white');
118 $description = get_string('rblockcolumnbgcdesc', 'theme_formal_white');
4afb01db 119 $default = '';
b396e167 120 $previewconfig = array('selector'=>'#page-content #region-post-box, #page-content #region-post', 'style'=>'backgroundColor');
121 $setting = new admin_setting_configcolourpicker($name, $title, $description, $default, $previewconfig);
dbf9e4ba
PS
122 $settings->add($setting);
123
dbf9e4ba
PS
124 // Foot note setting
125 $name = 'theme_formal_white/footnote';
126 $title = get_string('footnote','theme_formal_white');
127 $description = get_string('footnotedesc', 'theme_formal_white');
4afb01db 128 $default = '';
129 $setting = new admin_setting_confightmleditor($name, $title, $description, $default);
dbf9e4ba
PS
130 $settings->add($setting);
131
132 // Custom CSS file
133 $name = 'theme_formal_white/customcss';
134 $title = get_string('customcss','theme_formal_white');
135 $description = get_string('customcssdesc', 'theme_formal_white');
4afb01db 136 $default = '';
137 $setting = new admin_setting_configtextarea($name, $title, $description, $default);
dbf9e4ba 138 $settings->add($setting);
25d42212 139}