@@ -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 |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | $retour.="var self=this;\n"; |
39 | 39 | if($hasLoader===true && JString::isNotNull($responseElement)){ |
40 | 40 | $this->addLoading($retour, $responseElement,$ajaxLoader); |
41 | - }elseif($hasLoader==="internal"){ |
|
41 | + } elseif($hasLoader==="internal"){ |
|
42 | 42 | $retour.="\n$(this).addClass('loading');"; |
43 | 43 | } |
44 | 44 | $ajaxParameters=["url"=>"url","method"=>"'".\strtoupper($method)."'"]; |
@@ -55,8 +55,9 @@ discard block |
||
55 | 55 | $retour.="$.ajax({".$this->implodeAjaxParameters($ajaxParameters)."}).done(function( data, textStatus, jqXHR ) {\n"; |
56 | 56 | $retour.=$this->_getOnAjaxDone($responseElement, $jqueryDone,$ajaxTransition,$jsCallback,$hasLoader)."});\n"; |
57 | 57 | $retour=$this->_addJsCondition($jsCondition,$retour); |
58 | - if ($immediatly) |
|
59 | - $this->jquery_code_for_compile[]=$retour; |
|
58 | + if ($immediatly) { |
|
59 | + $this->jquery_code_for_compile[]=$retour; |
|
60 | + } |
|
60 | 61 | return $retour; |
61 | 62 | } |
62 | 63 | |
@@ -92,12 +93,13 @@ discard block |
||
92 | 93 | if(JString::isNotNull($attr)){ |
93 | 94 | if ($attr==="value"){ |
94 | 95 | $retour.="url=url+'".$slash."'+$(this).val();\n"; |
95 | - }elseif ($attr==="html"){ |
|
96 | + } elseif ($attr==="html"){ |
|
96 | 97 | $retour.="url=url+'".$slash."'+$(this).html();\n"; |
97 | - }elseif(\substr($attr, 0,3)==="js:"){ |
|
98 | + } elseif(\substr($attr, 0,3)==="js:"){ |
|
98 | 99 | $retour.="url=url+'".$slash."'+".\substr($attr, 3).";\n"; |
99 | - }elseif($attr!==null && $attr!=="") |
|
100 | - $retour.="url=url+'".$slash."'+($(this).attr('".$attr."')||'');\n"; |
|
100 | + } elseif($attr!==null && $attr!=="") { |
|
101 | + $retour.="url=url+'".$slash."'+($(this).attr('".$attr."')||'');\n"; |
|
102 | + } |
|
101 | 103 | } |
102 | 104 | return $retour; |
103 | 105 | } |
@@ -107,13 +109,14 @@ discard block |
||
107 | 109 | if (JString::isNotNull($responseElement)) { |
108 | 110 | if(isset($ajaxTransition)){ |
109 | 111 | $call=$this->setAjaxDataCall($ajaxTransition); |
110 | - }elseif(isset($this->ajaxTransition)){ |
|
112 | + } elseif(isset($this->ajaxTransition)){ |
|
111 | 113 | $call=$this->ajaxTransition; |
112 | 114 | } |
113 | - if(\is_callable($call)) |
|
114 | - $retour="\t".$call($responseElement,$jqueryDone).";\n"; |
|
115 | - else |
|
116 | - $retour="\t{$responseElement}.{$jqueryDone}( data );\n"; |
|
115 | + if(\is_callable($call)) { |
|
116 | + $retour="\t".$call($responseElement,$jqueryDone).";\n"; |
|
117 | + } else { |
|
118 | + $retour="\t{$responseElement}.{$jqueryDone}( data );\n"; |
|
119 | + } |
|
117 | 120 | } |
118 | 121 | if($hasLoader==="internal"){ |
119 | 122 | $retour.="\n$(self).removeClass('loading');"; |
@@ -131,8 +134,9 @@ discard block |
||
131 | 134 | } |
132 | 135 | |
133 | 136 | protected function _correctAjaxUrl($url) { |
134 | - if ($url!=="/" && JString::endsWith($url, "/")===true) |
|
135 | - $url=substr($url, 0, strlen($url)-1); |
|
137 | + if ($url!=="/" && JString::endsWith($url, "/")===true) { |
|
138 | + $url=substr($url, 0, strlen($url)-1); |
|
139 | + } |
|
136 | 140 | if (strncmp($url, 'http://', 7)!=0&&strncmp($url, 'https://', 8)!=0) { |
137 | 141 | $url=$this->getUrl($url); |
138 | 142 | } |
@@ -152,8 +156,9 @@ discard block |
||
152 | 156 | public static function _implodeParams($parameters){ |
153 | 157 | $allParameters=[]; |
154 | 158 | foreach ($parameters as $params){ |
155 | - if(isset($params)) |
|
156 | - $allParameters[]=self::_correctParams($params); |
|
159 | + if(isset($params)) { |
|
160 | + $allParameters[]=self::_correctParams($params); |
|
161 | + } |
|
157 | 162 | } |
158 | 163 | return \implode("+'&'+", $allParameters); |
159 | 164 | } |
@@ -179,8 +184,9 @@ discard block |
||
179 | 184 | |
180 | 185 | protected function setDefaultParameters(&$parameters,$default){ |
181 | 186 | foreach ($default as $k=>$v){ |
182 | - if(!isset($parameters[$k])) |
|
183 | - $parameters[$k]=$v; |
|
187 | + if(!isset($parameters[$k])) { |
|
188 | + $parameters[$k]=$v; |
|
189 | + } |
|
184 | 190 | } |
185 | 191 | } |
186 | 192 | |
@@ -298,7 +304,7 @@ discard block |
||
298 | 304 | if($context===null){ |
299 | 305 | $parent="$('".$maskSelector."').parent()"; |
300 | 306 | $newElm = "$('#'+newId)"; |
301 | - }else{ |
|
307 | + } else{ |
|
302 | 308 | $parent=$context; |
303 | 309 | $newElm = $context.".find('#'+newId)"; |
304 | 310 | } |
@@ -485,7 +491,7 @@ discard block |
||
485 | 491 | $retour.="var self=this;\n"; |
486 | 492 | if($hasLoader===true){ |
487 | 493 | $this->addLoading($retour, $responseElement,$ajaxLoader); |
488 | - }elseif($hasLoader==="internal"){ |
|
494 | + } elseif($hasLoader==="internal"){ |
|
489 | 495 | $retour.="\n$(this).addClass('loading');"; |
490 | 496 | } |
491 | 497 | $ajaxParameters=["url"=>"url","method"=>"'POST'","data"=>"params","async"=>$async]; |
@@ -503,8 +509,9 @@ discard block |
||
503 | 509 | $retour.="$('#".$form."').submit();\n"; |
504 | 510 | } |
505 | 511 | $retour=$this->_addJsCondition($jsCondition, $retour); |
506 | - if ($immediatly) |
|
507 | - $this->jquery_code_for_compile[]=$retour; |
|
512 | + if ($immediatly) { |
|
513 | + $this->jquery_code_for_compile[]=$retour; |
|
514 | + } |
|
508 | 515 | return $retour; |
509 | 516 | } |
510 | 517 |
@@ -17,8 +17,9 @@ discard block |
||
17 | 17 | * @param mixed $view |
18 | 18 | */ |
19 | 19 | protected function _compileLibrary(BaseGui $library, &$view=NULL){ |
20 | - if(isset($view)) |
|
21 | - $library->compileHtml($this, $view); |
|
20 | + if(isset($view)) { |
|
21 | + $library->compileHtml($this, $view); |
|
22 | + } |
|
22 | 23 | if ($library->isAutoCompile()) { |
23 | 24 | $library->compile(true); |
24 | 25 | } |
@@ -37,7 +38,9 @@ discard block |
||
37 | 38 | } |
38 | 39 | |
39 | 40 | protected function minify($input) { |
40 | - if(trim($input) === "") return $input; |
|
41 | + if(trim($input) === "") { |
|
42 | + return $input; |
|
43 | + } |
|
41 | 44 | return Minify::minifyJavascript($input); |
42 | 45 | } |
43 | 46 |