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
ModeToggle.php
Go to the documentation of this file.
1
<?php
2
3
namespace
ILIAS\GlobalScreen\Client
;
4
12
class
ModeToggle
13
{
14
const
GS_MODE
=
'gs_mode'
;
15
const
MODE1
=
"all"
;
16
const
MODE2
=
"none"
;
17
18
19
public
function
getMode
() : string
20
{
21
return
isset(
$_COOKIE
[self::GS_MODE]) ?
$_COOKIE
[self::GS_MODE] : self::MODE1;
22
}
23
24
25
public
function
saveStateOfAll
() : bool
26
{
27
return
$this->
getMode
() ==
ItemState::LEVEL_OF_TOOL
;
28
}
29
30
31
public
function
toggle
() : void
32
{
33
$current_mode = $this->
getMode
();
34
$new_mode = $current_mode == self::MODE1 ? self::MODE2 : self::MODE1;
35
setcookie(self::GS_MODE, $new_mode, 0,
"/"
);
36
$_COOKIE
[
ItemState::COOKIE_NS_GS
] =
""
;
37
header(
'Location: '
.
$_SERVER
[
'HTTP_REFERER'
]);
38
}
39
}
ILIAS\GlobalScreen\Client
Entry Point for Async calls from the Notification Center.
Definition:
gs_content.php:1
ILIAS\GlobalScreen\Client\ModeToggle\toggle
toggle()
Definition:
ModeToggle.php:31
$_SERVER
$_SERVER['HTTP_HOST']
Definition:
raiseError.php:10
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\ModeToggle\saveStateOfAll
saveStateOfAll()
Definition:
ModeToggle.php:25
ILIAS\GlobalScreen\Client\ModeToggle\MODE2
const MODE2
Definition:
ModeToggle.php:16
ILIAS\GlobalScreen\Client\ModeToggle\getMode
getMode()
Definition:
ModeToggle.php:19
ILIAS\GlobalScreen\Client\ModeToggle
Class ModeToggle.
Definition:
ModeToggle.php:12
ILIAS\GlobalScreen\Client\ModeToggle\MODE1
const MODE1
Definition:
ModeToggle.php:15
ILIAS\GlobalScreen\Client\ModeToggle\GS_MODE
const GS_MODE
Definition:
ModeToggle.php:14
$_COOKIE
$_COOKIE[session_name()]
Definition:
xapitoken.php:39
src
GlobalScreen
Client
ModeToggle.php
Generated on Sat Apr 5 2025 20:01:37 for ILIAS by
1.8.13 (using
Doxyfile
)