ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilContainerBlockPropertiesStorageGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2017 ILIAS open source, Extended GPL, see docs/LICENSE */
3
10{
14 protected $ctrl;
15
19 protected $user;
20
24 public function __construct()
25 {
26 global $DIC;
27
28 $this->ctrl = $DIC->ctrl();
29 $this->user = $DIC->user();
30 }
31
35 public function &executeCommand()
36 {
37 $ilCtrl = $this->ctrl;
38
39 $cmd = $ilCtrl->getCmd();
40 if (in_array($cmd, array("store"))) {
41 $this->$cmd();
42 }
43 }
44
48 public function store()
49 {
51
52 switch ($_GET["act"]) {
53
54 case "expand":
55 self::storeProperty($_GET["cont_block_id"], (int) $ilUser->getId(), "opened", "1");
56 break;
57
58 case "collapse":
59 self::storeProperty($_GET["cont_block_id"], (int) $ilUser->getId(), "opened", "0");
60 break;
61 }
62 }
63
72 public static function storeProperty($a_block_id, $a_user_id, $a_property, $a_value)
73 {
74 $_SESSION["cont_block"][$a_block_id][$a_user_id][$a_property] = $a_value;
76 ->debug("block id: " . $a_block_id . ", user id: " . $a_user_id . ", property: " . $a_property . ", val: " . print_r($a_value, true));
77 }
78
87 public static function getProperty($a_block_id, $a_user_id, $a_property)
88 {
89 $val = false;
90 if (isset($_SESSION["cont_block"][$a_block_id][$a_user_id][$a_property])) {
91 $val = $_SESSION["cont_block"][$a_block_id][$a_user_id][$a_property];
92 }
94 ->debug("block id: " . $a_block_id . ", user id: " . $a_user_id . ", property: " . $a_property . ", val: " . print_r($val, true));
95 return $val;
96 }
97}
user()
Definition: user.php:4
$_GET["client_id"]
$_SESSION["AccountId"]
An exception for terminatinating execution or to throw for unit testing.
static storeProperty($a_block_id, $a_user_id, $a_property, $a_value)
Store property in session or db.
static getProperty($a_block_id, $a_user_id, $a_property)
Get property in session or db.
static getLogger($a_component_id)
Get component logger.
global $DIC
Definition: goto.php:24
$ilUser
Definition: imgupload.php:18