19 declare(strict_types=1);
51 $this->resource_storage = $resourceStorage;
52 $this->upload_service = $uploadService;
63 int $size = self::IMAGE_SIZE_XS
68 $identification = $this->resource_storage->manage()->find($badge->
getImageRid());
69 if ($identification !==
null) {
71 $urls = $this->resource_storage->consume()->flavourUrls($flavour)->getURLsAsArray();
72 if (\count($urls) === self::IMAGE_URL_COUNT && isset($urls[$size])) {
73 $image_src = $urls[$size];
76 } elseif ($badge instanceof
ilBadge) {
87 $array_result = $this->upload_service->getResults();
88 $array_result = array_pop($array_result);
90 $identification = $this->resource_storage->manage()->upload($array_result, $stakeholder);
94 }
catch (IllegalStateException
$e) {
95 $this->main_template->setOnScreenMessage(
'failure', $e->getMessage(),
true);
104 return $this->resource_storage->manage()->clone($identification)->serialize();
cloneBadgeImageByRid(ResourceIdentification $identification)
getImageFromResourceId(ilBadge $badge, int $size=self::IMAGE_SIZE_XS)
processImageUpload(ilBadge $badge)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
getImageFromBadge(ilBadge $badge, int $size=self::IMAGE_SIZE_XS)
ilGlobalTemplateInterface $main_template
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Class ResourceIdentification.
getImagePath(bool $a_full_path=true)
FileUpload $upload_service
static signFile(string $path_to_file)
__construct(Services $resourceStorage, FileUpload $uploadService, ilGlobalTemplateInterface $main_template)
setImageRid(?string $image_rid)
Services $resource_storage