ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
PDMainBarProvider.php
Go to the documentation of this file.
1 <?php namespace ILIAS\PersonalDesktop;
2 
7 
14 {
15 
19  public function getStaticTopItems() : array
20  {
21  return [];
22  }
23 
24 
28  public function getStaticSubItems() : array
29  {
30  $dic = $this->dic;
31  $access_helper = BasicAccessCheckClosures::getInstance();
32 
33  $f = $this->dic->ui()->factory();
34 
35  $items = [
36  ];
37 
38  $top = StandardTopItemsProvider::getInstance()->getAdministrationIdentification();
39 
40  $title = $this->dic->language()->txt("obj_dshs");
41  $objects_by_type = \ilObject2::_getObjectsByType('dshs');
42  $id = (int) reset($objects_by_type)['obj_id'];
43  $references = \ilObject2::_getAllReferences($id);
44  $admin_ref_id = (int) reset($references);
45 
46  if ($admin_ref_id > 0) {
47  $action = "ilias.php?baseClass=ilAdministrationGUI&ref_id=" . $admin_ref_id . "&cmd=jump";
48  $icon = $this->dic->ui()->factory()->symbol()->icon()->standard("dshs", $title)
49  ->withIsOutlined(true);
50 
51  $items[] = $this->mainmenu->link($this->if->identifier('mm_adm_dshs'))
52  ->withAction($action)
53  ->withParent($top)
54  ->withTitle($title)
55  ->withSymbol($icon)
56  ->withPosition(25)
57  ->withVisibilityCallable(function() use($admin_ref_id){
58  return $this->dic->rbac()->system()->checkAccess('visible,read', $admin_ref_id);
59  });
60  }
61 
62 
63  return $items;
64  }
65 }
static _getObjectsByType($a_obj_type="", $a_owner="")
static _getAllReferences($a_id)
if(!file_exists(getcwd() . '/ilias.ini.php'))
registration confirmation script for ilias
Definition: confirmReg.php:12