ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
UserMetaBarProvider.php
Go to the documentation of this file.
1 <?php namespace ILIAS\User\Provider;
2 
5 use ilUtil;
7 
14 {
15 
19  public function getMetaBarItems() : array
20  {
21  $access_checks = BasicAccessCheckClosures::getInstance();
22  $f = $this->dic->ui()->factory();
23  $txt = function ($id) {
24  return $this->dic->language()->txt($id);
25  };
26  $mb = $this->globalScreen()->metaBar();
27  $id = function ($id) : IdentificationInterface {
28  return $this->if->identifier($id);
29  };
30 
31  $children = array();
32  $children[] = $mb->linkItem($id('personal_profile'))
33  ->withAction("ilias.php?baseClass=ilDashboardGUI&cmd=jumpToProfile")
34  ->withTitle($txt("personal_profile"))
35  ->withPosition(1)
36  ->withSymbol($f->symbol()->icon()->custom(ilUtil::getImagePath("icon_profile.svg"), $txt("personal_profile")));
37 
38  $children[] = $mb->linkItem($id('personal_settings'))
39  ->withAction("ilias.php?baseClass=ilDashboardGUI&cmd=jumpToSettings")
40  ->withTitle($txt("personal_settings"))
41  ->withPosition(2)
42  ->withSymbol($f->symbol()->icon()->custom(ilUtil::getImagePath("icon_personal_settings.svg"), $txt("personal_settings")));
43 
44  $children[] = $mb->linkItem($id('logout'))
45  ->withAction("logout.php?lang=" . $this->dic->user()->getCurrentLanguage())
46  ->withPosition(3)
47  ->withTitle($txt("logout"))
48  ->withSymbol($f->symbol()->glyph()->logout());
49 
50  // "User"-Menu
51  $item[] = $mb->topParentItem($id('user'))
52  ->withSymbol($this->dic->user()->getAvatar())
53  ->withTitle($this->dic->language()->txt("info_view_of_user"))
54  ->withPosition(4)
55  ->withVisibilityCallable($access_checks->isUserLoggedIn())
56  ->withChildren($children);
57 
58  return $item;
59  }
60 }
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
$txt
Definition: error.php:13