Merge branch 'MDL-59112-master' of git://github.com/jleyva/moodle

This commit is contained in:
Eloy Lafuente (stronk7)
2017-06-14 12:30:38 +01:00
committed by Dan Poltawski
+14 -2
View File
@@ -130,8 +130,14 @@ class theme_clean_core_renderer extends theme_bootstrapbase_core_renderer {
* @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);
}
@@ -146,8 +152,14 @@ class theme_clean_core_renderer extends theme_bootstrapbase_core_renderer {
* @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);
}