ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
GuzzleHttp\Client\ModeToggle Class Reference

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

+ Collaboration diagram for GuzzleHttp\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
 
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 33 of file ModeToggle.php.

Constructor & Destructor Documentation

◆ __construct()

GuzzleHttp\Client\ModeToggle::__construct ( )

Definition at line 45 of file ModeToggle.php.

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

46  {
48  global $DIC;
49  $this->ctrl = $DIC->ctrl();
50  $this->wrapper = $DIC->http()->wrapper();
51  $this->http = $DIC->http();
52  $this->refinery = $DIC->refinery();
53  $this->global_screen = $DIC->globalScreen();
54  }
static initILIAS()
ilias initialisation
static http()
Fetches the global http state from ILIAS.
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

Member Function Documentation

◆ getMode()

GuzzleHttp\Client\ModeToggle::getMode ( )

Definition at line 56 of file ModeToggle.php.

References ILIAS\Repository\refinery().

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

56  : string
57  {
58  return $this->wrapper->cookie()->has(self::GS_MODE)
59  ? $this->wrapper->cookie()->retrieve(self::GS_MODE, $this->refinery->to()->string())
60  : self::MODE1;
61  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveStateOfAll()

GuzzleHttp\Client\ModeToggle::saveStateOfAll ( )

Definition at line 63 of file ModeToggle.php.

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

63  : bool
64  {
65  return $this->getMode() == ItemState::LEVEL_OF_TOOL;
66  }
+ Here is the call graph for this function:

◆ toggle()

GuzzleHttp\Client\ModeToggle::toggle ( )

Definition at line 68 of file ModeToggle.php.

References $_SERVER, GuzzleHttp\Client\ModeToggle\getMode(), ILIAS\UI\examples\Symbol\Glyph\Header\header(), and ILIAS\FileDelivery\http().

68  : void
69  {
70  $current_mode = $this->getMode();
71  $new_mode = $current_mode === self::MODE1 ? self::MODE2 : self::MODE1;
72  $cookie_factory = new CookieFactoryImpl();
73  $cookie = $cookie_factory->create(self::GS_MODE, $new_mode)
74  ->withExpires(time() + 3600);
75  $this->http->cookieJar()->with($cookie);
76  header('Location: ' . $_SERVER['HTTP_REFERER']);
77  }
static http()
Fetches the global http state from ILIAS.
$_SERVER['HTTP_HOST']
Definition: raiseError.php:26
header()
expected output: > ILIAS shows the rendered Component.
Definition: header.php:29
+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilCtrlInterface GuzzleHttp\Client\ModeToggle::$ctrl
protected

Definition at line 41 of file ModeToggle.php.

◆ $global_screen

Services GuzzleHttp\Client\ModeToggle::$global_screen
protected

Definition at line 42 of file ModeToggle.php.

◆ $http

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

Definition at line 43 of file ModeToggle.php.

◆ $refinery

Factory GuzzleHttp\Client\ModeToggle::$refinery
protected

Definition at line 40 of file ModeToggle.php.

◆ $wrapper

WrapperFactory GuzzleHttp\Client\ModeToggle::$wrapper
protected

Definition at line 39 of file ModeToggle.php.

◆ GS_MODE

const GuzzleHttp\Client\ModeToggle::GS_MODE = 'gs_mode'

Definition at line 35 of file ModeToggle.php.

◆ MODE1

const GuzzleHttp\Client\ModeToggle::MODE1 = "all"

Definition at line 36 of file ModeToggle.php.

◆ MODE2

const GuzzleHttp\Client\ModeToggle::MODE2 = "none"

Definition at line 37 of file ModeToggle.php.


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