18 declare(strict_types=1);
33 class Image extends File implements C\Input\Field\Image
42 protected ImagePurpose $image_purpose,
52 $upload_limit_resolver,
59 $this->accepted_mime_types = [
'image/*'];
64 return $this->image_purpose;
77 if (
null === $image_purpose_input &&
null === $metadata_input) {
80 if (
null === $image_purpose_input &&
null !== $metadata_input) {
81 return $metadata_input;
83 if (
null !== $image_purpose_input &&
null === $metadata_input) {
84 return $field_factory->group([$image_purpose_input]);
86 return $field_factory->group([$image_purpose_input, $metadata_input]);
91 return $field_factory->switchableGroup([
92 ImagePurpose::INFORMATIVE->name => $field_factory->group([$field_factory->textarea($language->
txt(
'image_alt_text'))], $language->
txt(
'image_purpose_informative')),
93 ImagePurpose::DECORATIVE->name => $field_factory->group([], $language->
txt(
'image_purpose_decorative'))
99 return $field_factory->textarea($language->
txt(
'image_alt_text'))->
withRequired(
true);
ImagePurpose
This enum provides options to categorise the purpose of an image, which will be used to determine whe...
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
txt(string $a_topic, string $a_default_lang_fallback_mod="")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)