ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ILIAS\File\Icon\ilIconUploadHandlerGUI Class Reference
+ Inheritance diagram for ILIAS\File\Icon\ilIconUploadHandlerGUI:
+ Collaboration diagram for ILIAS\File\Icon\ilIconUploadHandlerGUI:

Public Member Functions

 __construct ()
 ilUIDemoFileUploadHandlerGUI constructor. More...
 
 getInfoResult (string $rid)
 
 getInfoForExistingFiles (array $resource_identifiers)
 
- Public Member Functions inherited from ILIAS\FileUpload\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

 getRemoveResult (string $rid)
 
- Protected Member Functions inherited from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler
 readChunkedInformation ()
 
 getUploadResult ()
 
 getRemoveResult (string $identifier)
 

Private Attributes

Services $storage
 
ilObjFileIconStakeholder $stakeholder
 
WrapperFactory $wrapper
 
Factory $refinery
 

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

Constructor & Destructor Documentation

◆ __construct()

ILIAS\File\Icon\ilIconUploadHandlerGUI::__construct ( )

ilUIDemoFileUploadHandlerGUI constructor.

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

References $DIC, $id, $message, ILIAS\MetaData\Repository\Validation\Data\__construct(), ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler\getFileIdentifierParameterName(), ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler\getUploadResult(), ILIAS\FileUpload\DTO\UploadResult\isOK(), ILIAS\Repository\refinery(), ILIAS\FileUpload\Handler\HandlerResult\STATUS_FAILED, ILIAS\FileUpload\Handler\HandlerResult\STATUS_OK, and ILIAS\Repository\upload().

49  {
50  global $DIC;
52  $this->storage = $DIC->resourceStorage();
53  $this->wrapper = $DIC->http()->wrapper();
54  $this->refinery = $DIC->refinery();
55  $this->stakeholder = new ilObjFileIconStakeholder();
56  }
global $DIC
Definition: feed.php:28
__construct(VocabulariesInterface $vocabularies)
+ Here is the call graph for this function:

Member Function Documentation

◆ getInfoForExistingFiles()

ILIAS\File\Icon\ilIconUploadHandlerGUI::getInfoForExistingFiles ( array  $resource_identifiers)
Returns
[]

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

Definition at line 144 of file class.ilIconUploadHandlerGUI.php.

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

144  : array
145  {
146  $infos = [];
147  foreach ($resource_identifiers as $rid) {
148  $id = $this->storage->manage()->find($rid);
149  if (!$id instanceof \ILIAS\ResourceStorage\Identification\ResourceIdentification) {
150  continue;
151  }
152  $r = $this->storage->manage()->getCurrentRevision($id)->getInformation();
153 
154  $infos[] = new BasicFileInfoResult(
156  $rid,
157  $r->getTitle(),
158  $r->getSize(),
159  $r->getMimeType()
160  );
161  }
162 
163  return $infos;
164  }
Class ChatMainBarProvider .
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
$r
+ Here is the call graph for this function:

◆ getInfoResult()

ILIAS\File\Icon\ilIconUploadHandlerGUI::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 124 of file class.ilIconUploadHandlerGUI.php.

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

124  : ?FileInfoResult
125  {
126  $id = $this->storage->manage()->find($rid);
127  if (!$id instanceof \ILIAS\ResourceStorage\Identification\ResourceIdentification) {
128  return new BasicFileInfoResult($this->getFileIdentifierParameterName(), 'unknown', 'unknown', 0, 'unknown');
129  }
130  $r = $this->storage->manage()->getCurrentRevision($id)->getInformation();
131 
132  return new BasicFileInfoResult(
134  $rid,
135  $r->getTitle(),
136  $r->getSize(),
137  $r->getMimeType()
138  );
139  }
Class ChatMainBarProvider .
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
$r
+ Here is the call graph for this function:

◆ getRemoveResult()

ILIAS\File\Icon\ilIconUploadHandlerGUI::getRemoveResult ( string  $rid)
protected

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

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

102  : HandlerResult
103  {
104  $id = $this->storage->manage()->find($rid);
105  if ($id !== null) {
106  $rev = $this->storage->manage()->getCurrentRevision($id);
107  $rev_num = $rev->getVersionNumber();
108  $this->storage->manage()->removeRevision($id, $rev_num);
109  return new BasicHandlerResult(
112  $rid,
113  'file deleted'
114  );
115  }
116  return new BasicHandlerResult(
119  $rid,
120  'file not found'
121  );
122  }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

Field Documentation

◆ $refinery

Factory ILIAS\File\Icon\ilIconUploadHandlerGUI::$refinery
private

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

◆ $stakeholder

ilObjFileIconStakeholder ILIAS\File\Icon\ilIconUploadHandlerGUI::$stakeholder
private

Definition at line 41 of file class.ilIconUploadHandlerGUI.php.

◆ $storage

Services ILIAS\File\Icon\ilIconUploadHandlerGUI::$storage
private

Definition at line 40 of file class.ilIconUploadHandlerGUI.php.

◆ $wrapper

WrapperFactory ILIAS\File\Icon\ilIconUploadHandlerGUI::$wrapper
private

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


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