|
Moodle
2.2.1
http://www.collinsharper.com
|
00001 <?php 00002 00003 function afterburner_process_css($css, $theme) { 00004 00005 // Set the background image for the logo 00006 if (!empty($theme->settings->logo)) { 00007 $logo = $theme->settings->logo; 00008 } else { 00009 $logo = null; 00010 } 00011 $css = afterburner_set_logo($css, $logo); 00012 00013 // Set custom CSS 00014 if (!empty($theme->settings->customcss)) { 00015 $customcss = $theme->settings->customcss; 00016 } else { 00017 $customcss = null; 00018 } 00019 $css = afterburner_set_customcss($css, $customcss); 00020 00021 return $css; 00022 } 00023 00024 function afterburner_set_logo($css, $logo) { 00025 global $OUTPUT; 00026 $tag = '[[setting:logo]]'; 00027 $replacement = $logo; 00028 if (is_null($replacement)) { 00029 $replacement = $OUTPUT->pix_url('images/logo','theme'); 00030 } 00031 00032 $css = str_replace($tag, $replacement, $css); 00033 00034 return $css; 00035 } 00036 00037 function afterburner_set_customcss($css, $customcss) { 00038 $tag = '[[setting:customcss]]'; 00039 $replacement = $customcss; 00040 if (is_null($replacement)) { 00041 $replacement = ''; 00042 } 00043 00044 $css = str_replace($tag, $replacement, $css); 00045 00046 return $css; 00047 }