ILIAS  release_8 Revision v8.24
ILIAS\GlobalScreen\Client\ModeToggle Class Reference

Class ModeToggle This is just for testing!!! And will be removed after. More...

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

Public Member Functions

 __construct ()
 
 getMode ()
 
 saveStateOfAll ()
 
 toggle ()
 

Data Fields

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

Protected Attributes

WrapperFactory $wrapper
 
Factory $refinery
 
ilCtrlInterface $ctrl
 
ILIAS GlobalScreen Services $global_screen
 
ILIAS HTTP Services $http
 

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 31 of file ModeToggle.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 43 of file ModeToggle.php.

44 {
46 global $DIC;
47 $this->ctrl = $DIC->ctrl();
48 $this->wrapper = $DIC->http()->wrapper();
49 $this->http = $DIC->http();
50 $this->refinery = $DIC->refinery();
51 $this->global_screen = $DIC->globalScreen();
52 }
static initILIAS()
ilias initialisation
global $DIC
Definition: feed.php:28
static http()
Fetches the global http state from ILIAS.

References $DIC, ILIAS\Repository\ctrl(), ILIAS\FileDelivery\http(), ilInitialisation\initILIAS(), and ILIAS\Repository\refinery().

+ Here is the call graph for this function:

Member Function Documentation

◆ getMode()

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

Definition at line 54 of file ModeToggle.php.

54 : string
55 {
56 return $this->wrapper->cookie()->has(self::GS_MODE)
57 ? $this->wrapper->cookie()->retrieve(self::GS_MODE, $this->refinery->to()->string())
59 }

References ILIAS\GlobalScreen\Client\ModeToggle\MODE1, and ILIAS\Repository\refinery().

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

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveStateOfAll()

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

Definition at line 61 of file ModeToggle.php.

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

+ Here is the call graph for this function:

◆ toggle()

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

Definition at line 66 of file ModeToggle.php.

66 : void
67 {
68 $current_mode = $this->getMode();
69 $new_mode = $current_mode == self::MODE1 ? self::MODE2 : self::MODE1;
70 $cookie_factory = new CookieFactoryImpl();
71 $cookie = $cookie_factory->create(self::GS_MODE, $new_mode)
72 ->withExpires(time() + 3600);
73 $this->http->cookieJar()->with($cookie);
74 header('Location: ' . $_SERVER['HTTP_REFERER']);
75 }
$_SERVER['HTTP_HOST']
Definition: raiseError.php:10

References $_SERVER, ILIAS\GlobalScreen\Client\ModeToggle\getMode(), ILIAS\FileDelivery\http(), ILIAS\GlobalScreen\Client\ModeToggle\MODE1, and ILIAS\GlobalScreen\Client\ModeToggle\MODE2.

+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilCtrlInterface ILIAS\GlobalScreen\Client\ModeToggle::$ctrl
protected

Definition at line 39 of file ModeToggle.php.

◆ $global_screen

ILIAS GlobalScreen Services ILIAS\GlobalScreen\Client\ModeToggle::$global_screen
protected

Definition at line 40 of file ModeToggle.php.

◆ $http

ILIAS HTTP Services ILIAS\GlobalScreen\Client\ModeToggle::$http
protected

Definition at line 41 of file ModeToggle.php.

◆ $refinery

Factory ILIAS\GlobalScreen\Client\ModeToggle::$refinery
protected

Definition at line 38 of file ModeToggle.php.

◆ $wrapper

WrapperFactory ILIAS\GlobalScreen\Client\ModeToggle::$wrapper
protected

Definition at line 37 of file ModeToggle.php.

◆ GS_MODE

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

Definition at line 33 of file ModeToggle.php.

◆ MODE1

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

◆ MODE2

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

Definition at line 35 of file ModeToggle.php.

Referenced by ILIAS\GlobalScreen\Client\ModeToggle\toggle().


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