JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
metaform lists types in alphabetical order
authorJason Woofenden <jason283@herkamire.com>
Wed, 10 Dec 2008 21:58:42 +0000 (16:58 -0500)
committerJason Woofenden <jason283@herkamire.com>
Wed, 10 Dec 2008 21:58:42 +0000 (16:58 -0500)
metaform.php
metaform/main.html

index 81ac452..b6456bd 100644 (file)
@@ -56,14 +56,12 @@ $GLOBALS['types'] = array(
 );
 
 function list_available_types() {
-       $types = '';
+       ksort($GLOBALS['types']);
        foreach($GLOBALS['types'] as $key => $value) {
-               if($types) {
-                       $types .= ', ';
-               }
-               $types .= $key;
+               tem_set('type', $key);
+               tem_show('types');
+               tem_show('types_sep');
        }
-       tem_set('available_types', $types);
 }
 
 
@@ -116,8 +114,9 @@ function metaform() {
 
 
        set_form_action();
+       tem_load('code/wfpl/metaform/main.html');
        list_available_types();
-       tem_output('code/wfpl/metaform/main.html');
+       tem_output();
 }
 
 
index d56e264..5e72e66 100644 (file)
@@ -27,7 +27,7 @@
 
     <p><input type="checkbox" name="opt_http_pass~opt_http_pass.checked~" value="Yes" /> Password protect this form (with HTTP authentication).</p>
 
-       <p>Below, specify the fields you'd like in your form, one field per line. After each field name, put at least one space, then the field type. The following field types are available: ~available_types.html~.</p>
+       <p>Below, specify the fields you'd like in your form, one field per line. After each field name, put at least one space, then the field type. The following field types are available: <!--~types start~--><!--~types_sep start~-->, <!--~end~-->~type.html~<!--~end~-->.</p>
        <p>Example:<br /><pre>
 name      textbox
 phone     phone