Public Member Functions | |
| ilSetting ($a_module="common") | |
| Initialise Settings. | |
| get ($a_keyword, $a_default_value=false) | |
| get setting | |
| deleteAll () | |
| Delete all settings of a current module. | |
| delete ($a_keyword) | |
| delete one value from settingstable public | |
| getAll () | |
| read all values from settingstable public | |
| set ($a_key, $a_val) | |
| write one value to db-table settings public | |
Data Fields | |
| $setting = array() | |
| $module = "" | |
ILIAS Setting Class.
Definition at line 32 of file class.ilSetting.php.
| ilSetting::delete | ( | $ | a_keyword | ) |
delete one value from settingstable public
| string | keyword |
Definition at line 110 of file class.ilSetting.php.
{
global $ilDB;
$query = "DELETE FROM settings WHERE keyword = ".
$ilDB->quote($a_keyword) . " AND module=" . $ilDB->quote($this->module);
$ilDB->query($query);
unset($this->setting[$a_keyword]);
return true;
}
| ilSetting::deleteAll | ( | ) |
Delete all settings of a current module.
public
Definition at line 94 of file class.ilSetting.php.
{
global $ilDB;
$query = "DELETE FROM settings WHERE module = ".$ilDB->quote($this->module)." ";
$ilDB->query($query);
$this->settings = array();
return true;
}
| ilSetting::get | ( | $ | a_keyword, | |
| $ | a_default_value = false | |||
| ) |
get setting
public
| string | keyword | |
| string | default_value This value is returned, when no setting has been found for the keyword. |
Definition at line 71 of file class.ilSetting.php.
{
if ($a_keyword == "ilias_version")
{
return ILIAS_VERSION;
}
if (isset($this->setting[$a_keyword]))
{
return $this->setting[$a_keyword];
}
else
{
return $a_default_value;
}
}
| ilSetting::getAll | ( | ) |
read all values from settingstable public
Definition at line 129 of file class.ilSetting.php.
{
return $this->setting;
}
| ilSetting::ilSetting | ( | $ | a_module = "common" |
) |
Initialise Settings.
Definition at line 40 of file class.ilSetting.php.
References $res.
{
global $ilDB;
$this->module = $a_module;
// check whether ini file object exists
if (!is_object($ilDB))
{
die ("Fatal Error: ilSettings object instantiated without DB initialisation.");
}
$query = "SELECT * FROM settings WHERE module=" . $ilDB->quote($this->module);
$res = $ilDB->query($query);
while ($row = $res->fetchRow(DB_FETCHMODE_ASSOC))
{
$this->setting[$row["keyword"]] = $row["value"];
}
}
| ilSetting::set | ( | $ | a_key, | |
| $ | a_val | |||
| ) |
write one value to db-table settings public
| string | keyword | |
| string | value |
Definition at line 141 of file class.ilSetting.php.
{
global $ilDB;
$sql = "DELETE FROM settings WHERE keyword=".$ilDB->quote($a_key).
" AND module=" . $ilDB->quote($this->module);
$ilDB->query($sql);
$sql = "INSERT INTO settings (module, keyword, value) VALUES (".
$ilDB->quote($this->module) . ",".$ilDB->quote($a_key).",".$ilDB->quote($a_val).")";
$ilDB->query($sql);
$this->setting[$a_key] = $a_val;
return true;
}
| ilSetting::$module = "" |
Definition at line 35 of file class.ilSetting.php.
| ilSetting::$setting = array() |
Definition at line 34 of file class.ilSetting.php.
1.7.1