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

include/inc.mail.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 
00025 function setLocator($a_obj_id,$a_user_id,$a_txt_prefix)
00026 {
00027                 global $lng,$tpl,$ilias_locator;;
00028 
00029                 // IF THERE IS NO OBJ_ID GIVEN GET THE ID OF MAIL ROOT NODE
00030                 if(!$a_obj_id)
00031                 {
00032                         include_once "classes/class.ilMailbox.php";
00033                         $mbox = new ilMailBox($_SESSION["AccountId"]);
00034                         $a_obj_id = $mbox->getInboxFolder();
00035                 }               
00036 
00037                 $tpl->addBlockFile("LOCATOR", "locator", "tpl.locator.html");
00038                 $tpl->setVariable("TXT_LOCATOR",$lng->txt("locator"));
00039                 $mtree = new ilTree($a_user_id);
00040                 $mtree->setTableNames('mail_tree','mail_obj_data');
00041                 $path_full = $mtree->getPathFull($a_obj_id,$mtree->readRootId());
00042                 
00043                 // ### AA 03.11.10 added new locator GUI class ###
00044                 $i = 1;
00045                 
00046                 // FIRST ITEM IS INBOX
00047                 $tpl->touchBlock("locator_separator");
00048                 $tpl->setCurrentBlock("locator_item");
00049                 $tpl->setVariable("ITEM", $lng->txt("mail_mails_of"));
00050                 $tpl->setVariable("LINK_ITEM", "mail.php");
00051                 $tpl->parseCurrentBlock();
00052                 
00053                 // ### AA 03.11.10 added new locator GUI class ###
00054                 // navigate locator
00055                 $ilias_locator->navigate($i++,$lng->txt("mail_mails_of"),"mail.php","bottom");
00056 
00057 #               var_dump("<pre>",$_SERVER,"</pre");
00058                 switch(basename($_SERVER["PATH_INFO"]))
00059                 {
00060                         case "mail_addressbook.php":
00061                                 $tpl->setCurrentBlock("locator_item");
00062                                 $tpl->setVariable("ITEM", $lng->txt("mail_addressbook"));
00063                                 $tpl->setVariable("LINK_ITEM", "mail_addressbook.php?mobj_id=$a_obj_id");
00064                                 $tpl->parseCurrentBlock();
00065                                 
00066                                 // ### AA 03.11.10 added new locator GUI class ###
00067                                 // navigate locator
00068                                 $ilias_locator->navigate($i++,$lng->txt("mail_addressbook"),"mail_addressbook.php?mobj_id=$a_obj_id","bottom");
00069                                 
00070                                 return true;
00071 
00072                         case "mail_new.php":
00073                         case "mail_attachment.php":
00074                         case "mail_search.php":
00075                                 $tpl->setCurrentBlock("locator_item");
00076                                 $tpl->setVariable("ITEM", $lng->txt("mail_compose"));
00077                                 $tpl->setVariable("LINK_ITEM", "mail_new.php?mobj_id=$a_obj_id");
00078                                 $tpl->parseCurrentBlock();
00079                                 
00080                                 // ### AA 03.11.10 added new locator GUI class ###
00081                                 // navigate locator
00082                                 $ilias_locator->navigate($i++,$lng->txt("mail_compose"),"mail_new.php?mobj_id=$a_obj_id","bottom");
00083                                 
00084                                 return true;
00085                                 
00086                         case "mail_options.php":
00087                                 $tpl->setCurrentBlock("locator_item");
00088                                 $tpl->setVariable("ITEM", $lng->txt("mail_options_of"));
00089                                 $tpl->setVariable("LINK_ITEM", "mail_options.php?mobj_id=$a_obj_id");
00090                                 $tpl->parseCurrentBlock();
00091                                 
00092                                 // ### AA 03.11.10 added new locator GUI class ###
00093                                 // navigate locator
00094                                 $ilias_locator->navigate($i++,$lng->txt("mail_options_of"),"mail_options.php?mobj_id=$a_obj_id","bottom");
00095                                 
00096                                 return true;
00097                 }
00098                 unset($path_full[0]);
00099                 foreach ($path_full as $key => $row)
00100                 {
00101                         if($row["type"] != 'user_folder')
00102                         {
00103                                 $row["title"] = $lng->txt("mail_".$row["title"]);
00104                         }
00105                         if ($key < count($path_full))
00106                         {
00107                                 $tpl->touchBlock("locator_separator");
00108                         }
00109                         $tpl->setCurrentBlock("locator_item");
00110                         $tpl->setVariable("ITEM", $row["title"]);
00111                         // TODO: SCRIPT NAME HAS TO BE VARIABLE!!!
00112                         $tpl->setVariable("LINK_ITEM", "mail.php?mobj_id=".$row["child"]);
00113                         $tpl->parseCurrentBlock();
00114                                 
00115                         // ### AA 03.11.10 added new locator GUI class ###
00116                         // navigate locator
00117                         $ilias_locator->navigate($i++,$row["title"],"mail.php?mobj_id=".$row["child"],"bottom");
00118                 }
00119 
00120                 $tpl->setCurrentBlock("locator");
00121                 
00122                 
00123                 $tpl->setVariable("TXT_PATH",$a_txt_prefix);
00124                 $tpl->parseCurrentBlock();
00125 }
00133 function formSelect ($selected,$varname,$options,$multiple = false)
00134 {
00135         global $lng;
00136                 
00137         $multiple ? $multiple = " multiple=\"multiple\"" : "";
00138         $str = "<select name=\"".$varname ."\"".$multiple.">\n";
00139 
00140         foreach ($options as $key => $val)
00141         {
00142                 
00143                 $str .= " <option value=\"".$val."\"";
00144                         
00145                 if ($selected == $key)
00146                 {
00147                         $str .= " selected=\"selected\"";
00148                 }
00149                         
00150                 $str .= ">".$val."</option>\n";
00151         }
00152 
00153         $str .= "</select>\n";
00154                 
00155         return $str;
00156 }
00157 
00158 function assignMailToPost($a_mail_data)
00159 {
00160         foreach($a_mail_data as $key => $data)
00161         {
00162                 $_POST[$key] = $data;
00163         }
00164 }
00165 
00166 ?>

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