@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | $title=JArray::getValue($content, "title",1); |
19 | 19 | $desc=JArray::getValue($content, "description",2); |
20 | 20 | $status=JArray::getValue($content, "status",3); |
21 | - }else{ |
|
21 | + } else{ |
|
22 | 22 | $icon=@$content["icon"]; |
23 | 23 | $title=@$content["title"]; |
24 | 24 | $desc=@$content["description"]; |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | if(isset($title)===true){ |
34 | 34 | $this->setTitle($title,$desc); |
35 | 35 | } |
36 | - }else{ |
|
36 | + } else{ |
|
37 | 37 | $this->setContent($content); |
38 | 38 | } |
39 | 39 | } |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | $icon=@$content[0]; |
18 | 18 | $title=@$content[1]; |
19 | 19 | $desc=@$content[2]; |
20 | - }else{ |
|
20 | + } else{ |
|
21 | 21 | $icon=@$content["icon"]; |
22 | 22 | $image=@$content["image"]; |
23 | 23 | $title=@$content["title"]; |
@@ -33,13 +33,13 @@ discard block |
||
33 | 33 | } |
34 | 34 | if(isset($title)===true){ |
35 | 35 | $this->setTitle($title,$desc); |
36 | - }elseif (isset($header)===true){ |
|
36 | + } elseif (isset($header)===true){ |
|
37 | 37 | $this->setTitle($header,$desc,"header"); |
38 | 38 | } |
39 | 39 | if(isset($items)===true){ |
40 | 40 | $this->addList($items); |
41 | 41 | } |
42 | - }else{ |
|
42 | + } else{ |
|
43 | 43 | $this->setContent($content); |
44 | 44 | } |
45 | 45 | } |
@@ -60,8 +60,9 @@ discard block |
||
60 | 60 | |
61 | 61 | public function asLink($href=NULL,$part=NULL){ |
62 | 62 | $this->setTagName("a"); |
63 | - if(isset($href)) |
|
64 | - $this->setProperty("href", $href); |
|
63 | + if(isset($href)) { |
|
64 | + $this->setProperty("href", $href); |
|
65 | + } |
|
65 | 66 | return $this; |
66 | 67 | } |
67 | 68 | |
@@ -72,8 +73,9 @@ discard block |
||
72 | 73 | * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::compile() |
73 | 74 | */ |
74 | 75 | public function compile(JsUtils $js=NULL, $view=NULL) { |
75 | - if(\is_array($this->content)) |
|
76 | - $this->content=JArray::sortAssociative($this->content, [ "icon","image","content" ]); |
|
76 | + if(\is_array($this->content)) { |
|
77 | + $this->content=JArray::sortAssociative($this->content, [ "icon","image","content" ]); |
|
78 | + } |
|
77 | 79 | return parent::compile($js, $view); |
78 | 80 | } |
79 | 81 | } |
80 | 82 | \ No newline at end of file |
@@ -56,8 +56,9 @@ |
||
56 | 56 | if(\sizeof($params)>0 || \strtolower($action)!="index" ){ |
57 | 57 | $items[]=$action; |
58 | 58 | foreach ($params as $p){ |
59 | - if(\is_object($p)===false) |
|
60 | - $items[]=$p; |
|
59 | + if(\is_object($p)===false) { |
|
60 | + $items[]=$p; |
|
61 | + } |
|
61 | 62 | } |
62 | 63 | } |
63 | 64 | return $items; |
@@ -147,10 +147,12 @@ discard block |
||
147 | 147 | if (isset($param)) { |
148 | 148 | $param=$this->_prep_value($param); |
149 | 149 | $str="$({$element}).{$jQueryCall}({$param});"; |
150 | - } else |
|
151 | - $str="$({$element}).{$jQueryCall}();"; |
|
152 | - if ($immediatly) |
|
153 | - $this->jquery_code_for_compile[]=$str; |
|
150 | + } else { |
|
151 | + $str="$({$element}).{$jQueryCall}();"; |
|
152 | + } |
|
153 | + if ($immediatly) { |
|
154 | + $this->jquery_code_for_compile[]=$str; |
|
155 | + } |
|
154 | 156 | return $str; |
155 | 157 | } |
156 | 158 | /** |
@@ -165,8 +167,9 @@ discard block |
||
165 | 167 | $to=$this->_prep_element($to); |
166 | 168 | $element=$this->_prep_element($element); |
167 | 169 | $str="$({$to}).{$jQueryCall}({$element});"; |
168 | - if ($immediatly) |
|
169 | - $this->jquery_code_for_compile[]=$str; |
|
170 | + if ($immediatly) { |
|
171 | + $this->jquery_code_for_compile[]=$str; |
|
172 | + } |
|
170 | 173 | return $str; |
171 | 174 | } |
172 | 175 | |
@@ -222,12 +225,14 @@ discard block |
||
222 | 225 | if ($stopPropagation===true) { |
223 | 226 | $js="event.stopPropagation();\n".$js; |
224 | 227 | } |
225 | - if (array_search($event, $this->jquery_events)===false) |
|
226 | - $event="\n\t$(".$this->_prep_element($element).").bind('{$event}',function(event){\n\t\t{$js}\n\t});\n"; |
|
227 | - else |
|
228 | - $event="\n\t$(".$this->_prep_element($element).").{$event}(function(event){\n\t\t{$js}\n\t});\n"; |
|
229 | - if($immediatly) |
|
230 | - $this->jquery_code_for_compile[]=$event; |
|
228 | + if (array_search($event, $this->jquery_events)===false) { |
|
229 | + $event="\n\t$(".$this->_prep_element($element).").bind('{$event}',function(event){\n\t\t{$js}\n\t});\n"; |
|
230 | + } else { |
|
231 | + $event="\n\t$(".$this->_prep_element($element).").{$event}(function(event){\n\t\t{$js}\n\t});\n"; |
|
232 | + } |
|
233 | + if($immediatly) { |
|
234 | + $this->jquery_code_for_compile[]=$event; |
|
235 | + } |
|
231 | 236 | return $event; |
232 | 237 | } |
233 | 238 | |
@@ -286,8 +291,9 @@ discard block |
||
286 | 291 | } |
287 | 292 | $output=($script_tags===FALSE) ? $script : $this->inline($script); |
288 | 293 | |
289 | - if ($view!=NULL) |
|
290 | - $this->jsUtils->createScriptVariable($view,$view_var, $output); |
|
294 | + if ($view!=NULL) { |
|
295 | + $this->jsUtils->createScriptVariable($view,$view_var, $output); |
|
296 | + } |
|
291 | 297 | return $output; |
292 | 298 | } |
293 | 299 | |
@@ -354,7 +360,9 @@ discard block |
||
354 | 360 | } |
355 | 361 | |
356 | 362 | private function minify($input) { |
357 | - if(trim($input) === "") return $input; |
|
363 | + if(trim($input) === "") { |
|
364 | + return $input; |
|
365 | + } |
|
358 | 366 | return preg_replace( |
359 | 367 | array( |
360 | 368 | // Remove comment(s) |
@@ -165,8 +165,9 @@ discard block |
||
165 | 165 | |
166 | 166 | public function _ajaxOn($operation, $event, $url, $responseElement="", $parameters=array()) { |
167 | 167 | foreach ( $this->content as $element ) { |
168 | - if ($element->getProperty($this->attr) != NULL) |
|
169 | - $element->_ajaxOn($operation, $event, $url, $responseElement, $parameters); |
|
168 | + if ($element->getProperty($this->attr) != NULL) { |
|
169 | + $element->_ajaxOn($operation, $event, $url, $responseElement, $parameters); |
|
170 | + } |
|
170 | 171 | } |
171 | 172 | return $this; |
172 | 173 | } |
@@ -180,9 +181,9 @@ discard block |
||
180 | 181 | protected function createItem($value) { |
181 | 182 | $count=$this->count(); |
182 | 183 | $itemO=new HtmlSemDoubleElement("item-" . $this->identifier . "-" . $count, "a", "section"); |
183 | - if (\is_array($value)) |
|
184 | - $itemO->fromArray($value); |
|
185 | - else { |
|
184 | + if (\is_array($value)) { |
|
185 | + $itemO->fromArray($value); |
|
186 | + } else { |
|
186 | 187 | $itemO->setContent($value); |
187 | 188 | } |
188 | 189 | return $itemO; |
@@ -6,8 +6,9 @@ |
||
6 | 6 | |
7 | 7 | class JsUtils extends \Ajax\JsUtils{ |
8 | 8 | public function getUrl($url){ |
9 | - if($url==="") |
|
10 | - $url="/"; |
|
9 | + if($url==="") { |
|
10 | + $url="/"; |
|
11 | + } |
|
11 | 12 | return Url::toRoute($url); |
12 | 13 | } |
13 | 14 |
@@ -40,8 +40,9 @@ discard block |
||
40 | 40 | } |
41 | 41 | $retour.="$.".$method."(url,".$params.").done(function( data ) {\n"; |
42 | 42 | $retour.=$this->_getOnAjaxDone($responseElement, $jsCallback)."});\n"; |
43 | - if ($immediatly) |
|
44 | - $this->jquery_code_for_compile[]=$retour; |
|
43 | + if ($immediatly) { |
|
44 | + $this->jquery_code_for_compile[]=$retour; |
|
45 | + } |
|
45 | 46 | return $retour; |
46 | 47 | } |
47 | 48 | |
@@ -49,13 +50,15 @@ discard block |
||
49 | 50 | $url=$this->_correctAjaxUrl($url); |
50 | 51 | $retour="url='".$url."';\n"; |
51 | 52 | $slash="/"; |
52 | - if(PhalconUtils::endsWith($url, "/")===true) |
|
53 | - $slash=""; |
|
53 | + if(PhalconUtils::endsWith($url, "/")===true) { |
|
54 | + $slash=""; |
|
55 | + } |
|
54 | 56 | if(JString::isNotNull($attr)){ |
55 | - if ($attr=="value") |
|
56 | - $retour.="url=url+'".$slash."'+$(this).val();\n"; |
|
57 | - else if($attr!=null && $attr!=="") |
|
58 | - $retour.="url=url+'".$slash."'+($(this).attr('".$attr."')||'');\n"; |
|
57 | + if ($attr=="value") { |
|
58 | + $retour.="url=url+'".$slash."'+$(this).val();\n"; |
|
59 | + } else if($attr!=null && $attr!=="") { |
|
60 | + $retour.="url=url+'".$slash."'+($(this).attr('".$attr."')||'');\n"; |
|
61 | + } |
|
59 | 62 | } |
60 | 63 | return $retour; |
61 | 64 | } |
@@ -77,8 +80,9 @@ discard block |
||
77 | 80 | } |
78 | 81 | |
79 | 82 | protected function _correctAjaxUrl($url) { |
80 | - if ($url!=="/" && JString::endsWith($url, "/")===true) |
|
81 | - $url=substr($url, 0, strlen($url)-1); |
|
83 | + if ($url!=="/" && JString::endsWith($url, "/")===true) { |
|
84 | + $url=substr($url, 0, strlen($url)-1); |
|
85 | + } |
|
82 | 86 | if (strncmp($url, 'http://', 7)!=0&&strncmp($url, 'https://', 8)!=0) { |
83 | 87 | $url=$this->jsUtils->getUrl($url); |
84 | 88 | } |
@@ -102,8 +106,9 @@ discard block |
||
102 | 106 | $retour.="\t".$jsCallback."\n". |
103 | 107 | "\t$(document).trigger('jsonReady',[data]);\n". |
104 | 108 | "});\n"; |
105 | - if ($immediatly) |
|
106 | - $this->jquery_code_for_compile[]=$retour; |
|
109 | + if ($immediatly) { |
|
110 | + $this->jquery_code_for_compile[]=$retour; |
|
111 | + } |
|
107 | 112 | return $retour; |
108 | 113 | } |
109 | 114 | |
@@ -142,7 +147,7 @@ discard block |
||
142 | 147 | if($context===null){ |
143 | 148 | $appendTo="\t\tnewElm.appendTo($('".$maskSelector."').parent());\n"; |
144 | 149 | $newElm = "$('#'+newId)"; |
145 | - }else{ |
|
150 | + } else{ |
|
146 | 151 | $appendTo="\t\tnewElm.appendTo(".$context.");\n"; |
147 | 152 | $newElm = $context.".find('#'+newId)"; |
148 | 153 | } |
@@ -152,8 +157,9 @@ discard block |
||
152 | 157 | $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"; |
153 | 158 | $retour.="\t$(document).trigger('jsonReady',[data]);\n"; |
154 | 159 | $retour.="\t".$jsCallback."\n"."});\n"; |
155 | - if ($immediatly) |
|
156 | - $this->jquery_code_for_compile[]=$retour; |
|
160 | + if ($immediatly) { |
|
161 | + $this->jquery_code_for_compile[]=$retour; |
|
162 | + } |
|
157 | 163 | return $retour; |
158 | 164 | } |
159 | 165 | /** |
@@ -194,8 +200,9 @@ discard block |
||
194 | 200 | }});\n"; |
195 | 201 | $retour.="$('#".$form."').submit();\n"; |
196 | 202 | } |
197 | - if ($immediatly) |
|
198 | - $this->jquery_code_for_compile[]=$retour; |
|
203 | + if ($immediatly) { |
|
204 | + $this->jquery_code_for_compile[]=$retour; |
|
205 | + } |
|
199 | 206 | return $retour; |
200 | 207 | } |
201 | 208 |