Class ilChatroomXMLWriter.
More...
|
| __construct (ilObjChatroom $chat) |
|
| start () |
|
| getXML () |
|
| __construct (string $version="1.0", string $outEnc="utf-8", string $inEnc="utf-8") |
|
| xmlSetDtdDef (string $dtdDef) |
| Sets dtd definition. More...
|
|
| xmlSetGenCmt (string $genCmt) |
| Sets generated comment. More...
|
|
| xmlFormatData (string $data) |
| Indents text for better reading. More...
|
|
| xmlHeader () |
| Writes xml header. More...
|
|
| xmlStartTag (string $tag, ?array $attrs=null, bool $empty=false, bool $encode=true, bool $escape=true) |
| Writes a starttag. More...
|
|
| xmlEndTag (string $tag) |
| Writes an endtag. More...
|
|
| xmlData (string $data, bool $encode=true, bool $escape=true) |
| Writes data. More...
|
|
| xmlElement (string $tag, $attrs=null, $data=null, $encode=true, $escape=true) |
| Writes a basic element (no children, just textual content) More...
|
|
| xmlDumpFile (string $file, bool $format=true) |
| Dumps xml document from memory into a file. More...
|
|
| xmlDumpMem (bool $format=true) |
| Returns xml document from memory. More...
|
|
| appendXML (string $a_str) |
| append xml string to document More...
|
|
| xmlClear () |
| clears xmlStr More...
|
|
◆ __construct()
◆ exportData()
ilChatroomXMLWriter::exportData |
( |
| ) |
|
|
private |
Definition at line 66 of file class.ilChatroomXMLWriter.php.
References ilXmlWriter\xmlElement(), ilXmlWriter\xmlEndTag(), and ilXmlWriter\xmlStartTag().
Referenced by start().
68 $privateRooms = $this->room->getPrivateRooms();
69 if (count($privateRooms) > 0) {
71 foreach ($privateRooms as $privateRoom) {
73 $this->
xmlElement(
'SubRoomId', null, (
string) ((
int) $privateRoom[
'proom_id']));
74 $this->
xmlElement(
'Title', null, (
string) $privateRoom[
'title']);
75 $this->
xmlElement(
'Owner', null, (
string) ((
int) $privateRoom[
'owner']));
76 $this->
xmlElement(
'Closed', null, (
string) ((
int) $privateRoom[
'closed']));
77 $this->
xmlElement(
'Public', null, (
string) ((
int) $privateRoom[
'is_public']));
78 $this->
xmlElement(
'CreatedTimestamp', null, (
string) ((
int) $privateRoom[
'created']));
80 foreach ($this->room->getPrivilegedUsersForPrivateRoom((
int) $privateRoom[
'proom_id']) as $usrId) {
81 $this->
xmlElement(
'PrivilegedUserId', null, (
string) $usrId);
89 $history = $this->room->getHistory(null, null, null, null,
false);
90 if (count($history) > 0) {
92 foreach ($history as $entry) {
94 $this->
xmlElement(
'SubRoomId', null, (
string) ((
int) $entry[
'sub_room']));
95 $this->
xmlElement(
'Body', null, json_encode($entry[
'message'], JSON_THROW_ON_ERROR));
96 $this->
xmlElement(
'CreatedTimestamp', null, (
string) ((
int) $entry[
'timestamp']));
xmlEndTag(string $tag)
Writes an endtag.
xmlStartTag(string $tag, ?array $attrs=null, bool $empty=false, bool $encode=true, bool $escape=true)
Writes a starttag.
xmlElement(string $tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)
◆ getXML()
ilChatroomXMLWriter::getXML |
( |
| ) |
|
◆ start()
ilChatroomXMLWriter::start |
( |
| ) |
|
Definition at line 42 of file class.ilChatroomXMLWriter.php.
References exportData(), ilXmlWriter\xmlElement(), ilXmlWriter\xmlEndTag(), and ilXmlWriter\xmlStartTag().
46 $this->
xmlElement(
'ObjId', null, (
string) $this->chat->getId());
47 $this->
xmlElement(
'RoomId', null, (
string) $this->room->getRoomId());
48 $this->
xmlElement(
'Title', null, $this->chat->getTitle());
49 $this->
xmlElement(
'Description', null, $this->chat->getDescription());
50 $this->
xmlElement(
'OnlineStatus', null, (
string) ((
int) $this->room->getSetting(
'online_status')));
51 $this->
xmlElement(
'AllowAnonymousAccess', null, (
string) ((
int) $this->room->getSetting(
'allow_anonymous')));
52 $this->
xmlElement(
'AllowCustomUsernames', null, (
string) ((
int) $this->room->getSetting(
'allow_custom_usernames')));
53 $this->
xmlElement(
'EnableHistory', null, (
string) ((
int) $this->room->getSetting(
'enable_history')));
54 $this->
xmlElement(
'RestrictHistory', null, (
string) ((
int) $this->room->getSetting(
'restrict_history')));
55 $this->
xmlElement(
'PrivateRoomsEnabled', null, (
string) ((
int) $this->room->getSetting(
'private_rooms_enabled')));
56 $this->
xmlElement(
'DisplayPastMessages', null, (
string) ((
int) $this->room->getSetting(
'display_past_msgs')));
57 $this->
xmlElement(
'AutoGeneratedUsernameSchema', null, (
string) $this->room->getSetting(
'autogen_usernames'));
59 if ($this->room->getRoomId() > 0) {
xmlEndTag(string $tag)
Writes an endtag.
xmlStartTag(string $tag, ?array $attrs=null, bool $empty=false, bool $encode=true, bool $escape=true)
Writes a starttag.
xmlElement(string $tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)
◆ $chat
◆ $room
The documentation for this class was generated from the following file: