ILIAS  release_7 Revision v7.30-3-g800a261c036
ILIAS\Administration\AdministrationMainBarProvider Class Reference

Class AdministrationMainBarProvider. More...

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

Public Member Functions

 getStaticTopItems ()
 @inheritDoc More...
 
 getStaticSubItems ()
 @inheritDoc More...
 
- 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
 $dic
 
 $if
 
 $mainmenu
 
- Protected Attributes inherited from ILIAS\GlobalScreen\Provider\AbstractProvider
 $dic
 

Detailed Description

Member Function Documentation

◆ getGroups()

ILIAS\Administration\AdministrationMainBarProvider::getGroups ( )
private
Returns
array

Definition at line 121 of file AdministrationMainBarProvider.php.

121 : array
122 {
123 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
124 return [[], []];
125 }
126 $tree = $this->dic->repositoryTree();
127 $rbacsystem = $this->dic->rbac()->system();
128 $lng = $this->dic->language();
129
130 $objects = $tree->getChilds(SYSTEM_FOLDER_ID);
131
132 foreach ($objects as $object) {
133 $new_objects[$object["title"] . ":" . $object["child"]]
134 = $object;
135 // have to set it manually as translation type of main node cannot be "sys" as this type is a orgu itself.
136 if ($object["type"] == "orgu") {
137 $new_objects[$object["title"] . ":" . $object["child"]]["title"] = $lng->txt("objs_orgu");
138 }
139 }
140
141 // add entry for switching to repository admin
142 // note: please see showChilds methods which prevents infinite look
143 $new_objects[$lng->txt("repository_admin") . ":" . ROOT_FOLDER_ID]
144 = array(
145 "tree" => 1,
146 "child" => ROOT_FOLDER_ID,
147 "ref_id" => ROOT_FOLDER_ID,
148 "depth" => 3,
149 "type" => "root",
150 "title" => $lng->txt("repository_admin"),
151 "description" => $lng->txt("repository_admin_desc"),
152 "desc" => $lng->txt("repository_admin_desc"),
153 );
154
155 $new_objects[$lng->txt("general_settings") . ":" . SYSTEM_FOLDER_ID]
156 = array(
157 "tree" => 1,
158 "child" => SYSTEM_FOLDER_ID,
159 "ref_id" => SYSTEM_FOLDER_ID,
160 "depth" => 2,
161 "type" => "adm",
162 "title" => $lng->txt("general_settings"),
163 );
164 ksort($new_objects);
165
166 // determine items to show
167 $items = array();
168 foreach ($new_objects as $c) {
169 // check visibility
170 if ($tree->getParentId($c["ref_id"]) == ROOT_FOLDER_ID && $c["type"] != "adm"
171 && $_GET["admin_mode"] != "repository"
172 ) {
173 continue;
174 }
175 // these objects may exist due to test cases that didnt clear
176 // data properly
177 if ($c["type"] == "" || $c["type"] == "objf"
178 || $c["type"] == "xxx"
179 ) {
180 continue;
181 }
182 $items[] = $c;
183 }
184
185 $titems = array();
186 foreach ($items as $i) {
187 $titems[$i["type"]] = $i;
188 }
189
190 // admin menu layout
191 $layout = array(
192 "maintenance" =>
193 array("adm", "lngf", "hlps", "wfe", "pdfg", 'fils', 'logs', 'sysc', "recf", "root"),
194 "layout_and_navigation" =>
195 array("mme", "stys", "adve", "accs"),
196 "repository_and_objects" =>
197 array("reps", "crss", "grps", "prgs", "bibs", "blga", "cpad", "chta", "facs", "frma", "lrss",
198 "mcts", "mobs", "svyf", "assf", "wbrs", "wiks", 'lsos'),
199 "personal_workspace" =>
200 array("tags", "cals", "prfa", "prss", "nots"),
201 "achievements" =>
202 array("lhts", "skmg", "trac", "bdga", "cert"),
203 "communication" =>
204 array("mail", "cadm", "nwss", "coms", "adn", "awra"),
205 "user_administration" =>
206 array("usrf", 'tos', "rolf", "otpl", "auth", "ps"),
207 "search_and_find" =>
208 array("seas", "mds", "taxs"),
209 "extending_ilias" =>
210 array('ecss', "ltis", "wbdv", "cmis", "cmps", "extt"),
211 );
212 $groups = [];
213 // now get all items and groups that are accessible
214 foreach ($layout as $group => $entries) {
215 $groups[$group] = array();
216 $entries_since_last_sep = false;
217 foreach ($entries as $e) {
218 if ($e == "---" || $titems[$e]["type"] != "") {
219 if ($e == "---" && $entries_since_last_sep) {
220 $groups[$group][] = $e;
221 $entries_since_last_sep = false;
222 } else {
223 if ($e != "---") {
224 $groups[$group][] = $e;
225 $entries_since_last_sep = true;
226 }
227 }
228 }
229 }
230 }
231
232 return [$groups, $titems];
233 }
$_GET["client_id"]
$c
Definition: cli.php:37
const SYSTEM_FOLDER_ID
Definition: constants.php:33
const ROOT_FOLDER_ID
Definition: constants.php:30
$i
Definition: metadata.php:24
$lng

References $_GET, $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 100 of file AdministrationMainBarProvider.php.

100 : Icon
101 {
102 $icon_map = array(
103 "maintenance" => "icon_sysa",
104 "layout_and_navigation" => "icon_laya",
105 "repository_and_objects" => "icon_repa",
106 "personal_workspace" => "icon_pwsa",
107 "achievements" => "icon_achva",
108 "communication" => "icon_coma",
109 "user_administration" => "icon_usra",
110 "search_and_find" => "icon_safa",
111 "extending_ilias" => "icon_exta"
112 );
113 $icon_path = \ilUtil::getImagePath("outlined/" . $icon_map[$group] . ".svg");
114 return $this->dic->ui()->factory()->symbol()->icon()->custom($icon_path, $title);
115 }
static getImagePath($img, $module_path="", $mode="output", $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 ( )

@inheritDoc

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

Definition at line 28 of file AdministrationMainBarProvider.php.

28 : array
29 {
31 $top = StandardTopItemsProvider::getInstance()->getAdministrationIdentification();
32
33 if (!$access_helper->isUserLoggedIn()() || !$access_helper->hasAdministrationAccess()()) {
34 return [];
35 }
36
37 $entries = [];
38 $this->dic->language()->loadLanguageModule('administration');
39
40 list($groups, $titems) = $this->getGroups();
41 $position = 1;
42 foreach ($groups as $group => $group_items) {
43 // Is Group
44 if (is_array($group_items) && count($group_items) > 0) {
45 // Entries
46 $links = [];
47 foreach ($group_items as $group_item) {
48 if ($group_item == "---") {
49 continue;
50 }
51
52 $icon = $this->dic->ui()->factory()->symbol()->icon()->standard($titems[$group_item]["type"], $titems[$group_item]["title"])
53 ->withIsOutlined(true);
54
55 $ref_id = $titems[$group_item]["ref_id"];
56 if ($_GET["admin_mode"] != 'repository' && $ref_id == ROOT_FOLDER_ID) {
57 $identification = $this->if->identifier('mm_adm_rep');
58 $action = "ilias.php?baseClass=ilAdministrationGUI&ref_id=" . $ref_id . "&admin_mode=repository";
59 } else {
60 $identification = $this->if->identifier("mm_adm_" . $titems[$group_item]["type"]);
61 $action = "ilias.php?baseClass=ilAdministrationGUI&ref_id=" . $ref_id . "&cmd=jump";
62 }
63
64 $links[] = $this->globalScreen()
65 ->mainBar()
66 ->link($identification)
67 ->withTitle($titems[$group_item]["title"])
68 ->withAction($action)
69 ->withSymbol($icon)
70 ->withVisibilityCallable(function() use($ref_id){
71 return $this->dic->rbac()->system()->checkAccess('visible,read', $ref_id);
72 });
73 }
74
75 // Main entry
76 $title = $this->dic->language()->txt("adm_" . $group);
77 $entries[] = $this->globalScreen()
78 ->mainBar()
79 ->linkList($this->if->identifier('adm_content_' . $group))
80 ->withSupportsAsynchronousLoading(true)
81 ->withLinks($links)
82 ->withTitle($title)
83 ->withSymbol($this->getIconForGroup($group, $title))
84 ->withParent($top)
85 ->withPosition($position * 10)
86 ->withAlwaysAvailable(true)
87 ->withNonAvailableReason($this->dic->ui()->factory()->legacy("{$this->dic->language()->txt('item_must_be_always_active')}"))
88 ->withVisibilityCallable(
89 $access_helper->hasAdministrationAccess()
90 )->withAvailableCallable(
91 $access_helper->isUserLoggedIn()
92 );
93 $position++;
94 }
95 }
96
97 return $entries;
98 }
if(!file_exists(getcwd() . '/ilias.ini.php'))
registration confirmation script for ilias
Definition: confirmReg.php:12

References $_GET, ILIAS\Administration\AdministrationMainBarProvider\getGroups(), ILIAS\Administration\AdministrationMainBarProvider\getIconForGroup(), ILIAS\GlobalScreen\Helper\BasicAccessCheckClosures\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 ( )

@inheritDoc

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

Definition at line 19 of file AdministrationMainBarProvider.php.

19 : array
20 {
21 return [];
22 }

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