18declare(strict_types=1);
37 DataFactory $data_factory,
42 protected ImagePurpose $image_purpose,
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'))
94 ], $language->
txt(
'image_purpose_user_defined'))->withRequired(
true);
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...
txt(string $a_topic, string $a_default_lang_fallback_mod="")
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc