ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilMailFolderGUI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
24use ILIAS\Refinery\Factory as Refinery;
26use ILIAS\Data\Factory as DataFactory;
33
38{
39 // used as single element namespace for UrlBuilder
40 // added with '_' before parameter names in queries from the table
41 private const string URL_BUILDER_PREFIX = 'ilMailFolderGUI';
42
43 // controller parameters
44 private const string PARAM_ACTION = 'action';
45 private const string PARAM_FOLDER_ID = 'mobj_id';
46 private const string PARAM_MAIL_ID = 'mail_id';
47 private const string PARAM_USER_ID = 'user_id';
48 private const string PARAM_TARGET_FOLDER = 'target_folder';
49 private const string PARAM_INTERRUPTIVE_ITEMS = 'interruptive_items';
50
51 // controller commands
52 private const string CMD_ADD_SUB_FOLDER = 'addSubFolder';
53 private const string CMD_DELETE_MAILS = 'deleteMails';
54 private const string CMD_DELETE_SUB_FOLDER = 'deleteSubFolder';
55 private const string CMD_DELIVER_FILE = 'deliverFile';
56 private const string CMD_EMPTY_TRASH = 'emptyTrash';
57 private const string CMD_MOVE_SINGLE_MAIL = 'moveSingleMail';
58 private const string CMD_PRINT_MAIL = 'printMail';
59 private const string CMD_RENAME_SUB_FOLDER = 'renameSubFolder';
60 private const string CMD_SHOW_MAIL = 'showMail';
61 private const string CMD_SHOW_FOLDER = 'showFolder';
62 private const string CMD_SHOW_USER = 'showUser';
63 private const string CMD_TABLE_ACTION = 'executeTableAction';
64
66 private readonly ilCtrlInterface $ctrl;
67 private readonly ilLanguage $lng;
68 private readonly ilToolbarGUI $toolbar;
69 private readonly ilTabsGUI $tabs;
70 private readonly ilObjUser $user;
71 private readonly GlobalHttpState $http;
72 private readonly Refinery $refinery;
73 private readonly ilErrorHandling $error;
74 private readonly Factory $ui_factory;
75 private readonly Renderer $ui_renderer;
76 private readonly ilUIService $ui_service;
77 private readonly DataFactory $data_factory;
78 private ilMail $umail;
81
82 public function __construct()
83 {
84 global $DIC;
85
86 $this->tpl = $DIC->ui()->mainTemplate();
87 $this->ctrl = $DIC->ctrl();
88 $this->lng = $DIC->language();
89 $this->toolbar = $DIC->toolbar();
90 $this->user = $DIC->user();
91 $this->tabs = $DIC->tabs();
92 $this->http = $DIC->http();
93 $this->refinery = $DIC->refinery();
94 $this->error = $DIC['ilErr'];
95 $this->ui_factory = $DIC->ui()->factory();
96 $this->ui_renderer = $DIC->ui()->renderer();
97 $this->ui_service = $DIC->uiService();
98 $this->data_factory = new ILIAS\Data\Factory();
99 }
100
101 public function getUnsafeGetCommands(): array
102 {
103 return [
105 ];
106 }
107
108 public function getSafePostCommands(): array
109 {
110 return [];
111 }
112
116 protected function initRequest(): void
117 {
118 $this->umail = new ilMail($this->user->getId());
119 $this->mbox = new ilMailbox($this->user->getId());
120
121 if ($this->http->wrapper()->post()->has(self::PARAM_FOLDER_ID)) {
122 $folder_id = $this->http->wrapper()->post()->retrieve(
123 self::PARAM_FOLDER_ID,
124 $this->refinery->kindlyTo()->int()
125 );
126 } elseif ($this->http->wrapper()->query()->has(self::PARAM_FOLDER_ID)) {
127 $folder_id = $this->http->wrapper()->query()->retrieve(
128 self::PARAM_FOLDER_ID,
129 $this->refinery->kindlyTo()->int()
130 );
131 } else {
132 $folder_id = $this->refinery->byTrying([
133 $this->refinery->kindlyTo()->int(),
134 $this->refinery->always(0),
135 ])->transform(ilSession::get(self::PARAM_FOLDER_ID));
136 }
137
138 if ($folder_id === 0 || !$this->mbox->isOwnedFolder($folder_id)) {
139 $folder_id = $this->mbox->getInboxFolder();
140 }
141
142 $folder = $this->mbox->getFolderData($folder_id);
143 if ($folder === null) {
144 $this->tpl->setOnScreenMessage(
146 $this->lng->txt('mail_operation_on_invalid_folder')
147 );
148 $this->tpl->printToStdout();
149 }
150 $this->folder = $folder;
151 }
152
153 public function executeCommand(): void
154 {
155 $this->initRequest();
156
157 $next_class = $this->ctrl->getNextClass($this) ?? '';
158 switch (strtolower($next_class)) {
159 case strtolower(ilContactGUI::class):
160 $this->ctrl->forwardCommand(new ilContactGUI());
161 break;
162
163 default:
164 $cmd = $this->ctrl->getCmd() ?? '';
165 match ($cmd) {
167 ),
168 default => $this->showFolder(),
169 };
170 }
171 }
172
173 protected function executeTableAction(): void
174 {
175 $action = $this->http->wrapper()->query()->retrieve(
176 self::URL_BUILDER_PREFIX . URLBuilder::SEPARATOR . self::PARAM_ACTION,
177 $this->refinery->byTrying([
178 $this->refinery->kindlyTo()->string(),
179 $this->refinery->always('')
180 ])
181 );
182
183 // Magic value of data table in ui framework, no public constant found
184 $for_all_entries = implode(
185 '',
186 $this->http->wrapper()->query()->retrieve(
187 self::URL_BUILDER_PREFIX . URLBuilder::SEPARATOR . self::PARAM_MAIL_ID,
188 $this->refinery->byTrying([
189 $this->refinery->kindlyTo()->listOf($this->refinery->kindlyTo()->string()),
190 $this->refinery->always([])
191 ])
192 )
193 ) === 'ALL_OBJECTS';
194
195 if ($for_all_entries) {
196 // we must apply the filter because the shown table is filtered, too
197 $mail_ids = $this->getFilteredSearch()->getMaiIds();
198 } else {
199 $mail_ids = $this->getMailIdsFromRequest();
200 }
201
202 if (empty($mail_ids)) {
203 // no redirect possible from async call
204 if ($action === MailFolderTableUI::ACTION_DELETE) {
205 $modal = $this->ui_factory->modal()->lightbox(
206 $this->ui_factory->modal()->lightboxTextPage(
207 $this->ui_renderer->render(
208 $this->ui_factory->messageBox()->failure($this->lng->txt('mail_select_one'))
209 ),
210 $this->lng->txt('delete'),
211 )
212 );
213 $this->http->saveResponse(
214 $this->http->response()->withBody(
215 Streams::ofString($this->ui_renderer->renderAsync($modal))
216 )
217 );
218 $this->http->sendResponse();
219 $this->http->close();
220 } else {
221 $this->tpl->setOnScreenMessage(
223 $this->lng->txt('mail_select_one'),
224 true
225 );
226 $this->redirectToFolder();
227 }
228 }
229
230 switch ($action) {
231 case MailFolderTableUI::ACTION_SHOW:
232 $this->showMail();
233 return;
234
235 case MailFolderTableUI::ACTION_EDIT:
236 $this->ctrl->setParameterByClass(
237 ilMailFormGUI::class,
238 self::PARAM_FOLDER_ID,
239 (string) $this->folder->getFolderId()
240 );
241 $this->ctrl->setParameterByClass(ilMailFormGUI::class, self::PARAM_MAIL_ID, (string) $mail_ids[0]);
242 $this->ctrl->setParameterByClass(ilMailFormGUI::class, 'type', ilMailFormGUI::MAIL_FORM_TYPE_DRAFT);
243 $this->ctrl->redirectByClass(ilMailFormGUI::class);
244
245 // no break
246 case MailFolderTableUI::ACTION_REPLY:
247 $this->ctrl->setParameterByClass(
248 ilMailFormGUI::class,
249 self::PARAM_FOLDER_ID,
250 (string) $this->folder->getFolderId()
251 );
252 $this->ctrl->setParameterByClass(ilMailFormGUI::class, self::PARAM_MAIL_ID, (string) $mail_ids[0]);
253 $this->ctrl->setParameterByClass(ilMailFormGUI::class, 'type', ilMailFormGUI::MAIL_FORM_TYPE_REPLY);
254 $this->ctrl->redirectByClass(ilMailFormGUI::class);
255
256 // no break
257 case MailFolderTableUI::ACTION_FORWARD:
258 $this->ctrl->setParameterByClass(
259 ilMailFormGUI::class,
260 self::PARAM_FOLDER_ID,
261 (string) $this->folder->getFolderId()
262 );
263 $this->ctrl->setParameterByClass(ilMailFormGUI::class, self::PARAM_MAIL_ID, (string) $mail_ids[0]);
264 $this->ctrl->setParameterByClass(ilMailFormGUI::class, 'type', ilMailFormGUI::MAIL_FORM_TYPE_FORWARD);
265 $this->ctrl->redirectByClass(ilMailFormGUI::class);
266
267 // no break
268 case MailFolderTableUI::ACTION_DOWNLOAD_ATTACHMENT:
269 $this->deliverAttachments();
270 return;
271
272 case MailFolderTableUI::ACTION_PRINT:
273 $this->printMail();
274 return;
275
276 case MailFolderTableUI::ACTION_PROFILE:
277 $mail_data = $this->umail->getMail($mail_ids[0] ?? 0);
278 if (!empty($user = ilMailUserCache::getUserObjectById($mail_data['sender_id'] ?? 0)) &&
280 $this->ctrl->setParameter($this, self::PARAM_FOLDER_ID, (string) $this->folder->getFolderId());
281 $this->ctrl->setParameter($this, self::PARAM_USER_ID, (string) $user->getId());
282 $this->ctrl->redirect($this, self::CMD_SHOW_USER);
283 } else {
284 $this->tpl->setOnScreenMessage(
286 $this->lng->txt('permission_denied'),
287 true
288 );
289 }
290 break;
291
292 case MailFolderTableUI::ACTION_MARK_READ:
293 $this->umail->markRead($mail_ids);
294 $this->tpl->setOnScreenMessage(
296 $this->lng->txt('saved_successfully'),
297 true
298 );
299 break;
300
301 case MailFolderTableUI::ACTION_MARK_UNREAD:
302 $this->umail->markUnread($mail_ids);
303 $this->tpl->setOnScreenMessage(
305 $this->lng->txt('saved_successfully'),
306 true
307 );
308 break;
309
310 case MailFolderTableUI::ACTION_MOVE_TO:
311 $folder_id = $this->http->wrapper()->query()->retrieve(
312 self::URL_BUILDER_PREFIX . URLBuilder::SEPARATOR . self::PARAM_TARGET_FOLDER,
313 $this->refinery->kindlyTo()->int()
314 );
315 if (empty($folder_id)) {
316 $this->tpl->setOnScreenMessage(
318 $this->lng->txt('mail_move_error')
319 );
320 } elseif ($this->umail->moveMailsToFolder($mail_ids, $folder_id)) {
321 $this->tpl->setOnScreenMessage(
323 $this->lng->txt('mail_moved'),
324 true
325 );
326 } else {
327 $this->tpl->setOnScreenMessage(
329 $this->lng->txt('mail_move_error')
330 );
331 }
332 break;
333
334 case MailFolderTableUI::ACTION_DELETE: // async call
335 $this->confirmDeleteMails($mail_ids);
336 break;
337
338 default:
339 $this->tpl->setOnScreenMessage(
341 $this->lng->txt('permission_denied')
342 );
343 break;
344 }
345
346 $this->redirectToFolder();
347 }
348
349 protected function emptyTrash(): void
350 {
351 $this->umail->deleteMailsOfFolder($this->mbox->getTrashFolder());
352 $this->tpl->setOnScreenMessage(
354 $this->lng->txt('mail_deleted'),
355 true
356 );
357 $this->redirectToFolder();
358 }
359
363 protected function showUser(): void
364 {
365 $usr_id = $this->http->wrapper()->query()->retrieve(
366 self::PARAM_USER_ID,
367 $this->refinery->byTrying([$this->refinery->kindlyTo()->int(), $this->refinery->always(0)])
368 );
369
370 $this->tpl->setVariable('TBL_TITLE', implode(' ', [
371 $this->lng->txt('profile_of'),
373 ]));
374 $this->tpl->setVariable('TBL_TITLE_IMG', ilUtil::getImagePath('standard/icon_usr.svg'));
375 $this->tpl->setVariable('TBL_TITLE_IMG_ALT', $this->lng->txt('public_profile'));
376
377 $profile_gui = new PublicProfileGUI($usr_id);
378
379 $mail_id = $this->http->wrapper()->query()->retrieve(
380 self::PARAM_MAIL_ID,
381 $this->refinery->byTrying([$this->refinery->kindlyTo()->int(), $this->refinery->always(0)])
382 );
383
384 if ($mail_id > 0) {
385 $this->ctrl->setParameter($this, self::PARAM_MAIL_ID, $mail_id);
386 $this->tabs->clearTargets();
387 $this->tabs->setBackTarget($this->lng->txt('back'), $this->ctrl->getLinkTarget($this, self::CMD_SHOW_MAIL));
388 } else {
389 $this->tabs->clearTargets();
390 $this->tabs->setBackTarget(
391 $this->lng->txt('back_to_folder'),
392 $this->ctrl->getLinkTarget($this, self::CMD_SHOW_FOLDER)
393 );
394 }
395
396 $this->ctrl->clearParameters($this);
397
398 $this->tpl->setTitle($this->lng->txt('mail'));
399 $this->tpl->setContent($this->ctrl->getHTML($profile_gui));
400 $this->tpl->printToStdout();
401 }
402
403 protected function showFolder(): void
404 {
405 $components = [];
406 $this->ctrl->setParameter($this, self::PARAM_FOLDER_ID, $this->folder->getFolderId());
407
408 if ($this->folder->isUserLocalFolder()) {
409 $this->toolbar->addComponent(
410 $this->ui_factory->button()->standard(
411 $this->lng->txt('mail_add_subfolder'),
412 $this->ctrl->getLinkTarget($this, self::CMD_ADD_SUB_FOLDER)
413 )
414 );
415 }
416
417 if ($this->folder->isUserFolder()) {
418 $this->toolbar->addComponent(
419 $this->ui_factory->button()->standard(
420 $this->lng->txt('rename'),
421 $this->ctrl->getLinkTarget($this, self::CMD_RENAME_SUB_FOLDER)
422 )
423 );
424
425 $components[] = $modal = $this->ui_factory->modal()->interruptive(
426 $this->lng->txt('delete'),
427 $this->lng->txt('mail_sure_delete_folder'),
428 $this->ctrl->getLinkTarget($this, self::CMD_DELETE_SUB_FOLDER)
429 );
430 $this->toolbar->addComponent(
431 $this->ui_factory->button()->standard(
432 $this->lng->txt('delete'),
433 '#'
434 )
435 ->withOnClick($modal->getShowSignal())
436 );
437 }
438
439 if ($this->folder->isTrash()) {
440 $components[] = $modal = $this->ui_factory->modal()->interruptive(
441 $this->lng->txt('mail_empty_trash'),
442 $this->lng->txt('mail_empty_trash_confirmation'),
443 $this->ctrl->getLinkTarget($this, self::CMD_EMPTY_TRASH)
444 );
445 $this->toolbar->addComponent(
446 $this->ui_factory->button()->standard(
447 $this->lng->txt('mail_empty_trash'),
448 '#'
449 )->withOnClick($modal->getShowSignal())
450 );
451 }
452
453 [
454 $url_builder,
455 $action_token,
456 $row_id_token,
457 $target_token,
458 ] = (new URLBuilder(
459 $this->data_factory->uri(
460 ilUtil::_getHttpPath() . '/' .
461 $this->ctrl->getLinkTarget($this, self::CMD_TABLE_ACTION)
462 )
463 )
464 )->acquireParameters(
465 [self::URL_BUILDER_PREFIX],
466 self::PARAM_ACTION,
467 self::PARAM_MAIL_ID,
468 self::PARAM_TARGET_FOLDER
469 );
470
471 $table = new MailFolderTableUI(
472 $url_builder,
473 $action_token,
474 $row_id_token,
475 $target_token,
476 $this->mbox->getSubFolders(),
477 $this->folder,
478 $this->getFilteredSearch(),
479 $this->umail,
480 $this->ui_factory,
481 $this->ui_renderer,
482 $this->lng,
483 $this->http->request(),
484 $this->data_factory,
485 $this->refinery,
486 $this->user->getDateFormat(),
487 $this->user->getTimeFormat(),
488 new DateTimeZone($this->user->getTimeZone())
489 );
490
491 $components[] = $this->getFilterUI()->getComponent();
492 $components[] = $table->getComponent();
493
494 $this->tpl->setTitle($this->folder->getTitle());
495 $this->tpl->setContent($this->ui_renderer->render($components));
496 $this->tpl->printToStdout();
497 }
498
499 protected function redirectToFolder(): never
500 {
501 $this->ctrl->clearParameters($this);
502 $this->ctrl->setParameter($this, self::PARAM_FOLDER_ID, $this->folder->getFolderId());
503 $this->ctrl->redirect($this, self::CMD_SHOW_FOLDER);
504 }
505
506 protected function deleteSubFolder(): void
507 {
508 $parent_folder_id = $this->mbox->getParentFolderId($this->folder->getFolderId());
509 if ($parent_folder_id > 0 && $this->mbox->deleteFolder($this->folder->getFolderId())) {
510 $this->tpl->setOnScreenMessage(
512 $this->lng->txt('mail_folder_deleted'),
513 true
514 );
515 $this->ctrl->setParameter($this, self::PARAM_FOLDER_ID, $parent_folder_id);
516 $this->ctrl->redirect($this, self::CMD_SHOW_FOLDER);
517 } else {
518 $this->tpl->setOnScreenMessage(
520 $this->lng->txt('mail_error_delete'),
521 true
522 );
523 $this->redirectToFolder();
524 }
525 }
526
527 protected function addSubFolder(): void
528 {
529 $form = $this->ui_factory->input()->container()->form()->standard(
530 $this->ctrl->getFormAction($this, self::CMD_ADD_SUB_FOLDER),
531 [
532 'folder' => $this->ui_factory->input()->field()->section([
533 'title' => $this->ui_factory->input()->field()->text($this->lng->txt('title'))->withRequired(true)
534 ], $this->lng->txt('mail_add_folder'))
535 ]
536 );
537
538 $request = $this->http->request();
539 if ($request->getMethod() === 'POST') {
540 $form = $form->withRequest($request);
541 $data = $form->getData();
542 if (!empty($data['folder']['title'])) {
543 $new_folder_id = $this->mbox->addFolder(
544 $this->folder->getFolderId(),
545 (string) $data['folder']['title']
546 );
547 if ($new_folder_id > 0) {
548 $this->tpl->setOnScreenMessage(
550 $this->lng->txt('mail_folder_created'),
551 true
552 );
553 $this->ctrl->setParameter($this, self::PARAM_FOLDER_ID, $new_folder_id);
554 $this->ctrl->redirect($this, self::CMD_SHOW_FOLDER);
555 } else {
556 $this->tpl->setOnScreenMessage(
558 $this->lng->txt('mail_folder_exists')
559 );
560 }
561 }
562 }
563 $this->tpl->setContent($this->ui_renderer->render($form));
564 $this->tpl->printToStdout();
565 }
566
567 protected function renameSubFolder(): void
568 {
569 $form = $this->ui_factory->input()->container()->form()->standard(
570 $this->ctrl->getFormAction($this, self::CMD_RENAME_SUB_FOLDER),
571 [
572 'folder' => $this->ui_factory->input()->field()->section([
573 'title' => $this->ui_factory->input()->field()->text($this->lng->txt('title'))->withRequired(true)
574 ], $this->lng->txt('mail_rename_folder'))
575 ]
576 );
577
578 $request = $this->http->request();
579 if ($request->getMethod() === 'POST') {
580 $form = $form->withRequest($request);
581 $data = $form->getData();
582 if (!empty($data['folder']['title'])) {
583 if ($this->mbox->renameFolder($this->folder->getFolderId(), (string) $data['folder']['title'])) {
584 $this->tpl->setOnScreenMessage(
586 $this->lng->txt('mail_folder_name_changed'),
587 true
588 );
589 $this->redirectToFolder();
590 } else {
591 $this->tpl->setOnScreenMessage(
593 $this->lng->txt('mail_folder_exists')
594 );
595 }
596 }
597 }
598 $this->tpl->setContent($this->ui_renderer->render($form));
599 $this->tpl->printToStdout();
600 }
601
602 protected function getFilterUI(): MailFilterUI
603 {
604 return new MailFilterUI(
605 $this->ctrl->getFormAction($this, self::CMD_SHOW_FOLDER),
606 ilSearchSettings::getInstance()->enabledLucene(),
607 $this->folder,
608 $this->ui_factory,
609 $this->ui_service->filter(),
610 $this->lng,
611 new DateTimeZone($this->user->getTimeZone()),
612 );
613 }
614
620 {
621 return new MailFolderSearch(
622 $this->folder,
623 $this->getFilterUI()->getData(),
624 ilSearchSettings::getInstance()->enabledLucene(),
625 );
626 }
627
631 protected function getMailIdsFromRequest(): array
632 {
633 // table actions have a prefix, controller commands and modal items have none
634 foreach (
635 [
636 self::URL_BUILDER_PREFIX . URLBuilder::SEPARATOR . self::PARAM_MAIL_ID,
637 self::PARAM_MAIL_ID,
638 self::PARAM_INTERRUPTIVE_ITEMS
639 ] as $param
640 ) {
641 foreach (
642 [
643 $this->http->wrapper()->post(),
644 $this->http->wrapper()->query()
645 ] as $wrapper
646 ) {
647 if ($wrapper->has($param)) {
648 return $wrapper->retrieve(
649 $param,
650 $this->refinery->byTrying([
651 $this->refinery->kindlyTo()->listOf($this->refinery->kindlyTo()->int()),
652 $this->refinery->always([])
653 ])
654 );
655 }
656 }
657 }
658
659 return [];
660 }
661
666 protected function moveSingleMail(): void
667 {
668 $mail_ids = $this->getMailIdsFromRequest();
669 if (count($mail_ids) !== 1) {
670 $this->showMail();
671 $this->tpl->setOnScreenMessage('info', $this->lng->txt('mail_select_one'));
672 return;
673 }
674
675 $new_folder_id = $this->http->wrapper()->query()->retrieve(
676 'folder_id',
677 $this->refinery->byTrying([$this->refinery->kindlyTo()->int(), $this->refinery->always(0)])
678 );
679 $redirect_folder_id = $new_folder_id;
680
681 foreach ($mail_ids as $mail_id) {
682 $mail_data = $this->umail->getMail($mail_id);
683 if (isset($mail_data['folder_id']) &&
684 is_numeric($mail_data['folder_id']) &&
685 (int) $mail_data['folder_id'] > 0) {
686 $redirect_folder_id = (int) $mail_data['folder_id'];
687 break;
688 }
689 }
690
691 if ($this->umail->moveMailsToFolder($mail_ids, $new_folder_id)) {
692 $this->tpl->setOnScreenMessage('success', $this->lng->txt('mail_moved'), true);
693 $this->ctrl->setParameter($this, self::PARAM_FOLDER_ID, $redirect_folder_id);
694 $this->ctrl->redirect($this, self::CMD_SHOW_FOLDER);
695 } else {
696 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('mail_move_error'));
697 $this->showMail();
698 }
699 }
700
701 protected function deleteMails(): void
702 {
703 if (!$this->folder->isTrash()) {
704 $this->tpl->setOnScreenMessage(
706 $this->lng->txt('mail_operation_on_invalid_folder'),
707 true
708 );
709 $this->redirectToFolder();
710 }
711
712 $this->umail->deleteMails($this->getMailIdsFromRequest());
713 $this->tpl->setOnScreenMessage(
715 $this->lng->txt('mail_deleted'),
716 true
717 );
718 $this->redirectToFolder();
719 }
720
725 protected function confirmDeleteMails(array $mail_ids): void
726 {
727 $user_timezone = new DateTimeZone($this->user->getTimeZone());
728 $records = $this->getFilteredSearch()->forMailIds($mail_ids)->getPagedRecords(10, 0, null, null);
729 $items = [];
730 foreach ($records as $record) {
731 $prefix = '';
732 if (!empty($record->getSendTime())) {
733 $time = $record->getSendTime()->setTimezone($user_timezone);
734 $prefix = $time->format($this->user->getDateFormat()->toString()) . ' ';
735 }
736 $items[] = $this->ui_factory->modal()->interruptiveItem()->standard(
737 (string) $record->getMailId(),
738 $prefix . $this->refinery->encode()->htmlSpecialCharsAsEntities()->transform($record->getSubject())
739 );
740 }
741
742 $modal = $this->ui_factory->modal()->interruptive(
743 $this->lng->txt('delete'),
744 $this->lng->txt('mail_sure_delete_' . (count($items) === 1 ? 's' : 'p')),
745 $this->ctrl->getFormAction($this, self::CMD_DELETE_MAILS)
746 )->withAffectedItems($items);
747
748 $this->http->saveResponse(
749 $this->http->response()->withBody(
750 Streams::ofString($this->ui_renderer->renderAsync($modal))
751 )
752 );
753 $this->http->sendResponse();
754 $this->http->close();
755 }
756
757 protected function showMail(): void
758 {
759 $ui_components = [];
760
761 $mail_id = $this->getMailIdsFromRequest()[0] ?? 0;
762 if ($mail_id <= 0) {
763 $this->error->raiseError($this->lng->txt('permission_denied'), $this->error->MESSAGE);
764 }
765
766 $mail_data = $this->umail->getMail($mail_id);
767 if ($mail_data === null) {
768 $this->error->raiseError($this->lng->txt('permission_denied'), $this->error->MESSAGE);
769 }
770
771 $this->umail->markRead([$mail_id]);
772
773 $this->tpl->setTitle($this->lng->txt('mail_mails_of'));
774
775 $this->tabs->clearTargets();
776 $this->ctrl->setParameter($this, self::PARAM_FOLDER_ID, $mail_data['folder_id']);
777 $this->tabs->setBackTarget(
778 $this->lng->txt('back_to_folder'),
779 $this->ctrl->getFormAction($this, self::CMD_SHOW_FOLDER)
780 );
781 $this->ctrl->clearParameters($this);
782
783 $this->ctrl->setParameter($this, self::PARAM_MAIL_ID, $mail_id);
784 $this->ctrl->setParameter($this, self::PARAM_FOLDER_ID, $mail_data['folder_id']);
785 $this->toolbar->setFormAction($this->ctrl->getFormAction($this, self::CMD_SHOW_MAIL));
786 $this->ctrl->clearParameters($this);
787
788 $form = new ilPropertyFormGUI();
789 $form->setId('MailContent');
790 $form->setPreventDoubleSubmission(false);
791 $form->setTableWidth('100%');
792 $this->ctrl->setParameter($this, self::PARAM_FOLDER_ID, $mail_data['folder_id']);
793 $this->ctrl->setParameter($this, self::PARAM_MAIL_ID, $mail_id);
794 $form->setFormAction($this->ctrl->getFormAction($this, self::CMD_SHOW_MAIL));
795 $this->ctrl->clearParameters($this);
796 $form->setTitle($this->lng->txt('mail_mails_of'));
797
799 $sender = ilObjectFactory::getInstanceByObjId($mail_data['sender_id'], false);
800 $reply_btn = null;
801 if ($sender instanceof ilObjUser && $sender->getId() !== 0 && !$sender->isAnonymous()) {
802 $this->ctrl->setParameterByClass(
803 ilMailFormGUI::class,
804 self::PARAM_FOLDER_ID,
805 $mail_data['folder_id']
806 );
807 $this->ctrl->setParameterByClass(ilMailFormGUI::class, self::PARAM_MAIL_ID, $mail_id);
808 $this->ctrl->setParameterByClass(ilMailFormGUI::class, 'type', ilMailFormGUI::MAIL_FORM_TYPE_REPLY);
809 $reply_btn = $this->ui_factory->button()->primary(
810 $this->lng->txt('reply'),
811 $this->ctrl->getLinkTargetByClass(ilMailFormGUI::class)
812 );
813 $this->toolbar->addStickyItem($reply_btn);
814 $this->ctrl->clearParametersByClass(ilMailFormGUI::class);
815 }
816
817 $this->ctrl->setParameterByClass(ilMailFormGUI::class, self::PARAM_FOLDER_ID, $mail_data['folder_id']);
818 $this->ctrl->setParameterByClass(ilMailFormGUI::class, self::PARAM_MAIL_ID, $mail_id);
819 $this->ctrl->setParameterByClass(ilMailFormGUI::class, 'type', ilMailFormGUI::MAIL_FORM_TYPE_FORWARD);
820 if ($reply_btn === null) {
821 $fwd_btn = $this->ui_factory->button()->primary(
822 $this->lng->txt('forward'),
823 $this->ctrl->getLinkTargetByClass(ilMailFormGUI::class)
824 );
825 $this->toolbar->addStickyItem($fwd_btn);
826 } else {
827 $fwd_btn = $this->ui_factory->button()->standard(
828 $this->lng->txt('forward'),
829 $this->ctrl->getLinkTargetByClass(ilMailFormGUI::class)
830 );
831 $this->toolbar->addComponent($fwd_btn);
832 }
833 $this->ctrl->clearParametersByClass(ilMailFormGUI::class);
834
835 if ($sender && $sender->getId() && !$sender->isAnonymous()) {
836 $linked_fullname = $sender->getPublicName();
837 $avatar = $this->ui_factory->symbol()->avatar()->picture(
838 $sender->getPersonalPicturePath('xsmall'),
839 $sender->getPublicName()
840 );
841
842 if (in_array(ilObjUser::_lookupPref($sender->getId(), 'public_profile'), ['y', 'g'])) {
843 $this->ctrl->setParameter($this, self::PARAM_MAIL_ID, $mail_id);
844 $this->ctrl->setParameter($this, self::PARAM_FOLDER_ID, $mail_data['folder_id']);
845 $this->ctrl->setParameter($this, self::PARAM_USER_ID, $sender->getId());
846 $linked_fullname = '<br /><a class="mailusername" href="' . $this->ctrl->getLinkTarget(
847 $this,
848 self::CMD_SHOW_USER
849 ) . '" title="' . $linked_fullname . '">' . $linked_fullname . '</a>';
850 $this->ctrl->clearParameters($this);
851 }
852
853 $from = new ilCustomInputGUI($this->lng->txt('from') . ':');
854 $from->setHtml($this->ui_renderer->render($avatar) . ' ' . $linked_fullname);
855 } elseif (!$sender || !$sender->getId()) {
856 $from = new ilCustomInputGUI($this->lng->txt('from') . ':');
857 $from->setHtml(trim(($mail_data['import_name'] ?? '') . ' (' . $this->lng->txt('user_deleted') . ')'));
858 } else {
859 $from = new ilCustomInputGUI($this->lng->txt('from') . ':');
860 $from->setHtml(
861 $this->ui_renderer->render(
862 $this->ui_factory
863 ->symbol()
864 ->avatar()
865 ->picture(ilUtil::getImagePath('logo/ilias_logo_centered.png'), ilMail::_getIliasMailerName())
866 ) . '<br />' . ilMail::_getIliasMailerName()
867 );
868 }
869 $form->addItem($from);
870
871 $to = new ilCustomInputGUI($this->lng->txt('mail_to') . ':');
872 $to->setHtml(
874 $this->umail->formatNamesForOutput($mail_data['rcp_to'] ?? ''),
875 false
876 )
877 );
878 $form->addItem($to);
879
880 if ($mail_data['rcp_cc']) {
881 $cc = new ilCustomInputGUI($this->lng->txt('mail_cc') . ':');
882 $cc->setHtml(
884 $this->umail->formatNamesForOutput($mail_data['rcp_cc']),
885 false
886 )
887 );
888 $form->addItem($cc);
889 }
890
891 if ($mail_data['rcp_bcc']) {
892 $bcc = new ilCustomInputGUI($this->lng->txt('mail_bcc') . ':');
893 $bcc->setHtml(
895 $this->umail->formatNamesForOutput($mail_data['rcp_bcc']),
896 false
897 )
898 );
899 $form->addItem($bcc);
900 }
901
902 $subject = new ilCustomInputGUI($this->lng->txt('subject') . ':');
903 $subject->setHtml(ilUtil::htmlencodePlainString($mail_data['m_subject'] ?? '', true));
904 $form->addItem($subject);
905
906 $date = new ilCustomInputGUI($this->lng->txt('mail_sent_datetime') . ':');
907 $date->setHtml(
909 new ilDateTime($mail_data['send_time'], IL_CAL_DATETIME)
910 )
911 );
912 $form->addItem($date);
913
914 $message = new ilCustomInputGUI($this->lng->txt('message') . ':');
915 $message->setHtml(ilUtil::htmlencodePlainString($mail_data['m_message'] ?? '', true));
916 $form->addItem($message);
917
918 if ($mail_data['attachments']) {
919 $att = new ilCustomInputGUI($this->lng->txt('attachments') . ':');
920
921 $radiog = new ilRadioGroupInputGUI('', 'filename');
922 foreach ($mail_data['attachments'] as $file) {
923 $radiog->addOption(new ilRadioOption($file, md5((string) $file)));
924 }
925
926 $att->setHtml($radiog->render());
927 $form->addCommandButton(self::CMD_DELIVER_FILE, $this->lng->txt('download'));
928 $form->addItem($att);
929 }
930
931 $current_folder = $this->mbox->getFolderData((int) $mail_data['folder_id']);
932 if ($current_folder === null) {
933 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('mail_operation_on_invalid_folder'), true);
934 $this->ctrl->setParameterByClass(ilMailGUI::class, self::PARAM_FOLDER_ID, $this->mbox->getInboxFolder());
935 $this->ctrl->redirectByClass(ilMailGUI::class);
936 }
937
938 $this->ctrl->setParameter($this, self::PARAM_FOLDER_ID, $this->folder->getFolderId());
939 $this->tabs->addTab(
940 'current_folder',
941 $current_folder->getTitle(),
942 $this->ctrl->getLinkTarget($this, self::CMD_SHOW_FOLDER)
943 );
944 $this->ctrl->clearParameters($this);
945 $this->tabs->activateTab('current_folder');
946
947 $move_links = [];
948 $folders = $this->mbox->getSubFolders();
949 foreach ($folders as $folder) {
950 if ((!$folder->isTrash() || !$current_folder->isTrash()) &&
951 $folder->getFolderId() !== $mail_data['folder_id']) {
952 $move_links[] = $this->ui_factory->button()->shy(
953 sprintf(
954 $this->lng->txt('mail_move_to_folder_x'),
955 $folder->getTitle()
956 ) . ($folder->isTrash() ? ' (' . $this->lng->txt('delete') . ')' : ''),
957 '#',
958 )->withOnLoadCode(static fn($id): string => "
959 document.getElementById('$id').addEventListener('click', function(e) {
960 const frm = this.closest('form'),
961 action = new URL(frm.action),
962 action_params = new URLSearchParams(action.search);
963
964 action_params.delete('cmd');
965 action_params.append('cmd', '" . self::CMD_MOVE_SINGLE_MAIL . "');
966 action_params.delete('folder_id');
967 action_params.append('folder_id', '" . $folder->getFolderId() . "');
968
969 action.search = action_params.toString();
970
971 frm.action = action.href;
972 frm.submit();
973
974 e.preventDefault();
975 e.stopPropagation();
976
977 return false;
978 });");
979 }
980 }
981
982 if ($this->folder->isTrash()) {
983 $this->ctrl->setParameter($this, self::PARAM_MAIL_ID, $mail_id);
984 $this->ctrl->setParameter($this, self::PARAM_FOLDER_ID, $mail_data['folder_id']);
985 $modal = $this->ui_factory->modal()->interruptive(
986 $this->lng->txt('delete'),
987 $this->lng->txt('mail_sure_delete_s'),
988 $this->ctrl->getLinkTarget($this, self::CMD_DELETE_MAILS)
989 )->withAffectedItems([
990 $this->ui_factory->modal()->interruptiveItem()->standard(
991 (string) $mail_id,
993 new ilDateTime($mail_data['send_time'], IL_CAL_DATETIME)
994 ) . ' ' . $mail_data['m_subject']
995 )
996 ]);
997 $this->toolbar->addComponent(
998 $this->ui_factory->button()->standard(
999 $this->lng->txt('delete'),
1000 '#'
1001 )->withOnClick($modal->getShowSignal())
1002 );
1003 $this->ctrl->clearParameters($this);
1004
1005 $ui_components[] = $modal;
1006 }
1007
1008 if ($move_links !== []) {
1009 $this->toolbar->addComponent(
1010 $this->ui_factory->dropdown()->standard($move_links)
1011 ->withLabel($this->lng->txt('mail_move_to_folder_btn_label'))
1012 );
1013 }
1014
1015 $this->toolbar->addSeparator();
1016
1017 $this->ctrl->setParameter($this, self::PARAM_MAIL_ID, $mail_id);
1018 $this->ctrl->setParameter($this, self::PARAM_FOLDER_ID, $mail_data['folder_id']);
1019 $print_url = $this->ctrl->getLinkTarget($this, self::CMD_PRINT_MAIL);
1020 $this->ctrl->clearParameters($this);
1021 $print_btn = $this->ui_factory->button()
1022 ->standard($this->lng->txt('print'), '#')
1023 ->withOnLoadCode(static fn($id): string => "
1024 document.getElementById('$id').addEventListener('click', function() {
1025 const frm = this.closest('form'),
1026 action = frm.action;
1027
1028 frm.action = '$print_url';
1029 frm.target = '_blank';
1030 frm.submit();
1031
1032 frm.action = action;
1033 frm.removeAttribute('target');
1034
1035 return false;
1036 });
1037 ");
1038 $this->toolbar->addComponent($print_btn);
1039
1040 $prev_mail = $this->umail->getPreviousMail($mail_id);
1041 $next_mail = $this->umail->getNextMail($mail_id);
1042 if (is_array($prev_mail) || is_array($next_mail)) {
1043 $this->toolbar->addSeparator();
1044
1045 if ($prev_mail && $prev_mail[self::PARAM_MAIL_ID]) {
1046 $this->ctrl->setParameter($this, self::PARAM_MAIL_ID, $prev_mail[self::PARAM_MAIL_ID]);
1047 $this->ctrl->setParameter($this, self::PARAM_FOLDER_ID, $this->folder->getFolderId());
1048 $pref_btn = $this->ui_factory->button()
1049 ->standard(
1050 $this->lng->txt('previous'),
1051 $this->ctrl->getLinkTarget($this, self::CMD_SHOW_MAIL)
1052 );
1053 $this->toolbar->addComponent($pref_btn);
1054 $this->ctrl->clearParameters($this);
1055 }
1056
1057 if ($next_mail && $next_mail[self::PARAM_MAIL_ID]) {
1058 $this->ctrl->setParameter($this, self::PARAM_MAIL_ID, $next_mail[self::PARAM_MAIL_ID]);
1059 $this->ctrl->setParameter($this, self::PARAM_FOLDER_ID, $this->folder->getFolderId());
1060 $next_btn = $this->ui_factory->button()
1061 ->standard(
1062 $this->lng->txt('next'),
1063 $this->ctrl->getLinkTarget($this, self::CMD_SHOW_MAIL)
1064 );
1065 $this->toolbar->addComponent($next_btn);
1066 $this->ctrl->clearParameters($this);
1067 }
1068 }
1069
1070 $this->tpl->setContent($form->getHTML() . $this->ui_renderer->render($ui_components));
1071 $this->tpl->printToStdout();
1072 }
1073
1074 protected function printMail(): void
1075 {
1076 $tplprint = new ilTemplate('tpl.mail_print.html', true, true, 'components/ILIAS/Mail');
1077
1078 $mail_id = $this->getMailIdsFromRequest()[0] ?? 0;
1079 $mail_data = $this->umail->getMail($mail_id);
1080
1081 $sender = ilObjectFactory::getInstanceByObjId($mail_data['sender_id'], false);
1082
1083 $tplprint->setVariable('TXT_FROM', $this->lng->txt('from'));
1084 if ($sender instanceof ilObjUser && $sender->getId() !== 0 && !$sender->isAnonymous()) {
1085 $tplprint->setVariable('FROM', $sender->getPublicName());
1086 } elseif (!$sender instanceof ilObjUser || $sender->getId() === 0) {
1087 $tplprint->setVariable(
1088 'FROM',
1089 trim(($mail_data['import_name'] ?? '') . ' (' . $this->lng->txt('user_deleted') . ')')
1090 );
1091 } else {
1092 $tplprint->setVariable('FROM', ilMail::_getIliasMailerName());
1093 }
1094
1095 $tplprint->setVariable('TXT_TO', $this->lng->txt('mail_to'));
1096 $tplprint->setVariable('TO', $mail_data['rcp_to']);
1097
1098 if ($mail_data['rcp_cc']) {
1099 $tplprint->setCurrentBlock('cc');
1100 $tplprint->setVariable('TXT_CC', $this->lng->txt('mail_cc'));
1101 $tplprint->setVariable('CC', $mail_data['rcp_cc']);
1102 $tplprint->parseCurrentBlock();
1103 }
1104
1105 if ($mail_data['rcp_bcc']) {
1106 $tplprint->setCurrentBlock('bcc');
1107 $tplprint->setVariable('TXT_BCC', $this->lng->txt('mail_bcc'));
1108 $tplprint->setVariable('BCC', $mail_data['rcp_bcc']);
1109 $tplprint->parseCurrentBlock();
1110 }
1111
1112 $tplprint->setVariable('TXT_SUBJECT', $this->lng->txt('subject'));
1113 $tplprint->setVariable('SUBJECT', htmlspecialchars((string) $mail_data['m_subject']));
1114
1115 $tplprint->setVariable('TXT_DATE', $this->lng->txt('date'));
1116 $tplprint->setVariable(
1117 'DATE',
1118 ilDatePresentation::formatDate(new ilDateTime($mail_data['send_time'], IL_CAL_DATETIME))
1119 );
1120
1121 $tplprint->setVariable('TXT_MESSAGE', $this->lng->txt('message'));
1122 $tplprint->setVariable('MAIL_MESSAGE', nl2br(htmlspecialchars((string) $mail_data['m_message'])));
1123
1124 $tplprint->show();
1125 }
1126
1127 protected function deliverFile(): void
1128 {
1129 $mail_id = $this->http->wrapper()->query()->retrieve(
1130 self::PARAM_MAIL_ID,
1131 $this->refinery->byTrying([$this->refinery->kindlyTo()->int(), $this->refinery->always(0)])
1132 );
1133 if ($mail_id <= 0) {
1134 $this->error->raiseError($this->lng->txt('permission_denied'), $this->error->MESSAGE);
1135 }
1136
1137 $filename = $this->http->wrapper()->post()->retrieve(
1138 'filename',
1139 $this->refinery->byTrying([$this->refinery->kindlyTo()->string(), $this->refinery->always('')])
1140 );
1141
1142 if (is_string(ilSession::get('filename')) && ilSession::get('filename') !== '') {
1143 $filename = ilSession::get('filename');
1144 ilSession::set('filename', null);
1145 }
1146
1147 try {
1148 if ($mail_id > 0 && $filename !== '') {
1149 while (str_contains((string) $filename, '..')) {
1150 $filename = str_replace('..', '', $filename);
1151 }
1152
1153 $mail_file_data = new ilFileDataMail($this->user->getId());
1154 try {
1155 $file = $mail_file_data->getAttachmentPathAndFilenameByMd5Hash($filename, (int) $mail_id);
1156 ilFileDelivery::deliverFileLegacy($file['path'], $file['filename']);
1157 } catch (OutOfBoundsException $e) {
1158 throw new ilMailException('mail_error_reading_attachment', $e->getCode(), $e);
1159 }
1160 } else {
1161 $this->tpl->setOnScreenMessage('info', $this->lng->txt('mail_select_attachment'));
1162 $this->showMail();
1163 }
1164 } catch (Exception $e) {
1165 $this->tpl->setOnScreenMessage('failure', $this->lng->txt($e->getMessage()), true);
1166 $this->redirectToFolder();
1167 }
1168 }
1169
1170 protected function deliverAttachments(): void
1171 {
1172 try {
1173 $mail_id = $this->getMailIdsFromRequest()[0] ?? 0;
1174 $mail_data = $this->umail->getMail($mail_id);
1175 if ($mail_data === null || [] === (array) $mail_data['attachments']) {
1176 throw new ilMailException('mail_error_reading_attachment');
1177 }
1178
1179 $type = $this->http->wrapper()->query()->retrieve(
1180 'type',
1181 $this->refinery->byTrying([$this->refinery->kindlyTo()->string(), $this->refinery->always('')])
1182 );
1183
1184 $mail_file_data = new ilFileDataMail($this->user->getId());
1185 if (count($mail_data['attachments']) === 1) {
1186 $attachment = current($mail_data['attachments']);
1187
1188 try {
1189 if ($type === 'draft') {
1190 if (!$mail_file_data->checkFilesExist([$attachment])) {
1191 throw new OutOfBoundsException('');
1192 }
1193 $path_to_file = $mail_file_data->getAbsoluteAttachmentPoolPathByFilename($attachment);
1194 $filename = $attachment;
1195 } else {
1196 $file = $mail_file_data->getAttachmentPathAndFilenameByMd5Hash(
1197 md5((string) $attachment),
1198 $mail_id
1199 );
1200 $path_to_file = $file['path'];
1201 $filename = $file['filename'];
1202 }
1204 } catch (OutOfBoundsException $e) {
1205 throw new ilMailException('mail_error_reading_attachment', $e->getCode(), $e);
1206 }
1207 } else {
1208 $mail_file_data->deliverAttachmentsAsZip(
1209 $mail_data['m_subject'],
1210 $mail_id,
1211 $mail_data['attachments'],
1212 $type === 'draft'
1213 );
1214 }
1215 } catch (Exception $e) {
1216 $this->tpl->setOnScreenMessage('failure', $this->lng->txt($e->getMessage()), true);
1217 $this->redirectToFolder();
1218 }
1219 }
1220}
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
$filename
Definition: buildRTE.php:78
$components
Builds a Color from either hex- or rgb values.
Definition: Factory.php:31
Builds data types.
Definition: Factory.php:36
Stream factory which enables the user to create streams without the knowledge of the concrete class.
Definition: Streams.php:32
GUI class for public user profile presentation.
const IL_CAL_DATETIME
error(string $a_errmsg)
This class represents a custom property in a property form.
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)
@classDescription Date and time handling
Error Handling & global info handling.
static deliverFileLegacy(string $a_file, ?string $a_filename=null, ?string $a_mime=null, ?bool $isInline=false, ?bool $removeAfterDelivery=false, ?bool $a_exit_after=true)
language handling
@ilCtrl_Calls ilMailFolderGUI:
readonly Renderer $ui_renderer
const string CMD_PRINT_MAIL
const string URL_BUILDER_PREFIX
const string CMD_ADD_SUB_FOLDER
const string CMD_DELETE_SUB_FOLDER
const string CMD_SHOW_USER
getSafePostCommands()
This method must return a list of safe POST commands.
readonly ilGlobalTemplateInterface $tpl
readonly Refinery $refinery
const string PARAM_TARGET_FOLDER
getFilteredSearch()
Searcher for mails in the folder, initialized with the current filter values needed for table display...
readonly Factory $ui_factory
const string CMD_DELETE_MAILS
readonly ilUIService $ui_service
readonly DataFactory $data_factory
const string PARAM_USER_ID
readonly GlobalHttpState $http
const string CMD_MOVE_SINGLE_MAIL
readonly ilCtrlInterface $ctrl
const string PARAM_MAIL_ID
readonly ilToolbarGUI $toolbar
readonly ilObjUser $user
readonly ilLanguage $lng
const string PARAM_INTERRUPTIVE_ITEMS
const string CMD_EMPTY_TRASH
const string CMD_SHOW_FOLDER
const string CMD_SHOW_MAIL
MailFolderData $folder
const string PARAM_FOLDER_ID
confirmDeleteMails(array $mail_ids)
Confirm the deletion of selected mails in async modal.
const string CMD_DELIVER_FILE
getUnsafeGetCommands()
This method must return a list of unsafe GET commands.
const string CMD_TABLE_ACTION
readonly ilTabsGUI $tabs
moveSingleMail()
Move a single mail to a folder Called from showMail page.
readonly ilErrorHandling $error
const string CMD_RENAME_SUB_FOLDER
initRequest()
Init class variables that can be determined in an actual request.
final const string MAIL_FORM_TYPE_DRAFT
final const string MAIL_FORM_TYPE_FORWARD
final const string MAIL_FORM_TYPE_REPLY
static getUserObjectById(int $usr_id)
static _getIliasMailerName()
User class.
static _lookupPref(int $a_usr_id, string $a_keyword)
static _lookupLogin(int $a_user_id)
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id
This class represents a property form user interface.
This class represents a property in a property form.
This class represents an option in a radio group.
static get(string $a_var)
static set(string $a_var, $a_val)
Set a value.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
special template class to simplify handling of ITX/PEAR
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Filter service.
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
static _getHttpPath()
static htmlencodePlainString(string $a_str, bool $a_make_links_clickable, bool $a_detect_goto_links=false)
Encodes a plain text string into HTML for display in a browser.
Interface GlobalHttpState.
This is how the factory for UI elements looks.
Definition: Factory.php:38
An entity that renders components to a string output.
Definition: Renderer.php:31
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static http()
Fetches the global http state from ILIAS.
global $DIC
Definition: shib_login.php:26
$message
Definition: xapiexit.php:31
$param
Definition: xapitoken.php:46