ILIAS  release_7 Revision v7.30-3-g800a261c036
StaffMainBarProvider.php
Go to the documentation of this file.
1<?php
2
4
16use ilMyStaffGUI;
17use ilUtil;
18
25{
26
30 public function getStaticTopItems() : array
31 {
32 return [];
33 }
34
35
39 public function getStaticSubItems() : array
40 {
41 $this->dic->language()->loadLanguageModule('mst');
43 $items = [];
44 $top = StandardTopItemsProvider::getInstance()->getOrganisationIdentification();
45
46 $title = $this->dic->language()->txt("mm_staff_list");
47 $icon = $this->dic->ui()->factory()->symbol()->icon()->custom(ilUtil::getImagePath("outlined/icon_stff.svg"), $title);
48
49 // My Staff
50 $items[] = $this->mainmenu->link($this->if->identifier('mm_pd_mst'))
51 ->withSymbol($icon)
52 ->withTitle($title)
53 ->withAction($this->dic->ctrl()->getLinkTargetByClass([
54 ilDashboardGUI::class,
55 ilMyStaffGUI::class,
56 ilMStListUsersGUI::class,
58 ->withParent($top)
59 ->withPosition(10)
60 ->withAvailableCallable(
61 static function () use ($dic) {
62 return (bool) ($dic->settings()->get('enable_my_staff'));
63 }
64 )
65 ->withVisibilityCallable(
66 static function () {
67 return (bool) ilMyStaffAccess::getInstance()->hasCurrentUserAccessToMyStaff();
68 }
69 )->withNonAvailableReason($dic->ui()->factory()->legacy("{$dic->language()->txt('component_not_active')}"));
70
71 $title = $this->dic->language()->txt("mm_enrolments");
72 $icon = $this->dic->ui()->factory()->symbol()->icon()->custom(ilUtil::getImagePath("outlined/icon_enrl.svg"), $title);
73
74 // My Enrolments
75 $items[] = $this->mainmenu->link($this->if->identifier('mm_pd_enrol'))
76 ->withSymbol($icon)
77 ->withTitle($title)
78 ->withAction($this->dic->ctrl()->getLinkTargetByClass([
79 ilDashboardGUI::class,
80 ilMyStaffGUI::class,
81 ilMStListCoursesGUI::class,
83 ->withParent($top)
84 ->withPosition(20)
85 ->withAvailableCallable(
86 function () use ($dic) {
87 return (bool) ($dic->settings()->get("enable_my_staff"));
88 }
89 )
90 ->withVisibilityCallable(
91 function () {
92 return (bool) ilMyStaffAccess::getInstance()->hasCurrentUserAccessToCourseMemberships();
93 }
94 )->withNonAvailableReason($dic->ui()->factory()->legacy("{$dic->language()->txt('component_not_active')}"));
95
96 // My Certificates
97 $icon = $this->dic->ui()->factory()->symbol()->icon()->standard(Standard::CERT, $title)->withIsOutlined(true);
98 $items[] = $this->mainmenu->link($this->if->identifier("mm_pd_cert"))
99 ->withSymbol($icon)
100 ->withTitle($this->dic->language()->txt("mm_certificates"))
101 ->withAction($this->dic->ctrl()->getLinkTargetByClass([
102 ilDashboardGUI::class,
103 ilMyStaffGUI::class,
104 ilMStListCertificatesGUI::class,
106 ->withParent($top)
107 ->withPosition(30)
108 ->withAvailableCallable(
109 function () : bool {
110 return boolval($this->dic->settings()->get("enable_my_staff"));
111 }
112 )
113 ->withVisibilityCallable(
114 function () : bool {
115 return boolval(ilMyStaffAccess::getInstance()->hasCurrentUserAccessToCertificates());
116 }
117 )->withNonAvailableReason($this->dic->ui()->factory()->legacy("{$this->dic->language()->txt("component_not_active")}"));
118
119
120 // My Competences
121 $icon = $this->dic->ui()->factory()->symbol()->icon()->standard(Standard::SKMG, $title)->withIsOutlined(true);
122 $items[] = $this->mainmenu->link($this->if->identifier("mm_pd_comp"))
123 ->withSymbol($icon)
124 ->withTitle($this->dic->language()->txt("mm_skills"))
125 ->withAction($this->dic->ctrl()->getLinkTargetByClass([
126 ilDashboardGUI::class,
127 ilMyStaffGUI::class,
128 ilMStListCompetencesGUI::class,
130 ->withParent($top)
131 ->withPosition(30)
132 ->withAvailableCallable(
133 function () : bool {
134 return boolval($this->dic->settings()->get("enable_my_staff"));
135 }
136 )
137 ->withVisibilityCallable(
138 function () : bool {
139 return boolval(ilMyStaffAccess::getInstance()->hasCurrentUserAccessToCompetences());
140 }
141 )->withNonAvailableReason($this->dic->ui()->factory()->legacy("{$this->dic->language()->txt("component_not_active")}"));
142
143
144 return $items;
145 }
146}
An exception for terminatinating execution or to throw for unit testing.
Class ilMStListCertificatesGUI.
Class ilMStListCompetencesGUI.
Class ilMStListCoursesGUI.
Class ilMStListUsersGUI.
Class ilMyStaffGUI.
@noRector
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
if(!file_exists(getcwd() . '/ilias.ini.php'))
registration confirmation script for ilias
Definition: confirmReg.php:12
This describes the specific behavior of an ILIAS standard icon.
Definition: Standard.php:11
withSymbol(Symbol $symbol)
@inheritDoc