ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
SkillMainBarProvider.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
27 use 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 }
if(!file_exists('../ilias.ini.php'))
global $DIC
Definition: shib_login.php:22