ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
class.ViewSessionRepository.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
21 namespace ILIAS\Container\Content;
22 
23 use ilSession;
24 
30 {
31  protected const KEY = "cont_view";
32  protected const VIEW_ADMIN = "admin";
33  protected const VIEW_CONTENT = "content";
34 
35  public function __construct()
36  {
37  }
38 
39  public function setAdminView(): void
40  {
41  ilSession::set(self::KEY, self::VIEW_ADMIN);
42  }
43 
44  public function setContentView(): void
45  {
46  ilSession::clear(self::KEY);
47  }
48 
49  public function isAdminView(): bool
50  {
51  if (ilSession::has(self::KEY)) {
52  return (ilSession::get(self::KEY) == self::VIEW_ADMIN);
53  }
54  return false;
55  }
56 
57  public function isContentView(): bool
58  {
59  return !ilSession::has(self::KEY);
60  }
61 }
static get(string $a_var)
static has($a_var)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static clear(string $a_var)
static set(string $a_var, $a_val)
Set a value.