@@ -4,6 +4,9 @@ |
||
| 4 | 4 | |
| 5 | 5 | trait HtmlLinkTrait { |
| 6 | 6 | |
| 7 | + /** |
|
| 8 | + * @param string $value |
|
| 9 | + */ |
|
| 7 | 10 | public function setHref($value) { |
| 8 | 11 | $this->setProperty("href", $value); |
| 9 | 12 | } |
@@ -84,6 +84,9 @@ discard block |
||
| 84 | 84 | return $this; |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | + /** |
|
| 88 | + * @param integer $index |
|
| 89 | + */ |
|
| 87 | 90 | public function removeItem($index){ |
| 88 | 91 | return array_splice($this->content, $index, 1); |
| 89 | 92 | } |
@@ -99,6 +102,9 @@ discard block |
||
| 99 | 102 | return $this->addItem($function($object)); |
| 100 | 103 | } |
| 101 | 104 | |
| 105 | + /** |
|
| 106 | + * @param \Closure $callBack |
|
| 107 | + */ |
|
| 102 | 108 | public function apply($callBack){ |
| 103 | 109 | foreach ($this->content as $item){ |
| 104 | 110 | $callBack($item); |
@@ -3,7 +3,17 @@ discard block |
||
| 3 | 3 | namespace Ajax\common\traits; |
| 4 | 4 | |
| 5 | 5 | trait JqueryActionsTrait { |
| 6 | + |
|
| 7 | + /** |
|
| 8 | + * @param string $element |
|
| 9 | + * @param string $js |
|
| 10 | + * @param string $event |
|
| 11 | + */ |
|
| 6 | 12 | public abstract function _add_event($element, $js, $event, $preventDefault=false, $stopPropagation=false,$immediatly=true); |
| 13 | + |
|
| 14 | + /** |
|
| 15 | + * @param string $element |
|
| 16 | + */ |
|
| 7 | 17 | public abstract function _prep_element($element); |
| 8 | 18 | public abstract function _prep_value($value); |
| 9 | 19 | |
@@ -384,7 +394,7 @@ discard block |
||
| 384 | 394 | |
| 385 | 395 | /** |
| 386 | 396 | * Ensures the speed parameter is valid for jQuery |
| 387 | - * @param string|int $speed |
|
| 397 | + * @param string $speed |
|
| 388 | 398 | * @return string |
| 389 | 399 | */ |
| 390 | 400 | private function _validate_speed($speed) { |
@@ -10,7 +10,17 @@ discard block |
||
| 10 | 10 | protected $ajaxLoader='<span></span><span></span><span></span><span></span><span></span>'; |
| 11 | 11 | |
| 12 | 12 | public abstract function _prep_value($value); |
| 13 | + |
|
| 14 | + /** |
|
| 15 | + * @param string $element |
|
| 16 | + * @param string $js |
|
| 17 | + * @param string $event |
|
| 18 | + */ |
|
| 13 | 19 | public abstract function _add_event($element, $js, $event, $preventDefault=false, $stopPropagation=false,$immediatly=true); |
| 20 | + |
|
| 21 | + /** |
|
| 22 | + * @param string $retour |
|
| 23 | + */ |
|
| 14 | 24 | protected function addLoading(&$retour, $responseElement) { |
| 15 | 25 | $loading_notifier='<div class="ajax-loader">'; |
| 16 | 26 | if ($this->ajaxLoader=='') { |
@@ -23,13 +33,23 @@ discard block |
||
| 23 | 33 | $retour.="\t\t$({$responseElement}).prepend('{$loading_notifier}');\n"; |
| 24 | 34 | } |
| 25 | 35 | |
| 36 | + /** |
|
| 37 | + * @param string $url |
|
| 38 | + */ |
|
| 26 | 39 | public function _get($url, $params="{}", $responseElement="", $jsCallback=NULL, $attr="id", $hasLoader=true,$immediatly=false) { |
| 27 | 40 | return $this->_ajax("get", $url,$params,$responseElement,$jsCallback,$attr,$hasLoader,$immediatly); |
| 28 | 41 | } |
| 42 | + |
|
| 43 | + /** |
|
| 44 | + * @param string $url |
|
| 45 | + */ |
|
| 29 | 46 | public function _post($url, $params="{}", $responseElement="", $jsCallback=NULL, $attr="id", $hasLoader=true,$immediatly=false) { |
| 30 | 47 | return $this->_ajax("post", $url,$params,$responseElement,$jsCallback,$attr,$hasLoader,$immediatly); |
| 31 | 48 | } |
| 32 | 49 | |
| 50 | + /** |
|
| 51 | + * @param string $method |
|
| 52 | + */ |
|
| 33 | 53 | protected function _ajax($method,$url, $params="{}", $responseElement="", $jsCallback=NULL, $attr="id", $hasLoader=true,$immediatly=false) { |
| 34 | 54 | if(JString::isNull($params)){$params="{}";} |
| 35 | 55 | $jsCallback=isset($jsCallback) ? $jsCallback : ""; |
@@ -46,6 +66,9 @@ discard block |
||
| 46 | 66 | return $retour; |
| 47 | 67 | } |
| 48 | 68 | |
| 69 | + /** |
|
| 70 | + * @param string $attr |
|
| 71 | + */ |
|
| 49 | 72 | protected function _getAjaxUrl($url,$attr){ |
| 50 | 73 | $url=$this->_correctAjaxUrl($url); |
| 51 | 74 | $retour="url='".$url."';\n"; |
@@ -177,6 +200,11 @@ discard block |
||
| 177 | 200 | return $this->_add_event($element, $this->_jsonArray($maskSelector,$url,$method, $params,$jsCallback, $attr, $context), $event, $preventDefault, $stopPropagation,$immediatly); |
| 178 | 201 | } |
| 179 | 202 | |
| 203 | + /** |
|
| 204 | + * @param string $url |
|
| 205 | + * @param string $form |
|
| 206 | + * @param string $responseElement |
|
| 207 | + */ |
|
| 180 | 208 | public function _postForm($url, $form, $responseElement, $validation=false, $jsCallback=NULL, $attr="id", $hasLoader=true,$immediatly=false) { |
| 181 | 209 | $jsCallback=isset($jsCallback) ? $jsCallback : ""; |
| 182 | 210 | $retour=$this->_getAjaxUrl($url, $attr); |
@@ -3,7 +3,16 @@ |
||
| 3 | 3 | namespace Ajax\common\traits; |
| 4 | 4 | |
| 5 | 5 | trait JqueryEventsTrait { |
| 6 | + |
|
| 7 | + /** |
|
| 8 | + * @param string $element |
|
| 9 | + */ |
|
| 6 | 10 | public abstract function _prep_element($element); |
| 11 | + |
|
| 12 | + /** |
|
| 13 | + * @param string $element |
|
| 14 | + * @param string $event |
|
| 15 | + */ |
|
| 7 | 16 | public abstract function _add_event($element, $js, $event, $preventDefault=false, $stopPropagation=false,$immediatly=true); |
| 8 | 17 | |
| 9 | 18 | /** |
@@ -429,7 +429,7 @@ |
||
| 429 | 429 | * |
| 430 | 430 | * @access public |
| 431 | 431 | * @param array an associative array of key/values |
| 432 | - * @return array |
|
| 432 | + * @return string |
|
| 433 | 433 | * |
| 434 | 434 | */ |
| 435 | 435 | function assoc_to_uri($array) { |
@@ -22,6 +22,11 @@ discard block |
||
| 22 | 22 | protected $_contentSeparator=""; |
| 23 | 23 | |
| 24 | 24 | |
| 25 | + /** |
|
| 26 | + * @param string $identifier |
|
| 27 | + * @param string $tagName |
|
| 28 | + * @param string $baseClass |
|
| 29 | + */ |
|
| 25 | 30 | public function __construct($identifier,$tagName,$baseClass){ |
| 26 | 31 | parent::__construct($identifier,$tagName,$baseClass); |
| 27 | 32 | $this->root=""; |
@@ -31,7 +36,7 @@ discard block |
||
| 31 | 36 | /** |
| 32 | 37 | * Associate an ajax get to the elements, displayed in $targetSelector |
| 33 | 38 | * @param string $targetSelector the target of the get |
| 34 | - * @return HtmlNavElement |
|
| 39 | + * @return HtmlSemNavElement |
|
| 35 | 40 | */ |
| 36 | 41 | public function autoGetOnClick($targetSelector){ |
| 37 | 42 | return $this->getOnClick($this->root, $targetSelector,array("attr"=>$this->attr)); |
@@ -63,7 +68,7 @@ discard block |
||
| 63 | 68 | /** |
| 64 | 69 | * Define the html attribute for each element url in ajax |
| 65 | 70 | * @param string $attr html attribute |
| 66 | - * @return HtmlNavElement |
|
| 71 | + * @return HtmlSemNavElement |
|
| 67 | 72 | */ |
| 68 | 73 | public function setAttr($attr) { |
| 69 | 74 | $this->attr = $attr; |
@@ -103,6 +108,9 @@ discard block |
||
| 103 | 108 | return $this; |
| 104 | 109 | } |
| 105 | 110 | |
| 111 | + /** |
|
| 112 | + * @param integer $index |
|
| 113 | + */ |
|
| 106 | 114 | protected function getContentDivider($index){ |
| 107 | 115 | if(\is_array($this->_contentSeparator)===true){ |
| 108 | 116 | return @$this->_contentSeparator[$index]; |
@@ -12,12 +12,24 @@ |
||
| 12 | 12 | protected $_states=[ ]; |
| 13 | 13 | protected $_baseClass; |
| 14 | 14 | |
| 15 | + /** |
|
| 16 | + * @param string $name |
|
| 17 | + */ |
|
| 15 | 18 | protected abstract function setPropertyCtrl($name, $value, $typeCtrl); |
| 16 | 19 | |
| 20 | + /** |
|
| 21 | + * @param string $name |
|
| 22 | + */ |
|
| 17 | 23 | protected abstract function addToPropertyCtrl($name, $value, $typeCtrl); |
| 18 | 24 | |
| 25 | + /** |
|
| 26 | + * @param string $name |
|
| 27 | + */ |
|
| 19 | 28 | protected abstract function addToPropertyCtrlCheck($name, $value, $typeCtrl); |
| 20 | 29 | |
| 30 | + /** |
|
| 31 | + * @param string $name |
|
| 32 | + */ |
|
| 21 | 33 | public abstract function addToProperty($name, $value, $separator=" "); |
| 22 | 34 | |
| 23 | 35 | public function addVariation($variation) { |
@@ -7,6 +7,10 @@ |
||
| 7 | 7 | trait IconTrait { |
| 8 | 8 | private $_hasIcon=false; |
| 9 | 9 | |
| 10 | + /** |
|
| 11 | + * @param string $name |
|
| 12 | + * @param string $value |
|
| 13 | + */ |
|
| 10 | 14 | protected abstract function addToPropertyCtrl($name, $value, $typeCtrl); |
| 11 | 15 | public abstract function addContent($content,$before=false); |
| 12 | 16 | |