40 $this->ctrl = $DIC->ctrl();
42 $lng = $DIC->language();
46 $this->manual_activation =
false;
47 $this->subtab_manual_activation =
false;
48 $this->temp_var =
"TABS";
49 $this->sub_tabs =
false;
50 $this->back_title =
"";
51 $this->back_target =
"";
52 $this->back_2_target =
"";
53 $this->back_2_title =
"";
63 $this->setup_mode = $a_val;
81 $this->back_title = $a_title;
82 $this->back_target = $a_target;
83 $this->back_frame = $a_frame;
91 $this->back_2_title = $a_title;
92 $this->back_2_target = $a_target;
93 $this->back_2_frame = $a_frame;
103 $this->force_one_tab = $a_val;
143 $a_cmdClass =
array();
145 $a_cmdClass = !is_array($a_cmdClass) ?
array(strtolower($a_cmdClass)) : $a_cmdClass;
146 #$a_cmdClass = strtolower($a_cmdClass); 149 $this->manual_activation =
true;
151 $this->target[] =
array(
"text" => $a_text,
"link" => $a_link,
152 "cmd" => $a_cmd,
"cmdClass" => $a_cmdClass,
"frame" => $a_frame,
153 "activate" => $a_activate,
"dir_text" => $a_dir_text,
"id" => $a_text);
164 public function addTab($a_id, $a_text, $a_link, $a_frame =
"")
166 $this->target[] =
array(
"text" => $a_text,
"link" => $a_link,
167 "frame" => $a_frame,
"dir_text" =>
true,
"id" => $a_id,
"cmdClass" =>
array());
181 unset($this->target[
$key]);
198 if ($this->sub_target[
$i][
'id'] == $a_id) {
199 unset($this->sub_target[
$i]);
217 public function replaceTab($a_old_id, $a_new_id, $a_text, $a_link, $a_frame =
'')
219 for (
$i = 0;
$i < count($this->target);
$i++) {
220 if ($this->target[
$i][
'id'] == $a_old_id) {
228 "cmdClass" =>
array());
243 if (isset($DIC[
"ilHelp"])) {
244 $ilHelp = $DIC[
"ilHelp"];
248 $ilHelp->setScreenIdComponent(
"");
251 $this->target =
array();
252 $this->sub_target =
array();
253 $this->non_tabbed_link =
array();
254 $this->back_title =
"";
255 $this->back_target =
"";
256 $this->back_2_target =
"";
257 $this->back_2_title =
"";
290 $a_cmdClass =
array();
292 $a_cmdClass = !is_array($a_cmdClass) ?
array(strtolower($a_cmdClass)) : $a_cmdClass;
293 #$a_cmdClass = strtolower($a_cmdClass); 296 $this->subtab_manual_activation =
true;
298 $this->sub_target[] =
array(
"text" => $a_text,
"link" => $a_link,
299 "cmd" => $a_cmd,
"cmdClass" => $a_cmdClass,
"frame" => $a_frame,
300 "activate" => $a_activate,
"dir_text" => $a_dir_text,
"id" => $a_text);
311 public function addSubTab($a_id, $a_text, $a_link, $a_frame =
"")
313 $this->sub_target[] =
array(
"text" => $a_text,
"link" => $a_link,
314 "frame" => $a_frame,
"dir_text" =>
true,
"id" => $a_id,
"cmdClass" =>
array());
331 $this->target[
$key][
'activate'] = $this->target[
$key][
'id'] == $a_id;
334 $this->manual_activation =
true;
336 $this->manual_activation =
false;
364 for (
$i = 0;
$i < count($this->sub_target);
$i++) {
365 $this->sub_target[
$i][
'activate'] = $this->sub_target[
$i][
'id'] == $a_text;
367 $this->subtab_manual_activation =
true;
388 $this->sub_target =
array();
395 public function getHTML($a_after_tabs_anchor =
false)
397 return $this->
__getHTML(
false, $this->manual_activation, $a_after_tabs_anchor);
405 return $this->
__getHTML(
true, $this->subtab_manual_activation);
418 $this->non_tabbed_link[] =
array(
"text" => $a_text,
"link" => $a_link,
419 "frame" => $a_frame,
"dir_text" =>
true,
"id" => $a_id,
"cmdClass" =>
array());
428 public function __getHTML($a_get_sub_tabs, $a_manual, $a_after_tabs_anchor =
false)
433 if (isset($DIC[
"ilHelp"])) {
434 $ilHelp = $DIC[
"ilHelp"];
440 if (isset($DIC[
"ilUser"])) {
443 $ilPluginAdmin = null;
444 if (isset($DIC[
"ilPluginAdmin"])) {
445 $ilPluginAdmin = $DIC[
"ilPluginAdmin"];
450 $pl_names = $ilPluginAdmin->getActivePluginsForSlot(
IL_COMP_SERVICE,
"UIComponent",
"uihk");
451 foreach ($pl_names as $pl) {
453 $gui_class = $ui_plugin->getUIClassInstance();
454 $resp = $gui_class->modifyGUI(
456 $a_get_sub_tabs ?
"sub_tabs" :
"tabs",
457 array(
"tabs" => $this)
466 $cmdClass =
$ilCtrl->getCmdClass();
469 if ($a_get_sub_tabs) {
470 $tpl =
new ilTemplate(
"tpl.sub_tabs.html",
true,
true,
"Services/UIComponent/Tabs");
475 $tpl =
new ilTemplate(
"tpl.tabs.html",
true,
true,
"Services/UIComponent/Tabs");
476 if ($a_after_tabs_anchor) {
477 $tpl->touchBlock(
"after_tabs");
481 include_once(
"./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php");
484 if ($this->back_2_title !=
"") {
485 $tpl->setCurrentBlock(
"back_2_tab");
487 $tpl->setVariable(
"BACK_2_TAB_LINK", $this->back_2_target);
488 $tpl->setVariable(
"BACK_2_TAB_TEXT", $this->back_2_title);
489 $tpl->setVariable(
"BACK_2_TAB_TARGET", $this->back_2_frame);
490 $tpl->parseCurrentBlock();
494 if ($this->back_title !=
"") {
495 $tpl->setCurrentBlock(
"back_tab");
497 $tpl->setVariable(
"BACK_TAB_LINK", $this->back_target);
498 $tpl->setVariable(
"BACK_TAB_TEXT", $this->back_title);
499 $tpl->setVariable(
"BACK_TAB_TARGET", $this->back_frame);
500 $tpl->parseCurrentBlock();
504 $targets = $a_get_sub_tabs ? $this->sub_target :
$this->target;
509 if ((count($targets) > 1 || $this->force_one_tab) || ($this->back_title !=
"" && !$a_get_sub_tabs)
510 || (count($this->non_tabbed_link) > 0 && !$a_get_sub_tabs)) {
511 foreach ($targets as
$target) {
514 if (!is_array($target[
"cmd"])) {
515 $target[
"cmd"] =
array($target[
"cmd"]);
518 (in_array($cmd, $target[
"cmd"]) || ($target[
"cmd"][0] ==
"" && count($target[
"cmd"]) == 1)) &&
519 (in_array($cmdClass, $target[
"cmdClass"]) || !$target[
"cmdClass"])) {
520 $tabtype = $pre .
"tabactive";
522 $tabtype = $pre .
"tabinactive";
525 if ($a_manual && $target[
"activate"]) {
526 $tabtype = $pre .
"tabactive";
529 if ($tabtype ==
"tabactive" || $tabtype ==
"subtabactive") {
530 $tpl->setCurrentBlock(
"sel_text");
531 $tpl->setVariable(
"TXT_SELECTED",
$lng->txt(
"stat_selected"));
532 $tpl->parseCurrentBlock();
535 if ($a_get_sub_tabs) {
540 $ilHelp->setDefaultScreenId($part, $target[
"id"]);
544 $tpl->setCurrentBlock($pre .
"tab");
545 $tpl->setVariable(
"ID", $pre .
"tab_" . $target[
"id"]);
549 $ttext = $ilHelp->getTabTooltipText($target[
"id"]);
551 include_once(
"./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php");
553 $pre .
"tab_" . $target[
"id"],
564 $tabtype = in_array($tabtype,
array(
"tabactive",
"subtabactive"))
569 $tpl->setVariable($pre2 .
"TAB_TYPE", $tabtype);
571 $hash = (
$ilUser->getPref(
"screen_reader_optimization"))
572 ?
"#after_" . $sr_pre .
"tabs" 576 $tpl->setVariable($pre2 .
"TAB_LINK", $target[
"link"] . $hash);
577 if ($target[
"dir_text"]) {
578 $tpl->setVariable($pre2 .
"TAB_TEXT", $target[
"text"]);
580 $tpl->setVariable($pre2 .
"TAB_TEXT",
$lng->txt($target[
"text"]));
582 $tpl->setVariable($pre2 .
"TAB_TARGET", $target[
"frame"]);
583 $tpl->parseCurrentBlock();
586 if ($a_get_sub_tabs) {
587 $tpl->setVariable(
"TXT_SUBTABS",
$lng->txt(
"subtabs"));
589 $tpl->setVariable(
"TXT_TABS",
$lng->txt(
"tabs"));
592 include_once(
"./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php");
593 foreach ($this->non_tabbed_link as $link) {
594 $tpl->setCurrentBlock(
"tab");
595 $tpl->setVariable(
"TAB_TYPE",
"nontabbed");
597 $tpl->setVariable(
"TAB_TEXT", $link[
"text"]);
598 $tpl->setVariable(
"TAB_LINK", $link[
"link"]);
599 $tpl->setVariable(
"TAB_TARGET", $link[
"frame"]);
600 $tpl->setVariable(
"ID",
"nontab_" . $link[
"id"]);
601 $tpl->parseCurrentBlock();
605 $ttext = $ilHelp->getTabTooltipText($link[
"id"]);
607 include_once(
"./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php");
609 "nontab_" . $link[
"id"],
629 foreach ($this->target as
$i =>
$target) {
630 if ($this->target[
$i][
'activate']) {
631 return $this->target[
$i][
'id'];
getSetupMode()
Get setup mode.
addSubTabTarget( $a_text, $a_link, $a_cmd="", $a_cmdClass="", $a_frame="", $a_activate=false, $a_dir_text=false)
DEPRECATED.
setTabActive($a_id)
DEPRECATED.
activateSubTab($a_id)
Activate a specific subtab identified its id.
getSubTabHTML()
get sub tabs code as html
static get($a_glyph, $a_text="")
Get glyph html.
setBack2Target($a_title, $a_target, $a_frame="")
back target for tow level upper context
addTarget( $a_text, $a_link, $a_cmd="", $a_cmdClass="", $a_frame="", $a_activate=false, $a_dir_text=false)
setBackTarget($a_title, $a_target, $a_frame="")
back target for upper context
getForcePresentationOfSingleTab()
Get force presentation of single tab.
replaceTab($a_old_id, $a_new_id, $a_text, $a_link, $a_frame='')
Replace a tab.
setSubTabActive($a_text)
DEPRECATED.
special template class to simplify handling of ITX/PEAR
static getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get Plugin Object.
setForcePresentationOfSingleTab($a_val)
Set force presentation of single tab.
addSubTab($a_id, $a_text, $a_link, $a_frame="")
Add a Subtab.
clearSubTabs()
Clear all already added sub tabs.
__getHTML($a_get_sub_tabs, $a_manual, $a_after_tabs_anchor=false)
get tabs code as html
clearTargets()
clear all targets
Create styles array
The data for the language used.
addNonTabbedLink($a_id, $a_text, $a_link, $a_frame="")
Add a non-tabbed link (outside of tabs at same level)
__construct()
Constructor public.
removeTab($a_id)
Remove a tab identified by its id.
activateTab($a_id)
Activate a specific tab identified its id.
removeSubTab($a_id)
Remove a tab identified by its id.
getHTML($a_after_tabs_anchor=false)
get tabs code as html
setSetupMode($a_val)
Set setup mode.
addTab($a_id, $a_text, $a_link, $a_frame="")
Add a Tab.