ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
MyStaffListEntryProvider.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
27use ilObjOrgUnit;
29use ilMyStaffGUI;
33use ilSetting;
34
36{
40
41 public function __construct(Container $dic)
42 {
44 $this->organisationIdentifier = StandardTopItemsProvider::getInstance()->getOrganisationIdentification();
45 $this->employeeTalkTemplateIdentifier = $this->if->identifier('mm_adm_org_etal');
46 $this->settings = $dic->settings();
47 }
48
49 public function getStaticTopItems(): array
50 {
51 return [];
52 }
53
54 public function getStaticSubItems(): array
55 {
56 $this->dic->language()->loadLanguageModule('etal');
57 $items = [];
58
59 $title = $this->dic->language()->txt("mm_org_etal");
60 $action = "ilias.php?baseClass=ilAdministrationGUI&ref_id=" . ilObjOrgUnit::getRootOrgRefId() . "&cmd=jump";
61 $icon = $this->dic->ui()->factory()->symbol()->icon()->custom(
62 \ilUtil::getImagePath('standard/icon_etal.svg'),
63 $title
64 );
65
66 $items[] = $this->mainmenu->link($this->employeeTalkTemplateIdentifier)
67 ->withAlwaysAvailable(false)
68 ->withAction($this->dic->ctrl()->getLinkTargetByClass([
69 ilDashboardGUI::class,
70 ilMyStaffGUI::class,
71 ilEmployeeTalkMyStaffListGUI::class,
73 ->withAvailableCallable(
74 function () {
75 return boolval($this->settings->get('enable_my_staff'));
76 }
77 )
78 ->withNonAvailableReason($this->dic->ui()->factory()->legacy()->content("{$this->dic->language()->txt('item_must_be_always_active')}"))
79 ->withParent($this->organisationIdentifier)
80 ->withTitle($title)
81 ->withSymbol($icon)
82 ->withPosition(60)
83 ->withVisibilityCallable(
84 function () {
85 return ilMyStaffAccess::getInstance()->hasCurrentUserAccessToTalks();
86 }
87 );
88
89 return $items;
90 }
91
95 public function getProviderNameForPresentation(): string
96 {
97 return "components/ILIAS/EmployeeTalk";
98 }
99}
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:36
settings()
Get the interface to the settings.
Definition: Container.php:135
@ilCtrl_Calls ilDashboardGUI: ILIAS\User\Profile\PersonalProfileGUI @ilCtrl_Calls ilDashboardGUI: ilO...
@ilCtrl_IsCalledBy ilEmployeeTalkMyStaffListGUI: ilMyStaffGUI @ilCtrl_IsCalledBy ilEmployeeTalkMyStaf...
Class ilMyStaffGUI.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getRootOrgRefId()
ILIAS Setting Class.
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
withParent(IdentificationInterface $identification)