3 require_once
"Services/ADT/classes/Bridges/class.ilADTFormBridge.php";
16 if (
sizeof($this->elements)) {
20 $this->elements = array();
26 $this->elements[
$name] =
$factory->getFormBridgeForInstance($element);
41 if (array_key_exists($a_name, $this->elements)) {
42 return $this->elements[$a_name];
60 foreach ($this->elements as $element) {
61 $element->addToForm();
68 foreach ($this->elements as $element) {
69 $element->addJS($a_tpl);
76 foreach ($this->elements as $element) {
78 $parent = $element->getParentElement();
80 if (is_array($parent)) {
83 if (isset($adt_forms[$parent])) {
84 $parent = $adt_forms[$parent];
89 if ($element->shouldBeImportedFromPost($parent)) {
90 $element->importFromPost();
104 foreach ($this->
getElements() as $element_id => $element) {
105 if ($element->isRequired() && $element->getADT()->isNull()) {
106 $field = $this->
getForm()->getItemByPostvar($element_id);
107 $field->setAlert(
$lng->txt(
"msg_input_is_required"));
111 elseif (!$element->validate()) {
116 if (!$this->
getADT()->isValid()) {
121 $mess = $this->
getADT()->getValidationErrorsByElements();
122 foreach ($mess as $error_code => $element_id) {
123 $tmp[$element_id][] = $this->
getADT()->translateErrorCode($error_code);
126 foreach ($tmp as $element_id =>
$errors) {
127 $field = $this->
getForm()->getItemByPostvar($element_id);
128 $field->setAlert(implode(
"<br />",
$errors));
static getInstance()
Get singleton.
special template class to simplify handling of ITX/PEAR