ILIAS  release_7 Revision v7.30-3-g800a261c036
UserMetaBarProvider.php
Go to the documentation of this file.
2
5use ilUtil;
7
14{
15
19 public function getMetaBarItems() : array
20 {
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}
An exception for terminatinating execution or to throw for unit testing.
@noRector
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
$txt
Definition: error.php:13