ILIAS  release_8 Revision v8.24
ilMediaPoolImportGUI Class Reference

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V. More...

+ Collaboration diagram for ilMediaPoolImportGUI:

Public Member Functions

 __construct (ilObjMediaPool $a_mep)
 
 executeCommand ()
 
 showTranslationImportForm ()
 
 initTranslationImportForm ()
 

Protected Attributes

ILIAS MediaPool StandardGUIRequest $request
 
ilObjMediaPool $mep
 
ilCtrl $ctrl
 
ilLanguage $lng
 
ilGlobalTemplateInterface $tpl
 

Detailed Description

This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Learning e.V.

ILIAS is licensed with the GPL-3.0, see https://www.gnu.org/licenses/gpl-3.0.en.html You should have received a copy of said license along with the source code, too.

If this is not the case or you just want to try ILIAS, you'll find us at: https://www.ilias.de https://github.com/ILIAS-eLearning Import related features for media pools (currently used for translation imports)

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 24 of file class.ilMediaPoolImportGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilMediaPoolImportGUI::__construct ( ilObjMediaPool  $a_mep)

Definition at line 32 of file class.ilMediaPoolImportGUI.php.

33 {
34 global $DIC;
35
36 $this->ctrl = $DIC->ctrl();
37 $this->lng = $DIC->language();
38 $this->tpl = $DIC->ui()->mainTemplate();
39 $this->mep = $a_mep;
40 $this->request = $DIC->mediaPool()
41 ->internal()
42 ->gui()
43 ->standardRequest();
44 }
global $DIC
Definition: feed.php:28

References $DIC, ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

Member Function Documentation

◆ executeCommand()

ilMediaPoolImportGUI::executeCommand ( )

Definition at line 46 of file class.ilMediaPoolImportGUI.php.

46 : void
47 {
48 $ilCtrl = $this->ctrl;
49
50 $cmd = $ilCtrl->getCmd("showTranslationImportForm");
51
52 if (in_array($cmd, array("showTranslationImportForm", "importTranslation"))) {
53 $this->$cmd();
54 }
55 }
getCmd(string $fallback_command=null)
@inheritDoc

References $ctrl, and ilCtrl\getCmd().

+ Here is the call graph for this function:

◆ initTranslationImportForm()

ilMediaPoolImportGUI::initTranslationImportForm ( )

Definition at line 67 of file class.ilMediaPoolImportGUI.php.

68 {
70 $ilCtrl = $this->ctrl;
71
72 $lng->loadLanguageModule("meta");
73
74 $form = new ilPropertyFormGUI();
75
76 // import file
77 $fi = new ilFileInputGUI($lng->txt("file"), "importfile");
78 $fi->setSuffixes(array("zip"));
79 $fi->setRequired(true);
80 $fi->setSize(30);
81 $form->addItem($fi);
82
83 $ot = ilObjectTranslation::getInstance($this->mep->getId());
84 $options = [];
85 foreach ($ot->getLanguages() as $l) {
86 if ($l->getLanguageCode() != $ot->getMasterLanguage()) {
87 $options[$l->getLanguageCode()] = $lng->txt("meta_l_" . $l->getLanguageCode());
88 }
89 }
90 $si = new ilSelectInputGUI($lng->txt("mep_import_lang"), "import_lang");
91 $si->setOptions($options);
92 $form->addItem($si);
93
94 $form->addCommandButton("importTranslation", $lng->txt("import"));
95 $form->setTitle($lng->txt("mep_import_trans"));
96 $form->setFormAction($ilCtrl->getFormAction($this));
97
98 return $form;
99 }
This class represents a file property in a property form.
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...
static getInstance(int $obj_id)
This class represents a property form user interface.
This class represents a selection list property in a property form.

References $ctrl, $lng, ilObjectTranslation\getInstance(), ilLanguage\loadLanguageModule(), and ilLanguage\txt().

Referenced by showTranslationImportForm().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showTranslationImportForm()

ilMediaPoolImportGUI::showTranslationImportForm ( )

Definition at line 57 of file class.ilMediaPoolImportGUI.php.

57 : void
58 {
61
62 $this->tpl->setOnScreenMessage('info', $lng->txt("mep_trans_import_info"));
63 $form = $this->initTranslationImportForm();
64 $tpl->setContent($form->getHTML());
65 }
ilGlobalTemplateInterface $tpl
setContent(string $a_html)
Sets content for standard template.
setOnScreenMessage(string $type, string $a_txt, bool $a_keep=false)
Set a message to be displayed to the user.

References $lng, $tpl, initTranslationImportForm(), ilGlobalTemplateInterface\setContent(), ilGlobalTemplateInterface\setOnScreenMessage(), and ilLanguage\txt().

+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilCtrl ilMediaPoolImportGUI::$ctrl
protected

Definition at line 28 of file class.ilMediaPoolImportGUI.php.

Referenced by executeCommand(), and initTranslationImportForm().

◆ $lng

ilLanguage ilMediaPoolImportGUI::$lng
protected

◆ $mep

ilObjMediaPool ilMediaPoolImportGUI::$mep
protected

Definition at line 27 of file class.ilMediaPoolImportGUI.php.

◆ $request

ILIAS MediaPool StandardGUIRequest ilMediaPoolImportGUI::$request
protected

Definition at line 26 of file class.ilMediaPoolImportGUI.php.

◆ $tpl

ilGlobalTemplateInterface ilMediaPoolImportGUI::$tpl
protected

Definition at line 30 of file class.ilMediaPoolImportGUI.php.

Referenced by showTranslationImportForm().


The documentation for this class was generated from the following file: