ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables 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

 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

Definition at line 23 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 307 of file class.ilTabsGUI.php.

312  : void {
313  $this->non_tabbed_link[] = array("text" => $a_text, "link" => $a_link,
314  "frame" => $a_frame, "dir_text" => true, "id" => $a_id, "cmdClass" => array());
315  }

◆ addSubTab()

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

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

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

251  : void {
252  $this->sub_target[] = array("text" => $a_text, "link" => $a_link,
253  "frame" => $a_frame, "dir_text" => true, "id" => $a_id, "cmdClass" => array());
254  }
+ 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 223 of file class.ilTabsGUI.php.

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

231  : void {
232  if (!$a_cmdClass) {
233  $a_cmdClass = array();
234  }
235  $a_cmdClass = !is_array($a_cmdClass) ? array(strtolower($a_cmdClass)) : $a_cmdClass;
236  #$a_cmdClass = strtolower($a_cmdClass);
237 
238  if ($a_activate) {
239  $this->subtab_manual_activation = true;
240  }
241  $this->sub_target[] = array("text" => $a_text, "link" => $a_link,
242  "cmd" => $a_cmd, "cmdClass" => $a_cmdClass, "frame" => $a_frame,
243  "activate" => $a_activate, "dir_text" => $a_dir_text, "id" => $a_text);
244  }
+ 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 112 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().

120  : void {
121  if (!$a_cmdClass) {
122  $a_cmdClass = array();
123  }
124  $a_cmdClass = !is_array($a_cmdClass) ? array(strtolower($a_cmdClass)) : $a_cmdClass;
125 
126  if ($a_activate) {
127  $this->manual_activation = true;
128  }
129  $this->target[] = array("text" => $a_text, "link" => $a_link,
130  "cmd" => $a_cmd, "cmdClass" => $a_cmdClass, "frame" => $a_frame,
131  "activate" => $a_activate, "dir_text" => $a_dir_text, "id" => $a_text);
132  }
+ Here is the caller graph for this function:

◆ clearSubTabs()

ilTabsGUI::clearSubTabs ( )

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

Referenced by ilSurveyPageEditGUI\callEditor().

292  : void
293  {
294  $this->sub_target = array();
295  }
+ Here is the caller graph for this function:

◆ clearTargets()

ilTabsGUI::clearTargets ( )

clear all targets

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

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

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

197  : void
198  {
199  global $DIC;
200 
201  $ilHelp = $DIC["ilHelp"] ?? null;
202 
203  if (!$this->getSetupMode()) {
204  $ilHelp->setScreenIdComponent("");
205  }
206 
207  $this->target = array();
208  $this->sub_target = array();
209  $this->non_tabbed_link = array();
210  $this->back_title = "";
211  $this->back_target = "";
212  $this->back_2_target = "";
213  $this->back_2_title = "";
214  $this->setTabActive("");
215  $this->setSubTabActive("");
216  }
setTabActive(string $a_id)
global $DIC
Definition: feed.php:28
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 536 of file class.ilTabsGUI.php.

References $i.

Referenced by removeNonTabbedLinks().

536  : string
537  {
538  foreach ($this->target as $i => $target) {
539  if ($this->target[$i]['activate'] ?? null) {
540  return $this->target[$i]['id'];
541  }
542  }
543  return "";
544  }
$i
Definition: metadata.php:41
+ Here is the caller graph for this function:

◆ getForcePresentationOfSingleTab()

ilTabsGUI::getForcePresentationOfSingleTab ( )

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

References $force_one_tab.

102  : bool
103  {
104  return $this->force_one_tab;
105  }
bool $force_one_tab

◆ getHTML()

ilTabsGUI::getHTML ( bool  $a_after_tabs_anchor = false)

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

297  : string
298  {
299  return $this->__getHTML(false, $a_after_tabs_anchor);
300  }

◆ getSetupMode()

ilTabsGUI::getSetupMode ( )

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

References $setup_mode.

Referenced by clearTargets(), and removeNonTabbedLinks().

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

◆ getSubTabHTML()

ilTabsGUI::getSubTabHTML ( )

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

302  : string
303  {
304  return $this->__getHTML(true);
305  }

◆ getTabTextOfId()

ilTabsGUI::getTabTextOfId ( string  $id)
protected

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

References $i, and ILIAS\Repository\lng().

Referenced by removeNonTabbedLinks().

522  : string
523  {
524  foreach ($this->target as $i => $target) {
525  if ($this->target[$i]['id'] == $id) {
526  if ($target["dir_text"]) {
527  return $target["text"];
528  } else {
529  return $this->lng->txt($target["text"]);
530  }
531  }
532  }
533  return "";
534  }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
$i
Definition: metadata.php:41
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ hasTabs()

ilTabsGUI::hasTabs ( )

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

546  : bool
547  {
548  return $this->target !== [];
549  }

◆ isTabActive()

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

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

Referenced by removeNonTabbedLinks().

551  : bool
552  {
553  if (($isSubTabsContext && $this->subtab_manual_activation) || (!$isSubTabsContext && $this->manual_activation)) {
554  return false;
555  }
556 
557  $cmdClass = (string) $cmdClass;
558  $cmd = (string) $cmd;
559 
560  $targetMatchesCmdClass = (
561  !$target['cmdClass'] ||
562  in_array(strtolower($cmdClass), array_map('strtolower', $target['cmdClass']), true)
563  );
564 
565  $targetMatchesCmd = (
566  in_array(strtolower($cmd), array_map('strtolower', $target['cmd']), true) ||
567  (count($target['cmd']) === 1 && $target['cmd'][0] === '')
568  );
569 
570  return $targetMatchesCmd && $targetMatchesCmdClass;
571  }
+ 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 162 of file class.ilTabsGUI.php.

References $i.

162  : void
163  {
164  foreach ($this->sub_target as $i => $sub_target) {
165  if ($this->sub_target[$i]['id'] == $a_id) {
166  unset($this->sub_target[$i]);
167  }
168  }
169  }
array $sub_target
$i
Definition: metadata.php:41

◆ removeTab()

ilTabsGUI::removeTab ( string  $a_id)

Remove a tab identified by its id.

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

References ILIAS\LTI\ToolProvider\$key.

150  : void
151  {
152  foreach ($this->target as $key => $target) {
153  if ($target['id'] == $a_id) {
154  unset($this->target[$key]);
155  }
156  }
157  }
string $key
Consumer key/client ID value.
Definition: System.php:193

◆ 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 174 of file class.ilTabsGUI.php.

References $i.

180  : void {
181  for ($i = 0, $iMax = count($this->target); $i < $iMax; $i++) {
182  if ($this->target[$i]['id'] == $a_old_id) {
183  $this->target[$i] = array(
184  "text" => $a_text,
185  "link" => $a_link,
186  "frame" => $a_frame,
187  "dir_text" => true,
188  "id" => $a_new_id,
189  "cmdClass" => array());
190  }
191  }
192  }
$i
Definition: metadata.php:41

◆ setBack2Target()

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

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

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

◆ setBackTarget()

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

◆ setForcePresentationOfSingleTab()

ilTabsGUI::setForcePresentationOfSingleTab ( bool  $a_val)

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

97  : void
98  {
99  $this->force_one_tab = $a_val;
100  }

◆ setSetupMode()

ilTabsGUI::setSetupMode ( bool  $a_val)

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

Referenced by ilLMMenuRendererGUI\render().

67  : void
68  {
69  $this->setup_mode = $a_val;
70  }
+ Here is the caller graph for this function:

◆ setSubTabActive()

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

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

References $i.

Referenced by activateSubTab(), and clearTargets().

279  : void
280  {
281  for ($i = 0, $iMax = count($this->sub_target); $i < $iMax; $i++) {
282  $this->sub_target[$i]['activate'] = $this->sub_target[$i]['id'] === $a_text;
283  }
284  $this->subtab_manual_activation = true;
285  }
$i
Definition: metadata.php:41
+ Here is the caller graph for this function:

◆ setTabActive()

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

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

References ILIAS\LTI\ToolProvider\$key.

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

259  : void
260  {
261  foreach ($this->target as $key => $target) {
262  $this->target[$key]['activate'] = $this->target[$key]['id'] === $a_id;
263  }
264  if ($a_id !== "") {
265  $this->manual_activation = true;
266  } else {
267  $this->manual_activation = false;
268  }
269  }
string $key
Consumer key/client ID value.
Definition: System.php:193
+ Here is the caller graph for this function:

Field Documentation

◆ $back_2_frame

string ilTabsGUI::$back_2_frame
protected

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

◆ $back_2_target

string ilTabsGUI::$back_2_target
protected

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

◆ $back_2_title

string ilTabsGUI::$back_2_title
protected

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

◆ $back_frame

string ilTabsGUI::$back_frame
protected

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

◆ $back_target

string ilTabsGUI::$back_target

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

◆ $back_title

string ilTabsGUI::$back_title
protected

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

◆ $ctrl

ilCtrl ilTabsGUI::$ctrl
protected

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

Referenced by removeNonTabbedLinks().

◆ $force_one_tab

bool ilTabsGUI::$force_one_tab = false
protected

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

Referenced by getForcePresentationOfSingleTab().

◆ $lng

ilLanguage ilTabsGUI::$lng

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

Referenced by removeNonTabbedLinks().

◆ $manual_activation

bool ilTabsGUI::$manual_activation
protected

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

◆ $non_tabbed_link

array ilTabsGUI::$non_tabbed_link = array()

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

◆ $obj_type

string ilTabsGUI::$obj_type

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

◆ $setup_mode

bool ilTabsGUI::$setup_mode = false

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

Referenced by getSetupMode().

◆ $sub_tabs

bool ilTabsGUI::$sub_tabs
protected

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

◆ $sub_target

array ilTabsGUI::$sub_target = array()

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

◆ $subtab_manual_activation

bool ilTabsGUI::$subtab_manual_activation
protected

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

◆ $tabs

array ilTabsGUI::$tabs

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

◆ $target

array ilTabsGUI::$target = array()

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

Referenced by removeNonTabbedLinks().

◆ $target_script

string ilTabsGUI::$target_script

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

◆ $temp_var

string ilTabsGUI::$temp_var
protected

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

◆ $tpl

ilGlobalTemplateInterface ilTabsGUI::$tpl

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


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