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