ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilAccordionPropertiesStorage Class Reference

Saves (mostly asynchronously) user properties of accordions. More...

+ Collaboration diagram for ilAccordionPropertiesStorage:

Public Member Functions

executeCommand ()
 execute command More...
 
 setOpenedTab ()
 Show Filter. More...
 
 storeProperty ($a_table_id, $a_user_id, $a_property, $a_value)
 Store property in session or db. More...
 
 getProperty ($a_table_id, $a_user_id, $a_property)
 Get property in session or db. More...
 

Data Fields

 $properties
 

Detailed Description

Saves (mostly asynchronously) user properties of accordions.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

@ilCtrl_Calls ilAccordionPropertiesStorage:

Definition at line 12 of file class.ilAccordionPropertiesStorage.php.

Member Function Documentation

◆ executeCommand()

& ilAccordionPropertiesStorage::executeCommand ( )

execute command

Definition at line 21 of file class.ilAccordionPropertiesStorage.php.

22 {
23 global $ilUser, $ilCtrl;
24
25 $cmd = $ilCtrl->getCmd();
26// $next_class = $this->ctrl->getNextClass($this);
27
28 $this->$cmd();
29 }
global $ilCtrl
Definition: ilias.php:18
$cmd
Definition: sahs_server.php:35
global $ilUser
Definition: imgupload.php:15

References $cmd, $ilCtrl, and $ilUser.

◆ getProperty()

ilAccordionPropertiesStorage::getProperty (   $a_table_id,
  $a_user_id,
  $a_property 
)

Get property in session or db.

Definition at line 111 of file class.ilAccordionPropertiesStorage.php.

112 {
113 global $ilDB;
114
115 switch ($this->properties[$a_property]["storage"])
116 {
117 case "session":
118 $r = $_SESSION["accordion"][$a_table_id][$a_user_id][$a_property];
119//echo "<br><br><br><br><br><br><br><br>get-".$r;
120 return $r;
121 break;
122
123 case "db":
124/*
125 $set = $ilDB->query("SELECT value FROM table_properties ".
126 " WHERE table_id = ".$ilDB->quote($a_table_id, "text").
127 " AND user_id = ".$ilDB->quote($a_user_id, "integer").
128 " AND property = ".$ilDB->quote($a_property, "text")
129 );
130 $rec = $ilDB->fetchAssoc($set);
131 return $rec["value"];
132 break;
133*/
134 }
135 }
$_SESSION["AccountId"]
$r
Definition: example_031.php:79
global $ilDB

References $_SESSION, $ilDB, and $r.

Referenced by setOpenedTab().

+ Here is the caller graph for this function:

◆ setOpenedTab()

ilAccordionPropertiesStorage::setOpenedTab ( )

Show Filter.

Definition at line 34 of file class.ilAccordionPropertiesStorage.php.

35 {
36 global $ilUser;
37
38 if ($_GET["user_id"] == $ilUser->getId())
39 {
40 switch ($_GET["act"])
41 {
42
43 case "add":
44 $cur = $this->getProperty($_GET["accordion_id"], (int) $_GET["user_id"],
45 "opened");
46 $cur_arr = explode(";", $cur);
47 if (!in_array((int) $_GET["tab_nr"], $cur_arr))
48 {
49 $cur_arr[] = (int) $_GET["tab_nr"];
50 }
51 $this->storeProperty($_GET["accordion_id"], (int) $_GET["user_id"],
52 "opened", implode($cur_arr, ";"));
53 break;
54
55 case "rem":
56 $cur = $this->getProperty($_GET["accordion_id"], (int) $_GET["user_id"],
57 "opened");
58 $cur_arr = explode(";", $cur);
59 if(($key = array_search((int) $_GET["tab_nr"], $cur_arr)) !== false) {
60 unset($cur_arr[$key]);
61 }
62 $this->storeProperty($_GET["accordion_id"], (int) $_GET["user_id"],
63 "opened", implode($cur_arr, ";"));
64 break;
65
66 case "clear":
67 $this->storeProperty($_GET["accordion_id"], (int) $_GET["user_id"],
68 "opened", "");
69 break;
70
71 case "set":
72 default:
73 $this->storeProperty($_GET["accordion_id"], (int) $_GET["user_id"],
74 "opened", $_GET["tab_nr"]);
75 break;
76 }
77 }
78 }
$_GET["client_id"]
getProperty($a_table_id, $a_user_id, $a_property)
Get property in session or db.
storeProperty($a_table_id, $a_user_id, $a_property, $a_value)
Store property in session or db.

References $_GET, $ilUser, getProperty(), and storeProperty().

+ Here is the call graph for this function:

◆ storeProperty()

ilAccordionPropertiesStorage::storeProperty (   $a_table_id,
  $a_user_id,
  $a_property,
  $a_value 
)

Store property in session or db.

Definition at line 83 of file class.ilAccordionPropertiesStorage.php.

85 {
86 global $ilDB;
87
88 switch ($this->properties[$a_property]["storage"])
89 {
90 case "session":
91 $_SESSION["accordion"][$a_table_id][$a_user_id][$a_property]
92 = $a_value;
93 break;
94
95 case "db":
96/*
97 $ilDB->replace("table_properties", array(
98 "table_id" => array("text", $a_table_id),
99 "user_id" => array("integer", $a_user_id),
100 "property" => array("text", $a_property)),
101 array(
102 "value" => array("text", $a_value)
103 ));
104*/
105 }
106 }

References $_SESSION, and $ilDB.

Referenced by setOpenedTab().

+ Here is the caller graph for this function:

Field Documentation

◆ $properties

ilAccordionPropertiesStorage::$properties
Initial value:
= array (
"opened" => array("storage" => "session")
)

Definition at line 14 of file class.ilAccordionPropertiesStorage.php.


The documentation for this class was generated from the following file: