54 $this->manual_activation =
false;
55 $this->subtab_manual_activation =
false;
56 $this->temp_var =
"TABS";
57 $this->sub_tabs =
false;
58 $this->back_title =
"";
59 $this->back_target =
"";
60 $this->back_2_target =
"";
61 $this->back_2_title =
"";
69 $this->back_title = $a_title;
70 $this->back_target = $a_target;
71 $this->back_frame = $a_frame;
79 $this->back_2_title = $a_title;
80 $this->back_2_target = $a_target;
81 $this->back_2_frame = $a_frame;
113 function addTarget($a_text, $a_link, $a_cmd =
"", $a_cmdClass =
"", $a_frame =
"", $a_activate =
false,
118 $a_cmdClass = array();
120 $a_cmdClass = !is_array($a_cmdClass) ? array(strtolower($a_cmdClass)) : $a_cmdClass;
121 #$a_cmdClass = strtolower($a_cmdClass);
125 $this->manual_activation =
true;
127 $this->target[] = array(
"text" => $a_text,
"link" => $a_link,
128 "cmd" => $a_cmd,
"cmdClass" => $a_cmdClass,
"frame" => $a_frame,
129 "activate" => $a_activate,
"dir_text" => $a_dir_text);
137 $this->target = array();
138 $this->back_title =
"";
139 $this->back_target =
"";
140 $this->back_2_target =
"";
141 $this->back_2_title =
"";
160 function addSubTabTarget($a_text, $a_link, $a_cmd =
"", $a_cmdClass =
"", $a_frame =
"", $a_activate =
false,
166 $a_cmdClass = array();
168 $a_cmdClass = !is_array($a_cmdClass) ? array(strtolower($a_cmdClass)) : $a_cmdClass;
169 #$a_cmdClass = strtolower($a_cmdClass);
173 $this->subtab_manual_activation =
true;
175 $this->sub_target[] = array(
"text" => $a_text,
"link" => $a_link,
176 "cmd" => $a_cmd,
"cmdClass" => $a_cmdClass,
"frame" => $a_frame,
177 "activate" => $a_activate,
"dir_text" => $a_dir_text);
189 for($i = 0; $i < count($this->target);$i++)
191 $this->target[$i][
'activate'] = $this->target[$i][
'text'] == $a_text;
195 $this->manual_activation =
true;
199 $this->manual_activation =
false;
213 for($i = 0; $i < count($this->sub_target);$i++)
215 $this->sub_target[$i][
'activate'] = $this->sub_target[$i][
'text'] == $a_text;
217 $this->subtab_manual_activation =
true;
228 $this->sub_target = array();
237 return $this->
__getHTML(
false,$this->manual_activation);
245 return $this->
__getHTML(
true,$this->subtab_manual_activation);
260 $cmd = $ilCtrl->getCmd();
261 $cmdClass = $ilCtrl->getCmdClass();
275 if ($this->back_2_title !=
"")
277 $tpl->setCurrentBlock(
"back_2_tab");
278 $tpl->setVariable(
"BACK_2_TAB_LINK", $this->back_2_target);
279 $tpl->setVariable(
"BACK_2_TAB_TEXT", $this->back_2_title);
280 $tpl->setVariable(
"BACK_2_TAB_TARGET", $this->back_2_frame);
281 $tpl->parseCurrentBlock();
285 if ($this->back_title !=
"")
287 $tpl->setCurrentBlock(
"back_tab");
288 $tpl->setVariable(
"BACK_TAB_LINK", $this->back_target);
289 $tpl->setVariable(
"BACK_TAB_TEXT", $this->back_title);
290 $tpl->setVariable(
"BACK_TAB_TARGET", $this->back_frame);
291 $tpl->parseCurrentBlock();
295 $targets = $a_get_sub_tabs ? $this->sub_target :
$this->target;
298 if ((count($targets) > 1) || ($this->back_title !=
"" && !$a_get_sub_tabs))
304 if (!is_array($target[
"cmd"]))
306 $target[
"cmd"] = array($target[
"cmd"]);
310 (in_array(
$cmd, $target[
"cmd"]) || ($target[
"cmd"][0] ==
"" && count($target[
"cmd"]) == 1)) &&
311 (in_array($cmdClass,$target[
"cmdClass"]) || !$target[
"cmdClass"]))
313 $tabtype = $pre.
"tabactive";
317 $tabtype = $pre.
"tabinactive";
320 if ($a_manual && $target[
"activate"])
322 $tabtype = $pre.
"tabactive";
325 $tpl->setCurrentBlock($pre.
"tab");
326 $tpl->setVariable($pre2.
"TAB_TYPE", $tabtype);
327 $tpl->setVariable($pre2.
"TAB_LINK", $target[
"link"]);
328 if ($target[
"dir_text"])
330 $tpl->setVariable($pre2.
"TAB_TEXT", $target[
"text"]);
334 $tpl->setVariable($pre2.
"TAB_TEXT", $lng->txt($target[
"text"]));
336 $tpl->setVariable($pre2.
"TAB_TARGET", $target[
"frame"]);
337 $tpl->parseCurrentBlock();