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
Branches
Tags
No related merge requests found
...@@ -6,6 +6,7 @@ Changes ...@@ -6,6 +6,7 @@ Changes
### Unreleased ### 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 * 2022-07-10 - Add Capabilities section to README.md
### v3.11-r3 ### v3.11-r3
......
...@@ -46,6 +46,7 @@ use paging_bar; ...@@ -46,6 +46,7 @@ use paging_bar;
use url_select; use url_select;
use context_course; use context_course;
use pix_icon; use pix_icon;
use context_system;
/** /**
* Extending the core_renderer interface. * Extending the core_renderer interface.
...@@ -97,14 +98,21 @@ class core_renderer extends \core_renderer { ...@@ -97,14 +98,21 @@ class core_renderer extends \core_renderer {
* *
* @since Moodle 2.5.1 2.6 * @since Moodle 2.5.1 2.6
* @return moodle_url The moodle_url for the favicon * @return moodle_url The moodle_url for the favicon
* @throws \moodle_exception
*/ */
public function favicon() { public function favicon() {
// MODIFICATION START. // MODIFICATION START.
if (!empty($this->page->theme->settings->favicon)) { $logo = null;
return $this->page->theme->setting_file_url('favicon', 'favicon'); if (!during_initial_install()) {
} else { $logo = get_config('theme_boost_campus', 'favicon');
}
if (empty($logo)) {
return $this->image_url('favicon', 'theme'); 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. // MODIFICATION END.
// @codingStandardsIgnoreStart // @codingStandardsIgnoreStart
/* ORIGINAL START. /* ORIGINAL START.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment