19declare(strict_types=1);
41 $this->room->setSetting(
'object_id', $this->chat->getId());
45 $this->
setXMLContent(
'<?xml version="1.0" encoding="utf-8"?>' . $a_xml_data);
50 $this->import_install_id =
$id;
72 public function handlerBeginTag(XMLParser $a_xml_parser,
string $a_name, array $a_attribs): void
76 $this->timestamp =
null;
77 $this->message =
null;
81 $this->in_messages =
true;
86 public function handlerEndTag(XMLParser $a_xml_parser,
string $a_name): void
88 $this->cdata = trim($this->cdata);
100 $this->chat->setOfflineStatus(
101 ((
int) $this->cdata) === 0
105 case 'AllowAnonymousAccess':
106 $this->room->setSetting(
'allow_anonymous', (
int) $this->cdata);
109 case 'AllowCustomUsernames':
110 $this->room->setSetting(
'allow_custom_usernames', (
int) $this->cdata);
113 case 'EnableHistory':
114 $this->room->setSetting(
'enable_history', (
int) $this->cdata);
117 case 'DisplayPastMessages':
118 $this->room->setSetting(
'display_past_msgs', (
int) $this->cdata);
121 case 'AutoGeneratedUsernameSchema':
126 $this->exportRoomId = (
int) $this->cdata;
129 case 'CreatedTimestamp':
130 $this->timestamp = (
int) $this->cdata;
139 $message = json_decode($this->message,
true, 512, JSON_THROW_ON_ERROR);
141 $message[
'roomId'] = $this->room->getRoomId();
144 $this->room->addHistoryEntry(
$message);
150 $this->in_messages =
false;
155 $this->chat->setOfflineStatus(
true);
156 $this->chat->update();
166 if ($a_data !==
"\n") {
167 $this->cdata .= preg_replace(
"/\t+/",
' ', $a_data);
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
handlerEndTag(XMLParser $a_xml_parser, string $a_name)
__construct(protected ilObjChatroom $chat, string $a_xml_data)
setHandlers($a_xml_parser)
handlerBeginTag(XMLParser $a_xml_parser, string $a_name, array $a_attribs)
setImportInstallId(?string $id)
handlerCharacterData(XMLParser $a_xml_parser, string $a_data)
string $import_install_id
static byObjectId(int $object_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setXMLContent(string $a_xml_content)
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc