public function render(html_form $form, $name, $input, $label, model_editor $editor, model_editor_field $field) { if ($this->isReadOnly) { return $this->renderStatic($form, $name, $input, $label, $editor, $field); } $available = array_merge(array('0' => \de\toxa\txf\_L('-')), $this->getSelectableOptions()); $values = array_pad($input, $this->selectorCount, null); if (\de\toxa\txf\input::vget($name . '_cmdActionAddSelector')) { $values[] = null; } if (count($values) > $this->maxCount) { array_splice($values, $this->maxCount); } $selectors = array_map(function ($value) use($name, $available) { return markup::selector($name . '[]', $available, $value); }, $values); $classes = implode(' ', array_filter(array($this->class, 'related'))); $form->setRow($name, $label, implode("\n", $selectors), $this->isMandatory, $this->hint, null, $classes); if (count($selectors) < $this->maxCount) { $form->setRowCode($name, markup::button($name . '_cmdActionAddSelector', '1', \de\toxa\txf\_L('Add Entry'), \de\toxa\txf\_L('Click this button to add another selector for choosing related information.'), 'actionAddSelector')); } return $this; }