Class ilChatroomXMLParser.
More...
◆ __construct()
ilChatroomXMLParser::__construct |
( |
ilObjChatroom |
$chat, |
|
|
string |
$a_xml_data |
|
) |
| |
◆ getImportInstallId()
ilChatroomXMLParser::getImportInstallId |
( |
| ) |
|
◆ handlerBeginTag()
ilChatroomXMLParser::handlerBeginTag |
( |
|
$a_xml_parser, |
|
|
string |
$a_name, |
|
|
array |
$a_attribs |
|
) |
| |
◆ handlerCharacterData()
ilChatroomXMLParser::handlerCharacterData |
( |
|
$a_xml_parser, |
|
|
string |
$a_data |
|
) |
| |
◆ handlerEndTag()
ilChatroomXMLParser::handlerEndTag |
( |
|
$a_xml_parser, |
|
|
string |
$a_name |
|
) |
| |
Definition at line 98 of file class.ilChatroomXMLParser.php.
References $cdata, $exportSubRoomId, $timestamp, ILIAS\Repository\int(), isSameInstallation(), and ilUtil\stripSlashes().
100 $this->cdata = trim($this->cdata);
104 if ($this->in_sub_rooms) {
116 $this->room->setSetting(
'online_status', (
int) $this->cdata);
119 case 'AllowAnonymousAccess':
120 $this->room->setSetting(
'allow_anonymous', (
int) $this->cdata);
123 case 'AllowCustomUsernames':
124 $this->room->setSetting(
'allow_custom_usernames', (
int) $this->cdata);
127 case 'EnableHistory':
128 $this->room->setSetting(
'enable_history', (
int) $this->cdata);
131 case 'RestrictHistory':
132 $this->room->setSetting(
'restrict_history', (
int) $this->cdata);
135 case 'PrivateRoomsEnabled':
136 $this->room->setSetting(
'private_rooms_enabled', (
int) $this->cdata);
139 case 'DisplayPastMessages':
140 $this->room->setSetting(
'display_past_msgs', (
int) $this->cdata);
143 case 'AutoGeneratedUsernameSchema':
148 $this->exportRoomId = (
int) $this->cdata;
152 $this->exportSubRoomId = (
int) $this->cdata;
156 $this->owner = (
int) $this->cdata;
160 $this->closed = (
int) $this->cdata;
164 $this->
public = (
int) $this->cdata;
167 case 'CreatedTimestamp':
168 $this->timestamp = (
int) $this->cdata;
171 case 'PrivilegedUserId':
172 $this->userIds[] = (
int) $this->cdata;
178 $user->setId((
int) $this->owner);
181 $subRoomId = $this->room->addPrivateRoom(
185 'public' => (
bool) $this->
public,
186 'created' => (
int) $this->timestamp,
187 'closed' => (
bool) $this->closed
191 foreach ($this->userIds as $userId) {
192 $this->room->inviteUserToPrivateRoom($userId, $subRoomId);
198 $this->exportSubRoomId = 0;
203 $this->timestamp = 0;
208 $this->in_sub_rooms =
false;
217 $message = json_decode($this->message,
true, 512, JSON_THROW_ON_ERROR);
220 (0 === $this->exportSubRoomId || array_key_exists($this->exportSubRoomId, $this->subRoomIdMapping))
222 $message[
'roomId'] = $this->room->getRoomId();
227 $this->room->addHistoryEntry(
$message);
231 $this->timestamp = 0;
232 $this->exportSubRoomId = 0;
236 $this->in_messages =
false;
240 $this->chat->update();
242 $this->room->setSetting(
'online_status', 0);
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
◆ isSameInstallation()
ilChatroomXMLParser::isSameInstallation |
( |
| ) |
|
|
private |
◆ setHandlers()
ilChatroomXMLParser::setHandlers |
( |
|
$a_xml_parser | ) |
|
Definition at line 78 of file class.ilChatroomXMLParser.php.
80 xml_set_object($a_xml_parser, $this);
81 xml_set_element_handler($a_xml_parser, [$this,
'handlerBeginTag'], [$this,
'handlerEndTag']);
82 xml_set_character_data_handler($a_xml_parser, [$this,
'handlerCharacterData']);
◆ setImportInstallId()
ilChatroomXMLParser::setImportInstallId |
( |
?string |
$id | ) |
|
◆ $cdata
string ilChatroomXMLParser::$cdata = '' |
|
protected |
◆ $chat
◆ $closed
int ilChatroomXMLParser::$closed = 0 |
|
protected |
◆ $exportRoomId
int ilChatroomXMLParser::$exportRoomId = 0 |
|
protected |
◆ $exportSubRoomId
int ilChatroomXMLParser::$exportSubRoomId = 0 |
|
protected |
◆ $import_install_id
string ilChatroomXMLParser::$import_install_id = null |
|
protected |
◆ $in_messages
bool ilChatroomXMLParser::$in_messages = false |
|
protected |
◆ $in_sub_rooms
bool ilChatroomXMLParser::$in_sub_rooms = false |
|
protected |
◆ $message
string ilChatroomXMLParser::$message = '' |
|
protected |
◆ $owner
int ilChatroomXMLParser::$owner = 0 |
|
protected |
◆ $public
int ilChatroomXMLParser::$public = 0 |
|
protected |
◆ $room
◆ $subRoomIdMapping
array ilChatroomXMLParser::$subRoomIdMapping = [] |
|
protected |
◆ $timestamp
int ilChatroomXMLParser::$timestamp = 0 |
|
protected |
◆ $title
string ilChatroomXMLParser::$title = '' |
|
protected |
◆ $userIds
array ilChatroomXMLParser::$userIds = [] |
|
protected |
The documentation for this class was generated from the following file: