ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
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\MetaData\OERExposer\OAIPMH\Handler\AbstractCtrlAwareUploadHandler
 __construct ()
 ilUIDemoFileUploadHandlerGUI constructor. More...
 
 getFileIdentifierParameterName ()
 
 getUploadURL ()
 
 getExistingFileInfoURL ()
 
 getFileRemovalURL ()
 
 executeCommand ()
 Since this is a ilCtrl aware UploadHandler executeCommand MUST be implemented. More...
 
 getInfoResult (string $identifier)
 
 getInfoForExistingFiles (array $file_ids)
 
 supportsChunkedUploads ()
 

Protected Member Functions

 getUploadResult ()
 
 getRemoveResult (string $identifier)
 
- Protected Member Functions inherited from ILIAS\MetaData\OERExposer\OAIPMH\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\MetaData\OERExposer\OAIPMH\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
[]

Implements ILIAS\UI\Component\Input\Field\UploadHandler.

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

References getInfoResult().

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  }
+ 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.

Implements ILIAS\UI\Component\Input\Field\UploadHandler.

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

References $id, ILIAS\MetaData\OERExposer\OAIPMH\Handler\AbstractCtrlAwareUploadHandler\getFileIdentifierParameterName(), ILIAS\MetaData\OERExposer\OAIPMH\Handler\FileInfoResult\getSize(), and null.

Referenced by getInfoForExistingFiles().

145  : ?FileInfoResult
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  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRemoveResult()

TileImageUploadHandlerGUI::getRemoveResult ( string  $identifier)
protected

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

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

127  : HandlerResult
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  }
language()
description: > Example for rendring a language glyph.
Definition: language.php:41
+ Here is the call graph for this function:

◆ getUploadResult()

TileImageUploadHandlerGUI::getUploadResult ( )
protected

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

References $message, $rid, ILIAS\MetaData\OERExposer\OAIPMH\Handler\AbstractCtrlAwareUploadHandler\getFileIdentifierParameterName(), null, and ILIAS\Repository\upload().

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(),
123  $message
124  );
125  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
$message
Definition: xapiexit.php:31
+ 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: