3 declare(strict_types=1);
20 protected ?
string $id = null;
33 $this->
lng = $DIC->language();
55 $this->
form = $a_form;
77 public function setTitle(
string $a_value): void
79 $this->title = trim($a_value);
87 public function setInfo(
string $a_value): void
89 $this->
info = trim($a_value);
102 if (!is_array($a_value)) {
103 $a_value = (string) $a_value;
105 $this->parent = $a_value;
129 $this->required = $a_value;
161 if (is_array($parent_def)) {
162 $parent_option = $parent_def[1];
163 $parent_def = $parent_def[0];
165 $parent_field = $this->
getForm()->getItemByPostVar($parent_def);
168 if ($parent_option && method_exists($parent_field,
"getOptions")) {
169 foreach ($parent_field->getOptions() as $option) {
170 if ($option->getValue() == $parent_option) {
171 $parent_field = $option;
179 return $parent_field;
189 $field->addSubItem($a_field);
191 $this->
getForm()->addItem($a_field);
198 abstract public function addToForm(): void;
215 return !$this->
getADT()->isNull();
231 $parent_option = null;
236 return $a_parent_adt->isActiveForSubItems($parent_option);
251 $field->setAlert($this->
lng->txt(
"msg_input_is_required"));
254 elseif (!$this->
getADT()->isValid()) {
256 $mess = $this->
getADT()->getValidationErrors();
257 foreach ($mess as $error_code) {
258 $tmp[] = $this->
getADT()->translateErrorCode($error_code);
261 $field->setAlert(implode(
"<br />", $tmp));
270 $field->setAlert(implode(
"<br />", $a_errors));
form( $class_path, string $cmd)
ADT definition base class.