ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilObjBibliographicUploadHandlerGUI.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
24
30{
31 public function __construct(private string $rid = "")
32 {
34 }
35
36 #[\Override]
37 protected function getUploadResult(): HandlerResult
38 {
39 $this->upload->process();
40
41 $result_array = $this->upload->getResults();
42 $result = end($result_array);
43
44 if ($result instanceof UploadResult && $result->isOK()) {
45 $resource_identification = $this->storage->manage()->find($this->rid);
46 if ($resource_identification !== null) {
47 $identifier = $this->storage->manage()->replaceWithUpload(
48 $resource_identification,
49 $result,
50 $this->stakeholder
51 )->getIdentification()->serialize();
52 } else {
53 $identifier = $this->storage->manage()->upload($result, $this->stakeholder)->serialize();
54 }
55 $status = HandlerResult::STATUS_OK;
56 $message = "file upload OK";
57 } else {
58 $identifier = '';
59 $status = HandlerResult::STATUS_FAILED;
60 $message = $result->getStatus()->getMessage();
61 }
62
63 return new BasicHandlerResult(
65 $status,
66 $identifier,
68 );
69 }
70}
Class ilCtrlAwareStorageUploadHandler.
Class ilObjBibliographicStakeholder.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$message
Definition: xapiexit.php:31