ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
class.ilContainerBlockPropertiesStorage.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2017 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
12 {
16  protected $ctrl;
17 
21  protected $user;
22 
23 
27  public function __construct()
28  {
29  global $DIC;
30 
31  $this->ctrl = $DIC->ctrl();
32  $this->user = $DIC->user();
33  }
34 
38  public function &executeCommand()
39  {
41 
42  $cmd = $ilCtrl->getCmd();
43  if (in_array($cmd, array("store"))) {
44  $this->$cmd();
45  }
46  }
47 
51  public function store()
52  {
54 
55  switch ($_GET["act"]) {
56 
57  case "expand":
58  self::storeProperty($_GET["cont_block_id"], (int) $ilUser->getId(), "opened", "1");
59  break;
60 
61  case "collapse":
62  self::storeProperty($_GET["cont_block_id"], (int) $ilUser->getId(), "opened", "0");
63  break;
64  }
65  }
66 
75  public static function storeProperty($a_block_id, $a_user_id, $a_property, $a_value)
76  {
77  $_SESSION["cont_block"][$a_block_id][$a_user_id][$a_property] = $a_value;
79  ->debug("block id: " . $a_block_id . ", user id: " . $a_user_id . ", property: " . $a_property . ", val: " . print_r($a_value, true));
80  }
81 
90  public static function getProperty($a_block_id, $a_user_id, $a_property)
91  {
92  $val = false;
93  if (isset($_SESSION["cont_block"][$a_block_id][$a_user_id][$a_property])) {
94  $val = $_SESSION["cont_block"][$a_block_id][$a_user_id][$a_property];
95  }
97  ->debug("block id: " . $a_block_id . ", user id: " . $a_user_id . ", property: " . $a_property . ", val: " . print_r($val, true));
98  return $val;
99  }
100 }
static getProperty($a_block_id, $a_user_id, $a_property)
Get property in session or db.
$_SESSION["AccountId"]
global $DIC
Definition: saml.php:7
$_GET["client_id"]
user()
Definition: user.php:4
global $ilCtrl
Definition: ilias.php:18
static storeProperty($a_block_id, $a_user_id, $a_property, $a_value)
Store property in session or db.
$ilUser
Definition: imgupload.php:18
static getLogger($a_component_id)
Get component logger.