mirror of
https://github.com/moodle/moodle.git
synced 2025-08-09 02:46:40 +02:00
MDL-82740 core: Consider theme when checking for monologo icons
This commit is contained in:
parent
f6141a67d8
commit
23a7976a4b
1 changed files with 7 additions and 1 deletions
|
@ -25,6 +25,7 @@
|
||||||
namespace core;
|
namespace core;
|
||||||
|
|
||||||
use core\exception\coding_exception;
|
use core\exception\coding_exception;
|
||||||
|
use core\output\theme_config;
|
||||||
use stdClass;
|
use stdClass;
|
||||||
use ArrayIterator;
|
use ArrayIterator;
|
||||||
use DirectoryIterator;
|
use DirectoryIterator;
|
||||||
|
@ -1680,11 +1681,16 @@ $cache = ' . var_export($cache, true) . ';
|
||||||
* @return bool True if the plugin has a monologo icon
|
* @return bool True if the plugin has a monologo icon
|
||||||
*/
|
*/
|
||||||
public static function has_monologo_icon(string $plugintype, string $pluginname): bool {
|
public static function has_monologo_icon(string $plugintype, string $pluginname): bool {
|
||||||
|
global $PAGE;
|
||||||
$plugindir = self::get_plugin_directory($plugintype, $pluginname);
|
$plugindir = self::get_plugin_directory($plugintype, $pluginname);
|
||||||
if ($plugindir === null) {
|
if ($plugindir === null) {
|
||||||
return false;
|
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…
Add table
Add a link
Reference in a new issue