ILIAS  trunk Revision v11.0_alpha-1723-g8e69f309bab
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
OrgUnitMainBarProvider.php
Go to the documentation of this file.
1 <?php
2 
20 
24 use ilObjOrgUnit;
29 
35 {
39 
40  public function __construct(Container $dic)
41  {
42  parent::__construct($dic);
43  $this->organisationIdentifier = $this->if->identifier('mm_adm_org');
44  $this->orgUnitIdentifier = $this->if->identifier('mm_adm_org_orgu');
45  $this->employeeTalkTemplateIdentifier = $this->if->identifier('mm_adm_org_etal');
46  }
47 
48  public function getStaticTopItems(): array
49  {
50  return [];
51  }
52 
56  public function getStaticSubItems(): array
57  {
58  $this->dic->language()->loadLanguageModule('mst');
59  $this->dic->language()->loadLanguageModule('etal');
60 
61  $items = [];
62  $access_helper = BasicAccessCheckClosuresSingleton::getInstance();
63  $top = StandardTopItemsProvider::getInstance()->getAdministrationIdentification();
64 
65  $title = $this->dic->language()->txt("objs_orgu");
66  $action = "ilias.php?baseClass=ilAdministrationGUI&ref_id=" . ilObjOrgUnit::getRootOrgRefId() . "&cmd=jump";
67  $icon = $this->dic->ui()->factory()->symbol()->icon()->standard('orgu', $title);
68 
69  $linkOrgUnit = $this->mainmenu->link($this->orgUnitIdentifier)
70  ->withAlwaysAvailable(true)
71  ->withAction($action)
72  ->withNonAvailableReason($this->dic->ui()->factory()->legacy()->content("{$this->dic->language()->txt('item_must_be_always_active')}"))
73  ->withParent($this->organisationIdentifier)
74  ->withTitle($title)
75  ->withSymbol($icon)
76  ->withPosition(10)
77  ->withVisibilityCallable(
78  $access_helper->hasAdministrationAccess(function (): bool {
79  return $this->dic->access()->checkAccess(
80  'read',
81  '',
83  );
84  })
85  );
86 
87  $title = $this->dic->language()->txt("mm_talk_template", "");
88  $action = "ilias.php?baseClass=ilAdministrationGUI&ref_id=" . ilObjTalkTemplateAdministration::getRootRefId() . "&cmd=jump";
89  $icon = $this->dic->ui()->factory()->symbol()->icon()->standard('tala', $title);
90  $linkEmployeeTalkTemplates = $this->mainmenu->link($this->employeeTalkTemplateIdentifier)
91  ->withAlwaysAvailable(true)
92  ->withAction($action)
93  ->withNonAvailableReason($this->dic->ui()->factory()->legacy()->content("{$this->dic->language()->txt('item_must_be_always_active')}"))
94  ->withParent($this->organisationIdentifier)
95  ->withTitle($title)
96  ->withSymbol($icon)
97  ->withPosition(20)
98  ->withVisibilityCallable(
99  $access_helper->hasAdministrationAccess(function (): bool {
100  return $this->dic->access()->checkAccess(
101  'read',
102  '',
104  );
105  })
106  );
107 
108  $title = $this->dic->language()->txt("mm_organisation");
109  $icon = $this->dic->ui()->factory()->symbol()->icon()->standard('org', $title);
110  $items[] = $this->mainmenu->linkList($this->organisationIdentifier)
111  ->withAlwaysAvailable(true)
112  ->withNonAvailableReason($this->dic->ui()->factory()->legacy()->content("{$this->dic->language()->txt('item_must_be_always_active')}"))
113  ->withParent($top)
114  ->withTitle($title)
115  ->withSymbol($icon)
116  ->withPosition(70)
117  ->withLinks([$linkOrgUnit, $linkEmployeeTalkTemplates])
118  ->withVisibilityCallable(
119  $access_helper->hasAdministrationAccess(function (): bool {
120  return $this->dic->access()->checkAccess(
121  'read',
122  '',
124  );
125  })
126  );
127 
128  return $items;
129  }
130 }
Customizing of pimple-DIC for ILIAS.
Definition: Container.php:35
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getRootOrgRefId()
withParent(IdentificationInterface $identification)
__construct(Container $dic, ilPlugin $plugin)