22 function store($a_context, $a_user_id, $a_name, array $a_state)
26 if ($a_context ==
"" || $a_name ==
"")
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)),
36 "value" => array(
"text", serialize($a_state))
48 function load($a_context, $a_user_id, $a_name)
52 if ($a_context ==
"" || $a_name ==
"")
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")
62 $rec = $ilDB->fetchAssoc($set);
63 return unserialize($rec[
"value"]);
73 function delete($a_context, $a_user_id, $a_name)
77 if ($a_context ==
"" || $a_name ==
"")
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")
100 if ($a_context ==
"")
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").
111 while ($rec = $ilDB->fetchAssoc($set))