]> wagnertech.de Git - timetracker.git/blobdiff - WEB-INF/lib/form/Form.class.php
A bit more refactoring in forms to make them leaner.
[timetracker.git] / WEB-INF / lib / form / Form.class.php
index b357fe5ea4de72c3813e6fd669a3ebf96cd8ff63..b37903cdd41c60a0ac7e589a6745b719c782b8ad 100644 (file)
 class Form {
 
   var $name = '';
-  // TODO: refactoring ongoing down from here.
+  var $elements = array();
 
-       var $elements = array();
-       var $mRequest;
-    
-    function __construct($formName) {
-        $this->name = $formName;
-    }
-    
-    function setRequest(&$request) {
-        $this->mRequest = &$request;
-    }
+  function __construct($formName) {
+    $this->name = $formName;
+  }
+
+  // TODO: refactoring ongoing down from here.
 
     function &getElement($name) {
        return $this->elements[$name];
@@ -65,22 +60,7 @@ class Form {
        // onsubmit
        // onreset
     function getName() { return $this->name; }
-    
-    function isSubmit()        {
-       if (!isset($this->mRequest)) return false;
-        $result = false;
-           foreach ($this->elements as $el) {
-               if (strtolower(get_class($el))=="submit") {
-                   $name = $el->getName();
-                   $value = $this->mRequest->getAttribute($name);
-                   if($value) {
-                      $result = true; 
-                   }
-               }
-           }
-        return $result;
-    }
-       
+
        //// INPUT element
        // type = TEXT | PASSWORD | CHECKBOX | RADIO | SUBMIT | RESET | FILE | HIDDEN | IMAGE | BUTTON
        // name