MDL-27588 Fixed up several bugs with the formal_white theme
[moodle.git] / theme / fusion / lib.php
blob116462b0981b10139956e4d5c3b0df7e7cc0c92b
1 <?php
2 function fusion_set_linkcolor($css, $linkcolor) {
3 $tag = '[[setting:linkcolor]]';
4 $replacement = $linkcolor;
5 if (is_null($replacement)) {
6 $replacement = '#2d83d5';
8 $css = str_replace($tag, $replacement, $css);
11 return $css;
14 function fusion_set_customcss($css, $customcss) {
15 $tag = '[[setting:customcss]]';
16 $replacement = $customcss;
17 if (is_null($replacement)) {
18 $replacement = '';
20 $css = str_replace($tag, $replacement, $css);
21 return $css;
28 function fusion_process_css($css, $theme) {
30 if (!empty($theme->settings->linkcolor)) {
31 $linkcolor = $theme->settings->linkcolor;
32 } else {
33 $linkcolor = null;
35 $css = fusion_set_linkcolor($css, $linkcolor);
37 if (!empty($theme->settings->customcss)) {
38 $customcss = $theme->settings->customcss;
39 } else {
40 $customcss = null;
42 $css = fusion_set_customcss($css, $customcss);
44 return $css;