@@ -25,8 +25,9 @@ |
||
25 | 25 | |
26 | 26 | private static function containsElement($input) { |
27 | 27 | foreach ( $input as $v ) { |
28 | - if (\is_object($v) || \is_array($v)) |
|
29 | - return true; |
|
28 | + if (\is_object($v) || \is_array($v)) { |
|
29 | + return true; |
|
30 | + } |
|
30 | 31 | } |
31 | 32 | return false; |
32 | 33 | } |
@@ -120,25 +120,29 @@ discard block |
||
120 | 120 | } |
121 | 121 | |
122 | 122 | public function getColPosition($colIndex) { |
123 | - if($this->_container->_isMerged()!==true) |
|
124 | - return $colIndex; |
|
123 | + if($this->_container->_isMerged()!==true) { |
|
124 | + return $colIndex; |
|
125 | + } |
|
125 | 126 | $pos=0; |
126 | 127 | $rows=$this->_container->getContent(); |
127 | 128 | for($i=0; $i < $this->_row; $i++) { |
128 | 129 | $max=\min($colIndex, $rows[$i]->count()); |
129 | 130 | for($j=0; $j < $max; $j++) { |
130 | 131 | $rowspan=$rows[$i]->getItem($j)->getRowspan(); |
131 | - if ($rowspan + $i > $this->_row) |
|
132 | - $pos++; |
|
132 | + if ($rowspan + $i > $this->_row) { |
|
133 | + $pos++; |
|
134 | + } |
|
133 | 135 | } |
134 | 136 | } |
135 | - if ($pos > $colIndex) |
|
136 | - return NULL; |
|
137 | + if ($pos > $colIndex) { |
|
138 | + return NULL; |
|
139 | + } |
|
137 | 140 | $count=$this->count(); |
138 | 141 | for($i=0; $i < $count; $i++) { |
139 | 142 | $pos+=$this->content[$i]->getColspan(); |
140 | - if ($pos >= $colIndex + 1) |
|
141 | - return $i; |
|
143 | + if ($pos >= $colIndex + 1) { |
|
144 | + return $i; |
|
145 | + } |
|
142 | 146 | } |
143 | 147 | return null; |
144 | 148 | } |
@@ -161,8 +165,9 @@ discard block |
||
161 | 165 | public function containsStr($needle) { |
162 | 166 | $cells=$this->content; |
163 | 167 | foreach ( $cells as $cell ) { |
164 | - if (\strpos($cell->getContent(), $needle) !== false) |
|
165 | - return true; |
|
168 | + if (\strpos($cell->getContent(), $needle) !== false) { |
|
169 | + return true; |
|
170 | + } |
|
166 | 171 | } |
167 | 172 | return false; |
168 | 173 | } |
@@ -43,8 +43,7 @@ discard block |
||
43 | 43 | foreach ($actions as $action){ |
44 | 44 | $this->addAction($action); |
45 | 45 | } |
46 | - } |
|
47 | - else{ |
|
46 | + } else{ |
|
48 | 47 | $this->addAction($actions); |
49 | 48 | } |
50 | 49 | return $this; |
@@ -64,8 +63,9 @@ discard block |
||
64 | 63 | $class="cancel"; |
65 | 64 | } |
66 | 65 | $action=new HtmlButton("action-".$this->identifier."-".JArray::count($this->content["actions"]->getContent()),$action); |
67 | - if($class!=="") |
|
68 | - $action->addToProperty("class", $class); |
|
66 | + if($class!=="") { |
|
67 | + $action->addToProperty("class", $class); |
|
68 | + } |
|
69 | 69 | } |
70 | 70 | return $this->addElementInPart($action, "actions"); |
71 | 71 | } |
@@ -174,8 +174,9 @@ discard block |
||
174 | 174 | * @see BaseHtml::run() |
175 | 175 | */ |
176 | 176 | public function run(JsUtils $js) { |
177 | - if(isset($this->_bsComponent)===false) |
|
178 | - $this->_bsComponent=$js->semantic()->modal("#".$this->identifier,$this->_params,$this->_paramParts); |
|
177 | + if(isset($this->_bsComponent)===false) { |
|
178 | + $this->_bsComponent=$js->semantic()->modal("#".$this->identifier,$this->_params,$this->_paramParts); |
|
179 | + } |
|
179 | 180 | $this->addEventsOnRun($js); |
180 | 181 | return $this->_bsComponent; |
181 | 182 | } |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | if(isset($value)){ |
37 | 37 | if($value instanceof HtmlSemDoubleElement){ |
38 | 38 | $text=$value; |
39 | - }else{ |
|
39 | + } else{ |
|
40 | 40 | $text=new HtmlSemDoubleElement("text-".$this->identifier,"div"); |
41 | 41 | $text->setClass("text"); |
42 | 42 | $this->setValue($value); |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | } |
110 | 110 | if(!$item instanceof HtmlDropdownItem){ |
111 | 111 | $itemO=new HtmlDropdownItem("dd-item-".$this->identifier."-".\sizeof($this->items),$item,$value,$image,$description); |
112 | - }elseif($itemO instanceof HtmlDropdownItem){ |
|
112 | + } elseif($itemO instanceof HtmlDropdownItem){ |
|
113 | 113 | $this->addToProperty("class", "vertical"); |
114 | 114 | } |
115 | 115 | return $itemO; |
@@ -123,8 +123,9 @@ discard block |
||
123 | 123 | } |
124 | 124 | |
125 | 125 | public function addInput($name){ |
126 | - if(!isset($name)) |
|
127 | - $name="input-".$this->identifier; |
|
126 | + if(!isset($name)) { |
|
127 | + $name="input-".$this->identifier; |
|
128 | + } |
|
128 | 129 | $this->setAction("activate"); |
129 | 130 | $this->input=new HtmlInput($name,"hidden"); |
130 | 131 | $this->input->setIdentifier("input-".$this->identifier); |
@@ -183,7 +184,7 @@ discard block |
||
183 | 184 | foreach ($items as $k=>$v){ |
184 | 185 | $this->addItem($v)->setData($k); |
185 | 186 | } |
186 | - }else{ |
|
187 | + } else{ |
|
187 | 188 | foreach ($items as $item){ |
188 | 189 | $this->addItem($item); |
189 | 190 | } |
@@ -205,8 +206,7 @@ discard block |
||
205 | 206 | $c=$this->items[$i++]; |
206 | 207 | if(isset($c)){ |
207 | 208 | $c->setProperty($property,$value); |
208 | - } |
|
209 | - else{ |
|
209 | + } else{ |
|
210 | 210 | return $this; |
211 | 211 | } |
212 | 212 | } |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | if($dropdown===false){ |
238 | 238 | $this->_template=include dirname(__FILE__).'/../templates/tplDropdownMenu.php'; |
239 | 239 | $dropdown="menu"; |
240 | - }else{ |
|
240 | + } else{ |
|
241 | 241 | $dropdown="dropdown"; |
242 | 242 | $this->mClass="menu"; |
243 | 243 | } |
@@ -258,22 +258,25 @@ discard block |
||
258 | 258 | |
259 | 259 | public function asButton($floating=false){ |
260 | 260 | $this->removeArrow(); |
261 | - if($floating) |
|
262 | - $this->addToProperty("class", "floating"); |
|
261 | + if($floating) { |
|
262 | + $this->addToProperty("class", "floating"); |
|
263 | + } |
|
263 | 264 | $this->removePropertyValue("class", "selection"); |
264 | 265 | return $this->addToProperty("class", "button"); |
265 | 266 | } |
266 | 267 | |
267 | 268 | public function asSelect($name=NULL,$multiple=false,$selection=true){ |
268 | 269 | $this->_multiple=$multiple; |
269 | - if(isset($name)) |
|
270 | - $this->addInput($name); |
|
270 | + if(isset($name)) { |
|
271 | + $this->addInput($name); |
|
272 | + } |
|
271 | 273 | if($multiple){ |
272 | 274 | $this->addToProperty("class", "multiple"); |
273 | 275 | } |
274 | 276 | if ($selection){ |
275 | - if($this->propertyContains("class", "button")===false) |
|
276 | - $this->addToPropertyCtrl("class", "selection",array("selection")); |
|
277 | + if($this->propertyContains("class", "button")===false) { |
|
278 | + $this->addToPropertyCtrl("class", "selection",array("selection")); |
|
279 | + } |
|
277 | 280 | } |
278 | 281 | return $this; |
279 | 282 | } |
@@ -284,8 +287,9 @@ discard block |
||
284 | 287 | } |
285 | 288 | |
286 | 289 | public function setSelect($name=NULL,$multiple=false){ |
287 | - if(!isset($name)) |
|
288 | - $name="select-".$this->identifier; |
|
290 | + if(!isset($name)) { |
|
291 | + $name="select-".$this->identifier; |
|
292 | + } |
|
289 | 293 | $this->input=null; |
290 | 294 | if($multiple){ |
291 | 295 | $this->setProperty("multiple", true); |
@@ -321,12 +325,13 @@ discard block |
||
321 | 325 | $value=$this->value; |
322 | 326 | if(isset($this->input) && isset($value)){ |
323 | 327 | $this->input->setProperty("value", $value); |
324 | - }else{ |
|
328 | + } else{ |
|
325 | 329 | $this->setProperty("value", $value); |
326 | 330 | } |
327 | 331 | $textElement=$this->getElementById("text-".$this->identifier, $this->content); |
328 | - if(isset($textElement) && ($textElement instanceof HtmlDoubleElement) && !$this->_multiple) |
|
329 | - $textElement->setContent($value); |
|
332 | + if(isset($textElement) && ($textElement instanceof HtmlDoubleElement) && !$this->_multiple) { |
|
333 | + $textElement->setContent($value); |
|
334 | + } |
|
330 | 335 | return $this; |
331 | 336 | } |
332 | 337 |
@@ -84,15 +84,17 @@ discard block |
||
84 | 84 | |
85 | 85 | public function getColspan() { |
86 | 86 | $colspan=1; |
87 | - if (\array_key_exists("colspan", $this->properties)) |
|
88 | - $colspan=$this->getProperty("colspan"); |
|
87 | + if (\array_key_exists("colspan", $this->properties)) { |
|
88 | + $colspan=$this->getProperty("colspan"); |
|
89 | + } |
|
89 | 90 | return $colspan; |
90 | 91 | } |
91 | 92 | |
92 | 93 | public function getRowspan() { |
93 | 94 | $rowspan=1; |
94 | - if (\array_key_exists("rowspan", $this->properties)) |
|
95 | - $rowspan=$this->getProperty("rowspan"); |
|
95 | + if (\array_key_exists("rowspan", $this->properties)) { |
|
96 | + $rowspan=$this->getProperty("rowspan"); |
|
97 | + } |
|
96 | 98 | return $rowspan; |
97 | 99 | } |
98 | 100 | |
@@ -129,7 +131,8 @@ discard block |
||
129 | 131 | } |
130 | 132 | |
131 | 133 | public function compile(JsUtils $js=NULL, &$view=NULL) { |
132 | - if(!$this->_deleted) |
|
133 | - return parent::compile(); |
|
134 | + if(!$this->_deleted) { |
|
135 | + return parent::compile(); |
|
136 | + } |
|
134 | 137 | } |
135 | 138 | } |
@@ -23,8 +23,9 @@ discard block |
||
23 | 23 | public function __construct($identifier, $caption="", $icon=NULL, $tagName="div") { |
24 | 24 | parent::__construct($identifier, $tagName, "ui label"); |
25 | 25 | $this->content=$caption; |
26 | - if (isset($icon)) |
|
27 | - $this->addIcon($icon); |
|
26 | + if (isset($icon)) { |
|
27 | + $this->addIcon($icon); |
|
28 | + } |
|
28 | 29 | } |
29 | 30 | |
30 | 31 | /** |
@@ -33,10 +34,11 @@ discard block |
||
33 | 34 | * @return HtmlLabel |
34 | 35 | */ |
35 | 36 | public function setPointing($value=Direction::NONE) { |
36 | - if($value==="left" || $value==="right") |
|
37 | - return $this->addToPropertyCtrl("class", $value." pointing", Direction::getConstantValues("pointing")); |
|
38 | - else |
|
39 | - return $this->addToPropertyCtrl("class", "pointing ".$value, Direction::getConstantValues("pointing",true)); |
|
37 | + if($value==="left" || $value==="right") { |
|
38 | + return $this->addToPropertyCtrl("class", $value." pointing", Direction::getConstantValues("pointing")); |
|
39 | + } else { |
|
40 | + return $this->addToPropertyCtrl("class", "pointing ".$value, Direction::getConstantValues("pointing",true)); |
|
41 | + } |
|
40 | 42 | } |
41 | 43 | |
42 | 44 | /** |
@@ -134,10 +136,11 @@ discard block |
||
134 | 136 | } |
135 | 137 | |
136 | 138 | public function setAttached($side=Side::TOP,$direction=Direction::NONE){ |
137 | - if($direction!==Direction::NONE) |
|
138 | - return $this->addToPropertyCtrl("class", $side." ".$direction." attached",Side::getConstantValues($direction." attached")); |
|
139 | - else |
|
140 | - return $this->addToPropertyCtrl("class", $side." attached",Side::getConstantValues("attached")); |
|
139 | + if($direction!==Direction::NONE) { |
|
140 | + return $this->addToPropertyCtrl("class", $side." ".$direction." attached",Side::getConstantValues($direction." attached")); |
|
141 | + } else { |
|
142 | + return $this->addToPropertyCtrl("class", $side." attached",Side::getConstantValues("attached")); |
|
143 | + } |
|
141 | 144 | } |
142 | 145 | |
143 | 146 | /** |
@@ -29,15 +29,17 @@ discard block |
||
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 | |
@@ -75,9 +77,9 @@ discard block |
||
75 | 77 | $instances=[]; |
76 | 78 | if($content instanceof $class){ |
77 | 79 | $instances[]=$content; |
78 | - }elseif($content instanceof HtmlDoubleElement){ |
|
80 | + } elseif($content instanceof HtmlDoubleElement){ |
|
79 | 81 | $instances=\array_merge($instances,$content->getContentInstances($class)); |
80 | - }elseif (\is_array($content)){ |
|
82 | + } elseif (\is_array($content)){ |
|
81 | 83 | foreach ($content as $element){ |
82 | 84 | $instances=\array_merge($instances,$this->_getContentInstances($class, $element)); |
83 | 85 | } |
@@ -90,10 +92,12 @@ discard block |
||
90 | 92 | * @return HtmlDoubleElement |
91 | 93 | */ |
92 | 94 | public function asLink($href=NULL,$target=NULL) { |
93 | - if (isset($href)) |
|
94 | - $this->setProperty("href", $href); |
|
95 | - if(isset($target)) |
|
96 | - $this->setProperty("target", $target); |
|
95 | + if (isset($href)) { |
|
96 | + $this->setProperty("href", $href); |
|
97 | + } |
|
98 | + if(isset($target)) { |
|
99 | + $this->setProperty("target", $target); |
|
100 | + } |
|
97 | 101 | return $this->setTagName("a"); |
98 | 102 | } |
99 | 103 | } |
@@ -28,11 +28,12 @@ discard block |
||
28 | 28 | if(\is_array($value)){ |
29 | 29 | $itemO=new HtmlFormInput(JArray::getDefaultValue($value, "id",""),JArray::getDefaultValue($value, "label",null),JArray::getDefaultValue($value, "type", "text"),JArray::getDefaultValue($value, "value",""),JArray::getDefaultValue($value, "placeholder",JArray::getDefaultValue($value, "label",null))); |
30 | 30 | return $itemO; |
31 | - }elseif(\is_object($value)){ |
|
31 | + } elseif(\is_object($value)){ |
|
32 | 32 | $itemO=new HtmlFormField("field-".$this->identifier, $value); |
33 | 33 | return $itemO; |
34 | - }else |
|
35 | - return new HtmlFormInput($value); |
|
34 | + } else { |
|
35 | + return new HtmlFormInput($value); |
|
36 | + } |
|
36 | 37 | } |
37 | 38 | |
38 | 39 | protected function createCondition($value){ |
@@ -66,8 +67,7 @@ discard block |
||
66 | 67 | if(isset($c)){ |
67 | 68 | $df=$c->getDataField(); |
68 | 69 | $df->setProperty($property,$value); |
69 | - } |
|
70 | - else{ |
|
70 | + } else{ |
|
71 | 71 | return $this; |
72 | 72 | } |
73 | 73 | } |
@@ -25,16 +25,17 @@ |
||
25 | 25 | if(isset($title)){ |
26 | 26 | $this->setTitle($title,$desc); |
27 | 27 | } |
28 | - }else{ |
|
28 | + } else{ |
|
29 | 29 | $this->setContent($content); |
30 | 30 | } |
31 | 31 | } |
32 | 32 | |
33 | 33 | public function setActive($value=true){ |
34 | - if($value) |
|
35 | - $this->setStatus(StepStatus::ACTIVE); |
|
36 | - else |
|
37 | - $this->setStatus(StepStatus::NONE); |
|
34 | + if($value) { |
|
35 | + $this->setStatus(StepStatus::ACTIVE); |
|
36 | + } else { |
|
37 | + $this->setStatus(StepStatus::NONE); |
|
38 | + } |
|
38 | 39 | return $this; |
39 | 40 | } |
40 | 41 |