19declare(strict_types=1);
39 DataFactory $data_factory,
54 if (is_null($value)) {
57 if (is_array($value)) {
58 foreach ($value as $v) {
59 if (!array_key_exists($v, $this->options)) {
73 if ($this->requirement_constraint !==
null) {
74 return $this->requirement_constraint;
77 return $this->
refinery->custom()->constraint(
78 fn($value) => is_array($value) && count($value) > 0,
88 return static fn(
$id) => <<<JS
90 function reduceMultiSelectCheckboxInputs(inputs) {
93 .filter((input) => input.checked)
94 .map((input) => input.parentElement.querySelector(
'.c-field-multiselect__label-text')?.textContent ??
'')
97 const multiSelectField = document.getElementById(
'$id');
98 const multiSelectCheckboxInputs = multiSelectField.querySelectorAll(
'.c-field-multiselect input[type="checkbox"]');
99 multiSelectCheckboxInputs.forEach((input) => {
100 input.addEventListener(
'input', (
event) => {
101 il.UI.input.onFieldUpdate(
event,
'$id', reduceMultiSelectCheckboxInputs(multiSelectCheckboxInputs));
104 il.UI.input.onFieldUpdate(undefined,
'$id', reduceMultiSelectCheckboxInputs(multiSelectCheckboxInputs));
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
A constraint encodes some resrtictions on values.
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
Interface Observer \BackgroundTasks Contains several chained tasks and infos about them.