ILIAS  release_8 Revision v8.24
StaffMainBarProvider.php
Go to the documentation of this file.
1<?php
20
26
32
35use ilMyStaffGUI;
36use ilUtil;
37
43{
47 final public function getStaticTopItems(): array
48 {
49 return [];
50 }
51
55 final public function getStaticSubItems(): array
56 {
58 return [];
59 }
60
61 $this->dic->language()->loadLanguageModule('mst');
63 $items = [];
64 $top = StandardTopItemsProvider::getInstance()->getOrganisationIdentification();
65
66 $title = $this->dic->language()->txt("mm_staff_list");
67 $icon = $this->dic->ui()->factory()->symbol()->icon()->custom(
68 ilUtil::getImagePath("icon_stff.svg"),
69 $title
70 );
71
72 // My Staff
73 $items[] = $this->mainmenu->link($this->if->identifier('mm_pd_mst'))
74 ->withSymbol($icon)
75 ->withTitle($title)
76 ->withAction($this->dic->ctrl()->getLinkTargetByClass([
77 ilDashboardGUI::class,
78 ilMyStaffGUI::class,
79 ilMStListUsersGUI::class,
81 ->withParent($top)
82 ->withPosition(10)
83 ->withAvailableCallable(
84 static function () use ($dic) {
85 return (bool) ($dic->settings()->get('enable_my_staff'));
86 }
87 )
88 ->withVisibilityCallable(
89 function (): bool {
90 return (
92 )->hasCurrentUserAccessToMyStaff();
93 }
94 )->withNonAvailableReason($dic->ui()->factory()->legacy("{$dic->language()->txt('component_not_active')}"));
95
96 $title = $this->dic->language()->txt("mm_enrolments");
97 $icon = $this->dic->ui()->factory()->symbol()->icon()->custom(
98 ilUtil::getImagePath("icon_enrl.svg"),
99 $title
100 );
101
102 // My Enrolments
103 $items[] = $this->mainmenu->link($this->if->identifier('mm_pd_enrol'))
104 ->withSymbol($icon)
105 ->withTitle($title)
106 ->withAction($this->dic->ctrl()->getLinkTargetByClass([
107 ilDashboardGUI::class,
108 ilMyStaffGUI::class,
109 ilMStListCoursesGUI::class,
111 ->withParent($top)
112 ->withPosition(20)
113 ->withAvailableCallable(
114 function () use ($dic) {
115 return (bool) ($dic->settings()->get("enable_my_staff"));
116 }
117 )
118 ->withVisibilityCallable(
119 function (): bool {
120 return (
122 )->hasCurrentUserAccessToCourseMemberships();
123 }
124 )->withNonAvailableReason($dic->ui()->factory()->legacy("{$dic->language()->txt('component_not_active')}"));
125
126 // My Certificates
127 $icon = $this->dic->ui()->factory()->symbol()->icon()->standard(Standard::CERT, $title);
128 $items[] = $this->mainmenu->link($this->if->identifier("mm_pd_cert"))
129 ->withSymbol($icon)
130 ->withTitle($this->dic->language()->txt("mm_certificates"))
131 ->withAction($this->dic->ctrl()->getLinkTargetByClass([
132 ilDashboardGUI::class,
133 ilMyStaffGUI::class,
134 ilMStListCertificatesGUI::class,
136 ->withParent($top)
137 ->withPosition(30)
138 ->withAvailableCallable(
139 function (): bool {
140 return boolval($this->dic->settings()->get("enable_my_staff"));
141 }
142 )
143 ->withVisibilityCallable(
144 function (): bool {
145 return (
147 )->hasCurrentUserAccessToCertificates();
148 }
149 )->withNonAvailableReason($this->dic->ui()->factory()->legacy("{$this->dic->language()->txt("component_not_active")}"));
150
151 // My Competences
152 $icon = $this->dic->ui()->factory()->symbol()->icon()->standard(Standard::SKMG, $title);
153 $items[] = $this->mainmenu->link($this->if->identifier("mm_pd_comp"))
154 ->withSymbol($icon)
155 ->withTitle($this->dic->language()->txt("mm_skills"))
156 ->withAction($this->dic->ctrl()->getLinkTargetByClass([
157 ilDashboardGUI::class,
158 ilMyStaffGUI::class,
159 ilMStListCompetencesGUI::class,
161 ->withParent($top)
162 ->withPosition(30)
163 ->withAvailableCallable(
164 function (): bool {
165 return boolval($this->dic->settings()->get("enable_my_staff"));
166 }
167 )
168 ->withVisibilityCallable(
169 function (): bool {
170 return (
172 )->hasCurrentUserAccessToCompetences();
173 }
174 )->withNonAvailableReason($this->dic->ui()->factory()->legacy("{$this->dic->language()->txt("component_not_active")}"));
175
176 return $items;
177 }
178}
ui()
Get the interface to get services from UI framework.
Definition: Container.php:118
settings()
Get the interface to the settings.
Definition: Container.php:126
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ilMStListCertificatesGUI.
Class ilMStListCompetencesGUI.
Class ilMStListCoursesGUI.
Class ilMStListUsersGUI.
Class ilMyStaffGUI.
Util class various functions, usage as namespace.
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
if(!file_exists(getcwd() . '/ilias.ini.php'))
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: confirmReg.php:20
This describes the specific behavior of an ILIAS standard icon.
Definition: Standard.php:27
withSymbol(Symbol $symbol)
@inheritDoc
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...