19declare(strict_types=1);
34 protected ?
string $id =
null;
47 $this->
lng = $DIC->language();
57 throw new InvalidArgumentException(
'ADTFormBridge Type mismatch.');
69 $this->
form = $a_form;
91 public function setTitle(
string $a_value): void
93 $this->title = trim($a_value);
101 public function setInfo(
string $a_value): void
103 $this->
info = trim($a_value);
116 if (!is_array($a_value)) {
117 $a_value = (string) $a_value;
119 $this->parent = $a_value;
143 $this->required = $a_value;
175 if (is_array($parent_def)) {
176 $parent_option = $parent_def[1];
177 $parent_def = $parent_def[0];
179 $parent_field = $this->
getForm()->getItemByPostVar($parent_def);
182 if ($parent_option && method_exists($parent_field,
"getOptions")) {
183 foreach ($parent_field->getOptions() as $option) {
184 if ($option->getValue() == $parent_option) {
185 $parent_field = $option;
193 return $parent_field;
203 $field->addSubItem($a_field);
205 $this->
getForm()->addItem($a_field);
229 return !$this->
getADT()->isNull();
245 $parent_option =
null;
250 return $a_parent_adt->isActiveForSubItems($parent_option);
265 $field->setAlert($this->
lng->txt(
"msg_input_is_required"));
268 elseif (!$this->
getADT()->isValid()) {
270 $mess = $this->
getADT()->getValidationErrors();
271 foreach ($mess as $error_code) {
272 $tmp[] = $this->
getADT()->translateErrorCode($error_code);
275 $field->setAlert(implode(
"<br />", $tmp));
284 $field->setAlert(implode(
"<br />", $a_errors));
ADT definition base class.
form( $class_path, string $cmd, string $submit_caption="")