19 declare(strict_types=1);
60 private ?
URI $back_target = null
62 $this->ui_factory = $this->dic->ui()->factory();
63 $this->
ctrl = $this->dic->ctrl();
64 $this->request = $this->dic->http()->request();
67 $this->dic->database()
71 $this->dic->learningObjectMetadata(),
74 $this->translatable_item,
81 $translations = $this->
repository->get($this->translatable_item);
82 if ($translations->get() === []) {
83 $content = $this->ui_factory->messageBox()->info(
84 $this->translator->translate(
'no_translations')
88 foreach ($translations->get() as $t) {
89 $items[$this->translator->translate(
'meta_l_' . $t->getLanguageCode())] = $t->getTranslation();
91 $content = $this->ui_factory->listing()->descriptive(
94 $content = $this->back_target === null ? $this->ui_factory->panel()->secondary()->legacy(
95 $this->translator->translate(
'translations'),
96 $this->ui_factory->legacy(
97 $this->ui_handling->render($content)
102 $prompt = $this->ui_factory->prompt()->standard(
103 $this->ui_handling->getHereAsURI(self::CMD_LANGUAGE_SELECTION)
107 $edit_button = $this->ui_factory
110 $this->translator->translate(
'edit_translations'),
113 ->withOnClick($prompt->getShowSignal());
115 $this->dic->toolbar()->addComponent(
119 if ($this->back_target === null) {
120 $this->ui_handling->out(
127 $this->ui_handling->outAsyncAsModal(
129 (
string) $this->back_target,
131 $this->ui_factory->divider()->horizontal(),
139 $this->ui_handling->outAsync(
140 $this->workflow->asTranslationWorkflow(
141 $this->ui_handling->getHereAsURI(),
142 $this->back_target ?? $this->ui_handling->getHereAsURI(self::CMD_DEFAULT)
149 $this->ui_handling->outAsync(
150 $this->workflow->asTranslationModal(
151 $this->ui_handling->getHereAsURI(self::CMD_SAVE_TRANSLATIONS)
158 $form = $this->workflow->asTranslationModal(
159 $this->ui_handling->getHereAsURI(self::CMD_SAVE_TRANSLATIONS)
161 $form = $form->withRequest($this->request);
162 if ((
$data = $form->getData()) === null) {
163 $this->ui_handling->outAsync($form);
166 $this->
ctrl->redirectToURL(
167 (
string) ($this->back_target ?? $this->ui_handling->getHereAsURI(self::CMD_DEFAULT))
175 $this->ui_handling->requireReadable();
177 $next_class = $this->
ctrl->getNextClass($this) ??
'';
178 $cmd = $this->
ctrl->getCmd(self::CMD_DEFAULT);
181 case self::CMD_DEFAULT:
182 case self::CMD_LANGUAGE_SELECTION:
183 case self::CMD_SAVE_LANGUAGE_SELECTION:
184 case self::CMD_TRANSLATE_IN_MODAL:
185 case self::CMD_SAVE_TRANSLATIONS:
187 $this->ui_handling->backToMainTab();
188 $this->ui_handling->requireWritable();
repository()
description: > Example for rendering a repository card
Customizing of pimple-DIC for ILIAS.
This is how the factory for UI elements looks.
The scope of this class is split ilias-conform URI's into components.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...