ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilMailFolderGUI Class Reference
+ Collaboration diagram for ilMailFolderGUI:

Public Member Functions

 __construct ()
 ilMailFolderGUI constructor. More...
 
 executeCommand ()
 
 cancelEmptyTrash ()
 cancel Empty Trash Action and return to folder More...
 
 performEmptyTrash ()
 empty Trash and return to folder More...
 
 askForEmptyTrash ()
 confirmation message for empty trash action More...
 
 showUser ()
 
 addSubfolderCommands ($check_uf=false)
 
 showFolder ($a_show_confirmation=false)
 Shows current folder. More...
 
 deleteSubfolder ($a_show_confirm=true)
 
 performDeleteSubFolder ()
 
 performAddSubFolder ()
 
 addSubFolder ()
 
 renameSubFolder ()
 
 performRenameSubFolder ()
 
 changeFolder ()
 
 editFolder ()
 
 confirmDeleteMails ()
 
 cancelDeleteMails ()
 
 deliverFile ()
 
 applyFilter ()
 
 resetFilter ()
 

Data Fields

 $umail
 
 $mbox
 

Private Attributes

 $current_select_cmd
 
 $current_selected_cmd
 
 $tpl
 
 $ctrl
 
 $lng
 
 $toolbar
 
 $tabs
 
 $user
 
 $errorDelete = false
 

Detailed Description

Author
Jens Conze
Version
$Id$

@ilCtrl_Calls ilMailFolderGUI: ilMailOptionsGUI, ilMailAttachmentGUI, ilMailSearchGUI @ilCtrl_Calls ilMailFolderGUI: ilPublicUserProfileGUI

Definition at line 19 of file class.ilMailFolderGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilMailFolderGUI::__construct ( )

ilMailFolderGUI constructor.

Definition at line 72 of file class.ilMailFolderGUI.php.

73 {
74 global $DIC;
75
76 $this->tpl = $DIC->ui()->mainTemplate();
77 $this->ctrl = $DIC->ctrl();
78 $this->lng = $DIC->language();
79 $this->toolbar = $DIC->toolbar();
80 $this->user = $DIC->user();
81 $this->tabs = $DIC->tabs();
82
83 $this->umail = new ilMail($this->user->getId());
84 $this->mbox = new ilMailBox($this->user->getId());
85
86 if (isset($_POST['mobj_id']) && (int) $_POST['mobj_id']) {
87 $_GET['mobj_id'] = $_POST['mobj_id'];
88 }
89
90 if (!(int) $_GET['mobj_id']) {
91 $_GET['mobj_id'] = $this->mbox->getInboxFolder();
92 }
93 $_GET['mobj_id'] = (int) $_GET['mobj_id'];
94
95 $this->ctrl->saveParameter($this, 'mobj_id');
96 $this->ctrl->setParameter($this, 'mobj_id', $_GET['mobj_id']);
97 }
user()
Definition: user.php:4
$_GET["client_id"]
$_POST["username"]
This class handles base functions for mail handling.
global $DIC
Definition: saml.php:7

References $_GET, $_POST, $DIC, and user().

+ Here is the call graph for this function:

Member Function Documentation

◆ addSubFolder()

ilMailFolderGUI::addSubFolder ( )

Definition at line 423 of file class.ilMailFolderGUI.php.

424 {
425 include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
426
427 $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.mail.html', 'Services/Mail');
428 $this->tpl->setTitle($this->lng->txt('mail'));
429
430 $oForm = new ilPropertyFormGUI();
431 $oForm->setFormAction($this->ctrl->getFormAction($this, 'performAddSubFolder'));
432 $oForm->setTitle($this->lng->txt('mail_add_folder'));
433
434 //title
435 $oTitle = new ilTextInputGUI();
436 $oTitle->setTitle($this->lng->txt('title'));
437 $oTitle->setPostVar('subfolder_title');
438 $oForm->addItem($oTitle);
439
440 $oForm->addCommandButton('performAddSubFolder', $this->lng->txt('save'));
441 $oForm->addCommandButton('showFolder', $this->lng->txt('cancel'));
442
443 $this->tpl->setVariable('FORM', $oForm->getHTML());
444 $this->tpl->show();
445
446 return true;
447 }
This class represents a property form user interface.
This class represents a text property in a property form.

Referenced by performAddSubFolder().

+ Here is the caller graph for this function:

◆ addSubfolderCommands()

ilMailFolderGUI::addSubfolderCommands (   $check_uf = false)

Definition at line 222 of file class.ilMailFolderGUI.php.

223 {
225 $this->toolbar->addSeparator();
226 }
227
228 $this->toolbar->addButton($this->lng->txt('mail_add_subfolder'), $this->ctrl->getLinkTarget($this, 'addSubFolder'));
229
230 if ($check_uf) {
231 $this->toolbar->addButton($this->lng->txt('rename'), $this->ctrl->getLinkTarget($this, 'renameSubFolder'));
232 $this->toolbar->addButton($this->lng->txt('delete'), $this->ctrl->getLinkTarget($this, 'deleteSubFolder'));
233 }
234
235 return true;
236 }
const VIEWMODE_SESSION_KEY
static get($a_var)
Get a value.

References ilSession\get(), and ilMailGUI\VIEWMODE_SESSION_KEY.

Referenced by showFolder().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ applyFilter()

ilMailFolderGUI::applyFilter ( )

Definition at line 908 of file class.ilMailFolderGUI.php.

909 {
910 $sentFolderId = $this->mbox->getSentFolder();
911 $draftsFolderId = $this->mbox->getDraftsFolder();
912
913 $isTrashFolder = $_GET['mobj_id'] == $this->mbox->getTrashFolder();
914 $isSentFolder = $_GET['mobj_id'] == $sentFolderId;
915 $isDraftFolder = $_GET['mobj_id'] == $draftsFolderId;
916
917 $table = new ilMailFolderTableGUI($this, (int) $_GET['mobj_id'], 'showFolder');
918 $table->isSentFolder($isSentFolder)
919 ->isDraftFolder($isDraftFolder)
920 ->isTrashFolder($isTrashFolder)
921 ->initFilter();
922 $table->resetOffset();
923 $table->writeFilterToSession();
924
925 $this->showFolder();
926 }
showFolder($a_show_confirmation=false)
Shows current folder.
if(empty($password)) $table
Definition: pwgen.php:24

References $_GET, $table, and showFolder().

+ Here is the call graph for this function:

◆ askForEmptyTrash()

ilMailFolderGUI::askForEmptyTrash ( )

confirmation message for empty trash action

Definition at line 191 of file class.ilMailFolderGUI.php.

192 {
193 if ($this->umail->countMailsOfFolder((int) $_GET['mobj_id'])) {
194 $this->askForConfirmation = true;
195 }
196
197 $this->showFolder();
198
199 return true;
200 }

References $_GET, and showFolder().

+ Here is the call graph for this function:

◆ cancelDeleteMails()

ilMailFolderGUI::cancelDeleteMails ( )

Definition at line 603 of file class.ilMailFolderGUI.php.

604 {
605 $this->ctrl->redirect($this);
606 }

◆ cancelEmptyTrash()

ilMailFolderGUI::cancelEmptyTrash ( )

cancel Empty Trash Action and return to folder

Definition at line 173 of file class.ilMailFolderGUI.php.

174 {
175 $this->showFolder();
176 }

References showFolder().

+ Here is the call graph for this function:

◆ changeFolder()

ilMailFolderGUI::changeFolder ( )

Definition at line 501 of file class.ilMailFolderGUI.php.

502 {
503 switch ($this->current_selected_cmd) {
504 default:
505 if (!(int) $_GET["mail_id"] || !(int) $this->current_selected_cmd) {
506 ilUtil::sendInfo($this->lng->txt("mail_move_error"));
507 return $this->showMail();
508 }
509
510 if ($this->umail->moveMailsToFolder(array($_GET["mail_id"]), $this->current_selected_cmd)) {
511 ilUtil::sendInfo($this->lng->txt("mail_moved"), true);
512 $this->ctrl->redirectByClass("ilMailGUI");
513 } else {
514 ilUtil::sendInfo($this->lng->txt("mail_move_error"));
515 }
516 break;
517 }
518
519 $this->showMail();
520
521 return true;
522 }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.

References $_GET, and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ confirmDeleteMails()

ilMailFolderGUI::confirmDeleteMails ( )

Definition at line 586 of file class.ilMailFolderGUI.php.

587 {
588 if ($this->mbox->getTrashFolder() == $_GET['mobj_id']) {
589 $_POST['mail_id'] = $mail_ids = explode(',', $_GET['mail_id']);
590 if (!is_array($mail_ids)) {
591 ilUtil::sendInfo($this->lng->txt('mail_select_one'));
592 } elseif ($this->umail->deleteMails($mail_ids)) {
593 $_GET['offset'] = 0;
594 ilUtil::sendInfo($this->lng->txt('mail_deleted'));
595 } else {
596 ilUtil::sendInfo($this->lng->txt('mail_delete_error'));
597 }
598 }
599
600 $this->showFolder();
601 }

References $_GET, $_POST, ilUtil\sendInfo(), and showFolder().

+ Here is the call graph for this function:

◆ deleteSubfolder()

ilMailFolderGUI::deleteSubfolder (   $a_show_confirm = true)

Definition at line 368 of file class.ilMailFolderGUI.php.

369 {
370 if ($a_show_confirm) {
371 include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
372 $oConfirmationGUI = new ilConfirmationGUI();
373
374 // set confirm/cancel commands
375 $oConfirmationGUI->setFormAction($this->ctrl->getFormAction($this, "showFolder"));
376 $oConfirmationGUI->setHeaderText($this->lng->txt("mail_sure_delete_folder"));
377 $oConfirmationGUI->setCancel($this->lng->txt("cancel"), "showFolder");
378 $oConfirmationGUI->setConfirm($this->lng->txt("confirm"), "performDeleteSubfolder");
379 $this->tpl->setVariable('CONFIRMATION', $oConfirmationGUI->getHTML());
380
381 return $this->showFolder(true);
382 } else {
383 return $this->showFolder(false);
384 }
385 }
Confirmation screen class.

References showFolder().

+ Here is the call graph for this function:

◆ deliverFile()

ilMailFolderGUI::deliverFile ( )

Definition at line 872 of file class.ilMailFolderGUI.php.

873 {
874 if ($_SESSION["mail_id"]) {
875 $_GET["mail_id"] = $_SESSION["mail_id"];
876 }
877 $_SESSION["mail_id"] = "";
878
879 $filename = ($_SESSION["filename"]
880 ? $_SESSION["filename"]
881 : ($_POST["filename"]
882 ? $_POST["filename"]
883 : $_GET["filename"]));
884 $_SESSION["filename"] = "";
885
886 if ($filename != "") {
887 require_once "./Services/Mail/classes/class.ilFileDataMail.php";
888
889 // secure filename
890 $filename = str_replace("..", "", $filename);
891
892 $mfile = new ilFileDataMail($GLOBALS['DIC']['ilUser']->getId());
893 if (!is_array($file = $mfile->getAttachmentPathByMD5Filename($filename, $_GET['mail_id']))) {
894 ilUtil::sendInfo($this->lng->txt('mail_error_reading_attachment'));
895 $this->showMail();
896 } else {
897 ilUtil::deliverFile($file['path'], $file['filename']);
898 }
899 } else {
900 ilUtil::sendInfo($this->lng->txt('mail_select_attachment'));
901 $this->showMail();
902 }
903 }
$_SESSION["AccountId"]
This class handles all operations on files (attachments) in directory ilias_data/mail.
static deliverFile( $a_file, $a_filename, $a_mime='', $isInline=false, $removeAfterDelivery=false, $a_exit_after=true)
deliver file for download via browser.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
if(!file_exists("$old.txt")) if( $old===$new) if(file_exists("$new.txt")) $file

References $_GET, $_POST, $_SESSION, $file, $filename, $GLOBALS, ilUtil\deliverFile(), and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ editFolder()

ilMailFolderGUI::editFolder ( )

Definition at line 524 of file class.ilMailFolderGUI.php.

525 {
526 switch ($this->current_selected_cmd) {
527 case 'markMailsRead':
528 if (is_array($_POST["mail_id"])) {
529 $this->umail->markRead($_POST["mail_id"]);
530 } else {
531 ilUtil::sendInfo($this->lng->txt("mail_select_one"));
532 }
533 break;
534 case 'markMailsUnread':
535 if (is_array($_POST["mail_id"])) {
536 $this->umail->markUnread($_POST["mail_id"]);
537 } else {
538 ilUtil::sendInfo($this->lng->txt("mail_select_one"));
539 }
540 break;
541
542 case 'deleteMails':
543 // IF MAILBOX IS TRASH ASK TO CONFIRM
544 if ($this->mbox->getTrashFolder() == $_GET["mobj_id"]) {
545 if (!is_array($_POST["mail_id"])) {
546 ilUtil::sendInfo($this->lng->txt("mail_select_one"));
547 $this->errorDelete = true;
548 }
549 } // END IF MAILBOX IS TRASH FOLDER
550 else {
551 // MOVE MAILS TO TRASH
552 if (!is_array($_POST["mail_id"])) {
553 ilUtil::sendInfo($this->lng->txt("mail_select_one"));
554 } elseif ($this->umail->moveMailsToFolder($_POST["mail_id"], $this->mbox->getTrashFolder())) {
555 $_GET["offset"] = 0;
556 ilUtil::sendInfo($this->lng->txt("mail_moved_to_trash"));
557 } else {
558 ilUtil::sendInfo($this->lng->txt("mail_move_error"));
559 }
560 }
561 break;
562
563 case 'add':
564 $this->ctrl->setParameterByClass("ilmailoptionsgui", "cmd", "add");
565 $this->ctrl->redirectByClass("ilmailoptionsgui");
566
567 // no break
568 case 'moveMails':
569 default:
570 if (!is_array($_POST["mail_id"])) {
571 ilUtil::sendInfo($this->lng->txt("mail_select_one"));
572 } elseif ($this->umail->moveMailsToFolder($_POST["mail_id"], $this->current_selected_cmd)) {
573 ilUtil::sendInfo($this->lng->txt("mail_moved"));
574 } else {
575 ilUtil::sendInfo($this->lng->txt("mail_move_error"));
576 }
577 break;
578 }
579
580 $this->showFolder();
581 }

References $_GET, $_POST, ilUtil\sendInfo(), and showFolder().

+ Here is the call graph for this function:

◆ executeCommand()

ilMailFolderGUI::executeCommand ( )

Definition at line 99 of file class.ilMailFolderGUI.php.

100 {
101 if ($_POST["select_cmd"]) {
102 $_GET["cmd"] = 'editFolder';
103
104 // lower menubar execute-button
105 $this->current_select_cmd = $_POST['select_cmd'];
106 $this->current_selected_cmd = $_POST['selected_cmd'];
107 } elseif ($_POST["select_cmd2"]) {
108 // upper menubar execute-button
109 $_GET["cmd"] = 'editFolder';
110 $this->current_select_cmd = $_POST['select_cmd2'];
111 $this->current_selected_cmd = $_POST['selected_cmd2'];
112 }
113
114 /* Fix: User views mail and wants to delete it...
115 mjansen: The mail system needs a revision :-)
116 */
117 if ($_GET['selected_cmd'] == "deleteMails" && $_GET["mail_id"]) {
118 $_GET["cmd"] = "editFolder";
119 $this->current_selected_cmd = "deleteMails";
120 $_POST["mail_id"] = array($_GET["mail_id"]);
121 }
122
123 /* Fix: User views mail and wants to move it...
124 mjansen: The mail system needs a revision :-)
125 */
126 $cmd = $this->ctrl->getCmd();
127 if ($cmd == 'changeFolder' &&
128 is_numeric($_POST['selected_cmd']) &&
129 $_GET["mail_id"]) {
130 $this->current_selected_cmd = (int) $_POST['selected_cmd'];
131 }
132
133 $forward_class = $this->ctrl->getNextClass($this);
134 switch ($forward_class) {
135 case 'ilcontactgui':
136 require_once 'Services/Contact/classes/class.ilContactGUI.php';
137 $this->ctrl->forwardCommand(new ilContactGUI());
138 break;
139
140 case 'ilmailoptionsgui':
141 $this->tpl->setTitle($this->lng->txt('mail'));
142 include_once 'Services/Mail/classes/class.ilMailOptionsGUI.php';
143
144 $this->ctrl->forwardCommand(new ilMailOptionsGUI());
145 break;
146
147 case 'ilpublicuserprofilegui':
148 include_once("Services/User/classes/class.ilPublicUserProfileGUI.php");
149 $this->tpl->setTitle($this->lng->txt("mail"));
150 $this->ctrl->saveParameter($this, "mail_id");
151 $profile_gui = new ilPublicUserProfileGUI($_GET["user"]);
152 $profile_gui->setBackUrl($this->ctrl->getLinkTarget($this, "showMail"));
153 $ret = $this->ctrl->forwardCommand($profile_gui);
154 if ($ret != "") {
155 $this->tpl->setContent($ret);
156 }
157 $this->tpl->show();
158 break;
159
160 default:
161 if (!($cmd = $this->ctrl->getCmd())) {
162 $cmd = "showFolder";
163 }
164 $this->$cmd();
165 break;
166 }
167 return true;
168 }
GUI class for public user profile presentation.
$ret
Definition: parser.php:6

References $_GET, $_POST, and $ret.

◆ performAddSubFolder()

ilMailFolderGUI::performAddSubFolder ( )

Definition at line 401 of file class.ilMailFolderGUI.php.

402 {
403 if (isset($_POST["subfolder_title"]) && 'tree' == ilSession::get(ilMailGUI::VIEWMODE_SESSION_KEY)) {
404 $_SESSION["subfolder_title"] = ilUtil::stripSlashes($_POST['subfolder_title']);
405 }
406
407 if (empty($_POST['subfolder_title'])) {
408 ilUtil::sendInfo($this->lng->txt("mail_insert_folder_name"));
409 return $this->addSubFolder();
410 } elseif ($mobj_id = $this->mbox->addFolder($_GET["mobj_id"], ilUtil::stripSlashes($_POST["subfolder_title"]))) {
411 unset($_SESSION["subfolder_title"]);
412 ilUtil::sendInfo($this->lng->txt("mail_folder_created"), true);
413
414 $this->ctrl->setParameterByClass("ilMailGUI", 'mobj_id', $mobj_id);
415 $this->ctrl->redirectByClass("ilMailGUI");
416 } else {
417 ilUtil::sendFailure($this->lng->txt("mail_folder_exists"));
418 $this->addSubFolder();
419 return;
420 }
421 }
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled

References $_GET, $_POST, $_SESSION, addSubFolder(), ilSession\get(), ilUtil\sendFailure(), ilUtil\sendInfo(), ilUtil\stripSlashes(), and ilMailGUI\VIEWMODE_SESSION_KEY.

+ Here is the call graph for this function:

◆ performDeleteSubFolder()

ilMailFolderGUI::performDeleteSubFolder ( )

Definition at line 387 of file class.ilMailFolderGUI.php.

388 {
389 $new_parent = $this->mbox->getParentFolderId((int) $_GET['mobj_id']);
390 if ($this->mbox->deleteFolder((int) $_GET['mobj_id'])) {
391 ilUtil::sendInfo($this->lng->txt('mail_folder_deleted'), true);
392 $this->ctrl->setParameterByClass('ilMailGUI', 'mobj_id', (int) $new_parent);
393 $this->ctrl->redirectByClass('ilMailGUI');
394 } else {
395 ilUtil::sendFailure($this->lng->txt('mail_error_delete'));
396 $this->showFolder();
397 return;
398 }
399 }

References $_GET, ilUtil\sendFailure(), ilUtil\sendInfo(), and showFolder().

+ Here is the call graph for this function:

◆ performEmptyTrash()

ilMailFolderGUI::performEmptyTrash ( )

empty Trash and return to folder

Definition at line 181 of file class.ilMailFolderGUI.php.

182 {
183 $this->umail->deleteMailsOfFolder($_GET['mobj_id']);
184 ilUtil::sendInfo($this->lng->txt('mail_deleted'));
185 $this->showFolder();
186 }

References $_GET, ilUtil\sendInfo(), and showFolder().

+ Here is the call graph for this function:

◆ performRenameSubFolder()

ilMailFolderGUI::performRenameSubFolder ( )

Definition at line 476 of file class.ilMailFolderGUI.php.

477 {
478 if (isset($_POST["subfolder_title"]) && 'tree' == ilSession::get(ilMailGUI::VIEWMODE_SESSION_KEY)) {
479 $_SESSION["subfolder_title"] = $_POST['subfolder_title'];
480 }
481
482 $tmp_data = $this->mbox->getFolderData($_GET["mobj_id"]);
483 if ($tmp_data["title"] != $_POST["subfolder_title"]) {
484 if ($_POST["subfolder_title"] == "") {
485 ilUtil::sendInfo($this->lng->txt("mail_insert_folder_name"));
486 return $this->renameSubFolder();
487 } else {
488 if ($this->mbox->renameFolder($_GET["mobj_id"], ilUtil::stripSlashes($_POST["subfolder_title"]))) {
489 ilUtil::sendInfo($this->lng->txt("mail_folder_name_changed"), true);
490 unset($_SESSION["subfolder_title"]);
491 $this->ctrl->redirectByClass("ilMailGUI");
492 } else {
493 ilUtil::sendFailure($this->lng->txt("mail_folder_exists"));
494 return $this->renameSubFolder();
495 }
496 }
497 }
498 return $this->showFolder();
499 }

References $_GET, $_POST, $_SESSION, ilSession\get(), renameSubFolder(), ilUtil\sendFailure(), ilUtil\sendInfo(), showFolder(), ilUtil\stripSlashes(), and ilMailGUI\VIEWMODE_SESSION_KEY.

+ Here is the call graph for this function:

◆ renameSubFolder()

ilMailFolderGUI::renameSubFolder ( )

Definition at line 449 of file class.ilMailFolderGUI.php.

450 {
451 include_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
452
453 $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.mail.html', 'Services/Mail');
454 $this->tpl->setTitle($this->lng->txt('mail'));
455
456 $oForm = new ilPropertyFormGUI();
457 $oForm->setFormAction($this->ctrl->getFormAction($this, 'performRenameSubFolder'));
458 $oForm->setTitle($this->lng->txt('mail_rename_folder'));
459
460 //title
461 $oTitle = new ilTextInputGUI();
462 $oTitle->setTitle($this->lng->txt('title'));
463 $tmp_data = $this->mbox->getFolderData($_GET["mobj_id"]);
464 $oTitle->setValue($tmp_data["title"]);
465 $oTitle->setPostVar('subfolder_title');
466 $oForm->addItem($oTitle);
467
468 $oForm->addCommandButton('performRenameSubFolder', $this->lng->txt('save'));
469 $oForm->addCommandButton('showFolder', $this->lng->txt('cancel'));
470 $this->tpl->setVariable('FORM', $oForm->getHTML());
471 $this->tpl->show();
472
473 return true;
474 }

References $_GET.

Referenced by performRenameSubFolder().

+ Here is the caller graph for this function:

◆ resetFilter()

ilMailFolderGUI::resetFilter ( )

Definition at line 931 of file class.ilMailFolderGUI.php.

932 {
933 $sentFolderId = $this->mbox->getSentFolder();
934 $draftsFolderId = $this->mbox->getDraftsFolder();
935
936 $isTrashFolder = $_GET['mobj_id'] == $this->mbox->getTrashFolder();
937 $isSentFolder = $_GET['mobj_id'] == $sentFolderId;
938 $isDraftFolder = $_GET['mobj_id'] == $draftsFolderId;
939
940 $table = new ilMailFolderTableGUI($this, (int) $_GET['mobj_id'], 'showFolder');
941 $table->isSentFolder($isSentFolder)
942 ->isDraftFolder($isDraftFolder)
943 ->isTrashFolder($isTrashFolder)
944 ->initFilter();
945 $table->resetOffset();
946 $table->resetFilter();
947
948 $this->showFolder();
949 }

References $_GET, $table, and showFolder().

+ Here is the call graph for this function:

◆ showFolder()

ilMailFolderGUI::showFolder (   $a_show_confirmation = false)

Shows current folder.

Current Folder is determined by $_GET["mobj_id"]

Definition at line 240 of file class.ilMailFolderGUI.php.

241 {
242 $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.mail.html', 'Services/Mail');
243 $this->tpl->setTitle($this->lng->txt('mail'));
244
245 $sentFolderId = $this->mbox->getSentFolder();
246 $draftsFolderId = $this->mbox->getDraftsFolder();
247
248 $isTrashFolder = $_GET['mobj_id'] == $this->mbox->getTrashFolder();
249 $isSentFolder = $_GET['mobj_id'] == $sentFolderId;
250 $isDraftFolder = $_GET['mobj_id'] == $draftsFolderId;
251
252 if ($this->current_selected_cmd == 'deleteMails' &&
253 !$this->errorDelete &&
254 $this->current_selected_cmd != 'confirm' &&
255 $isTrashFolder) {
256 if (isset($_REQUEST['mail_id']) && !is_array($_REQUEST['mail_id'])) {
257 $_REQUEST['mail_id'] = array($_REQUEST['mail_id']);
258 }
259 $confirmation = new ilConfirmationGUI();
260 $confirmation->setHeaderText($this->lng->txt('mail_sure_delete'));
261 $this->ctrl->setParameter($this, 'mail_id', implode(',', (array) $_REQUEST['mail_id']));
262 $confirmation->setFormAction($this->ctrl->getFormAction($this, 'confirmDeleteMails'));
263 $confirmation->setConfirm($this->lng->txt('confirm'), 'confirmDeleteMails');
264 $confirmation->setCancel($this->lng->txt('cancel'), 'cancelDeleteMails');
265 $this->tpl->setVariable('CONFIRMATION', $confirmation->getHTML());
266 $a_show_confirmation = true;
267 }
268
269 $folders = $this->mbox->getSubFolders();
270 $mtree = new ilTree($this->user->getId());
271 $mtree->setTableNames('mail_tree', 'mail_obj_data');
272
273 $check_uf = false;
274 $check_local = false;
275
277 $folder_d = $mtree->getNodeData($_GET['mobj_id']);
278 if ($folder_d['m_type'] == 'user_folder') {
279 $check_uf = true;
280 } elseif ($folder_d['m_type'] == 'local') {
281 $check_local = true;
282 }
283 }
284
285 $mailtable = new ilMailFolderTableGUI($this, (int) $_GET['mobj_id'], 'showFolder');
286 $mailtable->isSentFolder($isSentFolder)
287 ->isDraftFolder($isDraftFolder)
288 ->isTrashFolder($isTrashFolder)
289 ->initFilter();
290 $mailtable->setSelectedItems($_POST['mail_id']);
291
292 try {
293 $mailtable->prepareHTML();
294 } catch (Exception $e) {
296 $this->lng->txt($e->getMessage()) != '-' . $e->getMessage() . '-' ?
297 $this->lng->txt($e->getMessage()) :
298 $e->getMessage()
299 );
300 }
301
302 $table_html = $mailtable->getHtml();
303
304 $folder_options = array();
306 foreach ($folders as $folder) {
307 $folder_d = $mtree->getNodeData($folder['obj_id']);
308
309 if ($folder['obj_id'] == $_GET['mobj_id']) {
310 if ($folder['type'] == 'user_folder') {
311 $check_uf = true;
312 } elseif ($folder['type'] == 'local') {
313 $check_local = true;
314 $check_uf = false;
315 }
316 }
317
318 if ($folder['type'] == 'user_folder') {
319 $pre = '';
320 for ($i = 2; $i < $folder_d['depth'] - 1; $i++) {
321 $pre .= '&nbsp;';
322 }
323
324 if ($folder_d['depth'] > 1) {
325 $pre .= '+';
326 }
327
328 $folder_options[$folder['obj_id']] = $pre . ' ' . $folder['title'];
329 } else {
330 $folder_options[$folder['obj_id']] = $this->lng->txt('mail_' . $folder['title']);
331 }
332 }
333 }
334
335 if ($a_show_confirmation == false && $this->askForConfirmation == false) {
337 $this->toolbar->addText($this->lng->txt('mail_change_to_folder'));
338 include_once './Services/Form/classes/class.ilSelectInputGUI.php';
339 $si = new ilSelectInputGUI("", "mobj_id");
340 $si->setOptions($folder_options);
341 $si->setValue($_GET['mobj_id']);
342 $this->toolbar->addInputItem($si);
343
344 $this->toolbar->addFormButton($this->lng->txt('change'), 'showFolder');
345 $this->toolbar->setFormAction($this->ctrl->getFormAction($this, 'showFolder'));
346 }
347 if ($check_local == true || $check_uf == true) {
348 $this->addSubfolderCommands($check_uf);
349 }
350 }
351 // END SHOW_FOLDER
352
353 if ($mailtable->isTrashFolder() &&
354 $mailtable->getNumerOfMails() > 0 &&
355 $this->askForConfirmation) {
356 $confirmation = new ilConfirmationGUI();
357 $confirmation->setHeaderText($this->lng->txt('mail_empty_trash_confirmation'));
358 $confirmation->setFormAction($this->ctrl->getFormAction($this, 'performEmptyTrash'));
359 $confirmation->setConfirm($this->lng->txt('confirm'), 'performEmptyTrash');
360 $confirmation->setCancel($this->lng->txt('cancel'), 'cancelEmptyTrash');
361 $this->tpl->setVariable('CONFIRMATION', $confirmation->getHTML());
362 }
363
364 $this->tpl->setVariable('MAIL_TABLE', $table_html);
365 $this->tpl->show();
366 }
addSubfolderCommands($check_uf=false)
This class represents a selection list property in a property form.
Tree class data representation in hierachical trees using the Nested Set Model with Gaps by Joe Celco...
$i
Definition: disco.tpl.php:19

References $_GET, $_POST, $i, $si, addSubfolderCommands(), ilSession\get(), ilUtil\sendFailure(), user(), and ilMailGUI\VIEWMODE_SESSION_KEY.

Referenced by applyFilter(), askForEmptyTrash(), cancelEmptyTrash(), confirmDeleteMails(), deleteSubfolder(), editFolder(), performDeleteSubFolder(), performEmptyTrash(), performRenameSubFolder(), and resetFilter().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showUser()

ilMailFolderGUI::showUser ( )

Definition at line 202 of file class.ilMailFolderGUI.php.

203 {
204 $this->ctrl->setParameter($this, "mail_id", $_GET["mail_id"]);
205
206 $this->tpl->setTitle($this->lng->txt("mail"));
207
208 $this->tpl->setVariable("TBL_TITLE", $this->lng->txt("profile_of") . " " .
210 $this->tpl->setVariable("TBL_TITLE_IMG", ilUtil::getImagePath("icon_usr.svg"));
211 $this->tpl->setVariable("TBL_TITLE_IMG_ALT", $this->lng->txt("public_profile"));
212
213 include_once './Services/User/classes/class.ilPublicUserProfileGUI.php';
214 $profile_gui = new ilPublicUserProfileGUI($_GET["user"]);
215 $profile_gui->setBackUrl($this->ctrl->getLinkTarget($this, "showMail"));
216 $this->tpl->setContent($this->ctrl->getHTML($profile_gui));
217 $this->tpl->show();
218
219 return true;
220 }
static _lookupLogin($a_user_id)
lookup login
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)

References $_GET, ilObjUser\_lookupLogin(), and ilUtil\getImagePath().

+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilMailFolderGUI::$ctrl
private

Definition at line 32 of file class.ilMailFolderGUI.php.

◆ $current_select_cmd

ilMailFolderGUI::$current_select_cmd
private

Definition at line 21 of file class.ilMailFolderGUI.php.

◆ $current_selected_cmd

ilMailFolderGUI::$current_selected_cmd
private

Definition at line 22 of file class.ilMailFolderGUI.php.

◆ $errorDelete

ilMailFolderGUI::$errorDelete = false
private

Definition at line 67 of file class.ilMailFolderGUI.php.

◆ $lng

ilMailFolderGUI::$lng
private

Definition at line 37 of file class.ilMailFolderGUI.php.

◆ $mbox

ilMailFolderGUI::$mbox

Definition at line 62 of file class.ilMailFolderGUI.php.

◆ $tabs

ilMailFolderGUI::$tabs
private

Definition at line 47 of file class.ilMailFolderGUI.php.

◆ $toolbar

ilMailFolderGUI::$toolbar
private

Definition at line 42 of file class.ilMailFolderGUI.php.

◆ $tpl

ilMailFolderGUI::$tpl
private

Definition at line 27 of file class.ilMailFolderGUI.php.

◆ $umail

ilMailFolderGUI::$umail

Definition at line 57 of file class.ilMailFolderGUI.php.

◆ $user

ilMailFolderGUI::$user
private

Definition at line 52 of file class.ilMailFolderGUI.php.


The documentation for this class was generated from the following file: