@@ -412,10 +412,13 @@ public function postOnClick($element, $url, $params="{}", $responseElement="", $
412412 return $ this ->postOn ("click " , $ element , $ url , $ params , $ responseElement , $ parameters );
413413 }
414414
415- private function _postForm ($ url , $ form , $ responseElement , $ validation =false , $ jsCallback =NULL , $ attr ="id " , $ hasLoader =true ,$ jqueryDone ="html " ,$ ajaxTransition =null ,$ immediatly =false ) {
415+ private function _postForm ($ url , $ form , $ responseElement , $ params = null , $ validation =false , $ jsCallback =NULL , $ attr ="id " , $ hasLoader =true ,$ jqueryDone ="html " ,$ ajaxTransition =null ,$ immediatly =false ) {
416416 $ jsCallback =isset ($ jsCallback ) ? $ jsCallback : "" ;
417417 $ retour =$ this ->_getAjaxUrl ($ url , $ attr );
418418 $ retour .="\nvar params=$('# " .$ form ."').serialize(); \n" ;
419+ if (isset ($ params )){
420+ $ retour .="params+='&'+$.param( " .$ params ."); \n" ;
421+ }
419422 $ responseElement =$ this ->_getResponseElement ($ responseElement );
420423 $ retour .="var self=this; \n" ;
421424 if ($ hasLoader ===true ){
@@ -440,13 +443,14 @@ private function _postForm($url, $form, $responseElement, $validation=false, $js
440443 * @param string $url The url of the request
441444 * @param string $form The form HTML id
442445 * @param string $responseElement selector of the HTML element displaying the answer
446+ * @param string $params
443447 * @param string $jsCallback javascript code to execute after the request
444448 * @param boolean $hasLoader true for showing ajax loader. default : true
445449 * @param string $jqueryDone the jquery function call on ajax data. default:html
446450 * @param string|callable $ajaxTransition
447451 */
448- public function postForm ($ url , $ form , $ responseElement , $ validation =false , $ jsCallback =NULL ,$ hasLoader =true ,$ jqueryDone ="html " ,$ ajaxTransition =null ) {
449- return $ this ->_postForm ($ url , $ form , $ responseElement , $ validation , $ jsCallback , NULL , $ hasLoader ,$ jqueryDone ,$ ajaxTransition ,true );
452+ public function postForm ($ url , $ form , $ responseElement , $ params = NULL , $ validation =false , $ jsCallback =NULL ,$ hasLoader =true ,$ jqueryDone ="html " ,$ ajaxTransition =null ) {
453+ return $ this ->_postForm ($ url , $ form , $ responseElement , $ params , $ validation , $ jsCallback , NULL , $ hasLoader ,$ jqueryDone ,$ ajaxTransition ,true );
450454 }
451455
452456 /**
@@ -455,14 +459,16 @@ public function postForm($url, $form, $responseElement, $validation=false, $jsCa
455459 * @param string $url The url of the request
456460 * @param string $form The form HTML id
457461 * @param string $responseElement selector of the HTML element displaying the answer
462+ * @param string $params
463+ * @param boolean $validation
458464 * @param string $jsCallback javascript code to execute after the request
459465 * @param string $attr the html attribute added to the request
460466 * @param boolean $hasLoader true for showing ajax loader. default : true
461467 * @param string $jqueryDone the jquery function call on ajax data. default:html
462468 * @param string|callable $ajaxTransition
463469 */
464- public function postFormDeferred ($ url , $ form , $ responseElement , $ validation =false , $ jsCallback =NULL ,$ attr ="id " ,$ hasLoader =true ,$ jqueryDone ="html " ,$ ajaxTransition =null ) {
465- return $ this ->_postForm ($ url , $ form , $ responseElement , $ validation , $ jsCallback , $ attr , $ hasLoader ,$ jqueryDone ,$ ajaxTransition ,false );
470+ public function postFormDeferred ($ url , $ form , $ responseElement , $ params = NULL , $ validation =false , $ jsCallback =NULL ,$ attr ="id " ,$ hasLoader =true ,$ jqueryDone ="html " ,$ ajaxTransition =null ) {
471+ return $ this ->_postForm ($ url , $ form , $ responseElement , $ params , $ validation , $ jsCallback , $ attr , $ hasLoader ,$ jqueryDone ,$ ajaxTransition ,false );
466472 }
467473
468474 /**
@@ -480,13 +486,14 @@ public function postFormOn($event, $element, $url, $form, $responseElement="", $
480486 $ stopPropagation =true ;
481487 $ validation =false ;
482488 $ jsCallback =null ;
489+ $ params =null ;
483490 $ attr ="id " ;
484491 $ hasLoader =true ;
485492 $ immediatly =true ;
486493 $ jqueryDone ="html " ;
487494 $ ajaxTransition =null ;
488495 extract ($ parameters );
489- return $ this ->_add_event ($ element , $ this ->_postForm ($ url , $ form , $ responseElement , $ validation , $ jsCallback , $ attr ,$ hasLoader ,$ jqueryDone ,$ ajaxTransition ), $ event , $ preventDefault , $ stopPropagation ,$ immediatly );
496+ return $ this ->_add_event ($ element , $ this ->_postForm ($ url , $ form , $ responseElement ,$ params , $ validation , $ jsCallback , $ attr ,$ hasLoader ,$ jqueryDone ,$ ajaxTransition ), $ event , $ preventDefault , $ stopPropagation ,$ immediatly );
490497 }
491498
492499 /**
0 commit comments