ILIAS  release_4-3 Revision
 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.
 isValidProperty ($a_property)
 Check if given property id is valid.

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 28 of file class.ilTablePropertiesStorage.php.

References $cmd, $ilCtrl, and $ilUser.

{
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 106 of file class.ilTablePropertiesStorage.php.

References $_SESSION, and isValidProperty().

{
global $ilDB;
if ($a_table_id == "" || !$this->isValidProperty($a_property))
{
return;
}
$storage = $this->properties[$a_property]["storage"];
if ($a_user_id == ANONYMOUS_USER_ID)
{
$storage = "session";
}
switch ($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;
}
}

+ Here is the call graph for this function:

ilTablePropertiesStorage::hideFilter ( )

Hide Filter.

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

References $_GET, $ilUser, 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::isValidProperty (   $a_property)

Check if given property id is valid.

Parameters
string$a_property
Returns
bool

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

Referenced by getProperty(), and storeProperty().

{
if(array_key_exists($a_property, $this->properties))
{
return true;
}
return false;
}

+ Here is the caller graph for this function:

ilTablePropertiesStorage::showFilter ( )

Show Filter.

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

References $_GET, $ilUser, 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 69 of file class.ilTablePropertiesStorage.php.

References $_SESSION, and isValidProperty().

Referenced by hideFilter(), and showFilter().

{
global $ilDB;
if ($a_table_id == "" || !$this->isValidProperty($a_property))
{
return;
}
$storage = $this->properties[$a_property]["storage"];
if ($a_user_id == ANONYMOUS_USER_ID)
{
$storage = "session";
}
switch ($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 call graph for this function:

+ 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"),
"rows" => array("storage" => "db"),
"offset" => array("storage" => "session"),
"selfields" => array("storage" => "db"),
"selfilters" => array("storage" => "db"),
"filter_values" => array("storage" => "db")
)

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


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