ILIAS  release_8 Revision v8.24
ilUIDemoFileUploadHandlerGUI Class Reference

Class ilUIDemoFileUploadHandlerGUI. More...

+ Inheritance diagram for ilUIDemoFileUploadHandlerGUI:
+ Collaboration diagram for ilUIDemoFileUploadHandlerGUI:

Public Member Functions

 getUploadURL ()
 @inheritDoc More...
 
 getExistingFileInfoURL ()
 @inheritDoc More...
 
 getFileRemovalURL ()
 @inheritDoc More...
 
 getFileIdentifierParameterName ()
 @inheritDoc 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

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

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

Member Function Documentation

◆ getExistingFileInfoURL()

ilUIDemoFileUploadHandlerGUI::getExistingFileInfoURL ( )

@inheritDoc

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

Reimplemented in ilUIAsyncDemoFileUploadHandler, and ilUIAsyncDemoFileUploadHandlerGUI.

Definition at line 45 of file class.ilUIDemoFileUploadHandlerGUI.php.

45 : string
46 {
47 return $this->ctrl->getLinkTargetByClass([ilUIPluginRouterGUI::class, self::class], self::CMD_INFO);
48 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ getFileIdentifierParameterName()

ilUIDemoFileUploadHandlerGUI::getFileIdentifierParameterName ( )

@inheritDoc

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

Definition at line 68 of file class.ilUIDemoFileUploadHandlerGUI.php.

68 : string
69 {
70 return 'my_file_id';
71 }

Referenced by getInfoForExistingFiles(), getInfoResult(), getRemoveResult(), and getUploadResult().

+ Here is the caller graph for this function:

◆ getFileRemovalURL()

ilUIDemoFileUploadHandlerGUI::getFileRemovalURL ( )

@inheritDoc

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

Reimplemented in ilUIAsyncDemoFileUploadHandler, and ilUIAsyncDemoFileUploadHandlerGUI.

Definition at line 54 of file class.ilUIDemoFileUploadHandlerGUI.php.

54 : string
55 {
56 return $this->ctrl->getLinkTargetByClass(
57 [ilUIPluginRouterGUI::class, self::class],
58 self::CMD_REMOVE,
59 null,
60 false
61 );
62 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ getInfoForExistingFiles()

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

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

Definition at line 108 of file class.ilUIDemoFileUploadHandlerGUI.php.

108 : array
109 {
110 $infos = [];
111 foreach ($file_ids as $file_id) {
112 $infos[] = new BasicFileInfoResult(
114 $file_id,
115 "Name $file_id.txt",
116 rand(1000, 2000),
117 "text/plain"
118 );
119 }
120
121 return $infos;
122 }

References getFileIdentifierParameterName().

+ Here is the call graph for this function:

◆ getInfoResult()

ilUIDemoFileUploadHandlerGUI::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 96 of file class.ilUIDemoFileUploadHandlerGUI.php.

97 {
98 return new BasicFileInfoResult(
100 $identifier,
101 "My funny Testfile $identifier.txt",
102 64,
103 ""
104 );
105 }

References getFileIdentifierParameterName().

+ Here is the call graph for this function:

◆ getRemoveResult()

ilUIDemoFileUploadHandlerGUI::getRemoveResult ( string  $identifier)
protected

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

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

88 {
89 $status = HandlerResult::STATUS_OK;
90 $message = 'File Deleted';
91
92 return new BasicHandlerResult($this->getFileIdentifierParameterName(), $status, $identifier, $message);
93 }
$message
Definition: xapiexit.php:32

References $message, and getFileIdentifierParameterName().

+ Here is the call graph for this function:

◆ getUploadResult()

ilUIDemoFileUploadHandlerGUI::getUploadResult ( )
protected

@inheritDoc

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

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

78 {
79 $status = HandlerResult::STATUS_OK;
80 $identifier = md5(random_bytes(65));
81 $message = 'Everything ok';
82
83 return new BasicHandlerResult($this->getFileIdentifierParameterName(), $status, $identifier, $message);
84 }

References $message, and getFileIdentifierParameterName().

+ Here is the call graph for this function:

◆ getUploadURL()

ilUIDemoFileUploadHandlerGUI::getUploadURL ( )

@inheritDoc

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

Reimplemented in ilUIAsyncDemoFileUploadHandler, and ilUIAsyncDemoFileUploadHandlerGUI.

Definition at line 36 of file class.ilUIDemoFileUploadHandlerGUI.php.

36 : string
37 {
38 return $this->ctrl->getLinkTargetByClass([ilUIPluginRouterGUI::class, self::class], self::CMD_UPLOAD);
39 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

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