@@ -13,7 +13,7 @@ discard block |
||
| 13 | 13 | |
| 14 | 14 | /** |
| 15 | 15 | * Ensures the speed parameter is valid for jQuery |
| 16 | - * @param string|int $speed |
|
| 16 | + * @param string $speed |
|
| 17 | 17 | * @return string |
| 18 | 18 | */ |
| 19 | 19 | private function _validate_speed($speed) { |
@@ -422,7 +422,7 @@ discard block |
||
| 422 | 422 | * |
| 423 | 423 | * @param string $element |
| 424 | 424 | * @param array $options |
| 425 | - * @return void |
|
| 425 | + * @return string |
|
| 426 | 426 | */ |
| 427 | 427 | public function sortable($element, $options=array()) { |
| 428 | 428 | if (count($options)>0) { |
@@ -493,7 +493,7 @@ discard block |
||
| 493 | 493 | * @param string $jqueryCall the JQuery callback |
| 494 | 494 | * @param mixed $param array or string parameters |
| 495 | 495 | * @param string $jsCallback javascript code to execute after the jquery call |
| 496 | - * @return mixed |
|
| 496 | + * @return string |
|
| 497 | 497 | */ |
| 498 | 498 | public function doJQuery($element, $jqueryCall, $param="", $jsCallback="") { |
| 499 | 499 | return $this->_doJQuery($element, $jqueryCall, $param, $jsCallback, true); |
@@ -505,7 +505,7 @@ discard block |
||
| 505 | 505 | * @param string $jqueryCall the JQuery callback |
| 506 | 506 | * @param mixed $param array or string parameters |
| 507 | 507 | * @param string $jsCallback javascript code to execute after the jquery call |
| 508 | - * @return mixed |
|
| 508 | + * @return string |
|
| 509 | 509 | */ |
| 510 | 510 | public function doJQueryDeferred($element, $jqueryCall, $param="", $jsCallback="") { |
| 511 | 511 | return $this->_doJQuery($element, $jqueryCall, $param, $jsCallback, false); |
@@ -517,7 +517,7 @@ discard block |
||
| 517 | 517 | * @param string $element |
| 518 | 518 | * @param string $elementToModify |
| 519 | 519 | * @param string $jqueryCall |
| 520 | - * @param string|array $param |
|
| 520 | + * @param string $param |
|
| 521 | 521 | * @param boolean $preventDefault |
| 522 | 522 | * @param boolean $stopPropagation |
| 523 | 523 | * @param string $jsCallback javascript code to execute after the jquery call |
@@ -16,8 +16,17 @@ discard block |
||
| 16 | 16 | protected $ajaxLoader='<span></span><span></span><span></span><span></span><span></span>'; |
| 17 | 17 | |
| 18 | 18 | abstract public function getUrl($url); |
| 19 | + |
|
| 20 | + /** |
|
| 21 | + * @param string $element |
|
| 22 | + * @param string $js |
|
| 23 | + * @param string $event |
|
| 24 | + */ |
|
| 19 | 25 | abstract public function _add_event($element, $js, $event, $preventDefault=false, $stopPropagation=false,$immediatly=true); |
| 20 | 26 | |
| 27 | + /** |
|
| 28 | + * @param string $method |
|
| 29 | + */ |
|
| 21 | 30 | protected function _ajax($method,$url, $params="{}", $responseElement="", $jsCallback=NULL, $attr="id", $hasLoader=true,$jqueryDone="html",$ajaxTransition=null,$immediatly=false) { |
| 22 | 31 | if(JString::isNull($params)){$params="{}";} |
| 23 | 32 | $jsCallback=isset($jsCallback) ? $jsCallback : ""; |
@@ -36,6 +45,9 @@ discard block |
||
| 36 | 45 | |
| 37 | 46 | |
| 38 | 47 | |
| 48 | + /** |
|
| 49 | + * @param string $attr |
|
| 50 | + */ |
|
| 39 | 51 | protected function _getAjaxUrl($url,$attr){ |
| 40 | 52 | $url=$this->_correctAjaxUrl($url); |
| 41 | 53 | $retour="url='".$url."';"; |
@@ -53,6 +65,9 @@ discard block |
||
| 53 | 65 | return $retour; |
| 54 | 66 | } |
| 55 | 67 | |
| 68 | + /** |
|
| 69 | + * @param string $jqueryDone |
|
| 70 | + */ |
|
| 56 | 71 | protected function _getOnAjaxDone($responseElement,$jqueryDone,$ajaxTransition,$jsCallback){ |
| 57 | 72 | $retour="";$call=null; |
| 58 | 73 | if ($responseElement!=="") { |
@@ -86,6 +101,9 @@ discard block |
||
| 86 | 101 | return $url; |
| 87 | 102 | } |
| 88 | 103 | |
| 104 | + /** |
|
| 105 | + * @param string $retour |
|
| 106 | + */ |
|
| 89 | 107 | protected function addLoading(&$retour, $responseElement) { |
| 90 | 108 | $loading_notifier='<div class="ajax-loader">'; |
| 91 | 109 | if ($this->ajaxLoader=='') { |
@@ -252,6 +270,7 @@ discard block |
||
| 252 | 270 | * @param string $rowClass the css class for the new element |
| 253 | 271 | * @param string $context jquery DOM element, array container. |
| 254 | 272 | * @param boolean $immediatly |
| 273 | + * @param string $maskSelector |
|
| 255 | 274 | */ |
| 256 | 275 | public function jsonArray($maskSelector, $url, $method="get", $params="{}", $jsCallback=NULL,$rowClass="_json",$context=NULL,$immediatly=false) { |
| 257 | 276 | return $this->_jsonArray($maskSelector, $url,$method,$params,$jsCallback,$rowClass,$context,NULL,$immediatly); |
@@ -342,6 +361,11 @@ discard block |
||
| 342 | 361 | return $this->getOn("click", $element, $url, $responseElement, $parameters); |
| 343 | 362 | } |
| 344 | 363 | |
| 364 | + /** |
|
| 365 | + * @param string $url |
|
| 366 | + * @param string $jsCallback |
|
| 367 | + * @param callable $ajaxTransition |
|
| 368 | + */ |
|
| 345 | 369 | private function _post($url, $params="{}", $responseElement="", $jsCallback=NULL, $attr="id", $hasLoader=true,$jqueryDone="html",$ajaxTransition=null,$immediatly=false) { |
| 346 | 370 | return $this->_ajax("post", $url,$params,$responseElement,$jsCallback,$attr,$hasLoader,$jqueryDone,$ajaxTransition,$immediatly); |
| 347 | 371 | } |
@@ -412,6 +436,13 @@ discard block |
||
| 412 | 436 | return $this->postOn("click", $element, $url, $params, $responseElement, $parameters); |
| 413 | 437 | } |
| 414 | 438 | |
| 439 | + /** |
|
| 440 | + * @param string $url |
|
| 441 | + * @param string $form |
|
| 442 | + * @param string $responseElement |
|
| 443 | + * @param string $jsCallback |
|
| 444 | + * @param callable $ajaxTransition |
|
| 445 | + */ |
|
| 415 | 446 | private function _postForm($url, $form, $responseElement, $validation=false, $jsCallback=NULL, $attr="id", $hasLoader=true,$jqueryDone="html",$ajaxTransition=null,$immediatly=false) { |
| 416 | 447 | $jsCallback=isset($jsCallback) ? $jsCallback : ""; |
| 417 | 448 | $retour=$this->_getAjaxUrl($url, $attr); |