ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
ILIAS\GlobalScreen\Client\ModeToggle Class Reference

Class ModeToggle. More...

+ Collaboration diagram for ILIAS\GlobalScreen\Client\ModeToggle:

Public Member Functions

 getMode ()
 
 saveStateOfAll ()
 
 toggle ()
 

Data Fields

const GS_MODE = 'gs_mode'
 
const MODE1 = "all"
 
const MODE2 = "none"
 

Detailed Description

Class ModeToggle.

This is just for testing!!! And will be removed after

Author
Fabian Schmid fs@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch

Definition at line 12 of file ModeToggle.php.

Member Function Documentation

◆ getMode()

ILIAS\GlobalScreen\Client\ModeToggle::getMode ( )

Definition at line 19 of file ModeToggle.php.

References $_COOKIE.

Referenced by ILIAS\GlobalScreen\Client\ModeToggle\saveStateOfAll(), and ILIAS\GlobalScreen\Client\ModeToggle\toggle().

19  : string
20  {
21  return isset($_COOKIE[self::GS_MODE]) ? $_COOKIE[self::GS_MODE] : self::MODE1;
22  }
$_COOKIE[session_name()]
Definition: xapitoken.php:39
+ Here is the caller graph for this function:

◆ saveStateOfAll()

ILIAS\GlobalScreen\Client\ModeToggle::saveStateOfAll ( )

Definition at line 25 of file ModeToggle.php.

References ILIAS\GlobalScreen\Client\ModeToggle\getMode(), and ILIAS\GlobalScreen\Client\ItemState\LEVEL_OF_TOOL.

25  : bool
26  {
27  return $this->getMode() == ItemState::LEVEL_OF_TOOL;
28  }
+ Here is the call graph for this function:

◆ toggle()

ILIAS\GlobalScreen\Client\ModeToggle::toggle ( )

Definition at line 31 of file ModeToggle.php.

References $_COOKIE, $_SERVER, ILIAS\GlobalScreen\Client\ItemState\COOKIE_NS_GS, and ILIAS\GlobalScreen\Client\ModeToggle\getMode().

31  : 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, "/");
37  header('Location: ' . $_SERVER['HTTP_REFERER']);
38  }
$_SERVER['HTTP_HOST']
Definition: raiseError.php:10
$_COOKIE[session_name()]
Definition: xapitoken.php:39
+ Here is the call graph for this function:

Field Documentation

◆ GS_MODE

const ILIAS\GlobalScreen\Client\ModeToggle::GS_MODE = 'gs_mode'

Definition at line 14 of file ModeToggle.php.

◆ MODE1

const ILIAS\GlobalScreen\Client\ModeToggle::MODE1 = "all"

Definition at line 15 of file ModeToggle.php.

◆ MODE2

const ILIAS\GlobalScreen\Client\ModeToggle::MODE2 = "none"

Definition at line 16 of file ModeToggle.php.


The documentation for this class was generated from the following file: