ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
TileImageUploadHandlerGUI Class Reference
+ Inheritance diagram for TileImageUploadHandlerGUI:
+ Collaboration diagram for TileImageUploadHandlerGUI:

Public Member Functions

 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)
 

Protected Attributes

ilLanguage $language
 
ResourceStorageServices $storage
 
Stakeholder $stakeholder
 
FlavourDefinition $flavour
 
ResourceIdentification $rid = null
 
bool $has_access = false
 
- 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
 

Additional Inherited Members

- Data Fields inherited from ILIAS\UI\Component\Input\Field\UploadHandler
const DEFAULT_FILE_ID_PARAMETER = 'file_id'
 

Detailed Description

Member Function Documentation

◆ getInfoForExistingFiles()

TileImageUploadHandlerGUI::getInfoForExistingFiles ( array  $file_ids)
Returns
\ILIAS\FileUpload\Handler\BasicFileInfoResult[]

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

Definition at line 169 of file class.TileImageUploadHandlerGUI.php.

169 : array
170 {
171 $info_results = [];
172 foreach ($file_ids as $identifier) {
173 $info_results[] = $this->getInfoResult($identifier);
174 }
175
176 return $info_results;
177 }

References getInfoResult().

+ Here is the call graph for this function:

◆ getInfoResult()

TileImageUploadHandlerGUI::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 145 of file class.TileImageUploadHandlerGUI.php.

146 {
147 if (null !== ($id = $this->storage->manage()->find($identifier))) {
148 $revision = $this->storage->manage()->getCurrentRevision($id)->getInformation();
149 $title = $revision->getTitle();
150 $size = $revision->getSize();
151 $mime = $revision->getMimeType();
152 } else {
153 $title = $mime = 'unknown';
154 $size = 0;
155 }
156
157 return new BasicFileInfoResult(
159 $identifier,
160 $title,
161 $size,
162 $mime
163 );
164 }
$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 getInfoForExistingFiles().

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

◆ getRemoveResult()

TileImageUploadHandlerGUI::getRemoveResult ( string  $identifier)
protected

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

Definition at line 127 of file class.TileImageUploadHandlerGUI.php.

128 {
129 if ($this->has_access === false) {
130 return $this->getAccessFailureResult(
132 $identifier,
133 $this->language
134 );
135 }
136
137 return new BasicHandlerResult(
139 HandlerResult::STATUS_OK,
140 $identifier,
141 "We just don't do anything here."
142 );
143 }

References ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler\getFileIdentifierParameterName(), and ILIAS\UI\examples\Symbol\Glyph\Language\language().

+ Here is the call graph for this function:

◆ getUploadResult()

TileImageUploadHandlerGUI::getUploadResult ( )
protected

@inheritDoc

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

Definition at line 88 of file class.TileImageUploadHandlerGUI.php.

89 {
90 $this->upload->process();
91
92 $result_array = $this->upload->getResults();
93 $result = end($result_array);
94
95 if (!($result instanceof UploadResult) || !$result->isOK()) {
96 return new BasicHandlerResult(
98 HandlerResult::STATUS_FAILED,
99 '',
100 $result->getStatus()->getMessage()
101 );
102 }
103
104 $status = HandlerResult::STATUS_OK;
105 $message = "file upload OK";
106 if ($this->rid === null) {
107 $i = $this->storage->manage()->upload($result, $this->stakeholder);
108 } else {
109 $i = $this->rid;
110 $this->storage->manage()->replaceWithUpload(
111 $i,
112 $result,
113 $this->stakeholder
114 );
115 }
116
117 $this->storage->flavours()->ensure($i, $this->flavour);
118
119 return new BasicHandlerResult(
121 $status,
122 $i->serialize(),
124 );
125 }
$message
Definition: xapiexit.php:31

References $message, $rid, ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler\getFileIdentifierParameterName(), and ILIAS\Repository\upload().

+ Here is the call graph for this function:

Field Documentation

◆ $flavour

FlavourDefinition TileImageUploadHandlerGUI::$flavour
protected

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

◆ $has_access

bool TileImageUploadHandlerGUI::$has_access = false
protected

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

◆ $language

ilLanguage TileImageUploadHandlerGUI::$language
protected

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

◆ $rid

ResourceIdentification TileImageUploadHandlerGUI::$rid = null
protected

Definition at line 47 of file class.TileImageUploadHandlerGUI.php.

Referenced by getUploadResult().

◆ $stakeholder

Stakeholder TileImageUploadHandlerGUI::$stakeholder
protected

Definition at line 44 of file class.TileImageUploadHandlerGUI.php.

◆ $storage

ResourceStorageServices TileImageUploadHandlerGUI::$storage
protected

Definition at line 43 of file class.TileImageUploadHandlerGUI.php.


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