3 declare(strict_types=1);
39 protected \ilCtrlInterface
$ctrl;
41 protected \ILIAS\HTTP\Services
$http;
47 $this->
ctrl = $DIC->ctrl();
48 $this->wrapper = $DIC->http()->wrapper();
49 $this->
http = $DIC->http();
51 $this->global_screen = $DIC->globalScreen();
56 return $this->wrapper->cookie()->has(self::GS_MODE)
57 ? $this->wrapper->cookie()->retrieve(self::GS_MODE, $this->
refinery->to()->string())
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);
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static initILIAS()
ilias initialisation
ILIAS HTTP Services $http
static http()
Fetches the global http state from ILIAS.
ILIAS GlobalScreen Services $global_screen
Class ModeToggle This is just for testing!!! And will be removed after.