ILIAS
release_7 Revision v7.30-3-g800a261c036
◀ ilDoc Overview
Main Page
Related Pages
Modules
+
Namespaces
Namespace List
+
Namespace Members
+
All
$
_
a
b
c
d
e
f
g
h
i
j
l
m
p
r
s
t
w
+
Functions
_
a
b
c
f
g
h
i
r
s
t
w
+
Variables
$
c
d
e
f
g
h
j
l
m
p
s
t
+
Data Structures
Data Structures
Data Structure Index
Class Hierarchy
+
Data Fields
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Variables
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
+
Files
File List
+
Globals
+
All
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
+
Functions
_
a
b
c
d
e
f
g
h
i
l
m
n
o
p
r
s
t
u
v
w
x
+
Variables
$
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
Examples
•
All
Data Structures
Namespaces
Files
Functions
Variables
Modules
Pages
trait.ilMMCloseOnClick.php
Go to the documentation of this file.
1
<?php
2
3
use
ILIAS\GlobalScreen\Scope\MainMenu\Factory\isItem
;
4
use
ILIAS\GlobalScreen\Scope\MainMenu\Factory\isParent
;
5
use
ILIAS\GlobalScreen\Scope\MainMenu\Factory\isInterchangeableItem
;
6
use
ILIAS\UI\Component\JavaScriptBindable
;
7
12
trait
ilMMCloseOnClick
13
{
14
protected
function
addDisengageDecorator(
isItem
$item) :
isItem
15
{
16
if
(($item instanceof
isParent
|| $item instanceof
isInterchangeableItem
) && $item->getParent()->serialize() ===
''
) {
17
// always close MainBar when a link has been clicked
18
return
$item->
addComponentDecorator
(
static
function
(
ILIAS
\
UI
\
Component
\
Component
$c
19
) :
ILIAS
\
UI
\
Component
\
Component
{
20
if
($c instanceof
JavaScriptBindable
) {
21
return
$c->withAdditionalOnLoadCode(
function
($id) {
22
return
"$('#$id').click(function() {
23
il.UI.maincontrols.mainbar.disengageAll();
24
il.UI.maincontrols.mainbar.clearStates();
25
})"
;
26
});
27
}
28
return
$c
;
29
});
30
}
31
32
return
$item;
33
}
34
}
ILIAS\GlobalScreen\Scope\MainMenu\Factory\isInterchangeableItem
Definition:
isInterchangeableItem.php:27
JavaScriptBindable
UI
Class Factory.
$c
$c
Definition:
cli.php:37
ILIAS
Class ChatMainBarProvider .
ILIAS\UI\Component
ILIAS\UI\Implementation\Component\JavaScriptBindable
trait JavaScriptBindable
Trait for components implementing JavaScriptBindable providing standard implementation.
Definition:
JavaScriptBindable.php:12
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)
isItem
isInterchangeableItem
isParent
Services
MainMenu
classes
TypeRenderer
trait.ilMMCloseOnClick.php
Generated on Sun Apr 6 2025 21:01:34 for ILIAS by
1.8.13 (using
Doxyfile
)