- if(isset($_REQUEST['form_name'])) {
- $GLOBALS['form_name'] = format_varname($_REQUEST['form_name']);
- $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']);
- } else {
- $GLOBALS['form_name'] = 'some_form';
+ if(isset($_REQUEST['singular'])) {
+ $GLOBALS['file_name'] = format_varname($_REQUEST['file_name']);
+ $GLOBALS['table_name'] = format_varname($_REQUEST['table_name']);
+ $GLOBALS['plural'] = format_oneline($_REQUEST['plural']);
+ # backwards compatibility:
+ if(isset($_REQUEST['form_name'])) {
+ $GLOBALS['file_name'] = $GLOBALS['table_name'] = $GLOBALS['plural'] = format_varname($_REQUEST['form_name']);
+ }
+
+ $GLOBALS['singular'] = format_oneline($_REQUEST['singular']);
+ $GLOBALS['opt_email'] = format_bool($_REQUEST['opt_email']);
+ $GLOBALS['opt_db'] = format_bool($_REQUEST['opt_db']);
+ $GLOBALS['opt_listing'] = format_bool($_REQUEST['opt_listing']);
+ $GLOBALS['opt_display'] = format_bool($_REQUEST['opt_display']);
+ $GLOBALS['opt_pass'] = format_bool($_REQUEST['opt_pass']);
+ $GLOBALS['opt_public_form'] = format_bool($_REQUEST['opt_public_form']);
+ $GLOBALS['opt_public_display'] = format_bool($_REQUEST['opt_public_display']);
+
+ $GLOBALS['public_file_name'] = $GLOBALS['file_name'];
+ if($GLOBALS['opt_public_form'] || $GLOBALS['opt_public_display']) {
+ $GLOBALS['opt_public_something'] = 1;
+ $GLOBALS['file_name'] = $GLOBALS['file_name'] . _admin;
+ }
+
+ tem_init();
+ tem_set_globals($GLOBALS['wfpl_template']);