lib/kolab_form.php

Aleksander Machniak machniak at kolabsys.com
Thu Mar 15 13:16:35 CET 2012


 lib/kolab_form.php |   17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

New commits:
commit e850aeb57db53fb2e70412f79ac57507715cc849
Author: Aleksander Machniak <alec at alec.pl>
Date:   Thu Mar 15 13:15:28 2012 +0100

    Fix hidden fields handling (#633)

diff --git a/lib/kolab_form.php b/lib/kolab_form.php
index 2e087f0..c78486f 100644
--- a/lib/kolab_form.php
+++ b/lib/kolab_form.php
@@ -120,6 +120,7 @@ class kolab_form
     public function output()
     {
         $content = '';
+        $hidden  = array();
 
         if (!empty($this->sections)) {
             foreach ($this->sections as $set_idx => $set) {
@@ -130,6 +131,11 @@ class kolab_form
                         continue;
                     }
 
+                    if ($element['type'] == self::INPUT_HIDDEN) {
+                        $hidden[] = $this->get_element($element);
+                        continue;
+                    }
+
                     $rows[] = $this->form_row($element);
                 }
 
@@ -150,11 +156,20 @@ class kolab_form
                 continue;
             }
 
+            if ($element['type'] == self::INPUT_HIDDEN) {
+                $hidden[] = $this->get_element($element);
+                continue;
+            }
+
             $rows[] = $this->form_row($element);
         }
 
         if (!empty($rows)) {
-             $content = kolab_html::table(array('body' => $rows, 'class' => 'form'));
+            $content = kolab_html::table(array('body' => $rows, 'class' => 'form'));
+        }
+
+        if (!empty($hidden)) {
+            $content .= implode("\n", $hidden);
         }
 
         // Add form buttons





More information about the commits mailing list