ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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)
 Constructor. More...
 
 executeCommand ()
 Execute command. More...
 
 uploadMultipleSubtitleFileForm ()
 Upload multiple stubtitles. More...
 
 uploadMultipleSubtitleFile ()
 Upload multiple subtitles. More...
 
 showMultiSubtitleConfirmationTable ()
 List of srt files in zip file. More...
 
 cancelMultiSrt ()
 Cancel Multi Feedback. More...
 
 saveMultiSrt ()
 Save selected srt files as new srt files. More...
 

Data Fields

 $multi_srt
 

Protected Attributes

 $ctrl
 
 $lng
 
 $toolbar
 
 $tpl
 

Detailed Description

Upload SRT files to a set of media objects.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

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

Constructor & Destructor Documentation

◆ __construct()

ilMobMultiSrtUploadGUI::__construct ( ilMobMultiSrtInt  $a_multi_srt)

Constructor.

Parameters
ilObjLearningModule$a_lmlearning module object

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

References $DIC, $ilCtrl, $lng, and $tpl.

42  {
43  global $DIC;
44 
45  $ilCtrl = $DIC->ctrl();
46  $lng = $DIC->language();
47  $ilToolbar = $DIC->toolbar();
48  $tpl = $DIC["tpl"];
49 
50  $this->tpl = $tpl;
51  $this->lng = $lng;
52  $this->ctrl = $ilCtrl;
53  include_once("./Services/MediaObjects/classes/class.ilMobMultiSrtUpload.php");
54  $this->multi_srt = new ilMobMultiSrtUpload($a_multi_srt);
55  $this->toolbar = $ilToolbar;
56  }
global $DIC
Definition: saml.php:7
global $ilCtrl
Definition: ilias.php:18
Handler class for multi srt upload.

Member Function Documentation

◆ cancelMultiSrt()

ilMobMultiSrtUploadGUI::cancelMultiSrt ( )

Cancel Multi Feedback.

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

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

◆ executeCommand()

ilMobMultiSrtUploadGUI::executeCommand ( )

Execute command.

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

References array.

62  {
63  $cmd = $this->ctrl->getCmd("uploadMultipleSubtitleFileForm");
64 
65  if (in_array($cmd, array("uploadMultipleSubtitleFileForm", "uploadMultipleSubtitleFile", "showMultiSubtitleConfirmationTable", "cancelMultiSrt", "saveMultiSrt"))) {
66  $this->$cmd();
67  }
68  }
Create styles array
The data for the language used.

◆ saveMultiSrt()

ilMobMultiSrtUploadGUI::saveMultiSrt ( )

Save selected srt files as new srt files.

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

References ilUtil\sendSuccess().

124  {
125  $cnt = $this->multi_srt->moveMultiSrtFiles();
126  $this->multi_srt->clearMultiSrtDirectory();
127 
128  ilUtil::sendSuccess($this->lng->txt("cont_moved_srt_files") . " (" . $cnt . ")", true);
129  $this->ctrl->redirect($this, "uploadMultipleSubtitleFileForm");
130  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
+ Here is the call graph for this function:

◆ showMultiSubtitleConfirmationTable()

ilMobMultiSrtUploadGUI::showMultiSubtitleConfirmationTable ( )

List of srt files in zip file.

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

References $tab.

105  {
106  include_once("./Services/MediaObjects/classes/class.ilMobMultiSrtConfirmationTable2GUI.php");
107  $tab = new ilMobMultiSrtConfirmationTable2GUI($this, "showMultiSubtitleConfirmationTable");
108  $this->tpl->setContent($tab->getHTML());
109  }
List srt files from zip file for upload confirmation.

◆ uploadMultipleSubtitleFile()

ilMobMultiSrtUploadGUI::uploadMultipleSubtitleFile ( )

Upload multiple subtitles.

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

References ilUtil\sendFailure(), and ilUtil\stripSlashesArray().

91  {
92  try {
93  $this->multi_srt->uploadMultipleSubtitleFile(ilUtil::stripSlashesArray($_FILES["subtitle_file"]));
94  $this->ctrl->redirect($this, "showMultiSubtitleConfirmationTable");
95  } catch (ilLMException $e) {
96  ilUtil::sendFailure($e->getMessage(), true);
97  $this->ctrl->redirect($this, "uploadMultipleSubtitleFileForm");
98  }
99  }
Base exception class for learning modules.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static stripSlashesArray($a_arr, $a_strip_html=true, $a_allow="")
Strip slashes from array.
+ Here is the call graph for this function:

◆ uploadMultipleSubtitleFileForm()

ilMobMultiSrtUploadGUI::uploadMultipleSubtitleFileForm ( )

Upload multiple stubtitles.

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

References array, ilUtil\sendInfo(), and ilFileInputGUI\setSuffixes().

74  {
75  ilUtil::sendInfo($this->lng->txt("cont_upload_multi_srt_howto"));
76 
77  // upload file
78  $this->toolbar->setFormAction($this->ctrl->getFormAction($this), true);
79  include_once("./Services/Form/classes/class.ilFileInputGUI.php");
80  $fi = new ilFileInputGUI($this->lng->txt("cont_subtitle_file") . " (.zip)", "subtitle_file");
81  $fi->setSuffixes(array("zip"));
82  $this->toolbar->addInputItem($fi, true);
83 
84  $this->toolbar->addFormButton($this->lng->txt("upload"), "uploadMultipleSubtitleFile");
85  }
This class represents a file property in a property form.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Create styles array
The data for the language used.
setSuffixes($a_suffixes)
Set Accepted Suffixes.
+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilMobMultiSrtUploadGUI::$ctrl
protected

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

◆ $lng

ilMobMultiSrtUploadGUI::$lng
protected

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

Referenced by __construct().

◆ $multi_srt

ilMobMultiSrtUploadGUI::$multi_srt

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

◆ $toolbar

ilMobMultiSrtUploadGUI::$toolbar
protected

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

◆ $tpl

ilMobMultiSrtUploadGUI::$tpl
protected

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

Referenced by __construct().


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