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

Generated on Fri Dec 13 2013 17:56:49 for ILIAS Release_3_9_x_branch .rev 46835 by  doxygen 1.7.1