ILIAS  trunk Revision v12.0_alpha-1227-g7ff6d300864
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(ilMailFormGUI::class, self::PARAM_MAIL_ID, (string) $mail_ids[0]);
237 if ($this->folder->isOutbox()) {
238 $this->umail->moveMailsToFolder($mail_ids, $this->mbox->getDraftsFolder());
239 }
240 $this->ctrl->setParameterByClass(
241 ilMailFormGUI::class,
242 self::PARAM_FOLDER_ID,
243 (string) $this->mbox->getDraftsFolder()
244 );
245 $this->ctrl->setParameterByClass(ilMailFormGUI::class, 'type', ilMailFormGUI::MAIL_FORM_TYPE_DRAFT);
246 $this->ctrl->redirectByClass(ilMailFormGUI::class);
247
248 // no break
249 case MailFolderTableUI::ACTION_REPLY:
250 $this->ctrl->setParameterByClass(
251 ilMailFormGUI::class,
252 self::PARAM_FOLDER_ID,
253 (string) $this->folder->getFolderId()
254 );
255 $this->ctrl->setParameterByClass(ilMailFormGUI::class, self::PARAM_MAIL_ID, (string) $mail_ids[0]);
256 $this->ctrl->setParameterByClass(ilMailFormGUI::class, 'type', ilMailFormGUI::MAIL_FORM_TYPE_REPLY);
257 $this->ctrl->redirectByClass(ilMailFormGUI::class);
258
259 // no break
260 case MailFolderTableUI::ACTION_FORWARD:
261 $this->ctrl->setParameterByClass(
262 ilMailFormGUI::class,
263 self::PARAM_FOLDER_ID,
264 (string) $this->folder->getFolderId()
265 );
266 $this->ctrl->setParameterByClass(ilMailFormGUI::class, self::PARAM_MAIL_ID, (string) $mail_ids[0]);
267 $this->ctrl->setParameterByClass(ilMailFormGUI::class, 'type', ilMailFormGUI::MAIL_FORM_TYPE_FORWARD);
268 $this->ctrl->redirectByClass(ilMailFormGUI::class);
269
270 // no break
271 case MailFolderTableUI::ACTION_DOWNLOAD_ATTACHMENT:
272 $this->deliverAttachments();
273 return;
274
275 case MailFolderTableUI::ACTION_PRINT:
276 $this->printMail();
277 return;
278
279 case MailFolderTableUI::ACTION_PROFILE:
280 $mail_data = $this->umail->getMail($mail_ids[0] ?? 0);
281 if (!empty($user = ilMailUserCache::getUserObjectById($mail_data['sender_id'] ?? 0)) &&
283 $this->ctrl->setParameter($this, self::PARAM_FOLDER_ID, (string) $this->folder->getFolderId());
284 $this->ctrl->setParameter($this, self::PARAM_USER_ID, (string) $user->getId());
285 $this->ctrl->redirect($this, self::CMD_SHOW_USER);
286 } else {
287 $this->tpl->setOnScreenMessage(
289 $this->lng->txt('permission_denied'),
290 true
291 );
292 }
293 break;
294
295 case MailFolderTableUI::ACTION_MARK_READ:
296 $this->umail->markRead($mail_ids);
297 $this->tpl->setOnScreenMessage(
299 $this->lng->txt('saved_successfully'),
300 true
301 );
302 break;
303
304 case MailFolderTableUI::ACTION_MARK_UNREAD:
305 $this->umail->markUnread($mail_ids);
306 $this->tpl->setOnScreenMessage(
308 $this->lng->txt('saved_successfully'),
309 true
310 );
311 break;
312
313 case MailFolderTableUI::ACTION_MOVE_TO:
314 $folder_id = $this->http->wrapper()->query()->retrieve(
315 self::URL_BUILDER_PREFIX . URLBuilder::SEPARATOR . self::PARAM_TARGET_FOLDER,
316 $this->refinery->kindlyTo()->int()
317 );
318 if (empty($folder_id) || $folder_id === $this->mbox->getOutboxFolder()) {
319 $this->tpl->setOnScreenMessage(
321 $this->lng->txt('mail_move_error')
322 );
323 } elseif ($this->umail->moveMailsToFolder($mail_ids, $folder_id)) {
324 $this->tpl->setOnScreenMessage(
326 $this->lng->txt('mail_moved'),
327 true
328 );
329 } else {
330 $this->tpl->setOnScreenMessage(
332 $this->lng->txt('mail_move_error')
333 );
334 }
335 break;
336
337 case MailFolderTableUI::ACTION_DELETE: // async call
338 $this->confirmDeleteMails($mail_ids);
339 break;
340
341 default:
342 $this->tpl->setOnScreenMessage(
344 $this->lng->txt('permission_denied')
345 );
346 break;
347 }
348
349 $this->redirectToFolder();
350 }
351
352 protected function emptyTrash(): void
353 {
354 $this->umail->deleteMailsOfFolder($this->mbox->getTrashFolder());
355 $this->tpl->setOnScreenMessage(
357 $this->lng->txt('mail_deleted'),
358 true
359 );
360 $this->redirectToFolder();
361 }
362
366 protected function showUser(): void
367 {
368 $usr_id = $this->http->wrapper()->query()->retrieve(
369 self::PARAM_USER_ID,
370 $this->refinery->byTrying([$this->refinery->kindlyTo()->int(), $this->refinery->always(0)])
371 );
372
373 $this->tpl->setVariable('TBL_TITLE', implode(' ', [
374 $this->lng->txt('profile_of'),
376 ]));
377 $this->tpl->setVariable('TBL_TITLE_IMG', ilUtil::getImagePath('standard/icon_usr.svg'));
378 $this->tpl->setVariable('TBL_TITLE_IMG_ALT', $this->lng->txt('public_profile'));
379
380 $profile_gui = new PublicProfileGUI($usr_id);
381
382 $mail_id = $this->http->wrapper()->query()->retrieve(
383 self::PARAM_MAIL_ID,
384 $this->refinery->byTrying([$this->refinery->kindlyTo()->int(), $this->refinery->always(0)])
385 );
386
387 if ($mail_id > 0) {
388 $this->ctrl->setParameter($this, self::PARAM_MAIL_ID, $mail_id);
389 $this->tabs->clearTargets();
390 $this->tabs->setBackTarget($this->lng->txt('back'), $this->ctrl->getLinkTarget($this, self::CMD_SHOW_MAIL));
391 } else {
392 $this->tabs->clearTargets();
393 $this->tabs->setBackTarget(
394 $this->lng->txt('back_to_folder'),
395 $this->ctrl->getLinkTarget($this, self::CMD_SHOW_FOLDER)
396 );
397 }
398
399 $this->ctrl->clearParameters($this);
400
401 $this->tpl->setTitle($this->lng->txt('mail'));
402 $this->tpl->setContent($this->ctrl->getHTML($profile_gui));
403 $this->tpl->printToStdout();
404 }
405
406 protected function showFolder(): void
407 {
408 $components = [];
409 $this->ctrl->setParameter($this, self::PARAM_FOLDER_ID, $this->folder->getFolderId());
410
411 if ($this->folder->isUserLocalFolder()) {
412 $this->toolbar->addComponent(
413 $this->ui_factory->button()->standard(
414 $this->lng->txt('mail_add_subfolder'),
415 $this->ctrl->getLinkTarget($this, self::CMD_ADD_SUB_FOLDER)
416 )
417 );
418 }
419
420 if ($this->folder->isUserFolder()) {
421 $this->toolbar->addComponent(
422 $this->ui_factory->button()->standard(
423 $this->lng->txt('rename'),
424 $this->ctrl->getLinkTarget($this, self::CMD_RENAME_SUB_FOLDER)
425 )
426 );
427
428 $components[] = $modal = $this->ui_factory->modal()->interruptive(
429 $this->lng->txt('delete'),
430 $this->lng->txt('mail_sure_delete_folder'),
431 $this->ctrl->getLinkTarget($this, self::CMD_DELETE_SUB_FOLDER)
432 );
433 $this->toolbar->addComponent(
434 $this->ui_factory->button()->standard(
435 $this->lng->txt('delete'),
436 '#'
437 )
438 ->withOnClick($modal->getShowSignal())
439 );
440 }
441
442 if ($this->folder->isTrash()) {
443 $components[] = $modal = $this->ui_factory->modal()->interruptive(
444 $this->lng->txt('mail_empty_trash'),
445 $this->lng->txt('mail_empty_trash_confirmation'),
446 $this->ctrl->getLinkTarget($this, self::CMD_EMPTY_TRASH)
447 );
448 $this->toolbar->addComponent(
449 $this->ui_factory->button()->standard(
450 $this->lng->txt('mail_empty_trash'),
451 '#'
452 )->withOnClick($modal->getShowSignal())
453 );
454 }
455
456 [
457 $url_builder,
458 $action_token,
459 $row_id_token,
460 $target_token,
461 ] = (new URLBuilder(
462 $this->data_factory->uri(
463 ilUtil::_getHttpPath() . '/' .
464 $this->ctrl->getLinkTarget($this, self::CMD_TABLE_ACTION)
465 )
466 )
467 )->acquireParameters(
468 [self::URL_BUILDER_PREFIX],
469 self::PARAM_ACTION,
470 self::PARAM_MAIL_ID,
471 self::PARAM_TARGET_FOLDER
472 );
473
474 $table = new MailFolderTableUI(
475 $url_builder,
476 $action_token,
477 $row_id_token,
478 $target_token,
479 $this->mbox->getSubFolders(),
480 $this->folder,
481 $this->getFilteredSearch(),
482 $this->umail,
483 $this->ui_factory,
484 $this->ui_renderer,
485 $this->lng,
486 $this->http->request(),
487 $this->data_factory,
488 $this->refinery,
489 $this->user->getDateFormat(),
490 $this->user->getTimeFormat(),
491 new DateTimeZone($this->user->getTimeZone())
492 );
493
494 $components[] = $this->getFilterUI()->getComponent();
495 $components[] = $table->getComponent();
496
497 $this->tpl->setTitle($this->folder->getTitle());
498 $this->tpl->setContent($this->ui_renderer->render($components));
499 $this->tpl->printToStdout();
500 }
501
502 protected function redirectToFolder(): never
503 {
504 $this->ctrl->clearParameters($this);
505 $this->ctrl->setParameter($this, self::PARAM_FOLDER_ID, $this->folder->getFolderId());
506 $this->ctrl->redirect($this, self::CMD_SHOW_FOLDER);
507 }
508
509 protected function deleteSubFolder(): void
510 {
511 $parent_folder_id = $this->mbox->getParentFolderId($this->folder->getFolderId());
512 if ($parent_folder_id > 0 && $this->mbox->deleteFolder($this->folder->getFolderId())) {
513 $this->tpl->setOnScreenMessage(
515 $this->lng->txt('mail_folder_deleted'),
516 true
517 );
518 $this->ctrl->setParameter($this, self::PARAM_FOLDER_ID, $parent_folder_id);
519 $this->ctrl->redirect($this, self::CMD_SHOW_FOLDER);
520 } else {
521 $this->tpl->setOnScreenMessage(
523 $this->lng->txt('mail_error_delete'),
524 true
525 );
526 $this->redirectToFolder();
527 }
528 }
529
530 protected function addSubFolder(): void
531 {
532 $form = $this->ui_factory->input()->container()->form()->standard(
533 $this->ctrl->getFormAction($this, self::CMD_ADD_SUB_FOLDER),
534 [
535 'folder' => $this->ui_factory->input()->field()->section([
536 'title' => $this->ui_factory->input()->field()->text($this->lng->txt('title'))->withRequired(true)
537 ], $this->lng->txt('mail_add_folder'))
538 ]
539 );
540
541 $request = $this->http->request();
542 if ($request->getMethod() === 'POST') {
543 $form = $form->withRequest($request);
544 $data = $form->getData();
545 if (!empty($data['folder']['title'])) {
546 $new_folder_id = $this->mbox->addFolder(
547 $this->folder->getFolderId(),
548 (string) $data['folder']['title']
549 );
550 if ($new_folder_id > 0) {
551 $this->tpl->setOnScreenMessage(
553 $this->lng->txt('mail_folder_created'),
554 true
555 );
556 $this->ctrl->setParameter($this, self::PARAM_FOLDER_ID, $new_folder_id);
557 $this->ctrl->redirect($this, self::CMD_SHOW_FOLDER);
558 } else {
559 $this->tpl->setOnScreenMessage(
561 $this->lng->txt('mail_folder_exists')
562 );
563 }
564 }
565 }
566 $this->tpl->setContent($this->ui_renderer->render($form));
567 $this->tpl->printToStdout();
568 }
569
570 protected function renameSubFolder(): void
571 {
572 $form = $this->ui_factory->input()->container()->form()->standard(
573 $this->ctrl->getFormAction($this, self::CMD_RENAME_SUB_FOLDER),
574 [
575 'folder' => $this->ui_factory->input()->field()->section([
576 'title' => $this->ui_factory->input()->field()->text($this->lng->txt('title'))->withRequired(true)
577 ], $this->lng->txt('mail_rename_folder'))
578 ]
579 );
580
581 $request = $this->http->request();
582 if ($request->getMethod() === 'POST') {
583 $form = $form->withRequest($request);
584 $data = $form->getData();
585 if (!empty($data['folder']['title'])) {
586 if ($this->mbox->renameFolder($this->folder->getFolderId(), (string) $data['folder']['title'])) {
587 $this->tpl->setOnScreenMessage(
589 $this->lng->txt('mail_folder_name_changed'),
590 true
591 );
592 $this->redirectToFolder();
593 } else {
594 $this->tpl->setOnScreenMessage(
596 $this->lng->txt('mail_folder_exists')
597 );
598 }
599 }
600 }
601 $this->tpl->setContent($this->ui_renderer->render($form));
602 $this->tpl->printToStdout();
603 }
604
605 protected function getFilterUI(): MailFilterUI
606 {
607 return new MailFilterUI(
608 $this->ctrl->getFormAction($this, self::CMD_SHOW_FOLDER),
609 ilSearchSettings::getInstance()->enabledLucene(),
610 $this->folder,
611 $this->ui_factory,
612 $this->ui_service->filter(),
613 $this->lng,
614 new DateTimeZone($this->user->getTimeZone()),
615 );
616 }
617
623 {
624 return new MailFolderSearch(
625 $this->folder,
626 $this->getFilterUI()->getData(),
627 ilSearchSettings::getInstance()->enabledLucene(),
628 );
629 }
630
634 protected function getMailIdsFromRequest(): array
635 {
636 // table actions have a prefix, controller commands and modal items have none
637 foreach (
638 [
639 self::URL_BUILDER_PREFIX . URLBuilder::SEPARATOR . self::PARAM_MAIL_ID,
640 self::PARAM_MAIL_ID,
641 self::PARAM_INTERRUPTIVE_ITEMS
642 ] as $param
643 ) {
644 foreach (
645 [
646 $this->http->wrapper()->post(),
647 $this->http->wrapper()->query()
648 ] as $wrapper
649 ) {
650 if ($wrapper->has($param)) {
651 return $wrapper->retrieve(
652 $param,
653 $this->refinery->byTrying([
654 $this->refinery->kindlyTo()->listOf($this->refinery->kindlyTo()->int()),
655 $this->refinery->always([])
656 ])
657 );
658 }
659 }
660 }
661
662 return [];
663 }
664
669 protected function moveSingleMail(): void
670 {
671 $mail_ids = $this->getMailIdsFromRequest();
672 if (count($mail_ids) !== 1) {
673 $this->showMail();
674 $this->tpl->setOnScreenMessage('info', $this->lng->txt('mail_select_one'));
675 return;
676 }
677
678 $new_folder_id = $this->http->wrapper()->query()->retrieve(
679 'folder_id',
680 $this->refinery->byTrying([$this->refinery->kindlyTo()->int(), $this->refinery->always(0)])
681 );
682 $redirect_folder_id = $new_folder_id;
683
684 foreach ($mail_ids as $mail_id) {
685 $mail_data = $this->umail->getMail($mail_id);
686 if (isset($mail_data['folder_id']) &&
687 is_numeric($mail_data['folder_id']) &&
688 (int) $mail_data['folder_id'] > 0) {
689 $redirect_folder_id = (int) $mail_data['folder_id'];
690 break;
691 }
692 }
693
694 if ($this->umail->moveMailsToFolder($mail_ids, $new_folder_id)) {
695 $this->tpl->setOnScreenMessage('success', $this->lng->txt('mail_moved'), true);
696 $this->ctrl->setParameter($this, self::PARAM_FOLDER_ID, $redirect_folder_id);
697 $this->ctrl->redirect($this, self::CMD_SHOW_FOLDER);
698 } else {
699 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('mail_move_error'));
700 $this->showMail();
701 }
702 }
703
704 protected function deleteMails(): void
705 {
706 if (!$this->folder->isTrash()) {
707 $this->tpl->setOnScreenMessage(
709 $this->lng->txt('mail_operation_on_invalid_folder'),
710 true
711 );
712 $this->redirectToFolder();
713 }
714
715 $this->umail->deleteMails($this->getMailIdsFromRequest());
716 $this->tpl->setOnScreenMessage(
718 $this->lng->txt('mail_deleted'),
719 true
720 );
721 $this->redirectToFolder();
722 }
723
728 protected function confirmDeleteMails(array $mail_ids): void
729 {
730 $user_timezone = new DateTimeZone($this->user->getTimeZone());
731 $records = $this->getFilteredSearch()->forMailIds($mail_ids)->getPagedRecords(10, 0, null, null);
732 $items = [];
733 foreach ($records as $record) {
734 $prefix = '';
735 if (!empty($record->getSendTime())) {
736 $time = $record->getSendTime()->setTimezone($user_timezone);
737 $prefix = $time->format($this->user->getDateFormat()->toString()) . ' ';
738 }
739 $items[] = $this->ui_factory->modal()->interruptiveItem()->standard(
740 (string) $record->getMailId(),
741 $prefix . $this->refinery->encode()->htmlSpecialCharsAsEntities()->transform($record->getSubject())
742 );
743 }
744
745 $modal = $this->ui_factory->modal()->interruptive(
746 $this->lng->txt('delete'),
747 $this->lng->txt('mail_sure_delete_' . (count($items) === 1 ? 's' : 'p')),
748 $this->ctrl->getFormAction($this, self::CMD_DELETE_MAILS)
749 )->withAffectedItems($items);
750
751 $this->http->saveResponse(
752 $this->http->response()->withBody(
753 Streams::ofString($this->ui_renderer->renderAsync($modal))
754 )
755 );
756 $this->http->sendResponse();
757 $this->http->close();
758 }
759
760 protected function showMail(): void
761 {
762 $ui_components = [];
763
764 $mail_id = $this->getMailIdsFromRequest()[0] ?? 0;
765 if ($mail_id <= 0) {
766 $this->error->raiseError($this->lng->txt('permission_denied'), $this->error->MESSAGE);
767 }
768
769 $mail_data = $this->umail->getMail($mail_id);
770 if ($mail_data === null) {
771 $this->error->raiseError($this->lng->txt('permission_denied'), $this->error->MESSAGE);
772 }
773
774 $this->umail->markRead([$mail_id]);
775
776 $this->tpl->setTitle($this->lng->txt('mail_mails_of'));
777
778 $this->tabs->clearTargets();
779 $this->ctrl->setParameter($this, self::PARAM_FOLDER_ID, $mail_data['folder_id']);
780 $this->tabs->setBackTarget(
781 $this->lng->txt('back_to_folder'),
782 $this->ctrl->getFormAction($this, self::CMD_SHOW_FOLDER)
783 );
784 $this->ctrl->clearParameters($this);
785
786 $this->ctrl->setParameter($this, self::PARAM_MAIL_ID, $mail_id);
787 $this->ctrl->setParameter($this, self::PARAM_FOLDER_ID, $mail_data['folder_id']);
788 $this->toolbar->setFormAction($this->ctrl->getFormAction($this, self::CMD_SHOW_MAIL));
789 $this->ctrl->clearParameters($this);
790
791 $form = new ilPropertyFormGUI();
792 $form->setId('MailContent');
793 $form->setPreventDoubleSubmission(false);
794 $form->setTableWidth('100%');
795 $this->ctrl->setParameter($this, self::PARAM_FOLDER_ID, $mail_data['folder_id']);
796 $this->ctrl->setParameter($this, self::PARAM_MAIL_ID, $mail_id);
797 $form->setFormAction($this->ctrl->getFormAction($this, self::CMD_SHOW_MAIL));
798 $this->ctrl->clearParameters($this);
799 $form->setTitle($this->lng->txt('mail_mails_of'));
800
802 $sender = ilObjectFactory::getInstanceByObjId($mail_data['sender_id'], false);
803 $reply_btn = null;
804 if ($sender instanceof ilObjUser && $sender->getId() !== 0 && !$sender->isAnonymous()) {
805 $this->ctrl->setParameterByClass(
806 ilMailFormGUI::class,
807 self::PARAM_FOLDER_ID,
808 $mail_data['folder_id']
809 );
810 $this->ctrl->setParameterByClass(ilMailFormGUI::class, self::PARAM_MAIL_ID, $mail_id);
811 $this->ctrl->setParameterByClass(ilMailFormGUI::class, 'type', ilMailFormGUI::MAIL_FORM_TYPE_REPLY);
812 $reply_btn = $this->ui_factory->button()->primary(
813 $this->lng->txt('reply'),
814 $this->ctrl->getLinkTargetByClass(ilMailFormGUI::class)
815 );
816 $this->toolbar->addStickyItem($reply_btn);
817 $this->ctrl->clearParametersByClass(ilMailFormGUI::class);
818 }
819
820 $this->ctrl->setParameterByClass(ilMailFormGUI::class, self::PARAM_FOLDER_ID, $mail_data['folder_id']);
821 $this->ctrl->setParameterByClass(ilMailFormGUI::class, self::PARAM_MAIL_ID, $mail_id);
822 $this->ctrl->setParameterByClass(ilMailFormGUI::class, 'type', ilMailFormGUI::MAIL_FORM_TYPE_FORWARD);
823 if ($reply_btn === null) {
824 $fwd_btn = $this->ui_factory->button()->primary(
825 $this->lng->txt('forward'),
826 $this->ctrl->getLinkTargetByClass(ilMailFormGUI::class)
827 );
828 $this->toolbar->addStickyItem($fwd_btn);
829 } else {
830 $fwd_btn = $this->ui_factory->button()->standard(
831 $this->lng->txt('forward'),
832 $this->ctrl->getLinkTargetByClass(ilMailFormGUI::class)
833 );
834 $this->toolbar->addComponent($fwd_btn);
835 }
836 $this->ctrl->clearParametersByClass(ilMailFormGUI::class);
837
838 if ($sender && $sender->getId() && !$sender->isAnonymous()) {
839 $linked_fullname = $sender->getPublicName();
840 $avatar = $this->ui_factory->symbol()->avatar()->picture(
841 $sender->getPersonalPicturePath('xsmall'),
842 $sender->getPublicName()
843 );
844
845 if (in_array(ilObjUser::_lookupPref($sender->getId(), 'public_profile'), ['y', 'g'])) {
846 $this->ctrl->setParameter($this, self::PARAM_MAIL_ID, $mail_id);
847 $this->ctrl->setParameter($this, self::PARAM_FOLDER_ID, $mail_data['folder_id']);
848 $this->ctrl->setParameter($this, self::PARAM_USER_ID, $sender->getId());
849 $linked_fullname = '<br /><a class="mailusername" href="' . $this->ctrl->getLinkTarget(
850 $this,
851 self::CMD_SHOW_USER
852 ) . '" title="' . $linked_fullname . '">' . $linked_fullname . '</a>';
853 $this->ctrl->clearParameters($this);
854 }
855
856 $from = new ilCustomInputGUI($this->lng->txt('from') . ':');
857 $from->setHtml($this->ui_renderer->render($avatar) . ' ' . $linked_fullname);
858 } elseif (!$sender || !$sender->getId()) {
859 $from = new ilCustomInputGUI($this->lng->txt('from') . ':');
860 $from->setHtml(trim(($mail_data['import_name'] ?? '') . ' (' . $this->lng->txt('user_deleted') . ')'));
861 } else {
862 $from = new ilCustomInputGUI($this->lng->txt('from') . ':');
863 $from->setHtml(
864 $this->ui_renderer->render(
865 $this->ui_factory
866 ->symbol()
867 ->avatar()
868 ->picture(ilUtil::getImagePath('logo/ilias_logo_centered.png'), ilMail::_getIliasMailerName())
869 ) . '<br />' . ilMail::_getIliasMailerName()
870 );
871 }
872 $form->addItem($from);
873
874 $to = new ilCustomInputGUI($this->lng->txt('mail_to') . ':');
875 $to->setHtml(
877 $this->umail->formatNamesForOutput($mail_data['rcp_to'] ?? ''),
878 false
879 )
880 );
881 $form->addItem($to);
882
883 if ($mail_data['rcp_cc']) {
884 $cc = new ilCustomInputGUI($this->lng->txt('mail_cc') . ':');
885 $cc->setHtml(
887 $this->umail->formatNamesForOutput($mail_data['rcp_cc']),
888 false
889 )
890 );
891 $form->addItem($cc);
892 }
893
894 if ($mail_data['rcp_bcc']) {
895 $bcc = new ilCustomInputGUI($this->lng->txt('mail_bcc') . ':');
896 $bcc->setHtml(
898 $this->umail->formatNamesForOutput($mail_data['rcp_bcc']),
899 false
900 )
901 );
902 $form->addItem($bcc);
903 }
904
905 $subject = new ilCustomInputGUI($this->lng->txt('subject') . ':');
906 $subject->setHtml(ilUtil::htmlencodePlainString($mail_data['m_subject'] ?? '', true));
907 $form->addItem($subject);
908
909 $date = new ilCustomInputGUI($this->lng->txt('mail_sent_datetime') . ':');
910 $date->setHtml(
912 new ilDateTime($mail_data['send_time'], IL_CAL_DATETIME)
913 )
914 );
915 $form->addItem($date);
916
917 $message = new ilCustomInputGUI($this->lng->txt('message') . ':');
918 $message->setHtml(
919 str_replace(
920 ['{', '}'],
921 ['&#123;', '&#125;'],
922 $this->refinery->string()->makeClickable()->transform(
923 html_entity_decode(
924 $this->refinery->string()->markdown()->toHTML()->transform($mail_data['m_message']) ?? ''
925 )
926 )
927 )
928 );
929
930 $form->addItem($message);
931
932 if ($mail_data['attachments']) {
933 $att = new ilCustomInputGUI($this->lng->txt('attachments') . ':');
934
935 $radiog = new ilRadioGroupInputGUI('', 'filename');
936 foreach ($mail_data['attachments'] as $file) {
937 $radiog->addOption(new ilRadioOption($file, md5($file)));
938 }
939
940 $att->setHtml($radiog->render());
941 $form->addCommandButton(self::CMD_DELIVER_FILE, $this->lng->txt('download'));
942 $form->addItem($att);
943 }
944
945 $current_folder = $this->mbox->getFolderData((int) $mail_data['folder_id']);
946 if ($current_folder === null) {
947 $this->tpl->setOnScreenMessage('failure', $this->lng->txt('mail_operation_on_invalid_folder'), true);
948 $this->ctrl->setParameterByClass(ilMailGUI::class, self::PARAM_FOLDER_ID, $this->mbox->getInboxFolder());
949 $this->ctrl->redirectByClass(ilMailGUI::class);
950 }
951
952 $this->ctrl->setParameter($this, self::PARAM_FOLDER_ID, $this->folder->getFolderId());
953 $this->tabs->addTab(
954 'current_folder',
955 $current_folder->getTitle(),
956 $this->ctrl->getLinkTarget($this, self::CMD_SHOW_FOLDER)
957 );
958 $this->ctrl->clearParameters($this);
959 $this->tabs->activateTab('current_folder');
960
961 $move_links = [];
962 $folders = $this->mbox->getSubFolders();
963 foreach ($folders as $folder) {
964 if ((!$folder->isTrash() || !$current_folder->isTrash()) &&
965 $folder->getFolderId() !== $mail_data['folder_id']) {
966 $move_links[] = $this->ui_factory->button()->shy(
967 sprintf(
968 $this->lng->txt('mail_move_to_folder_x'),
969 $folder->getTitle()
970 ) . ($folder->isTrash() ? ' (' . $this->lng->txt('delete') . ')' : ''),
971 '#',
972 )->withOnLoadCode(static fn($id): string => "
973 document.getElementById('$id').addEventListener('click', function(e) {
974 const frm = this.closest('form'),
975 action = new URL(frm.action),
976 action_params = new URLSearchParams(action.search);
977
978 action_params.delete('cmd');
979 action_params.append('cmd', '" . self::CMD_MOVE_SINGLE_MAIL . "');
980 action_params.delete('folder_id');
981 action_params.append('folder_id', '" . $folder->getFolderId() . "');
982
983 action.search = action_params.toString();
984
985 frm.action = action.href;
986 frm.submit();
987
988 e.preventDefault();
989 e.stopPropagation();
990
991 return false;
992 });");
993 }
994 }
995
996 if ($this->folder->isTrash()) {
997 $this->ctrl->setParameter($this, self::PARAM_MAIL_ID, $mail_id);
998 $this->ctrl->setParameter($this, self::PARAM_FOLDER_ID, $mail_data['folder_id']);
999 $modal = $this->ui_factory->modal()->interruptive(
1000 $this->lng->txt('delete'),
1001 $this->lng->txt('mail_sure_delete_s'),
1002 $this->ctrl->getLinkTarget($this, self::CMD_DELETE_MAILS)
1003 )->withAffectedItems([
1004 $this->ui_factory->modal()->interruptiveItem()->standard(
1005 (string) $mail_id,
1007 new ilDateTime($mail_data['send_time'], IL_CAL_DATETIME)
1008 ) . ' ' . $mail_data['m_subject']
1009 )
1010 ]);
1011 $this->toolbar->addComponent(
1012 $this->ui_factory->button()->standard(
1013 $this->lng->txt('delete'),
1014 '#'
1015 )->withOnClick($modal->getShowSignal())
1016 );
1017 $this->ctrl->clearParameters($this);
1018
1019 $ui_components[] = $modal;
1020 }
1021
1022 if ($move_links !== []) {
1023 $this->toolbar->addComponent(
1024 $this->ui_factory->dropdown()->standard($move_links)
1025 ->withLabel($this->lng->txt('mail_move_to_folder_btn_label'))
1026 );
1027 }
1028
1029 $this->toolbar->addSeparator();
1030
1031 $this->ctrl->setParameter($this, self::PARAM_MAIL_ID, $mail_id);
1032 $this->ctrl->setParameter($this, self::PARAM_FOLDER_ID, $mail_data['folder_id']);
1033 $print_url = $this->ctrl->getLinkTarget($this, self::CMD_PRINT_MAIL);
1034 $this->ctrl->clearParameters($this);
1035 $print_btn = $this->ui_factory->button()
1036 ->standard($this->lng->txt('print'), '#')
1037 ->withOnLoadCode(static fn($id): string => "
1038 document.getElementById('$id').addEventListener('click', function() {
1039 const frm = this.closest('form'),
1040 action = frm.action;
1041
1042 frm.action = '$print_url';
1043 frm.target = '_blank';
1044 frm.submit();
1045
1046 frm.action = action;
1047 frm.removeAttribute('target');
1048
1049 return false;
1050 });
1051 ");
1052 $this->toolbar->addComponent($print_btn);
1053
1054 $prev_mail = $this->umail->getPreviousMail($mail_id);
1055 $next_mail = $this->umail->getNextMail($mail_id);
1056 if (is_array($prev_mail) || is_array($next_mail)) {
1057 $this->toolbar->addSeparator();
1058
1059 if ($prev_mail && $prev_mail[self::PARAM_MAIL_ID]) {
1060 $this->ctrl->setParameter($this, self::PARAM_MAIL_ID, $prev_mail[self::PARAM_MAIL_ID]);
1061 $this->ctrl->setParameter($this, self::PARAM_FOLDER_ID, $this->folder->getFolderId());
1062 $pref_btn = $this->ui_factory->button()
1063 ->standard(
1064 $this->lng->txt('previous'),
1065 $this->ctrl->getLinkTarget($this, self::CMD_SHOW_MAIL)
1066 );
1067 $this->toolbar->addComponent($pref_btn);
1068 $this->ctrl->clearParameters($this);
1069 }
1070
1071 if ($next_mail && $next_mail[self::PARAM_MAIL_ID]) {
1072 $this->ctrl->setParameter($this, self::PARAM_MAIL_ID, $next_mail[self::PARAM_MAIL_ID]);
1073 $this->ctrl->setParameter($this, self::PARAM_FOLDER_ID, $this->folder->getFolderId());
1074 $next_btn = $this->ui_factory->button()
1075 ->standard(
1076 $this->lng->txt('next'),
1077 $this->ctrl->getLinkTarget($this, self::CMD_SHOW_MAIL)
1078 );
1079 $this->toolbar->addComponent($next_btn);
1080 $this->ctrl->clearParameters($this);
1081 }
1082 }
1083
1084 $this->tpl->setContent($form->getHTML() . $this->ui_renderer->render($ui_components));
1085 $this->tpl->printToStdout();
1086 }
1087
1088 protected function printMail(): void
1089 {
1090 $tplprint = new ilTemplate('tpl.mail_print.html', true, true, 'components/ILIAS/Mail');
1091
1092 $mail_id = $this->getMailIdsFromRequest()[0] ?? 0;
1093 $mail_data = $this->umail->getMail($mail_id);
1094
1095 $sender = ilObjectFactory::getInstanceByObjId($mail_data['sender_id'], false);
1096
1097 $tplprint->setVariable('TXT_FROM', $this->lng->txt('from'));
1098 if ($sender instanceof ilObjUser && $sender->getId() !== 0 && !$sender->isAnonymous()) {
1099 $tplprint->setVariable('FROM', $sender->getPublicName());
1100 } elseif (!$sender instanceof ilObjUser || $sender->getId() === 0) {
1101 $tplprint->setVariable(
1102 'FROM',
1103 trim(($mail_data['import_name'] ?? '') . ' (' . $this->lng->txt('user_deleted') . ')')
1104 );
1105 } else {
1106 $tplprint->setVariable('FROM', ilMail::_getIliasMailerName());
1107 }
1108
1109 $tplprint->setVariable('TXT_TO', $this->lng->txt('mail_to'));
1110 $tplprint->setVariable('TO', $mail_data['rcp_to']);
1111
1112 if ($mail_data['rcp_cc']) {
1113 $tplprint->setCurrentBlock('cc');
1114 $tplprint->setVariable('TXT_CC', $this->lng->txt('mail_cc'));
1115 $tplprint->setVariable('CC', $mail_data['rcp_cc']);
1116 $tplprint->parseCurrentBlock();
1117 }
1118
1119 if ($mail_data['rcp_bcc']) {
1120 $tplprint->setCurrentBlock('bcc');
1121 $tplprint->setVariable('TXT_BCC', $this->lng->txt('mail_bcc'));
1122 $tplprint->setVariable('BCC', $mail_data['rcp_bcc']);
1123 $tplprint->parseCurrentBlock();
1124 }
1125
1126 $tplprint->setVariable('TXT_SUBJECT', $this->lng->txt('subject'));
1127 $tplprint->setVariable('SUBJECT', htmlspecialchars((string) $mail_data['m_subject']));
1128
1129 $tplprint->setVariable('TXT_DATE', $this->lng->txt('date'));
1130 $tplprint->setVariable(
1131 'DATE',
1132 ilDatePresentation::formatDate(new ilDateTime($mail_data['send_time'], IL_CAL_DATETIME))
1133 );
1134
1135 $tplprint->setVariable('TXT_MESSAGE', $this->lng->txt('message'));
1136 $tplprint->setVariable('MAIL_MESSAGE', html_entity_decode($this->refinery->string()->markdown()->toHTML()->transform($mail_data['m_message'])));
1137
1138 $tplprint->show();
1139 }
1140
1141 protected function deliverFile(): void
1142 {
1143 $mail_id = $this->http->wrapper()->query()->retrieve(
1144 self::PARAM_MAIL_ID,
1145 $this->refinery->byTrying([$this->refinery->kindlyTo()->int(), $this->refinery->always(0)])
1146 );
1147 if ($mail_id <= 0) {
1148 $this->error->raiseError($this->lng->txt('permission_denied'), $this->error->MESSAGE);
1149 }
1150
1151 $filename = $this->http->wrapper()->post()->retrieve(
1152 'filename',
1153 $this->refinery->byTrying([$this->refinery->kindlyTo()->string(), $this->refinery->always('')])
1154 );
1155
1156 if (is_string(ilSession::get('filename')) && ilSession::get('filename') !== '') {
1157 $filename = ilSession::get('filename');
1158 ilSession::set('filename', null);
1159 }
1160
1161 try {
1162 if ($mail_id > 0 && $filename !== '') {
1163 while (str_contains((string) $filename, '..')) {
1164 $filename = str_replace('..', '', $filename);
1165 }
1166
1167 $mail_file_data = new ilFileDataMail($this->user->getId());
1168 try {
1169 $file = $mail_file_data->getAttachmentPathAndFilenameByMd5Hash($filename, (int) $mail_id);
1170 ilFileDelivery::deliverFileLegacy($file['path'], $file['filename']);
1171 } catch (OutOfBoundsException $e) {
1172 throw new ilMailException('mail_error_reading_attachment', $e->getCode(), $e);
1173 }
1174 } else {
1175 $this->tpl->setOnScreenMessage('info', $this->lng->txt('mail_select_attachment'));
1176 $this->showMail();
1177 }
1178 } catch (Exception $e) {
1179 $this->tpl->setOnScreenMessage('failure', $this->lng->txt($e->getMessage()), true);
1180 $this->redirectToFolder();
1181 }
1182 }
1183
1184 protected function deliverAttachments(): void
1185 {
1186 try {
1187 $mail_id = $this->getMailIdsFromRequest()[0] ?? 0;
1188 $mail_data = $this->umail->getMail($mail_id);
1189 if ($mail_data === null || [] === (array) $mail_data['attachments']) {
1190 throw new ilMailException('mail_error_reading_attachment');
1191 }
1192
1193 $type = $this->http->wrapper()->query()->retrieve(
1194 'type',
1195 $this->refinery->byTrying([$this->refinery->kindlyTo()->string(), $this->refinery->always('')])
1196 );
1197
1198 $mail_file_data = new ilFileDataMail($this->user->getId());
1199 if (count($mail_data['attachments']) === 1) {
1200 $attachment = current($mail_data['attachments']);
1201
1202 try {
1203 if ($type === 'draft') {
1204 if (!$mail_file_data->checkFilesExist([$attachment])) {
1205 throw new OutOfBoundsException('');
1206 }
1207 $path_to_file = $mail_file_data->getAbsoluteAttachmentPoolPathByFilename($attachment);
1208 $filename = $attachment;
1209 } else {
1210 $file = $mail_file_data->getAttachmentPathAndFilenameByMd5Hash(
1211 md5((string) $attachment),
1212 $mail_id
1213 );
1214 $path_to_file = $file['path'];
1215 $filename = $file['filename'];
1216 }
1218 } catch (OutOfBoundsException $e) {
1219 throw new ilMailException('mail_error_reading_attachment', $e->getCode(), $e);
1220 }
1221 } else {
1222 $mail_file_data->deliverAttachmentsAsZip(
1223 $mail_data['m_subject'],
1224 $mail_id,
1225 $mail_data['attachments'],
1226 $type === 'draft'
1227 );
1228 }
1229 } catch (Exception $e) {
1230 $this->tpl->setOnScreenMessage('failure', $this->lng->txt($e->getMessage()), true);
1231 $this->redirectToFolder();
1232 }
1233 }
1234}
$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: ILIAS\User\Profile\PublicProfileGUI
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
$param
Definition: xapitoken.php:44