28 protected \ILIAS\MediaPool\StandardGUIRequest
$request;
39 $this->
ctrl = $DIC->ctrl();
40 $this->
lng = $DIC->language();
41 $this->tpl =
$DIC->ui()->mainTemplate();
43 $this->request =
$DIC->mediaPool()
54 $cmd = $ilCtrl->
getCmd(
"showTranslationImportForm");
56 if (in_array($cmd, array(
"showTranslationImportForm",
"importTranslation"))) {
82 $fi->setSuffixes(array(
"zip"));
83 $fi->setRequired(
true);
91 $options[$l->getLanguageCode()] =
$lng->
txt(
"meta_l_" . $l->getLanguageCode());
95 $si->setOptions($options);
98 $form->addCommandButton(
"importTranslation",
$lng->
txt(
"import"));
99 $form->setTitle(
$lng->
txt(
"mep_import_trans"));
100 $form->setFormAction($ilCtrl->getFormAction($this));
105 public function importTranslation(): void
113 $conf = $imp->getConfig(
"components/ILIAS/MediaPool");
115 $target_lang = $this->request->getImportLang();
118 $this->tpl->setOnScreenMessage(
'failure',
$lng->
txt(
"mep_transl_master_language_not_allowed"),
true);
119 $ilCtrl->redirect($this,
"showTranslationImportForm");
122 $conf->setTranslationImportMode($this->mep, $target_lang);
125 $_FILES[
"importfile"][
"tmp_name"],
126 $_FILES[
"importfile"][
"name"],
128 "components/ILIAS/MediaPool"
131 $this->tpl->setOnScreenMessage(
'success',
$lng->
txt(
"msg_obj_modified"),
true);
132 $ilCtrl->redirect($this,
"showTranslationImportForm");
Class handles translation mode for an object.
Class ilCtrl provides processing control methods.
getCmd(?string $fallback_command=null)
@inheritDoc
loadLanguageModule(string $a_module)
Load language module.
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.
setContent(string $a_html)
Sets content for standard template.