+ if(isset($_REQUEST['fields'])) {
+ if(isset($_REQUEST['view_sql'])) {
+ view_sql();
+ exit();
+ } elseif(isset($_REQUEST['view_php'])) {
+ view_php();
+ exit();
+ } elseif(isset($_REQUEST['view_html'])) {
+ view_html();
+ 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");
+ }
+ }
+
+
+ set_form_action();
+ list_available_types();
+ tem_output('code/wfpl/metaform/main.html');
+}