ILIAS  release_8 Revision v8.23
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 ()
 
 getStaticSubItems ()
 
- Public Member Functions inherited from ILIAS\GlobalScreen\Scope\MainMenu\Provider\AbstractStaticMainMenuProvider
 __construct (Container $dic)
 
 getAllIdentifications ()
 
 provideTypeInformation ()
 
- Public Member Functions inherited from ILIAS\GlobalScreen\Provider\AbstractProvider
 __construct (Container $dic)
 
 getFullyQualifiedClassName ()
 
 getProviderNameForPresentation ()
 

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
 
- Protected Attributes inherited from ILIAS\GlobalScreen\Provider\AbstractProvider
Container $dic
 

Detailed Description

Member Function Documentation

◆ getStaticSubItems()

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

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

Definition at line 55 of file StaffMainBarProvider.php.

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

55  : array
56  {
58  return [];
59  }
60 
61  $this->dic->language()->loadLanguageModule('mst');
62  $dic = $this->dic;
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 (
91  new ilMyStaffCachedAccessDecorator($this->dic, ilMyStaffAccess::getInstance())
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 (
121  new ilMyStaffCachedAccessDecorator($this->dic, ilMyStaffAccess::getInstance())
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 (
146  new ilMyStaffCachedAccessDecorator($this->dic, ilMyStaffAccess::getInstance())
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 (
171  new ilMyStaffCachedAccessDecorator($this->dic, ilMyStaffAccess::getInstance())
172  )->hasCurrentUserAccessToCompetences();
173  }
174  )->withNonAvailableReason($this->dic->ui()->factory()->legacy("{$this->dic->language()->txt("component_not_active")}"));
175 
176  return $items;
177  }
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
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
+ Here is the call graph for this function:

◆ getStaticTopItems()

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

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

Definition at line 47 of file StaffMainBarProvider.php.

47  : array
48  {
49  return [];
50  }

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