@@ -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]; |
@@ -113,6 +116,10 @@ discard block |
||
| 113 | 116 | return $this; |
| 114 | 117 | } |
| 115 | 118 | |
| 119 | + /** |
|
| 120 | + * @param string $name |
|
| 121 | + * @param string[] $typeCtrl |
|
| 122 | + */ |
|
| 116 | 123 | protected function setMemberCtrl(&$name, $value, $typeCtrl) { |
| 117 | 124 | if ($this->ctrl($name, $value, $typeCtrl)===true) { |
| 118 | 125 | return $name=$value; |
@@ -128,6 +135,10 @@ discard block |
||
| 128 | 135 | return $this; |
| 129 | 136 | } |
| 130 | 137 | |
| 138 | + /** |
|
| 139 | + * @param string $name |
|
| 140 | + * @param string[] $typeCtrl |
|
| 141 | + */ |
|
| 131 | 142 | protected function addToMemberCtrl(&$name, $value, $typeCtrl, $separator=" ") { |
| 132 | 143 | if ($this->ctrl($name, $value, $typeCtrl)===true) { |
| 133 | 144 | if (is_array($typeCtrl)) { |
@@ -138,6 +149,9 @@ discard block |
||
| 138 | 149 | return $this; |
| 139 | 150 | } |
| 140 | 151 | |
| 152 | + /** |
|
| 153 | + * @param string $name |
|
| 154 | + */ |
|
| 141 | 155 | protected function addToMember(&$name, $value, $separator=" ") { |
| 142 | 156 | $name=str_ireplace($value, "", $name).$separator.$value; |
| 143 | 157 | return $this; |
@@ -152,6 +166,10 @@ discard block |
||
| 152 | 166 | return $this->addToProperty($name, $value); |
| 153 | 167 | } |
| 154 | 168 | |
| 169 | + /** |
|
| 170 | + * @param string $name |
|
| 171 | + * @param string[] $typeCtrl |
|
| 172 | + */ |
|
| 155 | 173 | public function addToPropertyCtrl($name, $value, $typeCtrl) { |
| 156 | 174 | // if($this->ctrl($name, $value, $typeCtrl)===true){ |
| 157 | 175 | return $this->addToPropertyUnique($name, $value, $typeCtrl); |
@@ -219,6 +237,9 @@ discard block |
||
| 219 | 237 | |
| 220 | 238 | } |
| 221 | 239 | |
| 240 | + /** |
|
| 241 | + * @param string $before |
|
| 242 | + */ |
|
| 222 | 243 | public function wrap($before, $after="") { |
| 223 | 244 | $this->wrapBefore.=$before; |
| 224 | 245 | $this->wrapAfter=$after.$this->wrapAfter; |
@@ -285,6 +306,9 @@ discard block |
||
| 285 | 306 | } |
| 286 | 307 | } |
| 287 | 308 | |
| 309 | + /** |
|
| 310 | + * @param string $operation |
|
| 311 | + */ |
|
| 288 | 312 | public function _ajaxOn($operation, $event, $url, $responseElement="", $parameters=array()) { |
| 289 | 313 | $params=array ( |
| 290 | 314 | "url" => $url, |
@@ -295,14 +319,23 @@ discard block |
||
| 295 | 319 | return $this; |
| 296 | 320 | } |
| 297 | 321 | |
| 322 | + /** |
|
| 323 | + * @param string $event |
|
| 324 | + */ |
|
| 298 | 325 | public function getOn($event, $url, $responseElement="", $parameters=array()) { |
| 299 | 326 | return $this->_ajaxOn("get", $event, $url, $responseElement, $parameters); |
| 300 | 327 | } |
| 301 | 328 | |
| 329 | + /** |
|
| 330 | + * @param string $url |
|
| 331 | + */ |
|
| 302 | 332 | public function getOnClick($url, $responseElement="", $parameters=array()) { |
| 303 | 333 | return $this->getOn("click", $url, $responseElement, $parameters); |
| 304 | 334 | } |
| 305 | 335 | |
| 336 | + /** |
|
| 337 | + * @param string $event |
|
| 338 | + */ |
|
| 306 | 339 | public function postOn($event, $url, $params="{}", $responseElement="", $parameters=array()) { |
| 307 | 340 | $parameters ["params"]=$params; |
| 308 | 341 | return $this->_ajaxOn("post", $event, $url, $responseElement, $parameters); |
@@ -312,6 +345,9 @@ discard block |
||
| 312 | 345 | return $this->postOn("click", $url, $params, $responseElement, $parameters); |
| 313 | 346 | } |
| 314 | 347 | |
| 348 | + /** |
|
| 349 | + * @param string $event |
|
| 350 | + */ |
|
| 315 | 351 | public function postFormOn($event, $url, $form, $responseElement="", $parameters=array()) { |
| 316 | 352 | $parameters ["form"]=$form; |
| 317 | 353 | return $this->_ajaxOn("postForm", $event, $url, $responseElement, $parameters); |
@@ -361,6 +397,9 @@ discard block |
||
| 361 | 397 | return $value; |
| 362 | 398 | } |
| 363 | 399 | |
| 400 | + /** |
|
| 401 | + * @param string $jqueryCall |
|
| 402 | + */ |
|
| 364 | 403 | public function jsDoJquery($jqueryCall, $param=""){ |
| 365 | 404 | return "$('#".$this->identifier."').".$jqueryCall."(".$this->_prep_value($param).");"; |
| 366 | 405 | } |
@@ -49,16 +49,18 @@ discard block |
||
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | public function getProperty($name) { |
| 52 | - if (array_key_exists($name, $this->properties)) |
|
| 53 | - return $this->properties [$name]; |
|
| 52 | + if (array_key_exists($name, $this->properties)) { |
|
| 53 | + return $this->properties [$name]; |
|
| 54 | + } |
|
| 54 | 55 | } |
| 55 | 56 | |
| 56 | 57 | public function addToProperty($name, $value, $separator=" ") { |
| 57 | 58 | $v=$this->properties [$name]; |
| 58 | - if (isset($v)&&$v!=="") |
|
| 59 | - $v=$v.$separator.$value; |
|
| 60 | - else |
|
| 61 | - $v=$value; |
|
| 59 | + if (isset($v)&&$v!=="") { |
|
| 60 | + $v=$v.$separator.$value; |
|
| 61 | + } else { |
|
| 62 | + $v=$value; |
|
| 63 | + } |
|
| 62 | 64 | |
| 63 | 65 | return $this->setProperty($name, $v); |
| 64 | 66 | } |
@@ -108,8 +110,9 @@ discard block |
||
| 108 | 110 | } |
| 109 | 111 | |
| 110 | 112 | protected function setPropertyCtrl($name, $value, $typeCtrl) { |
| 111 | - if ($this->ctrl($name, $value, $typeCtrl)===true) |
|
| 112 | - return $this->setProperty($name, $value); |
|
| 113 | + if ($this->ctrl($name, $value, $typeCtrl)===true) { |
|
| 114 | + return $this->setProperty($name, $value); |
|
| 115 | + } |
|
| 113 | 116 | return $this; |
| 114 | 117 | } |
| 115 | 118 | |
@@ -144,8 +147,9 @@ discard block |
||
| 144 | 147 | } |
| 145 | 148 | |
| 146 | 149 | protected function addToPropertyUnique($name, $value, $typeCtrl) { |
| 147 | - if (@class_exists($typeCtrl, true)) |
|
| 148 | - $typeCtrl=$typeCtrl::getConstants(); |
|
| 150 | + if (@class_exists($typeCtrl, true)) { |
|
| 151 | + $typeCtrl=$typeCtrl::getConstants(); |
|
| 152 | + } |
|
| 149 | 153 | if (is_array($typeCtrl)) { |
| 150 | 154 | $this->removeOldValues($this->properties [$name], $typeCtrl); |
| 151 | 155 | } |
@@ -326,15 +330,18 @@ discard block |
||
| 326 | 330 | $flag=false; |
| 327 | 331 | $index=0; |
| 328 | 332 | while ( !$flag&&$index<sizeof($elements) ) { |
| 329 | - if ($elements [$index] instanceof BaseHtml) |
|
| 330 | - $flag=($elements [$index]->getIdentifier()===$identifier); |
|
| 333 | + if ($elements [$index] instanceof BaseHtml) { |
|
| 334 | + $flag=($elements [$index]->getIdentifier()===$identifier); |
|
| 335 | + } |
|
| 331 | 336 | $index++; |
| 332 | 337 | } |
| 333 | - if ($flag===true) |
|
| 334 | - return $elements [$index-1]; |
|
| 338 | + if ($flag===true) { |
|
| 339 | + return $elements [$index-1]; |
|
| 340 | + } |
|
| 335 | 341 | } elseif ($elements instanceof BaseHtml) { |
| 336 | - if ($elements->getIdentifier()===$identifier) |
|
| 337 | - return $elements; |
|
| 342 | + if ($elements->getIdentifier()===$identifier) { |
|
| 343 | + return $elements; |
|
| 344 | + } |
|
| 338 | 345 | } |
| 339 | 346 | return null; |
| 340 | 347 | } |
@@ -7,6 +7,9 @@ |
||
| 7 | 7 | |
| 8 | 8 | class PropertyWrapper { |
| 9 | 9 | |
| 10 | + /** |
|
| 11 | + * @param \Ajax\JsUtils $js |
|
| 12 | + */ |
|
| 10 | 13 | public static function wrap($input, $js=NULL, $separator=' ', $valueQuote='"') { |
| 11 | 14 | $output=""; |
| 12 | 15 | if (is_string($input)) { |
@@ -17,8 +17,9 @@ |
||
| 17 | 17 | $value1=reset($input); |
| 18 | 18 | if (is_object($value1)) { |
| 19 | 19 | $output=PropertyWrapper::wrapObjects($input, $js, $separator=' '); |
| 20 | - } else |
|
| 21 | - $output=PropertyWrapper::wrapStrings($input, $separator=' ', $valueQuote='"'); |
|
| 20 | + } else { |
|
| 21 | + $output=PropertyWrapper::wrapStrings($input, $separator=' ', $valueQuote='"'); |
|
| 22 | + } |
|
| 22 | 23 | } |
| 23 | 24 | } |
| 24 | 25 | return $output; |
@@ -18,6 +18,9 @@ discard block |
||
| 18 | 18 | */ |
| 19 | 19 | class HtmlListgroupItem extends HtmlElementAsContent { |
| 20 | 20 | |
| 21 | + /** |
|
| 22 | + * @param HtmlDoubleElement $element |
|
| 23 | + */ |
|
| 21 | 24 | public function __construct($element) { |
| 22 | 25 | parent::__construct($element); |
| 23 | 26 | $this->element->setProperty("class", "list-group-item"); |
@@ -37,7 +40,7 @@ discard block |
||
| 37 | 40 | * define the Panel style |
| 38 | 41 | * avaible values : "list-group-item-default","list-group-item-primary","list-group-item-success","list-group-item-info","list-group-item-warning","list-group-item-danger" |
| 39 | 42 | * @param string|int $cssStyle |
| 40 | - * @return \Ajax\bootstrap\html\HtmlListgroupItem default : "list-group-item-default" |
|
| 43 | + * @return \Ajax\bootstrap\html\base\HtmlSingleElement default : "list-group-item-default" |
|
| 41 | 44 | */ |
| 42 | 45 | public function setStyle($cssStyle) { |
| 43 | 46 | if (!PhalconUtils::startsWith($cssStyle, "list-group-item")) |
@@ -40,8 +40,9 @@ |
||
| 40 | 40 | * @return \Ajax\bootstrap\html\HtmlListgroupItem default : "list-group-item-default" |
| 41 | 41 | */ |
| 42 | 42 | public function setStyle($cssStyle) { |
| 43 | - if (!PhalconUtils::startsWith($cssStyle, "list-group-item")) |
|
| 44 | - $cssStyle="list-group-item".$cssStyle; |
|
| 43 | + if (!PhalconUtils::startsWith($cssStyle, "list-group-item")) { |
|
| 44 | + $cssStyle="list-group-item".$cssStyle; |
|
| 45 | + } |
|
| 45 | 46 | $this->element->addToPropertyCtrl("class", $cssStyle, CssRef::Styles("list-group-item")); |
| 46 | 47 | return $this->element; |
| 47 | 48 | } |
@@ -175,7 +175,6 @@ discard block |
||
| 175 | 175 | * Associate an ajax get to the breadcrumbs elements, displayed in $targetSelector |
| 176 | 176 | * $attr member is used to build each element url |
| 177 | 177 | * @param string $targetSelector the target of the get |
| 178 | - * @param string $attr the html attribute used to build the elements url |
|
| 179 | 178 | * @return HtmlBreadcrumbs |
| 180 | 179 | */ |
| 181 | 180 | public function autoGetOnClick($targetSelector){ |
@@ -197,6 +196,9 @@ discard block |
||
| 197 | 196 | $jsUtils->html("#".$this->identifier,str_replace("\"","'", $this->contentAsString()),true); |
| 198 | 197 | } |
| 199 | 198 | |
| 199 | + /** |
|
| 200 | + * @param integer $index |
|
| 201 | + */ |
|
| 200 | 202 | public function getElement($index){ |
| 201 | 203 | return $this->content[$index]; |
| 202 | 204 | } |
@@ -67,9 +67,9 @@ discard block |
||
| 67 | 67 | if(is_array($element)){ |
| 68 | 68 | $elm=new HtmlLink("lnk-".$this->identifier."-".$size); |
| 69 | 69 | $elm->fromArray($element); |
| 70 | - }else if($element instanceof HtmlLink){ |
|
| 70 | + } else if($element instanceof HtmlLink){ |
|
| 71 | 71 | $elm=$element; |
| 72 | - }else{ |
|
| 72 | + } else{ |
|
| 73 | 73 | $elm=new HtmlLink("lnk-".$this->identifier."-".$size,$href,$element); |
| 74 | 74 | if(isset($glyph)){ |
| 75 | 75 | $elm->wrapContentWithGlyph($glyph); |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | } |
| 117 | 117 | if($this->absolutePaths===true){ |
| 118 | 118 | return $this->_hrefFunction($this->content[$index]); |
| 119 | - }else{ |
|
| 119 | + } else{ |
|
| 120 | 120 | return $this->root.implode($separator, array_slice(array_map(function($e){return $this->_hrefFunction($e);}, $this->content),0,$index+1)); |
| 121 | 121 | } |
| 122 | 122 | } |
@@ -48,6 +48,9 @@ |
||
| 48 | 48 | $element->setStyle($value); |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | + /** |
|
| 52 | + * @param HtmlDropdown $bt |
|
| 53 | + */ |
|
| 51 | 54 | private function dropdownAsButton($bt) { |
| 52 | 55 | $this->addExistingDropDown($bt); |
| 53 | 56 | $bt->setTagName("button"); |
@@ -44,8 +44,9 @@ discard block |
||
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | public function setStyle($value) { |
| 47 | - foreach ( $this->elements as $element ) |
|
| 48 | - $element->setStyle($value); |
|
| 47 | + foreach ( $this->elements as $element ) { |
|
| 48 | + $element->setStyle($value); |
|
| 49 | + } |
|
| 49 | 50 | } |
| 50 | 51 | |
| 51 | 52 | private function dropdownAsButton($bt) { |
@@ -70,16 +71,18 @@ discard block |
||
| 70 | 71 | } elseif ($element instanceof HtmlButton) { |
| 71 | 72 | $this->elements[]=$element; |
| 72 | 73 | } elseif (is_array($element)) { |
| 73 | - if (array_key_exists("glyph", $element)) |
|
| 74 | - $bt=new HtmlGlyphButton($this->identifier."-button-".$iid); |
|
| 75 | - elseif (array_key_exists("btnCaption", $element)) { |
|
| 76 | - if (array_key_exists("split", $element)) |
|
| 77 | - $bt=new HtmlSplitbutton($this->identifier."-dropdown-".$iid); |
|
| 78 | - else |
|
| 79 | - $bt=new HtmlDropdown($this->identifier."-dropdown-".$iid); |
|
| 74 | + if (array_key_exists("glyph", $element)) { |
|
| 75 | + $bt=new HtmlGlyphButton($this->identifier."-button-".$iid); |
|
| 76 | + } elseif (array_key_exists("btnCaption", $element)) { |
|
| 77 | + if (array_key_exists("split", $element)) { |
|
| 78 | + $bt=new HtmlSplitbutton($this->identifier."-dropdown-".$iid); |
|
| 79 | + } else { |
|
| 80 | + $bt=new HtmlDropdown($this->identifier."-dropdown-".$iid); |
|
| 81 | + } |
|
| 80 | 82 | $this->dropdownAsButton($bt); |
| 81 | - } else |
|
| 82 | - $bt=new HtmlButton($this->identifier."-button-".$iid); |
|
| 83 | + } else { |
|
| 84 | + $bt=new HtmlButton($this->identifier."-button-".$iid); |
|
| 85 | + } |
|
| 83 | 86 | $bt->fromArray($element); |
| 84 | 87 | $this->elements[]=$bt; |
| 85 | 88 | $result=$bt; |
@@ -110,8 +113,9 @@ discard block |
||
| 110 | 113 | public function setAlignment($value) { |
| 111 | 114 | if (is_int($value)) { |
| 112 | 115 | $value=CssRef::alignment("btn-group")[$value]; |
| 113 | - } else |
|
| 114 | - $value="btn-group-".$value; |
|
| 116 | + } else { |
|
| 117 | + $value="btn-group-".$value; |
|
| 118 | + } |
|
| 115 | 119 | if (strstr($value, "justified")) { |
| 116 | 120 | foreach ( $this->elements as $element ) { |
| 117 | 121 | $element->wrap('<div class="btn-group" role="group">', '</div>'); |
@@ -126,9 +130,9 @@ discard block |
||
| 126 | 130 | * @return HtmlButton |
| 127 | 131 | */ |
| 128 | 132 | public function getElement($index) { |
| 129 | - if (is_int($index)) |
|
| 130 | - return $this->elements[$index]; |
|
| 131 | - else { |
|
| 133 | + if (is_int($index)) { |
|
| 134 | + return $this->elements[$index]; |
|
| 135 | + } else { |
|
| 132 | 136 | $elm=$this->getElementById($index, $this->elements); |
| 133 | 137 | return $elm; |
| 134 | 138 | } |
@@ -11,6 +11,11 @@ discard block |
||
| 11 | 11 | |
| 12 | 12 | class HtmlButtontoolbar extends HtmlButtongroups { |
| 13 | 13 | |
| 14 | + /** |
|
| 15 | + * @param string $identifier |
|
| 16 | + * @param string $cssStyle |
|
| 17 | + * @param string $size |
|
| 18 | + */ |
|
| 14 | 19 | public function __construct($identifier, $elements=array(), $cssStyle=NULL, $size=NULL, $tagName="div") { |
| 15 | 20 | parent::__construct($identifier, $elements, $cssStyle, $size, $tagName); |
| 16 | 21 | $this->setClass("btn-toolbar"); |
@@ -56,7 +61,7 @@ discard block |
||
| 56 | 61 | |
| 57 | 62 | /** |
| 58 | 63 | * return the Buttongroups at position $index |
| 59 | - * @return \Ajax\bootstrap\html\HtmlButtongroups |
|
| 64 | + * @return HtmlButton |
|
| 60 | 65 | */ |
| 61 | 66 | public function getGroup($index) { |
| 62 | 67 | return parent::getElement($index); |
@@ -45,9 +45,9 @@ discard block |
||
| 45 | 45 | */ |
| 46 | 46 | private function getLastButtonGroup() { |
| 47 | 47 | $nb=sizeof($this->elements); |
| 48 | - if ($nb>0) |
|
| 49 | - $bg=$this->elements [$nb-1]; |
|
| 50 | - else { |
|
| 48 | + if ($nb>0) { |
|
| 49 | + $bg=$this->elements [$nb-1]; |
|
| 50 | + } else { |
|
| 51 | 51 | $bg=new HtmlButtongroups($this->identifier."-buttongroups-".$nb); |
| 52 | 52 | $this->elements []=$bg; |
| 53 | 53 | } |
@@ -65,8 +65,9 @@ discard block |
||
| 65 | 65 | public function getLastGroup() { |
| 66 | 66 | $bg=null; |
| 67 | 67 | $nb=sizeof($this->elements); |
| 68 | - if ($nb>0) |
|
| 69 | - $bg=$this->elements [$nb-1]; |
|
| 68 | + if ($nb>0) { |
|
| 69 | + $bg=$this->elements [$nb-1]; |
|
| 70 | + } |
|
| 70 | 71 | return $bg; |
| 71 | 72 | } |
| 72 | 73 | |
@@ -23,6 +23,9 @@ discard block |
||
| 23 | 23 | protected $_base=""; |
| 24 | 24 | protected $_glyphs=array (); |
| 25 | 25 | |
| 26 | + /** |
|
| 27 | + * @param string $identifier |
|
| 28 | + */ |
|
| 26 | 29 | public function __construct($identifier, $images=NULL) { |
| 27 | 30 | parent::__construct($identifier); |
| 28 | 31 | $this->_template=include 'templates/tplCarousel.php'; |
@@ -61,7 +64,7 @@ discard block |
||
| 61 | 64 | * |
| 62 | 65 | * @param string $caption |
| 63 | 66 | * @param string $sens |
| 64 | - * @return HtmlCarouselControl|string |
|
| 67 | + * @return HtmlCarouselControl |
|
| 65 | 68 | */ |
| 66 | 69 | private function createControl($caption="next", $sens="left") { |
| 67 | 70 | $control=new HtmlCarouselControl($sens."-ctrl-".$this->identifier); |
@@ -75,27 +75,30 @@ |
||
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | private function getGlyph($sens="left") { |
| 78 | - if (array_key_exists($sens, $this->_glyphs)) |
|
| 79 | - return $this->_glyphs [$sens]; |
|
| 78 | + if (array_key_exists($sens, $this->_glyphs)) { |
|
| 79 | + return $this->_glyphs [$sens]; |
|
| 80 | + } |
|
| 80 | 81 | return "glyphicon-chevron-".$sens; |
| 81 | 82 | } |
| 82 | 83 | |
| 83 | 84 | public function setRightGlyph($glyphicon) { |
| 84 | 85 | $glyphs=CssRef::glyphIcons(); |
| 85 | - if (array_search($glyphicon, $glyphs)!==false) |
|
| 86 | - $this->_glyphs ["right"]=$glyphicon; |
|
| 86 | + if (array_search($glyphicon, $glyphs)!==false) { |
|
| 87 | + $this->_glyphs ["right"]=$glyphicon; |
|
| 88 | + } |
|
| 87 | 89 | } |
| 88 | 90 | |
| 89 | 91 | public function setLeftGlyph($glyphicon) { |
| 90 | 92 | $glyphs=CssRef::glyphIcons(); |
| 91 | - if (array_search($glyphicon, $glyphs)!==false) |
|
| 92 | - $this->_glyphs ["left"]=$glyphicon; |
|
| 93 | + if (array_search($glyphicon, $glyphs)!==false) { |
|
| 94 | + $this->_glyphs ["left"]=$glyphicon; |
|
| 95 | + } |
|
| 93 | 96 | } |
| 94 | 97 | |
| 95 | 98 | public function addImage($imageSrc, $imageAlt="", $caption=NULL, $description=NULL) { |
| 96 | 99 | if(is_array($imageSrc)){ |
| 97 | 100 | $this->addImage($imageSrc[0],@$imageSrc[1],@$imageSrc[2],@$imageSrc[3]); |
| 98 | - }else{ |
|
| 101 | + } else{ |
|
| 99 | 102 | $image=new HtmlCarouselItem("item-".$this->identifier); |
| 100 | 103 | $image->setImageSrc($this->_base.$imageSrc); |
| 101 | 104 | $image->setImageAlt($imageAlt); |
@@ -87,6 +87,9 @@ |
||
| 87 | 87 | return $result; |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | + /** |
|
| 91 | + * @return string |
|
| 92 | + */ |
|
| 90 | 93 | private function getPrefix($element) { |
| 91 | 94 | $result="input_text"; |
| 92 | 95 | foreach ( $this->formElementsPrefix as $k => $v ) { |
@@ -99,8 +99,9 @@ |
||
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | public function addGroup($identifier="") { |
| 102 | - if ($identifier==="") |
|
| 103 | - $identifier="form-".$this->identifier; |
|
| 102 | + if ($identifier==="") { |
|
| 103 | + $identifier="form-".$this->identifier; |
|
| 104 | + } |
|
| 104 | 105 | $group=new HtmlDoubleElement($identifier); |
| 105 | 106 | $group->setTagName("div"); |
| 106 | 107 | $group->setClass("form-group"); |
@@ -208,7 +208,7 @@ |
||
| 208 | 208 | * Includes a modal-backdrop element. |
| 209 | 209 | * Alternatively, specify static for a backdrop which doesn't close the modal on click. |
| 210 | 210 | * @param Boolean $value default : true |
| 211 | - * @return HtmlModal |
|
| 211 | + * @return boolean |
|
| 212 | 212 | */ |
| 213 | 213 | public function setBackdrop($value) { |
| 214 | 214 | return $this->backdrop=$value; |
@@ -151,18 +151,20 @@ discard block |
||
| 151 | 151 | $this->_bsComponent=$js->bootstrap()->modal("#".$this->identifier, array ( |
| 152 | 152 | "show" => $this->showOnStartup |
| 153 | 153 | )); |
| 154 | - if ($this->draggable) |
|
| 155 | - $this->_bsComponent->setDraggable(true); |
|
| 154 | + if ($this->draggable) { |
|
| 155 | + $this->_bsComponent->setDraggable(true); |
|
| 156 | + } |
|
| 156 | 157 | $this->_bsComponent->setBackdrop($this->backdrop); |
| 157 | 158 | $this->addEventsOnRun($js); |
| 158 | 159 | return $this->_bsComponent; |
| 159 | 160 | } |
| 160 | 161 | |
| 161 | 162 | public function getButton($index) { |
| 162 | - if (is_int($index)) |
|
| 163 | - return $this->buttons [$index]; |
|
| 164 | - else |
|
| 165 | - return $this->getElementById($index, $this->buttons); |
|
| 163 | + if (is_int($index)) { |
|
| 164 | + return $this->buttons [$index]; |
|
| 165 | + } else { |
|
| 166 | + return $this->getElementById($index, $this->buttons); |
|
| 167 | + } |
|
| 166 | 168 | } |
| 167 | 169 | |
| 168 | 170 | public function showOnCreate() { |
@@ -188,8 +190,9 @@ discard block |
||
| 188 | 190 | |
| 189 | 191 | public function jsHideButton($index) { |
| 190 | 192 | $btn=$this->getButton($index); |
| 191 | - if ($btn) |
|
| 192 | - return "$('#".$btn->getIdentifier()."').hide();"; |
|
| 193 | + if ($btn) { |
|
| 194 | + return "$('#".$btn->getIdentifier()."').hide();"; |
|
| 195 | + } |
|
| 193 | 196 | } |
| 194 | 197 | |
| 195 | 198 | /** |