ILIAS  release_8 Revision v8.24
class.ViewSessionRepository.php
Go to the documentation of this file.
1<?php
2
3declare(strict_types=1);
4
22
23use 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 clear(string $a_var)
static set(string $a_var, $a_val)
Set a value.
static has($a_var)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...