ILIAS  release_8 Revision v8.24
ILIAS\Administration\AdministrationMainBarProvider Class Reference

Class AdministrationMainBarProvider. More...

+ Inheritance diagram for ILIAS\Administration\AdministrationMainBarProvider:
+ Collaboration diagram for ILIAS\Administration\AdministrationMainBarProvider:

Public Member Functions

 getStaticTopItems ()
 
 getStaticSubItems ()
 
- Public Member Functions inherited from ILIAS\GlobalScreen\Scope\MainMenu\Provider\AbstractStaticMainMenuProvider
 __construct (Container $dic)
 @inheritDoc More...
 
 getAllIdentifications ()
 @inheritDoc More...
 
 provideTypeInformation ()
 @inheritDoc More...
 
- Public Member Functions inherited from ILIAS\GlobalScreen\Provider\AbstractProvider
 __construct (Container $dic)
 @inheritDoc More...
 
 getFullyQualifiedClassName ()
 @inheritDoc More...
 
 getProviderNameForPresentation ()
 
 getFullyQualifiedClassName ()
 
 getProviderNameForPresentation ()
 
 getStaticTopItems ()
 
 getStaticSubItems ()
 
 provideTypeInformation ()
 
 getAllIdentifications ()
 

Protected Member Functions

 getIconForGroup (string $group, string $title)
 
- Protected Member Functions inherited from ILIAS\GlobalScreen\Provider\AbstractProvider
 globalScreen ()
 

Private Member Functions

 getGroups ()
 

Additional Inherited Members

- Protected Attributes inherited from ILIAS\GlobalScreen\Scope\MainMenu\Provider\AbstractStaticMainMenuProvider
Container $dic
 
IdentificationProviderInterface $if
 
MainMenuItemFactory $mainmenu
 
- Protected Attributes inherited from ILIAS\GlobalScreen\Provider\AbstractProvider
Container $dic
 

Detailed Description

Member Function Documentation

◆ getGroups()

ILIAS\Administration\AdministrationMainBarProvider::getGroups ( )
private

Definition at line 134 of file AdministrationMainBarProvider.php.

134 : array
135 {
136 if (!$this->dic->offsetExists('tree')) { // isDependencyAvailable does not work, Fatal error: Uncaught Error: Call to undefined method ILIAS\DI\Container::tree() in /var/www/html/src/DI/Container.php on line 294
137 return [[], []];
138 }
139 $tree = $this->dic->repositoryTree();
140 $lng = $this->dic->language();
141
142 $admin_request = new AdminGUIRequest(
143 $this->dic->http(),
144 $this->dic->refinery()
145 );
146
147
148 $objects = $tree->getChilds(SYSTEM_FOLDER_ID);
149
150 foreach ($objects as $object) {
151 $new_objects[$object["title"] . ":" . $object["child"]]
152 = $object;
153 // have to set it manually as translation type of main node cannot be "sys" as this type is a orgu itself.
154 if ($object["type"] === "orgu") {
155 $new_objects[$object["title"] . ":" . $object["child"]]["title"] = $lng->txt("objs_orgu");
156 }
157 }
158
159 // add entry for switching to repository admin
160 // note: please see showChilds methods which prevents infinite look
161 $new_objects[$lng->txt("repository_admin") . ":" . ROOT_FOLDER_ID]
162 = array(
163 "tree" => 1,
164 "child" => ROOT_FOLDER_ID,
165 "ref_id" => ROOT_FOLDER_ID,
166 "depth" => 3,
167 "type" => "root",
168 "title" => $lng->txt("repository_admin"),
169 "description" => $lng->txt("repository_admin_desc"),
170 "desc" => $lng->txt("repository_admin_desc"),
171 );
172
173 $new_objects[$lng->txt("general_settings") . ":" . SYSTEM_FOLDER_ID]
174 = array(
175 "tree" => 1,
176 "child" => SYSTEM_FOLDER_ID,
177 "ref_id" => SYSTEM_FOLDER_ID,
178 "depth" => 2,
179 "type" => "adm",
180 "title" => $lng->txt("general_settings"),
181 );
182 ksort($new_objects);
183
184 // determine items to show
185 $items = array();
186 foreach ($new_objects as $c) {
187 // check visibility
188 if ($c["type"] !== "adm" && $tree->getParentId((int) $c["ref_id"]) === ROOT_FOLDER_ID
189 && $admin_request->getAdminMode() !== "repository"
190 ) {
191 continue;
192 }
193 // these objects may exist due to test cases that didnt clear
194 // data properly
195 if ($c["type"] == "" || $c["type"] === "objf"
196 || $c["type"] === "xxx"
197 ) {
198 continue;
199 }
200 $items[] = $c;
201 }
202
203 $titems = array();
204 foreach ($items as $i) {
205 $titems[$i["type"]] = $i;
206 }
207
208 // admin menu layout
209 $layout = array(
210 "maintenance" =>
211 array("adm", "lngf", "hlps", "wfe", "pdfg", 'fils', 'logs', 'sysc', "recf", "root"),
212 "layout_and_navigation" =>
213 array("mme", "dshs", "stys", "adve", "accs"),
214 "repository_and_objects" =>
215 array("reps", "crss", "grps", "prgs", "bibs", "blga", "cpad", "chta", "facs", "frma", "lrss",
216 "mcts", "mobs", "svyf", "assf", "wbrs", 'lsos'),
217 "personal_workspace" =>
218 array("tags", "cals", "prfa", "prss", "nots"),
219 "achievements" =>
220 array("lhts", "skmg", "trac", "bdga", "cert"),
221 "communication" =>
222 array("mail", "cadm", "nwss", "coms", "adn", "awra", "nota"),
223 "user_administration" =>
224 array("usrf", 'tos', "rolf", "otpl", "auth", "ps"),
225 "search_and_find" =>
226 array("seas", "mds", "taxs"),
227 "extending_ilias" =>
228 array('ecss', "ltis", "wbdv", "cmis", "cmps", "extt")
229 );
230 $groups = [];
231 // now get all items and groups that are accessible
232 foreach ($layout as $group => $entries) {
233 $groups[$group] = array();
234 $entries_since_last_sep = false;
235 foreach ($entries as $e) {
236 if ($e === "---" || (isset($titems[$e]["type"]) && $titems[$e]["type"] != "")) {
237 if ($e === "---" && $entries_since_last_sep) {
238 $groups[$group][] = $e;
239 $entries_since_last_sep = false;
240 } else {
241 if ($e !== "---") {
242 $groups[$group][] = $e;
243 $entries_since_last_sep = true;
244 }
245 }
246 }
247 }
248 }
249
250 return [$groups, $titems];
251 }
$c
Definition: cli.php:38
const SYSTEM_FOLDER_ID
Definition: constants.php:35
const ROOT_FOLDER_ID
Definition: constants.php:32
$i
Definition: metadata.php:41
$lng

References $c, Vendor\Package\$e, $i, $lng, ROOT_FOLDER_ID, and SYSTEM_FOLDER_ID.

Referenced by ILIAS\Administration\AdministrationMainBarProvider\getStaticSubItems().

+ Here is the caller graph for this function:

◆ getIconForGroup()

ILIAS\Administration\AdministrationMainBarProvider::getIconForGroup ( string  $group,
string  $title 
)
protected

Definition at line 117 of file AdministrationMainBarProvider.php.

117 : Icon
118 {
119 $icon_map = array(
120 "maintenance" => "icon_sysa",
121 "layout_and_navigation" => "icon_laya",
122 "repository_and_objects" => "icon_repa",
123 "personal_workspace" => "icon_pwsa",
124 "achievements" => "icon_achva",
125 "communication" => "icon_coma",
126 "user_administration" => "icon_usra",
127 "search_and_find" => "icon_safa",
128 "extending_ilias" => "icon_exta"
129 );
130 $icon_path = \ilUtil::getImagePath($icon_map[$group] . ".svg");
131 return $this->dic->ui()->factory()->symbol()->icon()->custom($icon_path, $title);
132 }
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)

References ilUtil\getImagePath().

Referenced by ILIAS\Administration\AdministrationMainBarProvider\getStaticSubItems().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getStaticSubItems()

ILIAS\Administration\AdministrationMainBarProvider::getStaticSubItems ( )
Returns
isItem[] These are Entries which will be available for configuration.

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

Definition at line 41 of file AdministrationMainBarProvider.php.

41 : array
42 {
44 $top = StandardTopItemsProvider::getInstance()->getAdministrationIdentification();
45
46 if (!$access_helper->isUserLoggedIn()() || !$access_helper->hasAdministrationAccess()()) {
47 return [];
48 }
49
50 $entries = [];
51 $this->dic->language()->loadLanguageModule('administration');
52
53 $admin_request = new AdminGUIRequest(
54 $this->dic->http(),
55 $this->dic->refinery()
56 );
57
58 [$groups, $titems] = $this->getGroups();
59 $position = 1;
60 foreach ($groups as $group => $group_items) {
61 // Is Group
62 if (is_array($group_items) && count($group_items) > 0) {
63 // Entries
64 $links = [];
65 foreach ($group_items as $group_item) {
66 if ($group_item === "---") {
67 continue;
68 }
69
70 $icon = $this->dic->ui()->factory()->symbol()->icon()->standard($titems[$group_item]["type"], $titems[$group_item]["title"]);
71
72 $ref_id = $titems[$group_item]["ref_id"];
73 if ($admin_request->getAdminMode() !== 'repository' && $ref_id == ROOT_FOLDER_ID) {
74 $identification = $this->if->identifier('mm_adm_rep');
75 $action = "ilias.php?baseClass=ilAdministrationGUI&ref_id=" . $ref_id . "&admin_mode=repository";
76 } else {
77 $identification = $this->if->identifier("mm_adm_" . $titems[$group_item]["type"]);
78 $action = "ilias.php?baseClass=ilAdministrationGUI&ref_id=" . $ref_id . "&cmd=jump";
79 }
80
81 $links[] = $this->globalScreen()
82 ->mainBar()
83 ->link($identification)
84 ->withTitle($titems[$group_item]["title"])
85 ->withAction($action)
86 ->withSymbol($icon)
87 ->withVisibilityCallable(function () use ($ref_id) {
88 return $this->dic->rbac()->system()->checkAccess('visible,read', (int) $ref_id);
89 });
90 }
91
92 // Main entry
93 $title = $this->dic->language()->txt("adm_" . $group);
94 $entries[] = $this->globalScreen()
95 ->mainBar()
96 ->linkList($this->if->identifier('adm_content_' . $group))
97 ->withSupportsAsynchronousLoading(true)
98 ->withLinks($links)
99 ->withTitle($title)
100 ->withSymbol($this->getIconForGroup($group, $title))
101 ->withParent($top)
102 ->withPosition($position * 10)
103 ->withAlwaysAvailable(true)
104 ->withNonAvailableReason($this->dic->ui()->factory()->legacy("{$this->dic->language()->txt('item_must_be_always_active')}"))
105 ->withVisibilityCallable(
106 $access_helper->hasAdministrationAccess()
107 )->withAvailableCallable(
108 $access_helper->isUserLoggedIn()
109 );
110 $position++;
111 }
112 }
113
114 return $entries;
115 }
if(!file_exists(getcwd() . '/ilias.ini.php'))
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: confirmReg.php:20
$ref_id
Definition: ltiauth.php:67

References $ref_id, ILIAS\Administration\AdministrationMainBarProvider\getGroups(), ILIAS\Administration\AdministrationMainBarProvider\getIconForGroup(), ILIAS\GlobalScreen\Helper\BasicAccessCheckClosuresSingleton\getInstance(), ILIAS\MainMenu\Provider\StandardTopItemsProvider\getInstance(), ILIAS\GlobalScreen\Provider\AbstractProvider\globalScreen(), if, and ROOT_FOLDER_ID.

+ Here is the call graph for this function:

◆ getStaticTopItems()

ILIAS\Administration\AdministrationMainBarProvider::getStaticTopItems ( )
Returns
TopParentItem[] These are Slates which will be available for configuration.

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

Definition at line 35 of file AdministrationMainBarProvider.php.

35 : array
36 {
37 return [];
38 }

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