45 public static function getDefaultConfiguration()
58 return new self((int)
$row->instance_id,
$row);
69 require_once
'Modules/Chatroom/classes/class.ilChatroomServerSettings.php';
77 public function saveGeneralSettings(stdClass
$settings)
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)
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)",
169 public function loadGeneralSettings()
176 $query =
'SELECT * FROM ' . self::$settingsTable .
' WHERE instance_id = ' .
$ilDB->quote($this->config_id,
'integer');
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');
200 return json_decode(
$row[
'client_settings']);
getServerSettings()
Instantiates ilChatroomServerSettings object, sets data using $this->settings->server_settings and re...
__construct($config_id, stdClass $settings=null)
Constructor Sets $this->config_id and $this->settings using given $config_id and $settings.