diff --git a/lib/classes/component.php b/lib/classes/component.php index d954186e738e2..d37c5e4af1b22 100644 --- a/lib/classes/component.php +++ b/lib/classes/component.php @@ -1566,10 +1566,15 @@ public static function get_core_api_names(): array { * @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; } }