Skip to content
Snippets Groups Projects
Commit f4327c23 authored by Kathrin Osswald's avatar Kathrin Osswald
Browse files

Fixed bug that theme Boost Campus Child did not show the favicon set in parent theme Boost Campus.

parent 47c4ee26
No related branches found
No related tags found
No related merge requests found
...@@ -6,6 +6,7 @@ Changes ...@@ -6,6 +6,7 @@ Changes
### Unreleased ### Unreleased
* 2020-09-24 - Fixed bug that theme Boost Campus Child did not show the favicon set in parent theme Boost Campus.
* 2020-06-09 - Improved SCSS settings to be used with admin_setting_scsscode that validates the code before saving. * 2020-06-09 - Improved SCSS settings to be used with admin_setting_scsscode that validates the code before saving.
### v3.8-r1 ### v3.8-r1
......
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Renderers to align Moodle's HTML with that expected by Bootstrap
*
* @package theme_boost_campus_child
* @copyright 2017 Kathrin Osswald, Ulm University kathrin.osswald@uni-ulm.de
* copyright based on code from theme_boost by Bas Brands
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
namespace theme_boost_campus_child\output;
use moodle_url;
use theme_config;
defined('MOODLE_INTERNAL') || die;
/**
* Extending the core_renderer interface.
*
* @copyright 2020 Kathrin Osswald, Ulm University kathrin.osswald@uni-ulm.de
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package theme_boost_campus_child
* @category output
*/
class core_renderer extends \core_renderer {
/**
* Override to be able to use uploaded images from admin_setting as well.
*
* Returns the moodle_url for the favicon.
*
* KIZ MODIFICATION: This renderer function is copied and modified from /lib/outputrenderers.php
*
* @since Moodle 2.5.1 2.6
* @return moodle_url The moodle_url for the favicon
*/
public function favicon() {
// MODIFICATION START.
// Get the theme Boost Campus config.
$bcconfig = theme_config::load('boost_campus');
// Get the theme Boost Campus favicon setting.
$bcconffavicon = get_config('theme_boost_campus', 'favicon');
if (!empty($bcconffavicon)) {
// Return the image that was saved in the theme Boost Campus favicon setting.
return $bcconfig->setting_file_url('favicon', 'favicon');
} else {
// Return the icon stored in boost_campus/pix folder.
return $bcconfig->image_url('favicon', 'theme');
}
// MODIFICATION END.
/* ORIGINAL START.
return $this->image_url('favicon', 'theme');
ORIGINAL END. */
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment