ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ilSkillProfileUploadHandlerGUI Class Reference

Class ilSkillProfileUploadHandlerGUI. More...

+ Inheritance diagram for ilSkillProfileUploadHandlerGUI:
+ Collaboration diagram for ilSkillProfileUploadHandlerGUI:

Public Member Functions

 __construct ()
 
 getInfoResult (string $identifier)
 
 getInfoForExistingFiles (array $file_ids)
 
- 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 $identifier)
 
- Protected Member Functions inherited from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler
 readChunkedInformation ()
 
 getUploadResult ()
 
 getRemoveResult (string $identifier)
 

Private Attributes

ResourceStorage $storage
 
ilSkillProfileStorageStakeHolder $stakeholder
 

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()

ilSkillProfileUploadHandlerGUI::__construct ( )

Member Function Documentation

◆ getInfoForExistingFiles()

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

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

Definition at line 99 of file class.ilSkillProfileUploadHandlerGUI.php.

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

99  : array
100  {
101  $infos = [];
102  foreach ($file_ids as $file_id) {
103  $id = $this->storage->manage()->find($file_id);
104  if ($id === null) {
105  continue;
106  }
107  $r = $this->storage->manage()->getCurrentRevision($id)->getInformation();
108 
109  $infos[] = new BasicFileInfoResult($this->getFileIdentifierParameterName(), $file_id, $r->getTitle(), $r->getSize(), $r->getMimeType());
110  }
111 
112  return $infos;
113  }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

◆ getInfoResult()

ilSkillProfileUploadHandlerGUI::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 82 of file class.ilSkillProfileUploadHandlerGUI.php.

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

83  {
84  $id = $this->storage->manage()->find($identifier);
85  if ($id === null) {
86  return new BasicFileInfoResult($this->getFileIdentifierParameterName(), 'unknown', 'unknown', 0, 'unknown');
87  }
88  $r = $this->storage->manage()->getCurrentRevision($id)->getInformation();
89 
90  return new BasicFileInfoResult(
92  $identifier,
93  $r->getTitle(),
94  $r->getSize(),
95  $r->getMimeType()
96  );
97  }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

◆ getRemoveResult()

ilSkillProfileUploadHandlerGUI::getRemoveResult ( string  $identifier)
protected

Definition at line 70 of file class.ilSkillProfileUploadHandlerGUI.php.

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

71  {
72  $id = $this->storage->manage()->find($identifier);
73  if ($id !== null) {
74  $this->storage->manage()->remove($id, $this->stakeholder);
75 
76  return new BasicHandlerResult($this->getFileIdentifierParameterName(), HandlerResultInterface::STATUS_OK, $identifier, 'file deleted');
77  } else {
78  return new BasicHandlerResult($this->getFileIdentifierParameterName(), HandlerResultInterface::STATUS_FAILED, $identifier, 'file not found');
79  }
80  }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
+ Here is the call graph for this function:

Field Documentation

◆ $stakeholder

ilSkillProfileStorageStakeHolder ilSkillProfileUploadHandlerGUI::$stakeholder
private

Definition at line 38 of file class.ilSkillProfileUploadHandlerGUI.php.

◆ $storage

ResourceStorage ilSkillProfileUploadHandlerGUI::$storage
private

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


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