ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
ilMMUploadHandlerGUI Class Reference

Class ilMMUploadHandlerGUI. More...

+ Inheritance diagram for ilMMUploadHandlerGUI:
+ Collaboration diagram for ilMMUploadHandlerGUI:

Public Member Functions

 __construct ()
 ilUIDemoFileUploadHandlerGUI constructor. More...
 
 getInfoForExistingFiles (array $file_ids)
 
- Public Member Functions inherited from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler
 __construct ()
 ilUIDemoFileUploadHandlerGUI constructor. More...
 
 getFileIdentifierParameterName ()
 
 getUploadURL ()
 
 getExistingFileInfoURL ()
 
 getFileRemovalURL ()
 
 executeCommand ()
 Since this is a ilCtrl aware UploadHandler executeCommand MUST be implemented. More...
 
 getInfoForExistingFiles (array $file_ids)
 

Protected Member Functions

 getRemoveResult (string $identifier)
 
 getInfoResult (string $identifier)
 
- Protected Member Functions inherited from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler
 getUploadResult ()
 
 getRemoveResult (string $identifier)
 
 getInfoResult (string $identifier)
 

Private Attributes

 $storage
 
 $stakeholder
 

Additional Inherited Members

- Data Fields inherited from ILIAS\UI\Component\Input\Field\UploadHandler
const DEFAULT_FILE_ID_PARAMETER = 'file_id'
 
- Protected Attributes inherited from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler
const CMD_UPLOAD = 'upload'
 
const CMD_REMOVE = 'remove'
 
const CMD_INFO = 'info'
 
 $http
 
 $ctrl
 
 $upload
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilMMUploadHandlerGUI::__construct ( )

ilUIDemoFileUploadHandlerGUI constructor.

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

References $i, $message, $result, ILIAS\GlobalScreen\Provider\__construct(), ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler\getFileIdentifierParameterName(), and ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler\getUploadResult().

36  {
38  $this->storage = new Services();
39  $this->stakeholder = new ilMMStorageStakeholder();
40  }
Class ilMMStorageStakeholder.
__construct(Container $dic, ilPlugin $plugin)
Class ilAsqQuestionAuthoringFactory.
+ Here is the call graph for this function:

Member Function Documentation

◆ getInfoForExistingFiles()

ilMMUploadHandlerGUI::getInfoForExistingFiles ( array  $file_ids)
Parameters
array$file_ids
Returns
BasicFileInfoResult[]

Implements ILIAS\UI\Component\Input\Field\UploadHandler.

Definition at line 94 of file class.ilMMUploadHandlerGUI.php.

References ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler\getFileIdentifierParameterName().

94  : array
95  {
96  $infos = [];
97  foreach ($file_ids as $file_id) {
98  $id = $this->storage->find($file_id);
99  if ($id === null) {
100  continue;
101  }
102  $r = $this->storage->getRevision($id)->getInformation();
103 
104  $infos[] = new BasicFileInfoResult($this->getFileIdentifierParameterName(), $file_id, $r->getTitle(), $r->getSize(), $r->getMimeType());
105  }
106 
107  return $infos;
108  }
+ Here is the call graph for this function:

◆ getInfoResult()

ilMMUploadHandlerGUI::getInfoResult ( string  $identifier)
protected

Definition at line 82 of file class.ilMMUploadHandlerGUI.php.

References ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler\getFileIdentifierParameterName().

83  {
84  $id = $this->storage->find($identifier);
85  if ($id === null) {
86  return new BasicFileInfoResult($this->getFileIdentifierParameterName(), 'unknown', 'unknown', 0, 'unknown');
87  }
88  $r = $this->storage->getRevision($id)->getInformation();
89 
90  return new BasicFileInfoResult($this->getFileIdentifierParameterName(), $identifier, $r->getTitle(), $r->getSize(), $r->getMimeType());
91  }
+ Here is the call graph for this function:

◆ getRemoveResult()

ilMMUploadHandlerGUI::getRemoveResult ( string  $identifier)
protected

Definition at line 69 of file class.ilMMUploadHandlerGUI.php.

References ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler\getFileIdentifierParameterName().

70  {
71  $id = $this->storage->find($identifier);
72  if ($id !== null) {
73  $this->storage->remove($id);
74 
75  return new BasicHandlerResult($this->getFileIdentifierParameterName(), HandlerResultInterface::STATUS_OK, $identifier, 'file deleted');
76  } else {
77  return new BasicHandlerResult($this->getFileIdentifierParameterName(), HandlerResultInterface::STATUS_FAILED, $identifier, 'file not found');
78  }
79  }
+ Here is the call graph for this function:

Field Documentation

◆ $stakeholder

ilMMUploadHandlerGUI::$stakeholder
private

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

◆ $storage

ilMMUploadHandlerGUI::$storage
private

Definition at line 25 of file class.ilMMUploadHandlerGUI.php.


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