Skip to content
Snippets Groups Projects
Commit bafe2728 authored by Alexander Bias's avatar Alexander Bias
Browse files

Bugfix: Return Boost Campus favicon as moodle_url instead of string, solves #120

parent 1143a534
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,7 @@ Changes
### Unreleased
* 2022-11-03 - Bugfix: Return Boost Campus favicon as moodle_url instead of string, solves #120.
* 2022-07-10 - Add Capabilities section to README.md
### v3.11-r3
......
......@@ -46,6 +46,7 @@ use paging_bar;
use url_select;
use context_course;
use pix_icon;
use context_system;
/**
* Extending the core_renderer interface.
......@@ -97,14 +98,21 @@ class core_renderer extends \core_renderer {
*
* @since Moodle 2.5.1 2.6
* @return moodle_url The moodle_url for the favicon
* @throws \moodle_exception
*/
public function favicon() {
// MODIFICATION START.
if (!empty($this->page->theme->settings->favicon)) {
return $this->page->theme->setting_file_url('favicon', 'favicon');
} else {
$logo = null;
if (!during_initial_install()) {
$logo = get_config('theme_boost_campus', 'favicon');
}
if (empty($logo)) {
return $this->image_url('favicon', 'theme');
}
// Use $CFG->themerev to prevent browser caching when the file changes.
return moodle_url::make_pluginfile_url(context_system::instance()->id, 'theme_boost_campus', 'favicon', '',
theme_get_revision(), $logo);
// MODIFICATION END.
// @codingStandardsIgnoreStart
/* ORIGINAL START.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment