ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilMMUploadHandlerGUI Class Reference

Class ilMMUploadHandlerGUI. More...

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

Public Member Functions

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

Protected Member Functions

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

Private Attributes

 $storage
 
ilMMStorageStakeholder $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'
 
HttpServices $http
 
ilCtrl $ctrl
 
FileUpload $upload
 
bool $is_chunked = false
 
int $chunk_index = 0
 
int $amount_of_chunks = 0
 
string $chunk_id = null
 
int $chunk_total_size = 0
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilMMUploadHandlerGUI::__construct ( )

ilUIDemoFileUploadHandlerGUI constructor.

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

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

49 {
50 global $DIC;
52 $this->storage = $DIC['resource_storage'];
53 $this->stakeholder = new ilMMStorageStakeholder();
54 }
Class ilMMStorageStakeholder.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

References $DIC, and ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

Member Function Documentation

◆ getInfoForExistingFiles()

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

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

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

107 : array
108 {
109 $infos = [];
110 foreach ($file_ids as $file_id) {
111 $id = $this->storage->manage()->find($file_id);
112 if ($id === null) {
113 continue;
114 }
115 $r = $this->storage->manage()->getCurrentRevision($id)->getInformation();
116
117 $infos[] = new BasicFileInfoResult($this->getFileIdentifierParameterName(), $file_id, $r->getTitle(), $r->getSize(), $r->getMimeType());
118 }
119
120 return $infos;
121 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23

References $id, and ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler\getFileIdentifierParameterName().

+ Here is the call graph for this function:

◆ getInfoResult()

ilMMUploadHandlerGUI::getInfoResult ( string  $identifier)
Returns
null|FileInfoResult for the file with the given identifier or null if the file does not exist.

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

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

96 {
97 $id = $this->storage->manage()->find($identifier);
98 if ($id === null) {
99 return new BasicFileInfoResult($this->getFileIdentifierParameterName(), 'unknown', 'unknown', 0, 'unknown');
100 }
101 $r = $this->storage->manage()->getCurrentRevision($id)->getInformation();
102
103 return new BasicFileInfoResult($this->getFileIdentifierParameterName(), $identifier, $r->getTitle(), $r->getSize(), $r->getMimeType());
104 }

References $id, and ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler\getFileIdentifierParameterName().

+ Here is the call graph for this function:

◆ getRemoveResult()

ilMMUploadHandlerGUI::getRemoveResult ( string  $identifier)
protected

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

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

83 : HandlerResultInterface
84 {
85 $id = $this->storage->manage()->find($identifier);
86 if ($id !== null) {
87 $this->storage->manage()->remove($id, $this->stakeholder);
88
89 return new BasicHandlerResult($this->getFileIdentifierParameterName(), HandlerResultInterface::STATUS_OK, $identifier, 'file deleted');
90 }
91 return new BasicHandlerResult($this->getFileIdentifierParameterName(), HandlerResultInterface::STATUS_FAILED, $identifier, 'file not found');
92 }

References $id, and ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler\getFileIdentifierParameterName().

+ Here is the call graph for this function:

Field Documentation

◆ $stakeholder

ilMMStorageStakeholder ilMMUploadHandlerGUI::$stakeholder
private

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

◆ $storage

ilMMUploadHandlerGUI::$storage
private

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


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