LSform : Move JSconfig from LSldapObject :: getForm() to LSform :: display()
authorBenjamin Renard <brenard@easter-eggs.com>
Wed, 17 Nov 2010 13:44:52 +0000 (14:44 +0100)
committerBenjamin Renard <brenard@easter-eggs.com>
Wed, 17 Nov 2010 13:44:52 +0000 (14:44 +0100)
public_html/includes/class/class.LSform.php
public_html/includes/class/class.LSldapObject.php

index a7edcc6..68a2bcc 100644 (file)
@@ -130,6 +130,13 @@ class LSform {
     $GLOBALS['Smarty'] -> assign('LSform_header',$LSform_header);
     
     $GLOBALS['Smarty'] -> assign('LSform_fields',$fields);
+
+    $JSconfig = array (
+      'ajaxSubmit' => ((isset($this -> config['LSform']['ajaxSubmit']))?$this -> config['LSform']['ajaxSubmit']:1)
+    );
+
+    LSsession :: addJSconfigParam('LSform_'.$this -> idForm,$JSconfig);
+
     if($this -> can_validate) {
       $GLOBALS['Smarty'] -> assign('LSform_submittxt',$this -> submit);
     }
index 1823081..091ac67 100644 (file)
@@ -213,9 +213,6 @@ class LSldapObject {
         }
       }      
     }
-    LSsession :: addJSconfigParam('LSform_'.$idForm,array(
-      'ajaxSubmit' => ((isset($this -> config['LSform']['ajaxSubmit']))?$this -> config['LSform']['ajaxSubmit']:1)
-    ));
     return $LSform;
   }