ILIAS  trunk Revision v11.0_alpha-1861-g09f3d197f78
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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.

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

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: shib_login.php:22
+ Here is the call graph for this function:

Member Function Documentation

◆ executeCommand()

ilMediaPoolImportGUI::executeCommand ( )

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

References $ctrl, and ilCtrl\getCmd().

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)
+ Here is the call graph for this function:

◆ initTranslationImportForm()

ilMediaPoolImportGUI::initTranslationImportForm ( )

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

References $ctrl, $lng, ilObjectTranslation\getInstance(), ilLanguage\loadLanguageModule(), null, ilSelectInputGUI\setOptions(), ilFileInputGUI\setSuffixes(), and ilLanguage\txt().

Referenced by showTranslationImportForm().

68  {
69  $lng = $this->lng;
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 selection list property in a property form.
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 file property in a property form.
setSuffixes(array $a_suffixes)
loadLanguageModule(string $a_module)
Load language module.
setOptions(array $a_options)
static getInstance(int $obj_id)
+ 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.

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

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