ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilTablePropertiesStorage Class Reference

Saves (mostly asynchronously) user properties of tables (e.g. More...

+ Collaboration diagram for ilTablePropertiesStorage:

Public Member Functions

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

Data Fields

 $properties

Detailed Description

Saves (mostly asynchronously) user properties of tables (e.g.

filter on/off)

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

ilTablePropertiesStorage:

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

Member Function Documentation

& ilTablePropertiesStorage::executeCommand ( )

execute command

Definition at line 24 of file class.ilTablePropertiesStorage.php.

References $cmd, and $ilCtrl.

{
global $ilUser, $ilCtrl;
$cmd = $ilCtrl->getCmd();
// $next_class = $this->ctrl->getNextClass($this);
$this->$cmd();
}
ilTablePropertiesStorage::getProperty (   $a_table_id,
  $a_user_id,
  $a_property 
)

Get property in session or db.

Definition at line 91 of file class.ilTablePropertiesStorage.php.

References $_SESSION, and $ilDB.

{
global $ilDB;
switch ($this->properties[$a_property]["storage"])
{
case "session":
return $_SESSION["table"][$a_table_id][$a_user_id][$a_property];
break;
case "db":
$set = $ilDB->query("SELECT value FROM table_properties ".
" WHERE table_id = ".$ilDB->quote($a_table_id, "text").
" AND user_id = ".$ilDB->quote($a_user_id, "integer").
" AND property = ".$ilDB->quote($a_property, "text")
);
$rec = $ilDB->fetchAssoc($set);
return $rec["value"];
break;
}
}
ilTablePropertiesStorage::hideFilter ( )

Hide Filter.

Definition at line 51 of file class.ilTablePropertiesStorage.php.

References $_GET, and storeProperty().

{
global $ilUser;
if ($_GET["user_id"] == $ilUser->getId())
{
$this->storeProperty($_GET["table_id"], $_GET["user_id"],
"filter", 0);
}
}

+ Here is the call graph for this function:

ilTablePropertiesStorage::showFilter ( )

Show Filter.

Definition at line 37 of file class.ilTablePropertiesStorage.php.

References $_GET, and storeProperty().

{
global $ilUser;
if ($_GET["user_id"] == $ilUser->getId())
{
$this->storeProperty($_GET["table_id"], $_GET["user_id"],
"filter", 1);
}
}

+ Here is the call graph for this function:

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

Store property in session or db.

Definition at line 65 of file class.ilTablePropertiesStorage.php.

References $_SESSION, and $ilDB.

Referenced by hideFilter(), and showFilter().

{
global $ilDB;
switch ($this->properties[$a_property]["storage"])
{
case "session":
$_SESSION["table"][$a_table_id][$a_user_id][$a_property]
= $a_value;
break;
case "db":
$ilDB->replace("table_properties", array(
"table_id" => array("text", $a_table_id),
"user_id" => array("integer", $a_user_id),
"property" => array("text", $a_property)),
array(
"value" => array("text", $a_value)
));
}
}

+ Here is the caller graph for this function:

Field Documentation

ilTablePropertiesStorage::$properties
Initial value:
array (
"filter" => array("storage" => "db"),
"direction" => array("storage" => "db"),
"order" => array("storage" => "db"),
"offset" => array("storage" => "session")
)

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


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