Merge branch 'MDL-42043-master' of git://github.com/FMCorz/moodle

This commit is contained in:
Marina Glancy
2013-11-11 21:10:47 +11:00
3 changed files with 12 additions and 16 deletions
+3 -4
View File
@@ -4,7 +4,7 @@ function afterburner_process_css($css, $theme) {
// Set the background image for the logo
$logo = $theme->setting_file_url('logo', 'logo');
$css = afterburner_set_logo($css, $logo);
$css = afterburner_set_logo($css, $logo, $theme);
// Set custom CSS
if (!empty($theme->settings->customcss)) {
@@ -17,12 +17,11 @@ function afterburner_process_css($css, $theme) {
return $css;
}
function afterburner_set_logo($css, $logo) {
global $OUTPUT;
function afterburner_set_logo($css, $logo, $theme) {
$tag = '[[setting:logo]]';
$replacement = $logo;
if (is_null($replacement)) {
$replacement = $OUTPUT->pix_url('images/logo','theme');
$replacement = $theme->pix_url('images/logo','theme');
}
$css = str_replace($tag, $replacement, $css);
+3 -4
View File
@@ -49,12 +49,11 @@ function brick_set_headingcolor($css, $headingcolor) {
return $css;
}
function brick_set_logo($css, $logo) {
global $OUTPUT;
function brick_set_logo($css, $logo, $theme) {
$tag = '[[setting:logo]]';
$replacement = $logo;
if (is_null($replacement)) {
$replacement = $OUTPUT->pix_url('logo', 'theme');
$replacement = $theme->pix_url('logo', 'theme');
}
$css = str_replace($tag, $replacement, $css);
return $css;
@@ -112,7 +111,7 @@ function brick_process_css($css, $theme) {
} else {
$logo = null;
}
$css = brick_set_logo($css, $logo);
$css = brick_set_logo($css, $logo, $theme);
+6 -8
View File
@@ -71,7 +71,7 @@ function magazine_process_css($css, $theme) {
} else {
$background = null;
}
$css = magazine_set_background($css, $background);
$css = magazine_set_background($css, $background, $theme);
// Set the logo image
if (!empty($theme->settings->logo)) {
@@ -79,7 +79,7 @@ function magazine_process_css($css, $theme) {
} else {
$logo = null;
}
$css = magazine_set_logo($css, $logo);
$css = magazine_set_logo($css, $logo, $theme);
// Return the CSS
@@ -162,23 +162,21 @@ function magazine_set_forumback($css, $forumback) {
return $css;
}
function magazine_set_background($css, $background) {
global $OUTPUT;
function magazine_set_background($css, $background, $theme) {
$tag = '[[setting:background]]';
$replacement = $background;
if (is_null($replacement)) {
$replacement = $OUTPUT->pix_url('bg4', 'theme');
$replacement = $theme->pix_url('bg4', 'theme');
}
$css = str_replace($tag, $replacement, $css);
return $css;
}
function magazine_set_logo($css, $logo) {
global $OUTPUT;
function magazine_set_logo($css, $logo, $theme) {
$tag = '[[setting:logo]]';
$replacement = $logo;
if (is_null($replacement)) {
$replacement = $OUTPUT->pix_url('logo', 'theme');
$replacement = $theme->pix_url('logo', 'theme');
}
$css = str_replace($tag, $replacement, $css);
return $css;