ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
SkillMainBarProvider.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
23 
28 use ilSetting;
29 
36 {
40  public function getStaticTopItems(): array
41  {
42  return [];
43  }
44 
45 
49  public function getStaticSubItems(): array
50  {
51  global $DIC;
52 
53  $title = $this->dic->language()->txt("mm_skills");
54  $icon = $this->dic->ui()->factory()->symbol()->icon()->standard("skmg", $title);
55  $icon = $this->dic->ui()->factory()->symbol()->icon()->standard(Standard::SKMG, $title);
56 
57  $ctrl = $DIC->ctrl();
58  $ctrl->clearParametersByClass("ilPersonalSkillsGUI");
59  $ctrl->setParameterByClass("ilPersonalSkillsGUI", "list_mode", \ilPersonalSkillsGUI::LIST_PROFILES);
60  $link = $ctrl->getLinkTargetByClass(["ilDashboardGUI", "ilAchievementsGUI", "ilPersonalSkillsGUI"]);
61  $ctrl->clearParameterByClass("ilPersonalSkillsGUI", "list_mode");
62  return [
63  $this->mainmenu->link($this->if->identifier('mm_pd_skill'))
64  ->withTitle($title)
65  ->withAction($link)
66  ->withParent(StandardTopItemsProvider::getInstance()->getAchievementsIdentification())
67  ->withPosition(20)
68  ->withSymbol($icon)
69  ->withNonAvailableReason($this->dic->ui()->factory()->legacy($this->dic->language()->txt('component_not_active')))
70  ->withAvailableCallable(
71  static function (): bool {
72  $skmg_set = new ilSetting("skmg");
73 
74  return (bool) ($skmg_set->get("enable_skmg"));
75  }
76  ),
77  ];
78  }
79 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
if(!file_exists('../ilias.ini.php'))
global $DIC
Definition: shib_login.php:25