mirror of
https://github.com/moodle/moodle.git
synced 2025-01-29 11:46:19 +01:00
MDL-82740 core: Check for monologo icons in theme overrides
This commit is contained in:
parent
62c4f8a76c
commit
ad913b65ee
@ -1566,10 +1566,15 @@ $cache = ' . var_export($cache, true) . ';
|
||||
* @return bool True if the plugin has a monologo icon
|
||||
*/
|
||||
public static function has_monologo_icon(string $plugintype, string $pluginname): bool {
|
||||
global $PAGE;
|
||||
$plugindir = self::get_plugin_directory($plugintype, $pluginname);
|
||||
if ($plugindir === null) {
|
||||
return false;
|
||||
}
|
||||
return file_exists("$plugindir/pix/monologo.svg") || file_exists("$plugindir/pix/monologo.png");
|
||||
$theme = \theme_config::load($PAGE->theme->name);
|
||||
$component = self::normalize_componentname("{$plugintype}_{$pluginname}");
|
||||
$hassvgmonologo = $theme->resolve_image_location('monologo', $component, true) !== null;
|
||||
$haspngmonologo = $theme->resolve_image_location('monologo', $component) !== null;
|
||||
return $haspngmonologo || $hassvgmonologo;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user