ILIAS  release_8 Revision v8.24
class.ilHelpViewLayoutProvider.php
Go to the documentation of this file.
1<?php
2
27use ILIAS\GlobalScreen\Scope\MainMenu\Collector\Renderer\Hasher;
28
34{
35 use Hasher;
36 use ilHelpDisplayed;
37
39 {
40 return $this->context_collection->main();
41 }
42
46 public function getMainBarModification(
47 CalledContexts $screen_context_stack
49 if (!$this->showHelpTool()) {
50 return null;
51 }
52 $this->globalScreen()->collector()->mainmenu()->collectOnce();
53 foreach ($this->globalScreen()->collector()->mainmenu()->getRawItems() as $item) {
54 $p = $item->getProviderIdentification();
55
56 $tt_text = ilHelp::getMainMenuTooltip($p->getInternalIdentifier());
57 $tt_text = addslashes(str_replace(array("\n", "\r"), '', $tt_text));
58
59 if ($tt_text !== "" && $item instanceof hasSymbol && $item->hasSymbol()) {
60 $item->addSymbolDecorator(static function (Symbol $symbol) use ($tt_text): Symbol {
61 return $symbol->withAdditionalOnLoadCode(static function ($id) use ($tt_text): string {
62 return "il.Tooltip.addToNearest('$id', 'button,a', { context:'', my:'bottom center', at:'top center', text:'$tt_text' });";
63 });
64 });
65 }
66 }
67
69
70 return null;
71 }
72}
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
HTML export view layout provider, hides main and meta bar.
getMainBarModification(CalledContexts $screen_context_stack)
No main bar in HTML exports.
static getMainMenuTooltip(string $a_item_id)
static init()
Initializes the needed tooltip libraries.
if(!file_exists(getcwd() . '/ilias.ini.php'))
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: confirmReg.php:20
Interface hasSymbol Methods for Entries with Symbols.
Definition: hasSymbol.php:33
withAdditionalOnLoadCode(Closure $binder)
Add some onload-code to the component instead of replacing the existing one.
This describes a symbol.
Definition: Symbol.php:30
trait JavaScriptBindable
Trait for components implementing JavaScriptBindable providing standard implementation.