19declare(strict_types=1);
24use ILIAS\GlobalScreen\GUI\I18n\Translator;
38 private Translator $translator,
48 $tab = $this->
structure->getById($tab_id);
52 if ($tab->getParent() ===
null) {
53 $this->active_tab = $tab_id;
55 $this->active_subtab = $tab_id;
56 $this->active_tab = $tab->getParent()->getId();
65 ?
string $handling_class =
null,
67 if ($handling_class === null) {
68 if ($target instanceof
URI) {
69 throw new \InvalidArgumentException(
'No handling class given');
71 if (is_array($target[0])) {
73 $handling_class = $target[0][count($target[0]) - 1];
74 } elseif (is_string($target[0])) {
75 $handling_class = $target[0];
77 throw new \InvalidArgumentException(
'No handling class given');
81 if ($handling_class ===
null) {
82 throw new \InvalidArgumentException(
'No handling class given');
84 if (!$target instanceof
URI) {
85 $target_class = $target[0];
86 $command = $target[1] ??
null;
95 $uri = $this->flow->getTargetURI($target_class, $command);
111 $this->tabs_gui->clearTargets();
113 $current_tab = $this->
structure->getByHandlingClass(
114 $this->flow->getCurrentClass() ??
''
118 $current_tab !==
null
119 && $current_tab->getParent() !==
null
120 && $current_tab->getParent()->getParent() !==
null
123 $this->tabs_gui->setBackTarget(
124 $this->translator->translate(
'back'),
125 $this->ctrl->getLinkTargetByClass(
126 $current_tab->getParent()->getHandlingClass()
132 foreach ($this->
structure->get() as $tab) {
133 if ($tab->getParent() ===
null) {
134 $this->tabs_gui->addTab(
136 $this->translator->t($tab->getLanguageKey()),
137 (
string) $tab->getTarget()
139 } elseif ($tab->getParent()->getId() === $this->active_tab) {
140 $this->tabs_gui->addSubTab(
142 $this->translator->t($tab->getLanguageKey()),
143 (
string) $tab->getTarget()
147 if ($this->active_tab !==
null) {
148 $this->tabs_gui->activateTab($this->active_tab);
150 if ($this->active_subtab !==
null) {
151 $this->tabs_gui->activateSubTab($this->active_subtab);
162 foreach ($tab as $t) {
169 $this->tabs_gui->clearTargets();
173 && $this->ctrl->getCmdClass() === strtolower(ilFooterEntriesGUI::class)
175 $this->tabs_gui->setBackTarget(
176 $this->translator->translate(
'back'),
177 $this->ctrl->getLinkTargetByClass(
178 ilFooterEntriesGUI::class,
185 $this->tabs_gui->setBackTarget(
186 $this->translator->translate(
'back'),
187 $this->ctrl->getLinkTargetByClass(
188 ilObjFooterAdministrationGUI::class,
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
The scope of this class is split ilias-conform URI's into components.
__construct(private Translator $translator, private \ilCtrlInterface $ctrl, private \ilTabsGUI $tabs_gui, private Flow $flow,)
build(string $id, string $language_key, array|URI $target, ?Tab $parent=null, ?string $handling_class=null,)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
if(!file_exists('../ilias.ini.php'))