ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ilMobMultiSrtUploadGUI Class Reference

Upload SRT files to a set of media objects. 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
 
InternalGUIService $media_gui
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilMobMultiSrtUploadGUI::__construct ( ilMobMultiSrtInt  $a_multi_srt)

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

36 {
37 global $DIC;
38
39 $ilCtrl = $DIC->ctrl();
40 $lng = $DIC->language();
41 $ilToolbar = $DIC->toolbar();
42 $tpl = $DIC["tpl"];
43
44 $this->tpl = $tpl;
45 $this->lng = $lng;
46 $this->ctrl = $ilCtrl;
47 $this->multi_srt = new ilMobMultiSrtUpload($a_multi_srt);
48 $this->toolbar = $ilToolbar;
49 $this->media_gui = $DIC->mediaObjects()->internal()->gui();
50 }
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 115 of file class.ilMobMultiSrtUploadGUI.php.

115 : void
116 {
117 $this->multi_srt->clearMultiSrtDirectory();
118 $this->ctrl->redirect($this, "uploadMultipleSubtitleFileForm");
119 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ executeCommand()

ilMobMultiSrtUploadGUI::executeCommand ( )

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

52 : void
53 {
54 $cmd = $this->ctrl->getCmd("uploadMultipleSubtitleFileForm");
55
56 if (in_array($cmd, array("uploadMultipleSubtitleFileForm", "uploadMultipleSubtitleFile", "showMultiSubtitleConfirmationTable", "cancelMultiSrt", "saveMultiSrt"))) {
57 $this->$cmd();
58 }
59 }

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 124 of file class.ilMobMultiSrtUploadGUI.php.

124 : void
125 {
126 $cnt = $this->multi_srt->moveMultiSrtFiles();
127 $this->multi_srt->clearMultiSrtDirectory();
128
129 $this->tpl->setOnScreenMessage('success', $this->lng->txt("cont_moved_srt_files") . " (" . $cnt . ")", true);
130 $this->ctrl->redirect($this, "uploadMultipleSubtitleFileForm");
131 }

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 91 of file class.ilMobMultiSrtUploadGUI.php.

91 : void
92 {
93 $this->toolbar->addButton(
94 $this->lng->txt("save"),
95 $this->ctrl->getLinkTarget($this, "saveMultiSrt")
96 );
97 $this->toolbar->addButton(
98 $this->lng->txt("cancel"),
99 $this->ctrl->getLinkTarget($this, "cancelMultiSrt")
100 );
101
102 $table = $this->media_gui->subTitles()->multiSrtConfirmationTableBuilder(
103 $this->multi_srt,
104 $this,
105 "showMultiSubtitleConfirmationTable"
106 )->getTable();
107
108 if ($table->handleCommand()) {
109 return;
110 }
111
112 $this->tpl->setContent($table->render());
113 }

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

+ Here is the call graph for this function:

◆ uploadMultipleSubtitleFile()

ilMobMultiSrtUploadGUI::uploadMultipleSubtitleFile ( )

Upload multiple subtitles.

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

77 : void
78 {
79 try {
80 $this->multi_srt->uploadMultipleSubtitleFile(ilArrayUtil::stripSlashesArray($_FILES["subtitle_file"]));
81 $this->ctrl->redirect($this, "showMultiSubtitleConfirmationTable");
82 } catch (ilLMException $e) {
83 $this->tpl->setOnScreenMessage('failure', $e->getMessage(), true);
84 $this->ctrl->redirect($this, "uploadMultipleSubtitleFileForm");
85 }
86 }
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 61 of file class.ilMobMultiSrtUploadGUI.php.

61 : void
62 {
63 $this->tpl->setOnScreenMessage('info', $this->lng->txt("cont_upload_multi_srt_howto"));
64
65 // upload file
66 $this->toolbar->setFormAction($this->ctrl->getFormAction($this), true);
67 $fi = new ilFileInputGUI($this->lng->txt("cont_subtitle_file") . " (.zip)", "subtitle_file");
68 $fi->setSuffixes(array("zip"));
69 $this->toolbar->addInputItem($fi, true);
70
71 $this->toolbar->addFormButton($this->lng->txt("upload"), "uploadMultipleSubtitleFile");
72 }
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 28 of file class.ilMobMultiSrtUploadGUI.php.

◆ $lng

ilLanguage ilMobMultiSrtUploadGUI::$lng
protected

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

Referenced by __construct().

◆ $media_gui

InternalGUIService ilMobMultiSrtUploadGUI::$media_gui
protected

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

◆ $multi_srt

ilMobMultiSrtUpload ilMobMultiSrtUploadGUI::$multi_srt

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

◆ $toolbar

ilToolbarGUI ilMobMultiSrtUploadGUI::$toolbar
protected

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

◆ $tpl

ilGlobalTemplateInterface ilMobMultiSrtUploadGUI::$tpl
protected

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

Referenced by __construct().


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