ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
class.ilHelpMetaBarProvider.php
Go to the documentation of this file.
1<?php
2
7
13{
14 use ilHelpDisplayed;
15
19 private function getId() : IdentificationInterface
20 {
21 return $this->if->identifier('help');
22 }
23
27 public function getMetaBarItems() : array
28 {
29 global $DIC;
30
31 $mb = $this->globalScreen()->metaBar();
32
33 $f = $DIC->ui()->factory();
34
35 $title = $DIC->language()->txt("help");
36
37 if ($this->showHelpTool()) {
38 // position should be 0, see bug #26794
39 $item = $mb->topLinkItem($this->getId())
40 ->addComponentDecorator(static function (ILIAS\UI\Component\Component $c) : ILIAS\UI\Component\Component {
41 if ($c instanceof Bulky) {
42 return $c->withAdditionalOnLoadCode(static function (string $id) : string {
43 return "$('#$id').on('click', function() {
44 console.log('trigger help slate');
45 $('body').trigger('il-help-toggle-slate');
46 })";
47 });
48 }
49 })
50// ->withAction($this->dic->ctrl()->getLinkTargetByClass(ilDashboardGUI::class, "toggleHelp"))
51 ->withSymbol($f->symbol()->glyph()->help())
52 ->withTitle($title)
53 ->withPosition(0);
54
55 return [$item];
56 }
57
58 return [];
59 }
60}
An exception for terminatinating execution or to throw for unit testing.
withSymbol(Symbol $symbol)
@inheritDoc
Class ChatMainBarProvider \MainMenu\Provider.
Class Factory.
$DIC
Definition: xapitoken.php:46