ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 44 of file class.ilUIDemoFileUploadHandlerGUI.php.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

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