Support hidden fields
authorJoey Schulze <joey@infodrom.org>
Thu, 4 Mar 2010 19:24:18 +0000 (20:24 +0100)
committerJoey Schulze <joey@infodrom.org>
Thu, 4 Mar 2010 19:24:18 +0000 (20:24 +0100)
lib/mask.php

index eda8248..fc49454 100644 (file)
@@ -30,7 +30,9 @@ function build_form($name, $mask)
   $ret[] = sprintf('<input type="hidden" id="edit_source" name="source" value="%s">', $name);
 
   foreach ($mask['edit'] as $id => $info) {
-    if ($info['type'] == 'text' || $info['type'] == 'passwd' ||
+    if ($info['type'] == 'hidden') {
+      $ret[] = sprintf('<input type="hidden" id="edit_%s" name="%s">', $id, $id);
+    } else if ($info['type'] == 'text' || $info['type'] == 'passwd' ||
        $info['type'] == 'decimal' || $info['type'] == 'number') {
       $v = array('id="edit_'.$id.'"',
                 'name="'.$id.'"');
@@ -57,7 +59,8 @@ function build_form($name, $mask)
     }
     if (array_key_exists('comment',$info))
       $ret[] = sprintf('<span class="comment">%s</span>', $info['comment']);
-    $ret[] = '<br>';
+    if ($info['type'] != 'hidden')
+      $ret[] = '<br>';
   }
 
   $ret[] = '<span id="form_status">&nbsp;</span>';