40 $this->lng()->loadLanguageModule(
"mme");
46 $this->ctrl()->saveParameter($this, self::IDENTIFIER);
47 switch ($this->ctrl()->getNextClass()) {
49 $cmd = $this->ctrl()->getCmd(self::CMD_DEFAULT);
60 $this->tpl()->setContent(
$table->getHTML());
66 $this->toolbar()->addButton(
67 $this->lng()->txt(
"add_languages"),
69 ->getLinkTarget($this, self::CMD_ADD_LANGUAGE)
74 protected function saveTranslations()
76 $to_translate = (array) $this->
http()->request()->getParsedBody()[self::P_TRANSLATIONS];
77 foreach ($to_translate as
$id =>
$data) {
82 $translation->setTranslation(
$data[
'translation']);
83 $translation->update();
93 $to_delete = (array) $this->
http()->request()->getParsedBody()[self::P_DELETE];
94 foreach ($to_delete as
$id) {
97 $this->
repository->updateItem($this->item_facade);
107 $this->tpl()->setContent(
$form->getHTML());
114 if (
$form->checkInput()) {
115 $ad =
$form->getInput(
"additional_langs");
117 foreach ($ad as $language_key) {
121 $this->
repository->updateItem($this->item_facade);
127 $form->setValuesByPost();
128 $this->tpl()->setContent(
$form->getHTML());
139 $form->setFormAction($this->ctrl()->getFormAction($this));
149 $form->setTitle($this->lng()->txt(
"add_languages"));
150 $form->addCommandButton(self::CMD_SAVE_LANGUAGES, $this->lng()->txt(
"save"));
151 $form->addCommandButton(self::CMD_DEFAULT, $this->lng()->txt(
"cancel"));
159 $this->ctrl()->redirect($this, self::CMD_DEFAULT);
static find($primary_key, array $add_constructor_args=array())
const CMD_DELETE_TRANSLATIONS
if(!array_key_exists('StateId', $_REQUEST)) $id
Class ilMMItemRepository.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
__construct(ilMMItemFacadeInterface $item_facade, ilMMItemRepository $repository)
ilMMItemTranslationGUI constructor.
static http()
Fetches the global http state from ILIAS.
if(isset($_POST['submit'])) $form
const CMD_SAVE_TRANSLATIONS
Class ilMMItemTranslationGUI.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
Class ilMMItemTranslationTableGUI.
if(empty($password)) $table
static storeTranslation(IdentificationInterface $identification, string $language_key, string $translation)
Interface ilMMItemFacadeInterface.