24 require_once 
"Services/Mail/classes/class.ilMail.php";
 
   25 require_once 
'Services/Mail/classes/class.ilMailFormCall.php';
 
   58                         $_GET[
'mobj_id'] = $_POST[
'mobj_id'];
 
   61                 $this->ctrl->saveParameter($this, 
"mobj_id");
 
   62                 $this->lng->loadLanguageModule(
"mail");
 
   64                 $this->umail = 
new ilMail($ilUser->getId());
 
   67                 if (!$rbacsystem->checkAccess(
"mail_visible", $this->umail->getMailObjectReferenceId()))
 
   69                         $ilErr->raiseError($this->lng->txt(
"permission_denied"), $ilErr->WARNING);
 
   78                 if($ilUser->getProfileIncomplete())
 
   85                 if( $ilUser->isPasswordChangeDemanded() || $ilUser->isPasswordExpired() )
 
   90                 if (
$_GET[
"type"] == 
"search_res")
 
   92                         $this->ctrl->setParameterByClass(
"ilmailformgui", 
"cmd", 
"searchResults");
 
   93                         $this->ctrl->redirectByClass(
"ilmailformgui");
 
   96                 if (
$_GET[
"type"] == 
"attach")
 
  100                         $this->ctrl->setParameterByClass(
"ilmailformgui", 
"cmd", 
"mailAttachment");
 
  101                         $this->ctrl->redirectByClass(
"ilmailformgui");
 
  104                 if (
$_GET[
"type"] == 
"new")
 
  112                         $this->ctrl->setParameterByClass(
"ilmailformgui", 
"cmd", 
"mailUser");
 
  113                         $this->ctrl->redirectByClass(
"ilmailformgui");
 
  116                 if (
$_GET[
"type"] == 
"reply")
 
  119                         $this->ctrl->setParameterByClass(
"ilmailformgui", 
"cmd", 
"replyMail");
 
  120                         $this->ctrl->redirectByClass(
"ilmailformgui");
 
  123                 if (
$_GET[
"type"] == 
"read")
 
  126                         $this->ctrl->setParameterByClass(
"ilmailfoldergui", 
"cmd", 
"showMail");
 
  127                         $this->ctrl->redirectByClass(
"ilmailfoldergui");
 
  130                 if (
$_GET[
"type"] == 
"deliverFile")
 
  134                         $this->ctrl->setParameterByClass(
"ilmailfoldergui", 
"cmd", 
"deliverFile");
 
  135                         $this->ctrl->redirectByClass(
"ilmailfoldergui");
 
  138                 if (
$_GET[
"type"] == 
"message_sent")
 
  141                         $this->ctrl->redirectByClass(
"ilmailfoldergui");
 
  144                 if (
$_GET[
"type"] == 
"role")
 
  146                         if (is_array(
$_POST[
'roles']))
 
  150                         else if (
$_GET[
"role"])
 
  157                         $this->ctrl->setParameterByClass(
"ilmailformgui", 
"cmd", 
"mailRole");
 
  158                         $this->ctrl->redirectByClass(
"ilmailformgui");
 
  161                 if (
$_GET[
"view"] == 
"my_courses")
 
  164                         $this->ctrl->setParameterByClass(
"ilmailformgui", 
"cmd", 
"searchCoursesTo");
 
  165                         $this->ctrl->redirectByClass(
"ilmailformgui");
 
  168                 if (isset(
$_GET[
"viewmode"]))
 
  171                         $this->ctrl->setCmd(
"setViewMode");
 
  174                 $this->forwardClass = $this->ctrl->getNextClass($this);
 
  175                 if ($this->ctrl->getCmd() != 
"showMenu" && $this->ctrl->getCmd() != 
"refresh")
 
  180                 switch($this->forwardClass)
 
  182                         case 'ilmailmenugui':
 
  183                                 include_once 
'Services/Mail/classes/class.ilMailMenuGUI.php';
 
  185                                 $this->ctrl->forwardCommand(
new ilMailMenuGUI());
 
  188                         case 'ilmailformgui':
 
  189                                 include_once 
'Services/Mail/classes/class.ilMailFormGUI.php';
 
  194                         case 'ilmailaddressbookgui':
 
  195                                 include_once 
'Services/Contact/classes/class.ilMailAddressbookGUI.php';
 
  200                         case 'ilmailoptionsgui':
 
  201                                 include_once 
'Services/Mail/classes/class.ilMailOptionsGUI.php';
 
  206                         case 'ilmailfoldergui':
 
  207                                 include_once 
'Services/Mail/classes/class.ilMailFolderGUI.php';
 
  212                                 if (!(
$cmd = $this->ctrl->getCmd()))
 
  214                                         $cmd = 
"setViewMode";
 
  226                 if (
$_GET[
"target"] == 
"")
 
  228                         $_GET[
"target"] = 
"ilmailfoldergui";
 
  232                         include_once(
"Services/Frameset/classes/class.ilFramesetGUI.php");
 
  234                         $fs_gui->setFramesetTitle($this->lng->txt(
"mail"));
 
  235                         $fs_gui->setMainFrameName(
"content");
 
  236                         $fs_gui->setSideFrameName(
"tree");
 
  238                         $this->ctrl->setParameter($this, 
"cmd", 
"showMenu");
 
  239                         $this->ctrl->setParameter($this, 
"mexpand", 1);
 
  240                         $fs_gui->setSideFrameSource($this->ctrl->getLinkTarget($this));
 
  241                         $this->ctrl->clearParameters($this);
 
  243                         if (
$_GET[
"type"] == 
"add_subfolder")
 
  245                                 $fs_gui->setMainFrameSource($this->ctrl->getLinkTargetByClass(
$_GET[
"target"], 
"addSubFolder"));
 
  247                         else if (
$_GET[
"type"] == 
"enter_folderdata")
 
  249                                 $fs_gui->setMainFrameSource($this->ctrl->getLinkTargetByClass(
$_GET[
"target"], 
"enterFolderData"));
 
  251                         else if (
$_GET[
"type"] == 
"confirmdelete_folderdata")
 
  253                                 $fs_gui->setMainFrameSource($this->ctrl->getLinkTargetByClass(
$_GET[
"target"], 
"confirmDeleteFolder"));
 
  257                                 $fs_gui->setMainFrameSource($this->ctrl->getLinkTargetByClass(
$_GET[
"target"]));
 
  264                         $this->ctrl->redirectByClass(
$_GET[
"target"]);
 
  275                 global $ilMainMenu, $ilTabs;
 
  277                 $ilMainMenu->setActive(
"mail");
 
  279                 $this->tpl->addBlockFile(
"CONTENT", 
"content", 
"tpl.adm_content.html");
 
  280                 $this->tpl->addBlockFile(
"STATUSLINE", 
"statusline", 
"tpl.statusline.html");
 
  286                 $ilTabs->addTarget(
'fold', $this->ctrl->getLinkTargetByClass(
'ilmailfoldergui'));               
 
  287                 $this->ctrl->setParameterByClass(
'ilmailformgui', 
'type', 
'new');
 
  288                 $ilTabs->addTarget(
'compose', $this->ctrl->getLinkTargetByClass(
'ilmailformgui'));
 
  289                 $this->ctrl->clearParametersByClass(
'ilmailformgui');
 
  290                 $ilTabs->addTarget(
'mail_addressbook', $this->ctrl->getLinkTargetByClass(
'ilmailaddressbookgui'));
 
  291                 $ilTabs->addTarget(
'options', $this->ctrl->getLinkTargetByClass(
'ilmailoptionsgui'));
 
  293                 switch($this->forwardClass)
 
  295                         case 'ilmailformgui':
 
  296                                 $ilTabs->setTabActive(
'compose');
 
  299                         case 'ilmailaddressbookgui':
 
  300                                 $ilTabs->setTabActive(
'mail_addressbook');
 
  303                         case 'ilmailoptionsgui':
 
  304                                 $ilTabs->setTabActive(
'options');
 
  307                         case 'ilmailfoldergui':
 
  309                                 $ilTabs->setTabActive(
'fold');
 
  313                 if(isset(
$_GET[
'message_sent'])) $ilTabs->setTabActive(
'fold');
 
  318                         $this->ctrl->setParameter($this, 
"viewmode", 
"tree");
 
  319                         $this->tpl->setTreeFlatIcon(
 
  320                                 $this->ctrl->getLinkTarget($this),
 
  327                         $this->ctrl->setParameter($this, 
"viewmode", 
"flat");
 
  328                         $this->tpl->setTreeFlatIcon(
 
  329                                 $this->ctrl->getLinkTarget($this),
 
  333                 $this->ctrl->clearParameters($this);
 
  334                 $this->tpl->setCurrentBlock(
"tree_icons");
 
  335                 $this->tpl->parseCurrentBlock();
 
  342                 require_once 
"Services/Mail/classes/class.ilMailExplorer.php";
 
  344                 $this->tpl->addBlockFile(
"CONTENT", 
"content", 
"tpl.explorer.html");
 
  347                 $this->exp = 
new ilMailExplorer($this->ctrl->getLinkTargetByClass(
"ilmailfoldergui"),$ilUser->getId());
 
  350                 if (
$_GET[
"mexpand"] == 
"")
 
  352                         $this->mtree = 
new ilTree($ilUser->getId());
 
  354                         $expanded = $this->mtree->readRootId();
 
  357                         $expanded = 
$_GET[
"mexpand"];
 
  359                 $this->exp->setExpand($expanded);
 
  362                 $this->exp->setOutput(0);
 
  363                 $this->output = $this->exp->getOutput();
 
  365                 $this->tpl->setCurrentBlock(
"content");
 
  366                 $this->tpl->setVariable(
"TXT_EXPLORER_HEADER", $this->lng->txt(
"mail_folders"));
 
  367                 $this->tpl->setVariable(
"EXP_REFRESH", $this->lng->txt(
"refresh"));
 
  368                 $this->tpl->setVariable(
"EXPLORER",$this->output);
 
  369                 $this->ctrl->setParameter($this, 
"mexpand", 
$_GET[
"mexpand"]);
 
  370                 $this->tpl->setVariable(
"ACTION", $this->ctrl->getFormAction($this, 
'showMenu'));
 
  371                 $this->tpl->parseCurrentBlock();
 
  373                 $this->tpl->show(
false);