ILIAS  trunk Revision v11.0_alpha-1715-g7fc467680fb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
MyStaffListEntryProvider.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
27 use ilObjOrgUnit;
28 use ilDashboardGUI;
29 use ilMyStaffGUI;
33 use ilSetting;
34 
36 {
40 
41  public function __construct(Container $dic)
42  {
43  parent::__construct($dic);
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,
72  ], ControlFlowCommand::INDEX))
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 }
withAvailableCallable(callable $is_available)
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:35
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
static getRootOrgRefId()
withParent(IdentificationInterface $identification)
__construct(Container $dic, ilPlugin $plugin)
settings()
Get the interface to the settings.
Definition: Container.php:135