4 require_once 
"Services/Mail/classes/class.ilMail.php";
 
    5 require_once 
'Services/Mail/classes/class.ilMailFormCall.php';
 
   43                         $_GET[
'mobj_id'] = $_POST[
'mobj_id'];
 
   47                 $this->ctrl->saveParameter($this, 
"mobj_id");
 
   48                 $this->lng->loadLanguageModule(
"mail");
 
   50                 $this->umail = 
new ilMail($ilUser->getId());
 
   53                 if (!$rbacsystem->checkAccess(
'internal_mail', $this->umail->getMailObjectReferenceId()))
 
   55                         $ilErr->raiseError($this->lng->txt(
"permission_denied"), $ilErr->WARNING);
 
   64                 if($ilUser->getProfileIncomplete())
 
   71                 if( $ilUser->isPasswordChangeDemanded() || $ilUser->isPasswordExpired() )
 
   76                 if (
$_GET[
"type"] == 
"search_res")
 
   78                         $this->ctrl->setParameterByClass(
"ilmailformgui", 
"cmd", 
"searchResults");
 
   79                         $this->ctrl->redirectByClass(
"ilmailformgui");
 
   82                 if (
$_GET[
"type"] == 
"attach")
 
   86                         $this->ctrl->setParameterByClass(
"ilmailformgui", 
"cmd", 
"mailAttachment");
 
   87                         $this->ctrl->redirectByClass(
"ilmailformgui");
 
   90                 if (
$_GET[
"type"] == 
"new")
 
   98                         $this->ctrl->setParameterByClass(
"ilmailformgui", 
"cmd", 
"mailUser");
 
   99                         $this->ctrl->redirectByClass(
"ilmailformgui");
 
  102                 if (
$_GET[
"type"] == 
"reply")
 
  105                         $this->ctrl->setParameterByClass(
"ilmailformgui", 
"cmd", 
"replyMail");
 
  106                         $this->ctrl->redirectByClass(
"ilmailformgui");
 
  109                 if (
$_GET[
"type"] == 
"read")
 
  112                         $this->ctrl->setParameterByClass(
"ilmailfoldergui", 
"cmd", 
"showMail");
 
  113                         $this->ctrl->redirectByClass(
"ilmailfoldergui");
 
  116                 if (
$_GET[
"type"] == 
"deliverFile")
 
  120                         $this->ctrl->setParameterByClass(
"ilmailfoldergui", 
"cmd", 
"deliverFile");
 
  121                         $this->ctrl->redirectByClass(
"ilmailfoldergui");
 
  124                 if (
$_GET[
"type"] == 
"message_sent")
 
  127                         $this->ctrl->redirectByClass(
"ilmailfoldergui");
 
  130                 if (
$_GET[
"type"] == 
"role")
 
  132                         if (is_array(
$_POST[
'roles']))
 
  136                         else if (
$_GET[
"role"])
 
  143                         $this->ctrl->setParameterByClass(
"ilmailformgui", 
"cmd", 
"mailRole");
 
  144                         $this->ctrl->redirectByClass(
"ilmailformgui");
 
  147                 if (
$_GET[
"view"] == 
"my_courses")
 
  150                         $this->ctrl->setParameterByClass(
"ilmailformgui", 
"cmd", 
"searchCoursesTo");
 
  151                         $this->ctrl->redirectByClass(
"ilmailformgui");
 
  154                 if (isset(
$_GET[
"viewmode"]))
 
  157                         $this->ctrl->setCmd(
"setViewMode");
 
  160                 $this->forwardClass = $this->ctrl->getNextClass($this);
 
  161                 if ($this->ctrl->getCmd() != 
"showMenu" && $this->ctrl->getCmd() != 
"refresh")
 
  166                 include_once 
"Services/jQuery/classes/class.iljQueryUtil.php";
 
  169                 switch($this->forwardClass)
 
  171                         case 'ilmailformgui':
 
  172                                 include_once 
'Services/Mail/classes/class.ilMailFormGUI.php';
 
  177                         case 'ilmailaddressbookgui':
 
  178                                 include_once 
'Services/Contact/classes/class.ilMailAddressbookGUI.php';
 
  183                         case 'ilmailoptionsgui':
 
  184                                 include_once 
'Services/Mail/classes/class.ilMailOptionsGUI.php';
 
  189                         case 'ilmailfoldergui':
 
  190                                 include_once 
'Services/Mail/classes/class.ilMailFolderGUI.php';
 
  195                                 if (!(
$cmd = $this->ctrl->getCmd()))
 
  197                                         $cmd = 
"setViewMode";
 
  209                 if (
$_GET[
"target"] == 
"")
 
  211                         $_GET[
"target"] = 
"ilmailfoldergui";
 
  215                         include_once(
"Services/Frameset/classes/class.ilFramesetGUI.php");
 
  217                         $fs_gui->setFramesetTitle($this->lng->txt(
"mail"));
 
  218                         $fs_gui->setMainFrameName(
"content");
 
  219                         $fs_gui->setSideFrameName(
"tree");
 
  221                         $this->ctrl->setParameter($this, 
"cmd", 
"showMenu");
 
  222                         $this->ctrl->setParameter($this, 
"mexpand", 1);
 
  223                         $fs_gui->setSideFrameSource($this->ctrl->getLinkTarget($this));
 
  224                         $this->ctrl->clearParameters($this);
 
  226                         if (
$_GET[
"type"] == 
"add_subfolder")
 
  228                                 $fs_gui->setMainFrameSource($this->ctrl->getLinkTargetByClass(
$_GET[
"target"], 
"addSubFolder"));
 
  230                         else if (
$_GET[
"type"] == 
"enter_folderdata")
 
  232                                 $fs_gui->setMainFrameSource($this->ctrl->getLinkTargetByClass(
$_GET[
"target"], 
"enterFolderData"));
 
  234                         else if (
$_GET[
"type"] == 
"confirmdelete_folderdata")
 
  236                                 $fs_gui->setMainFrameSource($this->ctrl->getLinkTargetByClass(
$_GET[
"target"], 
"confirmDeleteFolder"));
 
  240                                 $fs_gui->setMainFrameSource($this->ctrl->getLinkTargetByClass(
$_GET[
"target"]));
 
  247                         $this->ctrl->redirectByClass(
$_GET[
"target"]);
 
  258                 global $ilMainMenu, $ilTabs, $ilHelp;
 
  260                 $ilHelp->setScreenIdComponent(
"mail");
 
  262                 $ilMainMenu->setActive(
"mail");
 
  265                 $this->tpl->addBlockFile(
"CONTENT", 
"content", 
"tpl.adm_content.html");
 
  266                 $this->tpl->addBlockFile(
"STATUSLINE", 
"statusline", 
"tpl.statusline.html");
 
  272                 $ilTabs->addTarget(
'fold', $this->ctrl->getLinkTargetByClass(
'ilmailfoldergui'));               
 
  273                 $this->ctrl->setParameterByClass(
'ilmailformgui', 
'type', 
'new');
 
  274                 $ilTabs->addTarget(
'compose', $this->ctrl->getLinkTargetByClass(
'ilmailformgui'));
 
  275                 $this->ctrl->clearParametersByClass(
'ilmailformgui');
 
  276                 $ilTabs->addTarget(
'mail_addressbook', $this->ctrl->getLinkTargetByClass(
'ilmailaddressbookgui'));
 
  277                 $ilTabs->addTarget(
'options', $this->ctrl->getLinkTargetByClass(
'ilmailoptionsgui'));
 
  279                 switch($this->forwardClass)
 
  281                         case 'ilmailformgui':
 
  282                                 $ilTabs->setTabActive(
'compose');
 
  285                         case 'ilmailaddressbookgui':
 
  286                                 $ilTabs->setTabActive(
'mail_addressbook');
 
  289                         case 'ilmailoptionsgui':
 
  290                                 $ilTabs->setTabActive(
'options');
 
  293                         case 'ilmailfoldergui':
 
  295                                 $ilTabs->setTabActive(
'fold');
 
  299                 if(isset(
$_GET[
'message_sent'])) $ilTabs->setTabActive(
'fold');
 
  303                         $this->ctrl->setParameter($this, 
'viewmode', 
'tree');
 
  304                         $this->tpl->setTreeFlatIcon($this->ctrl->getLinkTarget($this), 
'tree');
 
  308                         $this->ctrl->setParameter($this, 
'viewmode', 
'flat');
 
  309                         $this->tpl->setTreeFlatIcon($this->ctrl->getLinkTarget($this), 
'flat');
 
  311                 $this->ctrl->clearParameters($this);
 
  312                 $this->tpl->setCurrentBlock(
"tree_icons");
 
  313                 $this->tpl->parseCurrentBlock();
 
  320                 require_once 
"Services/Mail/classes/class.ilMailExplorer.php";
 
  322                 $this->tpl->addBlockFile(
"CONTENT", 
"content", 
"tpl.explorer.html");
 
  325                 $this->exp = 
new ilMailExplorer($this->ctrl->getLinkTargetByClass(
"ilmailfoldergui"),$ilUser->getId());
 
  328                 if (
$_GET[
"mexpand"] == 
"")
 
  330                         $this->mtree = 
new ilTree($ilUser->getId());
 
  332                         $expanded = $this->mtree->readRootId();
 
  335                         $expanded = 
$_GET[
"mexpand"];
 
  337                 $this->exp->setExpand($expanded);
 
  340                 $this->exp->setOutput(0);
 
  341                 $this->output = $this->exp->getOutput();
 
  343                 $this->tpl->setCurrentBlock(
"content");
 
  344                 $this->tpl->setVariable(
"TXT_EXPLORER_HEADER", $this->lng->txt(
"mail_folders"));
 
  345                 $this->tpl->setVariable(
"EXP_REFRESH", $this->lng->txt(
"refresh"));
 
  346                 $this->tpl->setVariable(
"EXPLORER",$this->output);
 
  347                 $this->ctrl->setParameter($this, 
"mexpand", 
$_GET[
"mexpand"]);
 
  348                 $this->tpl->setVariable(
"ACTION", $this->ctrl->getFormAction($this, 
'showMenu'));
 
  349                 $this->tpl->parseCurrentBlock();
 
  351                 $this->tpl->show(
false);