ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
class.ilHelpViewLayoutProvider.php
Go to the documentation of this file.
1 <?php
2 
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  global $DIC;
50 
51  if (!$this->showHelpTool()) {
52  return null;
53  }
54 
55  $ttm = $DIC->help()->internal()->domain()->tooltips();
56 
57  $this->globalScreen()->collector()->mainmenu()->collectOnce();
58  foreach ($this->globalScreen()->collector()->mainmenu()->getRawItems() as $item) {
59  $p = $item->getProviderIdentification();
60 
61  $tt_text = $ttm->getMainMenuTooltip($p->getInternalIdentifier());
62  $tt_text = addslashes(str_replace(array("\n", "\r"), '', $tt_text));
63 
64  if ($tt_text !== "" && $item instanceof hasSymbol && $item->hasSymbol()) {
65  $item->addSymbolDecorator(static function (Symbol $symbol) use ($tt_text): Symbol {
66  return $symbol->withAdditionalOnLoadCode(static function ($id) use ($tt_text): string {
67  return "il.Tooltip.addToNearest('$id', 'button,a', { context:'', my:'bottom center', at:'top center', text:'$tt_text' });";
68  });
69  });
70  }
71  }
72 
74 
75  return null;
76  }
77 }
This describes a symbol.
Definition: Symbol.php:29
static init()
Initializes the needed tooltip libraries.
getMainBarModification(CalledContexts $screen_context_stack)
No main bar in HTML exports.
trait JavaScriptBindable
Trait for components implementing JavaScriptBindable providing standard implementation.
global $DIC
Definition: feed.php:28
Interface hasSymbol Methods for Entries with Symbols.
Definition: hasSymbol.php:32
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
HTML export view layout provider, hides main and meta bar.
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
withAdditionalOnLoadCode(Closure $binder)
Add some onload-code to the component instead of replacing the existing one.