121 : void {
123
124 $this->gui->switchToVisibleMode();
125
126
127 if ($export) {
128 $roomTpl =
new ilGlobalTemplate(
'tpl.history_export.html',
true,
true,
'components/ILIAS/Chatroom');
129 } else {
130 $roomTpl =
new ilTemplate(
'tpl.history.html',
true,
true,
'components/ILIAS/Chatroom');
131 }
132
133 if ($export) {
135 }
136
137 $time_format = $this->ilUser->getTimeFormat();
138
139 $num_messages_shown = 0;
140 $prev_date_time_presentation = null;
141 $prev_date_time = null;
142 if ($export) {
144 switch (
$message[
'message']->type) {
145 case 'message':
149
151 $roomTpl,
152 $prev_date_time,
153 $message_date_time,
154 $message_date,
155 $prev_date_time_presentation,
156 $message_date_time_presentation,
157 $time_format
158 );
159
160 $roomTpl->setCurrentBlock('message_line');
161 $roomTpl->setVariable(
'MESSAGECONTENT', htmlspecialchars(
$message[
'message']->content, ENT_QUOTES | ENT_SUBSTITUTE,
'utf-8'));
162 $roomTpl->setVariable(
'MESSAGESENDER', htmlspecialchars(
$message[
'message']->
from->username, ENT_QUOTES | ENT_SUBSTITUTE,
'utf-8'));
163 $roomTpl->parseCurrentBlock();
164
165 $roomTpl->setCurrentBlock('row');
166 $roomTpl->parseCurrentBlock();
167
168 ++$num_messages_shown;
169 break;
170 }
171 }
172 }
173
174 if (!$num_messages_shown) {
175 $roomTpl->setVariable('LBL_NO_MESSAGES', $this->ilLng->txt('no_messages'));
176 }
177
178 $scope = $this->ilLng->txt(
'main');
179
182
184 $unixFrom = $from->getUnixTime();
185 $unixTo = $to->getUnixTime();
186
187 if ($unixFrom === $unixTo) {
190 } else {
194 }
196
197 $roomTpl->setVariable(
198 'ROOM_TITLE',
199 sprintf($this->ilLng->txt('history_title_general'), $this->gui->getObject()->getTitle()) . ' (' . $date_sub . ')'
200 );
201 }
202
203 if ($export) {
205 $roomTpl->get(),
207 'text/html'
208 );
209 }
210
211 $roomTpl->setVariable(
'PERIOD_FORM', $durationForm->
getHTML());
212
215 $this->mainTpl->addJavaScript('assets/js/socket.io.min.js');
216 $this->mainTpl->addJavaScript('assets/js/Chatroom.min.js');
217 $roomTpl->setVariable(
'CHAT', (
new ilChatroomViewGUI($this->gui))->readOnlyChatWindow($room, array_column(
$messages,
'message'))->
get());
218 } else {
219 $roomTpl->setVariable('CHAT', '');
220 }
221 $this->mainTpl->setVariable('ADM_CONTENT', $roomTpl->get());
222 }
redirectIfNoPermission($permission)
Checks for requested permissions and redirects if the permission check failed.
renderDateTimeInformation( $room_tpl, ?ilDateTime &$prev_date_time, ilDateTime $message_date_time, ilDate $message_date, ?string &$prev_date_time_presentation, string $message_date_time_presentation, string $time_format)
static useRelativeDates()
static setUseRelativeDates(bool $a_status)
set use relative dates
static formatPeriod(ilDateTime $start, ilDateTime $end, bool $a_skip_starting_day=false, ?ilObjUser $user=null)
Format a period of two dates Shows: 14.
@classDescription Date and time handling
static getASCIIFilename(string $a_filename)
special template class to simplify handling of ITX/PEAR
static initLinkify(?ilGlobalTemplateInterface $a_tpl=null)
special template class to simplify handling of ITX/PEAR
static deliverData(string $a_data, string $a_filename, string $mime="application/octet-stream")