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

Public Member Functions

 __construct (string $identification)
 
 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)
 

Protected Attributes

ilMDCopyrightImageStakeholder $stakeholder
 
Services $storage
 
string $identification
 
- 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

Definition at line 30 of file class.ilMDCopyrightImageUploadHandlerGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilMDCopyrightImageUploadHandlerGUI::__construct ( string  $identification)

Definition at line 36 of file class.ilMDCopyrightImageUploadHandlerGUI.php.

37 {
38 global $DIC;
39
40 $this->stakeholder = new ilMDCopyrightImageStakeholder();
41 $this->storage = $DIC->resourceStorage();
42 $this->identification = $identification;
43
45 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

References $DIC, $identification, and ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

Member Function Documentation

◆ getInfoForExistingFiles()

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

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

Definition at line 109 of file class.ilMDCopyrightImageUploadHandlerGUI.php.

109 : array
110 {
111 $info_results = [];
112 foreach ($file_ids as $identifier) {
113 $info_results[] = $this->getInfoResult($identifier);
114 }
115
116 return $info_results;
117 }

References getInfoResult().

+ Here is the call graph for this function:

◆ getInfoResult()

ilMDCopyrightImageUploadHandlerGUI::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 88 of file class.ilMDCopyrightImageUploadHandlerGUI.php.

89 {
90 if (null !== ($id = $this->storage->manage()->find($identifier))) {
91 $revision = $this->storage->manage()->getCurrentRevision($id)->getInformation();
92 $title = $revision->getTitle();
93 $size = $revision->getSize();
94 $mime = $revision->getMimeType();
95 } else {
96 $title = $mime = 'unknown';
97 $size = 0;
98 }
99
100 return new BasicFileInfoResult(
102 $identifier,
103 $title,
104 $size,
105 $mime
106 );
107 }
$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()

ilMDCopyrightImageUploadHandlerGUI::getRemoveResult ( string  $identifier)
protected

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

Definition at line 78 of file class.ilMDCopyrightImageUploadHandlerGUI.php.

79 {
80 return new BasicHandlerResult(
82 HandlerResult::STATUS_OK,
83 $identifier,
84 'asynchronous removal blocked'
85 );
86 }

References ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler\getFileIdentifierParameterName().

+ Here is the call graph for this function:

◆ getUploadResult()

ilMDCopyrightImageUploadHandlerGUI::getUploadResult ( )
protected

Reimplemented from ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler.

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

48 {
49 $status = HandlerResult::STATUS_FAILED;
50 $new_identification = 'unknown';
51 $message = 'file upload failed';
52
53 $this->upload->process();
54 $uploadResults = $this->upload->getResults();
55 $result = end($uploadResults);
56
57 if ($result instanceof UploadResult && $result->isOK() && $result->getSize()) {
58 $resource_id = $this->storage->manage()->find($this->identification);
59 if (is_null($resource_id)) {
60 $new_identification = $this->storage->manage()->upload($result, $this->stakeholder)->serialize();
61 $status = HandlerResult::STATUS_OK;
62 $message = 'Upload ok';
63 } elseif ($this->identification !== '') {
64 $this->storage->manage()->replaceWithUpload($resource_id, $result, $this->stakeholder);
65 $new_identification = $this->identification;
66 $status = HandlerResult::STATUS_OK;
67 $message = 'Upload ok';
68 }
69 }
70 return new BasicHandlerResult(
72 $status,
73 $new_identification,
75 );
76 }
$message
Definition: xapiexit.php:31

References $identification, $message, ILIAS\FileUpload\Handler\AbstractCtrlAwareUploadHandler\getFileIdentifierParameterName(), ILIAS\FileUpload\DTO\UploadResult\isOK(), and ILIAS\Repository\upload().

+ Here is the call graph for this function:

Field Documentation

◆ $identification

string ilMDCopyrightImageUploadHandlerGUI::$identification
protected

Definition at line 34 of file class.ilMDCopyrightImageUploadHandlerGUI.php.

Referenced by __construct(), and getUploadResult().

◆ $stakeholder

ilMDCopyrightImageStakeholder ilMDCopyrightImageUploadHandlerGUI::$stakeholder
protected

Definition at line 32 of file class.ilMDCopyrightImageUploadHandlerGUI.php.

◆ $storage

Services ilMDCopyrightImageUploadHandlerGUI::$storage
protected

Definition at line 33 of file class.ilMDCopyrightImageUploadHandlerGUI.php.


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