26 protected \ILIAS\MediaPool\StandardGUIRequest
$request;
36 $this->
ctrl = $DIC->ctrl();
37 $this->
lng = $DIC->language();
38 $this->tpl = $DIC->ui()->mainTemplate();
40 $this->request = $DIC->mediaPool()
50 $cmd = $ilCtrl->
getCmd(
"showTranslationImportForm");
52 if (in_array($cmd, array(
"showTranslationImportForm",
"importTranslation"))) {
79 $fi->setRequired(
true);
85 foreach ($ot->getLanguages() as $l) {
86 if ($l->getLanguageCode() != $ot->getMasterLanguage()) {
87 $options[$l->getLanguageCode()] = $lng->
txt(
"meta_l_" . $l->getLanguageCode());
91 $si->setOptions($options);
94 $form->addCommandButton(
"importTranslation", $lng->
txt(
"import"));
95 $form->setTitle($lng->
txt(
"mep_import_trans"));
96 $form->setFormAction($ilCtrl->getFormAction($this));
101 public function importTranslation():
void 109 $conf = $imp->getConfig(
"Modules/MediaPool");
111 $target_lang = $this->request->getImportLang();
113 if ($target_lang === $ot->getMasterLanguage()) {
114 $this->tpl->setOnScreenMessage(
'failure', $lng->
txt(
"mep_transl_master_language_not_allowed"),
true);
115 $ilCtrl->redirect($this,
"showTranslationImportForm");
118 $conf->setTranslationImportMode($this->mep, $target_lang);
121 $_FILES[
"importfile"][
"tmp_name"],
122 $_FILES[
"importfile"][
"name"],
127 $this->tpl->setOnScreenMessage(
'success', $lng->
txt(
"msg_obj_modified"),
true);
128 $ilCtrl->redirect($this,
"showTranslationImportForm");
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
setOnScreenMessage(string $type, string $a_txt, bool $a_keep=false)
Set a message to be displayed to the user.
getCmd(string $fallback_command=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
loadLanguageModule(string $a_module)
Load language module.
setContent(string $a_html)
Sets content for standard template.
static getInstance(int $obj_id)