Go to the documentation of this file.00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
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
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
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
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 ?>