45 public static function getDefaultConfiguration()
53 $query =
'SELECT * FROM ' . self::$settingsTable;
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';
70 return ilChatroomServerSettings::loadDefault();
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 $settings = json_decode(
$row[
'server_settings'],
true);
182 if(!$settings[
'protocol'])
184 $settings[
'protocol'] =
'http';
197 public function loadClientSettings()
204 $query =
'SELECT * FROM ' . self::$settingsTable .
' WHERE instance_id = ' . $ilDB->quote($this->config_id,
'integer');
205 if((
$row = $ilDB->fetchAssoc($ilDB->query(
$query))) &&
$row[
'client_settings'])
207 $settings = json_decode(
$row[
'client_settings'],
true);
209 if(!$settings[
'osd_intervall'])
211 $settings[
'osd_intervall'] = 60;
214 if(!$settings[
'client'])
216 $settings[
'client'] = CLIENT_ID;
219 $settings[
'client_name'] = (
string)$settings[
'name'];
220 if (!$settings[
'client_name']) {
221 $settings[
'client_name'] = CLIENT_ID;
Add rich text string
The name of the decorator.
Create styles array
The data for the language used.
__construct($config_id, stdClass $settings=null)
Constructor Sets $this->config_id and $this->settings using given $config_id and $settings.
getServerSettings()
Instantiates ilChatroomServerSettings object, sets data using $this->settings->server_settings and re...