@@ -42,6 +42,7 @@ discard block |
||
| 42 | 42 | |
| 43 | 43 | /** |
| 44 | 44 | * @param string $identifier |
| 45 | + * @param integer $active |
|
| 45 | 46 | */ |
| 46 | 47 | public function __construct($identifier,$from=1,$to=1,$active=NULL,$countVisible=NULL){ |
| 47 | 48 | parent::__construct($identifier,"ul"); |
@@ -57,6 +58,9 @@ discard block |
||
| 57 | 58 | $this->createContent(); |
| 58 | 59 | } |
| 59 | 60 | |
| 61 | + /** |
|
| 62 | + * @param integer $num |
|
| 63 | + */ |
|
| 60 | 64 | private function createElement($num,$content,$disabled=false,$current=false){ |
| 61 | 65 | $count=sizeof($this->content)+1; |
| 62 | 66 | $elem=new HtmlBsDoubleElement("li-".$this->identifier."-".$count,"li"); |
@@ -168,6 +172,10 @@ discard block |
||
| 168 | 172 | public function getActive() { |
| 169 | 173 | return $this->active; |
| 170 | 174 | } |
| 175 | + |
|
| 176 | + /** |
|
| 177 | + * @param integer $active |
|
| 178 | + */ |
|
| 171 | 179 | public function setActive($active) { |
| 172 | 180 | $this->active = $active; |
| 173 | 181 | $this->createContent(); |
@@ -48,6 +48,9 @@ discard block |
||
| 48 | 48 | return $this; |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | + /** |
|
| 52 | + * @param string $name |
|
| 53 | + */ |
|
| 51 | 54 | public function getProperty($name) { |
| 52 | 55 | if (array_key_exists($name, $this->properties)) |
| 53 | 56 | return $this->properties [$name]; |
@@ -128,6 +131,10 @@ discard block |
||
| 128 | 131 | return $this; |
| 129 | 132 | } |
| 130 | 133 | |
| 134 | + /** |
|
| 135 | + * @param string $name |
|
| 136 | + * @param string[] $typeCtrl |
|
| 137 | + */ |
|
| 131 | 138 | protected function addToMemberCtrl(&$name, $value, $typeCtrl, $separator=" ") { |
| 132 | 139 | if ($this->ctrl($name, $value, $typeCtrl)===true) { |
| 133 | 140 | if (is_array($typeCtrl)) { |
@@ -152,6 +159,9 @@ discard block |
||
| 152 | 159 | return $this->addToProperty($name, $value); |
| 153 | 160 | } |
| 154 | 161 | |
| 162 | + /** |
|
| 163 | + * @param string $name |
|
| 164 | + */ |
|
| 155 | 165 | public function addToPropertyCtrl($name, $value, $typeCtrl) { |
| 156 | 166 | // if($this->ctrl($name, $value, $typeCtrl)===true){ |
| 157 | 167 | return $this->addToPropertyUnique($name, $value, $typeCtrl); |
@@ -219,6 +229,9 @@ discard block |
||
| 219 | 229 | |
| 220 | 230 | } |
| 221 | 231 | |
| 232 | + /** |
|
| 233 | + * @param string $before |
|
| 234 | + */ |
|
| 222 | 235 | public function wrap($before, $after="") { |
| 223 | 236 | if(isset($before)){ |
| 224 | 237 | $this->wrapBefore.=$before; |
@@ -287,6 +300,9 @@ discard block |
||
| 287 | 300 | } |
| 288 | 301 | } |
| 289 | 302 | |
| 303 | + /** |
|
| 304 | + * @param string $operation |
|
| 305 | + */ |
|
| 290 | 306 | public function _ajaxOn($operation, $event, $url, $responseElement="", $parameters=array()) { |
| 291 | 307 | $params=array ( |
| 292 | 308 | "url" => $url, |
@@ -297,14 +313,23 @@ discard block |
||
| 297 | 313 | return $this; |
| 298 | 314 | } |
| 299 | 315 | |
| 316 | + /** |
|
| 317 | + * @param string $event |
|
| 318 | + */ |
|
| 300 | 319 | public function getOn($event, $url, $responseElement="", $parameters=array()) { |
| 301 | 320 | return $this->_ajaxOn("get", $event, $url, $responseElement, $parameters); |
| 302 | 321 | } |
| 303 | 322 | |
| 323 | + /** |
|
| 324 | + * @param string $url |
|
| 325 | + */ |
|
| 304 | 326 | public function getOnClick($url, $responseElement="", $parameters=array()) { |
| 305 | 327 | return $this->getOn("click", $url, $responseElement, $parameters); |
| 306 | 328 | } |
| 307 | 329 | |
| 330 | + /** |
|
| 331 | + * @param string $event |
|
| 332 | + */ |
|
| 308 | 333 | public function postOn($event, $url, $params="{}", $responseElement="", $parameters=array()) { |
| 309 | 334 | $parameters ["params"]=$params; |
| 310 | 335 | return $this->_ajaxOn("post", $event, $url, $responseElement, $parameters); |
@@ -314,6 +339,9 @@ discard block |
||
| 314 | 339 | return $this->postOn("click", $url, $params, $responseElement, $parameters); |
| 315 | 340 | } |
| 316 | 341 | |
| 342 | + /** |
|
| 343 | + * @param string $event |
|
| 344 | + */ |
|
| 317 | 345 | public function postFormOn($event, $url, $form, $responseElement="", $parameters=array()) { |
| 318 | 346 | $parameters ["form"]=$form; |
| 319 | 347 | return $this->_ajaxOn("postForm", $event, $url, $responseElement, $parameters); |
@@ -363,6 +391,9 @@ discard block |
||
| 363 | 391 | return $value; |
| 364 | 392 | } |
| 365 | 393 | |
| 394 | + /** |
|
| 395 | + * @param string $jqueryCall |
|
| 396 | + */ |
|
| 366 | 397 | public function jsDoJquery($jqueryCall, $param=""){ |
| 367 | 398 | return "$('#".$this->identifier."').".$jqueryCall."(".$this->_prep_value($param).");"; |
| 368 | 399 | } |
@@ -40,6 +40,7 @@ |
||
| 40 | 40 | /** |
| 41 | 41 | * {@inheritDoc} |
| 42 | 42 | * @see \Ajax\common\html\HtmlSingleElement::setSize() |
| 43 | + * @param string $size |
|
| 43 | 44 | */ |
| 44 | 45 | public function setSize($size) { |
| 45 | 46 | $this->setMemberCtrl($this->size, $size,IconSize::getConstants()); |
@@ -92,8 +92,9 @@ discard block |
||
| 92 | 92 | |
| 93 | 93 | public function setCircular($inverted=false){ |
| 94 | 94 | $invertedStr=""; |
| 95 | - if($inverted) |
|
| 96 | - $invertedStr=" inverted"; |
|
| 95 | + if($inverted) { |
|
| 96 | + $invertedStr=" inverted"; |
|
| 97 | + } |
|
| 97 | 98 | return $this->addToMember($this->attributes, "circular".$invertedStr); |
| 98 | 99 | } |
| 99 | 100 | |
@@ -110,8 +111,9 @@ discard block |
||
| 110 | 111 | */ |
| 111 | 112 | public function setBordered($inverted=false){ |
| 112 | 113 | $invertedStr=""; |
| 113 | - if($inverted) |
|
| 114 | - $invertedStr=" inverted"; |
|
| 114 | + if($inverted) { |
|
| 115 | + $invertedStr=" inverted"; |
|
| 116 | + } |
|
| 115 | 117 | return $this->addToMember($this->attributes, "bordered".$invertedStr); |
| 116 | 118 | } |
| 117 | 119 | |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | foreach ($icons as $icon=>$size){ |
| 37 | 37 | $group->addIcon($icon,$size); |
| 38 | 38 | } |
| 39 | - }else{ |
|
| 39 | + } else{ |
|
| 40 | 40 | foreach ($icons as $icon){ |
| 41 | 41 | $group->addIcon($icon); |
| 42 | 42 | } |
@@ -33,11 +33,12 @@ discard block |
||
| 33 | 33 | foreach ($this->content as $pb){ |
| 34 | 34 | $pb->setActive($value); |
| 35 | 35 | } |
| 36 | - }else{ |
|
| 37 | - if ($value===true) |
|
| 38 | - $this->active="active"; |
|
| 39 | - else |
|
| 40 | - $this->active=""; |
|
| 36 | + } else{ |
|
| 37 | + if ($value===true) { |
|
| 38 | + $this->active="active"; |
|
| 39 | + } else { |
|
| 40 | + $this->active=""; |
|
| 41 | + } |
|
| 41 | 42 | } |
| 42 | 43 | return $this; |
| 43 | 44 | } |
@@ -47,11 +48,12 @@ discard block |
||
| 47 | 48 | foreach ($this->content as $pb){ |
| 48 | 49 | $pb->setStriped($value); |
| 49 | 50 | } |
| 50 | - }else{ |
|
| 51 | - if ($value===true) |
|
| 52 | - $this->striped="progress-bar-striped"; |
|
| 53 | - else |
|
| 54 | - $this->striped=""; |
|
| 51 | + } else{ |
|
| 52 | + if ($value===true) { |
|
| 53 | + $this->striped="progress-bar-striped"; |
|
| 54 | + } else { |
|
| 55 | + $this->striped=""; |
|
| 56 | + } |
|
| 55 | 57 | } |
| 56 | 58 | return $this; |
| 57 | 59 | } |
@@ -61,11 +63,12 @@ discard block |
||
| 61 | 63 | foreach ($this->content as $pb){ |
| 62 | 64 | $pb->showCaption($value); |
| 63 | 65 | } |
| 64 | - }else{ |
|
| 65 | - if ($value===true) |
|
| 66 | - $this->caption="%value%%"; |
|
| 67 | - else |
|
| 68 | - $this->caption='<span class="sr-only">%value%% Complete (%style%)</span>'; |
|
| 66 | + } else{ |
|
| 67 | + if ($value===true) { |
|
| 68 | + $this->caption="%value%%"; |
|
| 69 | + } else { |
|
| 70 | + $this->caption='<span class="sr-only">%value%% Complete (%style%)</span>'; |
|
| 71 | + } |
|
| 69 | 72 | } |
| 70 | 73 | return $this; |
| 71 | 74 | } |
@@ -137,8 +140,9 @@ discard block |
||
| 137 | 140 | if(isset($this->styleLimits)&& JArray::isAssociative($this->styleLimits)){ |
| 138 | 141 | foreach ($this->styleLimits as $k=>$v){ |
| 139 | 142 | $actualStyle=$k; |
| 140 | - if($v>$this->value) |
|
| 141 | - break; |
|
| 143 | + if($v>$this->value) { |
|
| 144 | + break; |
|
| 145 | + } |
|
| 142 | 146 | } |
| 143 | 147 | } |
| 144 | 148 | $this->style=$actualStyle; |
@@ -65,9 +65,9 @@ discard block |
||
| 65 | 65 | if(is_array($element)){ |
| 66 | 66 | $elm=new HtmlLink("lnk-".$this->identifier."-".$size); |
| 67 | 67 | $elm->fromArray($element); |
| 68 | - }else if($element instanceof HtmlLink){ |
|
| 68 | + } else if($element instanceof HtmlLink){ |
|
| 69 | 69 | $elm=$element; |
| 70 | - }else{ |
|
| 70 | + } else{ |
|
| 71 | 71 | $elm=new HtmlLink("lnk-".$this->identifier."-".$size,$href,$element); |
| 72 | 72 | if(isset($glyph)){ |
| 73 | 73 | $elm->wrapContentWithGlyph($glyph); |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | } |
| 115 | 115 | if($this->absolutePaths===true){ |
| 116 | 116 | return $this->_hrefFunction($this->content[$index]); |
| 117 | - }else{ |
|
| 117 | + } else{ |
|
| 118 | 118 | return $this->root.implode($separator, array_slice(array_map(function($e){return $this->_hrefFunction($e);}, $this->content),$this->startIndex,$index+1)); |
| 119 | 119 | } |
| 120 | 120 | } |
@@ -204,8 +204,9 @@ discard block |
||
| 204 | 204 | if(\sizeof($params)>0 || \strtolower($action)!="index" ){ |
| 205 | 205 | $items[]=$action; |
| 206 | 206 | foreach ($params as $p){ |
| 207 | - if(\is_object($p)==false) |
|
| 208 | - $items[]=$p; |
|
| 207 | + if(\is_object($p)==false) { |
|
| 208 | + $items[]=$p; |
|
| 209 | + } |
|
| 209 | 210 | } |
| 210 | 211 | } |
| 211 | 212 | return $this->addElements($items); |
@@ -29,15 +29,17 @@ |
||
| 29 | 29 | |
| 30 | 30 | public function addContent($content,$before=false) { |
| 31 | 31 | if (is_array($this->content)===false) { |
| 32 | - if(isset($this->content)) |
|
| 33 | - $this->content=array ($this->content); |
|
| 34 | - else |
|
| 35 | - $this->content=array(); |
|
| 32 | + if(isset($this->content)) { |
|
| 33 | + $this->content=array ($this->content); |
|
| 34 | + } else { |
|
| 35 | + $this->content=array(); |
|
| 36 | + } |
|
| 37 | + } |
|
| 38 | + if($before) { |
|
| 39 | + array_unshift($this->content,$content); |
|
| 40 | + } else { |
|
| 41 | + $this->content []=$content; |
|
| 36 | 42 | } |
| 37 | - if($before) |
|
| 38 | - array_unshift($this->content,$content); |
|
| 39 | - else |
|
| 40 | - $this->content []=$content; |
|
| 41 | 43 | return $this; |
| 42 | 44 | } |
| 43 | 45 | |