• Main Page
  • Related Pages
  • Namespaces
  • Data Structures
  • Files
  • File List
  • Globals

mail_frameset.php

Go to the documentation of this file.
00001 <?php
00002 /*
00003         +-----------------------------------------------------------------------------+
00004         | ILIAS open source                                                           |
00005         +-----------------------------------------------------------------------------+
00006         | Copyright (c) 1998-2001 ILIAS open source, University of Cologne            |
00007         |                                                                             |
00008         | This program is free software; you can redistribute it and/or               |
00009         | modify it under the terms of the GNU General Public License                 |
00010         | as published by the Free Software Foundation; either version 2              |
00011         | of the License, or (at your option) any later version.                      |
00012         |                                                                             |
00013         | This program is distributed in the hope that it will be useful,             |
00014         | but WITHOUT ANY WARRANTY; without even the implied warranty of              |
00015         | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the               |
00016         | GNU General Public License for more details.                                |
00017         |                                                                             |
00018         | You should have received a copy of the GNU General Public License           |
00019         | along with this program; if not, write to the Free Software                 |
00020         | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA. |
00021         +-----------------------------------------------------------------------------+
00022 */
00023 
00024 
00034 require_once "./include/inc.header.php";
00035 require_once "./classes/class.ilMailbox.php";
00036 
00037 $lng->loadLanguageModule("mail");
00038 
00039 $startfilename = $ilias->tplPath.$ilias->account->getPref("skin")."/tpl.mail_frameset.html"; 
00040 
00041 // ADD FOLDER cmd comes from mail_options button
00042 if(isset($_POST["cmd"]["add"]))
00043 {
00044         $mbox = new ilMailbox($_SESSION["AccountId"]);
00045 
00046         if(empty($_POST['folder_name_add']))
00047         {
00048                 sendInfo($lng->txt("mail_insert_folder_name"),true);
00049                 $_GET["target"] = urlencode("mail_options.php?mobj_id=$_GET[mobj_id]");
00050         }
00051         else if($new_id = $mbox->addFolder($_GET["mobj_id"],$_POST["folder_name_add"]))
00052         {
00053                 sendInfo($lng->txt("mail_folder_created"),true);
00054                 $_GET["mobj_id"] = $new_id;
00055         }
00056         else
00057         {
00058                 sendInfo($lng->txt("mail_folder_exists"),true);
00059                 $_GET["target"] = urlencode("mail_options.php?mobj_id=$_GET[mobj_id]");
00060         }
00061 }
00062 // DELETE FOLDER confirmed
00063 if(isset($_POST["cmd"]["confirm"]))
00064 {
00065         $mbox = new ilMailbox($_SESSION["AccountId"]);
00066         $new_parent = $mbox->getParentFolderId($_GET["mobj_id"]);
00067 
00068         if($mbox->deleteFolder($_GET["mobj_id"]))
00069         {
00070                 sendInfo($lng->txt("mail_folder_deleted"),true);
00071                 $_GET["target"] = urlencode("mail_options.php?mobj_id=".$new_parent);
00072         }
00073         else
00074         {
00075                 sendInfo($lng->txt("mail_error_delete"),true);
00076                 $_GET["target"] = urlencode("mail_options.php?mobj_id=".$_GET["mobj_id"]);
00077 
00078         }
00079 }
00080 // DELETEING CANCELED
00081 if(isset($_POST["cmd"]["cancel"]))
00082 {
00083         $_GET["target"] = urlencode("mail_options.php?mobj_id=".$_GET["mobj_id"]);
00084 }
00085 
00086 if (isset($_GET["viewmode"]))
00087 {
00088         $_SESSION["viewmode"] = $_GET["viewmode"];
00089 }
00090 if (file_exists($startfilename) and ($_SESSION["viewmode"] == "tree"))
00091 {
00092         $tpl = new ilTemplate("tpl.mail_frameset.html", false, false);
00093         if(isset($_GET["target"]))
00094         {
00095                 $tpl->setVariable("FRAME_RIGHT_SRC",urldecode($_GET["target"]));
00096         }
00097         else
00098         {
00099                 $tpl->setVariable("FRAME_RIGHT_SRC","mail.php?mobj_id=$_GET[mobj_id]");
00100         }
00101         $tpl->show();
00102 }
00103 else
00104 {
00105         if(isset($_GET["target"]))
00106         {
00107                 header("location: ".urldecode($_GET["target"]));
00108         }
00109         else
00110         {
00111                 header("location: mail.php?mobj_id=$_GET[mobj_id]");
00112         }
00113 }
00114 ?>

Generated on Fri Dec 13 2013 09:06:36 for ILIAS Release_3_4_x_branch .rev 46804 by  doxygen 1.7.1