X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=metaform%2Ftemplate.php;h=4858e4dd8393394901f9771435d9c54674f57b33;hb=09617312a7eff11be39355b053237565c7ad614d;hp=672993031a06c5d3bff21658f0ccca062c7f8cef;hpb=a1011831f5cf76e4cb8b1c0b5c5332cd82ca2d7b;p=wfpl.git diff --git a/metaform/template.php b/metaform/template.php index 6729930..4858e4d 100644 --- a/metaform/template.php +++ b/metaform/template.php @@ -76,13 +76,21 @@ function ~form_name~_display_listing($where = 'order by ~always_field~ limit 100 $~always_field~ = '--'; } tem_set('~always_field~', $~always_field~); - tem_sub('listing_row'); + tem_show('listing_row'); } - tem_sub('listings'); + tem_show('listings'); return true; } -function ~form_name~_main() { +function ~form_name~_main() { + $ret = _~form_name~_main(); + if($ret) { + return $ret; + } + display_messages(); +} + +function _~form_name~_main() { # To remove password protection, just delete this block: if (!isset($_SERVER['PHP_AUTH_USER']) || $_SERVER['PHP_AUTH_USER'] != AUTH_USER || $_SERVER['PHP_AUTH_PW'] != AUTH_PASS) { header('WWW-Authenticate: Basic realm="' . AUTH_REALM . '"'); @@ -98,7 +106,7 @@ function ~form_name~_main() { if($edit_id) { # add hidden field for database id of row we're editing tem_set('~form_name~_edit_id', $edit_id); - tem_sub('editing'); + tem_show('editing'); } $delete_id = format_int($_REQUEST['~form_name~_delete_id']); @@ -123,7 +131,7 @@ function ~form_name~_main() { } } - tem_sub('new_msg'); + tem_show('new_msg'); } if(isset($_REQUEST['~always_field~'])) { @@ -158,7 +166,7 @@ function ~form_name~_main() { } if($error !== true) { ~form_name~_display_listing(); - tem_sub('thankyou'); + tem_show('thankyou'); return; } } @@ -179,10 +187,10 @@ function ~form_name~_main() { # this has to be later in the file because it requres that ~always_field~ be set already if($edit_id) { - tem_sub('edit_msg'); + tem_show('edit_msg'); } - tem_sub('form'); + tem_show('form'); } ?>