@@ -9,7 +9,17 @@ discard block |
||
| 9 | 9 | protected $ajaxLoader='<span></span><span></span><span></span><span></span><span></span>'; |
| 10 | 10 | |
| 11 | 11 | public abstract function _prep_value($value); |
| 12 | + |
|
| 13 | + /** |
|
| 14 | + * @param string $element |
|
| 15 | + * @param string $js |
|
| 16 | + * @param string $event |
|
| 17 | + */ |
|
| 12 | 18 | public abstract function _add_event($element, $js, $event, $preventDefault=false, $stopPropagation=false,$immediatly=true); |
| 19 | + |
|
| 20 | + /** |
|
| 21 | + * @param string $retour |
|
| 22 | + */ |
|
| 13 | 23 | protected function addLoading(&$retour, $responseElement) { |
| 14 | 24 | $loading_notifier='<div class="ajax-loader">'; |
| 15 | 25 | if ($this->ajaxLoader=='') { |
@@ -22,13 +32,23 @@ discard block |
||
| 22 | 32 | $retour.="\t\t$({$responseElement}).prepend('{$loading_notifier}');\n"; |
| 23 | 33 | } |
| 24 | 34 | |
| 35 | + /** |
|
| 36 | + * @param string $url |
|
| 37 | + */ |
|
| 25 | 38 | public function _get($url, $params="{}", $responseElement="", $jsCallback=NULL, $attr="id", $hasLoader=true,$immediatly=false) { |
| 26 | 39 | return $this->_ajax("get", $url,$params,$responseElement,$jsCallback,$attr,$hasLoader,$immediatly); |
| 27 | 40 | } |
| 41 | + |
|
| 42 | + /** |
|
| 43 | + * @param string $url |
|
| 44 | + */ |
|
| 28 | 45 | public function _post($url, $params="{}", $responseElement="", $jsCallback=NULL, $attr="id", $hasLoader=true,$immediatly=false) { |
| 29 | 46 | return $this->_ajax("post", $url,$params,$responseElement,$jsCallback,$attr,$hasLoader,$immediatly); |
| 30 | 47 | } |
| 31 | 48 | |
| 49 | + /** |
|
| 50 | + * @param string $method |
|
| 51 | + */ |
|
| 32 | 52 | protected function _ajax($method,$url, $params="{}", $responseElement="", $jsCallback=NULL, $attr="id", $hasLoader=true,$immediatly=false) { |
| 33 | 53 | if(JString::isNull($params)){$params="{}";} |
| 34 | 54 | $jsCallback=isset($jsCallback) ? $jsCallback : ""; |
@@ -45,6 +65,9 @@ discard block |
||
| 45 | 65 | return $retour; |
| 46 | 66 | } |
| 47 | 67 | |
| 68 | + /** |
|
| 69 | + * @param string $attr |
|
| 70 | + */ |
|
| 48 | 71 | protected function _getAjaxUrl($url,$attr){ |
| 49 | 72 | $url=$this->_correctAjaxUrl($url); |
| 50 | 73 | $retour="url='".$url."';\n"; |
@@ -176,6 +199,11 @@ discard block |
||
| 176 | 199 | return $this->_add_event($element, $this->_jsonArray($maskSelector,$url,$method, $params,$jsCallback, $attr, $context), $event, $preventDefault, $stopPropagation,$immediatly); |
| 177 | 200 | } |
| 178 | 201 | |
| 202 | + /** |
|
| 203 | + * @param string $url |
|
| 204 | + * @param string $form |
|
| 205 | + * @param string $responseElement |
|
| 206 | + */ |
|
| 179 | 207 | public function _postForm($url, $form, $responseElement, $validation=false, $jsCallback=NULL, $attr="id", $hasLoader=true,$immediatly=false) { |
| 180 | 208 | $jsCallback=isset($jsCallback) ? $jsCallback : ""; |
| 181 | 209 | $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 | /** |
@@ -22,6 +22,7 @@ discard block |
||
| 22 | 22 | /** |
| 23 | 23 | * |
| 24 | 24 | * @param string $identifier the id |
| 25 | + * @param string $cssStyle |
|
| 25 | 26 | */ |
| 26 | 27 | public function __construct($identifier, $value="", $items=array(), $cssStyle=null, $onClick=null) { |
| 27 | 28 | parent::__construct($identifier, "", $cssStyle, $onClick); |
@@ -45,7 +46,7 @@ discard block |
||
| 45 | 46 | /** |
| 46 | 47 | * define the button style |
| 47 | 48 | * avaible values : "btn-default","btn-primary","btn-success","btn-info","btn-warning","btn-danger" |
| 48 | - * @param string|int $cssStyle |
|
| 49 | + * @param string $cssStyle |
|
| 49 | 50 | * @return \Ajax\bootstrap\html\HtmlDropdown default : "btn-default" |
| 50 | 51 | */ |
| 51 | 52 | public function setStyle($cssStyle) { |
@@ -149,10 +150,16 @@ discard block |
||
| 149 | 150 | return $this->items [$index]; |
| 150 | 151 | } |
| 151 | 152 | |
| 153 | + /** |
|
| 154 | + * @param string $value |
|
| 155 | + */ |
|
| 152 | 156 | public function setBtnClass($value) { |
| 153 | 157 | $this->class=$value; |
| 154 | 158 | } |
| 155 | 159 | |
| 160 | + /** |
|
| 161 | + * @param string $value |
|
| 162 | + */ |
|
| 156 | 163 | public function setMClass($value) { |
| 157 | 164 | $this->mClass=$value; |
| 158 | 165 | } |
@@ -183,6 +190,7 @@ discard block |
||
| 183 | 190 | /** |
| 184 | 191 | * Sets the tagName's dropdown |
| 185 | 192 | * @see \Ajax\bootstrap\html\BaseHtml::setTagName() |
| 193 | + * @param string $tagName |
|
| 186 | 194 | */ |
| 187 | 195 | public function setTagName($tagName) { |
| 188 | 196 | if ($tagName=="button") |
@@ -194,6 +202,9 @@ discard block |
||
| 194 | 202 | return $this->compile(); |
| 195 | 203 | } |
| 196 | 204 | |
| 205 | + /** |
|
| 206 | + * @param string $btnCaption |
|
| 207 | + */ |
|
| 197 | 208 | public function setBtnCaption($btnCaption) { |
| 198 | 209 | $this->btnCaption=$btnCaption; |
| 199 | 210 | return $this; |
@@ -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]; |
@@ -21,6 +21,9 @@ discard block |
||
| 21 | 21 | protected $params=array("action"=>"nothing","on"=>"hover"); |
| 22 | 22 | protected $input; |
| 23 | 23 | |
| 24 | + /** |
|
| 25 | + * @param string $identifier |
|
| 26 | + */ |
|
| 24 | 27 | public function __construct($identifier, $value="", $items=array()) { |
| 25 | 28 | parent::__construct($identifier, "div"); |
| 26 | 29 | $this->_template=include dirname(__FILE__).'/../templates/tplDropdown.php'; |
@@ -47,7 +50,7 @@ discard block |
||
| 47 | 50 | /** |
| 48 | 51 | * Insert an item at a position |
| 49 | 52 | * @param mixed $item |
| 50 | - * @param number $position |
|
| 53 | + * @param integer $position |
|
| 51 | 54 | * @return \Ajax\semantic\html\content\HtmlDropdownItem|unknown |
| 52 | 55 | */ |
| 53 | 56 | public function insertItem($item,$position=0){ |
@@ -196,6 +199,9 @@ discard block |
||
| 196 | 199 | } |
| 197 | 200 | } |
| 198 | 201 | |
| 202 | + /** |
|
| 203 | + * @param string $action |
|
| 204 | + */ |
|
| 199 | 205 | public function setAction($action){ |
| 200 | 206 | $this->params["action"]=$action; |
| 201 | 207 | } |
@@ -16,6 +16,9 @@ |
||
| 16 | 16 | |
| 17 | 17 | trait BootstrapComponentsTrait { |
| 18 | 18 | |
| 19 | + /** |
|
| 20 | + * @param string|null $attachTo |
|
| 21 | + */ |
|
| 19 | 22 | public abstract function addComponent(SimpleComponent $component, $attachTo, $params); |
| 20 | 23 | /** |
| 21 | 24 | * |
@@ -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) { |
@@ -7,9 +7,16 @@ |
||
| 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 | |
| 17 | + /** |
|
| 18 | + * @param boolean $direction |
|
| 19 | + */ |
|
| 13 | 20 | public function addIcon($icon,$direction=Direction::LEFT){ |
| 14 | 21 | if($this->_hasIcon===false){ |
| 15 | 22 | $iconO=$icon; |
@@ -57,8 +57,7 @@ discard block |
||
| 57 | 57 | * Associate an ajax get to the breadcrumb elements, displayed in $targetSelector |
| 58 | 58 | * $attr member is used to build each element url |
| 59 | 59 | * @param string $targetSelector the target of the get |
| 60 | - * @param string $attr the html attribute used to build the elements url |
|
| 61 | - * @return HtmlBreadcrumbs |
|
| 60 | + * @return HtmlBreadcrumb |
|
| 62 | 61 | */ |
| 63 | 62 | public function autoGetOnClick($targetSelector){ |
| 64 | 63 | return $this->getOnClick($this->root, $targetSelector,array("attr"=>$this->attr)); |
@@ -83,7 +82,7 @@ discard block |
||
| 83 | 82 | /** |
| 84 | 83 | * Add new elements in breadcrumbs corresponding to request dispatcher : controllerName, actionName, parameters |
| 85 | 84 | * @param Dispatcher $dispatcher the request dispatcher |
| 86 | - * @return \Ajax\bootstrap\html\HtmlBreadcrumbs |
|
| 85 | + * @return HtmlBreadcrumb |
|
| 87 | 86 | */ |
| 88 | 87 | public function fromDispatcher($dispatcher,$startIndex=0){ |
| 89 | 88 | $this->startIndex=$startIndex; |
@@ -120,7 +119,7 @@ discard block |
||
| 120 | 119 | /** |
| 121 | 120 | * sets the function who generates the href elements. default : function($element){return $element->getContent()} |
| 122 | 121 | * @param function $_hrefFunction |
| 123 | - * @return \Ajax\bootstrap\html\HtmlBreadcrumbs |
|
| 122 | + * @return HtmlBreadcrumb |
|
| 124 | 123 | */ |
| 125 | 124 | public function setHrefFunction($_hrefFunction) { |
| 126 | 125 | $this->_hrefFunction = $_hrefFunction; |