ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
StaffMainBarProvider.php
Go to the documentation of this file.
1<?php
19
32use ilMyStaffGUI;
33use ilUtil;
34
40{
44 final public function getStaticTopItems(): array
45 {
46 return [];
47 }
48
52 final public function getStaticSubItems(): array
53 {
55 return [];
56 }
57
58 $this->dic->language()->loadLanguageModule('mst');
60 $items = [];
61 $top = StandardTopItemsProvider::getInstance()->getOrganisationIdentification();
62
63 $title = $this->dic->language()->txt("mm_staff_list");
64 $icon = $this->dic->ui()->factory()->symbol()->icon()->custom(
65 ilUtil::getImagePath("standard/icon_stff.svg"),
66 $title
67 );
68
69 // My Staff
70 $items[] = $this->mainmenu->link($this->if->identifier('mm_pd_mst'))
71 ->withSymbol($icon)
72 ->withTitle($title)
73 ->withAction($this->dic->ctrl()->getLinkTargetByClass([
74 ilDashboardGUI::class,
75 ilMyStaffGUI::class,
76 ilMStListUsersGUI::class,
78 ->withParent($top)
79 ->withPosition(10)
80 ->withAvailableCallable(
81 static function () use ($dic) {
82 return (bool) ($dic->settings()->get('enable_my_staff'));
83 }
84 )
86 function (): bool {
87 return (
89 )->hasCurrentUserAccessToMyStaff();
90 }
91 )->withNonAvailableReason($dic->ui()->factory()->legacy()->content("{$dic->language()->txt('component_not_active')}"));
92
93 $title = $this->dic->language()->txt("mm_enrolments");
94 $icon = $this->dic->ui()->factory()->symbol()->icon()->custom(
95 ilUtil::getImagePath("standard/icon_enrl.svg"),
96 $title
97 );
98
99 // My Enrolments
100 $items[] = $this->mainmenu->link($this->if->identifier('mm_pd_enrol'))
101 ->withSymbol($icon)
102 ->withTitle($title)
103 ->withAction($this->dic->ctrl()->getLinkTargetByClass([
104 ilDashboardGUI::class,
105 ilMyStaffGUI::class,
106 ilMStListCoursesGUI::class,
108 ->withParent($top)
109 ->withPosition(20)
110 ->withAvailableCallable(
111 function () use ($dic) {
112 return (bool) ($dic->settings()->get("enable_my_staff"));
113 }
114 )
116 function (): bool {
117 return (
119 )->hasCurrentUserAccessToCourseMemberships();
120 }
121 )->withNonAvailableReason($dic->ui()->factory()->legacy()->content("{$dic->language()->txt('component_not_active')}"));
122
123 // My Certificates
124 $icon = $this->dic->ui()->factory()->symbol()->icon()->standard(Standard::CERT, $title);
125 $items[] = $this->mainmenu->link($this->if->identifier("mm_pd_cert"))
126 ->withSymbol($icon)
127 ->withTitle($this->dic->language()->txt("mm_certificates"))
128 ->withAction($this->dic->ctrl()->getLinkTargetByClass([
129 ilDashboardGUI::class,
130 ilMyStaffGUI::class,
131 ilMStListCertificatesGUI::class,
133 ->withParent($top)
134 ->withPosition(30)
135 ->withAvailableCallable(
136 function (): bool {
137 return boolval($this->dic->settings()->get("enable_my_staff"));
138 }
139 )
141 function (): bool {
142 return (
144 )->hasCurrentUserAccessToCertificates();
145 }
146 )->withNonAvailableReason($this->dic->ui()->factory()->legacy()->content("{$this->dic->language()->txt("component_not_active")}"));
147
148 // My Competences
149 $icon = $this->dic->ui()->factory()->symbol()->icon()->standard(Standard::SKMG, $title);
150 $items[] = $this->mainmenu->link($this->if->identifier("mm_pd_comp"))
151 ->withSymbol($icon)
152 ->withTitle($this->dic->language()->txt("mm_skills"))
153 ->withAction($this->dic->ctrl()->getLinkTargetByClass([
154 ilDashboardGUI::class,
155 ilMyStaffGUI::class,
156 ilMStListCompetencesGUI::class,
158 ->withParent($top)
159 ->withPosition(30)
160 ->withAvailableCallable(
161 function (): bool {
162 return boolval($this->dic->settings()->get("enable_my_staff"));
163 }
164 )
166 function (): bool {
167 return (
169 )->hasCurrentUserAccessToCompetences();
170 }
171 )->withNonAvailableReason($this->dic->ui()->factory()->legacy()->content("{$this->dic->language()->txt("component_not_active")}"));
172
173 return $items;
174 }
175}
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'))