3 defined('MOODLE_INTERNAL') ||
die();
6 * Makes our changes to the CSS
9 * @param theme_config $theme
12 function formal_white_user_settings($css, $theme) {
14 // Set the font reference size
15 if (empty($theme->settings
->fontsizereference
)) {
16 $fontsizereference = '13'; // default
18 $fontsizereference = $theme->settings
->fontsizereference
;
20 $css = formal_white_set_fontsizereference($css, $fontsizereference);
22 // Set the page header background color
23 if (empty($theme->settings
->headerbgc
)) {
24 $headerbgc = '#E3DFD4'; // default
26 $headerbgc = $theme->settings
->headerbgc
;
28 $css = formal_white_set_headerbgc($css, $headerbgc);
30 // Set the block content background color
31 if (empty($theme->settings
->blockcontentbgc
)) {
32 $blockcontentbgc = '#F6F6F6'; // default
34 $blockcontentbgc = $theme->settings
->blockcontentbgc
;
36 $css = formal_white_set_blockcontentbgc($css, $blockcontentbgc);
38 // Set the left block column background color
39 if (empty($theme->settings
->lblockcolumnbgc
)) {
40 $lblockcolumnbgc = '#E3DFD4'; // default
42 $lblockcolumnbgc = $theme->settings
->lblockcolumnbgc
;
44 $css = formal_white_set_lblockcolumnbgc($css, $lblockcolumnbgc);
46 // Set the right block column background color
47 if (empty($theme->settings
->rblockcolumnbgc
)) {
48 $rblockcolumnbgc = $lblockcolumnbgc; // default
50 $rblockcolumnbgc = $theme->settings
->rblockcolumnbgc
;
52 $css = formal_white_set_rblockcolumnbgc($css, $rblockcolumnbgc);
54 // set the width of the two blocks columns
55 if (!empty($theme->settings
->blockcolumnwidth
)) {
56 $blockcolumnwidth = $theme->settings
->blockcolumnwidth
;
58 $blockcolumnwidth = '200'; // default
60 $css = formal_white_set_blockcolumnwidth($css, $blockcolumnwidth);
63 if (!empty($theme->settings
->customcss
)) {
64 $customcss = $theme->settings
->customcss
;
68 $css = formal_white_set_customcss($css, $customcss);
77 * Sets the link color variable in CSS
80 function formal_white_set_fontsizereference($css, $fontsizereference) {
81 $tag = '[[setting:fontsizereference]]';
82 $css = str_replace($tag, $fontsizereference.'px', $css);
86 function formal_white_set_headerbgc($css, $headerbgc) {
87 $tag = '[[setting:headerbgc]]';
88 $css = str_replace($tag, $headerbgc, $css);
92 function formal_white_set_blockcontentbgc($css, $blockcontentbgc) {
93 $tag = '[[setting:blockcontentbgc]]';
94 $css = str_replace($tag, $blockcontentbgc, $css);
98 function formal_white_set_lblockcolumnbgc($css, $lblockcolumnbgc) {
99 $tag = '[[setting:lblockcolumnbgc]]';
100 $css = str_replace($tag, $lblockcolumnbgc, $css);
104 function formal_white_set_rblockcolumnbgc($css, $rblockcolumnbgc) {
105 $tag = '[[setting:rblockcolumnbgc]]';
106 $css = str_replace($tag, $rblockcolumnbgc, $css);
110 function formal_white_set_blockcolumnwidth($css, $blockcolumnwidth) {
111 $tag = '[[setting:blockcolumnwidth]]';
112 $css = str_replace($tag, $blockcolumnwidth.'px', $css);
114 $tag = '[[setting:minusdoubleblockcolumnwidth]]';
115 $css = str_replace($tag, (-2*$blockcolumnwidth).'px', $css);
117 $tag = '[[setting:doubleblockcolumnwidth]]';
118 $css = str_replace($tag, (2*$blockcolumnwidth).'px', $css);
123 function formal_white_set_customcss($css, $customcss) {
124 $tag = '[[setting:customcss]]';
125 $css = str_replace($tag, $customcss, $css);