|
Moodle
2.2.1
http://www.collinsharper.com
|
00001 <?php 00002 00003 defined('MOODLE_INTERNAL') || die(); 00004 00012 function formal_white_user_settings($css, $theme) { 00013 00014 // Set the font reference size 00015 if (empty($theme->settings->fontsizereference)) { 00016 $fontsizereference = '13'; // default 00017 } else { 00018 $fontsizereference = $theme->settings->fontsizereference; 00019 } 00020 $css = formal_white_set_fontsizereference($css, $fontsizereference); 00021 00022 // Set the page header background color 00023 if (empty($theme->settings->headerbgc)) { 00024 $headerbgc = '#E3DFD4'; // default 00025 } else { 00026 $headerbgc = $theme->settings->headerbgc; 00027 } 00028 $css = formal_white_set_headerbgc($css, $headerbgc); 00029 00030 // Set the block content background color 00031 if (empty($theme->settings->blockcontentbgc)) { 00032 $blockcontentbgc = '#F6F6F6'; // default 00033 } else { 00034 $blockcontentbgc = $theme->settings->blockcontentbgc; 00035 } 00036 $css = formal_white_set_blockcontentbgc($css, $blockcontentbgc); 00037 00038 // Set the left block column background color 00039 if (empty($theme->settings->lblockcolumnbgc)) { 00040 $lblockcolumnbgc = '#E3DFD4'; // default 00041 } else { 00042 $lblockcolumnbgc = $theme->settings->lblockcolumnbgc; 00043 } 00044 $css = formal_white_set_lblockcolumnbgc($css, $lblockcolumnbgc); 00045 00046 // Set the right block column background color 00047 if (empty($theme->settings->rblockcolumnbgc)) { 00048 $rblockcolumnbgc = $lblockcolumnbgc; // default 00049 } else { 00050 $rblockcolumnbgc = $theme->settings->rblockcolumnbgc; 00051 } 00052 $css = formal_white_set_rblockcolumnbgc($css, $rblockcolumnbgc); 00053 00054 // set the width of the two blocks columns 00055 if (!empty($theme->settings->blockcolumnwidth)) { 00056 $blockcolumnwidth = $theme->settings->blockcolumnwidth; 00057 } else { 00058 $blockcolumnwidth = '200'; // default 00059 } 00060 $css = formal_white_set_blockcolumnwidth($css, $blockcolumnwidth); 00061 00062 // set the customcss 00063 if (!empty($theme->settings->customcss)) { 00064 $customcss = $theme->settings->customcss; 00065 } else { 00066 $customcss = null; 00067 } 00068 $css = formal_white_set_customcss($css, $customcss); 00069 00070 // Return the CSS 00071 return $css; 00072 } 00073 00074 00075 00080 function formal_white_set_fontsizereference($css, $fontsizereference) { 00081 $tag = '[[setting:fontsizereference]]'; 00082 $css = str_replace($tag, $fontsizereference.'px', $css); 00083 return $css; 00084 } 00085 00086 function formal_white_set_headerbgc($css, $headerbgc) { 00087 $tag = '[[setting:headerbgc]]'; 00088 $css = str_replace($tag, $headerbgc, $css); 00089 return $css; 00090 } 00091 00092 function formal_white_set_blockcontentbgc($css, $blockcontentbgc) { 00093 $tag = '[[setting:blockcontentbgc]]'; 00094 $css = str_replace($tag, $blockcontentbgc, $css); 00095 return $css; 00096 } 00097 00098 function formal_white_set_lblockcolumnbgc($css, $lblockcolumnbgc) { 00099 $tag = '[[setting:lblockcolumnbgc]]'; 00100 $css = str_replace($tag, $lblockcolumnbgc, $css); 00101 return $css; 00102 } 00103 00104 function formal_white_set_rblockcolumnbgc($css, $rblockcolumnbgc) { 00105 $tag = '[[setting:rblockcolumnbgc]]'; 00106 $css = str_replace($tag, $rblockcolumnbgc, $css); 00107 return $css; 00108 } 00109 00110 function formal_white_set_blockcolumnwidth($css, $blockcolumnwidth) { 00111 $tag = '[[setting:blockcolumnwidth]]'; 00112 $css = str_replace($tag, $blockcolumnwidth.'px', $css); 00113 00114 $tag = '[[setting:minusdoubleblockcolumnwidth]]'; 00115 $css = str_replace($tag, (-2*$blockcolumnwidth).'px', $css); 00116 00117 $tag = '[[setting:doubleblockcolumnwidth]]'; 00118 $css = str_replace($tag, (2*$blockcolumnwidth).'px', $css); 00119 00120 return $css; 00121 } 00122 00123 function formal_white_set_customcss($css, $customcss) { 00124 $tag = '[[setting:customcss]]'; 00125 $css = str_replace($tag, $customcss, $css); 00126 return $css; 00127 }