JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
metaform: default listing page now contains all non-huge failds
[wfpl.git] / metaform.php
index f89e720..06bb7dd 100644 (file)
@@ -222,6 +222,7 @@ function make_html($whole_file = true) {
                if($input != 'hidden') {
                        $tem->show('row');
                }
+
                if($input == 'image' && !$uploads_output_already) {
                        $tem->show('uploads');
                        $tem->set('enctype_attr', '" enctype="multipart/form-data');
@@ -231,7 +232,8 @@ function make_html($whole_file = true) {
                        $tem->set('html_field_name', $name);
                        $tem->show('replace_textarea');
                }
-               if($GLOBALS['opt_display']) {
+
+               if($GLOBALS['opt_display'] == 'Yes') {
                        switch($input) {
                                case 'checkbox':
                                case 'leftcheck':
@@ -251,6 +253,16 @@ function make_html($whole_file = true) {
                        }
                        $tem->show('display_row');
                }
+
+               if($GLOBALS['opt_listing'] == 'Yes') {
+                       if($GLOBALS['opt_display'] != 'Yes') {
+                               $tem->show('opt_display_a_else');
+                       }
+                       if(show_in_listing($type, $input, $format, $sql)) {
+                               $tem->show('listing_head_col');
+                               $tem->show('listing_row_col');
+                       }
+               }
        }
 
        if($GLOBALS['opt_db'] == 'Yes') {
@@ -261,9 +273,6 @@ function make_html($whole_file = true) {
        }
 
        if($GLOBALS['opt_listing'] == 'Yes') {
-               if($GLOBALS['opt_display'] != 'Yes') {
-                       $tem->show('opt_display_a_else');
-               }
                $tem->show('opt_listing_1');
        }
 
@@ -300,6 +309,19 @@ function view_html() {
        echo make_html();
 }
 
+function show_in_listing($type, $input, $format, $sql) {
+       switch($input) {
+               case 'submit':
+               case 'hidden':
+               case 'password':
+               case 'textarea':
+               case 'html':
+                       return false;
+               default:
+                       return true;
+       }
+}
+
 
 function make_php() {
        $tem = new tem();
@@ -341,6 +363,13 @@ function make_php() {
                        }
                        $tem->show('tem_sets');
                }
+
+               if($GLOBALS['opt_listing'] == 'Yes') {
+                       if(show_in_listing($type, $input, $format, $sql)) {
+                               $tem->show('listing_fields_1');
+                               $tem->show('listing_fields_2');
+                       }
+               }
        }
 
        $tem->set('always_field', $always_field);