@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | public function getCol($index,$force=true){ |
| 43 | 43 | if($index<sizeof($this->cols)+1){ |
| 44 | 44 | $result=$this->cols[$index-1]; |
| 45 | - }else if ($force){ |
|
| 45 | + } else if ($force){ |
|
| 46 | 46 | $result=$this->addColAt(CssSize::SIZE_MD,1,$index); |
| 47 | 47 | } |
| 48 | 48 | return $result; |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | $this->cols = array_values($this->cols); |
| 96 | 96 | $width=$width-$widthCol; |
| 97 | 97 | } |
| 98 | - }else{ |
|
| 98 | + } else{ |
|
| 99 | 99 | $width=0; |
| 100 | 100 | } |
| 101 | 101 | } |
@@ -424,8 +424,9 @@ discard block |
||
| 424 | 424 | $element=$this->_prep_element($element); |
| 425 | 425 | $value=$this->_prep_value($value); |
| 426 | 426 | $str="$({$element}).after({$value});"; |
| 427 | - if ($immediatly) |
|
| 428 | - $this->jquery_code_for_compile[]=$str; |
|
| 427 | + if ($immediatly) { |
|
| 428 | + $this->jquery_code_for_compile[]=$str; |
|
| 429 | + } |
|
| 429 | 430 | return $str; |
| 430 | 431 | } |
| 431 | 432 | |
@@ -441,10 +442,12 @@ discard block |
||
| 441 | 442 | if (isset($value)) { |
| 442 | 443 | $value=$this->_prep_value($value); |
| 443 | 444 | $str="$({$element}).attr(\"$attributeName\",{$value});"; |
| 444 | - } else |
|
| 445 | - $str="$({$element}).attr(\"$attributeName\");"; |
|
| 446 | - if ($immediatly) |
|
| 447 | - $this->jquery_code_for_compile[]=$str; |
|
| 445 | + } else { |
|
| 446 | + $str="$({$element}).attr(\"$attributeName\");"; |
|
| 447 | + } |
|
| 448 | + if ($immediatly) { |
|
| 449 | + $this->jquery_code_for_compile[]=$str; |
|
| 450 | + } |
|
| 448 | 451 | return $str; |
| 449 | 452 | } |
| 450 | 453 | |
@@ -460,10 +463,12 @@ discard block |
||
| 460 | 463 | if (isset($param)) { |
| 461 | 464 | $param=$this->_prep_value($param); |
| 462 | 465 | $str="$({$element}).{$jQueryCall}({$param});"; |
| 463 | - } else |
|
| 464 | - $str="$({$element}).{$jQueryCall}();"; |
|
| 465 | - if ($immediatly) |
|
| 466 | - $this->jquery_code_for_compile[]=$str; |
|
| 466 | + } else { |
|
| 467 | + $str="$({$element}).{$jQueryCall}();"; |
|
| 468 | + } |
|
| 469 | + if ($immediatly) { |
|
| 470 | + $this->jquery_code_for_compile[]=$str; |
|
| 471 | + } |
|
| 467 | 472 | return $str; |
| 468 | 473 | } |
| 469 | 474 | /** |
@@ -478,8 +483,9 @@ discard block |
||
| 478 | 483 | $to=$this->_prep_element($to); |
| 479 | 484 | $element=$this->_prep_element($element); |
| 480 | 485 | $str="$({$to}).{$jQueryCall}({$element});"; |
| 481 | - if ($immediatly) |
|
| 482 | - $this->jquery_code_for_compile[]=$str; |
|
| 486 | + if ($immediatly) { |
|
| 487 | + $this->jquery_code_for_compile[]=$str; |
|
| 488 | + } |
|
| 483 | 489 | return $str; |
| 484 | 490 | } |
| 485 | 491 | // -------------------------------------------------------------------- |
@@ -516,8 +522,9 @@ discard block |
||
| 516 | 522 | |
| 517 | 523 | $str="$({$element}).animate({\n$animations\n\t\t}".$speed.$extra.");"; |
| 518 | 524 | |
| 519 | - if ($immediatly) |
|
| 520 | - $this->jquery_code_for_compile[]=$str; |
|
| 525 | + if ($immediatly) { |
|
| 526 | + $this->jquery_code_for_compile[]=$str; |
|
| 527 | + } |
|
| 521 | 528 | return $str; |
| 522 | 529 | } |
| 523 | 530 | |
@@ -542,8 +549,9 @@ discard block |
||
| 542 | 549 | |
| 543 | 550 | $str="$({$element}).fadeIn({$speed}{$callback});"; |
| 544 | 551 | |
| 545 | - if ($immediatly) |
|
| 546 | - $this->jquery_code_for_compile[]=$str; |
|
| 552 | + if ($immediatly) { |
|
| 553 | + $this->jquery_code_for_compile[]=$str; |
|
| 554 | + } |
|
| 547 | 555 | return $str; |
| 548 | 556 | } |
| 549 | 557 | |
@@ -568,8 +576,9 @@ discard block |
||
| 568 | 576 | |
| 569 | 577 | $str="$({$element}).fadeOut({$speed}{$callback});"; |
| 570 | 578 | |
| 571 | - if ($immediatly) |
|
| 572 | - $this->jquery_code_for_compile[]=$str; |
|
| 579 | + if ($immediatly) { |
|
| 580 | + $this->jquery_code_for_compile[]=$str; |
|
| 581 | + } |
|
| 573 | 582 | return $str; |
| 574 | 583 | } |
| 575 | 584 | |
@@ -594,8 +603,9 @@ discard block |
||
| 594 | 603 | |
| 595 | 604 | $str="$({$element}).hide({$speed}{$callback});"; |
| 596 | 605 | |
| 597 | - if ($immediatly) |
|
| 598 | - $this->jquery_code_for_compile[]=$str; |
|
| 606 | + if ($immediatly) { |
|
| 607 | + $this->jquery_code_for_compile[]=$str; |
|
| 608 | + } |
|
| 599 | 609 | return $str; |
| 600 | 610 | } |
| 601 | 611 | |
@@ -622,8 +632,9 @@ discard block |
||
| 622 | 632 | |
| 623 | 633 | $str="$({$element}).slideUp({$speed}{$callback});"; |
| 624 | 634 | |
| 625 | - if ($immediatly) |
|
| 626 | - $this->jquery_code_for_compile[]=$str; |
|
| 635 | + if ($immediatly) { |
|
| 636 | + $this->jquery_code_for_compile[]=$str; |
|
| 637 | + } |
|
| 627 | 638 | return $str; |
| 628 | 639 | } |
| 629 | 640 | |
@@ -648,8 +659,9 @@ discard block |
||
| 648 | 659 | |
| 649 | 660 | $str="$({$element}).slideDown({$speed}{$callback});"; |
| 650 | 661 | |
| 651 | - if ($immediatly) |
|
| 652 | - $this->jquery_code_for_compile[]=$str; |
|
| 662 | + if ($immediatly) { |
|
| 663 | + $this->jquery_code_for_compile[]=$str; |
|
| 664 | + } |
|
| 653 | 665 | return $str; |
| 654 | 666 | } |
| 655 | 667 | |
@@ -674,8 +686,9 @@ discard block |
||
| 674 | 686 | |
| 675 | 687 | $str="$({$element}).slideToggle({$speed}{$callback});"; |
| 676 | 688 | |
| 677 | - if ($immediatly) |
|
| 678 | - $this->jquery_code_for_compile[]=$str; |
|
| 689 | + if ($immediatly) { |
|
| 690 | + $this->jquery_code_for_compile[]=$str; |
|
| 691 | + } |
|
| 679 | 692 | return $str; |
| 680 | 693 | } |
| 681 | 694 | |
@@ -692,8 +705,9 @@ discard block |
||
| 692 | 705 | $element=$this->_prep_element($element); |
| 693 | 706 | $str="$({$element}).toggle();"; |
| 694 | 707 | |
| 695 | - if ($immediatly) |
|
| 696 | - $this->jquery_code_for_compile[]=$str; |
|
| 708 | + if ($immediatly) { |
|
| 709 | + $this->jquery_code_for_compile[]=$str; |
|
| 710 | + } |
|
| 697 | 711 | return $str; |
| 698 | 712 | } |
| 699 | 713 | |
@@ -709,8 +723,9 @@ discard block |
||
| 709 | 723 | $element=$this->_prep_element($element); |
| 710 | 724 | $str="$({$element}).trigger(\"$event\");"; |
| 711 | 725 | |
| 712 | - if ($immediatly) |
|
| 713 | - $this->jquery_code_for_compile[]=$str; |
|
| 726 | + if ($immediatly) { |
|
| 727 | + $this->jquery_code_for_compile[]=$str; |
|
| 728 | + } |
|
| 714 | 729 | return $str; |
| 715 | 730 | } |
| 716 | 731 | |
@@ -735,8 +750,9 @@ discard block |
||
| 735 | 750 | |
| 736 | 751 | $str="$({$element}).show({$speed}{$callback});"; |
| 737 | 752 | |
| 738 | - if ($immediatly) |
|
| 739 | - $this->jquery_code_for_compile[]=$str; |
|
| 753 | + if ($immediatly) { |
|
| 754 | + $this->jquery_code_for_compile[]=$str; |
|
| 755 | + } |
|
| 740 | 756 | return $str; |
| 741 | 757 | } |
| 742 | 758 | |
@@ -754,8 +770,9 @@ discard block |
||
| 754 | 770 | $str.="else{".$jsCodeIfFalse."}"; |
| 755 | 771 | } |
| 756 | 772 | |
| 757 | - if ($immediatly) |
|
| 758 | - $this->jquery_code_for_compile[]=$str; |
|
| 773 | + if ($immediatly) { |
|
| 774 | + $this->jquery_code_for_compile[]=$str; |
|
| 775 | + } |
|
| 759 | 776 | return $str; |
| 760 | 777 | } |
| 761 | 778 | |
@@ -821,12 +838,14 @@ discard block |
||
| 821 | 838 | if ($stopPropagation===true) { |
| 822 | 839 | $js="event.stopPropagation();\n".$js; |
| 823 | 840 | } |
| 824 | - if (array_search($event, $this->jquery_events)===false) |
|
| 825 | - $event="\n\t$(".$this->_prep_element($element).").bind('{$event}',function(event){\n\t\t{$js}\n\t});\n"; |
|
| 826 | - else |
|
| 827 | - $event="\n\t$(".$this->_prep_element($element).").{$event}(function(event){\n\t\t{$js}\n\t});\n"; |
|
| 828 | - if($immediatly) |
|
| 829 | - $this->jquery_code_for_compile[]=$event; |
|
| 841 | + if (array_search($event, $this->jquery_events)===false) { |
|
| 842 | + $event="\n\t$(".$this->_prep_element($element).").bind('{$event}',function(event){\n\t\t{$js}\n\t});\n"; |
|
| 843 | + } else { |
|
| 844 | + $event="\n\t$(".$this->_prep_element($element).").{$event}(function(event){\n\t\t{$js}\n\t});\n"; |
|
| 845 | + } |
|
| 846 | + if($immediatly) { |
|
| 847 | + $this->jquery_code_for_compile[]=$event; |
|
| 848 | + } |
|
| 830 | 849 | return $event; |
| 831 | 850 | } |
| 832 | 851 | |
@@ -879,8 +898,9 @@ discard block |
||
| 879 | 898 | } |
| 880 | 899 | $output=($script_tags===FALSE) ? $script : $this->inline($script); |
| 881 | 900 | |
| 882 | - if ($view!=NULL) |
|
| 883 | - $view->setVar($view_var, $output); |
|
| 901 | + if ($view!=NULL) { |
|
| 902 | + $view->setVar($view_var, $output); |
|
| 903 | + } |
|
| 884 | 904 | return $output; |
| 885 | 905 | } |
| 886 | 906 | |
@@ -1003,8 +1023,9 @@ discard block |
||
| 1003 | 1023 | } |
| 1004 | 1024 | $retour.="$.".$method."(url,".$params.").done(function( data ) {\n"; |
| 1005 | 1025 | $retour.=$this->_getOnAjaxDone($responseElement, $jsCallback)."});\n"; |
| 1006 | - if ($immediatly) |
|
| 1007 | - $this->jquery_code_for_compile[]=$retour; |
|
| 1026 | + if ($immediatly) { |
|
| 1027 | + $this->jquery_code_for_compile[]=$retour; |
|
| 1028 | + } |
|
| 1008 | 1029 | return $retour; |
| 1009 | 1030 | } |
| 1010 | 1031 | |
@@ -1012,13 +1033,15 @@ discard block |
||
| 1012 | 1033 | $url=$this->_correctAjaxUrl($url); |
| 1013 | 1034 | $retour="url='".$url."';\n"; |
| 1014 | 1035 | $slash="/"; |
| 1015 | - if(PhalconUtils::endsWith($url, "/")) |
|
| 1016 | - $slash=""; |
|
| 1036 | + if(PhalconUtils::endsWith($url, "/")) { |
|
| 1037 | + $slash=""; |
|
| 1038 | + } |
|
| 1017 | 1039 | if(JString::isNotNull($attr)){ |
| 1018 | - if ($attr=="value") |
|
| 1019 | - $retour.="url=url+'".$slash."'+$(this).val();\n"; |
|
| 1020 | - else if($attr!=null && $attr!=="") |
|
| 1021 | - $retour.="url=url+'".$slash."'+($(this).attr('".$attr."')||'');\n"; |
|
| 1040 | + if ($attr=="value") { |
|
| 1041 | + $retour.="url=url+'".$slash."'+$(this).val();\n"; |
|
| 1042 | + } else if($attr!=null && $attr!=="") { |
|
| 1043 | + $retour.="url=url+'".$slash."'+($(this).attr('".$attr."')||'');\n"; |
|
| 1044 | + } |
|
| 1022 | 1045 | } |
| 1023 | 1046 | return $retour; |
| 1024 | 1047 | } |
@@ -1040,8 +1063,9 @@ discard block |
||
| 1040 | 1063 | } |
| 1041 | 1064 | |
| 1042 | 1065 | protected function _correctAjaxUrl($url) { |
| 1043 | - if (PhalconUtils::endsWith($url, "/")) |
|
| 1044 | - $url=substr($url, 0, strlen($url)-1); |
|
| 1066 | + if (PhalconUtils::endsWith($url, "/")) { |
|
| 1067 | + $url=substr($url, 0, strlen($url)-1); |
|
| 1068 | + } |
|
| 1045 | 1069 | if (strncmp($url, 'http://', 7)!=0&&strncmp($url, 'https://', 8)!=0) { |
| 1046 | 1070 | $url=$this->_di->get("url")->get($url); |
| 1047 | 1071 | } |
@@ -1065,8 +1089,9 @@ discard block |
||
| 1065 | 1089 | $retour.="\t".$jsCallback."\n". |
| 1066 | 1090 | "\t$(document).trigger('jsonReady',[data]);\n". |
| 1067 | 1091 | "});\n"; |
| 1068 | - if ($immediatly) |
|
| 1069 | - $this->jquery_code_for_compile[]=$retour; |
|
| 1092 | + if ($immediatly) { |
|
| 1093 | + $this->jquery_code_for_compile[]=$retour; |
|
| 1094 | + } |
|
| 1070 | 1095 | return $retour; |
| 1071 | 1096 | } |
| 1072 | 1097 | |
@@ -1105,7 +1130,7 @@ discard block |
||
| 1105 | 1130 | if($context===null){ |
| 1106 | 1131 | $appendTo="\t\tnewElm.appendTo($('".$maskSelector."').parent());\n"; |
| 1107 | 1132 | $newElm = "$('#'+newId)"; |
| 1108 | - }else{ |
|
| 1133 | + } else{ |
|
| 1109 | 1134 | $appendTo="\t\tnewElm.appendTo(".$context.");\n"; |
| 1110 | 1135 | $newElm = $context.".find('#'+newId)"; |
| 1111 | 1136 | } |
@@ -1115,8 +1140,9 @@ discard block |
||
| 1115 | 1140 | $retour.="\t}\n"."\tfor(var key in value){\n"."\t\t\tvar html = $('<div />').append($(newElm).clone()).html();\n"."\t\t\tif(html.indexOf('[['+key+']]')>-1){\n"."\t\t\t\tcontent=$(html.split('[['+key+']]').join(value[key]));\n"."\t\t\t\t$(newElm).replaceWith(content);newElm=content;\n"."\t\t\t}\n"."\t\tvar sel='[data-id=\"'+key+'\"]';if($(sel,newElm).length){\n"."\t\t\tvar selElm=$(sel,newElm);\n"."\t\t\t if(selElm.is('[value]')) { selElm.attr('value',value[key]);selElm.val(value[key]);} else { selElm.html(value[key]); }\n"."\t\t}\n"."}\n"."\t$(newElm).show(true);"."\n"."\t$(newElm).removeClass('hide');"."});\n"; |
| 1116 | 1141 | $retour.="\t$(document).trigger('jsonReady',[data]);\n"; |
| 1117 | 1142 | $retour.="\t".$jsCallback."\n"."});\n"; |
| 1118 | - if ($immediatly) |
|
| 1119 | - $this->jquery_code_for_compile[]=$retour; |
|
| 1143 | + if ($immediatly) { |
|
| 1144 | + $this->jquery_code_for_compile[]=$retour; |
|
| 1145 | + } |
|
| 1120 | 1146 | return $retour; |
| 1121 | 1147 | } |
| 1122 | 1148 | /** |
@@ -1157,8 +1183,9 @@ discard block |
||
| 1157 | 1183 | }});\n"; |
| 1158 | 1184 | $retour.="$('#".$form."').submit();\n"; |
| 1159 | 1185 | } |
| 1160 | - if ($immediatly) |
|
| 1161 | - $this->jquery_code_for_compile[]=$retour; |
|
| 1186 | + if ($immediatly) { |
|
| 1187 | + $this->jquery_code_for_compile[]=$retour; |
|
| 1188 | + } |
|
| 1162 | 1189 | return $retour; |
| 1163 | 1190 | } |
| 1164 | 1191 | |
@@ -1238,11 +1265,13 @@ discard block |
||
| 1238 | 1265 | public function _doJQuery($element, $jqueryCall, $param="", $jsCallback="", $immediatly=false) { |
| 1239 | 1266 | $param=$this->_prep_value($param); |
| 1240 | 1267 | $callback=""; |
| 1241 | - if ($jsCallback!="") |
|
| 1242 | - $callback=", function(event){\n{$jsCallback}\n}"; |
|
| 1268 | + if ($jsCallback!="") { |
|
| 1269 | + $callback=", function(event){\n{$jsCallback}\n}"; |
|
| 1270 | + } |
|
| 1243 | 1271 | $script="$(".$this->_prep_element($element).").".$jqueryCall."(".$param.$callback.");\n"; |
| 1244 | - if ($immediatly) |
|
| 1245 | - $this->jquery_code_for_compile[]=$script; |
|
| 1272 | + if ($immediatly) { |
|
| 1273 | + $this->jquery_code_for_compile[]=$script; |
|
| 1274 | + } |
|
| 1246 | 1275 | return $script; |
| 1247 | 1276 | } |
| 1248 | 1277 | |
@@ -1271,8 +1300,9 @@ discard block |
||
| 1271 | 1300 | */ |
| 1272 | 1301 | public function _exec($js, $immediatly=false) { |
| 1273 | 1302 | $script=$js."\n"; |
| 1274 | - if ($immediatly) |
|
| 1275 | - $this->jquery_code_for_compile[]=$script; |
|
| 1303 | + if ($immediatly) { |
|
| 1304 | + $this->jquery_code_for_compile[]=$script; |
|
| 1305 | + } |
|
| 1276 | 1306 | return $script; |
| 1277 | 1307 | } |
| 1278 | 1308 | |
@@ -1291,7 +1321,9 @@ discard block |
||
| 1291 | 1321 | } |
| 1292 | 1322 | |
| 1293 | 1323 | private function minify($input) { |
| 1294 | - if(trim($input) === "") return $input; |
|
| 1324 | + if(trim($input) === "") { |
|
| 1325 | + return $input; |
|
| 1326 | + } |
|
| 1295 | 1327 | return preg_replace( |
| 1296 | 1328 | array( |
| 1297 | 1329 | // Remove comment(s) |
@@ -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; |
@@ -17,8 +17,9 @@ discard block |
||
| 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; |
@@ -37,10 +38,11 @@ discard block |
||
| 37 | 38 | |
| 38 | 39 | public static function wrapObjects($input, $js=NULL, $separator=' ') { |
| 39 | 40 | return implode($separator, array_map(function ($v) use($js) { |
| 40 | - if (is_object($v)) |
|
| 41 | - return $v->compile($js); |
|
| 42 | - else |
|
| 43 | - return $v; |
|
| 41 | + if (is_object($v)) { |
|
| 42 | + return $v->compile($js); |
|
| 43 | + } else { |
|
| 44 | + return $v; |
|
| 45 | + } |
|
| 44 | 46 | }, $input)); |
| 45 | 47 | } |
| 46 | 48 | } |
| 47 | 49 | \ No newline at end of file |
@@ -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 | } |
@@ -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 | |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | public function addOption($element,$value="",$selected=false){ |
| 29 | 29 | if($element instanceof HtmlOption){ |
| 30 | 30 | $option=$element; |
| 31 | - }else{ |
|
| 31 | + } else{ |
|
| 32 | 32 | $option=new HtmlOption($this->identifier."-".count($this->options), $element,$value); |
| 33 | 33 | } |
| 34 | 34 | if($selected || $option->getValue()==$this->getProperty("value")){ |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | foreach ($array as $k=>$v){ |
| 68 | 68 | $this->addOption($v, $k); |
| 69 | 69 | } |
| 70 | - }else{ |
|
| 70 | + } else{ |
|
| 71 | 71 | foreach ($array as $v){ |
| 72 | 72 | $this->addOption($v, $v); |
| 73 | 73 | } |
@@ -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); |