diff options
Diffstat (limited to 'lib/classes/forms/Form.php')
| -rw-r--r-- | lib/classes/forms/Form.php | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/classes/forms/Form.php b/lib/classes/forms/Form.php index fa0422e..9c22c4f 100644 --- a/lib/classes/forms/Form.php +++ b/lib/classes/forms/Form.php @@ -297,6 +297,8 @@ class Form extends Part \PageLayout::postSuccess($this->success_message); } page_close(); + //This indicates that the form has been stored successfully. + echo "STUDIPFORM_STORE_SUCCESS"; die(); } } @@ -309,7 +311,7 @@ class Form extends Part //verify the user input: $output = []; foreach ($this->getAllInputs() as $input) { - if ($input->validate) { + if ($input->hasValidation()) { $callback = $input->getValidationCallback(); $value = $this->getStorableValueFromRequest($input); $valid = $callback($value, $input); @@ -317,7 +319,7 @@ class Form extends Part $output[$input->getName()] = [ 'name' => $input->getName(), 'label' => $input->getTitle(), - 'error' => $callback($value, $input) + 'error' => $valid, ]; } } @@ -396,7 +398,7 @@ class Form extends Part $stored = 0; foreach ($this->getAllInputs() as $input) { - if ($input->validate) { + if ($input->hasValidation()) { $callback = $input->getValidationCallback(); $value = $this->getStorableValueFromRequest($input); $valid = $callback($value, $input); @@ -450,7 +452,7 @@ class Form extends Part /** * Returns all the Part objects like Fieldsets as an array. - * @return array + * @return Part[] */ public function getParts() : array { @@ -492,7 +494,7 @@ class Form extends Part /** * Renders the whole form as a string. * @return string - * @throws \Flexi_TemplateNotFoundException + * @throws \Flexi\TemplateNotFoundException */ public function render() { |
