3use Psr\Http\Message\RequestInterface;
63 $this->ctrl =
$DIC->ctrl();
64 $this->tabs =
$DIC->tabs();
65 $this->tpl =
$DIC->ui()->mainTemplate();
66 $this->logger =
$DIC->logger()->amet();
67 $this->toolbar =
$DIC->toolbar();
69 $this->
language->loadLanguageModule(
'obj');
70 $this->request =
$DIC->http()->request();
79 $this->ctrl->setParameterByClass(
80 strtolower(get_class($this)),
82 $this->record->getRecordId()
85 $next_class = $this->ctrl->getNextClass($this);
86 $cmd = $this->ctrl->getCmd(self::CMD_DEFAULT);
87 switch ($next_class) {
96 protected function setTabs(
string $active_tab)
98 $this->tabs->activateTab($active_tab);
111 $this->tabs->activateTab(self::CMD_DEFAULT);
116 $this->tpl->setContent($form->getHTML());
124 $form = new \ilPropertyFormGUI();
125 $form->setFormAction($this->ctrl->getFormAction($this));
126 $form->setTitle($this->
language->txt(
'obj_add_languages'));
130 $this->
language->txt(
'obj_additional_langs'),
133 $languages->setOptions($language_options);
134 $languages->setMulti(
true);
135 $languages->setRequired(
true);
136 $form->addItem($languages);
138 $form->addCommandButton(
139 self::CMD_SAVE_ADDITIONAL_TRANSLATIONS,
142 $form->addCommandButton(
153 $button->setCaption(
'obj_add_languages');
155 $this->ctrl->getLinkTargetByClass(
156 strtolower(get_class($this)),
157 self::CMD_ADD_TRANSLATION
160 $this->toolbar->addButtonInstance($button);
171 $this->
language->loadLanguageModule(
'meta');
174 $options[
''] = $this->
language->txt(
'select_one');
175 foreach ($installed_languages as $key =>
$language) {
177 if ($languages->isConfigured(
$language)) {
188 if (!$form->checkInput()) {
189 $form->setValuesByPost();
193 foreach (array_unique((array) $form->getInput(
'languages')) as $language_code) {
196 $languages->addTranslationEntry($language_code);
199 ilUtil::sendSuccess($this->
language->txt(
'settings_saved'),
true);
200 $this->ctrl->redirect($this, self::CMD_DEFAULT);
An exception for terminatinating execution or to throw for unit testing.
static getInstanceByRecordId(int $record_id)
saveAdditionalTranslations()
addToolbarLanguageCreation()
addTranslations(ilPropertyFormGUI $form=null)
show translation creation form
const CMD_ADD_TRANSLATION
const CMD_SAVE_ADDITIONAL_TRANSLATIONS
initCreateTranslationForm()
const CMD_DEFAULT
Default command.
getAvailableLanguagesOptions()
__construct(ilAdvancedMDRecord $record)
ilAdvancedMDTranslationGUI constructor.
executeCommand()
Execute command and save parameter record id.
setTabs(string $active_tab)
static _getInstalledLanguages()
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.