49 $DIC->database()->setLimit(1);
50 $query =
'SELECT * FROM ' . self::$settingsTable;
52 $rset = $DIC->database()->query(
$query);
53 if (
$row = $DIC->database()->fetchObject($rset)) {
54 return new self((int)
$row->instance_id,
$row);
65 require_once
'Modules/Chatroom/classes/class.ilChatroomServerSettings.php';
77 $res = $DIC->database()->queryF(
80 FROM chatroom_admconfig 81 WHERE instance_id = %s",
83 array($this->config_id)
86 $row = $DIC->database()->fetchAssoc(
$res);
88 $DIC->database()->manipulateF(
91 FROM chatroom_admconfig 92 WHERE instance_id = %s",
94 array($this->config_id)
97 $row[
'default_config'] !== null ? $def_conf =
$row[
'default_config'] : $def_conf =
"{}";
98 $row[
'client_settings'] !== null ? $clnt_set =
$row[
'client_settings'] : $clnt_set =
"{}";
100 $DIC->database()->manipulateF(
102 INSERT INTO chatroom_admconfig 103 (instance_id, server_settings, default_config, client_settings) 104 VALUES (%s, %s, %s, %s)",
105 array(
'integer',
'text',
'integer',
'text'),
106 array($this->config_id, json_encode($settings), $def_conf, $clnt_set)
118 $res = $DIC->database()->queryF(
121 FROM chatroom_admconfig 122 WHERE instance_id = %s",
124 array($this->config_id)
127 $row = $DIC->database()->fetchAssoc(
$res);
129 $DIC->database()->manipulateF(
132 FROM chatroom_admconfig 133 WHERE instance_id = %s",
135 array($this->config_id)
138 $row[
'default_config'] !== null ? $def_conf =
$row[
'default_config'] : $def_conf =
"{}";
139 $row[
'server_settings'] !== null ? $srv_set =
$row[
'server_settings'] : $srv_set =
"{}";
141 $DIC->database()->manipulateF(
143 INSERT INTO chatroom_admconfig 144 (instance_id, server_settings, default_config, client_settings) 145 VALUES (%s, %s, %s, %s)",
156 json_encode($settings)
169 $query =
'SELECT * FROM ' . self::$settingsTable .
' WHERE instance_id = ' . $DIC->database()->quote($this->config_id,
'integer');
171 if ((
$row = $DIC->database()->fetchAssoc($DIC->database()->query(
$query))) &&
$row[
'server_settings']) {
196 $query =
'SELECT * FROM ' . self::$settingsTable .
' WHERE instance_id = ' . $DIC->database()->quote($this->config_id,
'integer');
197 if ((
$row = $DIC->database()->fetchAssoc($DIC->database()->query(
$query))) &&
$row[
'client_settings']) {
saveGeneralSettings(stdClass $settings)
Saves given $settings into settingsTable.
static getDefaultConfiguration()
Instantiates and returns ilChatroomAdmin object using instance_id and settings from settingsTable...
foreach($_POST as $key=> $value) $res
loadGeneralSettings()
Returns an array containing server settings from settingsTable.
loadClientSettings()
Returns an array containing client settings from settingsTable.
__construct($config_id, stdClass $settings=null)
Constructor Sets $this->config_id and $this->settings using given $config_id and $settings.
saveClientSettings(stdClass $settings)
Saves given client $settings into settingsTable.
getServerSettings()
Instantiates ilChatroomServerSettings object, sets data using $this->settings->server_settings and re...