ILIAS  release_8 Revision v8.24
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.

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 }

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

+ 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.

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 }

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

+ Here is the caller graph for this function:

◆ addTab()

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

Add a Tab.

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

142 : void {
143 $this->target[] = array("text" => $a_text, "link" => $a_link,
144 "frame" => $a_frame, "dir_text" => true, "id" => $a_id, "cmdClass" => array());
145 }

Referenced by ilMembershipGUI\addMemberTab(), ilSkillTreeNodeGUI\addObjectsTab(), ilSkillTreeNodeGUI\addUsageTab(), ilChatroomTabGUIFactory\buildTabs(), ilObjPortfolioAdministrationGUI\getAdminTabs(), ilObjAccessibilitySettingsGUI\getAdminTabs(), ilObjLearningHistorySettingsGUI\getAdminTabs(), ilObjCommentsSettingsGUI\getAdminTabs(), ilObjNotesSettingsGUI\getAdminTabs(), ilObjPersonalWorkspaceSettingsGUI\getAdminTabs(), and ilAchievementsGUI\setTabs().

+ Here is the caller graph for this function:

◆ 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.

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 }

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

+ Here is the caller graph for this function:

◆ clearSubTabs()

ilTabsGUI::clearSubTabs ( )

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

292 : void
293 {
294 $this->sub_target = array();
295 }

◆ clearTargets()

ilTabsGUI::clearTargets ( )

clear all targets

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

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 }
global $DIC
Definition: feed.php:28

References $DIC.

Referenced by ilSkillProfileGUI\confirmLevelAssignmentRemoval(), ilObjSkillTreeGUI\create(), ilBookingObjectGUI\create(), ilSkillProfileGUI\createLocal(), ilExerciseManagementGUI\executeCommand(), ilNewsItemGUI\initFormNewsItem(), ilNewsForContextBlockGUI\initSettingsForm(), ilStructureObjectGUI\insertTemplate(), ilSurveySkillThresholdsGUI\listSkillThresholds(), ilObjSkillTreeGUI\save(), ilContainerGUI\showContainerPageTabs(), and ilSkillProfileGUI\showLevelsWithLocalContext().

+ Here is the caller graph for this function:

◆ getActiveTab()

ilTabsGUI::getActiveTab ( )

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

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

References $i.

◆ getForcePresentationOfSingleTab()

ilTabsGUI::getForcePresentationOfSingleTab ( )

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

102 : bool
103 {
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.

72 : bool
73 {
74 return $this->setup_mode;
75 }

References $setup_mode.

◆ 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.

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

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

+ Here is the call 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.

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 }

◆ removeNonTabbedLinks()

ilTabsGUI::removeNonTabbedLinks ( )

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

317 : void
318 {
319 $this->non_tabbed_link = [];
320 }

◆ removeSubTab()

ilTabsGUI::removeSubTab ( string  $a_id)

Remove a subtab identified by its id.

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

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

References $i.

◆ removeTab()

ilTabsGUI::removeTab ( string  $a_id)

Remove a tab identified by its id.

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

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

References ILIAS\LTI\ToolProvider\$key.

◆ 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.

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 }

References $i.

◆ 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 = "" 
)

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

81 : void {
82 $this->back_title = $a_title;
83 $this->back_target = $a_target;
84 $this->back_frame = $a_frame;
85 }

Referenced by assQuestionGUI\addBackTab(), ilLMPageObjectGUI\create(), ilObjSkillTreeGUI\create(), ilSkillTreeNodeGUI\create(), ilSkillProfileGUI\createLocal(), ilStructureObjectGUI\insertTemplate(), ilObjSkillTreeGUI\save(), ilContainerGUI\showContainerPageTabs(), ilSkillProfileGUI\showLevelsWithLocalContext(), and ilLMPresentationGUI\showPrintView().

+ Here is the caller graph for this function:

◆ 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.

67 : void
68 {
69 $this->setup_mode = $a_val;
70 }

Referenced by ilLMMenuRendererGUI\render().

+ 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.

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 }

References $i.

◆ setTabActive()

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

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

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 }

References ILIAS\LTI\ToolProvider\$key.

Referenced by ilPCQuestionGUI\edit(), ilContainerReferenceGUI\editObject(), ilObjTaggingSettingsGUI\editSettings(), ilPCQuestionGUI\feedback(), assQuestionGUI\save(), and assQuestionGUI\saveReturn().

+ 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.

◆ $force_one_tab

bool ilTabsGUI::$force_one_tab = false
protected

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

◆ $lng

ilLanguage ilTabsGUI::$lng

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

◆ $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.

◆ $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: