JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
metaform: added pretty-printing for checkboxes and dates to listing
authorJason Woofenden <jason283@herkamire.com>
Fri, 13 Feb 2009 04:00:33 +0000 (23:00 -0500)
committerJason Woofenden <jason283@herkamire.com>
Fri, 13 Feb 2009 04:00:33 +0000 (23:00 -0500)
metaform.php
metaform/template.html

index 06bb7dd..ecde564 100644 (file)
@@ -259,6 +259,11 @@ function make_html($whole_file = true) {
                                $tem->show('opt_display_a_else');
                        }
                        if(show_in_listing($type, $input, $format, $sql)) {
+                               if($format == 'bool' || $format == 'yesno') {
+                                       $tem->set('listing_enc', 'yesno');
+                               } elseif($input == 'date') {
+                                       $tem->set('listing_enc', 'mmddyyyy');
+                               }
                                $tem->show('listing_head_col');
                                $tem->show('listing_row_col');
                        }
index dbb1d8d..8f0890c 100644 (file)
@@ -87,7 +87,7 @@
   <table cellspacing="0" cellpadding="4" border="1" summary="">
     <!--~listing_head_col start~--><th>~caption~</th><!--~end~--><th></th><!--~~listing_row start~~-->
     <tr><!--~listing_row_col start~-->
-      <td class="listing"><a href="~form_name~?~form_name~_<!--~opt_display_a_else start~-->edit_<!--~end~-->id=~~id~~">~~~name~.html~~</a></td><!--~end~-->
+      <td class="listing"><a href="~form_name~?~form_name~_<!--~opt_display_a_else start~-->edit_<!--~end~-->id=~~id~~">~~~name~.~listing_enc~~~</a></td><!--~end~-->
       <td><a href="~form_name~?~form_name~_delete_id=~~id~~" onclick="return confirm('Permanently delete?')">[delete this ~singular~]</a></td>
     </tr><!--~~end~~-->