19 declare(strict_types=1);
53 ImageFactory $factory,
56 if (!$this->
settings->hasTilePreviews()) {
65 if ($irss->flavours()->possible($rid, $this->crop_definition)) {
66 $flavour = $irss->flavours()->get($rid, $this->crop_definition);
69 if ($irss->flavours()->possible($rid, $this->extract_definition)) {
70 $flavour = $irss->flavours()->get($rid, $this->extract_definition);
79 ImageFactory $factory,
82 $urls = $irss->consume()->flavourUrls($flavour)->getURLsAsArray();
88 $available_widths = $this->crop_definition->getWidths();
89 array_pop($available_widths);
91 if (!isset($urls[count($available_widths)])) {
95 $image = $factory->responsive($urls[count($available_widths)],
'');
98 function (array $carry, $size) use ($urls): array {
99 $image = $carry[
'image']->withAdditionalHighResSource($urls[$carry[
'counter']], $size / 2);
100 $counter = ++$carry[
'counter'];
103 'counter' => $counter
106 [
'image' => $image,
'counter' => 0]
112 IconFactory $icon_factory,
115 $info = $this->
info->getByObjectId($obj_id);
116 $path = $this->icons->getIconFilePathBySuffix($info->getSuffix());
118 return $icon_factory->custom(
$path, $info->getSuffix());
getObjectTypeSpecificIcon(int $obj_id, IconFactory $icon_factory, StorageService $irss)
FlavourDefinition $crop_definition
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
info()
description: > Example for rendering a info message box.
ilObjFileInfoRepository $info
FlavourDefinition $extract_definition
This is how a factory for icons looks like.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
IconDatabaseRepository $icons
getObjectTypeSpecificTileImage(int $obj_id, ImageFactory $factory, StorageService $irss)
This is how the factory for UI elements looks.
getImageFromIRSS(StorageService $irss, ImageFactory $factory, Flavour $flavour)