ILIAS  trunk Revision v11.0_alpha-1761-g6dbbfa7b760
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilTabsGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for ilTabsGUI:

Public Member Functions

 setSetupMode (bool $a_val)
 
 getSetupMode ()
 
 setBackTarget (string $a_title, string $a_target, string $a_frame="")
 
 setBack2Target (string $a_title, string $a_target, string $a_frame="")
 
 setForcePresentationOfSingleTab (bool $a_val)
 
 getForcePresentationOfSingleTab ()
 
 addTarget (string $a_text, string $a_link, $a_cmd="", $a_cmdClass="", string $a_frame="", bool $a_activate=false, bool $a_dir_text=false)
 
 addTab (string $a_id, string $a_text, string $a_link, string $a_frame="")
 Add a Tab. More...
 
 removeTab (string $a_id)
 Remove a tab identified by its id. More...
 
 removeSubTab (string $a_id)
 Remove a subtab identified by its id. More...
 
 replaceTab (string $a_old_id, string $a_new_id, string $a_text, string $a_link, string $a_frame='')
 Replace a tab. More...
 
 clearTargets ()
 clear all targets More...
 
 addSubTabTarget (string $a_text, string $a_link, $a_cmd="", $a_cmdClass="", string $a_frame="", bool $a_activate=false, bool $a_dir_text=false)
 
 addSubTab (string $a_id, string $a_text, string $a_link, string $a_frame="")
 
 setTabActive (string $a_id)
 
 activateTab (string $a_id)
 
 setSubTabActive (string $a_text)
 
 activateSubTab (string $a_id)
 
 clearSubTabs ()
 
 getHTML (bool $a_after_tabs_anchor=false)
 
 getSubTabHTML ()
 
 addNonTabbedLink (string $a_id, string $a_text, string $a_link, string $a_frame="")
 
 removeNonTabbedLinks ()
 
 getActiveTab ()
 
 hasTabs ()
 

Data Fields

string $target_script
 
string $obj_type
 
ilGlobalTemplateInterface $tpl
 
ilLanguage $lng
 
array $tabs
 
array $target = array()
 
array $sub_target = array()
 
array $non_tabbed_link = array()
 
bool $setup_mode = false
 
string $back_target
 

Protected Member Functions

 symbol ()
 
 getTabTextOfId (string $id)
 

Protected Attributes

ilCtrl $ctrl
 
bool $force_one_tab = false
 
bool $manual_activation
 
bool $subtab_manual_activation
 
bool $sub_tabs
 
string $temp_var
 
string $back_title
 
string $back_2_target
 
string $back_2_title
 
string $back_2_frame
 
string $back_frame
 

Private Member Functions

 isTabActive (bool $isSubTabsContext, array $target, ?string $cmd, ?string $cmdClass)
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Tabs GUI

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de
Deprecated:
10

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

Member Function Documentation

◆ activateSubTab()

◆ activateTab()

◆ addNonTabbedLink()

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

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

320  : void {
321  $this->non_tabbed_link[] = array("text" => $a_text, "link" => $a_link,
322  "frame" => $a_frame, "dir_text" => true, "id" => $a_id, "cmdClass" => array());
323  }

◆ addSubTab()

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

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

Referenced by ilObjWorkspaceFolderGUI\addContentSubTabs(), ilObjQuestionPoolGUI\addSettingsSubTabs(), ilTaxMDGUI\addSubTab(), ilContainerSkillGUI\addTabs(), ilChatroomTabGUIFactory\buildTabs(), ilIndividualAssessmentSettingsGUI\getSubTabs(), ilSurveyParticipantsGUI\setParticipantSubTabs(), and ilBookingGatewayGUI\setSubTabs().

259  : void {
260  $this->sub_target[] = array("text" => $a_text, "link" => $a_link,
261  "frame" => $a_frame, "dir_text" => true, "id" => $a_id, "cmdClass" => array());
262  }
+ Here is the caller graph for this function:

◆ addSubTabTarget()

ilTabsGUI::addSubTabTarget ( string  $a_text,
string  $a_link,
  $a_cmd = "",
  $a_cmdClass = "",
string  $a_frame = "",
bool  $a_activate = false,
bool  $a_dir_text = false 
)
Deprecated:
Parameters
string | array$a_cmd
string | array$a_cmdClass

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

Referenced by ilInfoScreenGUI\getTabs(), ilLearningSequenceMembershipGUI\setSubTabs(), and ilMembershipGUI\setSubTabs().

239  : void {
240  if (!$a_cmdClass) {
241  $a_cmdClass = array();
242  }
243  $a_cmdClass = !is_array($a_cmdClass) ? array(strtolower($a_cmdClass)) : $a_cmdClass;
244  #$a_cmdClass = strtolower($a_cmdClass);
245 
246  if ($a_activate) {
247  $this->subtab_manual_activation = true;
248  }
249  $this->sub_target[] = array("text" => $a_text, "link" => $a_link,
250  "cmd" => $a_cmd, "cmdClass" => $a_cmdClass, "frame" => $a_frame,
251  "activate" => $a_activate, "dir_text" => $a_dir_text, "id" => $a_text);
252  }
+ Here is the caller graph for this function:

◆ addTab()

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

◆ addTarget()

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

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

Referenced by ilObjectPluginGUI\addInfoTab(), ilObjectPluginGUI\addInilPluginAdminfoTab(), assQuestionGUI\addTab_Question(), assQuestionGUI\addTab_QuestionFeedback(), assQuestionGUI\addTab_QuestionHints(), assQuestionGUI\addTab_SuggestedSolution(), ilObjMediaObjectsSettingsGUI\getAdminTabs(), ilPCMediaObjectGUI\getTabs(), and assFormulaQuestionGUI\setQuestionSpecificTabs().

128  : void {
129  if (!$a_cmdClass) {
130  $a_cmdClass = array();
131  }
132  $a_cmdClass = !is_array($a_cmdClass) ? array(strtolower($a_cmdClass)) : $a_cmdClass;
133 
134  if ($a_activate) {
135  $this->manual_activation = true;
136  }
137  $this->target[] = array("text" => $a_text, "link" => $a_link,
138  "cmd" => $a_cmd, "cmdClass" => $a_cmdClass, "frame" => $a_frame,
139  "activate" => $a_activate, "dir_text" => $a_dir_text, "id" => $a_text);
140  }
+ Here is the caller graph for this function:

◆ clearSubTabs()

ilTabsGUI::clearSubTabs ( )

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

300  : void
301  {
302  $this->sub_target = array();
303  }

◆ clearTargets()

ilTabsGUI::clearTargets ( )

clear all targets

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

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

Referenced by ilSurveyParticipantsGUI\confirmAppraiseeCloseObject(), ilBookingObjectGUI\confirmDelete(), ilBadgeManagementGUI\confirmDeleteBadges(), ilObjBadgeAdministrationGUI\confirmDeleteObjectBadges(), ilSkillProfileGUI\confirmLevelAssignmentRemoval(), ilBookingObjectGUI\create(), ilObjSkillTreeGUI\create(), ilSkillProfileGUI\createLocal(), ilBlogPostingGUI\editDate(), ilBlogPostingGUI\editTitle(), ILIAS\Wiki\Export\WikiHtmlExport\exportPageHTML(), ilNewsItemGUI\initFormNewsItem(), ilNewsForContextBlockGUI\initSettingsForm(), ilSurveySkillThresholdsGUI\listSkillThresholds(), ilObjSkillTreeGUI\save(), ilContainerGUI\showContainerPageTabs(), and ilSkillProfileGUI\showLevelsWithLocalContext().

205  : void
206  {
207  global $DIC;
208 
209  $ilHelp = $DIC["ilHelp"] ?? null;
210 
211  if (!$this->getSetupMode()) {
212  $ilHelp->setScreenIdComponent("");
213  }
214 
215  $this->target = array();
216  $this->sub_target = array();
217  $this->non_tabbed_link = array();
218  $this->back_title = "";
219  $this->back_target = "";
220  $this->back_2_target = "";
221  $this->back_2_title = "";
222  $this->setTabActive("");
223  $this->setSubTabActive("");
224  }
setTabActive(string $a_id)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
global $DIC
Definition: shib_login.php:22
setSubTabActive(string $a_text)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getActiveTab()

ilTabsGUI::getActiveTab ( )

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

References null.

Referenced by removeNonTabbedLinks().

542  : string
543  {
544  foreach ($this->target as $i => $target) {
545  if ($this->target[$i]['activate'] ?? null) {
546  return $this->target[$i]['id'];
547  }
548  }
549  return "";
550  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
+ Here is the caller graph for this function:

◆ getForcePresentationOfSingleTab()

ilTabsGUI::getForcePresentationOfSingleTab ( )

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

References $force_one_tab.

110  : bool
111  {
112  return $this->force_one_tab;
113  }
bool $force_one_tab

◆ getHTML()

ilTabsGUI::getHTML ( bool  $a_after_tabs_anchor = false)

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

305  : string
306  {
307  return $this->__getHTML(false, $a_after_tabs_anchor);
308  }

◆ getSetupMode()

ilTabsGUI::getSetupMode ( )

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

References $setup_mode.

Referenced by clearTargets(), and removeNonTabbedLinks().

80  : bool
81  {
82  return $this->setup_mode;
83  }
+ Here is the caller graph for this function:

◆ getSubTabHTML()

ilTabsGUI::getSubTabHTML ( )

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

310  : string
311  {
312  return $this->__getHTML(true);
313  }

◆ getTabTextOfId()

ilTabsGUI::getTabTextOfId ( string  $id)
protected

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

References ILIAS\Repository\lng().

Referenced by removeNonTabbedLinks().

528  : string
529  {
530  foreach ($this->target as $i => $target) {
531  if ($this->target[$i]['id'] == $id) {
532  if ($target["dir_text"]) {
533  return $target["text"];
534  } else {
535  return $this->lng->txt($target["text"]);
536  }
537  }
538  }
539  return "";
540  }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasTabs()

ilTabsGUI::hasTabs ( )

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

552  : bool
553  {
554  return $this->target !== [];
555  }

◆ isTabActive()

ilTabsGUI::isTabActive ( bool  $isSubTabsContext,
array  $target,
?string  $cmd,
?string  $cmdClass 
)
private

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

Referenced by removeNonTabbedLinks().

557  : bool
558  {
559  if (($isSubTabsContext && $this->subtab_manual_activation) || (!$isSubTabsContext && $this->manual_activation)) {
560  return false;
561  }
562 
563  $cmdClass = (string) $cmdClass;
564  $cmd = (string) $cmd;
565 
566  $targetMatchesCmdClass = (
567  !$target['cmdClass'] ||
568  in_array(strtolower($cmdClass), array_map('strtolower', $target['cmdClass']), true)
569  );
570 
571  $targetMatchesCmd = (
572  in_array(strtolower($cmd), array_map('strtolower', $target['cmd']), true) ||
573  (count($target['cmd']) === 1 && $target['cmd'][0] === '')
574  );
575 
576  return $targetMatchesCmd && $targetMatchesCmdClass;
577  }
+ Here is the caller graph for this function:

◆ removeNonTabbedLinks()

◆ removeSubTab()

ilTabsGUI::removeSubTab ( string  $a_id)

Remove a subtab identified by its id.

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

170  : void
171  {
172  foreach ($this->sub_target as $i => $sub_target) {
173  if ($this->sub_target[$i]['id'] == $a_id) {
174  unset($this->sub_target[$i]);
175  }
176  }
177  }
array $sub_target

◆ removeTab()

ilTabsGUI::removeTab ( string  $a_id)

Remove a tab identified by its id.

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

158  : void
159  {
160  foreach ($this->target as $key => $target) {
161  if ($target['id'] == $a_id) {
162  unset($this->target[$key]);
163  }
164  }
165  }

◆ replaceTab()

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

Replace a tab.

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

188  : void {
189  for ($i = 0, $iMax = count($this->target); $i < $iMax; $i++) {
190  if ($this->target[$i]['id'] == $a_old_id) {
191  $this->target[$i] = array(
192  "text" => $a_text,
193  "link" => $a_link,
194  "frame" => $a_frame,
195  "dir_text" => true,
196  "id" => $a_new_id,
197  "cmdClass" => array());
198  }
199  }
200  }

◆ setBack2Target()

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

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

99  : void {
100  $this->back_2_title = $a_title;
101  $this->back_2_target = $a_target;
102  $this->back_2_frame = $a_frame;
103  }

◆ setBackTarget()

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

◆ setForcePresentationOfSingleTab()

ilTabsGUI::setForcePresentationOfSingleTab ( bool  $a_val)

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

105  : void
106  {
107  $this->force_one_tab = $a_val;
108  }

◆ setSetupMode()

ilTabsGUI::setSetupMode ( bool  $a_val)

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

Referenced by ilLMMenuRendererGUI\render().

75  : void
76  {
77  $this->setup_mode = $a_val;
78  }
+ Here is the caller graph for this function:

◆ setSubTabActive()

ilTabsGUI::setSubTabActive ( string  $a_text)
Deprecated:
since version 5.2

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

Referenced by activateSubTab(), and clearTargets().

287  : void
288  {
289  for ($i = 0, $iMax = count($this->sub_target); $i < $iMax; $i++) {
290  $this->sub_target[$i]['activate'] = $this->sub_target[$i]['id'] === $a_text;
291  }
292  $this->subtab_manual_activation = true;
293  }
+ Here is the caller graph for this function:

◆ setTabActive()

ilTabsGUI::setTabActive ( string  $a_id)
Deprecated:
since version 5.2

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

Referenced by activateTab(), clearTargets(), ilPCInteractiveImageGUI\confirmDeleteOverlays(), ilPCInteractiveImageGUI\confirmPopupDeletion(), ilPCQuestionGUI\edit(), ilContainerReferenceGUI\editObject(), ilObjTaggingSettingsGUI\editSettings(), ilPCQuestionGUI\feedback(), ilPCInteractiveImageGUI\initAddOverlaysForm(), and ilPageLayoutGUI\properties().

267  : void
268  {
269  foreach ($this->target as $key => $target) {
270  $this->target[$key]['activate'] = $this->target[$key]['id'] === $a_id;
271  }
272  if ($a_id !== "") {
273  $this->manual_activation = true;
274  } else {
275  $this->manual_activation = false;
276  }
277  }
+ Here is the caller graph for this function:

◆ symbol()

ilTabsGUI::symbol ( )
protected

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

References $DIC.

Referenced by removeNonTabbedLinks().

70  {
71  global $DIC;
72  return $DIC->repository()->internal()->gui()->symbol();
73  }
global $DIC
Definition: shib_login.php:22
+ Here is the caller graph for this function:

Field Documentation

◆ $back_2_frame

string ilTabsGUI::$back_2_frame
protected

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

◆ $back_2_target

string ilTabsGUI::$back_2_target
protected

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

◆ $back_2_title

string ilTabsGUI::$back_2_title
protected

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

◆ $back_frame

string ilTabsGUI::$back_frame
protected

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

◆ $back_target

string ilTabsGUI::$back_target

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

◆ $back_title

string ilTabsGUI::$back_title
protected

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

◆ $ctrl

ilCtrl ilTabsGUI::$ctrl
protected

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

Referenced by removeNonTabbedLinks().

◆ $force_one_tab

bool ilTabsGUI::$force_one_tab = false
protected

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

Referenced by getForcePresentationOfSingleTab().

◆ $lng

ilLanguage ilTabsGUI::$lng

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

Referenced by removeNonTabbedLinks().

◆ $manual_activation

bool ilTabsGUI::$manual_activation
protected

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

◆ $non_tabbed_link

array ilTabsGUI::$non_tabbed_link = array()

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

◆ $obj_type

string ilTabsGUI::$obj_type

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

◆ $setup_mode

bool ilTabsGUI::$setup_mode = false

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

Referenced by getSetupMode().

◆ $sub_tabs

bool ilTabsGUI::$sub_tabs
protected

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

◆ $sub_target

array ilTabsGUI::$sub_target = array()

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

◆ $subtab_manual_activation

bool ilTabsGUI::$subtab_manual_activation
protected

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

◆ $tabs

array ilTabsGUI::$tabs

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

◆ $target

array ilTabsGUI::$target = array()

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

Referenced by removeNonTabbedLinks().

◆ $target_script

string ilTabsGUI::$target_script

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

◆ $temp_var

string ilTabsGUI::$temp_var
protected

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

◆ $tpl

ilGlobalTemplateInterface ilTabsGUI::$tpl

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


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