19declare(strict_types=1);
32use ILIAS\GlobalScreen\GUI\I18n\Translator;
64 array $language_modules = [],
72 $this->input =
new Input(
80 $this->translator =
new Translator(
82 $translations_repository,
93 $this->output =
new Output(
108 public function handle(
string $entry_tab, array $post_handling_classes = []): bool
110 $next_class = $this->
ctrl->getNextClass();
111 $tab = $this->
tabs->structure()->getById($entry_tab);
113 if (empty($next_class)) {
115 throw new \RuntimeException(
'Handling Class not found');
118 $this->
tabs->activate($entry_tab);
122 if ($next_class === strtolower(MultiLanguageGUI::class)) {
123 if ($this->latest_gui !==
null) {
124 $item = $this->latest_gui->getCurrentItem();
125 $back_target = $this->
flow->getTargetURI(
126 $tab?->getHandlingClass() ??
''
130 $back_target ??= $this->
flow->getParentAsURI(
'');
131 $this->
ctrl->forwardCommand(
141 if (in_array(strtolower($next_class), array_map(
'strtolower', $post_handling_classes),
true)) {
145 $tab = $this->
tabs->structure()->getByHandlingClass($next_class);
148 throw new \RuntimeException(
"Handling Class `$next_class` not found");
152 $this->
access->require($tab->getPermission());
154 $handling_class = $tab->getHandlingClass();
155 if (is_a($handling_class, PonsGUI::class,
true)) {
156 $this->latest_gui =
new $handling_class($this);
160 if (method_exists($this->latest_gui, $command)) {
161 $method = new \ReflectionMethod($this->latest_gui, $command);
162 $attributes = $method->getAttributes(Command::class);
163 foreach ($attributes as $attribute) {
164 $instance = $attribute->newInstance();
165 $this->
access->require($instance->getPermissions());
170 return (
bool) $this->
ctrl->forwardCommand($this->latest_gui);
178 public function i18n(): Translator
212 array $language_modules = [],
228 $translations_repository
Provides fluid interface to RBAC services.
Provides fluid interface to RBAC services.
static fromDIC(array $language_modules=[], ?TranslationsRepository $translations_repository=null,)
@description this is only for convenience, but the constructor is still public and testing is possibl...
handle(string $entry_tab, array $post_handling_classes=[])
__construct(Services $http, UIServices $ui_services, private \ilCtrlInterface $ctrl, Refinery\Factory $refinery, Factory $data_factory, \ilLanguage $lng, RBACServices $rbac_services, \ilObjUser $user, \ilTabsGUI $tabs, \ilToolbarGUI $toolbar, array $language_modules=[], ?TranslationsRepository $translations_repository=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...