ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilMediaPoolImportGUI Class Reference

Import related features for media pools (currently used for translation imports) 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
 
Translations $ot
 

Detailed Description

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 26 of file class.ilMediaPoolImportGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilMediaPoolImportGUI::__construct ( ilObjMediaPool  $a_mep)

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

36 {
37 global $DIC;
38
39 $this->ctrl = $DIC->ctrl();
40 $this->lng = $DIC->language();
41 $this->tpl = $DIC->ui()->mainTemplate();
42 $this->mep = $a_mep;
43 $this->request = $DIC->mediaPool()
44 ->internal()
45 ->gui()
46 ->standardRequest();
47 $this->ot = $a_mep->getObjectProperties()->getPropertyTranslations();
48 }
global $DIC
Definition: shib_login.php:26

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

+ Here is the call graph for this function:

Member Function Documentation

◆ executeCommand()

ilMediaPoolImportGUI::executeCommand ( )

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

50 : void
51 {
52 $ilCtrl = $this->ctrl;
53
54 $cmd = $ilCtrl->getCmd("showTranslationImportForm");
55
56 if (in_array($cmd, array("showTranslationImportForm", "importTranslation"))) {
57 $this->$cmd();
58 }
59 }
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 71 of file class.ilMediaPoolImportGUI.php.

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

References $ctrl, $lng, $ot, ILIAS\ILIASObject\Properties\Translations\Translations\getBaseLanguage(), ILIAS\ILIASObject\Properties\Translations\Translations\getLanguages(), 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 61 of file class.ilMediaPoolImportGUI.php.

61 : void
62 {
65
66 $this->tpl->setOnScreenMessage('info', $lng->txt("mep_trans_import_info"));
67 $form = $this->initTranslationImportForm();
68 $tpl->setContent($form->getHTML());
69 }
ilGlobalTemplateInterface $tpl
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.

References $lng, $tpl, initTranslationImportForm(), ILIAS\UICore\GlobalTemplate\setContent(), ILIAS\UICore\GlobalTemplate\setOnScreenMessage(), and ilLanguage\txt().

+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilCtrl ilMediaPoolImportGUI::$ctrl
protected

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

Referenced by executeCommand(), and initTranslationImportForm().

◆ $lng

ilLanguage ilMediaPoolImportGUI::$lng
protected

◆ $mep

ilObjMediaPool ilMediaPoolImportGUI::$mep
protected

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

◆ $ot

Translations ilMediaPoolImportGUI::$ot
protected

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

Referenced by initTranslationImportForm().

◆ $request

ILIAS MediaPool StandardGUIRequest ilMediaPoolImportGUI::$request
protected

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

◆ $tpl

ilGlobalTemplateInterface ilMediaPoolImportGUI::$tpl
protected

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

Referenced by showTranslationImportForm().


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