ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilMobMultiSrtUploadGUI 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 ilMobMultiSrtUploadGUI:

Public Member Functions

 __construct (ilMobMultiSrtInt $a_multi_srt)
 
 executeCommand ()
 
 uploadMultipleSubtitleFileForm ()
 
 uploadMultipleSubtitleFile ()
 Upload multiple subtitles. More...
 
 showMultiSubtitleConfirmationTable ()
 List of srt files in zip file. More...
 
 cancelMultiSrt ()
 
 saveMultiSrt ()
 Save selected srt files as new srt files. More...
 

Data Fields

ilMobMultiSrtUpload $multi_srt
 

Protected Attributes

ilCtrl $ctrl
 
ilLanguage $lng
 
ilToolbarGUI $toolbar
 
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 Upload SRT files to a set of media objects

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

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

Constructor & Destructor Documentation

◆ __construct()

ilMobMultiSrtUploadGUI::__construct ( ilMobMultiSrtInt  $a_multi_srt)

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

33 {
34 global $DIC;
35
36 $ilCtrl = $DIC->ctrl();
37 $lng = $DIC->language();
38 $ilToolbar = $DIC->toolbar();
39 $tpl = $DIC["tpl"];
40
41 $this->tpl = $tpl;
42 $this->lng = $lng;
43 $this->ctrl = $ilCtrl;
44 $this->multi_srt = new ilMobMultiSrtUpload($a_multi_srt);
45 $this->toolbar = $ilToolbar;
46 }
ilGlobalTemplateInterface $tpl
Handler class for multi srt upload.
global $DIC
Definition: shib_login.php:26

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

+ Here is the call graph for this function:

Member Function Documentation

◆ cancelMultiSrt()

ilMobMultiSrtUploadGUI::cancelMultiSrt ( )

Definition at line 93 of file class.ilMobMultiSrtUploadGUI.php.

93 : void
94 {
95 $this->multi_srt->clearMultiSrtDirectory();
96 $this->ctrl->redirect($this, "uploadMultipleSubtitleFileForm");
97 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ executeCommand()

ilMobMultiSrtUploadGUI::executeCommand ( )

Definition at line 48 of file class.ilMobMultiSrtUploadGUI.php.

48 : void
49 {
50 $cmd = $this->ctrl->getCmd("uploadMultipleSubtitleFileForm");
51
52 if (in_array($cmd, array("uploadMultipleSubtitleFileForm", "uploadMultipleSubtitleFile", "showMultiSubtitleConfirmationTable", "cancelMultiSrt", "saveMultiSrt"))) {
53 $this->$cmd();
54 }
55 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ saveMultiSrt()

ilMobMultiSrtUploadGUI::saveMultiSrt ( )

Save selected srt files as new srt files.

Definition at line 102 of file class.ilMobMultiSrtUploadGUI.php.

102 : void
103 {
104 $cnt = $this->multi_srt->moveMultiSrtFiles();
105 $this->multi_srt->clearMultiSrtDirectory();
106
107 $this->tpl->setOnScreenMessage('success', $this->lng->txt("cont_moved_srt_files") . " (" . $cnt . ")", true);
108 $this->ctrl->redirect($this, "uploadMultipleSubtitleFileForm");
109 }

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

+ Here is the call graph for this function:

◆ showMultiSubtitleConfirmationTable()

ilMobMultiSrtUploadGUI::showMultiSubtitleConfirmationTable ( )

List of srt files in zip file.

Definition at line 87 of file class.ilMobMultiSrtUploadGUI.php.

87 : void
88 {
89 $tab = new ilMobMultiSrtConfirmationTable2GUI($this, "showMultiSubtitleConfirmationTable");
90 $this->tpl->setContent($tab->getHTML());
91 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

◆ uploadMultipleSubtitleFile()

ilMobMultiSrtUploadGUI::uploadMultipleSubtitleFile ( )

Upload multiple subtitles.

Definition at line 73 of file class.ilMobMultiSrtUploadGUI.php.

73 : void
74 {
75 try {
76 $this->multi_srt->uploadMultipleSubtitleFile(ilArrayUtil::stripSlashesArray($_FILES["subtitle_file"]));
77 $this->ctrl->redirect($this, "showMultiSubtitleConfirmationTable");
78 } catch (ilLMException $e) {
79 $this->tpl->setOnScreenMessage('failure', $e->getMessage(), true);
80 $this->ctrl->redirect($this, "uploadMultipleSubtitleFileForm");
81 }
82 }
static stripSlashesArray(array $a_arr, bool $a_strip_html=true, string $a_allow="")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References Vendor\Package\$e, ILIAS\Repository\ctrl(), and ilArrayUtil\stripSlashesArray().

+ Here is the call graph for this function:

◆ uploadMultipleSubtitleFileForm()

ilMobMultiSrtUploadGUI::uploadMultipleSubtitleFileForm ( )

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

57 : void
58 {
59 $this->tpl->setOnScreenMessage('info', $this->lng->txt("cont_upload_multi_srt_howto"));
60
61 // upload file
62 $this->toolbar->setFormAction($this->ctrl->getFormAction($this), true);
63 $fi = new ilFileInputGUI($this->lng->txt("cont_subtitle_file") . " (.zip)", "subtitle_file");
64 $fi->setSuffixes(array("zip"));
65 $this->toolbar->addInputItem($fi, true);
66
67 $this->toolbar->addFormButton($this->lng->txt("upload"), "uploadMultipleSubtitleFile");
68 }
This class represents a file property in a property form.

References ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ILIAS\Repository\toolbar().

+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilCtrl ilMobMultiSrtUploadGUI::$ctrl
protected

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

◆ $lng

ilLanguage ilMobMultiSrtUploadGUI::$lng
protected

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

Referenced by __construct().

◆ $multi_srt

ilMobMultiSrtUpload ilMobMultiSrtUploadGUI::$multi_srt

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

◆ $toolbar

ilToolbarGUI ilMobMultiSrtUploadGUI::$toolbar
protected

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

◆ $tpl

ilGlobalTemplateInterface ilMobMultiSrtUploadGUI::$tpl
protected

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

Referenced by __construct().


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