@@ -34,8 +34,9 @@ discard block |
||
| 34 | 34 | $callback = ", function(){\n{$callback}\n}"; |
| 35 | 35 | } |
| 36 | 36 | $str = "$({$element}).{$action}({$speed}{$callback});"; |
| 37 | - if ($immediatly) |
|
| 38 | - $this->jquery_code_for_compile[] = $str; |
|
| 37 | + if ($immediatly) { |
|
| 38 | + $this->jquery_code_for_compile[] = $str; |
|
| 39 | + } |
|
| 39 | 40 | return $str; |
| 40 | 41 | } |
| 41 | 42 | |
@@ -73,10 +74,12 @@ discard block |
||
| 73 | 74 | if (isset($param)) { |
| 74 | 75 | $param = Javascript::prep_value($param); |
| 75 | 76 | $str = "$({$element}).{$jQueryCall}({$param});"; |
| 76 | - } else |
|
| 77 | - $str = "$({$element}).{$jQueryCall}();"; |
|
| 78 | - if ($immediatly) |
|
| 79 | - $this->jquery_code_for_compile[] = $str; |
|
| 77 | + } else { |
|
| 78 | + $str = "$({$element}).{$jQueryCall}();"; |
|
| 79 | + } |
|
| 80 | + if ($immediatly) { |
|
| 81 | + $this->jquery_code_for_compile[] = $str; |
|
| 82 | + } |
|
| 80 | 83 | return $str; |
| 81 | 84 | } |
| 82 | 85 | |
@@ -94,8 +97,9 @@ discard block |
||
| 94 | 97 | $to = Javascript::prep_element($to); |
| 95 | 98 | $element = Javascript::prep_element($element); |
| 96 | 99 | $str = "$({$to}).{$jQueryCall}({$element});"; |
| 97 | - if ($immediatly) |
|
| 98 | - $this->jquery_code_for_compile[] = $str; |
|
| 100 | + if ($immediatly) { |
|
| 101 | + $this->jquery_code_for_compile[] = $str; |
|
| 102 | + } |
|
| 99 | 103 | return $str; |
| 100 | 104 | } |
| 101 | 105 | |
@@ -153,10 +157,12 @@ discard block |
||
| 153 | 157 | if (isset($value)) { |
| 154 | 158 | $value = Javascript::prep_value($value); |
| 155 | 159 | $str = "$({$element}).attr(\"$attributeName\",{$value});"; |
| 156 | - } else |
|
| 157 | - $str = "$({$element}).attr(\"$attributeName\");"; |
|
| 158 | - if ($immediatly) |
|
| 159 | - $this->jquery_code_for_compile[] = $str; |
|
| 160 | + } else { |
|
| 161 | + $str = "$({$element}).attr(\"$attributeName\");"; |
|
| 162 | + } |
|
| 163 | + if ($immediatly) { |
|
| 164 | + $this->jquery_code_for_compile[] = $str; |
|
| 165 | + } |
|
| 160 | 166 | return $str; |
| 161 | 167 | } |
| 162 | 168 | |
@@ -219,8 +225,9 @@ discard block |
||
| 219 | 225 | |
| 220 | 226 | $str = "$({$element}).animate({\n$animations\n\t\t}" . $speed . $extra . ");"; |
| 221 | 227 | |
| 222 | - if ($immediatly) |
|
| 223 | - $this->jquery_code_for_compile[] = $str; |
|
| 228 | + if ($immediatly) { |
|
| 229 | + $this->jquery_code_for_compile[] = $str; |
|
| 230 | + } |
|
| 224 | 231 | return $str; |
| 225 | 232 | } |
| 226 | 233 | |
@@ -410,8 +417,9 @@ discard block |
||
| 410 | 417 | $element = Javascript::prep_element($element); |
| 411 | 418 | $str = "$({$element}).trigger(\"$event\");"; |
| 412 | 419 | |
| 413 | - if ($immediatly) |
|
| 414 | - $this->jquery_code_for_compile[] = $str; |
|
| 420 | + if ($immediatly) { |
|
| 421 | + $this->jquery_code_for_compile[] = $str; |
|
| 422 | + } |
|
| 415 | 423 | return $str; |
| 416 | 424 | } |
| 417 | 425 | |
@@ -481,8 +489,9 @@ discard block |
||
| 481 | 489 | $str .= "else{" . $jsCodeIfFalse . "}"; |
| 482 | 490 | } |
| 483 | 491 | |
| 484 | - if ($immediatly) |
|
| 485 | - $this->jquery_code_for_compile[] = $str; |
|
| 492 | + if ($immediatly) { |
|
| 493 | + $this->jquery_code_for_compile[] = $str; |
|
| 494 | + } |
|
| 486 | 495 | return $str; |
| 487 | 496 | } |
| 488 | 497 | |
@@ -500,11 +509,13 @@ discard block |
||
| 500 | 509 | private function _doJQuery($element, $jqueryCall, $param = "", $jsCallback = "", $immediatly = false) { |
| 501 | 510 | $param = Javascript::prep_value($param); |
| 502 | 511 | $callback = ""; |
| 503 | - if ($jsCallback != "") |
|
| 504 | - $callback = ", function(event){\n{$jsCallback}\n}"; |
|
| 512 | + if ($jsCallback != "") { |
|
| 513 | + $callback = ", function(event){\n{$jsCallback}\n}"; |
|
| 514 | + } |
|
| 505 | 515 | $script = "$(" . Javascript::prep_element($element) . ")." . $jqueryCall . "(" . $param . $callback . ");\n"; |
| 506 | - if ($immediatly) |
|
| 507 | - $this->jquery_code_for_compile[] = $script; |
|
| 516 | + if ($immediatly) { |
|
| 517 | + $this->jquery_code_for_compile[] = $script; |
|
| 518 | + } |
|
| 508 | 519 | return $script; |
| 509 | 520 | } |
| 510 | 521 | |
@@ -591,8 +602,9 @@ discard block |
||
| 591 | 602 | */ |
| 592 | 603 | public function exec($js, $immediatly = false) { |
| 593 | 604 | $script = $js . "\n"; |
| 594 | - if ($immediatly) |
|
| 595 | - $this->jquery_code_for_compile[] = $script; |
|
| 605 | + if ($immediatly) { |
|
| 606 | + $this->jquery_code_for_compile[] = $script; |
|
| 607 | + } |
|
| 596 | 608 | return $script; |
| 597 | 609 | } |
| 598 | 610 | |
@@ -82,8 +82,9 @@ discard block |
||
| 82 | 82 | if (isset($this->content[$index]) === false) { |
| 83 | 83 | $this->content[$index] = $this->createSegment($index, $content, $menu->getItem($index) |
| 84 | 84 | ->getIdentifier()); |
| 85 | - } else |
|
| 86 | - $this->content[$index]->setContent($content); |
|
| 85 | + } else { |
|
| 86 | + $this->content[$index]->setContent($content); |
|
| 87 | + } |
|
| 87 | 88 | } |
| 88 | 89 | return $this; |
| 89 | 90 | } |
@@ -277,15 +278,17 @@ discard block |
||
| 277 | 278 | * @see BaseHtml::run() |
| 278 | 279 | */ |
| 279 | 280 | public function run(JsUtils $js) { |
| 280 | - if (isset($this->_bsComponent) === false) |
|
| 281 | - $this->_bsComponent = $js->semantic()->tab("#" . $this->identifier . " .item", $this->params); |
|
| 281 | + if (isset($this->_bsComponent) === false) { |
|
| 282 | + $this->_bsComponent = $js->semantic()->tab("#" . $this->identifier . " .item", $this->params); |
|
| 283 | + } |
|
| 282 | 284 | $this->addEventsOnRun($js); |
| 283 | 285 | return $this->_bsComponent; |
| 284 | 286 | } |
| 285 | 287 | |
| 286 | 288 | public function compile(JsUtils $js = NULL, &$view = NULL) { |
| 287 | - if (! $this->_activated && $this->content["menu"]->count() > 0 && \sizeof($this->content) > 1) |
|
| 288 | - $this->activate(0); |
|
| 289 | + if (! $this->_activated && $this->content["menu"]->count() > 0 && \sizeof($this->content) > 1) { |
|
| 290 | + $this->activate(0); |
|
| 291 | + } |
|
| 289 | 292 | return parent::compile($js, $view); |
| 290 | 293 | } |
| 291 | 294 | } |
@@ -141,8 +141,9 @@ discard block |
||
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | public function addInput($name) { |
| 144 | - if (! isset($name)) |
|
| 145 | - $name = "input-" . $this->identifier; |
|
| 144 | + if (! isset($name)) { |
|
| 145 | + $name = "input-" . $this->identifier; |
|
| 146 | + } |
|
| 146 | 147 | $this->setAction("activate"); |
| 147 | 148 | $this->input = new HtmlInput($name, "hidden"); |
| 148 | 149 | $this->input->setIdentifier("input-" . $this->identifier); |
@@ -293,24 +294,27 @@ discard block |
||
| 293 | 294 | |
| 294 | 295 | public function asButton($floating = false) { |
| 295 | 296 | $this->removeArrow(); |
| 296 | - if ($floating) |
|
| 297 | - $this->addToProperty("class", "floating"); |
|
| 297 | + if ($floating) { |
|
| 298 | + $this->addToProperty("class", "floating"); |
|
| 299 | + } |
|
| 298 | 300 | $this->removePropertyValue("class", "selection"); |
| 299 | 301 | return $this->addToProperty("class", "button"); |
| 300 | 302 | } |
| 301 | 303 | |
| 302 | 304 | public function asSelect($name = NULL, $multiple = false, $selection = true) { |
| 303 | 305 | $this->_multiple = $multiple; |
| 304 | - if (isset($name)) |
|
| 305 | - $this->addInput($name); |
|
| 306 | + if (isset($name)) { |
|
| 307 | + $this->addInput($name); |
|
| 308 | + } |
|
| 306 | 309 | if ($multiple) { |
| 307 | 310 | $this->addToProperty("class", "multiple"); |
| 308 | 311 | } |
| 309 | 312 | if ($selection) { |
| 310 | - if ($this->propertyContains("class", "button") === false) |
|
| 311 | - $this->addToPropertyCtrl("class", "selection", array( |
|
| 313 | + if ($this->propertyContains("class", "button") === false) { |
|
| 314 | + $this->addToPropertyCtrl("class", "selection", array( |
|
| 312 | 315 | "selection" |
| 313 | 316 | )); |
| 317 | + } |
|
| 314 | 318 | } |
| 315 | 319 | return $this; |
| 316 | 320 | } |
@@ -322,8 +326,9 @@ discard block |
||
| 322 | 326 | |
| 323 | 327 | public function setSelect($name = NULL, $multiple = false) { |
| 324 | 328 | $this->_template = '<%tagName% id="%identifier%" %properties%>%items%</%tagName%>'; |
| 325 | - if (! isset($name)) |
|
| 326 | - $name = "select-" . $this->identifier; |
|
| 329 | + if (! isset($name)) { |
|
| 330 | + $name = "select-" . $this->identifier; |
|
| 331 | + } |
|
| 327 | 332 | $this->input = null; |
| 328 | 333 | if ($multiple) { |
| 329 | 334 | $this->setProperty("multiple", true); |
@@ -368,8 +373,9 @@ discard block |
||
| 368 | 373 | $this->setProperty("value", $value); |
| 369 | 374 | } |
| 370 | 375 | $textElement = $this->getElementById("text-" . $this->identifier, $this->content); |
| 371 | - if (isset($textElement) && ($textElement instanceof HtmlDoubleElement) && ! $this->_multiple) |
|
| 372 | - $textElement->setContent($value); |
|
| 376 | + if (isset($textElement) && ($textElement instanceof HtmlDoubleElement) && ! $this->_multiple) { |
|
| 377 | + $textElement->setContent($value); |
|
| 378 | + } |
|
| 373 | 379 | return $this; |
| 374 | 380 | } |
| 375 | 381 | |
@@ -26,8 +26,9 @@ discard block |
||
| 26 | 26 | public function asIcon($icon, $title, $subHeader = NULL) { |
| 27 | 27 | $header = new HtmlHeader("header-" . $this->identifier); |
| 28 | 28 | $header->asIcon($icon, $title, $subHeader); |
| 29 | - if ($this->_inverted === false) |
|
| 30 | - $header->setInverted(); |
|
| 29 | + if ($this->_inverted === false) { |
|
| 30 | + $header->setInverted(); |
|
| 31 | + } |
|
| 31 | 32 | return $this->setContent($header); |
| 32 | 33 | } |
| 33 | 34 | |
@@ -51,8 +52,9 @@ discard block |
||
| 51 | 52 | } |
| 52 | 53 | |
| 53 | 54 | public function jsShow() { |
| 54 | - if (isset($this->_container)) |
|
| 55 | - return '$("#.' . $this->_container->getIdentifier() . ').dimmer("show");'; |
|
| 55 | + if (isset($this->_container)) { |
|
| 56 | + return '$("#.' . $this->_container->getIdentifier() . ').dimmer("show");'; |
|
| 57 | + } |
|
| 56 | 58 | } |
| 57 | 59 | |
| 58 | 60 | public function setBlurring() { |
@@ -45,8 +45,9 @@ discard block |
||
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | public function compile($internal = false) { |
| 48 | - if ($internal === false && $this->autoCompile === true) |
|
| 49 | - throw new \Exception("Impossible to compile if autoCompile is set to 'true'"); |
|
| 48 | + if ($internal === false && $this->autoCompile === true) { |
|
| 49 | + throw new \Exception("Impossible to compile if autoCompile is set to 'true'"); |
|
| 50 | + } |
|
| 50 | 51 | foreach ($this->components as $component) { |
| 51 | 52 | $component->compile(); |
| 52 | 53 | } |
@@ -69,9 +70,10 @@ discard block |
||
| 69 | 70 | $this->components[] = $component; |
| 70 | 71 | } |
| 71 | 72 | } |
| 72 | - if (isset($params)) |
|
| 73 | - if (\is_array($params)) |
|
| 73 | + if (isset($params)) { |
|
| 74 | + if (\is_array($params)) |
|
| 74 | 75 | $component->setParams($params); |
| 76 | + } |
|
| 75 | 77 | return $component; |
| 76 | 78 | } |
| 77 | 79 | |