Merge branch 'MDL-39629_master' of git://github.com/kordan/moodle

This commit is contained in:
Sam Hemelryk 2013-06-12 09:48:56 +12:00
commit ac547b717a
4 changed files with 6 additions and 17 deletions

View File

@ -30,15 +30,12 @@ if ($hascustommenu) {
/************************************************************************************************/
if (!empty($PAGE->theme->settings->frontpagelogourl)) {
$logourl = $PAGE->theme->settings->frontpagelogourl;
$logourl = $PAGE->theme->setting_file_url('frontpagelogourl', 'frontpagelogourl');
} else if (!empty($PAGE->theme->settings->customlogourl)) {
$logourl = $PAGE->theme->settings->customlogourl;
$logourl = $PAGE->theme->setting_file_url('customlogourl', 'customlogourl');
} 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;

View File

@ -40,10 +40,7 @@ if ($hascustommenu) {
/************************************************************************************************/
if (!empty($PAGE->theme->settings->customlogourl)) {
$logourl = $PAGE->theme->settings->customlogourl;
if (strtolower(substr($logourl, 0, 4)) != 'http') {
$logourl = $CFG->wwwroot.'/'.$logourl;
}
$logourl = $PAGE->theme->setting_file_url('customlogourl', 'customlogourl');
} else {
$logourl = $OUTPUT->pix_url('logo_small', 'theme');
}

View File

@ -35,10 +35,7 @@ if ($hascustommenu) {
/************************************************************************************************/
if (!empty($PAGE->theme->settings->customlogourl)) {
$logourl = $PAGE->theme->settings->customlogourl;
if (strtolower(substr($logourl, 0, 4)) != 'http') {
$logourl = $CFG->wwwroot.'/'.$logourl;
}
$logourl = $PAGE->theme->setting_file_url('customlogourl', 'customlogourl');
} else {
$logourl = $OUTPUT->pix_url('logo_small', 'theme');
}

View File

@ -50,8 +50,7 @@ if ($ADMIN->fulltree) {
$name = 'theme_formal_white/customlogourl';
$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_RAW); // we want it accepting ../ at the beginning. Security is not at its top but Moodle trusts admins.
$setting = new admin_setting_configstoredfile($name, $title, $description, 'customlogourl');
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);
@ -59,8 +58,7 @@ if ($ADMIN->fulltree) {
$name = 'theme_formal_white/frontpagelogourl';
$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_RAW); // we want it accepting ../ at the beginning. Security is not at its top but Moodle trusts admins.
$setting = new admin_setting_configstoredfile($name, $title, $description, 'frontpagelogourl');
$setting->set_updatedcallback('theme_reset_all_caches');
$settings->add($setting);