@@ -69,7 +69,8 @@ |
||
69 | 69 | } |
70 | 70 | |
71 | 71 | public function getPanel($index) { |
72 | - if ($index<sizeof($this->content)) |
|
73 | - return $this->content [$index]; |
|
72 | + if ($index<sizeof($this->content)) { |
|
73 | + return $this->content [$index]; |
|
74 | + } |
|
74 | 75 | } |
75 | 76 | } |
@@ -89,8 +89,9 @@ discard block |
||
89 | 89 | * @return \Ajax\bootstrap\html\HtmlPanel default : "panel-default" |
90 | 90 | */ |
91 | 91 | public function setStyle($cssStyle) { |
92 | - if (!PhalconUtils::startsWith($cssStyle, "panel")) |
|
93 | - $cssStyle="panel".$cssStyle; |
|
92 | + if (!PhalconUtils::startsWith($cssStyle, "panel")) { |
|
93 | + $cssStyle="panel".$cssStyle; |
|
94 | + } |
|
94 | 95 | return $this->addToPropertyCtrl("class", $cssStyle, CssRef::Styles("panel")); |
95 | 96 | } |
96 | 97 | |
@@ -132,7 +133,8 @@ discard block |
||
132 | 133 | * @return $this default : false |
133 | 134 | */ |
134 | 135 | public function show($value) { |
135 | - if ($this->_collapsable) |
|
136 | - $this->_showOnStartup=$value; |
|
136 | + if ($this->_collapsable) { |
|
137 | + $this->_showOnStartup=$value; |
|
138 | + } |
|
137 | 139 | } |
138 | 140 | } |
@@ -30,16 +30,18 @@ |
||
30 | 30 | public function compile(JsUtils $js=NULL, &$view=NULL) { |
31 | 31 | $result=""; |
32 | 32 | foreach ( $this->_elements as $element ) { |
33 | - if ($element instanceof PhBsElement) |
|
34 | - $result.=$element->compile($js, $view); |
|
33 | + if ($element instanceof PhBsElement) { |
|
34 | + $result.=$element->compile($js, $view); |
|
35 | + } |
|
35 | 36 | } |
36 | 37 | return $result; |
37 | 38 | } |
38 | 39 | |
39 | 40 | public function run(JsUtils $js) { |
40 | 41 | foreach ( $this->_elements as $element ) { |
41 | - if ($element instanceof PhBsElement) |
|
42 | - $element->run($js); |
|
42 | + if ($element instanceof PhBsElement) { |
|
43 | + $element->run($js); |
|
44 | + } |
|
43 | 45 | } |
44 | 46 | } |
45 | 47 | } |
@@ -36,8 +36,9 @@ discard block |
||
36 | 36 | } |
37 | 37 | |
38 | 38 | public function getTab($index) { |
39 | - if ($index>0&&$index<sizeof($this->tabs)) |
|
40 | - return $this->tabs [$index]; |
|
39 | + if ($index>0&&$index<sizeof($this->tabs)) { |
|
40 | + return $this->tabs [$index]; |
|
41 | + } |
|
41 | 42 | } |
42 | 43 | |
43 | 44 | public function show($index) { |
@@ -53,8 +54,9 @@ discard block |
||
53 | 54 | */ |
54 | 55 | public function onShow($index, $jsCode) { |
55 | 56 | $tab=$this->getTab($index); |
56 | - if (isset($tab)) |
|
57 | - return $tab->onShow($jsCode); |
|
57 | + if (isset($tab)) { |
|
58 | + return $tab->onShow($jsCode); |
|
59 | + } |
|
58 | 60 | } |
59 | 61 | |
60 | 62 | /** |
@@ -65,8 +67,9 @@ discard block |
||
65 | 67 | */ |
66 | 68 | public function onShown($index, $jsCode) { |
67 | 69 | $tab=$this->getTab($index); |
68 | - if (isset($tab)) |
|
69 | - return $tab->onShown($jsCode); |
|
70 | + if (isset($tab)) { |
|
71 | + return $tab->onShown($jsCode); |
|
72 | + } |
|
70 | 73 | } |
71 | 74 | |
72 | 75 | /** |
@@ -77,8 +80,9 @@ discard block |
||
77 | 80 | */ |
78 | 81 | public function onHide($index, $jsCode) { |
79 | 82 | $tab=$this->getTab($index); |
80 | - if (isset($tab)) |
|
81 | - return $tab->onShow($jsCode); |
|
83 | + if (isset($tab)) { |
|
84 | + return $tab->onShow($jsCode); |
|
85 | + } |
|
82 | 86 | } |
83 | 87 | |
84 | 88 | /** |
@@ -89,7 +93,8 @@ discard block |
||
89 | 93 | */ |
90 | 94 | public function onHidden($index, $jsCode) { |
91 | 95 | $tab=$this->getTab($index); |
92 | - if (isset($tab)) |
|
93 | - return $tab->onShow($jsCode); |
|
96 | + if (isset($tab)) { |
|
97 | + return $tab->onShow($jsCode); |
|
98 | + } |
|
94 | 99 | } |
95 | 100 | } |
@@ -23,8 +23,9 @@ discard block |
||
23 | 23 | $this->widgetIdentifier=$identifier; |
24 | 24 | $this->values=[]; |
25 | 25 | $this->afterCompile=[]; |
26 | - if(isset($instance)) |
|
27 | - $this->setInstance($instance); |
|
26 | + if(isset($instance)) { |
|
27 | + $this->setInstance($instance); |
|
28 | + } |
|
28 | 29 | $this->setCaptions($captions); |
29 | 30 | $this->captionCallback=NULL; |
30 | 31 | $this->defaultValueFunction=function($name,$value){return $value;}; |
@@ -62,14 +63,16 @@ discard block |
||
62 | 63 | } |
63 | 64 | |
64 | 65 | public function getIdentifier($index=NULL){ |
65 | - if(!isset($index)) |
|
66 | - $index=self::$index; |
|
66 | + if(!isset($index)) { |
|
67 | + $index=self::$index; |
|
68 | + } |
|
67 | 69 | $value=$index; |
68 | 70 | if(isset($this->values["identifier"])){ |
69 | - if(\is_string($this->values["identifier"])) |
|
70 | - $value=JReflection::callMethod($this->instance, $this->values["identifier"], []); |
|
71 | - else |
|
72 | - $value=$this->values["identifier"]($index,$this->instance); |
|
71 | + if(\is_string($this->values["identifier"])) { |
|
72 | + $value=JReflection::callMethod($this->instance, $this->values["identifier"], []); |
|
73 | + } else { |
|
74 | + $value=$this->values["identifier"]($index,$this->instance); |
|
75 | + } |
|
73 | 76 | } |
74 | 77 | return $value; |
75 | 78 | } |
@@ -99,16 +102,16 @@ discard block |
||
99 | 102 | if($property instanceof \ReflectionProperty){ |
100 | 103 | $value=$this->_getPropertyValue($property, $index); |
101 | 104 | $propertyName=$property->getName(); |
102 | - }elseif(\is_callable($property)) |
|
103 | - $value=$property($this->instance); |
|
104 | - elseif(\is_array($property)){ |
|
105 | + } elseif(\is_callable($property)) { |
|
106 | + $value=$property($this->instance); |
|
107 | + } elseif(\is_array($property)){ |
|
105 | 108 | $values=\array_map(function($v) use ($index){return $this->_getValue($v, $index);}, $property); |
106 | 109 | $value=\implode("", $values); |
107 | - }elseif(\is_string($property)){ |
|
110 | + } elseif(\is_string($property)){ |
|
108 | 111 | $value=$property; |
109 | 112 | if(isset($this->instance->{$property})){ |
110 | 113 | $value=$this->instance->{$property}; |
111 | - }elseif(\method_exists($this->instance, $getter=JReflection::getterName($property))){ |
|
114 | + } elseif(\method_exists($this->instance, $getter=JReflection::getterName($property))){ |
|
112 | 115 | $value=JReflection::callMethod($this->instance, $getter, []); |
113 | 116 | } |
114 | 117 | } |
@@ -118,7 +121,7 @@ discard block |
||
118 | 121 | protected function _postGetValue($index,$propertyName,$value){ |
119 | 122 | if(isset($this->values[$index])){ |
120 | 123 | $value= $this->values[$index]($value,$this->instance,$index); |
121 | - }else{ |
|
124 | + } else{ |
|
122 | 125 | $value=$this->_getDefaultValue($propertyName,$value, $index); |
123 | 126 | } |
124 | 127 | if(isset($this->afterCompile[$index])){ |
@@ -139,10 +142,10 @@ discard block |
||
139 | 142 | if(isset($vb[$index])){ |
140 | 143 | if(\is_array($vb[$index])){ |
141 | 144 | $this->visibleProperties[$index][]=$field; |
142 | - }else{ |
|
145 | + } else{ |
|
143 | 146 | $this->visibleProperties[$index]=[$vb[$index],$field]; |
144 | 147 | } |
145 | - }else{ |
|
148 | + } else{ |
|
146 | 149 | return $this->insertField($index, $field); |
147 | 150 | } |
148 | 151 | return $this; |
@@ -169,9 +172,9 @@ discard block |
||
169 | 172 | $property=$this->getProperty($index); |
170 | 173 | if($property instanceof \ReflectionProperty){ |
171 | 174 | $result=$property->getName(); |
172 | - }elseif(\is_callable($property)){ |
|
175 | + } elseif(\is_callable($property)){ |
|
173 | 176 | $result=$this->visibleProperties[$index]; |
174 | - }else{ |
|
177 | + } else{ |
|
175 | 178 | $result=$property; |
176 | 179 | } |
177 | 180 | return $result; |
@@ -191,7 +194,7 @@ discard block |
||
191 | 194 | $this->reflect=new \ReflectionClass($instance); |
192 | 195 | if(\sizeof($this->visibleProperties)===0){ |
193 | 196 | $this->properties=$this->getDefaultProperties(); |
194 | - }else{ |
|
197 | + } else{ |
|
195 | 198 | foreach ($this->visibleProperties as $property){ |
196 | 199 | $this->setInstanceProperty($property); |
197 | 200 | } |
@@ -202,22 +205,23 @@ discard block |
||
202 | 205 | private function setInstanceProperty($property){ |
203 | 206 | if(\is_callable($property)){ |
204 | 207 | $this->properties[]=$property; |
205 | - }elseif(\is_string($property)){ |
|
208 | + } elseif(\is_string($property)){ |
|
206 | 209 | try{ |
207 | 210 | $this->_beforeAddProperty(\sizeof($this->properties), $property); |
208 | 211 | $rProperty=$this->reflect->getProperty($property); |
209 | 212 | $this->properties[]=$rProperty; |
210 | - }catch(\Exception $e){ |
|
213 | + } catch(\Exception $e){ |
|
211 | 214 | $this->_beforeAddProperty(\sizeof($this->properties), $property); |
212 | 215 | $this->properties[]=$property; |
213 | 216 | } |
214 | - }elseif(\is_int($property)){ |
|
217 | + } elseif(\is_int($property)){ |
|
215 | 218 | $props=$this->getDefaultProperties(); |
216 | - if(isset($props[$property])) |
|
217 | - $this->properties[]=$props[$property]; |
|
218 | - else |
|
219 | - $this->properties[]=$property; |
|
220 | - }else{ |
|
219 | + if(isset($props[$property])) { |
|
220 | + $this->properties[]=$props[$property]; |
|
221 | + } else { |
|
222 | + $this->properties[]=$property; |
|
223 | + } |
|
224 | + } else{ |
|
221 | 225 | $this->properties[]=$property; |
222 | 226 | } |
223 | 227 | } |
@@ -261,12 +265,13 @@ discard block |
||
261 | 265 | if(isset($this->captions[$index])){ |
262 | 266 | return $this->captions[$index]; |
263 | 267 | } |
264 | - if($this->properties[$index] instanceof \ReflectionProperty) |
|
265 | - return $this->properties[$index]->getName(); |
|
266 | - elseif(\is_callable($this->properties[$index])) |
|
267 | - return ""; |
|
268 | - else |
|
269 | - return $this->properties[$index]; |
|
268 | + if($this->properties[$index] instanceof \ReflectionProperty) { |
|
269 | + return $this->properties[$index]->getName(); |
|
270 | + } elseif(\is_callable($this->properties[$index])) { |
|
271 | + return ""; |
|
272 | + } else { |
|
273 | + return $this->properties[$index]; |
|
274 | + } |
|
270 | 275 | } |
271 | 276 | |
272 | 277 | public function getCaptions(){ |
@@ -276,7 +281,7 @@ discard block |
||
276 | 281 | for($i=$captionsSize;$i<$this->count();$i++){ |
277 | 282 | $captions[]=""; |
278 | 283 | } |
279 | - }else{ |
|
284 | + } else{ |
|
280 | 285 | $captions=[]; |
281 | 286 | $index=0; |
282 | 287 | $count=$this->count(); |
@@ -292,8 +297,9 @@ discard block |
||
292 | 297 | } |
293 | 298 | |
294 | 299 | public function setCaption($index,$caption){ |
295 | - if(isset($this->captions)===false) |
|
296 | - $this->captions=[]; |
|
300 | + if(isset($this->captions)===false) { |
|
301 | + $this->captions=[]; |
|
302 | + } |
|
297 | 303 | $this->captions[$index]=$caption; |
298 | 304 | return $this; |
299 | 305 | } |
@@ -29,8 +29,9 @@ discard block |
||
29 | 29 | } |
30 | 30 | $retour.="$.".$method."(url,".$params.").done(function( data ) {\n"; |
31 | 31 | $retour.=$this->_getOnAjaxDone($responseElement, $jqueryDone,$ajaxTransition,$jsCallback)."});\n"; |
32 | - if ($immediatly) |
|
33 | - $this->jquery_code_for_compile[]=$retour; |
|
32 | + if ($immediatly) { |
|
33 | + $this->jquery_code_for_compile[]=$retour; |
|
34 | + } |
|
34 | 35 | return $retour; |
35 | 36 | } |
36 | 37 | |
@@ -40,15 +41,17 @@ discard block |
||
40 | 41 | $url=$this->_correctAjaxUrl($url); |
41 | 42 | $retour="url='".$url."';"; |
42 | 43 | $slash="/"; |
43 | - if(JString::endswith($url, "/")===true) |
|
44 | - $slash=""; |
|
44 | + if(JString::endswith($url, "/")===true) { |
|
45 | + $slash=""; |
|
46 | + } |
|
45 | 47 | if(JString::isNotNull($attr)){ |
46 | - if ($attr==="value") |
|
47 | - $retour.="url=url+'".$slash."'+$(this).val();\n"; |
|
48 | - elseif ($attr==="html") |
|
49 | - $retour.="url=url+'".$slash."'+$(this).html();\n"; |
|
50 | - elseif($attr!==null && $attr!=="") |
|
51 | - $retour.="url=url+'".$slash."'+($(this).attr('".$attr."')||'');\n"; |
|
48 | + if ($attr==="value") { |
|
49 | + $retour.="url=url+'".$slash."'+$(this).val();\n"; |
|
50 | + } elseif ($attr==="html") { |
|
51 | + $retour.="url=url+'".$slash."'+$(this).html();\n"; |
|
52 | + } elseif($attr!==null && $attr!=="") { |
|
53 | + $retour.="url=url+'".$slash."'+($(this).attr('".$attr."')||'');\n"; |
|
54 | + } |
|
52 | 55 | } |
53 | 56 | return $retour; |
54 | 57 | } |
@@ -58,13 +61,14 @@ discard block |
||
58 | 61 | if ($responseElement!=="") { |
59 | 62 | if(isset($ajaxTransition)){ |
60 | 63 | $call=$this->setAjaxDataCall($ajaxTransition); |
61 | - }elseif(isset($this->ajaxTransition)){ |
|
64 | + } elseif(isset($this->ajaxTransition)){ |
|
62 | 65 | $call=$this->ajaxTransition; |
63 | 66 | } |
64 | - if(\is_callable($call)) |
|
65 | - $retour="\t".$call($responseElement,$jqueryDone).";\n"; |
|
66 | - else |
|
67 | - $retour="\t$({$responseElement}).{$jqueryDone}( data );\n"; |
|
67 | + if(\is_callable($call)) { |
|
68 | + $retour="\t".$call($responseElement,$jqueryDone).";\n"; |
|
69 | + } else { |
|
70 | + $retour="\t$({$responseElement}).{$jqueryDone}( data );\n"; |
|
71 | + } |
|
68 | 72 | } |
69 | 73 | $retour.="\t".$jsCallback."\n"; |
70 | 74 | return $retour; |
@@ -78,8 +82,9 @@ discard block |
||
78 | 82 | } |
79 | 83 | |
80 | 84 | protected function _correctAjaxUrl($url) { |
81 | - if ($url!=="/" && JString::endsWith($url, "/")===true) |
|
82 | - $url=substr($url, 0, strlen($url)-1); |
|
85 | + if ($url!=="/" && JString::endsWith($url, "/")===true) { |
|
86 | + $url=substr($url, 0, strlen($url)-1); |
|
87 | + } |
|
83 | 88 | if (strncmp($url, 'http://', 7)!=0&&strncmp($url, 'https://', 8)!=0) { |
84 | 89 | $url=$this->getUrl($url); |
85 | 90 | } |
@@ -159,8 +164,9 @@ discard block |
||
159 | 164 | $retour.="\t".$jsCallback."\n". |
160 | 165 | "\t$(document).trigger('jsonReady',[data]);\n". |
161 | 166 | "});\n"; |
162 | - if ($immediatly) |
|
163 | - $this->jquery_code_for_compile[]=$retour; |
|
167 | + if ($immediatly) { |
|
168 | + $this->jquery_code_for_compile[]=$retour; |
|
169 | + } |
|
164 | 170 | return $retour; |
165 | 171 | } |
166 | 172 | |
@@ -225,7 +231,7 @@ discard block |
||
225 | 231 | if($context===null){ |
226 | 232 | $parent="$('".$maskSelector."').parent()"; |
227 | 233 | $newElm = "$('#'+newId)"; |
228 | - }else{ |
|
234 | + } else{ |
|
229 | 235 | $parent=$context; |
230 | 236 | $newElm = $context.".find('#'+newId)"; |
231 | 237 | } |
@@ -238,8 +244,9 @@ discard block |
||
238 | 244 | $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"; |
239 | 245 | $retour.="\t$(document).trigger('jsonReady',[data]);\n"; |
240 | 246 | $retour.="\t".$jsCallback."\n"."});\n"; |
241 | - if ($immediatly) |
|
242 | - $this->jquery_code_for_compile[]=$retour; |
|
247 | + if ($immediatly) { |
|
248 | + $this->jquery_code_for_compile[]=$retour; |
|
249 | + } |
|
243 | 250 | return $retour; |
244 | 251 | } |
245 | 252 | |
@@ -430,8 +437,9 @@ discard block |
||
430 | 437 | }});\n"; |
431 | 438 | $retour.="$('#".$form."').submit();\n"; |
432 | 439 | } |
433 | - if ($immediatly) |
|
434 | - $this->jquery_code_for_compile[]=$retour; |
|
440 | + if ($immediatly) { |
|
441 | + $this->jquery_code_for_compile[]=$retour; |
|
442 | + } |
|
435 | 443 | return $retour; |
436 | 444 | } |
437 | 445 |
@@ -40,10 +40,12 @@ discard block |
||
40 | 40 | if (isset($param)) { |
41 | 41 | $param=Javascript::prep_value($param); |
42 | 42 | $str="$({$element}).{$jQueryCall}({$param});"; |
43 | - } else |
|
44 | - $str="$({$element}).{$jQueryCall}();"; |
|
45 | - if ($immediatly) |
|
46 | - $this->jquery_code_for_compile[]=$str; |
|
43 | + } else { |
|
44 | + $str="$({$element}).{$jQueryCall}();"; |
|
45 | + } |
|
46 | + if ($immediatly) { |
|
47 | + $this->jquery_code_for_compile[]=$str; |
|
48 | + } |
|
47 | 49 | return $str; |
48 | 50 | } |
49 | 51 | |
@@ -59,8 +61,9 @@ discard block |
||
59 | 61 | $to=Javascript::prep_element($to); |
60 | 62 | $element=Javascript::prep_element($element); |
61 | 63 | $str="$({$to}).{$jQueryCall}({$element});"; |
62 | - if ($immediatly) |
|
63 | - $this->jquery_code_for_compile[]=$str; |
|
64 | + if ($immediatly) { |
|
65 | + $this->jquery_code_for_compile[]=$str; |
|
66 | + } |
|
64 | 67 | return $str; |
65 | 68 | } |
66 | 69 | /** |
@@ -109,10 +112,12 @@ discard block |
||
109 | 112 | if (isset($value)) { |
110 | 113 | $value=Javascript::prep_value($value); |
111 | 114 | $str="$({$element}).attr(\"$attributeName\",{$value});"; |
112 | - } else |
|
113 | - $str="$({$element}).attr(\"$attributeName\");"; |
|
114 | - if ($immediatly) |
|
115 | - $this->jquery_code_for_compile[]=$str; |
|
115 | + } else { |
|
116 | + $str="$({$element}).attr(\"$attributeName\");"; |
|
117 | + } |
|
118 | + if ($immediatly) { |
|
119 | + $this->jquery_code_for_compile[]=$str; |
|
120 | + } |
|
116 | 121 | return $str; |
117 | 122 | } |
118 | 123 | |
@@ -168,8 +173,9 @@ discard block |
||
168 | 173 | |
169 | 174 | $str="$({$element}).animate({\n$animations\n\t\t}".$speed.$extra.");"; |
170 | 175 | |
171 | - if ($immediatly) |
|
172 | - $this->jquery_code_for_compile[]=$str; |
|
176 | + if ($immediatly) { |
|
177 | + $this->jquery_code_for_compile[]=$str; |
|
178 | + } |
|
173 | 179 | return $str; |
174 | 180 | } |
175 | 181 | |
@@ -214,8 +220,9 @@ discard block |
||
214 | 220 | |
215 | 221 | $str="$({$element}).fadeIn({$speed}{$callback});"; |
216 | 222 | |
217 | - if ($immediatly) |
|
218 | - $this->jquery_code_for_compile[]=$str; |
|
223 | + if ($immediatly) { |
|
224 | + $this->jquery_code_for_compile[]=$str; |
|
225 | + } |
|
219 | 226 | return $str; |
220 | 227 | } |
221 | 228 | |
@@ -238,8 +245,9 @@ discard block |
||
238 | 245 | |
239 | 246 | $str="$({$element}).fadeOut({$speed}{$callback});"; |
240 | 247 | |
241 | - if ($immediatly) |
|
242 | - $this->jquery_code_for_compile[]=$str; |
|
248 | + if ($immediatly) { |
|
249 | + $this->jquery_code_for_compile[]=$str; |
|
250 | + } |
|
243 | 251 | return $str; |
244 | 252 | } |
245 | 253 | |
@@ -262,8 +270,9 @@ discard block |
||
262 | 270 | |
263 | 271 | $str="$({$element}).slideUp({$speed}{$callback});"; |
264 | 272 | |
265 | - if ($immediatly) |
|
266 | - $this->jquery_code_for_compile[]=$str; |
|
273 | + if ($immediatly) { |
|
274 | + $this->jquery_code_for_compile[]=$str; |
|
275 | + } |
|
267 | 276 | return $str; |
268 | 277 | } |
269 | 278 | |
@@ -298,8 +307,9 @@ discard block |
||
298 | 307 | |
299 | 308 | $str="$({$element}).slideDown({$speed}{$callback});"; |
300 | 309 | |
301 | - if ($immediatly) |
|
302 | - $this->jquery_code_for_compile[]=$str; |
|
310 | + if ($immediatly) { |
|
311 | + $this->jquery_code_for_compile[]=$str; |
|
312 | + } |
|
303 | 313 | return $str; |
304 | 314 | } |
305 | 315 | |
@@ -322,8 +332,9 @@ discard block |
||
322 | 332 | |
323 | 333 | $str="$({$element}).slideToggle({$speed}{$callback});"; |
324 | 334 | |
325 | - if ($immediatly) |
|
326 | - $this->jquery_code_for_compile[]=$str; |
|
335 | + if ($immediatly) { |
|
336 | + $this->jquery_code_for_compile[]=$str; |
|
337 | + } |
|
327 | 338 | return $str; |
328 | 339 | } |
329 | 340 | |
@@ -346,8 +357,9 @@ discard block |
||
346 | 357 | |
347 | 358 | $str="$({$element}).hide({$speed}{$callback});"; |
348 | 359 | |
349 | - if ($immediatly) |
|
350 | - $this->jquery_code_for_compile[]=$str; |
|
360 | + if ($immediatly) { |
|
361 | + $this->jquery_code_for_compile[]=$str; |
|
362 | + } |
|
351 | 363 | return $str; |
352 | 364 | } |
353 | 365 | |
@@ -362,8 +374,9 @@ discard block |
||
362 | 374 | $element=Javascript::prep_element($element); |
363 | 375 | $str="$({$element}).toggle();"; |
364 | 376 | |
365 | - if ($immediatly) |
|
366 | - $this->jquery_code_for_compile[]=$str; |
|
377 | + if ($immediatly) { |
|
378 | + $this->jquery_code_for_compile[]=$str; |
|
379 | + } |
|
367 | 380 | return $str; |
368 | 381 | } |
369 | 382 | |
@@ -388,8 +401,9 @@ discard block |
||
388 | 401 | $element=Javascript::prep_element($element); |
389 | 402 | $str="$({$element}).trigger(\"$event\");"; |
390 | 403 | |
391 | - if ($immediatly) |
|
392 | - $this->jquery_code_for_compile[]=$str; |
|
404 | + if ($immediatly) { |
|
405 | + $this->jquery_code_for_compile[]=$str; |
|
406 | + } |
|
393 | 407 | return $str; |
394 | 408 | } |
395 | 409 | |
@@ -412,8 +426,9 @@ discard block |
||
412 | 426 | |
413 | 427 | $str="$({$element}).show({$speed}{$callback});"; |
414 | 428 | |
415 | - if ($immediatly) |
|
416 | - $this->jquery_code_for_compile[]=$str; |
|
429 | + if ($immediatly) { |
|
430 | + $this->jquery_code_for_compile[]=$str; |
|
431 | + } |
|
417 | 432 | return $str; |
418 | 433 | } |
419 | 434 | |
@@ -462,8 +477,9 @@ discard block |
||
462 | 477 | $str.="else{".$jsCodeIfFalse."}"; |
463 | 478 | } |
464 | 479 | |
465 | - if ($immediatly) |
|
466 | - $this->jquery_code_for_compile[]=$str; |
|
480 | + if ($immediatly) { |
|
481 | + $this->jquery_code_for_compile[]=$str; |
|
482 | + } |
|
467 | 483 | return $str; |
468 | 484 | } |
469 | 485 | |
@@ -479,11 +495,13 @@ discard block |
||
479 | 495 | private function _doJQuery($element, $jqueryCall, $param="", $jsCallback="", $immediatly=false) { |
480 | 496 | $param=Javascript::prep_value($param); |
481 | 497 | $callback=""; |
482 | - if ($jsCallback!="") |
|
483 | - $callback=", function(event){\n{$jsCallback}\n}"; |
|
498 | + if ($jsCallback!="") { |
|
499 | + $callback=", function(event){\n{$jsCallback}\n}"; |
|
500 | + } |
|
484 | 501 | $script="$(".Javascript::prep_element($element).").".$jqueryCall."(".$param.$callback.");\n"; |
485 | - if ($immediatly) |
|
486 | - $this->jquery_code_for_compile[]=$script; |
|
502 | + if ($immediatly) { |
|
503 | + $this->jquery_code_for_compile[]=$script; |
|
504 | + } |
|
487 | 505 | return $script; |
488 | 506 | } |
489 | 507 | |
@@ -554,8 +572,9 @@ discard block |
||
554 | 572 | */ |
555 | 573 | public function exec($js, $immediatly=false) { |
556 | 574 | $script=$js."\n"; |
557 | - if ($immediatly) |
|
558 | - $this->jquery_code_for_compile[]=$script; |
|
575 | + if ($immediatly) { |
|
576 | + $this->jquery_code_for_compile[]=$script; |
|
577 | + } |
|
559 | 578 | return $script; |
560 | 579 | } |
561 | 580 |
@@ -34,12 +34,14 @@ |
||
34 | 34 | if ($stopPropagation===true) { |
35 | 35 | $js=Javascript::$stopPropagation.$js; |
36 | 36 | } |
37 | - if (array_search($event, $this->jquery_events)===false) |
|
38 | - $event="\n\t$(".Javascript::prep_element($element).").bind('{$event}',function(event){\n\t\t{$js}\n\t});\n"; |
|
39 | - else |
|
40 | - $event="\n\t$(".Javascript::prep_element($element).").{$event}(function(event){\n\t\t{$js}\n\t});\n"; |
|
41 | - if($immediatly) |
|
42 | - $this->jquery_code_for_compile[]=$event; |
|
37 | + if (array_search($event, $this->jquery_events)===false) { |
|
38 | + $event="\n\t$(".Javascript::prep_element($element).").bind('{$event}',function(event){\n\t\t{$js}\n\t});\n"; |
|
39 | + } else { |
|
40 | + $event="\n\t$(".Javascript::prep_element($element).").{$event}(function(event){\n\t\t{$js}\n\t});\n"; |
|
41 | + } |
|
42 | + if($immediatly) { |
|
43 | + $this->jquery_code_for_compile[]=$event; |
|
44 | + } |
|
43 | 45 | return $event; |
44 | 46 | } |
45 | 47 |
@@ -16,8 +16,9 @@ discard block |
||
16 | 16 | */ |
17 | 17 | private function _compileLibrary($library, &$view=NULL){ |
18 | 18 | if ($library!=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 | } |
@@ -37,7 +38,9 @@ discard block |
||
37 | 38 | } |
38 | 39 | |
39 | 40 | private function minify($input) { |
40 | - if(trim($input) === "") return $input; |
|
41 | + if(trim($input) === "") { |
|
42 | + return $input; |
|
43 | + } |
|
41 | 44 | return preg_replace( |
42 | 45 | array( |
43 | 46 | // Remove comment(s) |