Remove superflous code
[misc/kostenrechnung] / lib / mask.php
index e3c7eab..8549ee4 100644 (file)
@@ -35,6 +35,11 @@ function build_form($name, $fields)
       $v[] = 'type="'.($info['type']=='passwd'?'password':'text').'"';
       $ret[] = sprintf('<label for="edit_%s">%s</label><br>', $id, $info['name']);
       $ret[] = sprintf('<input %s>', implode(' ', $v));
+    } elseif ($info['type'] == 'date') {
+      $ret[] = sprintf('<label for="edit_%s">%s</label><br>', $id, $info['name']);
+      $ret[] = sprintf('<input id="edit_%s" name="%s" size="8">&nbsp;'.
+                      '<img class="calendar" src="images/icons/calendar.gif" onclick="calendar(\'edit_%s\',event)" />',
+                      $id, $id, $id);
     } elseif ($info['type'] == 'boolean') {
       $ret[] = sprintf('<label for="edit_%s">%s</label><br>', $id, $info['name']);
       $ret[] = sprintf('<input type="checkbox" id="edit_%s" name="%s">', $id, $id);
@@ -46,8 +51,6 @@ function build_form($name, $fields)
       foreach ($options as $row)
        $ret[] = sprintf('<option value="%s">%s</option>', $row['id'], $row['text']);
       $ret[] = '</select>';
-    } elseif ($info['type'] == 'date') {
-      error_log('type = date');
     }
     if (array_key_exists('comment',$info))
       $ret[] = sprintf('<span class="comment">%s</span>', $info['comment']);