19declare(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];
87 $array_result = $this->upload_service->getResults();
88 $array_result = array_pop($array_result);
90 $identification = $this->resource_storage->manage()->upload($array_result, $stakeholder);
95 $this->main_template->setOnScreenMessage(
'failure',
$e->getMessage(),
true);
104 return $this->resource_storage->manage()->clone($identification)->serialize();
ilGlobalTemplateInterface $main_template
getImageFromResourceId(ilBadge $badge, int $size=self::IMAGE_SIZE_XS)
FileUpload $upload_service
cloneBadgeImageByRid(ResourceIdentification $identification)
processImageUpload(ilBadge $badge)
__construct(Services $resourceStorage, FileUpload $uploadService, ilGlobalTemplateInterface $main_template)
Services $resource_storage
getImageFromBadge(ilBadge $badge, int $size=self::IMAGE_SIZE_XS)
Class IllegalStateException.
Class ResourceIdentification.
getImagePath(bool $a_full_path=true)
setImageRid(?string $image_rid)
static signFile(string $path_to_file)