ILIAS
release_6 Revision v6.24-5-g0c8bfefb3b8
◀ 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
s
t
w
+
Functions
_
a
b
c
f
g
h
i
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
ItemState.php
Go to the documentation of this file.
1
<?php
2
3
namespace
ILIAS\GlobalScreen\Client
;
4
5
use
ILIAS\GlobalScreen\Identification\IdentificationInterface
;
6
use
ILIAS\GlobalScreen\Scope\MainMenu\Collector\Renderer\Hasher
;
7
13
class
ItemState
14
{
15
use
Hasher
;
16
const
LEVEL_OF_TOOL
= 1;
17
const
LEVEL_OF_TOPITEM
= 2;
18
const
LEVEL_OF_SUBITEM
= 10;
19
const
COOKIE_NS_GS
=
'gs_active_items'
;
23
private
$identification
;
27
private
$storage
= [];
28
29
35
public
function
__construct
(
IdentificationInterface
$identification
)
36
{
37
$this->identification =
$identification
;
38
$this->storage = $this->
getStorage
();
39
}
40
41
42
public
function
isItemActive
() : bool
43
{
44
$hash = $this->
hash
($this->identification->serialize());
45
$b
= isset($this->storage[$hash]) && $this->storage[$hash] ==
true
;
46
47
return
$b
;
48
}
49
50
54
public
function
getStorage
() : array
55
{
56
static
$json_decode;
57
if
(!isset($json_decode)) {
58
$json_decode = json_decode(
$_COOKIE
[self::COOKIE_NS_GS],
true
);
59
$json_decode = is_array($json_decode) ? $json_decode : [];
60
}
61
62
return
$json_decode;
63
}
64
}
ILIAS\GlobalScreen\Client\ItemState\__construct
__construct(IdentificationInterface $identification)
ItemState constructor.
Definition:
ItemState.php:35
ILIAS\GlobalScreen\Client\ItemState\LEVEL_OF_TOPITEM
const LEVEL_OF_TOPITEM
Definition:
ItemState.php:17
ILIAS\GlobalScreen\Identification\IdentificationInterface
Interface IdentificationInterface.
Definition:
IdentificationInterface.php:8
ILIAS\GlobalScreen\Client
Entry Point for Async calls from the Notification Center.
Definition:
gs_content.php:1
ILIAS\GlobalScreen\Client\ItemState
Class ItemState.
Definition:
ItemState.php:13
ILIAS\GlobalScreen\Client\ItemState\LEVEL_OF_SUBITEM
const LEVEL_OF_SUBITEM
Definition:
ItemState.php:18
Hasher
hash
IdentificationInterface
ILIAS\GlobalScreen\Client\ItemState\getStorage
getStorage()
Definition:
ItemState.php:54
ILIAS\GlobalScreen\Client\ItemState\COOKIE_NS_GS
const COOKIE_NS_GS
Definition:
ItemState.php:19
ILIAS\GlobalScreen\Client\ItemState\LEVEL_OF_TOOL
const LEVEL_OF_TOOL
Definition:
ItemState.php:16
ILIAS\GlobalScreen\Client\ItemState\$identification
$identification
Definition:
ItemState.php:23
Hasher
ILIAS\GlobalScreen\Client\ItemState\$storage
$storage
Definition:
ItemState.php:27
Vendor\Package\$b
$b
Definition:
example_cleaned.php:31
$_COOKIE
$_COOKIE[session_name()]
Definition:
xapitoken.php:39
ILIAS\GlobalScreen\Client\ItemState\isItemActive
isItemActive()
Definition:
ItemState.php:42
src
GlobalScreen
Client
ItemState.php
Generated on Wed Apr 9 2025 20:01:37 for ILIAS by
1.8.13 (using
Doxyfile
)