@@ -123,8 +123,9 @@ |
||
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | public function run(JsUtils $js){ |
| 126 | - if(JString::isNotNull($this->_identifier)) |
|
| 127 | - $js->execOn("click", "#".$this->_identifier." .ui.toggle", 'var active=$(this).hasClass("active");$(this).children("i").toggleClass("up",active).toggleClass("down",!active);var nextTd=$(this).closest("td").next("td");nextTd.children(":not(.toggle-caption)").toggle(active);nextTd.children(".toggle-caption").toggle(!active);$(this).trigger({type:"toggled",active: active,caption: nextTd.children(".toggle-caption")});'); |
|
| 126 | + if(JString::isNotNull($this->_identifier)) { |
|
| 127 | + $js->execOn("click", "#".$this->_identifier." .ui.toggle", 'var active=$(this).hasClass("active");$(this).children("i").toggleClass("up",active).toggleClass("down",!active);var nextTd=$(this).closest("td").next("td");nextTd.children(":not(.toggle-caption)").toggle(active);nextTd.children(".toggle-caption").toggle(!active);$(this).trigger({type:"toggled",active: active,caption: nextTd.children(".toggle-caption")});'); |
|
| 128 | + } |
|
| 128 | 129 | parent::run($js); |
| 129 | 130 | } |
| 130 | 131 | } |
@@ -41,8 +41,9 @@ discard block |
||
| 41 | 41 | * @param string $popupEvent |
| 42 | 42 | */ |
| 43 | 43 | public function setPopupAttributes($variation=NULL, $popupEvent=NULL) { |
| 44 | - if (isset($this->_popup)) |
|
| 45 | - $this->_popup->setAttributes($variation, $popupEvent); |
|
| 44 | + if (isset($this->_popup)) { |
|
| 45 | + $this->_popup->setAttributes($variation, $popupEvent); |
|
| 46 | + } |
|
| 46 | 47 | } |
| 47 | 48 | |
| 48 | 49 | /** |
@@ -97,8 +98,9 @@ discard block |
||
| 97 | 98 | $labelO=$label; |
| 98 | 99 | if (\is_object($label) === false) { |
| 99 | 100 | $labelO=new HtmlLabel("label-" . $this->identifier, $label); |
| 100 | - if (isset($icon)) |
|
| 101 | - $labelO->addIcon($icon); |
|
| 101 | + if (isset($icon)) { |
|
| 102 | + $labelO->addIcon($icon); |
|
| 103 | + } |
|
| 102 | 104 | } else { |
| 103 | 105 | $labelO->addToPropertyCtrl("class", "label", array ("label" )); |
| 104 | 106 | } |
@@ -125,10 +127,12 @@ discard block |
||
| 125 | 127 | * @return HtmlSemDoubleElement |
| 126 | 128 | */ |
| 127 | 129 | public function asLink($href=NULL,$target=NULL) { |
| 128 | - if (isset($href)) |
|
| 129 | - $this->setProperty("href", $href); |
|
| 130 | - if(isset($target)) |
|
| 131 | - $this->setProperty("target", $target); |
|
| 130 | + if (isset($href)) { |
|
| 131 | + $this->setProperty("href", $href); |
|
| 132 | + } |
|
| 133 | + if(isset($target)) { |
|
| 134 | + $this->setProperty("target", $target); |
|
| 135 | + } |
|
| 132 | 136 | return $this->setTagName("a"); |
| 133 | 137 | } |
| 134 | 138 | |
@@ -139,8 +143,9 @@ discard block |
||
| 139 | 143 | */ |
| 140 | 144 | public function jsShowDimmer($show=true) { |
| 141 | 145 | $status="hide"; |
| 142 | - if ($show === true) |
|
| 143 | - $status="show"; |
|
| 146 | + if ($show === true) { |
|
| 147 | + $status="show"; |
|
| 148 | + } |
|
| 144 | 149 | return '$("#.' . $this->identifier . ').dimmer("' . $status . '");'; |
| 145 | 150 | } |
| 146 | 151 | |
@@ -16,8 +16,9 @@ discard block |
||
| 16 | 16 | * @param mixed $view |
| 17 | 17 | */ |
| 18 | 18 | protected function _compileLibrary(BaseGui $library, &$view=NULL){ |
| 19 | - if(isset($view)) |
|
| 20 | - $library->compileHtml($this, $view); |
|
| 19 | + if(isset($view)) { |
|
| 20 | + $library->compileHtml($this, $view); |
|
| 21 | + } |
|
| 21 | 22 | if ($library->isAutoCompile()) { |
| 22 | 23 | $library->compile(true); |
| 23 | 24 | } |
@@ -36,7 +37,9 @@ discard block |
||
| 36 | 37 | } |
| 37 | 38 | |
| 38 | 39 | protected function minify($input) { |
| 39 | - if(trim($input) === "") return $input; |
|
| 40 | + if(trim($input) === "") { |
|
| 41 | + return $input; |
|
| 42 | + } |
|
| 40 | 43 | $input= preg_replace( |
| 41 | 44 | array( |
| 42 | 45 | // Remove comment(s) |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | $retour.="var self=this;\n"; |
| 33 | 33 | if($hasLoader===true && JString::isNotNull($responseElement)){ |
| 34 | 34 | $this->addLoading($retour, $responseElement,$ajaxLoader); |
| 35 | - }elseif($hasLoader==="internal"){ |
|
| 35 | + } elseif($hasLoader==="internal"){ |
|
| 36 | 36 | $retour.="\n$(this).addClass('loading');"; |
| 37 | 37 | } |
| 38 | 38 | $ajaxParameters=["url"=>"url","method"=>"'".\strtoupper($method)."'"]; |
@@ -49,8 +49,9 @@ discard block |
||
| 49 | 49 | $retour.="$.ajax({".$this->implodeAjaxParameters($ajaxParameters)."}).done(function( data, textStatus, jqXHR ) {\n"; |
| 50 | 50 | $retour.=$this->_getOnAjaxDone($responseElement, $jqueryDone,$ajaxTransition,$jsCallback,$hasLoader,($historize?$originalSelector:null))."});\n"; |
| 51 | 51 | $retour=$this->_addJsCondition($jsCondition,$retour); |
| 52 | - if ($immediatly) |
|
| 53 | - $this->jquery_code_for_compile[]=$retour; |
|
| 52 | + if ($immediatly) { |
|
| 53 | + $this->jquery_code_for_compile[]=$retour; |
|
| 54 | + } |
|
| 54 | 55 | return $retour; |
| 55 | 56 | } |
| 56 | 57 | |
@@ -86,12 +87,13 @@ discard block |
||
| 86 | 87 | if(JString::isNotNull($attr)){ |
| 87 | 88 | if ($attr==="value"){ |
| 88 | 89 | $retour.="url=url+'".$slash."'+$(this).val();\n"; |
| 89 | - }elseif ($attr==="html"){ |
|
| 90 | + } elseif ($attr==="html"){ |
|
| 90 | 91 | $retour.="url=url+'".$slash."'+$(this).html();\n"; |
| 91 | - }elseif(\substr($attr, 0,3)==="js:"){ |
|
| 92 | + } elseif(\substr($attr, 0,3)==="js:"){ |
|
| 92 | 93 | $retour.="url=url+'".$slash."'+".\substr($attr, 3).";\n"; |
| 93 | - }elseif($attr!==null && $attr!=="") |
|
| 94 | - $retour.="url=url+'".$slash."'+($(this).attr('".$attr."')||'');\n"; |
|
| 94 | + } elseif($attr!==null && $attr!=="") { |
|
| 95 | + $retour.="url=url+'".$slash."'+($(this).attr('".$attr."')||'');\n"; |
|
| 96 | + } |
|
| 95 | 97 | } |
| 96 | 98 | return $retour; |
| 97 | 99 | } |
@@ -111,13 +113,14 @@ discard block |
||
| 111 | 113 | if (JString::isNotNull($responseElement)) { |
| 112 | 114 | if(isset($ajaxTransition)){ |
| 113 | 115 | $call=$this->setAjaxDataCall($ajaxTransition); |
| 114 | - }elseif(isset($this->ajaxTransition)){ |
|
| 116 | + } elseif(isset($this->ajaxTransition)){ |
|
| 115 | 117 | $call=$this->ajaxTransition; |
| 116 | 118 | } |
| 117 | - if(\is_callable($call)) |
|
| 118 | - $retour="\t".$call($responseElement,$jqueryDone).";\n"; |
|
| 119 | - else |
|
| 120 | - $retour="\t{$responseElement}.{$jqueryDone}( data );\n"; |
|
| 119 | + if(\is_callable($call)) { |
|
| 120 | + $retour="\t".$call($responseElement,$jqueryDone).";\n"; |
|
| 121 | + } else { |
|
| 122 | + $retour="\t{$responseElement}.{$jqueryDone}( data );\n"; |
|
| 123 | + } |
|
| 121 | 124 | } |
| 122 | 125 | if(isset($history)){ |
| 123 | 126 | if($this->params["autoActiveLinks"]){ |
@@ -140,8 +143,9 @@ discard block |
||
| 140 | 143 | } |
| 141 | 144 | |
| 142 | 145 | protected function _correctAjaxUrl($url) { |
| 143 | - if ($url!=="/" && JString::endsWith($url, "/")===true) |
|
| 144 | - $url=substr($url, 0, strlen($url)-1); |
|
| 146 | + if ($url!=="/" && JString::endsWith($url, "/")===true) { |
|
| 147 | + $url=substr($url, 0, strlen($url)-1); |
|
| 148 | + } |
|
| 145 | 149 | if (strncmp($url, 'http://', 7)!=0&&strncmp($url, 'https://', 8)!=0) { |
| 146 | 150 | $url=$this->getUrl($url); |
| 147 | 151 | } |
@@ -161,8 +165,9 @@ discard block |
||
| 161 | 165 | public static function _implodeParams($parameters){ |
| 162 | 166 | $allParameters=[]; |
| 163 | 167 | foreach ($parameters as $params){ |
| 164 | - if(isset($params)) |
|
| 165 | - $allParameters[]=self::_correctParams($params); |
|
| 168 | + if(isset($params)) { |
|
| 169 | + $allParameters[]=self::_correctParams($params); |
|
| 170 | + } |
|
| 166 | 171 | } |
| 167 | 172 | return \implode("+'&'+", $allParameters); |
| 168 | 173 | } |
@@ -188,8 +193,9 @@ discard block |
||
| 188 | 193 | |
| 189 | 194 | protected function setDefaultParameters(&$parameters,$default){ |
| 190 | 195 | foreach ($default as $k=>$v){ |
| 191 | - if(!isset($parameters[$k])) |
|
| 192 | - $parameters[$k]=$v; |
|
| 196 | + if(!isset($parameters[$k])) { |
|
| 197 | + $parameters[$k]=$v; |
|
| 198 | + } |
|
| 193 | 199 | } |
| 194 | 200 | } |
| 195 | 201 | |
@@ -307,7 +313,7 @@ discard block |
||
| 307 | 313 | if($context===null){ |
| 308 | 314 | $parent="$('".$maskSelector."').parent()"; |
| 309 | 315 | $newElm = "$('#'+newId)"; |
| 310 | - }else{ |
|
| 316 | + } else{ |
|
| 311 | 317 | $parent=$context; |
| 312 | 318 | $newElm = $context.".find('#'+newId)"; |
| 313 | 319 | } |
@@ -533,7 +539,7 @@ discard block |
||
| 533 | 539 | $retour.="var self=this;\n"; |
| 534 | 540 | if($hasLoader===true){ |
| 535 | 541 | $this->addLoading($retour, $responseElement,$ajaxLoader); |
| 536 | - }elseif($hasLoader==="internal"){ |
|
| 542 | + } elseif($hasLoader==="internal"){ |
|
| 537 | 543 | $retour.="\n$(this).addClass('loading');"; |
| 538 | 544 | } |
| 539 | 545 | $ajaxParameters=["url"=>"url","method"=>"'POST'","data"=>"params","async"=>$async]; |
@@ -551,8 +557,9 @@ discard block |
||
| 551 | 557 | $retour.="$('#".$form."').submit();\n"; |
| 552 | 558 | } |
| 553 | 559 | $retour=$this->_addJsCondition($jsCondition, $retour); |
| 554 | - if ($immediatly) |
|
| 555 | - $this->jquery_code_for_compile[]=$retour; |
|
| 560 | + if ($immediatly) { |
|
| 561 | + $this->jquery_code_for_compile[]=$retour; |
|
| 562 | + } |
|
| 556 | 563 | return $retour; |
| 557 | 564 | } |
| 558 | 565 | |