X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=metaform.php;h=ce6a37fef91da32b0490e895a6bf0a3119c382ca;hb=53094de20d007b5a121f8a7cf814eabd8ee75b90;hp=82637970b03d73e18438d42e47c38699295abbf3;hpb=22d5fb7ab7d4ee86bd59e194387dca268bd577a1;p=wfpl.git diff --git a/metaform.php b/metaform.php index 8263797..ce6a37f 100644 --- a/metaform.php +++ b/metaform.php @@ -22,6 +22,7 @@ # 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'); # see code/wfpl/metaform/template.html for the html templates for these elements @@ -29,7 +30,8 @@ $GLOBALS['types'] = array( # type input format sql 'name' => array('textbox', 'oneline', 'varchar(200)'), 'textbox' => array('textbox', 'oneline', 'varchar(200)'), - 'int' => array('textbox', 'int', 'varchar(100)'), + 'int' => array('textbox', 'int', 'int'), + 'bigint' => array('textbox', 'int', 'varchar(100)'), # up to 100 digits, stored as a string 'email' => array('textbox', 'email', 'varchar(100)'), 'phone' => array('textbox', 'phone', 'varchar(32)'), 'money' => array('textbox', 'money', 'varchar(32)'), @@ -231,9 +233,18 @@ function make_php() { $tem->set('always_field', $always_field); $tem->set('db_fields', $db_fields); $tem->set('php_fields', $php_fields); + $tem->set('metaform_url', edit_url()); return $tem->run(); } +# make a URL for the edit page with all the fields filled in +function edit_url() { + $url = this_url(); + $url = ereg_replace('view_php=[^&]*', 'edit=yes', $url); + $url = ereg_replace('download_tar=[^&]*', 'edit=yes', $url); + return $url; +} + function view_php() { view_headers(); echo make_php();