ILIAS  trunk Revision v12.0_alpha-1541-g23eaa5e013d
ILIAS\MyStaff\Provider\StaffMainBarProvider Class Reference

Class StaffMainBarProvider. More...

+ Inheritance diagram for ILIAS\MyStaff\Provider\StaffMainBarProvider:
+ Collaboration diagram for ILIAS\MyStaff\Provider\StaffMainBarProvider:

Public Member Functions

 getStaticTopItems ()
 @inheritDoc More...
 
 getStaticSubItems ()
 @inheritDoc More...
 
- Public Member Functions inherited from ILIAS\GlobalScreen\Scope\MainMenu\Provider\AbstractStaticMainMenuProvider
 __construct (Container $dic)
 @inheritDoc More...
 
 getAllIdentifications ()
 @inheritDoc More...
 
 provideTypeInformation ()
 @inheritDoc More...
 
- Public Member Functions inherited from ILIAS\GlobalScreen\Provider\AbstractProvider
 __construct (protected Container $dic)
 
 getFullyQualifiedClassName ()
 
 getProviderNameForPresentation ()
 
 getFullyQualifiedClassName ()
 
 getProviderNameForPresentation ()
 
 getStaticTopItems ()
 
 getStaticSubItems ()
 
 provideTypeInformation ()
 
 getAllIdentifications ()
 

Additional Inherited Members

- Protected Member Functions inherited from ILIAS\GlobalScreen\Provider\AbstractProvider
 globalScreen ()
 
- Protected Attributes inherited from ILIAS\GlobalScreen\Scope\MainMenu\Provider\AbstractStaticMainMenuProvider
Container $dic
 
IdentificationProviderInterface $if
 
MainMenuItemFactory $mainmenu
 

Detailed Description

Member Function Documentation

◆ getStaticSubItems()

ILIAS\MyStaff\Provider\StaffMainBarProvider::getStaticSubItems ( )
final

@inheritDoc

Implements ILIAS\GlobalScreen\Scope\MainMenu\Provider\StaticMainMenuProvider.

Definition at line 53 of file StaffMainBarProvider.php.

53 : 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 (
89 new ilMyStaffCachedAccessDecorator($this->dic, ilMyStaffAccess::getInstance())
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 (
119 new ilMyStaffCachedAccessDecorator($this->dic, ilMyStaffAccess::getInstance())
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 (
144 new ilMyStaffCachedAccessDecorator($this->dic, ilMyStaffAccess::getInstance())
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 (
169 new ilMyStaffCachedAccessDecorator($this->dic, ilMyStaffAccess::getInstance())
170 )->hasCurrentUserAccessToCompetences();
171 }
172 )->withNonAvailableReason($this->dic->ui()->factory()->legacy()->content("{$this->dic->language()->txt("component_not_active")}"));
173
174 return $items;
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
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
withAction(URI|Signal|string $action)
withParent(IdentificationInterface $identification)
withSymbol(Symbol $symbol)
@inheritDoc
withVisibilityCallable(callable $is_visible)
if(!file_exists('../ilias.ini.php'))

References ILIAS\GlobalScreen\Scope\MainMenu\Provider\AbstractStaticMainMenuProvider\$dic, ILIAS\UI\Component\Symbol\Icon\Standard\CERT, ilMStListCertificatesGUI\CMD_INDEX, ilMStListCompetencesGUI\CMD_INDEX, ilMStListCoursesGUI\CMD_INDEX, ilMStListUsersGUI\CMD_INDEX, ilUtil\getImagePath(), ILIAS\MainMenu\Provider\StandardTopItemsProvider\getInstance(), ILIAS\MyStaff\ilMyStaffAccess\getInstance(), if, ILIAS\MyStaff\ilMyStaffAccess\isMyStaffActive(), ILIAS\DI\Container\settings(), ILIAS\UI\Component\Symbol\Icon\Standard\SKMG, ILIAS\DI\Container\ui(), ILIAS\GlobalScreen\Scope\Footer\Factory\withAction(), ILIAS\GlobalScreen\Scope\Footer\Factory\withParent(), ILIAS\GlobalScreen\Scope\MainMenu\Factory\withSymbol(), and ILIAS\GlobalScreen\Scope\withVisibilityCallable().

+ Here is the call graph for this function:

◆ getStaticTopItems()

ILIAS\MyStaff\Provider\StaffMainBarProvider::getStaticTopItems ( )
final

@inheritDoc

Implements ILIAS\GlobalScreen\Scope\MainMenu\Provider\StaticMainMenuProvider.

Definition at line 45 of file StaffMainBarProvider.php.

45 : array
46 {
47 return [];
48 }

The documentation for this class was generated from the following file: