Skip to content

Commit

Permalink
Merge branch 'MDL-59112-32' of git://github.com/jleyva/moodle into MO…
Browse files Browse the repository at this point in the history
…ODLE_32_STABLE
  • Loading branch information
stronk7 committed Jun 12, 2017
2 parents a4f5cdd + 70dcc1e commit 5e39900
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions theme/clean/classes/core_renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,14 @@ protected function get_home_ref($returnlink = true) {
* @return moodle_url|false
*/
public function get_logo_url($maxwidth = null, $maxheight = 100) {
global $CFG;

if (!empty($this->page->theme->settings->logo)) {
return $this->page->theme->setting_file_url('logo', 'logo');
$url = $this->page->theme->setting_file_url('logo', 'logo');
// Get a URL suitable for moodle_url.
$relativebaseurl = preg_replace('|^https?://|i', '//', $CFG->wwwroot);
$url = str_replace($relativebaseurl, '', $url);
return new moodle_url($url);
}
return parent::get_logo_url($maxwidth, $maxheight);
}
Expand All @@ -146,8 +152,14 @@ public function get_logo_url($maxwidth = null, $maxheight = 100) {
* @return moodle_url|false
*/
public function get_compact_logo_url($maxwidth = 100, $maxheight = 100) {
global $CFG;

if (!empty($this->page->theme->settings->smalllogo)) {
return $this->page->theme->setting_file_url('smalllogo', 'smalllogo');
$url = $this->page->theme->setting_file_url('smalllogo', 'smalllogo');
// Get a URL suitable for moodle_url.
$relativebaseurl = preg_replace('|^https?://|i', '//', $CFG->wwwroot);
$url = str_replace($relativebaseurl, '', $url);
return new moodle_url($url);
}
return parent::get_compact_logo_url($maxwidth, $maxheight);
}
Expand Down

0 comments on commit 5e39900

Please sign in to comment.