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