ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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...
 
 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...
 
 getInfoForExistingFiles (array $file_ids)
 
 executeCommand ()
 Since this is a ilCtrl aware UploadHandler executeCommand MUST be implemented. More...
 
 getFileIdentifierParameterName ()
 
 getUploadURL ()
 
 getFileRemovalURL ()
 
 getExistingFileInfoURL ()
 
 getInfoForExistingFiles (array $file_ids)
 

Protected Member Functions

 getUploadResult ()
 @inheritDoc More...
 
 getRemoveResult (string $identifier)
 
 getInfoResult (string $identifier)
 
 getUploadResult ()
 
 getRemoveResult (string $identifier)
 
 getInfoResult (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'
 
 $http
 
 $ctrl
 
 $upload
 

Detailed Description

Member Function Documentation

◆ getExistingFileInfoURL()

ilUIDemoFileUploadHandlerGUI::getExistingFileInfoURL ( )

@inheritDoc

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

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

31 : string
32 {
33 $this->ctrl->initBaseClass(ilUIPluginRouterGUI::class);
34
35 return $this->ctrl->getLinkTargetByClass([ilUIPluginRouterGUI::class, self::class], self::CMD_INFO);
36 }

◆ getFileIdentifierParameterName()

ilUIDemoFileUploadHandlerGUI::getFileIdentifierParameterName ( )

@inheritDoc

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

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

53 : string
54 {
55 return 'my_file_id';
56 }

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.

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

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

◆ getInfoForExistingFiles()

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

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

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

87 : array
88 {
89 $infos = [];
90 foreach ($file_ids as $file_id) {
91 $infos[] = new BasicFileInfoResult($this->getFileIdentifierParameterName(), $file_id, "Name $file_id.txt", rand(1000, 2000), "text/plain");
92 }
93
94 return $infos;
95 }

References getFileIdentifierParameterName().

+ Here is the call graph for this function:

◆ getInfoResult()

ilUIDemoFileUploadHandlerGUI::getInfoResult ( string  $identifier)
protected

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

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

82 {
83 return new BasicFileInfoResult($this->getFileIdentifierParameterName(), $identifier, "My funny Testfile $identifier.txt", 64);
84 }

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

73 {
74 $status = HandlerResult::STATUS_OK;
75 $message = 'File Deleted';
76
77 return new BasicHandlerResult($this->getFileIdentifierParameterName(), $status, $identifier, $message);
78 }
$message
Definition: xapiexit.php:14

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

63 {
64 $status = HandlerResult::STATUS_OK;
65 $identifier = md5(random_bytes(65));
66 $message = 'Everything ok';
67
68 return new BasicHandlerResult($this->getFileIdentifierParameterName(), $status, $identifier, $message);
69 }

References $message, and getFileIdentifierParameterName().

+ Here is the call graph for this function:

◆ getUploadURL()

ilUIDemoFileUploadHandlerGUI::getUploadURL ( )

@inheritDoc

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

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

20 : string
21 {
22 $this->ctrl->initBaseClass(ilUIPluginRouterGUI::class);
23
24 return $this->ctrl->getLinkTargetByClass([ilUIPluginRouterGUI::class, self::class], self::CMD_UPLOAD);
25 }

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