ILIAS  trunk Revision v12.0_alpha-1540-g00f839d5fa1
StaffMainBarProvider.php
Go to the documentation of this file.
1<?php
2
20
33use ilMyStaffGUI;
34use ilUtil;
35
41{
45 final public function getStaticTopItems(): array
46 {
47 return [];
48 }
49
53 final public function getStaticSubItems(): array
54 {
56 return [];
57 }
58
59 $this->dic->language()->loadLanguageModule('mst');
61 $items = [];
62 $top = StandardTopItemsProvider::getInstance()->getOrganisationIdentification();
63
64 $title = $this->dic->language()->txt("mm_staff_list");
65 $icon = $this->dic->ui()->factory()->symbol()->icon()->custom(
66 ilUtil::getImagePath("standard/icon_stff.svg"),
67 $title
68 );
69
70 // My Staff
71 $items[] = $this->mainmenu->link($this->if->identifier('mm_pd_mst'))
72 ->withSymbol($icon)
73 ->withTitle($title)
74 ->withAction($this->dic->ctrl()->getLinkTargetByClass([
75 ilDashboardGUI::class,
76 ilMyStaffGUI::class,
77 ilMStListUsersGUI::class,
79 ->withParent($top)
80 ->withPosition(10)
81 ->withAvailableCallable(
82 static function () use ($dic) {
83 return (bool) ($dic->settings()->get('enable_my_staff'));
84 }
85 )
87 function (): bool {
88 return (
90 )->hasCurrentUserAccessToMyStaff();
91 }
92 )->withNonAvailableReason($dic->ui()->factory()->legacy()->content("{$dic->language()->txt('component_not_active')}"));
93
94 $title = $this->dic->language()->txt("mm_enrolments");
95 $icon = $this->dic->ui()->factory()->symbol()->icon()->custom(
96 ilUtil::getImagePath("standard/icon_enrl.svg"),
97 $title
98 );
99
100 // My Enrolments
101 $items[] = $this->mainmenu->link($this->if->identifier('mm_pd_enrol'))
102 ->withSymbol($icon)
103 ->withTitle($title)
104 ->withAction($this->dic->ctrl()->getLinkTargetByClass([
105 ilDashboardGUI::class,
106 ilMyStaffGUI::class,
107 ilMStListCoursesGUI::class,
109 ->withParent($top)
110 ->withPosition(20)
111 ->withAvailableCallable(
112 function () use ($dic) {
113 return (bool) ($dic->settings()->get("enable_my_staff"));
114 }
115 )
117 function (): bool {
118 return (
120 )->hasCurrentUserAccessToCourseMemberships();
121 }
122 )->withNonAvailableReason($dic->ui()->factory()->legacy()->content("{$dic->language()->txt('component_not_active')}"));
123
124 // My Certificates
125 $icon = $this->dic->ui()->factory()->symbol()->icon()->standard(Standard::CERT, $title);
126 $items[] = $this->mainmenu->link($this->if->identifier("mm_pd_cert"))
127 ->withSymbol($icon)
128 ->withTitle($this->dic->language()->txt("mm_certificates"))
129 ->withAction($this->dic->ctrl()->getLinkTargetByClass([
130 ilDashboardGUI::class,
131 ilMyStaffGUI::class,
132 ilMStListCertificatesGUI::class,
134 ->withParent($top)
135 ->withPosition(30)
136 ->withAvailableCallable(
137 function (): bool {
138 return boolval($this->dic->settings()->get("enable_my_staff"));
139 }
140 )
142 function (): bool {
143 return (
145 )->hasCurrentUserAccessToCertificates();
146 }
147 )->withNonAvailableReason($this->dic->ui()->factory()->legacy()->content("{$this->dic->language()->txt("component_not_active")}"));
148
149 // My Competences
150 $icon = $this->dic->ui()->factory()->symbol()->icon()->standard(Standard::SKMG, $title);
151 $items[] = $this->mainmenu->link($this->if->identifier("mm_pd_comp"))
152 ->withSymbol($icon)
153 ->withTitle($this->dic->language()->txt("mm_skills"))
154 ->withAction($this->dic->ctrl()->getLinkTargetByClass([
155 ilDashboardGUI::class,
156 ilMyStaffGUI::class,
157 ilMStListCompetencesGUI::class,
159 ->withParent($top)
160 ->withPosition(30)
161 ->withAvailableCallable(
162 function (): bool {
163 return boolval($this->dic->settings()->get("enable_my_staff"));
164 }
165 )
167 function (): bool {
168 return (
170 )->hasCurrentUserAccessToCompetences();
171 }
172 )->withNonAvailableReason($this->dic->ui()->factory()->legacy()->content("{$this->dic->language()->txt("component_not_active")}"));
173
174 return $items;
175 }
176}
ui()
Get the interface to get services from UI framework.
Definition: Container.php:127
settings()
Get the interface to the settings.
Definition: Container.php:135
@ilCtrl_Calls ilDashboardGUI: ILIAS\User\Profile\PersonalProfileGUI @ilCtrl_Calls ilDashboardGUI: ilO...
Class ilMStListCertificatesGUI.
Class ilMStListCompetencesGUI.
Class ilMStListCoursesGUI.
Class ilMStListUsersGUI.
Class ilMyStaffGUI.
Util class various functions, usage as namespace.
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
This describes the specific behavior of an ILIAS standard icon.
Definition: Standard.php:27
withAction(URI|Signal|string $action)
withParent(IdentificationInterface $identification)
withSymbol(Symbol $symbol)
@inheritDoc
withVisibilityCallable(callable $is_visible)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
if(!file_exists('../ilias.ini.php'))