@@ -19,6 +19,9 @@ discard block |
||
| 19 | 19 | protected $style=""; |
| 20 | 20 | protected $styleLimits=null; |
| 21 | 21 | |
| 22 | + /** |
|
| 23 | + * @param string $identifier |
|
| 24 | + */ |
|
| 22 | 25 | public function __construct($identifier, $style="info", $value=0, $max=100, $min=0) { |
| 23 | 26 | parent::__construct($identifier); |
| 24 | 27 | $this->_template=include 'templates/tplProgressbar.php'; |
@@ -28,6 +31,9 @@ discard block |
||
| 28 | 31 | $this->setStyle($style); |
| 29 | 32 | } |
| 30 | 33 | |
| 34 | + /** |
|
| 35 | + * @param boolean $value |
|
| 36 | + */ |
|
| 31 | 37 | public function setActive($value) { |
| 32 | 38 | if(is_array($this->content)){ |
| 33 | 39 | foreach ($this->content as $pb){ |
@@ -42,6 +48,9 @@ discard block |
||
| 42 | 48 | return $this; |
| 43 | 49 | } |
| 44 | 50 | |
| 51 | + /** |
|
| 52 | + * @param boolean $value |
|
| 53 | + */ |
|
| 45 | 54 | public function setStriped($value) { |
| 46 | 55 | if(is_array($this->content)){ |
| 47 | 56 | foreach ($this->content as $pb){ |
@@ -56,6 +65,9 @@ discard block |
||
| 56 | 65 | return $this; |
| 57 | 66 | } |
| 58 | 67 | |
| 68 | + /** |
|
| 69 | + * @param boolean $value |
|
| 70 | + */ |
|
| 59 | 71 | public function showCaption($value) { |
| 60 | 72 | if(is_array($this->content)){ |
| 61 | 73 | foreach ($this->content as $pb){ |
@@ -113,6 +125,9 @@ discard block |
||
| 113 | 125 | return $this->isStacked; |
| 114 | 126 | } |
| 115 | 127 | |
| 128 | + /** |
|
| 129 | + * @param boolean $isStacked |
|
| 130 | + */ |
|
| 116 | 131 | public function setIsStacked($isStacked) { |
| 117 | 132 | $this->isStacked=$isStacked; |
| 118 | 133 | return $this; |
@@ -121,7 +136,7 @@ discard block |
||
| 121 | 136 | /** |
| 122 | 137 | * define the progressbar style |
| 123 | 138 | * avaible values : "success","info","warning","danger" |
| 124 | - * @param string|int $cssStyle |
|
| 139 | + * @param string $cssStyle |
|
| 125 | 140 | * @return \Ajax\bootstrap\html\HtmlProgressbar default : "" |
| 126 | 141 | */ |
| 127 | 142 | public function setStyle($cssStyle) { |
@@ -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 | * |
@@ -124,6 +124,10 @@ discard block |
||
| 124 | 124 | return $this; |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | + /** |
|
| 128 | + * @param string $name |
|
| 129 | + * @param string[] $typeCtrl |
|
| 130 | + */ |
|
| 127 | 131 | protected function setMemberCtrl(&$name, $value, $typeCtrl) { |
| 128 | 132 | if ($this->ctrl($name, $value, $typeCtrl) === true) { |
| 129 | 133 | return $name=$value; |
@@ -139,22 +143,35 @@ discard block |
||
| 139 | 143 | return $this; |
| 140 | 144 | } |
| 141 | 145 | |
| 146 | + /** |
|
| 147 | + * @param string $name |
|
| 148 | + */ |
|
| 142 | 149 | protected function removePropertyValue($name, $value) { |
| 143 | 150 | $this->properties[$name]=\str_replace($value, "", $this->properties[$name]); |
| 144 | 151 | return $this; |
| 145 | 152 | } |
| 146 | 153 | |
| 154 | + /** |
|
| 155 | + * @param string $name |
|
| 156 | + */ |
|
| 147 | 157 | protected function removePropertyValues($name, $values) { |
| 148 | 158 | $this->removeOldValues($this->properties[$name], $values); |
| 149 | 159 | return $this; |
| 150 | 160 | } |
| 151 | 161 | |
| 162 | + /** |
|
| 163 | + * @param string $name |
|
| 164 | + */ |
|
| 152 | 165 | public function removeProperty($name) { |
| 153 | 166 | if (\array_key_exists($name, $this->properties)) |
| 154 | 167 | unset($this->properties[$name]); |
| 155 | 168 | return $this; |
| 156 | 169 | } |
| 157 | 170 | |
| 171 | + /** |
|
| 172 | + * @param string $name |
|
| 173 | + * @param string[] $typeCtrl |
|
| 174 | + */ |
|
| 158 | 175 | protected function addToMemberCtrl(&$name, $value, $typeCtrl, $separator=" ") { |
| 159 | 176 | if ($this->ctrl($name, $value, $typeCtrl) === true) { |
| 160 | 177 | if (is_array($typeCtrl)) { |
@@ -165,6 +182,9 @@ discard block |
||
| 165 | 182 | return $this; |
| 166 | 183 | } |
| 167 | 184 | |
| 185 | + /** |
|
| 186 | + * @param string $name |
|
| 187 | + */ |
|
| 168 | 188 | protected function addToMember(&$name, $value, $separator=" ") { |
| 169 | 189 | $name=str_ireplace($value, "", $name) . $separator . $value; |
| 170 | 190 | return $this; |
@@ -179,6 +199,9 @@ discard block |
||
| 179 | 199 | return $this->addToProperty($name, $value); |
| 180 | 200 | } |
| 181 | 201 | |
| 202 | + /** |
|
| 203 | + * @param string $name |
|
| 204 | + */ |
|
| 182 | 205 | public function addToPropertyCtrl($name, $value, $typeCtrl) { |
| 183 | 206 | return $this->addToPropertyUnique($name, $value, $typeCtrl); |
| 184 | 207 | } |
@@ -327,14 +350,23 @@ discard block |
||
| 327 | 350 | return $this; |
| 328 | 351 | } |
| 329 | 352 | |
| 353 | + /** |
|
| 354 | + * @param string $event |
|
| 355 | + */ |
|
| 330 | 356 | public function getOn($event, $url, $responseElement="", $parameters=array()) { |
| 331 | 357 | return $this->_ajaxOn("get", $event, $url, $responseElement, $parameters); |
| 332 | 358 | } |
| 333 | 359 | |
| 360 | + /** |
|
| 361 | + * @param string $url |
|
| 362 | + */ |
|
| 334 | 363 | public function getOnClick($url, $responseElement="", $parameters=array()) { |
| 335 | 364 | return $this->getOn("click", $url, $responseElement, $parameters); |
| 336 | 365 | } |
| 337 | 366 | |
| 367 | + /** |
|
| 368 | + * @param string $event |
|
| 369 | + */ |
|
| 338 | 370 | public function postOn($event, $url, $params="{}", $responseElement="", $parameters=array()) { |
| 339 | 371 | $parameters["params"]=$params; |
| 340 | 372 | return $this->_ajaxOn("post", $event, $url, $responseElement, $parameters); |
@@ -344,6 +376,9 @@ discard block |
||
| 344 | 376 | return $this->postOn("click", $url, $params, $responseElement, $parameters); |
| 345 | 377 | } |
| 346 | 378 | |
| 379 | + /** |
|
| 380 | + * @param string $event |
|
| 381 | + */ |
|
| 347 | 382 | public function postFormOn($event, $url, $form, $responseElement="", $parameters=array()) { |
| 348 | 383 | $parameters["form"]=$form; |
| 349 | 384 | return $this->_ajaxOn("postForm", $event, $url, $responseElement, $parameters); |
@@ -371,6 +406,10 @@ discard block |
||
| 371 | 406 | return null; |
| 372 | 407 | } |
| 373 | 408 | |
| 409 | + /** |
|
| 410 | + * @param string $propertyName |
|
| 411 | + * @param string $value |
|
| 412 | + */ |
|
| 374 | 413 | protected function getElementByPropertyValue($propertyName,$value, $elements) { |
| 375 | 414 | if (is_array($elements)) { |
| 376 | 415 | $flag=false; |
@@ -411,6 +450,9 @@ discard block |
||
| 411 | 450 | return $value; |
| 412 | 451 | } |
| 413 | 452 | |
| 453 | + /** |
|
| 454 | + * @param string $jqueryCall |
|
| 455 | + */ |
|
| 414 | 456 | public function jsDoJquery($jqueryCall, $param="") { |
| 415 | 457 | return "$('#" . $this->identifier . "')." . $jqueryCall . "(" . $this->_prep_value($param) . ");"; |
| 416 | 458 | } |
@@ -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 | /** |
@@ -55,6 +55,9 @@ discard block |
||
| 55 | 55 | return $this->_semantic; |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | + /** |
|
| 59 | + * @param JsUtils $jsUtils |
|
| 60 | + */ |
|
| 58 | 61 | public function __construct($params,$jsUtils) { |
| 59 | 62 | $this->params=array(); |
| 60 | 63 | foreach ( $params as $key => $val ) { |
@@ -175,7 +178,7 @@ discard block |
||
| 175 | 178 | * |
| 176 | 179 | * @param string $element |
| 177 | 180 | * @param array $options |
| 178 | - * @return void |
|
| 181 | + * @return string |
|
| 179 | 182 | */ |
| 180 | 183 | public function sortable($element, $options=array()) { |
| 181 | 184 | if (count($options)>0) { |
@@ -307,6 +310,7 @@ discard block |
||
| 307 | 310 | |
| 308 | 311 | /** |
| 309 | 312 | * A wrapper for writing document.ready() |
| 313 | + * @param string $js |
|
| 310 | 314 | * @return string |
| 311 | 315 | */ |
| 312 | 316 | public function _document_ready($js) { |
@@ -354,6 +358,9 @@ discard block |
||
| 354 | 358 | return $value; |
| 355 | 359 | } |
| 356 | 360 | |
| 361 | + /** |
|
| 362 | + * @param string $input |
|
| 363 | + */ |
|
| 357 | 364 | private function minify($input) { |
| 358 | 365 | if(trim($input) === "") return $input; |
| 359 | 366 | return preg_replace( |