ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
SkillMainBarProvider.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
27use ilSetting;
28
35{
39 public function getStaticTopItems(): array
40 {
41 return [];
42 }
43
44
48 public function getStaticSubItems(): array
49 {
50 global $DIC;
51
52 $title = $this->dic->language()->txt("mm_skills");
53 $icon = $this->dic->ui()->factory()->symbol()->icon()->standard("skmg", $title);
54 $icon = $this->dic->ui()->factory()->symbol()->icon()->standard(Standard::SKMG, $title);
55
56 $ctrl = $DIC->ctrl();
57 $ctrl->clearParametersByClass("ilPersonalSkillsGUI");
58 $ctrl->setParameterByClass("ilPersonalSkillsGUI", "list_mode", \ilPersonalSkillsGUI::LIST_PROFILES);
59 $link = $ctrl->getLinkTargetByClass(["ilDashboardGUI", "ilAchievementsGUI", "ilPersonalSkillsGUI"]);
60 $ctrl->clearParameterByClass("ilPersonalSkillsGUI", "list_mode");
61 return [
62 $this->mainmenu->link($this->if->identifier('mm_pd_skill'))
63 ->withTitle($title)
64 ->withAction($link)
65 ->withParent(StandardTopItemsProvider::getInstance()->getAchievementsIdentification())
66 ->withPosition(20)
67 ->withSymbol($icon)
68 ->withNonAvailableReason($this->dic->ui()->factory()->legacy()->content($this->dic->language()->txt('component_not_active')))
69 ->withAvailableCallable(
70 static function (): bool {
71 $skmg_set = new ilSetting("skmg");
72
73 return (bool) ($skmg_set->get("enable_skmg"));
74 }
75 ),
76 ];
77 }
78}
ILIAS Setting Class.
This describes how an icon could be modified during construction of UI.
Definition: Icon.php:29
This describes the specific behavior of an ILIAS standard icon.
Definition: Standard.php:27
if(!file_exists('../ilias.ini.php'))
global $DIC
Definition: shib_login.php:26