LSform :: dataEntryForm : Added requiredAllAttributes parameter
authorBenjamin Renard <brenard@easter-eggs.com>
Mon, 29 Nov 2010 11:36:35 +0000 (12:36 +0100)
committerBenjamin Renard <brenard@easter-eggs.com>
Mon, 29 Nov 2010 11:36:35 +0000 (12:36 +0100)
public_html/includes/class/class.LSform.php

index 414882f..1651c98 100644 (file)
@@ -140,7 +140,7 @@ class LSform {
           continue;
         }
         $element = $this -> elements[$elementName];
-        if (isset($this -> dataEntryFormConfig['requiredAttributes']) && is_array($this -> dataEntryFormConfig['requiredAttributes']) && in_array($elementName,$this -> dataEntryFormConfig['requiredAttributes'])) {
+        if ((isset($this -> dataEntryFormConfig['requiredAllAttributes']) && $this -> dataEntryFormConfig['requiredAllAttributes']) || isset($this -> dataEntryFormConfig['requiredAttributes']) && is_array($this -> dataEntryFormConfig['requiredAttributes']) && in_array($elementName,$this -> dataEntryFormConfig['requiredAttributes'])) {
             $element -> setRequired();
         }
         $field = array();
@@ -435,7 +435,7 @@ class LSform {
           continue;
         }
         $element = $this -> elements[$elementName];
-        if (isset($this -> dataEntryFormConfig['requiredAttributes']) && is_array($this -> dataEntryFormConfig['requiredAttributes']) && in_array($elementName,$this -> dataEntryFormConfig['requiredAttributes'])) {
+        if ((isset($this -> dataEntryFormConfig['requiredAllAttributes']) && $this -> dataEntryFormConfig['requiredAllAttributes']) || isset($this -> dataEntryFormConfig['requiredAttributes']) && is_array($this -> dataEntryFormConfig['requiredAttributes']) && in_array($elementName,$this -> dataEntryFormConfig['requiredAttributes'])) {
             $element -> setRequired();
         }
         if( !($element -> getPostData($this -> _postData)) ) {