ILIAS  trunk Revision v11.0_alpha-2638-g80c1d007f79
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 (protected 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
 

Detailed Description

Member Function Documentation

◆ getStaticSubItems()

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

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

Definition at line 52 of file StaffMainBarProvider.php.

References ILIAS\GlobalScreen\Scope\MainMenu\Provider\AbstractStaticMainMenuProvider\$dic, ilMStListCompetencesGUI\CMD_INDEX, ilMStListUsersGUI\CMD_INDEX, ilMStListCoursesGUI\CMD_INDEX, ilMStListCertificatesGUI\CMD_INDEX, ilUtil\getImagePath(), ILIAS\MyStaff\ilMyStaffAccess\getInstance(), if, ILIAS\MyStaff\ilMyStaffAccess\isMyStaffActive(), ILIAS\DI\Container\language(), ILIAS\DI\Container\settings(), 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().

52  : array
53  {
55  return [];
56  }
57 
58  $this->dic->language()->loadLanguageModule('mst');
59  $dic = $this->dic;
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  }
withAction(URI|Signal|string $action)
if(!file_exists('../ilias.ini.php'))
withVisibilityCallable(callable $is_visible)
language()
Get interface to the i18n service.
Definition: Container.php:95
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
withParent(IdentificationInterface $identification)
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
+ 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 44 of file StaffMainBarProvider.php.

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

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