45 public static function getDefaultConfiguration()
55 $rset = $ilDB->query(
$query);
56 if(
$row = $ilDB->fetchObject($rset))
58 return new self((int)
$row->instance_id,
$row);
69 require_once
'Modules/Chatroom/classes/class.ilChatroomServerSettings.php';
77 public function saveGeneralSettings(stdClass
$settings)
84 $res = $ilDB->queryF(
"
86 FROM chatroom_admconfig
87 WHERE instance_id = %s",
89 array($this->config_id)
96 FROM chatroom_admconfig
97 WHERE instance_id = %s",
99 array($this->config_id)
102 $row[
'default_config'] !== null ? $def_conf =
$row[
'default_config'] : $def_conf =
"{}";
103 $row[
'client_settings'] !== null ? $clnt_set =
$row[
'client_settings'] : $clnt_set =
"{}";
106 INSERT INTO chatroom_admconfig
107 (instance_id, server_settings, default_config, client_settings)
108 VALUES (%s, %s, %s, %s)",
109 array(
'integer',
'text',
'integer',
'text'),
110 array($this->config_id, json_encode($settings), $def_conf, $clnt_set)
118 public function saveClientSettings(stdClass $settings)
125 $res = $ilDB->queryF(
"
127 FROM chatroom_admconfig
128 WHERE instance_id = %s",
130 array($this->config_id)
137 FROM chatroom_admconfig
138 WHERE instance_id = %s",
140 array($this->config_id)
143 $row[
'default_config'] !== null ? $def_conf =
$row[
'default_config'] : $def_conf =
"{}";
144 $row[
'server_settings'] !== null ? $srv_set =
$row[
'server_settings'] : $srv_set =
"{}";
147 INSERT INTO chatroom_admconfig
148 (instance_id, server_settings, default_config, client_settings)
149 VALUES (%s, %s, %s, %s)",
160 json_encode($settings)
169 public function loadGeneralSettings()
176 $query =
'SELECT * FROM ' . self::$settingsTable .
' WHERE instance_id = ' . $ilDB->quote($this->config_id,
'integer');
178 if((
$row = $ilDB->fetchAssoc($ilDB->query(
$query))) &&
$row[
'server_settings'])
180 return json_decode(
$row[
'server_settings']);
190 public function loadClientSettings()
197 $query =
'SELECT * FROM ' . self::$settingsTable .
' WHERE instance_id = ' . $ilDB->quote($this->config_id,
'integer');
198 if((
$row = $ilDB->fetchAssoc($ilDB->query(
$query))) &&
$row[
'client_settings'])
200 return json_decode(
$row[
'client_settings']);