ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 52 of file StaffMainBarProvider.php.

52 : 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 (
88 new ilMyStaffCachedAccessDecorator($this->dic, ilMyStaffAccess::getInstance())
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 (
118 new ilMyStaffCachedAccessDecorator($this->dic, ilMyStaffAccess::getInstance())
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 (
143 new ilMyStaffCachedAccessDecorator($this->dic, ilMyStaffAccess::getInstance())
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 (
168 new ilMyStaffCachedAccessDecorator($this->dic, ilMyStaffAccess::getInstance())
169 )->hasCurrentUserAccessToCompetences();
170 }
171 )->withNonAvailableReason($this->dic->ui()->factory()->legacy()->content("{$this->dic->language()->txt("component_not_active")}"));
172
173 return $items;
174 }
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 44 of file StaffMainBarProvider.php.

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

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