5 require_once 
'Services/User/classes/class.ilObjUser.php';
 
    6 require_once 
'Services/Mail/classes/class.ilMailbox.php';
 
    7 require_once 
'Services/Mail/classes/class.ilMail.php';
 
   43                 $this->umail = 
new ilMail($ilUser->getId());
 
   44                 $this->mbox = 
new ilMailBox($ilUser->getId());
 
   48                         $_GET[
'mobj_id'] = $_POST[
'mobj_id'];
 
   51                 if(!(
int)
$_GET[
'mobj_id'])
 
   53                         $_GET[
'mobj_id'] = $this->mbox->getInboxFolder();
 
   55                 $ilCtrl->saveParameter($this, 
'mobj_id');
 
   56                 $ilCtrl->setParameter($this, 
'mobj_id', 
$_GET[
'mobj_id']);
 
   64                         $_GET[
"cmd"] = 
'editFolder';
 
   67                         $this->current_select_cmd = 
$_POST[
'select_cmd'];
 
   68                         $this->current_selected_cmd = 
$_POST[
'selected_cmd'];
 
   70                 else if (
$_POST[
"select_cmd2"])
 
   73                         $_GET[
"cmd"] = 
'editFolder';
 
   74                         $this->current_select_cmd = 
$_POST[
'select_cmd2'];
 
   75                         $this->current_selected_cmd = 
$_POST[
'selected_cmd2'];
 
   81                 if (
$_GET[
'selected_cmd'] == 
"deleteMails" && 
$_GET[
"mail_id"])
 
   83                         $_GET[
"cmd"] = 
"editFolder";
 
   84                         $this->current_selected_cmd = 
"deleteMails";
 
   91                 $cmd = $this->ctrl->getCmd();
 
   92                 if(
$cmd == 
'changeFolder' && 
 
   93                    is_numeric(
$_POST[
'selected_cmd']) && 
 
   96                         $this->current_selected_cmd = (int)
$_POST[
'selected_cmd'];
 
   99                 $forward_class = $this->ctrl->getNextClass($this);              
 
  100                 switch($forward_class)
 
  102                         case 'ilmailaddressbookgui':
 
  103                                 include_once 
'Services/Contact/classes/class.ilMailAddressbookGUI.php';
 
  108                         case 'ilmailoptionsgui':
 
  109                                 include_once 
'Services/Mail/classes/class.ilMailOptionsGUI.php';
 
  114                         case 'ilpublicuserprofilegui':
 
  115                                 include_once(
"Services/User/classes/class.ilPublicUserProfileGUI.php");
 
  116                                 $this->tpl->setTitle($this->lng->txt(
"mail"));
 
  117                                 $this->ctrl->saveParameter($this, 
"mail_id");
 
  119                                 $profile_gui->setBackUrl($this->ctrl->getLinkTarget($this, 
"showMail"));
 
  120                                 $ret = $this->ctrl->forwardCommand($profile_gui);
 
  123                                         $this->tpl->setContent(
$ret);
 
  129                                 if (!(
$cmd = $this->ctrl->getCmd()))
 
  141                 global 
$lng, $ilUser;
 
  143                 if(
$_GET[
"mail_id"] != 
"")
 
  145                         if (is_array($mail_data = $this->umail->getMail(
$_GET[
"mail_id"])))
 
  147                                 require_once 
"Services/Contact/classes/class.ilAddressbook.php";
 
  150                                 $tmp_user = 
new ilObjUser($mail_data[
"sender_id"]);
 
  151                                 if ($abook->checkEntryByLogin($tmp_user->getLogin()) > 0)
 
  157                                         $abook->addEntry($tmp_user->getLogin(),
 
  158                                                                 $tmp_user->getFirstname(),
 
  159                                                                 $tmp_user->getLastname(),
 
  160                                                                 $tmp_user->getEmail());
 
  183                 $this->umail->deleteMailsOfFolder(
$_GET[
"mobj_id"]); 
 
  196                 if($this->umail->countMailsOfFolder((
int)
$_GET[
'mobj_id']))
 
  199                         $this->askForConfirmation = 
true;
 
  211                 $this->ctrl->setParameter($this, 
"mail_id", 
$_GET[
"mail_id"]);
 
  213                 $this->tpl->setTitle($this->lng->txt(
"mail"));
 
  216                 $this->tpl->setVariable(
"TBL_TITLE", $this->lng->txt(
"profile_of").
" ".
 
  219                 $this->tpl->setVariable(
"TBL_TITLE_IMG_ALT", $this->lng->txt(
"public_profile"));
 
  221                 include_once 
'./Services/User/classes/class.ilPublicUserProfileGUI.php';                
 
  223                 $profile_gui->setBackUrl($this->ctrl->getLinkTarget($this, 
"showMail"));
 
  224                 $this->tpl->setContent($ilCtrl->getHTML($profile_gui));
 
  237                 $this->tpl->addBlockFile(
'ADM_CONTENT', 
'adm_content', 
'tpl.mail.html', 
'Services/Mail');
 
  238                 $this->tpl->setVariable(
'HEADER', $this->lng->txt(
'mail'));
 
  240                 include_once 
'Services/Mail/classes/class.ilMailFolderTableGUI.php';
 
  242                 $sentFolderId = $this->mbox->getSentFolder();
 
  243                 $draftsFolderId = $this->mbox->getDraftsFolder();
 
  245                 $isTrashFolder = 
$_GET[
'mobj_id'] == $this->mbox->getTrashFolder();
 
  246                 $isSentFolder = 
$_GET[
'mobj_id'] == $sentFolderId;      
 
  247                 $isDraftFolder = 
$_GET[
'mobj_id'] == $draftsFolderId;           
 
  250                 if($this->current_selected_cmd == 
'deleteMails' &&
 
  251                         !$this->errorDelete &&
 
  252                         $this->current_selected_cmd != 
'confirm' &&
 
  256                         foreach((array)
$_REQUEST[
'mail_id'] as $id)
 
  258                                 $this->tpl->setCurrentBlock(
'mail_ids');
 
  259                                 $this->tpl->setVariable(
'MAIL_ID_VALUE', $id);
 
  260                                 $this->tpl->parseCurrentBlock();
 
  263                         $this->tpl->setCurrentBlock(
'confirm_delete');
 
  264                         $this->tpl->setVariable(
'ACTION', $this->ctrl->getFormAction($this, 
'confirmDeleteMails'));
 
  265                         $this->tpl->setVariable(
'BUTTON_CONFIRM',$this->lng->txt(
'confirm'));
 
  266                         $this->tpl->setVariable(
'BUTTON_CANCEL',$this->lng->txt(
'cancel'));                     
 
  267                         $this->tpl->parseCurrentBlock();
 
  271                 $mailtable->isSentFolder($isSentFolder)
 
  272                                   ->isDraftFolder($isDraftFolder)
 
  273                                   ->isTrashFolder($isTrashFolder)
 
  274                                   ->setSelectedItems(
$_POST[
'mail_id'])
 
  278                 $folders = $this->mbox->getSubFolders();
 
  279                 $mtree = 
new ilTree($ilUser->getId());
 
  283                         foreach($folders as $folder)
 
  285                                 $this->tpl->setCurrentBLock(
'flat_select');
 
  286                                 $folder_d = $mtree->getNodeData($folder[
'obj_id']);
 
  287                                 if($folder[
'obj_id'] == $_GET[
'mobj_id'])
 
  289                                         $this->tpl->setVariable(
'FLAT_SELECTED', 
' selected="selected"');
 
  291                                 $this->tpl->setVariable(
'FLAT_VALUE', $folder[
'obj_id']);
 
  292                                 if($folder[
'type'] == 
'user_folder')
 
  295                                         for ($i = 2; $i < $folder_d[
'depth'] - 1; $i++)
 
  297                                         if ($folder_d[
'depth'] > 1)
 
  299                                         $this->tpl->setVariable(
'FLAT_NAME', $pre.
' '.$folder[
'title']);
 
  303                                         $this->tpl->setVariable(
'FLAT_NAME', $this->lng->txt(
'mail_'.$folder[
'title']));
 
  305                                 $this->tpl->parseCurrentBlock();
 
  308                         $this->tpl->setCurrentBlock(
'show_folder');
 
  309                         $this->tpl->setVariable(
'TXT_FOLDERS', $this->lng->txt(
'mail_change_to_folder'));
 
  311                         $this->tpl->setVariable(
'FOLDER_VALUE', $this->lng->txt(
'change'));
 
  312                         $this->tpl->setVariable(
'ACTION_FLAT', $this->ctrl->getFormAction($this, 
'showFolder'));
 
  313                         $this->tpl->parseCurrentBlock();                        
 
  318                 if($mailtable->isTrashFolder() && 
 
  319                    $mailtable->getNumerOfMails() > 0)
 
  321                         if($this->askForConfirmation == 
true)
 
  323                                 $this->tpl->setCurrentBlock(
'CONFIRM_EMPTY_TRASH');
 
  324                 $this->tpl->setVariable(
'ACTION_EMPTY_TRASH_CONFIRMATION', $this->ctrl->getFormAction($this, 
'performEmptyTrash'));
 
  325                 $this->tpl->setVariable(
'BUTTON_CONFIRM_EMPTY_TRASH', $this->lng->txt(
'confirm'));
 
  326                 $this->tpl->setVariable(
'BUTTON_CANCEL_EMPTY_TRASH', $this->lng->txt(
'cancel'));
 
  327                 $this->tpl->parseCurrentBlock();
 
  332                 $this->tpl->setVariable(
'MAIL_TABLE', $mailtable->getHtml());
 
  340                         ilUtil::redirect(
"ilias.php?baseClass=ilMailGUI&mobj_id=".
$_GET[
"mobj_id"].
"&type=confirmdelete_folderdata");
 
  361                 $new_parent = $this->mbox->getParentFolderId(
$_GET[
"mobj_id"]);
 
  363                 if ($this->mbox->deleteFolder(
$_GET[
"mobj_id"]))
 
  373                                 ilUtil::redirect(
"ilias.php?baseClass=ilMailGUI&mobj_id=".
$_GET[
"mobj_id"].
"&type=confirmdelete_folderdata");                                   
 
  389                         ilUtil::redirect(
"ilias.php?baseClass=ilMailGUI&mobj_id=".
$_GET[
"mobj_id"].
"&type=enter_folderdata");                                   
 
  402                         ilUtil::redirect(
"ilias.php?baseClass=ilMailGUI&mobj_id=".
$_GET[
"mobj_id"].
"&target=ilmailfoldergui");                                  
 
  415                 $tmp_data = $this->mbox->getFolderData(
$_GET[
"mobj_id"]);
 
  416                 if ($tmp_data[
"title"] != 
$_POST[
"folder_name_add"])
 
  418                         if (
$_POST[
"folder_name_add"] == 
"")
 
  423                                         ilUtil::redirect(
"ilias.php?baseClass=ilMailGUI&mobj_id=".
$_GET[
"mobj_id"].
"&type=enter_folderdata");                                   
 
  444                                                 ilUtil::redirect(
"ilias.php?baseClass=ilMailGUI&mobj_id=".
$_GET[
"mobj_id"].
"&type=enter_folderdata");                                   
 
  458                         ilUtil::redirect(
"ilias.php?baseClass=ilMailGUI&mobj_id=".
$_GET[
"mobj_id"].
"&type=enter_folderdata");                                   
 
  473                 if (empty(
$_POST[
'folder_name_add']))
 
  489                         $ilCtrl->saveParameter($this, 
'mobj_id');
 
  490                         $ilCtrl->setParameter($this, 
'mobj_id', 
$_GET[
'mobj_id']);
 
  533                 $mtree = 
new ilTree($ilUser->getId());
 
  535                 $folder_node = $mtree->getNodeData(
$_GET[mobj_id]);
 
  537                 $this->tpl->addBlockFile(
"ADM_CONTENT", 
"adm_content", 
"tpl.mail_edit_user_folder.html",
'Services/Mail');
 
  541                         $this->tpl->setCurrentBlock(
"confirm_delete");
 
  542                         $this->ctrl->setParameter($this, 
"cmd", 
"post");
 
  543                         $this->tpl->setVariable(
"ACTION_DELETE", $this->ctrl->getFormAction($this));
 
  545                         $this->ctrl->clearParameters($this);
 
  546                         $this->tpl->setVariable(
"TXT_DELETE_CONFIRM",$this->lng->txt(
"confirm"));
 
  547                         $this->tpl->setVariable(
"TXT_DELETE_CANCEL",$this->lng->txt(
"cancel"));                 
 
  548                         $this->tpl->parseCurrentBlock();
 
  551                 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");            
 
  553                 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
 
  556                 if (
$cmd == 
"saveFolderSettings")
 
  558                         $this->tpl->setVariable(
"TXT_HEADLINE", $this->lng->txt(
'mail_folder_edit'));
 
  559                         $this->tpl->setVariable(
"TXT_TITLE", $this->lng->txt(
'name'));
 
  560                         $this->tpl->setVariable(
"TXT_DELETE", $this->lng->txt(
'delete'));
 
  568                         $this->tpl->setVariable(
"TXT_HEADLINE", $this->lng->txt(
'mail_add_subfolder'));
 
  569                         $this->tpl->setVariable(
"TXT_TITLE", $this->lng->txt(
'name'));
 
  577                 $this->tpl->setVariable(
"CMD_SUBMIT", 
$cmd);
 
  578                 $this->tpl->setVariable(
"TXT_SUBMIT", (
$cmd == 
"saveSubFolderSettings" ? $this->lng->txt(
'save') : $this->lng->txt(
'rename')));         
 
  579                 $this->tpl->setVariable(
"TITLE_VALUE", $title_value);
 
  580                 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
'cancel'));
 
  582                 $this->tpl->setVariable(
"HEADER", $this->lng->txt(
"mail"));
 
  590                 switch ($this->current_selected_cmd)
 
  593                                 if(!(
int)
$_GET[
"mail_id"] || !(
int)$this->current_selected_cmd)
 
  598                                 if ($this->umail->moveMailsToFolder(array(
$_GET[
"mail_id"]), $this->current_selected_cmd))
 
  601                                         $this->ctrl->redirectByClass(
"ilMailGUI");
 
  617                 switch ($this->current_selected_cmd)
 
  619                         case 'markMailsRead':
 
  620                                 if(is_array(
$_POST[
"mail_id"]))
 
  622                                         $this->umail->markRead(
$_POST[
"mail_id"]);
 
  629                         case 'markMailsUnread':
 
  630                                 if(is_array(
$_POST[
"mail_id"]))
 
  632                                         $this->umail->markUnread(
$_POST[
"mail_id"]);
 
  642                                 if($this->mbox->getTrashFolder() == 
$_GET[
"mobj_id"])
 
  644                                         if(!is_array(
$_POST[
"mail_id"]))
 
  647                                                 $this->errorDelete = 
true;
 
  657                                         if(!is_array(
$_POST[
"mail_id"]))
 
  661                                         else if($this->umail->moveMailsToFolder(
$_POST[
"mail_id"], $this->mbox->getTrashFolder()))
 
  674                                 $this->ctrl->setParameterByClass(
"ilmailoptionsgui", 
"cmd", 
"add");
 
  675                                 $this->ctrl->redirectByClass(
"ilmailoptionsgui");
 
  679                                 if(!is_array(
$_POST[
"mail_id"]))
 
  683                                 else if($this->umail->moveMailsToFolder(
$_POST[
"mail_id"],$this->current_selected_cmd))
 
  700                 if($this->mbox->getTrashFolder() == 
$_GET[
"mobj_id"])
 
  702                         if(!is_array(
$_POST[
"mail_id"]))
 
  706                         else if($this->umail->deleteMails(
$_POST[
"mail_id"]))
 
  723                 $this->ctrl->redirect($this);
 
  736                 $this->umail->markRead(array(
$_GET[
"mail_id"]));
 
  738                 $mailData = $this->umail->getMail(
$_GET[
"mail_id"]);
 
  740                 $this->tpl->addBlockFile(
"ADM_CONTENT", 
"adm_content", 
"tpl.mail_read.html", 
"Services/Mail");
 
  741                 $this->tpl->setVariable(
"HEADER",$this->lng->txt(
"mail_mails_of"));
 
  745                 include_once(
"./Services/Accessibility/classes/class.ilAccessKeyGUI.php");
 
  749                 include_once(
"./Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php");
 
  751                 if($mailData[
"sender_id"] &&
 
  752                    $mailData[
"sender_id"] != ANONYMOUS_USER_ID)
 
  754                         $this->ctrl->setParameterByClass(
"ilmailformgui", 
"mail_id", 
$_GET[
"mail_id"]);
 
  755                         $this->ctrl->setParameterByClass(
"ilmailformgui", 
"type", 
"reply");
 
  756                         $this->ctrl->clearParametersByClass(
"iliasmailformgui");
 
  758                         $toolbar->addButton($this->lng->txt(
"reply"), $this->ctrl->getLinkTargetByClass(
"ilmailformgui"),
 
  763                 $this->ctrl->setParameterByClass(
"ilmailformgui", 
"mail_id", 
$_GET[
"mail_id"]);
 
  764                 $this->ctrl->setParameterByClass(
"ilmailformgui", 
"type", 
"forward");
 
  765                 $this->ctrl->clearParametersByClass(
"iliasmailformgui");
 
  766                 $toolbar->addButton($this->lng->txt(
"forward"), $this->ctrl->getLinkTargetByClass(
"ilmailformgui"),
 
  770                 $this->ctrl->setParameter($this, 
"mail_id", 
$_GET[
"mail_id"]);
 
  771                 $this->ctrl->setParameter($this, 
"cmd", 
"printMail");
 
  772                 $toolbar->addButton($this->lng->txt(
"print"), $this->ctrl->getLinkTarget($this),
 
  774                 $this->ctrl->clearParameters($this);
 
  777                 $this->ctrl->setParameter($this, 
"mail_id", 
$_GET[
"mail_id"]);
 
  778                 $this->ctrl->setParameter($this, 
"selected_cmd", 
"deleteMails");
 
  779                 $toolbar->addButton($this->lng->txt(
"delete"), $this->ctrl->getLinkTarget($this),
 
  781                 $this->ctrl->clearParameters($this);
 
  783                 $this->tpl->setVariable(
"BUTTONS2",$toolbar->getHTML());
 
  785                 $this->ctrl->setParameter($this, 
"mail_id", 
$_GET[
"mail_id"]);
 
  786                 $this->tpl->setVariable(
"ACTION", $this->ctrl->getFormAction($this));
 
  787                 $this->ctrl->clearParameters($this);
 
  789                 if ($mailData[
"sender_id"] && 
 
  790                     $mailData[
"sender_id"] != $ilUser->getId() && 
 
  791                         $mailData[
"sender_id"] != ANONYMOUS_USER_ID)
 
  793                         require_once 
"Services/Contact/classes/class.ilAddressbook.php";
 
  795                         $tmp_user = 
new ilObjUser($mailData[
"sender_id"]);
 
  796                         if ($abook->checkEntryByLogin($tmp_user->getLogin()) == 0)
 
  800                                 $tplbtn->setCurrentBlock(
"btn_cell");
 
  801                                 $this->ctrl->setParameter($this, 
"mail_id", 
$_GET[
"mail_id"]);
 
  802                                 $this->ctrl->setParameter($this, 
"cmd", 
"add");
 
  803                                 $tplbtn->setVariable(
"BTN_LINK", $this->ctrl->getLinkTarget($this));
 
  804                                 $this->ctrl->clearParameters($this);
 
  805                                 $tplbtn->setVariable(
"BTN_TXT", $this->lng->txt(
"mail_add_to_addressbook"));
 
  808                                 $this->tpl->setVariable(
"ADD_USER_BTN",
$tplbtn->get());
 
  816                 if($mailData[
"sender_id"] != ANONYMOUS_USER_ID)
 
  818                         $tmp_user = 
new ilObjUser($mailData[
'sender_id']);              
 
  819                         $this->ctrl->setParameter($this, 
'mail_id', 
$_GET[
'mail_id']);
 
  820                         $this->ctrl->setParameter($this, 
'user', $tmp_user->getId());                           
 
  823                                 $this->tpl->setVariable(
'PROFILE_LINK_FROM', $this->ctrl->getLinkTarget($this, 
'showUser'));
 
  824                                 $this->tpl->setVariable(
'FROM', $tmp_user->getFullname());
 
  826                         $this->tpl->setCurrentBlock(
"pers_image");
 
  827                         $this->tpl->setVariable(
"IMG_SENDER", $tmp_user->getPersonalPicturePath(
"xsmall"));
 
  828                         $this->tpl->setVariable(
"ALT_SENDER", $tmp_user->getFullname());
 
  829                         $this->tpl->parseCurrentBlock();
 
  830                         $this->tpl->setCurrentBlock(
"adm_content");             
 
  831                         if(!($login = $tmp_user->getLogin()))
 
  833                                 $login = $mailData[
"import_name"].
" (".$this->lng->txt(
"user_deleted").
")";
 
  835                         $this->tpl->setVariable(
"MAIL_LOGIN",$login);
 
  836                         $this->tpl->setVariable(
"CSSROW_FROM", (++$counter) % 2 ? 
'tblrow1' : 
'tblrow2');
 
  840                         $tmp_user = 
new ilObjUser(ANONYMOUS_USER_ID);           
 
  841                         $this->tpl->setVariable(
'MAIL_LOGIN', ilMail::_getIliasMailerName());
 
  842                         $this->tpl->setCurrentBlock(
'pers_image');
 
  844                         $this->tpl->setVariable(
'ALT_SENDER', ilMail::_getIliasMailerName());
 
  845                         $this->tpl->parseCurrentBlock();
 
  848                 $this->tpl->setVariable(
'TXT_FROM', $this->lng->txt(
'from'));
 
  851                 $this->tpl->setVariable(
'TXT_TO', $this->lng->txt(
'mail_to'));          
 
  854                 $this->tpl->setVariable(
'CSSROW_TO', (++$counter) % 2 ? 
'tblrow1' : 
'tblrow2');
 
  857                 if($mailData[
'rcp_cc'])
 
  859                         $this->tpl->setCurrentBlock(
'cc');
 
  860                         $this->tpl->setVariable(
'TXT_CC',$this->lng->txt(
'cc'));
 
  863                         $this->tpl->setVariable(
'CSSROW_CC', (++$counter) % 2 ? 
'tblrow1' : 
'tblrow2');
 
  864                         $this->tpl->parseCurrentBlock();
 
  868                 if($mailData[
'rcp_bcc'])
 
  870                         $this->tpl->setCurrentBlock(
'bcc');
 
  871                         $this->tpl->setVariable(
'TXT_BCC',$this->lng->txt(
'bc'));
 
  874                         $this->tpl->setVariable(
'CSSROW_BCC', (++$counter) % 2 ? 
'tblrow1' : 
'tblrow2');
 
  875                         $this->tpl->parseCurrentBlock();
 
  879                 $this->tpl->setVariable(
'TXT_SUBJECT', $this->lng->txt(
'subject'));
 
  882                 $this->tpl->setVariable(
'CSSROW_SUBJ', (++$counter) % 2 ? 
'tblrow1' : 
'tblrow2');
 
  885                 $this->tpl->setVariable(
'TXT_DATE', $this->lng->txt(
'date'));
 
  887                 $this->tpl->setVariable(
'CSSROW_DATE', (++$counter) % 2 ? 
'tblrow1' : 
'tblrow2');
 
  890                 if($mailData[
'attachments'])
 
  892                         $this->tpl->setCurrentBlock(
'attachment');
 
  893                         $this->tpl->setCurrentBlock(
'a_row');
 
  895                         foreach($mailData[
'attachments'] as 
$file)
 
  897                                 $this->tpl->setVariable(
'A_CSSROW', (++$counter) % 2 ? 
'tblrow1' : 
'tblrow2');
 
  898                                 $this->tpl->setVariable(
'FILE', md5($file));
 
  899                                 $this->tpl->setVariable(
'FILE_NAME', $file);
 
  900                                 $this->tpl->parseCurrentBlock();
 
  902                         $this->tpl->setVariable(
'TXT_ATTACHMENT', $this->lng->txt(
'attachments'));
 
  903                         $this->tpl->setVariable(
'TXT_DOWNLOAD', $this->lng->txt(
'download'));
 
  904                         $this->tpl->parseCurrentBlock();
 
  908                 $this->tpl->setVariable(
'TXT_MESSAGE', $this->lng->txt(
'message'));
 
  913                 $isTrashFolder = 
false;
 
  914                 if ($this->mbox->getTrashFolder() == 
$_GET[
'mobj_id'])
 
  916                         $isTrashFolder = 
true;
 
  922                 $selectOptions = array();               
 
  923                 $actions = $this->mbox->getActions(
$_GET[
"mobj_id"]);                           
 
  924                 foreach($actions as $key => $action)
 
  926                         if($key == 
'moveMails')
 
  928                                 $folders = $this->mbox->getSubFolders();
 
  929                                 foreach($folders as $folder)
 
  931                                         if ($folder[
"type"] != 
'trash' ||
 
  935                                                 if($folder[
'type'] != 
'user_folder')
 
  937                                                         $optionText = $action.
' '.$this->lng->txt(
'mail_'.$folder[
'title']).($folder[
'type'] == 
'trash' ? 
' ('.$this->lng->txt(
'delete').
')' : 
'');
 
  941                                                         $optionText = $action.
' '.$folder[
'title'];
 
  944                                                 $selectOptions[$folder[
'obj_id']] = $optionText;
 
  949                 if(is_array($selectOptions) && count($selectOptions))
 
  951                         include_once 
'Services/Form/classes/class.ilSelectInputGUI.php';
 
  953                         $oActionSelectBox->setOptions($selectOptions);
 
  954                         $oBottomToolbar->addInputItem($oActionSelectBox);
 
  955                         $oBottomToolbar->addFormButton($this->lng->txt(
'submit'), 
'changeFolder');
 
  959                 $prevMail = $this->umail->getPreviousMail(
$_GET[
'mail_id']);
 
  960                 $nextMail = $this->umail->getNextMail(
$_GET[
'mail_id']);                
 
  961                 if(is_array($prevMail) || is_array($nextMail))
 
  963                         $oBottomToolbar->addSeparator();
 
  965                         if($prevMail[
'mail_id'])
 
  967                                 $this->ctrl->setParameter($this, 
'mail_id', $prevMail[
'mail_id']);
 
  968                                 $this->ctrl->setParameter($this, 
'cmd', 
'showMail');                            
 
  969                                 $oBottomToolbar->addButton($this->lng->txt(
'previous'), $this->ctrl->getLinkTarget($this));
 
  970                                 $this->ctrl->clearParameters($this);
 
  973                         if($nextMail[
'mail_id'])
 
  975                                 $this->ctrl->setParameter($this, 
'mail_id', $nextMail[
'mail_id']);
 
  976                                 $this->ctrl->setParameter($this, 
'cmd', 
'showMail');
 
  977                                 $oBottomToolbar->addButton($this->lng->txt(
'next'), $this->ctrl->getLinkTarget($this));
 
  978                                 $this->ctrl->clearParameters($this);
 
  982                 $this->tpl->setVariable(
'MAIL_NAVIGATION', $oBottomToolbar->getHTML());
 
  988                 $tplprint = 
new ilTemplate(
"Services/Mail/templates/default/tpl.mail_print.html",
true,
true,
true);
 
  989                 $tplprint->setVariable(
"JSPATH",
$tpl->tplPath);
 
  992                 $mailData = $this->umail->getMail(
$_GET[
"mail_id"]);
 
  996                 if($mailData[
"sender_id"] != ANONYMOUS_USER_ID)
 
  998                         $tmp_user = 
new ilObjUser($mailData[
"sender_id"]);
 
  999                         if(!($login = $tmp_user->getFullname()))
 
 1001                                 $login = $mailData[
"import_name"].
" (".$this->lng->txt(
"user_deleted").
")";
 
 1003                         $tplprint->setVariable(
"FROM", $login);
 
 1007                         $tplprint->setVariable(
'FROM', ilMail::_getIliasMailerName());
 
 1010                 $tplprint->setVariable(
'TXT_FROM', $this->lng->txt(
'from'));
 
 1013                 $tplprint->setVariable(
"TXT_TO", $this->lng->txt(
"mail_to"));
 
 1014                 $tplprint->setVariable(
"TO", $mailData[
"rcp_to"]);
 
 1017                 if($mailData[
"rcp_cc"])
 
 1019                         $tplprint->setCurrentBlock(
"cc");
 
 1020                         $tplprint->setVariable(
"TXT_CC",$this->lng->txt(
"cc"));
 
 1021                         $tplprint->setVariable(
"CC",$mailData[
"rcp_cc"]);
 
 1022                         $tplprint->parseCurrentBlock();
 
 1025                 $tplprint->setVariable(
"TXT_SUBJECT",$this->lng->txt(
"subject"));
 
 1026                 $tplprint->setVariable(
"SUBJECT",htmlspecialchars($mailData[
"m_subject"]));
 
 1029                 $tplprint->setVariable(
"TXT_DATE", $this->lng->txt(
"date"));
 
 1034                 $tplprint->setVariable(
"TXT_MESSAGE", $this->lng->txt(
"message"));
 
 1035                 $tplprint->setVariable(
"MAIL_MESSAGE", nl2br(htmlspecialchars($mailData[
"m_message"])));
 
 1053                                                         : 
$_GET[
"filename"]));
 
 1058                         require_once 
"classes/class.ilFileDataMail.php";
 
 1064                         if(!is_array(
$file = $mfile->getAttachmentPathByMD5Filename(
$filename, 
$_GET[
'mail_id'])))