ILIAS
release_9 Revision v9.13-25-g2c18ec4c24f
◀ ilDoc Overview
trait.ilMMCloseOnClick.php
Go to the documentation of this file.
1
<?php
18
declare(strict_types=1);
19
20
use
ILIAS\GlobalScreen\Scope\MainMenu\Factory\isItem
;
21
use
ILIAS\GlobalScreen\Scope\MainMenu\Factory\isParent
;
22
use
ILIAS\GlobalScreen\Scope\MainMenu\Factory\isInterchangeableItem
;
23
use
ILIAS\UI\Component\Link\Link
;
24
29
trait
ilMMCloseOnClick
30
{
31
protected
function
addDisengageDecorator(
isItem
$item):
isItem
32
{
33
if
(($item instanceof
isParent
|| $item instanceof
isInterchangeableItem
) && $item->getParent()->serialize() ===
''
) {
34
// always close MainBar when a link has been clicked
35
return
$item->
addComponentDecorator
(
static
function
(
36
ILIAS
\
UI
\
Component
\
Component
$c
37
):
ILIAS
\
UI
\
Component
\
Component
{
38
if
(!$c instanceof
Link
) {
39
return
$c->withAdditionalOnLoadCode(fn (
$id
) =>
"$('#$id').click(function() {
40
il.UI.maincontrols.mainbar.disengageAll();
41
il.UI.maincontrols.mainbar.clearStates();
42
})"
);
43
}
44
return
$c
;
45
});
46
}
47
48
return
$item;
49
}
50
}
ILIAS\GlobalScreen\Scope\MainMenu\Factory\isInterchangeableItem
Definition:
isInterchangeableItem.php:27
ILIAS
Class ChatMainBarProvider .
Factory
ILIAS\UI\Component
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
ILIAS\GlobalScreen\Scope\MainMenu\Factory\isItem
Interface IFactory.
Definition:
isItem.php:31
ILIAS\GlobalScreen\Scope\MainMenu\Factory\isParent
Interface isParent.
Definition:
isParent.php:26
ilMMCloseOnClick
ILIAS\GlobalScreen\isGlobalScreenItem\addComponentDecorator
addComponentDecorator(Closure $component_decorator)
Link
isItem
$id
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition:
plugin.php:23
Vendor\Package\$c
$c
Definition:
example_cleaned.php:49
ILIAS\UI\Component\Link\Link
Link base interface.
Definition:
Link.php:32
isInterchangeableItem
isParent
Services
MainMenu
classes
TypeRenderer
trait.ilMMCloseOnClick.php
Generated on Wed Sep 10 2025 14:11:37 for ILIAS by
1.8.13 (using
Doxyfile
)