From: Jason Woofenden Date: Thu, 15 Jan 2009 02:50:19 +0000 (-0500) Subject: enc_hhmm leaves a blank blank. remove extra whitespace from metaform templates X-Git-Url: https://jasonwoof.com/gitweb/?p=wfpl.git;a=commitdiff_plain;h=456602c35b5550a0ab8cbaf4c74ca6d00a3be076 enc_hhmm leaves a blank blank. remove extra whitespace from metaform templates --- diff --git a/encode.php b/encode.php index 57e565c..6102a91 100644 --- a/encode.php +++ b/encode.php @@ -168,6 +168,9 @@ function enc_mmddyyyyhhmm($seconds) { # takes decimal # returns hh:mm function enc_hhmm($str) { + if(strlen($str) == 0) { + return ''; + } $hours = floor($str); $minutes = round(($str - $hours) * 60); $str = sprintf("%d:%02d", $hours, $minutes); diff --git a/metaform/template.html b/metaform/template.html index 5e0a45e..2be0fee 100644 --- a/metaform/template.html +++ b/metaform/template.html @@ -48,13 +48,13 @@

~singular.cap~ details

- +
~caption.html~: ~~~name~.html~~
- +
~caption.html~:
~~~name~~~
- +
~caption.html~:
~~~name~.htmlbrtab~~
- +

Edit

diff --git a/metaform/template.php b/metaform/template.php index 5ce7cfe..965f38c 100644 --- a/metaform/template.php +++ b/metaform/template.php @@ -135,9 +135,9 @@ function _~form_name~_main() { echo '401 Unauthorized'; exit; } - + pulldown('~name~', array('option 1', 'option 2', 'option 3')); - + $edit_id = format_int($_REQUEST['~form_name~_edit_id']); unset($_REQUEST['~form_name~_edit_id']); if($edit_id) { @@ -160,7 +160,7 @@ function _~form_name~_main() { ~form_name~_display_listing(); return; } - + tem_show('new_msg'); }