MDL-34916 theme_formal_white: added support for relative path of logos

This commit is contained in:
Kordan
2012-09-04 09:52:13 +02:00
parent 569f1ad63b
commit 087c28d62e
4 changed files with 11 additions and 2 deletions
+3
View File
@@ -36,6 +36,9 @@ if (!empty($PAGE->theme->settings->frontpagelogourl)) {
} else {
$logourl = $OUTPUT->pix_url('logo', 'theme');
}
if (strtolower(substr($logourl, 0, 4)) != 'http') {
$logourl = $CFG->wwwroot.'/'.$logourl;
}
$hasframe = !isset($PAGE->theme->settings->noframe) || !$PAGE->theme->settings->noframe;
+3
View File
@@ -31,6 +31,9 @@ if ($hascustommenu) {
/************************************************************************************************/
if (!empty($PAGE->theme->settings->customlogourl)) {
$logourl = $PAGE->theme->settings->customlogourl;
if (strtolower(substr($logourl, 0, 4)) != 'http') {
$logourl = $CFG->wwwroot.'/'.$logourl;
}
} else {
$logourl = $OUTPUT->pix_url('logo_small', 'theme');
}
+3
View File
@@ -26,6 +26,9 @@ if ($hascustommenu) {
/************************************************************************************************/
if (!empty($PAGE->theme->settings->customlogourl)) {
$logourl = $PAGE->theme->settings->customlogourl;
if (strtolower(substr($logourl, 0, 4)) != 'http') {
$logourl = $CFG->wwwroot.'/'.$logourl;
}
} else {
$logourl = $OUTPUT->pix_url('logo_small', 'theme');
}
+2 -2
View File
@@ -47,7 +47,7 @@ if ($ADMIN->fulltree) {
$title = get_string('customlogourl','theme_formal_white');
$description = get_string('customlogourldesc', 'theme_formal_white');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, $default, PARAM_URL);
$setting = new admin_setting_configtext($name, $title, $description, $default, PARAM_RAW); // we want it accepting ../ at the beginning. Security is not at its top but Moodle trusts admins.
$settings->add($setting);
// Custom front page site logo setting
@@ -55,7 +55,7 @@ if ($ADMIN->fulltree) {
$title = get_string('frontpagelogourl','theme_formal_white');
$description = get_string('frontpagelogourldesc', 'theme_formal_white');
$default = '';
$setting = new admin_setting_configtext($name, $title, $description, $default, PARAM_URL);
$setting = new admin_setting_configtext($name, $title, $description, $default, PARAM_RAW); // we want it accepting ../ at the beginning. Security is not at its top but Moodle trusts admins.
$settings->add($setting);
// page header background colour setting