-if(isset($_REQUEST['fields'])) {
- if(isset($_REQUEST['view_sql'])) {
- view_sql();
- exit();
- } elseif(isset($_REQUEST['view_php'])) {
- view_php();
- exit();
- } elseif(isset($_REQUEST['view_template'])) {
- view_template();
- exit();
- } elseif(isset($_REQUEST['view_email'])) {
- view_email();
- exit();
- } elseif(isset($_REQUEST['download_tar'])) {
- download_tar();
- exit();
- } elseif(isset($_REQUEST['preview'])) {
- preview();
- exit();
- } elseif(isset($_REQUEST['edit'])) {
- tem_set('fields', $_REQUEST['fields']);
- tem_set('form_name', $GLOBALS['form_name']);
- # fall through
- } else {
- die("Sorry... couldn't tell which button you pressed");
+
+function metaform() {
+ if(isset($_REQUEST['singular'])) {
+ $GLOBALS['file_name'] = format_varname($_REQUEST['file_name']);
+ $GLOBALS['table_name'] = format_varname($_REQUEST['table_name']);
+ $GLOBALS['plural'] = format_varname($_REQUEST['plural']);
+ # backwards compatibility:
+ if(isset($_REQUEST['form_name'])) {
+ $GLOBALS['file_name'] = $GLOBALS['table_name'] = $GLOBALS['plural'] = format_varname($_REQUEST['form_name']);
+ }
+ tem_set('file_name', $GLOBALS['file_name']);
+ tem_set('table_name', $GLOBALS['table_name']);
+ tem_set('plural', $GLOBALS['plural']);
+
+ $GLOBALS['singular'] = format_varname($_REQUEST['singular']);
+ tem_set('singular', $GLOBALS['singular']);
+ $GLOBALS['opt_email'] = format_yesno($_REQUEST['opt_email']);
+ tem_set('opt_email', $GLOBALS['opt_email']);
+ $GLOBALS['opt_db'] = format_yesno($_REQUEST['opt_db']);
+ tem_set('opt_db', $GLOBALS['opt_db']);
+ $GLOBALS['opt_listing'] = format_yesno($_REQUEST['opt_listing']);
+ tem_set('opt_listing', $GLOBALS['opt_listing']);
+ $GLOBALS['opt_display'] = format_yesno($_REQUEST['opt_display']);
+ tem_set('opt_display', $GLOBALS['opt_display']);
+ $GLOBALS['opt_http_pass'] = format_yesno($_REQUEST['opt_http_pass']);
+ tem_set('opt_http_pass', $GLOBALS['opt_http_pass']);