ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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:
with ILIAS 12

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.

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 }

Referenced by ilObjWorkspaceFolderGUI\addContentSubTabs(), ilObjQuestionPoolGUI\addSettingsSubTabs(), 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 231 of file class.ilTabsGUI.php.

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 }

Referenced by ilRTESettingsGUI\addSubtabs(), 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 145 of file class.ilTabsGUI.php.

150 : void {
151 $this->target[] = array("text" => $a_text, "link" => $a_link,
152 "frame" => $a_frame, "dir_text" => true, "id" => $a_id, "cmdClass" => array());
153 }

Referenced by ilMembershipGUI\addMemberTab(), ilSkillTreeNodeGUI\addObjectsTab(), ilSkillTreeNodeGUI\addUsageTab(), ilChatroomTabGUIFactory\buildTabs(), ilObjAccessibilitySettingsGUI\getAdminTabs(), ilObjLearningHistorySettingsGUI\getAdminTabs(), ilObjCommentsSettingsGUI\getAdminTabs(), ilObjNotesSettingsGUI\getAdminTabs(), ilObjPersonalWorkspaceSettingsGUI\getAdminTabs(), ilObjPortfolioAdministrationGUI\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 120 of file class.ilTabsGUI.php.

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 }

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

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

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

References $DIC.

Referenced by ilSkillProfileGUI\confirmLevelAssignmentRemoval(), ilObjSkillTreeGUI\create(), ilBookingObjectGUI\create(), ilSkillProfileGUI\createLocal(), ilNewsItemGUI\initFormNewsItem(), ilNewsForContextBlockGUI\initSettingsForm(), ilSurveySkillThresholdsGUI\listSkillThresholds(), ilObjSkillTreeGUI\save(), and ilSkillProfileGUI\showLevelsWithLocalContext().

+ Here is the caller graph for this function:

◆ getActiveTab()

ilTabsGUI::getActiveTab ( )

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

543 : string
544 {
545 foreach ($this->target as $i => $target) {
546 if ($this->target[$i]['activate'] ?? null) {
547 return $this->target[$i]['id'];
548 }
549 }
550 return "";
551 }

◆ getForcePresentationOfSingleTab()

ilTabsGUI::getForcePresentationOfSingleTab ( )

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

110 : bool
111 {
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.

80 : bool
81 {
82 return $this->setup_mode;
83 }

References $setup_mode.

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

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

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

+ Here is the call graph for this function:

◆ hasTabs()

ilTabsGUI::hasTabs ( )

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

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

◆ isTabActive()

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

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

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

◆ removeNonTabbedLinks()

ilTabsGUI::removeNonTabbedLinks ( )

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

325 : void
326 {
327 $this->non_tabbed_link = [];
328 }

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

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

89 : void {
90 $this->back_title = $a_title;
91 $this->back_target = $a_target;
92 $this->back_frame = $a_frame;
93 }

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

+ Here is the caller graph for this function:

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

75 : void
76 {
77 $this->setup_mode = $a_val;
78 }

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

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 }

◆ setTabActive()

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

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

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 }

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

+ Here is the caller graph for this function:

◆ symbol()

ilTabsGUI::symbol ( )
protected

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

70 {
71 global $DIC;
72 return $DIC->repository()->internal()->gui()->symbol();
73 }

References $DIC.

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.

◆ $force_one_tab

bool ilTabsGUI::$force_one_tab = false
protected

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

◆ $lng

ilLanguage ilTabsGUI::$lng

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

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

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