@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | foreach ($items as $k=>$v){ |
23 | 23 | $this->addItem([$k,$v]); |
24 | 24 | } |
25 | - }else{ |
|
25 | + } else{ |
|
26 | 26 | foreach ($items as $item){ |
27 | 27 | $this->addItem($item); |
28 | 28 | } |
@@ -70,9 +70,9 @@ discard block |
||
70 | 70 | * @return \Ajax\common\html\HtmlDoubleElement |
71 | 71 | */ |
72 | 72 | public function getItem($index) { |
73 | - if (is_int($index)) |
|
74 | - return $this->content[$index]; |
|
75 | - else { |
|
73 | + if (is_int($index)) { |
|
74 | + return $this->content[$index]; |
|
75 | + } else { |
|
76 | 76 | $elm=$this->getElementById($index, $this->content); |
77 | 77 | return $elm; |
78 | 78 | } |
@@ -134,10 +134,11 @@ discard block |
||
134 | 134 | $i=0; |
135 | 135 | foreach ($properties as $k=>$v){ |
136 | 136 | $c=$this->content[$i++]; |
137 | - if(isset($c)) |
|
138 | - $c->setProperty($k,$v); |
|
139 | - else |
|
140 | - return $this; |
|
137 | + if(isset($c)) { |
|
138 | + $c->setProperty($k,$v); |
|
139 | + } else { |
|
140 | + return $this; |
|
141 | + } |
|
141 | 142 | } |
142 | 143 | return $this; |
143 | 144 | } |
@@ -151,8 +152,7 @@ discard block |
||
151 | 152 | $c=$this->content[$i++]; |
152 | 153 | if(isset($c)){ |
153 | 154 | $c->setProperty($property,$value); |
154 | - } |
|
155 | - else{ |
|
155 | + } else{ |
|
156 | 156 | return $this; |
157 | 157 | } |
158 | 158 | } |
@@ -12,18 +12,21 @@ |
||
12 | 12 | $this->setProperty("name", $identifier); |
13 | 13 | $this->setValue($value); |
14 | 14 | $this->setPlaceholder($placeholder); |
15 | - if(isset($rows)) |
|
16 | - $this->setRows($rows); |
|
15 | + if(isset($rows)) { |
|
16 | + $this->setRows($rows); |
|
17 | + } |
|
17 | 18 | } |
18 | 19 | public function setValue($value) { |
19 | - if(isset($value)) |
|
20 | - $this->setContent($value); |
|
20 | + if(isset($value)) { |
|
21 | + $this->setContent($value); |
|
22 | + } |
|
21 | 23 | return $this; |
22 | 24 | } |
23 | 25 | |
24 | 26 | public function setPlaceholder($value){ |
25 | - if(JString::isNotNull($value)) |
|
26 | - $this->setProperty("placeholder", $value); |
|
27 | + if(JString::isNotNull($value)) { |
|
28 | + $this->setProperty("placeholder", $value); |
|
29 | + } |
|
27 | 30 | return $this; |
28 | 31 | } |
29 | 32 |
@@ -29,15 +29,17 @@ |
||
29 | 29 | |
30 | 30 | public function addContent($content,$before=false) { |
31 | 31 | if (!\is_array($this->content)) { |
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 |
@@ -50,8 +50,9 @@ discard block |
||
50 | 50 | } |
51 | 51 | |
52 | 52 | public function getProperty($name) { |
53 | - if (array_key_exists($name, $this->properties)) |
|
54 | - return $this->properties[$name]; |
|
53 | + if (array_key_exists($name, $this->properties)) { |
|
54 | + return $this->properties[$name]; |
|
55 | + } |
|
55 | 56 | } |
56 | 57 | |
57 | 58 | public function addToProperty($name, $value, $separator=" ") { |
@@ -61,10 +62,11 @@ discard block |
||
61 | 62 | } |
62 | 63 | } else if ($value !== "" && $this->propertyContains($name, $value) === false) { |
63 | 64 | $v=@$this->properties[$name]; |
64 | - if (isset($v) && $v !== "") |
|
65 | - $v=$v . $separator . $value; |
|
66 | - else |
|
67 | - $v=$value; |
|
65 | + if (isset($v) && $v !== "") { |
|
66 | + $v=$v . $separator . $value; |
|
67 | + } else { |
|
68 | + $v=$value; |
|
69 | + } |
|
68 | 70 | |
69 | 71 | return $this->setProperty($name, $v); |
70 | 72 | } |
@@ -119,8 +121,9 @@ discard block |
||
119 | 121 | } |
120 | 122 | |
121 | 123 | protected function setPropertyCtrl($name, $value, $typeCtrl) { |
122 | - if ($this->ctrl($name, $value, $typeCtrl) === true) |
|
123 | - return $this->setProperty($name, $value); |
|
124 | + if ($this->ctrl($name, $value, $typeCtrl) === true) { |
|
125 | + return $this->setProperty($name, $value); |
|
126 | + } |
|
124 | 127 | return $this; |
125 | 128 | } |
126 | 129 | |
@@ -150,8 +153,9 @@ discard block |
||
150 | 153 | } |
151 | 154 | |
152 | 155 | public function removeProperty($name) { |
153 | - if (\array_key_exists($name, $this->properties)) |
|
154 | - unset($this->properties[$name]); |
|
156 | + if (\array_key_exists($name, $this->properties)) { |
|
157 | + unset($this->properties[$name]); |
|
158 | + } |
|
155 | 159 | return $this; |
156 | 160 | } |
157 | 161 | |
@@ -171,8 +175,9 @@ discard block |
||
171 | 175 | } |
172 | 176 | |
173 | 177 | protected function addToPropertyUnique($name, $value, $typeCtrl) { |
174 | - if (@class_exists($typeCtrl, true)) |
|
175 | - $typeCtrl=$typeCtrl::getConstants(); |
|
178 | + if (@class_exists($typeCtrl, true)) { |
|
179 | + $typeCtrl=$typeCtrl::getConstants(); |
|
180 | + } |
|
176 | 181 | if (\is_array($typeCtrl)) { |
177 | 182 | $this->removeOldValues($this->properties[$name], $typeCtrl); |
178 | 183 | } |
@@ -213,8 +218,9 @@ discard block |
||
213 | 218 | |
214 | 219 | public function fromArray($array) { |
215 | 220 | foreach ( $this as $key => $value ) { |
216 | - if(array_key_exists($key, $array)===true) |
|
217 | - $this->_callSetter("set" . ucfirst($key), $key, $array[$key], $array); |
|
221 | + if(array_key_exists($key, $array)===true) { |
|
222 | + $this->_callSetter("set" . ucfirst($key), $key, $array[$key], $array); |
|
223 | + } |
|
218 | 224 | } |
219 | 225 | foreach ( $array as $key => $value ) { |
220 | 226 | if($this->_callSetter($key, $key, $value, $array)===false){ |
@@ -265,15 +271,18 @@ discard block |
||
265 | 271 | $flag=false; |
266 | 272 | $index=0; |
267 | 273 | while ( !$flag && $index < sizeof($elements) ) { |
268 | - if ($elements[$index] instanceof BaseHtml) |
|
269 | - $flag=($elements[$index]->getIdentifier() === $identifier); |
|
274 | + if ($elements[$index] instanceof BaseHtml) { |
|
275 | + $flag=($elements[$index]->getIdentifier() === $identifier); |
|
276 | + } |
|
270 | 277 | $index++; |
271 | 278 | } |
272 | - if ($flag === true) |
|
273 | - return $elements[$index - 1]; |
|
279 | + if ($flag === true) { |
|
280 | + return $elements[$index - 1]; |
|
281 | + } |
|
274 | 282 | } elseif ($elements instanceof BaseHtml) { |
275 | - if ($elements->getIdentifier() === $identifier) |
|
276 | - return $elements; |
|
283 | + if ($elements->getIdentifier() === $identifier) { |
|
284 | + return $elements; |
|
285 | + } |
|
277 | 286 | } |
278 | 287 | return null; |
279 | 288 | } |
@@ -283,15 +292,18 @@ discard block |
||
283 | 292 | $flag=false; |
284 | 293 | $index=0; |
285 | 294 | while ( !$flag && $index < sizeof($elements) ) { |
286 | - if ($elements[$index] instanceof BaseHtml) |
|
287 | - $flag=($elements[$index]->propertyContains($propertyName, $value) === true); |
|
295 | + if ($elements[$index] instanceof BaseHtml) { |
|
296 | + $flag=($elements[$index]->propertyContains($propertyName, $value) === true); |
|
297 | + } |
|
288 | 298 | $index++; |
289 | 299 | } |
290 | - if ($flag === true) |
|
291 | - return $elements[$index - 1]; |
|
300 | + if ($flag === true) { |
|
301 | + return $elements[$index - 1]; |
|
302 | + } |
|
292 | 303 | } elseif ($elements instanceof BaseHtml) { |
293 | - if ($elements->propertyContains($propertyName, $value) === true) |
|
294 | - return $elements; |
|
304 | + if ($elements->propertyContains($propertyName, $value) === true) { |
|
305 | + return $elements; |
|
306 | + } |
|
295 | 307 | } |
296 | 308 | return null; |
297 | 309 | } |
@@ -46,8 +46,9 @@ discard block |
||
46 | 46 | } |
47 | 47 | $retour.="$.".$method."(url,".$params.").done(function( data ) {\n"; |
48 | 48 | $retour.=$this->_getOnAjaxDone($responseElement, $jqueryDone,$jsCallback)."});\n"; |
49 | - if ($immediatly) |
|
50 | - $this->jquery_code_for_compile[]=$retour; |
|
49 | + if ($immediatly) { |
|
50 | + $this->jquery_code_for_compile[]=$retour; |
|
51 | + } |
|
51 | 52 | return $retour; |
52 | 53 | } |
53 | 54 | |
@@ -55,15 +56,17 @@ discard block |
||
55 | 56 | $url=$this->_correctAjaxUrl($url); |
56 | 57 | $retour="url='".$url."';\n"; |
57 | 58 | $slash="/"; |
58 | - if(JString::endswith($url, "/")===true) |
|
59 | - $slash=""; |
|
59 | + if(JString::endswith($url, "/")===true) { |
|
60 | + $slash=""; |
|
61 | + } |
|
60 | 62 | if(JString::isNotNull($attr)){ |
61 | - if ($attr==="value") |
|
62 | - $retour.="url=url+'".$slash."'+$(this).val();\n"; |
|
63 | - elseif ($attr==="html") |
|
64 | - $retour.="url=url+'".$slash."'+$(this).html();\n"; |
|
65 | - elseif($attr!=null && $attr!=="") |
|
66 | - $retour.="url=url+'".$slash."'+($(this).attr('".$attr."')||'');\n"; |
|
63 | + if ($attr==="value") { |
|
64 | + $retour.="url=url+'".$slash."'+$(this).val();\n"; |
|
65 | + } elseif ($attr==="html") { |
|
66 | + $retour.="url=url+'".$slash."'+$(this).html();\n"; |
|
67 | + } elseif($attr!=null && $attr!=="") { |
|
68 | + $retour.="url=url+'".$slash."'+($(this).attr('".$attr."')||'');\n"; |
|
69 | + } |
|
67 | 70 | } |
68 | 71 | return $retour; |
69 | 72 | } |
@@ -85,8 +88,9 @@ discard block |
||
85 | 88 | } |
86 | 89 | |
87 | 90 | protected function _correctAjaxUrl($url) { |
88 | - if ($url!=="/" && JString::endsWith($url, "/")===true) |
|
89 | - $url=substr($url, 0, strlen($url)-1); |
|
91 | + if ($url!=="/" && JString::endsWith($url, "/")===true) { |
|
92 | + $url=substr($url, 0, strlen($url)-1); |
|
93 | + } |
|
90 | 94 | if (strncmp($url, 'http://', 7)!=0&&strncmp($url, 'https://', 8)!=0) { |
91 | 95 | $url=$this->jsUtils->getUrl($url); |
92 | 96 | } |
@@ -110,8 +114,9 @@ discard block |
||
110 | 114 | $retour.="\t".$jsCallback."\n". |
111 | 115 | "\t$(document).trigger('jsonReady',[data]);\n". |
112 | 116 | "});\n"; |
113 | - if ($immediatly) |
|
114 | - $this->jquery_code_for_compile[]=$retour; |
|
117 | + if ($immediatly) { |
|
118 | + $this->jquery_code_for_compile[]=$retour; |
|
119 | + } |
|
115 | 120 | return $retour; |
116 | 121 | } |
117 | 122 | |
@@ -150,7 +155,7 @@ discard block |
||
150 | 155 | if($context===null){ |
151 | 156 | $appendTo="\t\tnewElm.appendTo($('".$maskSelector."').parent());\n"; |
152 | 157 | $newElm = "$('#'+newId)"; |
153 | - }else{ |
|
158 | + } else{ |
|
154 | 159 | $appendTo="\t\tnewElm.appendTo(".$context.");\n"; |
155 | 160 | $newElm = $context.".find('#'+newId)"; |
156 | 161 | } |
@@ -160,8 +165,9 @@ discard block |
||
160 | 165 | $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"; |
161 | 166 | $retour.="\t$(document).trigger('jsonReady',[data]);\n"; |
162 | 167 | $retour.="\t".$jsCallback."\n"."});\n"; |
163 | - if ($immediatly) |
|
164 | - $this->jquery_code_for_compile[]=$retour; |
|
168 | + if ($immediatly) { |
|
169 | + $this->jquery_code_for_compile[]=$retour; |
|
170 | + } |
|
165 | 171 | return $retour; |
166 | 172 | } |
167 | 173 | /** |
@@ -202,8 +208,9 @@ discard block |
||
202 | 208 | }});\n"; |
203 | 209 | $retour.="$('#".$form."').submit();\n"; |
204 | 210 | } |
205 | - if ($immediatly) |
|
206 | - $this->jquery_code_for_compile[]=$retour; |
|
211 | + if ($immediatly) { |
|
212 | + $this->jquery_code_for_compile[]=$retour; |
|
213 | + } |
|
207 | 214 | return $retour; |
208 | 215 | } |
209 | 216 |
@@ -66,8 +66,9 @@ discard block |
||
66 | 66 | |
67 | 67 | $table->setRowCount(0, \sizeof($captions)); |
68 | 68 | $table->setHeaderValues($captions); |
69 | - if(isset($this->_compileParts)) |
|
70 | - $table->setCompileParts($this->_compileParts); |
|
69 | + if(isset($this->_compileParts)) { |
|
70 | + $table->setCompileParts($this->_compileParts); |
|
71 | + } |
|
71 | 72 | if(isset($this->_searchField) && isset($js)){ |
72 | 73 | $this->_searchField->postOn("change", $this->_urls,"{'s':$(this).val()}","#".$this->identifier." tbody",["preventDefault"=>false,"jqueryDone"=>"replaceWith"]); |
73 | 74 | } |
@@ -158,7 +159,7 @@ discard block |
||
158 | 159 | $hasPart=$table->hasPart($part); |
159 | 160 | if($hasPart){ |
160 | 161 | $row=$table->getPart($part)->addRow(\sizeof($captions)); |
161 | - }else{ |
|
162 | + } else{ |
|
162 | 163 | $row=$table->getPart($part)->getRow(0); |
163 | 164 | } |
164 | 165 | $row->mergeCol(); |
@@ -282,8 +283,9 @@ discard block |
||
282 | 283 | private function getDefaultButton($icon,$class=null){ |
283 | 284 | $bt=$this->getFieldButton(""); |
284 | 285 | $bt->asIcon($icon); |
285 | - if(isset($class)) |
|
286 | - $bt->addToProperty("class", $class); |
|
286 | + if(isset($class)) { |
|
287 | + $bt->addToProperty("class", $class); |
|
288 | + } |
|
287 | 289 | return $bt; |
288 | 290 | } |
289 | 291 |
@@ -21,8 +21,9 @@ discard block |
||
21 | 21 | $this->widgetIdentifier=$identifier; |
22 | 22 | $this->values=[]; |
23 | 23 | $this->afterCompile=[]; |
24 | - if(isset($instance)) |
|
25 | - $this->setInstance($instance); |
|
24 | + if(isset($instance)) { |
|
25 | + $this->setInstance($instance); |
|
26 | + } |
|
26 | 27 | $this->setCaptions($captions); |
27 | 28 | $this->captionCallback=NULL; |
28 | 29 | $this->defaultValueFunction=function($name,$value){return $value;}; |
@@ -40,8 +41,9 @@ discard block |
||
40 | 41 | |
41 | 42 | public function getIdentifier(){ |
42 | 43 | $value=self::$index; |
43 | - if(isset($this->values["identifier"])) |
|
44 | - $value=$this->values["identifier"](self::$index,$this->instance); |
|
44 | + if(isset($this->values["identifier"])) { |
|
45 | + $value=$this->values["identifier"](self::$index,$this->instance); |
|
46 | + } |
|
45 | 47 | return $value; |
46 | 48 | } |
47 | 49 | |
@@ -65,19 +67,19 @@ discard block |
||
65 | 67 | $value=$property->getValue($this->instance); |
66 | 68 | if(isset($this->values[$index])){ |
67 | 69 | $value= $this->values[$index]($value,$this->instance,$index); |
68 | - }else{ |
|
70 | + } else{ |
|
69 | 71 | $value=$this->_getDefaultValue($property->getName(),$value, $index); |
70 | 72 | } |
71 | - }else{ |
|
72 | - if(\is_callable($property)) |
|
73 | - $value=$property($this->instance); |
|
74 | - elseif(\is_array($property)){ |
|
73 | + } else{ |
|
74 | + if(\is_callable($property)) { |
|
75 | + $value=$property($this->instance); |
|
76 | + } elseif(\is_array($property)){ |
|
75 | 77 | $values=\array_map(function($v) use ($index){return $this->_getValue($v, $index);}, $property); |
76 | 78 | $value=\implode("", $values); |
77 | - }else{ |
|
79 | + } else{ |
|
78 | 80 | if(isset($this->values[$index])){ |
79 | 81 | $value= $this->values[$index]($property,$this->instance,$index); |
80 | - }else{ |
|
82 | + } else{ |
|
81 | 83 | $value=$property; |
82 | 84 | } |
83 | 85 | } |
@@ -100,10 +102,10 @@ discard block |
||
100 | 102 | if(isset($vb[$index])){ |
101 | 103 | if(\is_array($vb[$index])){ |
102 | 104 | $this->visibleProperties[$index][]=$field; |
103 | - }else{ |
|
105 | + } else{ |
|
104 | 106 | $this->visibleProperties[$index]=[$vb[$index],$field]; |
105 | 107 | } |
106 | - }else{ |
|
108 | + } else{ |
|
107 | 109 | return $this->insertField($index, $field); |
108 | 110 | } |
109 | 111 | return $this; |
@@ -130,9 +132,9 @@ discard block |
||
130 | 132 | $property=$this->getProperty($index); |
131 | 133 | if($property instanceof \ReflectionProperty){ |
132 | 134 | $result=$property->getName(); |
133 | - }elseif(\is_callable($property)){ |
|
135 | + } elseif(\is_callable($property)){ |
|
134 | 136 | $result=$this->visibleProperties[$index]; |
135 | - }else{ |
|
137 | + } else{ |
|
136 | 138 | $result=$property; |
137 | 139 | } |
138 | 140 | return $result; |
@@ -152,7 +154,7 @@ discard block |
||
152 | 154 | $this->reflect=new \ReflectionClass($instance); |
153 | 155 | if(\sizeof($this->visibleProperties)===0){ |
154 | 156 | $this->properties=$this->getDefaultProperties(); |
155 | - }else{ |
|
157 | + } else{ |
|
156 | 158 | foreach ($this->visibleProperties as $property){ |
157 | 159 | $this->setInstanceProperty($property); |
158 | 160 | } |
@@ -163,22 +165,23 @@ discard block |
||
163 | 165 | private function setInstanceProperty($property){ |
164 | 166 | if(\is_callable($property)){ |
165 | 167 | $this->properties[]=$property; |
166 | - }elseif(\is_string($property)){ |
|
168 | + } elseif(\is_string($property)){ |
|
167 | 169 | try{ |
168 | 170 | $this->_beforeAddProperty(\sizeof($this->properties), $property); |
169 | 171 | $rProperty=$this->reflect->getProperty($property); |
170 | 172 | $this->properties[]=$rProperty; |
171 | - }catch(\Exception $e){ |
|
173 | + } catch(\Exception $e){ |
|
172 | 174 | $this->_beforeAddProperty(\sizeof($this->properties), $property); |
173 | 175 | $this->properties[]=$property; |
174 | 176 | } |
175 | - }elseif(\is_int($property)){ |
|
177 | + } elseif(\is_int($property)){ |
|
176 | 178 | $props=$this->getDefaultProperties(); |
177 | - if(isset($props[$property])) |
|
178 | - $this->properties[]=$props[$property]; |
|
179 | - else |
|
180 | - $this->properties[]=$property; |
|
181 | - }else{ |
|
179 | + if(isset($props[$property])) { |
|
180 | + $this->properties[]=$props[$property]; |
|
181 | + } else { |
|
182 | + $this->properties[]=$property; |
|
183 | + } |
|
184 | + } else{ |
|
182 | 185 | $this->properties[]=$property; |
183 | 186 | } |
184 | 187 | } |
@@ -222,12 +225,13 @@ discard block |
||
222 | 225 | if(isset($this->captions[$index])){ |
223 | 226 | return $this->captions[$index]; |
224 | 227 | } |
225 | - if($this->properties[$index] instanceof \ReflectionProperty) |
|
226 | - return $this->properties[$index]->getName(); |
|
227 | - elseif(\is_callable($this->properties[$index])) |
|
228 | - return ""; |
|
229 | - else |
|
230 | - return $this->properties[$index]; |
|
228 | + if($this->properties[$index] instanceof \ReflectionProperty) { |
|
229 | + return $this->properties[$index]->getName(); |
|
230 | + } elseif(\is_callable($this->properties[$index])) { |
|
231 | + return ""; |
|
232 | + } else { |
|
233 | + return $this->properties[$index]; |
|
234 | + } |
|
231 | 235 | } |
232 | 236 | |
233 | 237 | public function getCaptions(){ |
@@ -236,7 +240,7 @@ discard block |
||
236 | 240 | for($i=\sizeof($captions);$i<$this->count();$i++){ |
237 | 241 | $captions[]=""; |
238 | 242 | } |
239 | - }else{ |
|
243 | + } else{ |
|
240 | 244 | $captions=[]; |
241 | 245 | $index=0; |
242 | 246 | $count=$this->count(); |
@@ -252,8 +256,9 @@ discard block |
||
252 | 256 | } |
253 | 257 | |
254 | 258 | public function setCaption($index,$caption){ |
255 | - if(isset($this->captions)===false) |
|
256 | - $this->captions=[]; |
|
259 | + if(isset($this->captions)===false) { |
|
260 | + $this->captions=[]; |
|
261 | + } |
|
257 | 262 | $this->captions[$index]=$caption; |
258 | 263 | return $this; |
259 | 264 | } |
@@ -33,8 +33,9 @@ |
||
33 | 33 | |
34 | 34 | |
35 | 35 | public function addSeparatorAfter($fieldNum){ |
36 | - if(\array_search($fieldNum, $this->separators)===false) |
|
37 | - $this->separators[]=$fieldNum; |
|
36 | + if(\array_search($fieldNum, $this->separators)===false) { |
|
37 | + $this->separators[]=$fieldNum; |
|
38 | + } |
|
38 | 39 | return $this; |
39 | 40 | } |
40 | 41 |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | $this->setTagName("div"); |
58 | 58 | $this->removeProperty("href"); |
59 | 59 | $this->addToPropertyCtrl("class", "active", array("active")); |
60 | - }else{ |
|
60 | + } else{ |
|
61 | 61 | $this->removePropertyValue("class", "active"); |
62 | 62 | } |
63 | 63 | return $this; |
@@ -65,8 +65,9 @@ discard block |
||
65 | 65 | |
66 | 66 | public function asLink($href=NULL,$part=NULL){ |
67 | 67 | $this->setTagName("a"); |
68 | - if(isset($href)) |
|
69 | - $this->setProperty("href", $href); |
|
68 | + if(isset($href)) { |
|
69 | + $this->setProperty("href", $href); |
|
70 | + } |
|
70 | 71 | return $this; |
71 | 72 | } |
72 | 73 | |
@@ -77,8 +78,9 @@ discard block |
||
77 | 78 | * @see \Ajax\semantic\html\base\HtmlSemDoubleElement::compile() |
78 | 79 | */ |
79 | 80 | public function compile(JsUtils $js=NULL, &$view=NULL) { |
80 | - if(\is_array($this->content) && JArray::isAssociative($this->content)) |
|
81 | - $this->content=JArray::sortAssociative($this->content, [ "icon","image","content" ]); |
|
81 | + if(\is_array($this->content) && JArray::isAssociative($this->content)) { |
|
82 | + $this->content=JArray::sortAssociative($this->content, [ "icon","image","content" ]); |
|
83 | + } |
|
82 | 84 | return parent::compile($js, $view); |
83 | 85 | } |
84 | 86 | } |
85 | 87 | \ No newline at end of file |