ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilTabsGUI Class Reference

Tabs GUI. More...

+ Collaboration diagram for ilTabsGUI:

Public Member Functions

 __construct ()
 Constructor public. More...
 
 setSetupMode ($a_val)
 Set setup mode. More...
 
 getSetupMode ()
 Get setup mode. More...
 
 setBackTarget ($a_title, $a_target, $a_frame="")
 back target for upper context More...
 
 setBack2Target ($a_title, $a_target, $a_frame="")
 back target for tow level upper context More...
 
 setForcePresentationOfSingleTab ($a_val)
 Set force presentation of single tab. More...
 
 getForcePresentationOfSingleTab ()
 Get force presentation of single tab. More...
 
 addTarget ( $a_text, $a_link, $a_cmd="", $a_cmdClass="", $a_frame="", $a_activate=false, $a_dir_text=false)
 
 addTab ($a_id, $a_text, $a_link, $a_frame="")
 Add a Tab. More...
 
 removeTab ($a_id)
 Remove a tab identified by its id. More...
 
 removeSubTab ($a_id)
 Remove a tab identified by its id. More...
 
 replaceTab ($a_old_id, $a_new_id, $a_text, $a_link, $a_frame='')
 Replace a tab. More...
 
 clearTargets ()
 clear all targets More...
 
 addSubTabTarget ( $a_text, $a_link, $a_cmd="", $a_cmdClass="", $a_frame="", $a_activate=false, $a_dir_text=false)
 DEPRECATED. More...
 
 addSubTab ($a_id, $a_text, $a_link, $a_frame="")
 Add a Subtab. More...
 
 setTabActive ($a_id)
 DEPRECATED. More...
 
 activateTab ($a_id)
 Activate a specific tab identified its id. More...
 
 setSubTabActive ($a_text)
 DEPRECATED. More...
 
 activateSubTab ($a_id)
 Activate a specific subtab identified its id. More...
 
 clearSubTabs ()
 Clear all already added sub tabs. More...
 
 getHTML ($a_after_tabs_anchor=false)
 get tabs code as html More...
 
 getSubTabHTML ()
 get sub tabs code as html More...
 
 addNonTabbedLink ($a_id, $a_text, $a_link, $a_frame="")
 Add a non-tabbed link (outside of tabs at same level) More...
 
 __getHTML ($a_get_sub_tabs, $a_manual, $a_after_tabs_anchor=false)
 get tabs code as html More...
 
 getActiveTab ()
 
 hasTabs ()
 

Data Fields

 $target_script
 
 $obj_type
 
 $tpl
 
 $lng
 
 $tabs
 
 $target = array()
 
 $sub_target = array()
 
 $non_tabbed_link = array()
 
 $setup_mode = false
 

Protected Attributes

 $ctrl
 
 $force_one_tab = false
 

Detailed Description

Tabs GUI.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 12 of file class.ilTabsGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilTabsGUI::__construct ( )

Constructor public.

Definition at line 36 of file class.ilTabsGUI.php.

References $DIC, $lng, and $tpl.

37  {
38  global $DIC;
39 
40  $this->ctrl = $DIC->ctrl();
41  $tpl = $DIC["tpl"];
42  $lng = $DIC->language();
43 
44  $this->tpl = $tpl;
45  $this->lng = $lng;
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 = "";
54  }
global $DIC
Definition: saml.php:7

Member Function Documentation

◆ __getHTML()

ilTabsGUI::__getHTML (   $a_get_sub_tabs,
  $a_manual,
  $a_after_tabs_anchor = false 
)

get tabs code as html

Parameters
boolchoose tabs or sub tabs
boolmanual activation Private

Definition at line 428 of file class.ilTabsGUI.php.

References $ctrl, $DIC, $i, $ilCtrl, $ilUser, $lng, $target, $tpl, ilTooltipGUI\addTooltip(), array, ilGlyphGUI\get(), ilPluginAdmin\getPluginObject(), getSetupMode(), ilHelpGUI\ID_PART_SCREEN, ilHelpGUI\ID_PART_SUB_SCREEN, IL_COMP_SERVICE, ilGlyphGUI\NEXT, ilGlyphGUI\NO_TEXT, and ilGlyphGUI\PREVIOUS.

Referenced by getHTML(), and getSubTabHTML().

429  {
430  global $DIC;
431 
432  $ilHelp = null;
433  if (isset($DIC["ilHelp"])) {
434  $ilHelp = $DIC["ilHelp"];
435  }
436 
438  $lng = $this->lng;
439  $ilUser = null;
440  if (isset($DIC["ilUser"])) {
441  $ilUser = $DIC->user();
442  }
443  $ilPluginAdmin = null;
444  if (isset($DIC["ilPluginAdmin"])) {
445  $ilPluginAdmin = $DIC["ilPluginAdmin"];
446  }
447 
448  // user interface hook [uihk]
449  if (!$this->getSetupMode()) {
450  $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "UIComponent", "uihk");
451  foreach ($pl_names as $pl) {
452  $ui_plugin = ilPluginAdmin::getPluginObject(IL_COMP_SERVICE, "UIComponent", "uihk", $pl);
453  $gui_class = $ui_plugin->getUIClassInstance();
454  $resp = $gui_class->modifyGUI(
455  "",
456  $a_get_sub_tabs ? "sub_tabs" : "tabs",
457  array("tabs" => $this)
458  );
459  }
460  }
461 
462 
463  // user interface hook [uihk]
464  if (!$this->getSetupMode()) {
465  $cmd = $ilCtrl->getCmd();
466  $cmdClass = $ilCtrl->getCmdClass();
467  }
468 
469  if ($a_get_sub_tabs) {
470  $tpl = new ilTemplate("tpl.sub_tabs.html", true, true, "Services/UIComponent/Tabs");
471  $pre = "sub";
472  $pre2 = "SUB_";
473  $sr_pre = "sub_";
474  } else {
475  $tpl = new ilTemplate("tpl.tabs.html", true, true, "Services/UIComponent/Tabs");
476  if ($a_after_tabs_anchor) {
477  $tpl->touchBlock("after_tabs");
478  }
479  $pre = $pre2 = "";
480 
481  include_once("./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php");
482 
483  // back 2 tab
484  if ($this->back_2_title != "") {
485  $tpl->setCurrentBlock("back_2_tab");
486  $tpl->setVariable("BACK_2_ICON", ilGlyphGUI::get(ilGlyphGUI::PREVIOUS, ilGlyphGUI::NO_TEXT));
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();
491  }
492 
493  // back tab
494  if ($this->back_title != "") {
495  $tpl->setCurrentBlock("back_tab");
496  $tpl->setVariable("BACK_ICON", ilGlyphGUI::get(ilGlyphGUI::PREVIOUS, ilGlyphGUI::NO_TEXT));
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();
501  }
502  }
503 
504  $targets = $a_get_sub_tabs ? $this->sub_target : $this->target;
505 
506  $i=0;
507 
508  // do not display one tab only
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) {
512  $i++;
513 
514  if (!is_array($target["cmd"])) {
515  $target["cmd"] = array($target["cmd"]);
516  }
517  if (!$a_manual &&
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";
521  } else {
522  $tabtype = $pre . "tabinactive";
523  }
524 
525  if ($a_manual && $target["activate"]) {
526  $tabtype = $pre . "tabactive";
527  }
528 
529  if ($tabtype == "tabactive" || $tabtype == "subtabactive") {
530  $tpl->setCurrentBlock("sel_text");
531  $tpl->setVariable("TXT_SELECTED", $lng->txt("stat_selected"));
532  $tpl->parseCurrentBlock();
533 
534  if (!$this->getSetupMode()) {
535  if ($a_get_sub_tabs) {
537  } else {
539  }
540  $ilHelp->setDefaultScreenId($part, $target["id"]);
541  }
542  }
543 
544  $tpl->setCurrentBlock($pre . "tab");
545  $tpl->setVariable("ID", $pre . "tab_" . $target["id"]);
546 
547  // tooltip
548  if (!$this->getSetupMode()) {
549  $ttext = $ilHelp->getTabTooltipText($target["id"]);
550  if ($ttext != "") {
551  include_once("./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php");
553  $pre . "tab_" . $target["id"],
554  $ttext,
555  "",
556  "bottom center",
557  "top center",
558  false
559  );
560  }
561  }
562 
563  // bs-patch: start
564  $tabtype = in_array($tabtype, array("tabactive", "subtabactive"))
565  ? "active"
566  : "";
567  // bs-patch: end
568 
569  $tpl->setVariable($pre2 . "TAB_TYPE", $tabtype);
570  if (!$this->getSetupMode()) {
571  $hash = ($ilUser->getPref("screen_reader_optimization"))
572  ? "#after_" . $sr_pre . "tabs"
573  : "";
574  }
575 
576  $tpl->setVariable($pre2 . "TAB_LINK", $target["link"] . $hash);
577  if ($target["dir_text"]) {
578  $tpl->setVariable($pre2 . "TAB_TEXT", $target["text"]);
579  } else {
580  $tpl->setVariable($pre2 . "TAB_TEXT", $lng->txt($target["text"]));
581  }
582  $tpl->setVariable($pre2 . "TAB_TARGET", $target["frame"]);
583  $tpl->parseCurrentBlock();
584  }
585 
586  if ($a_get_sub_tabs) {
587  $tpl->setVariable("TXT_SUBTABS", $lng->txt("subtabs"));
588  } else {
589  $tpl->setVariable("TXT_TABS", $lng->txt("tabs"));
590 
591  // non tabbed links
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");
596  $tpl->setVariable("TAB_ICON", " " . ilGlyphGUI::get(ilGlyphGUI::NEXT, ilGlyphGUI::NO_TEXT));
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();
602 
603  // tooltip
604  if (!$this->getSetupMode()) {
605  $ttext = $ilHelp->getTabTooltipText($link["id"]);
606  if ($ttext != "") {
607  include_once("./Services/UIComponent/Tooltip/classes/class.ilTooltipGUI.php");
609  "nontab_" . $link["id"],
610  $ttext,
611  "",
612  "bottom center",
613  "top center",
614  false
615  );
616  }
617  }
618  }
619  }
620 
621  return $tpl->get();
622  } else {
623  return "";
624  }
625  }
getSetupMode()
Get setup mode.
static addTooltip( $a_el_id, $a_text, $a_container="", $a_my="bottom center", $a_at="top center", $a_use_htmlspecialchars=true)
Adds a tooltip to an HTML element.
global $DIC
Definition: saml.php:7
static get($a_glyph, $a_text="")
Get glyph html.
const ID_PART_SUB_SCREEN
global $ilCtrl
Definition: ilias.php:18
special template class to simplify handling of ITX/PEAR
$ilUser
Definition: imgupload.php:18
static getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get Plugin Object.
Create styles array
The data for the language used.
$i
Definition: disco.tpl.php:19
const ID_PART_SCREEN
const IL_COMP_SERVICE
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ activateSubTab()

ilTabsGUI::activateSubTab (   $a_id)

Activate a specific subtab identified its id.

Parameters
string$a_textmenu item text

Definition at line 376 of file class.ilTabsGUI.php.

References setSubTabActive().

377  {
378  $this->setSubTabActive($a_id);
379  }
setSubTabActive($a_text)
DEPRECATED.
+ Here is the call graph for this function:

◆ activateTab()

ilTabsGUI::activateTab (   $a_id)

Activate a specific tab identified its id.

Parameters
string$a_textmenu item text

Definition at line 346 of file class.ilTabsGUI.php.

References setTabActive().

347  {
348  $this->setTabActive($a_id);
349  }
setTabActive($a_id)
DEPRECATED.
+ Here is the call graph for this function:

◆ addNonTabbedLink()

ilTabsGUI::addNonTabbedLink (   $a_id,
  $a_text,
  $a_link,
  $a_frame = "" 
)

Add a non-tabbed link (outside of tabs at same level)

Parameters
stringid
stringtext (no lang var!)
stringlink
stringframe target

Definition at line 416 of file class.ilTabsGUI.php.

References array.

417  {
418  $this->non_tabbed_link[] = array("text" => $a_text, "link" => $a_link,
419  "frame" => $a_frame, "dir_text" => true, "id" => $a_id, "cmdClass" => array());
420  }
Create styles array
The data for the language used.

◆ addSubTab()

ilTabsGUI::addSubTab (   $a_id,
  $a_text,
  $a_link,
  $a_frame = "" 
)

Add a Subtab.

Parameters
stringid
stringtext (no lang var!)
stringlink
stringframe target

Definition at line 311 of file class.ilTabsGUI.php.

References array.

Referenced by ilChatroomTabGUIFactory\buildTabs(), and ilIndividualAssessmentSettingsGUI\getSubTabs().

312  {
313  $this->sub_target[] = array("text" => $a_text, "link" => $a_link,
314  "frame" => $a_frame, "dir_text" => true, "id" => $a_id, "cmdClass" => array());
315  }
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ addSubTabTarget()

ilTabsGUI::addSubTabTarget (   $a_text,
  $a_link,
  $a_cmd = "",
  $a_cmdClass = "",
  $a_frame = "",
  $a_activate = false,
  $a_dir_text = false 
)

DEPRECATED.

Use addTab/addSubTab and activateTab/activateSubTab.

Add a Subtarget to the tabbed menu. If no target has set $a_activate to true, ILIAS tries to determine the current activated menu item automatically using $a_cmd and $a_cmdClass. If one item is set activated (and only one should be activated) the automatism is disabled.

Parameters
string$a_textmenu item text
string$a_linkmenu item link
string$a_cmdcommand, used for auto activation
string$a_cmdClassused for auto activation. String or array of cmd classes
string$a_frameframe target
boolean$a_activateactivate this menu item
boolean$a_dir_texttext is direct text, no language variable

Definition at line 280 of file class.ilTabsGUI.php.

References array.

Referenced by ilObjQuestionPoolGUI\addSettingsSubTabs(), and ilMembershipGUI\setSubTabs().

288  {
289  if (!$a_cmdClass) {
290  $a_cmdClass = array();
291  }
292  $a_cmdClass = !is_array($a_cmdClass) ? array(strtolower($a_cmdClass)) : $a_cmdClass;
293  #$a_cmdClass = strtolower($a_cmdClass);
294 
295  if ($a_activate) {
296  $this->subtab_manual_activation = true;
297  }
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);
301  }
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ addTab()

ilTabsGUI::addTab (   $a_id,
  $a_text,
  $a_link,
  $a_frame = "" 
)

Add a Tab.

Parameters
stringid
stringtext (no lang var!)
stringlink
stringframe target

Definition at line 164 of file class.ilTabsGUI.php.

References array.

Referenced by ilMembershipGUI\addMemberTab(), ilChatroomTabGUIFactory\buildTabs(), and ilTestToplistGUI\manageTabs().

165  {
166  $this->target[] = array("text" => $a_text, "link" => $a_link,
167  "frame" => $a_frame, "dir_text" => true, "id" => $a_id, "cmdClass" => array());
168  }
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ addTarget()

ilTabsGUI::addTarget (   $a_text,
  $a_link,
  $a_cmd = "",
  $a_cmdClass = "",
  $a_frame = "",
  $a_activate = false,
  $a_dir_text = false 
)
Deprecated:
since version 5.0

Use addTab/addSubTab and activateTab/activateSubTab.

Add a target to the tabbed menu. If no target has set $a_activate to true, ILIAS tries to determine the current activated menu item automatically using $a_cmd and $a_cmdClass. If one item is set activated (and only one should be activated) the automatism is disabled.

Parameters
string$a_textmenu item text
string$a_linkmenu item link
string$a_cmdcommand, used for auto activation
string$a_cmdClassused for auto activation. String or array of cmd classes
string$a_frameframe target
boolean$a_activateactivate this menu item

Definition at line 133 of file class.ilTabsGUI.php.

References array.

Referenced by assQuestionGUI\addTab_QuestionFeedback(), assQuestionGUI\addTab_QuestionHints(), assQuestionGUI\addTab_QuestionPreview(), and assQuestionGUI\addTab_SuggestedSolution().

141  {
142  if (!$a_cmdClass) {
143  $a_cmdClass = array();
144  }
145  $a_cmdClass = !is_array($a_cmdClass) ? array(strtolower($a_cmdClass)) : $a_cmdClass;
146  #$a_cmdClass = strtolower($a_cmdClass);
147 
148  if ($a_activate) {
149  $this->manual_activation = true;
150  }
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);
154  }
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ clearSubTabs()

ilTabsGUI::clearSubTabs ( )

Clear all already added sub tabs.

Parameters
boolean

Definition at line 386 of file class.ilTabsGUI.php.

References array.

387  {
388  $this->sub_target = array();
389  return true;
390  }
Create styles array
The data for the language used.

◆ clearTargets()

ilTabsGUI::clearTargets ( )

clear all targets

Definition at line 238 of file class.ilTabsGUI.php.

References $DIC, array, getSetupMode(), setSubTabActive(), and setTabActive().

Referenced by ilTestToplistGUI\manageTabs(), and ilIndividualAssessmentMemberGUI\setTabs().

239  {
240  global $DIC;
241 
242  $ilHelp = null;
243  if (isset($DIC["ilHelp"])) {
244  $ilHelp = $DIC["ilHelp"];
245  }
246 
247  if (!$this->getSetupMode()) {
248  $ilHelp->setScreenIdComponent("");
249  }
250 
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 = "";
258  $this->setTabActive("");
259  $this->setSubTabActive("");
260  }
getSetupMode()
Get setup mode.
setTabActive($a_id)
DEPRECATED.
global $DIC
Definition: saml.php:7
setSubTabActive($a_text)
DEPRECATED.
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getActiveTab()

ilTabsGUI::getActiveTab ( )

Definition at line 627 of file class.ilTabsGUI.php.

References $i, and $target.

628  {
629  foreach ($this->target as $i => $target) {
630  if ($this->target[$i]['activate']) {
631  return $this->target[$i]['id'];
632  }
633  }
634  }
$i
Definition: disco.tpl.php:19

◆ getForcePresentationOfSingleTab()

ilTabsGUI::getForcePresentationOfSingleTab ( )

Get force presentation of single tab.

Returns
bool force presentation of single tab

Definition at line 111 of file class.ilTabsGUI.php.

References $force_one_tab.

112  {
113  return $this->force_one_tab;
114  }

◆ getHTML()

ilTabsGUI::getHTML (   $a_after_tabs_anchor = false)

get tabs code as html

Definition at line 395 of file class.ilTabsGUI.php.

References __getHTML().

396  {
397  return $this->__getHTML(false, $this->manual_activation, $a_after_tabs_anchor);
398  }
__getHTML($a_get_sub_tabs, $a_manual, $a_after_tabs_anchor=false)
get tabs code as html
+ Here is the call graph for this function:

◆ getSetupMode()

ilTabsGUI::getSetupMode ( )

Get setup mode.

Returns
boolean setup mode

Definition at line 71 of file class.ilTabsGUI.php.

References $setup_mode.

Referenced by __getHTML(), and clearTargets().

72  {
73  return $this->setup_mode;
74  }
+ Here is the caller graph for this function:

◆ getSubTabHTML()

ilTabsGUI::getSubTabHTML ( )

get sub tabs code as html

Definition at line 403 of file class.ilTabsGUI.php.

References __getHTML().

404  {
405  return $this->__getHTML(true, $this->subtab_manual_activation);
406  }
__getHTML($a_get_sub_tabs, $a_manual, $a_after_tabs_anchor=false)
get tabs code as html
+ Here is the call graph for this function:

◆ hasTabs()

ilTabsGUI::hasTabs ( )

Definition at line 636 of file class.ilTabsGUI.php.

References $target.

637  {
638  return (bool) sizeof($this->target);
639  }

◆ removeSubTab()

ilTabsGUI::removeSubTab (   $a_id)

Remove a tab identified by its id.

Parameters
string$a_idId of tab to remove
Returns
bool false if tab wasn't found public

Definition at line 195 of file class.ilTabsGUI.php.

References $i, and $sub_target.

196  {
197  foreach ($this->sub_target as $i => $sub_target) {
198  if ($this->sub_target[$i]['id'] == $a_id) {
199  unset($this->sub_target[$i]);
200  return true;
201  }
202  }
203  return false;
204  }
$i
Definition: disco.tpl.php:19

◆ removeTab()

ilTabsGUI::removeTab (   $a_id)

Remove a tab identified by its id.

Parameters
string$a_idId of tab to remove
Returns
bool false if tab wasn't found public

Definition at line 177 of file class.ilTabsGUI.php.

References $key, and $target.

178  {
179  foreach ($this->target as $key => $target) {
180  if ($target['id'] == $a_id) {
181  unset($this->target[$key]);
182  return true;
183  }
184  }
185  return false;
186  }
$key
Definition: croninfo.php:18

◆ replaceTab()

ilTabsGUI::replaceTab (   $a_old_id,
  $a_new_id,
  $a_text,
  $a_link,
  $a_frame = '' 
)

Replace a tab.

In contrast to a combination of removeTab and addTab, the position is kept.

Parameters
string$a_old_idold id of tab
string$a_new_idnew id if tab
string$a_texttab text
string$a_linktab link
string$a_frame,[optional]frame
Returns
bool

Definition at line 217 of file class.ilTabsGUI.php.

References $i, and array.

218  {
219  for ($i = 0; $i < count($this->target); $i++) {
220  if ($this->target[$i]['id'] == $a_old_id) {
221  $this->target[$i] = array();
222  $this->target[$i] = array(
223  "text" => $a_text,
224  "link" => $a_link,
225  "frame" => $a_frame,
226  "dir_text" => true,
227  "id" => $a_new_id,
228  "cmdClass" => array());
229  return true;
230  }
231  }
232  return false;
233  }
Create styles array
The data for the language used.
$i
Definition: disco.tpl.php:19

◆ setBack2Target()

ilTabsGUI::setBack2Target (   $a_title,
  $a_target,
  $a_frame = "" 
)

back target for tow level upper context

Definition at line 89 of file class.ilTabsGUI.php.

90  {
91  $this->back_2_title = $a_title;
92  $this->back_2_target = $a_target;
93  $this->back_2_frame = $a_frame;
94  }

◆ setBackTarget()

ilTabsGUI::setBackTarget (   $a_title,
  $a_target,
  $a_frame = "" 
)

back target for upper context

Definition at line 79 of file class.ilTabsGUI.php.

Referenced by assQuestionGUI\addBackTab(), ilTestToplistGUI\manageTabs(), and ilIndividualAssessmentMemberGUI\setTabs().

80  {
81  $this->back_title = $a_title;
82  $this->back_target = $a_target;
83  $this->back_frame = $a_frame;
84  }
+ Here is the caller graph for this function:

◆ setForcePresentationOfSingleTab()

ilTabsGUI::setForcePresentationOfSingleTab (   $a_val)

Set force presentation of single tab.

Parameters
bool$a_valforce presentation of single tab

Definition at line 101 of file class.ilTabsGUI.php.

102  {
103  $this->force_one_tab = $a_val;
104  }

◆ setSetupMode()

ilTabsGUI::setSetupMode (   $a_val)

Set setup mode.

Parameters
boolean$a_valsetup mode

Definition at line 61 of file class.ilTabsGUI.php.

62  {
63  $this->setup_mode = $a_val;
64  }

◆ setSubTabActive()

ilTabsGUI::setSubTabActive (   $a_text)

DEPRECATED.

Use addTab/addSubTab and activateTab/activateSubTab.

Activate a specific tab identified by name This method overrides the definition in YOUR_OBJECT::getTabs() and deactivates all other tabs.

Parameters
string$a_textmenu item text
boolean

Definition at line 362 of file class.ilTabsGUI.php.

References $i.

Referenced by activateSubTab(), and clearTargets().

363  {
364  for ($i = 0; $i < count($this->sub_target);$i++) {
365  $this->sub_target[$i]['activate'] = $this->sub_target[$i]['id'] == $a_text;
366  }
367  $this->subtab_manual_activation = true;
368  return true;
369  }
$i
Definition: disco.tpl.php:19
+ Here is the caller graph for this function:

◆ setTabActive()

ilTabsGUI::setTabActive (   $a_id)

DEPRECATED.

Deprecated:
since version 5.2

Use addTab/addSubTab and activateTab/activateSubTab.

Activate a specific tab identified by name This method overrides the definition in YOUR_OBJECT::getTabs() and deactivates all other tabs.

Parameters
string$a_textmenu item text

Definition at line 328 of file class.ilTabsGUI.php.

References $key, and $target.

Referenced by activateTab(), clearTargets(), and ilTestToplistGUI\manageTabs().

329  {
330  foreach ($this->target as $key => $target) {
331  $this->target[$key]['activate'] = $this->target[$key]['id'] == $a_id;
332  }
333  if ($a_id != "") {
334  $this->manual_activation = true;
335  } else {
336  $this->manual_activation = false;
337  }
338  return true;
339  }
$key
Definition: croninfo.php:18
+ Here is the caller graph for this function:

Field Documentation

◆ $ctrl

ilTabsGUI::$ctrl
protected

Definition at line 18 of file class.ilTabsGUI.php.

Referenced by __getHTML().

◆ $force_one_tab

ilTabsGUI::$force_one_tab = false
protected

Definition at line 30 of file class.ilTabsGUI.php.

Referenced by getForcePresentationOfSingleTab().

◆ $lng

ilTabsGUI::$lng

Definition at line 23 of file class.ilTabsGUI.php.

Referenced by __construct(), and __getHTML().

◆ $non_tabbed_link

ilTabsGUI::$non_tabbed_link = array()

Definition at line 27 of file class.ilTabsGUI.php.

◆ $obj_type

ilTabsGUI::$obj_type

Definition at line 21 of file class.ilTabsGUI.php.

◆ $setup_mode

ilTabsGUI::$setup_mode = false

Definition at line 28 of file class.ilTabsGUI.php.

Referenced by getSetupMode().

◆ $sub_target

ilTabsGUI::$sub_target = array()

Definition at line 26 of file class.ilTabsGUI.php.

Referenced by removeSubTab().

◆ $tabs

ilTabsGUI::$tabs

Definition at line 24 of file class.ilTabsGUI.php.

◆ $target

ilTabsGUI::$target = array()

Definition at line 25 of file class.ilTabsGUI.php.

Referenced by __getHTML(), getActiveTab(), hasTabs(), removeTab(), and setTabActive().

◆ $target_script

ilTabsGUI::$target_script

Definition at line 20 of file class.ilTabsGUI.php.

◆ $tpl

ilTabsGUI::$tpl

Definition at line 22 of file class.ilTabsGUI.php.

Referenced by __construct(), and __getHTML().


The documentation for this class was generated from the following file: