ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilTableTemplatesStorage Class Reference

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

+ Collaboration diagram for ilTableTemplatesStorage:

Public Member Functions

 store ($a_context, $a_user_id, $a_name, array $a_state)
 Store table template. More...
 
 load ($a_context, $a_user_id, $a_name)
 Get table template. More...
 
 delete ($a_context, $a_user_id, $a_name)
 Delete table template. More...
 
 getNames ($a_context, $a_user_id)
 List templates. More...
 

Detailed Description

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

filter on/off)

Author
Jörg Lützenkirchen luetz.nosp@m.enki.nosp@m.rchen.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

ilTableTemplatesStorage:

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

Member Function Documentation

◆ delete()

ilTableTemplatesStorage::delete (   $a_context,
  $a_user_id,
  $a_name 
)

Delete table template.

Parameters
string$a_context
int$a_user_id
string$a_name

Definition at line 73 of file class.ilTableTemplatesStorage.php.

References $ilDB.

74  {
75  global $ilDB;
76 
77  if ($a_context == "" || $a_name == "")
78  {
79  return;
80  }
81 
82  $ilDB->query("DELETE FROM table_templates ".
83  " WHERE name = ".$ilDB->quote($a_name, "text").
84  " AND user_id = ".$ilDB->quote($a_user_id, "integer").
85  " AND context = ".$ilDB->quote($a_context, "text")
86  );
87  }
global $ilDB

◆ getNames()

ilTableTemplatesStorage::getNames (   $a_context,
  $a_user_id 
)

List templates.

Parameters
string$a_context
int$a_user_id
Returns
array

Definition at line 96 of file class.ilTableTemplatesStorage.php.

References $ilDB, $result, and array.

97  {
98  global $ilDB;
99 
100  if ($a_context == "")
101  {
102  return;
103  }
104 
105  $set = $ilDB->query("SELECT name FROM table_templates ".
106  " WHERE user_id = ".$ilDB->quote($a_user_id, "integer").
107  " AND context = ".$ilDB->quote($a_context, "text").
108  " ORDER BY name"
109  );
110  $result = array();
111  while ($rec = $ilDB->fetchAssoc($set))
112  {
113  $result[] = $rec["name"];
114  }
115  return $result;
116  }
$result
Create styles array
The data for the language used.
global $ilDB

◆ load()

ilTableTemplatesStorage::load (   $a_context,
  $a_user_id,
  $a_name 
)

Get table template.

Parameters
string$a_context
int$a_user_id
string$a_name
Returns
array

Definition at line 48 of file class.ilTableTemplatesStorage.php.

References $ilDB.

49  {
50  global $ilDB;
51 
52  if ($a_context == "" || $a_name == "")
53  {
54  return;
55  }
56 
57  $set = $ilDB->query("SELECT value FROM table_templates ".
58  " WHERE name = ".$ilDB->quote($a_name, "text").
59  " AND user_id = ".$ilDB->quote($a_user_id, "integer").
60  " AND context = ".$ilDB->quote($a_context, "text")
61  );
62  $rec = $ilDB->fetchAssoc($set);
63  return unserialize($rec["value"]);
64  }
global $ilDB

◆ store()

ilTableTemplatesStorage::store (   $a_context,
  $a_user_id,
  $a_name,
array  $a_state 
)

Store table template.

Parameters
string$a_context
int$a_user_id
string$a_name
array$a_state

Definition at line 22 of file class.ilTableTemplatesStorage.php.

References $ilDB, and array.

23  {
24  global $ilDB;
25 
26  if ($a_context == "" || $a_name == "")
27  {
28  return;
29  }
30 
31  $ilDB->replace("table_templates", array(
32  "name" => array("text", $a_name),
33  "user_id" => array("integer", $a_user_id),
34  "context" => array("text", $a_context)),
35  array(
36  "value" => array("text", serialize($a_state))
37  ));
38  }
Create styles array
The data for the language used.
global $ilDB

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