Commits

Sascha Köhler committed 1b44e57

ENHANCEMENT Added method 'getFormFieldDefinition' that returns the definition of a form field or custom parameter.

Comments (0)

Files changed (1)

code/CustomHtmlForm.php

     }
 
     /**
+     * Returns the requested formField or customParameter if available.
+     *
+     * @param string $fieldName The name to search for
+     *
+     * @return mixed
+     * 
+     * @author Sascha Koehler <skoehler@pixeltricks.de>
+     * @since 18.11.2011
+     */
+    public function getFormFieldDefinition($fieldName) {
+        if (isset($this->customParameters[$fieldName])) {
+            return $this->customParameters[$fieldName];
+        }
+        
+        if (isset($this->formFields[$fieldName])) {
+            return $this->formFields[$fieldName];
+        }
+        
+        return false;
+    }
+
+    /**
      * creates a form field from the definition; sets standard values if they
      * are not defined
      *