Index: DB/Table/QuickForm.php
===================================================================
RCS file: /repository/pear/DB_Table/DB/Table/QuickForm.php,v
retrieving revision 1.12
diff -u -r1.12 QuickForm.php
--- DB/Table/QuickForm.php	27 Oct 2004 21:17:25 -0000	1.12
+++ DB/Table/QuickForm.php	8 Aug 2005 22:10:43 -0000
@@ -88,6 +88,7 @@
         $form =& DB_Table_QuickForm::createForm($args);
         DB_Table_QuickForm::addElements($form, $cols, $arrayName);
         DB_Table_QuickForm::addRules($form, $cols, $arrayName, $clientValidate);
+        DB_Table_QuickForm::addFilters($form, $cols, $arrayName);
         
         return $form;
     }
@@ -203,6 +204,44 @@
         }
     }
     
+    /**
+    *
+    * Adds DB_Table filters to a pre-existing HTML_QuickForm object.
+    *
+    * @static
+    *
+    * @access public
+    *
+    * @param object &$form An HTML_QuickForm object.
+    *
+    * @param array $cols A sequential array of DB_Table column definitions
+    * from which to create form elements.
+    *
+    * @param string $arrayName By default, the form will use the names
+    * of the columns as the names of the form elements.  If you pass
+    * $arrayName, the column names will become keys in an array named
+    * for this parameter.
+    *
+    * @return void
+    *
+    */
+    function addFilters(&$form, $cols, $arrayName = null)
+    {
+        foreach ($cols as $name => $col) {
+            if ($arrayName) {
+                $elemname = $arrayName . "[$name]";
+            } else {
+                $elemname = $name;
+            }
+
+            DB_Table_QuickForm::fixColDef($col, $elemname);
+
+            foreach (array_keys($col['qf_filters']) as $fk) {
+                $form->applyFilter($elemname, $col['qf_filters'][$fk]);
+            }
+        }
+    }
+    
     
     /**
     * 
@@ -613,6 +652,10 @@
         if (! isset($col['qf_client'])) {
             $col['qf_client'] = false;
         }
+
+        if (! isset($col['qf_filters'])) {
+            $col['qf_filters'] = array();
+        }
         
         // the element type; if not set,
         // assigns an element type based on the column type.
