JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
metaform codegen: use tem_auto_unset()
authorJason Woofenden <jason@jasonwoof.com>
Mon, 25 Oct 2010 05:30:26 +0000 (01:30 -0400)
committerJason Woofenden <jason@jasonwoof.com>
Mon, 25 Oct 2010 05:47:53 +0000 (01:47 -0400)
metaform.php
metaform/template.html

index d134f92..fdd1ad3 100644 (file)
@@ -83,12 +83,9 @@ function tem_set_globals(&$tem) {
                'opt_pass');
        foreach($bools as $bool) {
                if(format_bool($GLOBALS[$bool])) {
-                       $tem->set($bool, 1);
-               } else {
-                       $tem->set($bool . '_else', 1);
+                       $tem->set($bool);
                }
        }
-
 }
 
 function metaform() {
index 58629d8..0e04ef9 100644 (file)
@@ -74,7 +74,7 @@
        <!--~~}~~--><!--~}~-->
 
        <!--~~form {~~--><!--~form {~-->
-               <h2><!--~opt_db {~--><!--~~new_msg {~~-->Add a new ~singular~<!--~~}~~--><!--~~edit_msg {~~-->Edit ~singular~ "~~~always_field~ html~~"<!--~~}~~--><!--~}~--><!--~opt_db_else {~-->Submit a ~singular~<!--~}~--></h2>
+               <h2><!--~opt_db {~--><!--~~new_msg {~~-->Add a new ~singular~<!--~~}~~--><!--~~edit_msg {~~-->Edit ~singular~ "~~~always_field~ html~~"<!--~~}~~--><!--~}~--><!--~opt_db unset {~-->Submit a ~singular~<!--~}~--></h2>
 
                <form action="~file_name~" method="post~enctype_attr~"><!--~opt_db {~--><!--~~editing {~~--><div style="display: none"><input type="hidden" name="~file_name~_edit_id" value="~~~file_name~_edit_id attr~~"></div><!--~~}~~--><!--~}~--><!--~uploads {~--><input type="hidden" name="MAX_FILE_SIZE" value="~~upload_max_filesize~~"><!--~}~-->
 <!--~row {~--><!--~image {~-->
                        <table cellspacing="0" cellpadding="4" border="1" summary="">
                                <!--~listing_head_col {~--><th>~caption~</th><!--~}~--><th>&nbsp;</th><!--~~rows {~~-->
                                <tr><!--~listing_row_col {~-->
-                                       <td class="listing"><a href="~file_name~?~file_name~_<!--~opt_display_else {~-->edit_<!--~}~-->id=~~id~~"><!--~listing_value_enc {~-->~~~name~ ~listing_enc~~~<!--~}~--><!--~listing_value_thumb {~--><img src="~~~name~ thumb_src~~" width="~~~name~ thumb_width~~" height="~~~name~ thumb_height~~" alt=""><!--~}~--></a></td><!--~}~-->
+                                       <td class="listing"><a href="~file_name~?~file_name~_<!--~opt_display unset {~-->edit_<!--~}~-->id=~~id~~"><!--~listing_value_enc {~-->~~~name~ ~listing_enc~~~<!--~}~--><!--~listing_value_thumb {~--><img src="~~~name~ thumb_src~~" width="~~~name~ thumb_width~~" height="~~~name~ thumb_height~~" alt=""><!--~}~--></a></td><!--~}~-->
                                        <td><a href="~file_name~?~file_name~_delete_id=~~id~~" onclick="return confirm('Permanently delete?')">[delete this ~singular~]</a></td>
                                </tr><!--~~}~~-->