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
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
00031 if(!$a_obj_id)
00032 {
00033 include_once "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
00045 $i = 1;
00046
00047 $tpl->touchBlock("locator_separator");
00048 $tpl->touchBlock("locator_item");
00049
00050 if($a_path == 'mail.php')
00051 {
00052
00053
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
00062
00063
00064
00065 unset($path_full[0]);
00066 foreach ($path_full as $key => $row)
00067 {
00068 if($row["type"] != 'user_folder')
00069 {
00070 $row["title"] = $lng->txt("mail_".$row["title"]);
00071 }
00072 if ($key < count($path_full))
00073 {
00074 $tpl->touchBlock("locator_separator");
00075 }
00076 $tpl->setCurrentBlock("locator_item");
00077 $tpl->setVariable("ITEM", $row["title"]);
00078
00079 $tpl->setVariable("LINK_ITEM", "mail.php?mobj_id=".$row["child"]);
00080 $tpl->parseCurrentBlock();
00081
00082
00083
00084 $ilias_locator->navigate($i++,$row["title"],"mail.php?mobj_id=".$row["child"],
00085 ilFrameTargetInfo::_getFrame("MainContent"));
00086 }
00087 $tpl->setCurrentBlock("locator");
00088 }
00089
00090
00091 switch($a_path)
00092 {
00093 case 'mail_new.php':
00094 case 'mail_attachment.php':
00095 case 'mail_search.php':
00096 $tpl->setCurrentBlock("locator_item");
00097 $tpl->setVariable("ITEM", $lng->txt("mail_compose"));
00098 $tpl->setVariable("LINK_ITEM", "mail_new.php?mobj_id=$a_obj_id");
00099 $tpl->parseCurrentBlock();
00100 break;
00101
00102 case "mail_addressbook.php":
00103 $tpl->setCurrentBlock("locator_item");
00104 $tpl->setVariable("ITEM", $lng->txt("mail_addressbook"));
00105 $tpl->setVariable("LINK_ITEM", "mail_addressbook.php?mobj_id=$a_obj_id");
00106 $tpl->parseCurrentBlock();
00107 break;
00108
00109 case "mail_options.php":
00110 $tpl->setCurrentBlock("locator_item");
00111 $tpl->setVariable("ITEM", $lng->txt("mail_options_of"));
00112 $tpl->setVariable("LINK_ITEM", "mail_options.php?mobj_id=$a_obj_id");
00113 $tpl->parseCurrentBlock();
00114 break;
00115
00116 default:
00117 break;
00118 }
00119
00120 $tpl->setVariable("TXT_PATH",$a_txt_prefix);
00121 $tpl->parseCurrentBlock();
00122 }
00130 function formSelect ($selected,$varname,$options,$multiple = false)
00131 {
00132 global $lng;
00133
00134 $multiple ? $multiple = " multiple=\"multiple\"" : "";
00135 $str = "<select name=\"".$varname ."\"".$multiple.">\n";
00136
00137 foreach ($options as $key => $val)
00138 {
00139
00140 $str .= " <option value=\"".$val."\"";
00141
00142 if ($selected == $key)
00143 {
00144 $str .= " selected=\"selected\"";
00145 }
00146
00147 $str .= ">".$val."</option>\n";
00148 }
00149
00150 $str .= "</select>\n";
00151
00152 return $str;
00153 }
00154
00155 function assignMailToPost($a_mail_data)
00156 {
00157 foreach($a_mail_data as $key => $data)
00158 {
00159 $_POST[$key] = $data;
00160 }
00161 }
00162
00163 ?>