ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\User\Settings\NewAccountMail\UploadHandlerGUI Class Reference
+ Inheritance diagram for ILIAS\User\Settings\NewAccountMail\UploadHandlerGUI:
+ Collaboration diagram for ILIAS\User\Settings\NewAccountMail\UploadHandlerGUI:

Public Member Functions

 __construct (private readonly ResourceStorage $storage, private readonly Stakeholder $stakeholder)
 
 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 ()
 
 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

Author
Stephan Kergomard webma.nosp@m.ster.nosp@m.@kerg.nosp@m.omar.nosp@m.d.ch

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

Constructor & Destructor Documentation

◆ __construct()

ILIAS\User\Settings\NewAccountMail\UploadHandlerGUI::__construct ( private readonly ResourceStorage  $storage,
private readonly Stakeholder  $stakeholder 
)

Definition at line 37 of file class.UploadHandlerGUI.php.

40 {
41
43 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

Member Function Documentation

◆ getInfoForExistingFiles()

ILIAS\User\Settings\NewAccountMail\UploadHandlerGUI::getInfoForExistingFiles ( array  $file_ids)
Returns
\ILIAS\FileUpload\Handler\BasicFileInfoResult[]

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

Definition at line 102 of file class.UploadHandlerGUI.php.

102 : array
103 {
104 $info_results = [];
105 foreach ($file_ids as $identifier) {
106 $info_results[] = $this->getInfoResult($identifier);
107 }
108
109 return $info_results;
110 }

References ILIAS\User\Settings\NewAccountMail\UploadHandlerGUI\getInfoResult().

+ Here is the call graph for this function:

◆ getInfoResult()

ILIAS\User\Settings\NewAccountMail\UploadHandlerGUI::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 79 of file class.UploadHandlerGUI.php.

79 : ?FileInfoResult
80 {
81 $title = $mime = 'unknown';
82 $size = 0;
83 if (($id = $this->storage->manage()->find($identifier)) !== null) {
84 $revision = $this->storage->manage()->getCurrentRevision($id)->getInformation();
85 $title = $revision->getTitle();
86 $size = $revision->getSize();
87 $mime = $revision->getMimeType();
88 }
89
90 return new BasicFileInfoResult(
92 $identifier,
93 $title,
94 $size,
95 $mime
96 );
97 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23

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

Referenced by ILIAS\User\Settings\NewAccountMail\UploadHandlerGUI\getInfoForExistingFiles().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRemoveResult()

ILIAS\User\Settings\NewAccountMail\UploadHandlerGUI::getRemoveResult ( string  $identifier)
protected

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

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

69 : HandlerResult
70 {
71 return new BasicHandlerResult(
74 $identifier,
75 'We just don\'t do anything here.'
76 );
77 }

References ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler\getFileIdentifierParameterName(), and ILIAS\FileUpload\Handler\HandlerResult\STATUS_OK.

+ Here is the call graph for this function:

◆ getUploadResult()

ILIAS\User\Settings\NewAccountMail\UploadHandlerGUI::getUploadResult ( )
protected

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

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

45 : HandlerResult
46 {
47 $this->upload->process();
48
49 $result_array = $this->upload->getResults();
50 $result = end($result_array);
51
52 if (!($result instanceof UploadResult) || !$result->isOK()) {
53 return new BasicHandlerResult(
56 '',
57 $result->getStatus()->getMessage()
58 );
59 }
60
61 return new BasicHandlerResult(
64 $this->storage->manage()->upload($result, $this->stakeholder)->serialize(),
65 'file upload OK'
66 );
67 }

References ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler\getFileIdentifierParameterName(), ILIAS\FileUpload\Handler\HandlerResult\STATUS_FAILED, ILIAS\FileUpload\Handler\HandlerResult\STATUS_OK, and ILIAS\Repository\upload().

+ Here is the call graph for this function:

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