X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=metaform.php;h=1cfb70c7dc099299d33f312b1081d22dfe2a22c1;hb=93f76cafaeb914987e47efa22ad74ca435b02bfb;hp=b4ec6e03e1109b92989778b90bd1967a97ff62e4;hpb=3e70448969d205f3387edc245c6b52d01ae9ab75;p=wfpl.git diff --git a/metaform.php b/metaform.php index b4ec6e0..1cfb70c 100644 --- a/metaform.php +++ b/metaform.php @@ -18,10 +18,10 @@ # This file writes the code for you (sql, php, html, email) to handle a form. -require_once('code/wfpl/template.php'); -require_once('code/wfpl/http.php'); -require_once('code/wfpl/tar.php'); -require_once('code/wfpl/format.php'); +require_once(__DIR__ . '/template.php'); +require_once(__DIR__ . '/http.php'); +require_once(__DIR__ . '/tar.php'); +require_once(__DIR__ . '/format.php'); # see code/wfpl/metaform/template.html for the html templates for these elements $GLOBALS['types'] = array( @@ -30,7 +30,7 @@ $GLOBALS['types'] = array( 'name' => array('textbox', 'oneline', 'varchar(200) binary'), 'textbox' => array('textbox', 'oneline', 'varchar(200) binary'), 'int' => array('textbox', 'int', 'int'), - 'decimal' => array('textbox', 'decimal', 'decimal(12,12)'), + 'decimal' => array('textbox', 'decimal', 'decimal(12,2)'), 'bigint' => array('textbox', 'int', 'varchar(100) binary'), # up to 100 digits, stored as a string 'zip' => array('textbox', 'zip', 'varchar(20) binary'), 'email' => array('email', 'email', 'varchar(100) binary'), @@ -179,10 +179,6 @@ function get_fields() { $name = trim(substr($field, 0, -1)); # FIXME: stop this from getting enc_caption()ed $type = '{'; $options = null; - } elseif(substr($field, -1) == '{') { - $name = 'ignored'; - $type = '}'; - $options = null; } else { list($name, $type, $options) = split(' *', $field); if($options) $options = explode(',', $options); @@ -304,7 +300,7 @@ function make_html($whole_file = true) { } if(show_in_listing($type, $input, $format, $sql)) { - $listing_headers[] = array('caption' => format_caption($name)); + $listing_headers[] = array('caption' => format_caption($name), 'name' => $name); $listing_field = array('name' => $name); if($format == 'bool' || $format == 'yesno') { $listing_field['enc'] = 'yesno';