ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
class.ilHelpViewLayoutProvider.php
Go to the documentation of this file.
1<?php
2
27use ILIAS\GlobalScreen\Scope\MainMenu\Collector\Renderer\Hasher;
31
37{
38 use Hasher;
39 use ilHelpDisplayed;
40
42 {
43 return $this->context_collection->main();
44 }
45
49 public function getMainBarModification(
50 CalledContexts $screen_context_stack
52 global $DIC;
53
54 $f = $DIC->ui()->factory();
55 $ttm = $DIC->help()->internal()->domain()->tooltips();
56
57 if (!$this->showHelpTool() && !$ttm->isTooltipIdentifierVisible()) {
58 return null;
59 }
60
61
62 $this->globalScreen()->collector()->mainmenu()->collectOnce();
63 foreach ($this->globalScreen()->collector()->mainmenu()->getRawItems() as $item) {
64 if ($item instanceof isDecorateable) {
65 $p = $item->getProviderIdentification();
66
67 $tt_text = $ttm->getMainMenuTooltip($p->getInternalIdentifier());
68 $tt_text = addslashes(str_replace(array("\n", "\r"), '', $tt_text));
69 if ($tt_text !== "") {
70 //$item->withTopics($DIC->ui()->factory()->helpTopics($p->getInternalIdentifier()));
71 $item->withTopics(...$DIC->ui()->factory()->helpTopics($tt_text));
72 }
73 }
74 }
75
76 return null;
77 }
78
79 public function getMetaBarModification(CalledContexts $screen_context_stack): ?MetaBarModification
80 {
81 global $DIC;
82
83 $ttm = $DIC->help()->internal()->domain()->tooltips();
84
85 if (!$this->showHelpTool() && !$ttm->isTooltipIdentifierVisible()) {
86 return null;
87 }
88
89 // add id mapping of all main menu items to gui
90 $this->globalScreen()->collector()->metaBar()->collectOnce();
91 foreach ($this->globalScreen()->collector()->metaBar()->getRawItems() as $item) {
92 if ($item instanceof isDecorateable) {
93 $p = $item->getProviderIdentification();
94
95 $tt_text = $ttm->getMainMenuTooltip($p->getInternalIdentifier());
96 $tt_text = addslashes(str_replace(array("\n", "\r"), '', $tt_text));
97 if ($tt_text !== "") {
98 //$item->withTopics($DIC->ui()->factory()->helpTopics($p->getInternalIdentifier()));
99 $item->withTopics(...$DIC->ui()->factory()->helpTopics($tt_text));
100 }
101 }
102 }
103 return null;
104 }
105
106}
HTML export view layout provider, hides main and meta bar.
getMainBarModification(CalledContexts $screen_context_stack)
No main bar in HTML exports.
getMetaBarModification(CalledContexts $screen_context_stack)
@inheritDoc
A component is the most general form of an entity in the UI.
Definition: Component.php:28
This describes a symbol.
Definition: Symbol.php:30
trait JavaScriptBindable
Trait for components implementing JavaScriptBindable providing standard implementation.
global $DIC
Definition: shib_login.php:26