3use ILIAS\GlobalScreen\Scope\MainMenu\Collector\Renderer\Hasher;
25 return $this->context_collection->
main();
36 $help_gui =
$DIC[
"ilHelp"];
39 $lng->loadLanguageModule(
"help");
40 $f =
$DIC->ui()->factory();
44 $hidden = !$help_gui->isHelpPageActive();
46 $title =
$lng->txt(
"help");
47 $icon =
$f->symbol()->icon()->standard(
"hlps", $title)->withIsOutlined(
true);
49 if ($this->showHelpTool()) {
50 $iff =
function ($id) {
51 return $this->identification_provider->contextAwareIdentifier($id,
true);
53 $l =
function (
string $content) {
54 return $this->dic->ui()->factory()->legacy($content);
57 $identification = $iff(
"help");
58 $hashed = $this->hash($identification->serialize());
59 $tools[] = $this->factory->tool($identification)
60 ->addComponentDecorator(
static function (
ILIAS\
UI\Component\Component
$c) use ($hashed, $hidden) :
ILIAS\
UI\Component\Component {
61 if (
$c instanceof LegacySlate) {
62 $signal_id =
$c->getToggleSignal()->getId();
63 return $c->withAdditionalOnLoadCode(
static function ($id) use ($hashed, $hidden) {
65 $('body').on('il-help-toggle-slate', function(){
66 if (!$('#$id').hasClass('disengaged')) {
67 il.Help.resetCurrentPage();
68 il.UI.maincontrols.mainbar.removeTool('$hashed');
70 il.UI.maincontrols.mainbar.engageTool('$hashed');
71 const panel = document.getElementById('ilHelpPanel');
72 const firstFocusElement = panel.querySelector('a,input,[role=\'button\'],button');
73 if (firstFocusElement) {
74 firstFocusElement.focus();
82 ->withInitiallyHidden($hidden)
85 ->withContentWrapper(
function () use ($l) {
86 return $l($this->getHelpContent());
99 private function getHelpContent() : string
103 $ctrl =
$DIC->ctrl();
104 $main_tpl =
$DIC->ui()->mainTemplate();
107 $help_gui =
$DIC[
"ilHelp"];
109 $help_gui->initHelp($main_tpl, $ctrl->getLinkTargetByClass(
"ilhelpgui",
"",
"",
true));
112 if ((defined(
"OH_REF_ID") && OH_REF_ID > 0) || DEVMODE == 1) {
113 $html =
"<div class='ilHighlighted small'>Screen ID: " . $help_gui->getScreenId() .
"</div>";
116 $html .=
"<div id='ilHelpPanel'> </div>";
An exception for terminatinating execution or to throw for unit testing.
trait JavaScriptBindable
Trait for components implementing JavaScriptBindable providing standard implementation.
Class ChatMainBarProvider \MainMenu\Provider.