ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
OrgUnitMainBarProvider.php
Go to the documentation of this file.
1 <?php
2 
21 
25 use ilObjOrgUnit;
30 
36 {
40 
41  public function __construct(Container $dic)
42  {
43  parent::__construct($dic);
44  $this->organisationIdentifier = $this->if->identifier('mm_adm_org');
45  $this->orgUnitIdentifier = $this->if->identifier('mm_adm_org_orgu');
46  $this->employeeTalkTemplateIdentifier = $this->if->identifier('mm_adm_org_etal');
47  }
48 
49  public function getStaticTopItems(): array
50  {
51  return [];
52  }
53 
57  public function getStaticSubItems(): array
58  {
59  $this->dic->language()->loadLanguageModule('mst');
60  $this->dic->language()->loadLanguageModule('etal');
61 
62  $items = [];
63  $access_helper = BasicAccessCheckClosuresSingleton::getInstance();
64  $top = StandardTopItemsProvider::getInstance()->getAdministrationIdentification();
65 
66  $title = $this->dic->language()->txt("objs_orgu");
67  $action = "ilias.php?baseClass=ilAdministrationGUI&ref_id=" . ilObjOrgUnit::getRootOrgRefId() . "&cmd=jump";
68  $icon = $this->dic->ui()->factory()->symbol()->icon()->standard('orgu', $title);
69 
70  $linkOrgUnit = $this->mainmenu->link($this->orgUnitIdentifier)
71  ->withAlwaysAvailable(true)
72  ->withAction($action)
73  ->withNonAvailableReason($this->dic->ui()->factory()->legacy("{$this->dic->language()->txt('item_must_be_always_active')}"))
74  ->withParent($this->organisationIdentifier)
75  ->withTitle($title)
76  ->withSymbol($icon)
77  ->withPosition(10)
78  ->withVisibilityCallable(
79  $access_helper->hasAdministrationAccess(function (): bool {
80  return $this->dic->access()->checkAccess(
81  'read',
82  '',
84  );
85  })
86  );
87 
88  $title = $this->dic->language()->txt("mm_talk_template", "");
89  $action = "ilias.php?baseClass=ilAdministrationGUI&ref_id=" . ilObjTalkTemplateAdministration::getRootRefId() . "&cmd=jump";
90  $icon = $this->dic->ui()->factory()->symbol()->icon()->standard('tala', $title);
91  $linkEmployeeTalkTemplates = $this->mainmenu->link($this->employeeTalkTemplateIdentifier)
92  ->withAlwaysAvailable(true)
93  ->withAction($action)
94  ->withNonAvailableReason($this->dic->ui()->factory()->legacy("{$this->dic->language()->txt('item_must_be_always_active')}"))
95  ->withParent($this->organisationIdentifier)
96  ->withTitle($title)
97  ->withSymbol($icon)
98  ->withPosition(20)
99  ->withVisibilityCallable(
100  $access_helper->hasAdministrationAccess(function (): bool {
101  return $this->dic->access()->checkAccess(
102  'read',
103  '',
105  );
106  })
107  );
108 
109  $title = $this->dic->language()->txt("mm_organisation");
110  $icon = $this->dic->ui()->factory()->symbol()->icon()->standard('org', $title);
111  $items[] = $this->mainmenu->linkList($this->organisationIdentifier)
112  ->withAlwaysAvailable(true)
113  ->withNonAvailableReason($this->dic->ui()->factory()->legacy("{$this->dic->language()->txt('item_must_be_always_active')}"))
114  ->withParent($top)
115  ->withTitle($title)
116  ->withSymbol($icon)
117  ->withPosition(70)
118  ->withLinks([$linkOrgUnit, $linkEmployeeTalkTemplates])
119  ->withVisibilityCallable(
120  $access_helper->hasAdministrationAccess(function (): bool {
121  return $this->dic->access()->checkAccess(
122  'read',
123  '',
125  );
126  })
127  );
128 
129  return $items;
130  }
131 }
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)