19 declare(strict_types=1);
45 private bool $custom_icons_enabled,
56 if ($this->object_type_specific_property_providers ===
null) {
59 return $this->object_type_specific_property_providers->getObjectTypeSpecificIcon($object_id, $factory, $irss);
75 $clone->deleted_flag =
true;
87 $clone->temp_file_name = $name;
96 if (!$this->custom_icons_enabled) {
99 $trafo = $refinery->custom()->transformation(
101 $property_icon =
new self(
102 $this->custom_icons_enabled,
106 if (count($v) > 0 && $v[0] !==
'custom_icon') {
107 return $property_icon
108 ->withTempFileName($v[0]);
111 if (count($v) === 0 && $this->
custom_icon->exists()) {
112 return $property_icon
116 return $property_icon;
119 $custom_icon = $field_factory
121 ->withAcceptedMimeTypes(self::SUPPORTED_MIME_TYPES)
122 ->withAdditionalTransformation($trafo);
128 return $custom_icon->withValue([
'custom_icon']);
134 if (!$this->custom_icons_enabled) {
137 $custom_icon_input = new \ilImageFileInputGUI($language->
txt(self::INPUT_LABEL),
'icon');
138 $custom_icon_input->setSuffixes($this->
custom_icon->getSupportedFileExtensions());
139 $custom_icon_input->setUseCache(
false);
141 $custom_icon_input->setImage($this->
custom_icon->getFullPath());
143 $custom_icon_input->setImage(
'');
146 return $custom_icon_input;
toLegacyForm(\ilLanguage $language)
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
custom_icon()
description: > Example for rendering custom icons.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
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...
__construct(private bool $custom_icons_enabled, private ?Custom $custom_icon=null, private ?ObjectTypeSpecificPropertyProviders $object_type_specific_property_providers=null)
toForm(\ilLanguage $language, FieldFactory $field_factory, Refinery $refinery)
getObjectTypeSpecificIcon(int $object_id, IconFactory $factory, StorageService $irss)
const SUPPORTED_MIME_TYPES
withTempFileName(string $name)