25 function setLocator($a_obj_id,$a_path,$a_user_id,$a_txt_prefix)
27 global
$lng,
$tpl,$ilias_locator, $ilMainMenu;
29 $ilMainMenu->setActive(
"mail");
33 include_once
"Services/Mail/classes/class.ilMailbox.php";
34 $mbox =
new ilMailBox(
$_SESSION[
"AccountId"]);
35 $a_obj_id = $mbox->getInboxFolder();
38 $tpl->addBlockFile(
"LOCATOR",
"locator",
"tpl.locator.html");
39 $tpl->setVariable(
"TXT_LOCATOR",$lng->txt(
"locator"));
40 $mtree =
new ilTree($a_user_id);
41 $mtree->setTableNames(
'mail_tree',
'mail_obj_data');
42 $path_full = $mtree->getPathFull($a_obj_id,$mtree->readRootId());
47 $tpl->touchBlock(
"locator_separator");
48 $tpl->touchBlock(
"locator_item");
50 if($a_path ==
'mail.php')
54 $tpl->touchBlock(
"locator_separator");
55 $tpl->setCurrentBlock(
"locator_item");
56 $tpl->setVariable(
"ITEM", $lng->txt(
"folder"));
57 $tpl->setVariable(
"LINK_ITEM",
"mail.php?mobj_id=".$a_obj_id);
58 $tpl->parseCurrentBlock();
62 foreach ($path_full as $key =>
$row)
64 if(
$row[
"type"] !=
'user_folder')
66 $row[
"title"] = $lng->txt(
"mail_".
$row[
"title"]);
68 if ($key < count($path_full))
70 $tpl->touchBlock(
"locator_separator");
72 $tpl->setCurrentBlock(
"locator_item");
73 $tpl->setVariable(
"ITEM",
$row[
"title"]);
75 $tpl->setVariable(
"LINK_ITEM",
"mail.php?mobj_id=".
$row[
"child"]);
76 $tpl->parseCurrentBlock();
79 $tpl->setCurrentBlock(
"locator");
86 case 'mail_attachment.php':
87 case 'mail_search.php':
88 $tpl->setCurrentBlock(
"locator_item");
89 $tpl->setVariable(
"ITEM", $lng->txt(
"mail_compose"));
90 $tpl->setVariable(
"LINK_ITEM",
"mail_new.php?mobj_id=$a_obj_id");
91 $tpl->parseCurrentBlock();
94 case "mail_addressbook.php":
95 $tpl->setCurrentBlock(
"locator_item");
96 $tpl->setVariable(
"ITEM", $lng->txt(
"mail_addressbook"));
97 $tpl->setVariable(
"LINK_ITEM",
"mail_addressbook.php?mobj_id=$a_obj_id");
98 $tpl->parseCurrentBlock();
101 case "mail_options.php":
102 $tpl->setCurrentBlock(
"locator_item");
103 $tpl->setVariable(
"ITEM", $lng->txt(
"mail_options_of"));
104 $tpl->setVariable(
"LINK_ITEM",
"mail_options.php?mobj_id=$a_obj_id");
105 $tpl->parseCurrentBlock();
112 $tpl->setVariable(
"TXT_PATH",$a_txt_prefix);
113 $tpl->parseCurrentBlock();
122 function formSelect ($selected,$varname,$options,$multiple =
false)
126 $multiple ? $multiple =
" multiple=\"multiple\"" :
"";
127 $str =
"<select name=\"".$varname .
"\"".$multiple.
">\n";
129 foreach ($options as $key => $val)
132 $str .=
" <option value=\"".$val.
"\"";
134 if ($selected == $key)
136 $str .=
" selected=\"selected\"";
139 $str .=
">".$val.
"</option>\n";
142 $str .=
"</select>\n";
149 foreach($a_mail_data as $key =>
$data)