ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilHelpMetaBarProvider.php
Go to the documentation of this file.
1<?php
2
24
26{
27 use ilHelpDisplayed;
28
29 private function getId(): IdentificationInterface
30 {
31 return $this->if->identifier('help');
32 }
33
34 public function getMetaBarItems(): array
35 {
36 global $DIC;
37
38 $mb = $this->globalScreen()->metaBar();
39
40 $f = $DIC->ui()->factory();
41
42 $title = $DIC->language()->txt("help");
43
44 if ($this->showHelpTool()) {
45 // position should be 0, see bug #26794
46 $item = $mb->topLinkItem($this->getId())
47 ->addComponentDecorator(static function (ILIAS\UI\Component\Component $c): ?ILIAS\UI\Component\Component {
48 if ($c instanceof BulkyButton || $c instanceof BulkyLink) {
49 return $c->withAdditionalOnLoadCode(static function (string $id): string {
50 return "$('#$id').on('click', function() {
51 $('body').trigger('il-help-toggle-slate');
52 return false;
53 })";
54 });
55 }
56 return null;
57 })
58 ->withSymbol($f->symbol()->glyph()->help())
59 ->withTitle($title)
60 ->withPosition(0);
61
62 return [$item];
63 }
64
65 return [];
66 }
67}
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
$c
Definition: deliver.php:25
withSymbol(Symbol $symbol)
@inheritDoc
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.
global $DIC
Definition: shib_login.php:26