19declare(strict_types=1);
55 $slot = $this->vocabulary_adapter->slotForElement($element);
57 if (!$this->vocabulary_adapter->doesSlotHaveVocabularies($slot)) {
59 $this->getInputLabelFromElement($this->presenter, $element, $context_element),
64 if (!$this->vocabulary_adapter->doesSlotAllowCustomInput($slot)) {
66 $this->getInputLabelFromElement($this->presenter, $element, $context_element),
73 $this->getInputLabelFromElement($this->presenter, $element, $context_element),
84 $super_name = $element->getSuperElement()
87 if ($super_name ===
'description') {
88 $input = $this->ui_factory->textarea($label);
90 $input = $this->ui_factory->text($label);
94 $input = $this->addValueFromElement($element, $input);
96 return $this->addConstraintsFromElement($this->constraint_dictionary, $element, $input, !$with_value);
104 SlotIdentifier $slot,
109 $data = $this->getValueFromElementOrConstraint($element);
110 $raw_values = $this->vocabulary_adapter->valuesInVocabulariesForSlot($slot,
$data);
111 foreach ($this->presenter->data()->vocabularyValues($slot, ...$raw_values) as $labelled_value) {
112 $values[$labelled_value->value()] = $labelled_value->label();
114 $input = $this->ui_factory->select($label, $values);
117 $input = $this->addValueFromElement($element, $input);
119 return $this->addConstraintsFromElement($this->constraint_dictionary, $element, $input, !$with_value);
124 SlotIdentifier $slot,
127 $data = $this->getValueFromElementOrConstraint($element);
129 $value_label = $this->presenter->utilities()->txt(
'md_editor_value');
130 $select_input = $this->buildSelectInput($value_label, $slot, $element,
false);
131 $text_input = $this->buildTextInput($value_label, $element,
false);
134 if ($this->vocabulary_adapter->isValueInVocabulariesForSlot($slot,
$data)) {
135 $select_input = $select_input->withValue(
$data);
136 $radio_value =
'from_vocab';
138 $text_input = $text_input->withValue(
$data);
139 $radio_value =
'custom';
143 $input = $this->ui_factory->switchableGroup(
145 'from_vocab' => $this->ui_factory->group(
146 [
'value' => $select_input],
147 $this->presenter->utilities()->txt(
'md_editor_from_vocab_input')
149 'custom' => $this->ui_factory->group(
150 [
'value' => $text_input],
151 $this->presenter->utilities()->txt(
'md_editor_custom_input')
156 if (isset($radio_value)) {
157 $input = $input->withValue($radio_value);
159 return $this->addConstraintsFromElement($this->constraint_dictionary, $element, $input,
true)
160 ->withAdditionalTransformation(
161 $this->
refinery->custom()->transformation(function ($vs) {
162 return $vs[1][
'value'] ??
null;
177 return $this->getPresetValueFromConstraints($this->constraint_dictionary, $element) ??
$data;
184 return $this->rawInput($element, $context_element);
190 SlotIdentifier $conditional_slot
192 return $this->rawInput($element, $context_element);
return['delivery_method'=> 'php',]
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc