diff --git a/Services/Administration/GlobalScreen/classes/AdministrationMainBarProvider.php b/Services/Administration/GlobalScreen/classes/AdministrationMainBarProvider.php index a8088e65ba14..ee6b2206fb4d 100644 --- a/Services/Administration/GlobalScreen/classes/AdministrationMainBarProvider.php +++ b/Services/Administration/GlobalScreen/classes/AdministrationMainBarProvider.php @@ -117,17 +117,17 @@ public function getStaticSubItems(): array protected function getIconForGroup(string $group, string $title): Icon { $icon_map = array( - "maintenance" => "standard/icon_sysa", + "maintenance" => "icon_sysa", "layout_and_navigation" => "icon_laya", - "repository_and_objects" => "standard/icon_repa", - "personal_workspace" => "standard/icon_pwsa", - "achievements" => "standard/icon_achva", - "communication" => "standard/icon_coma", - "user_administration" => "standard/icon_usra", - "search_and_find" => "standard/icon_safa", - "extending_ilias" => "standard/icon_exta" + "repository_and_objects" => "icon_repa", + "personal_workspace" => "icon_pwsa", + "achievements" => "icon_achva", + "communication" => "icon_coma", + "user_administration" => "icon_usra", + "search_and_find" => "icon_safa", + "extending_ilias" => "icon_exta" ); - $icon_path = \ilUtil::getImagePath($icon_map[$group] . ".svg"); + $icon_path = \ilUtil::getImagePath("standard/" . $icon_map[$group] . ".svg"); return $this->dic->ui()->factory()->symbol()->icon()->custom($icon_path, $title); } diff --git a/Services/Object/classes/class.ilObject.php b/Services/Object/classes/class.ilObject.php index bddeb5a5561e..8e24ca07f681 100755 --- a/Services/Object/classes/class.ilObject.php +++ b/Services/Object/classes/class.ilObject.php @@ -1819,9 +1819,9 @@ public static function getIconForReference( return ilUtil::getImagePath("standard/icon_cmps.svg"); } - return ilUtil::getImagePath("icon_" . $type . ".svg"); + return ilUtil::getImagePath("standard/icon_" . $type . ".svg"); } else { - return "./images/icon_" . $type . ".svg"; + return "./images/standard/icon_" . $type . ".svg"; } } diff --git a/src/UI/Implementation/Component/Symbol/Icon/Renderer.php b/src/UI/Implementation/Component/Symbol/Icon/Renderer.php index 71a2d7a56a12..3658807e8f73 100644 --- a/src/UI/Implementation/Component/Symbol/Icon/Renderer.php +++ b/src/UI/Implementation/Component/Symbol/Icon/Renderer.php @@ -93,13 +93,22 @@ protected function renderLabel(Component\Component $component, Template $tpl): T protected function getStandardIconPath(Component\Symbol\Icon\Icon $icon): string { $name = $icon->getName(); - if (!in_array($name, $icon->getAllStandardHandles())) { + $is_in_standard_icon_list = in_array($name, $icon->getAllStandardHandles()); + $is_in_page_editor_icon_list = in_array($name, $icon->getAllStandardPageEditorHandles()); + if (!$is_in_standard_icon_list && !$is_in_page_editor_icon_list) { $name = self::DEFAULT_ICON_NAME; } $pattern = self::ICON_NAME_PATTERN; + $icon_path_name = ''; $icon_name = sprintf($pattern, $name); - return $this->getImagePathResolver()->resolveImagePath($icon_name); + if ($is_in_page_editor_icon_list) { + $icon_path_name = 'page_editor/' . $icon_name; + } else { + $icon_path_name = 'standard/' . $icon_name; + } + + return $this->getImagePathResolver()->resolveImagePath($icon_path_name); } /** diff --git a/src/UI/Implementation/Component/Symbol/Icon/Standard.php b/src/UI/Implementation/Component/Symbol/Icon/Standard.php index c63a66b804a2..43758021a2a7 100644 --- a/src/UI/Implementation/Component/Symbol/Icon/Standard.php +++ b/src/UI/Implementation/Component/Symbol/Icon/Standard.php @@ -139,6 +139,17 @@ class Standard extends Icon implements C\Symbol\Icon\Standard self::CMIS, self::TASK, self::REP, + self::LSO, + self::LSOS, + self::ADN, + self::NOTA, + self::GCON, + self::CON, + self::FILS, + self::TALA + ]; + + private static array $standard_page_editor_icons = [ self::PEAC, self::PEADL, self::PEADT, @@ -165,14 +176,6 @@ class Standard extends Icon implements C\Symbol\Icon\Standard self::PESC, self::PETMP, self::PEUSR, - self::LSO, - self::LSOS, - self::ADN, - self::NOTA, - self::GCON, - self::CON, - self::FILS, - self::TALA ]; public function __construct(string $name, string $label, string $size, bool $is_disabled) @@ -198,4 +201,13 @@ public function getAllStandardHandles(): array { return self::$standard_icons; } + + /** + * get all defined constants + * @return string[] + */ + public function getAllStandardPageEditorHandles(): array + { + return self::$standard_page_editor_icons; + } } diff --git a/tests/UI/Component/Symbol/Icon/IconTest.php b/tests/UI/Component/Symbol/Icon/IconTest.php index 9a4533ee51fc..ca3a5b0b0079 100644 --- a/tests/UI/Component/Symbol/Icon/IconTest.php +++ b/tests/UI/Component/Symbol/Icon/IconTest.php @@ -30,7 +30,7 @@ */ class IconTest extends ILIAS_UI_TestBase { - public const ICON_PATH = __DIR__ . '/../../../../../templates/default/images/'; + public const ICON_PATH = __DIR__ . '/../../../../../templates/default/images/standard/'; public const ICON_PATH_REL = './templates/default/images/'; private function getIconFactory(): I\Component\Symbol\Icon\Factory