44 $this->module = $a_module;
46 if (!is_object($ilDB))
48 die (
"Fatal Error: ilSettings object instantiated without DB initialisation.");
60 $this->setting = array();
62 $query =
"SELECT * FROM settings WHERE module=".$ilDB->quote($this->module,
"text");
65 while (
$row = $ilDB->fetchAssoc(
$res))
67 $this->setting[
$row[
"keyword"]] = $row[
"value"];
81 function get($a_keyword, $a_default_value =
false)
83 if ($a_keyword ==
"ilias_version")
88 if (isset($this->setting[$a_keyword]))
90 return $this->setting[$a_keyword];
94 return $a_default_value;
108 $query =
"DELETE FROM settings WHERE module = ".$ilDB->quote($this->module,
"text");
109 $ilDB->manipulate(
$query);
111 $this->setting = array();
126 $query =
"DELETE FROM settings WHERE module = ".$ilDB->quote($this->module,
"text").
127 " AND ".$ilDB->like(
"keyword",
"text", $a_like);
128 $ilDB->manipulate(
$query);
140 function delete($a_keyword)
144 $st = $ilDB->manipulate(
"DELETE FROM settings WHERE keyword = ".
145 $ilDB->quote($a_keyword,
"text").
" AND module = ".
146 $ilDB->quote($this->module,
"text"));
148 unset($this->setting[$a_keyword]);
172 function set($a_key, $a_val)
176 $this->
delete($a_key);
182 $ilDB->insert(
"settings", array(
183 "module" => array(
"text", $this->module),
184 "keyword" => array(
"text", $a_key),
185 "value" => array(
"clob", $a_val)));
187 $this->setting[$a_key] = $a_val;
196 $query =
"SELECT value FROM settings WHERE module = %s AND keyword = %s";
197 $res = $ilDB->queryF(
$query, array(
'text',
'text'), array($a_module, $a_keyword));
199 return $data[
'value'];