@@ -50,14 +50,14 @@ discard block |
||
50 | 50 | |
51 | 51 | $this->setHiddenValue('tg', $App->controllerTg); |
52 | 52 | |
53 | - if(isset($customfield)){ |
|
53 | + if (isset($customfield)) { |
|
54 | 54 | $this->setHiddenValue('customfield[id]', $customfield->id); |
55 | 55 | $values = $customfield->getValues(); |
56 | 56 | |
57 | - if(! empty($this->customfield->enumvalues)){ |
|
57 | + if (!empty($this->customfield->enumvalues)) { |
|
58 | 58 | $values['enumvalues'] = unserialize($this->customfield->enumvalues); |
59 | 59 | } |
60 | - else{ |
|
60 | + else { |
|
61 | 61 | $values['enumvalues'] = array( |
62 | 62 | '0' => '' |
63 | 63 | ); |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | $this->addItem($this->searchable()); |
83 | 83 | $this->addItem($this->visible()); |
84 | 84 | $this->addItem($this->importable()); |
85 | - if($App->onlineShop){ |
|
85 | + if ($App->onlineShop) { |
|
86 | 86 | $this->addItem($this->visible_in_shop()); |
87 | 87 | } |
88 | 88 | } |
@@ -175,16 +175,16 @@ discard block |
||
175 | 175 | $fieldValuesItem->addItem($W->Label($App->translate('List of available values'))); |
176 | 176 | $values = array(); |
177 | 177 | |
178 | - if(isset($this->customfield) && ! empty($this->customfield->enumvalues)){ |
|
178 | + if (isset($this->customfield) && !empty($this->customfield->enumvalues)) { |
|
179 | 179 | $values = unserialize($this->customfield->enumvalues); |
180 | 180 | |
181 | - foreach ($values as $name => $text){ |
|
181 | + foreach ($values as $name => $text) { |
|
182 | 182 | $fieldValuesItem->addItem($W->LineEdit() |
183 | 183 | ->setName((string) $name)); |
184 | 184 | } |
185 | 185 | } |
186 | 186 | |
187 | - if(empty($values)){ |
|
187 | + if (empty($values)) { |
|
188 | 188 | $fieldValuesItem->addItem($W->LineEdit() |
189 | 189 | ->setName('1')); |
190 | 190 | } |
@@ -56,8 +56,7 @@ |
||
56 | 56 | |
57 | 57 | if(! empty($this->customfield->enumvalues)){ |
58 | 58 | $values['enumvalues'] = unserialize($this->customfield->enumvalues); |
59 | - } |
|
60 | - else{ |
|
59 | + } else{ |
|
61 | 60 | $values['enumvalues'] = array( |
62 | 61 | '0' => '' |
63 | 62 | ); |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | $row = $W->Items()->setSizePolicy('row'); |
277 | 277 | foreach ($customSections as $customSection) { |
278 | 278 | |
279 | - list(, , $nbCol) = explode('-', $customSection->sizePolicy); |
|
279 | + list(,, $nbCol) = explode('-', $customSection->sizePolicy); |
|
280 | 280 | |
281 | 281 | if ($currentColumn + $nbCol > 12) { |
282 | 282 | $this->addItem($row); |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | $parameters = $displayField['parameters']; |
304 | 304 | $classname = isset($parameters['classname']) ? $parameters['classname'] : ''; |
305 | 305 | $label = isset($parameters['label']) ? $parameters['label'] : ''; |
306 | - $displayFieldMethod = '_' . $displayFieldName; |
|
306 | + $displayFieldMethod = '_'.$displayFieldName; |
|
307 | 307 | |
308 | 308 | if (method_exists($this, $displayFieldMethod)) { |
309 | 309 | $value = $this->$displayFieldMethod($customSection, $label); |
@@ -28,7 +28,7 @@ |
||
28 | 28 | |
29 | 29 | protected function getShapeHtml() |
30 | 30 | { |
31 | - $path = "M{$this->size} {$this->size} " . number_format($this->size / 2, 1) . ' ' . number_format($this->size / 6, 1) . " L0 {$this->size} Z"; |
|
31 | + $path = "M{$this->size} {$this->size} ".number_format($this->size / 2, 1).' '.number_format($this->size / 6, 1)." L0 {$this->size} Z"; |
|
32 | 32 | return "<svg height='{$this->size}' width='{$this->size}'> |
33 | 33 | <path d='{$path}' fill='{$this->color}'/> |
34 | 34 | </svg>"; |
@@ -62,7 +62,7 @@ |
||
62 | 62 | if(isset($componentUi) && method_exists($componentUi, $name)){ |
63 | 63 | return call_user_func_array(array($componentUi, $name), $arguments); |
64 | 64 | } |
65 | - }catch(\Exception $e){} |
|
65 | + } catch(\Exception $e){} |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | $rc = new \ReflectionClass($this); |
@@ -47,22 +47,22 @@ discard block |
||
47 | 47 | { |
48 | 48 | $App = $this->App(); |
49 | 49 | $Ui = $App->Ui(); |
50 | - if(strpos($name, $App->classPrefix) !== false){ |
|
50 | + if (strpos($name, $App->classPrefix) !== false) { |
|
51 | 51 | list(, $name) = explode($App->classPrefix, $name); |
52 | 52 | } |
53 | 53 | |
54 | - if(method_exists($Ui, $name)){ |
|
54 | + if (method_exists($Ui, $name)) { |
|
55 | 55 | return call_user_func_array(array($Ui, $name), $arguments); |
56 | 56 | } |
57 | 57 | |
58 | 58 | $components = $App->getComponents(); |
59 | - foreach ($components as $component){ |
|
60 | - try{ |
|
59 | + foreach ($components as $component) { |
|
60 | + try { |
|
61 | 61 | $componentUi = $component->ui(); |
62 | - if(isset($componentUi) && method_exists($componentUi, $name)){ |
|
62 | + if (isset($componentUi) && method_exists($componentUi, $name)) { |
|
63 | 63 | return call_user_func_array(array($componentUi, $name), $arguments); |
64 | 64 | } |
65 | - }catch(\Exception $e){} |
|
65 | + } catch (\Exception $e) {} |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | $rc = new \ReflectionClass($this); |
@@ -83,11 +83,11 @@ discard block |
||
83 | 83 | $page->addMessageInfo(); |
84 | 84 | |
85 | 85 | $addon = $App->getAddon(); |
86 | - if($addon){ |
|
86 | + if ($addon) { |
|
87 | 87 | $components = $App->getComponents(); |
88 | - foreach ($components as $component){ |
|
88 | + foreach ($components as $component) { |
|
89 | 89 | $stylePath = $component->getStylePath(); |
90 | - if($stylePath){ |
|
90 | + if ($stylePath) { |
|
91 | 91 | $page->addStyleSheet($stylePath.'style.css'); |
92 | 92 | } |
93 | 93 | } |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | continue; |
304 | 304 | } |
305 | 305 | |
306 | - list(, , $nbCol) = explode('-', $customSection->sizePolicy); |
|
306 | + list(,, $nbCol) = explode('-', $customSection->sizePolicy); |
|
307 | 307 | |
308 | 308 | if ($currentColumn + $nbCol > 12) { |
309 | 309 | $container->addItem($row); |
@@ -359,19 +359,19 @@ discard block |
||
359 | 359 | $sizePolicy .= isset($parameters['sizePolicy']) ? $parameters['sizePolicy'] : ''; |
360 | 360 | $sizePolicy .= isset($parameters['transparentBackground']) && $parameters['transparentBackground'] ? 'customsection-field-box-transparentBackground' : ''; |
361 | 361 | |
362 | - $displayFieldMethod = '_' . $displayFieldName; |
|
362 | + $displayFieldMethod = '_'.$displayFieldName; |
|
363 | 363 | if (!$isGroupField && method_exists($this, $displayFieldMethod)) { |
364 | 364 | $item = $this->$displayFieldMethod($customSection, $label); |
365 | 365 | } |
366 | 366 | else { |
367 | - if($isGroupField){ |
|
367 | + if ($isGroupField) { |
|
368 | 368 | list(, $groupId) = explode('_fieldsGroup', $displayFieldId); |
369 | 369 | if (method_exists($this, '__fieldsGroup')) { |
370 | 370 | $item = $this->__fieldsGroup($customSection, $groupId, $label); |
371 | 371 | } |
372 | 372 | $sizePolicy .= ' customsection-fieldsgroup-box'; |
373 | 373 | } |
374 | - else{ |
|
374 | + else { |
|
375 | 375 | try { |
376 | 376 | $field = $this->recordSet->getField($displayFieldName); |
377 | 377 | $value = $this->fieldOutput($field, $this->record, $displayFieldName); |
@@ -399,7 +399,7 @@ discard block |
||
399 | 399 | } |
400 | 400 | } |
401 | 401 | |
402 | - if ($currentColumn + $nbCol> 0) { |
|
402 | + if ($currentColumn + $nbCol > 0) { |
|
403 | 403 | $container->addItem($row); |
404 | 404 | } |
405 | 405 | } |
@@ -431,8 +431,8 @@ discard block |
||
431 | 431 | $groupField = $customSection->getField('_fieldsGroup'.$groupId); |
432 | 432 | $originalFieldsLayout = $customSection->fieldsLayout; |
433 | 433 | $customSection->fieldsLayout = AppCustomSection::FIELDS_LAYOUT_VERTICAL_LABEL; |
434 | - if(isset($groupField['fields'])){ |
|
435 | - foreach ($groupField['fields'] as $field){ |
|
434 | + if (isset($groupField['fields'])) { |
|
435 | + foreach ($groupField['fields'] as $field) { |
|
436 | 436 | $item = null; |
437 | 437 | $parameters = $field['parameters']; |
438 | 438 | $labelField = isset($parameters['label']) ? $parameters['label'] : ''; |
@@ -442,11 +442,11 @@ discard block |
||
442 | 442 | |
443 | 443 | $displayFieldName = $field['fieldname']; |
444 | 444 | |
445 | - $displayFieldMethod = '_' . $displayFieldName; |
|
445 | + $displayFieldMethod = '_'.$displayFieldName; |
|
446 | 446 | if (method_exists($this, $displayFieldMethod)) { |
447 | 447 | $item = $this->$displayFieldMethod($customSection, $labelField); |
448 | 448 | } |
449 | - else{ |
|
449 | + else { |
|
450 | 450 | try { |
451 | 451 | $field = $this->recordSet->getField($displayFieldName); |
452 | 452 | $value = $this->fieldOutput($field, $this->record, $displayFieldName); |
@@ -462,7 +462,7 @@ discard block |
||
462 | 462 | $item = null; |
463 | 463 | } |
464 | 464 | } |
465 | - if(isset($item)){ |
|
465 | + if (isset($item)) { |
|
466 | 466 | $item->addClass('app-customsection-groupedfield'); |
467 | 467 | $item->addClass($itemClass); |
468 | 468 | } |
@@ -362,16 +362,14 @@ discard block |
||
362 | 362 | $displayFieldMethod = '_' . $displayFieldName; |
363 | 363 | if (!$isGroupField && method_exists($this, $displayFieldMethod)) { |
364 | 364 | $item = $this->$displayFieldMethod($customSection, $label); |
365 | - } |
|
366 | - else { |
|
365 | + } else { |
|
367 | 366 | if($isGroupField){ |
368 | 367 | list(, $groupId) = explode('_fieldsGroup', $displayFieldId); |
369 | 368 | if (method_exists($this, '__fieldsGroup')) { |
370 | 369 | $item = $this->__fieldsGroup($customSection, $groupId, $label); |
371 | 370 | } |
372 | 371 | $sizePolicy .= ' customsection-fieldsgroup-box'; |
373 | - } |
|
374 | - else{ |
|
372 | + } else{ |
|
375 | 373 | try { |
376 | 374 | $field = $this->recordSet->getField($displayFieldName); |
377 | 375 | $value = $this->fieldOutput($field, $this->record, $displayFieldName); |
@@ -445,8 +443,7 @@ discard block |
||
445 | 443 | $displayFieldMethod = '_' . $displayFieldName; |
446 | 444 | if (method_exists($this, $displayFieldMethod)) { |
447 | 445 | $item = $this->$displayFieldMethod($customSection, $labelField); |
448 | - } |
|
449 | - else{ |
|
446 | + } else{ |
|
450 | 447 | try { |
451 | 448 | $field = $this->recordSet->getField($displayFieldName); |
452 | 449 | $value = $this->fieldOutput($field, $this->record, $displayFieldName); |
@@ -137,8 +137,7 @@ discard block |
||
137 | 137 | } |
138 | 138 | if(isset($title)){ |
139 | 139 | $this->context->addItem($W->Section($title, $item, 4), $position); |
140 | - } |
|
141 | - else{ |
|
140 | + } else{ |
|
142 | 141 | $this->context->addItem($item, $position); |
143 | 142 | } |
144 | 143 | return $this; |
@@ -169,8 +168,7 @@ discard block |
||
169 | 168 | $mainPanel = $W->Frame(null, $this->mainPanel); |
170 | 169 | if(bab_isAjaxRequest()){ |
171 | 170 | $mainPanel->addClass('app_main_panel'); |
172 | - } |
|
173 | - else{ |
|
171 | + } else{ |
|
174 | 172 | $mainPanel->setId('app_main_panel'); |
175 | 173 | } |
176 | 174 |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | * @var FuncIcons $I |
66 | 66 | */ |
67 | 67 | $I = BabFunctionality::get('Icons'); |
68 | - if($I){ |
|
68 | + if ($I) { |
|
69 | 69 | $I->includeCss(); |
70 | 70 | } |
71 | 71 | |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | */ |
113 | 113 | public function addItem(WidgetDisplayableInterface $item = null, $order = null) |
114 | 114 | { |
115 | - if(! isset($this->mainPanel)){ |
|
115 | + if (!isset($this->mainPanel)) { |
|
116 | 116 | $W = bab_widgets(); |
117 | 117 | $this->mainPanel = $W->VBoxLayout(); |
118 | 118 | } |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | { |
134 | 134 | $W = bab_widgets(); |
135 | 135 | |
136 | - if(null === $this->context){ |
|
136 | + if (null === $this->context) { |
|
137 | 137 | |
138 | 138 | $isAjaxRequest = (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest'); |
139 | 139 | $contextPanelId = $isAjaxRequest ? null : 'app_context_panel'; |
@@ -141,10 +141,10 @@ discard block |
||
141 | 141 | $this->context = $W->Frame($contextPanelId, $W->VBoxLayout() |
142 | 142 | ->setVerticalSpacing(2, 'em')); |
143 | 143 | } |
144 | - if(isset($title)){ |
|
144 | + if (isset($title)) { |
|
145 | 145 | $this->context->addItem($W->Section($title, $item, 4), $position); |
146 | 146 | } |
147 | - else{ |
|
147 | + else { |
|
148 | 148 | $this->context->addItem($item, $position); |
149 | 149 | } |
150 | 150 | return $this; |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | { |
161 | 161 | $W = bab_Widgets(); |
162 | 162 | |
163 | - if(null === $this->toolbars){ |
|
163 | + if (null === $this->toolbars) { |
|
164 | 164 | $this->toolbars = $W->Frame(null, $W->VBoxItems()); |
165 | 165 | } |
166 | 166 | $this->toolbars->addItem($item); |
@@ -173,10 +173,10 @@ discard block |
||
173 | 173 | $W = bab_widgets(); |
174 | 174 | |
175 | 175 | $mainPanel = $W->Frame(null, $this->mainPanel); |
176 | - if(bab_isAjaxRequest()){ |
|
176 | + if (bab_isAjaxRequest()) { |
|
177 | 177 | $mainPanel->addClass('app_main_panel'); |
178 | 178 | } |
179 | - else{ |
|
179 | + else { |
|
180 | 180 | $mainPanel->setId('app_main_panel'); |
181 | 181 | } |
182 | 182 | |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | { |
194 | 194 | $mainPanel = $this->getMainPanel(); |
195 | 195 | |
196 | - if($this->context){ |
|
196 | + if ($this->context) { |
|
197 | 197 | |
198 | 198 | $W = bab_widgets(); |
199 | 199 | |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | |
211 | 211 | protected function addToolbars(WidgetItem $mainPanel) |
212 | 212 | { |
213 | - if($this->toolbars){ |
|
213 | + if ($this->toolbars) { |
|
214 | 214 | |
215 | 215 | $W = bab_widgets(); |
216 | 216 | $this->toolbars->setSizePolicy('app-toolbars'); |
@@ -250,12 +250,12 @@ discard block |
||
250 | 250 | */ |
251 | 251 | public function addMessageInfo() |
252 | 252 | { |
253 | - if(isset($_SESSION['app_msginfo'])){ |
|
253 | + if (isset($_SESSION['app_msginfo'])) { |
|
254 | 254 | |
255 | 255 | // all widget have static id to not change id of others widgets in page |
256 | 256 | |
257 | 257 | $infoMessages = $_SESSION['app_msginfo']; |
258 | - foreach ($infoMessages as $infoLine){ |
|
258 | + foreach ($infoMessages as $infoLine) { |
|
259 | 259 | $this->App() |
260 | 260 | ->Controller() |
261 | 261 | ->addMessage($infoLine); |
@@ -272,8 +272,7 @@ discard block |
||
272 | 272 | if (!$isGroupField && method_exists($this, $displayFieldMethod)) { |
273 | 273 | $widget = $this->$displayFieldMethod($customSection, $label); |
274 | 274 | $item = $widget; |
275 | - } |
|
276 | - else { |
|
275 | + } else { |
|
277 | 276 | if($isGroupField){ |
278 | 277 | list(, $groupId) = explode('_fieldsGroup', $displayFieldId); |
279 | 278 | if (method_exists($this, '__fieldsGroup')) { |
@@ -282,8 +281,7 @@ discard block |
||
282 | 281 | $customSection->fieldsLayout = $originalFieldsLayout; |
283 | 282 | } |
284 | 283 | $sizePolicy .= ' customsection-fieldsgroup-box'; |
285 | - } |
|
286 | - else{ |
|
284 | + } else{ |
|
287 | 285 | try{ |
288 | 286 | $field = $recordSet->getField($displayFieldName); |
289 | 287 | if ($label === '' || $label === '__') { |
@@ -351,8 +349,7 @@ discard block |
||
351 | 349 | $sizePolicy .= isset($parameters['sizePolicy']) ? $parameters['sizePolicy'] : ''; |
352 | 350 | if (!$isGroupField && method_exists($this, $displayFieldMethod)) { |
353 | 351 | $item = $this->$displayFieldMethod($customSection, $label); |
354 | - } |
|
355 | - else{ |
|
352 | + } else{ |
|
356 | 353 | if($isGroupField){ |
357 | 354 | list(, $groupId) = explode('_fieldsGroup', $displayFieldId); |
358 | 355 | if (method_exists($this, '__fieldsGroup')) { |
@@ -361,8 +358,7 @@ discard block |
||
361 | 358 | $customSection->fieldsLayout = $wantedFieldsLayout; |
362 | 359 | } |
363 | 360 | $sizePolicy .= ' customsection-fieldsgroup-box'; |
364 | - } |
|
365 | - else{ |
|
361 | + } else{ |
|
366 | 362 | try { |
367 | 363 | $field = $this->recordSet->getField($displayFieldName); |
368 | 364 | if (!isset($label) || empty($label)) { |
@@ -414,8 +410,7 @@ discard block |
||
414 | 410 | $displayFieldMethod = '_' . $displayFieldName; |
415 | 411 | if (method_exists($this, $displayFieldMethod)) { |
416 | 412 | $item = $this->$displayFieldMethod($customSection, $labelField); |
417 | - } |
|
418 | - else if ($recordSet->fieldExist($displayFieldName)) { |
|
413 | + } else if ($recordSet->fieldExist($displayFieldName)) { |
|
419 | 414 | $field = $recordSet->getField($displayFieldName); |
420 | 415 | if ($labelField === '') { |
421 | 416 | $labelField = $field->getDescription(); |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | |
41 | 41 | class AppRecordEditor extends AppEditor |
42 | 42 | { |
43 | - public function __construct(FuncApp $app, $id = null, WidgetLayout $layout = null,AppRecord $record = null) |
|
43 | + public function __construct(FuncApp $app, $id = null, WidgetLayout $layout = null, AppRecord $record = null) |
|
44 | 44 | { |
45 | 45 | $this->record = $record; |
46 | 46 | parent::__construct($app, $id, $layout); |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | */ |
56 | 56 | protected function getRecordSet() |
57 | 57 | { |
58 | - if(!isset($this->recordSet)){ |
|
58 | + if (!isset($this->recordSet)) { |
|
59 | 59 | $this->recordSet = parent::getRecordSet(); |
60 | 60 | } |
61 | 61 | return $this->recordSet; |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | |
192 | 192 | public function addSections($view) |
193 | 193 | { |
194 | - echo '<!-- VIEW (' . $view . ') -->'; |
|
194 | + echo '<!-- VIEW ('.$view.') -->'; |
|
195 | 195 | $App = $this->App(); |
196 | 196 | $W = bab_Widgets(); |
197 | 197 | |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | continue; |
240 | 240 | } |
241 | 241 | |
242 | - list(, , $nbCol) = explode('-', $customSection->sizePolicy); |
|
242 | + list(,, $nbCol) = explode('-', $customSection->sizePolicy); |
|
243 | 243 | |
244 | 244 | if ($currentColumn + $nbCol > 12) { |
245 | 245 | $container->addItem($row); |
@@ -271,14 +271,14 @@ discard block |
||
271 | 271 | $sizePolicy = 'customsection-field-box '; |
272 | 272 | $sizePolicy .= isset($parameters['sizePolicy']) ? $parameters['sizePolicy'] : ''; |
273 | 273 | $sizePolicy .= isset($parameters['transparentBackground']) && $parameters['transparentBackground'] ? 'customsection-field-box-transparentBackground' : ''; |
274 | - $displayFieldMethod = '_' . $displayFieldName; |
|
274 | + $displayFieldMethod = '_'.$displayFieldName; |
|
275 | 275 | |
276 | 276 | if (!$isGroupField && method_exists($this, $displayFieldMethod)) { |
277 | 277 | $widget = $this->$displayFieldMethod($customSection, $label); |
278 | 278 | $item = $widget; |
279 | 279 | } |
280 | 280 | else { |
281 | - if($isGroupField){ |
|
281 | + if ($isGroupField) { |
|
282 | 282 | list(, $groupId) = explode('_fieldsGroup', $displayFieldId); |
283 | 283 | if (method_exists($this, '__fieldsGroup')) { |
284 | 284 | $customSection->fieldsLayout = $groupFieldsLayout; |
@@ -287,8 +287,8 @@ discard block |
||
287 | 287 | } |
288 | 288 | $sizePolicy .= ' customsection-fieldsgroup-box'; |
289 | 289 | } |
290 | - else{ |
|
291 | - try{ |
|
290 | + else { |
|
291 | + try { |
|
292 | 292 | $field = $recordSet->getField($displayFieldName); |
293 | 293 | if ($label === '' || $label === '__') { |
294 | 294 | $label = $field->getDescription(); |
@@ -350,14 +350,14 @@ discard block |
||
350 | 350 | $parameters = $displayField['parameters']; |
351 | 351 | $classname = isset($parameters['classname']) ? $parameters['classname'] : ''; |
352 | 352 | $label = isset($parameters['label']) && !empty($parameters['label']) && $parameters['label'] !== '__' ? $parameters['label'] : null; |
353 | - $displayFieldMethod = '_' . $displayFieldName; |
|
353 | + $displayFieldMethod = '_'.$displayFieldName; |
|
354 | 354 | $sizePolicy = 'customsection-field-box '; |
355 | 355 | $sizePolicy .= isset($parameters['sizePolicy']) ? $parameters['sizePolicy'] : ''; |
356 | 356 | if (!$isGroupField && method_exists($this, $displayFieldMethod)) { |
357 | 357 | $item = $this->$displayFieldMethod($customSection, $label); |
358 | 358 | } |
359 | - else{ |
|
360 | - if($isGroupField){ |
|
359 | + else { |
|
360 | + if ($isGroupField) { |
|
361 | 361 | list(, $groupId) = explode('_fieldsGroup', $displayFieldId); |
362 | 362 | if (method_exists($this, '__fieldsGroup')) { |
363 | 363 | $customSection->fieldsLayout = $groupFieldsLayout; |
@@ -366,7 +366,7 @@ discard block |
||
366 | 366 | } |
367 | 367 | $sizePolicy .= ' customsection-fieldsgroup-box'; |
368 | 368 | } |
369 | - else{ |
|
369 | + else { |
|
370 | 370 | try { |
371 | 371 | $field = $this->recordSet->getField($displayFieldName); |
372 | 372 | if (!isset($label) || empty($label)) { |
@@ -408,14 +408,14 @@ discard block |
||
408 | 408 | $groupField = $customSection->getField('_fieldsGroup'.$groupId); |
409 | 409 | $recordSet = $this->getRecordSet(); |
410 | 410 | |
411 | - if(isset($groupField['fields'])){ |
|
412 | - foreach ($groupField['fields'] as $field){ |
|
411 | + if (isset($groupField['fields'])) { |
|
412 | + foreach ($groupField['fields'] as $field) { |
|
413 | 413 | $item = null; |
414 | 414 | |
415 | 415 | $labelField = isset($field['parameters']['label']) ? $field['parameters']['label'] : ''; |
416 | 416 | $itemClass = isset($field['parameters']['classname']) ? $field['parameters']['classname'] : ''; |
417 | 417 | $displayFieldName = $field['fieldname']; |
418 | - $displayFieldMethod = '_' . $displayFieldName; |
|
418 | + $displayFieldMethod = '_'.$displayFieldName; |
|
419 | 419 | if (method_exists($this, $displayFieldMethod)) { |
420 | 420 | $item = $this->$displayFieldMethod($customSection, $labelField); |
421 | 421 | } |
@@ -433,7 +433,7 @@ discard block |
||
433 | 433 | } |
434 | 434 | $item = $this->getValueItem($customSection, $field, $labelField, $item); |
435 | 435 | } |
436 | - if(isset($item)){ |
|
436 | + if (isset($item)) { |
|
437 | 437 | $item->addClass('app-customsection-groupedfield'); |
438 | 438 | $item->addClass($itemClass); |
439 | 439 | $box->addItem($item); |
@@ -69,8 +69,7 @@ |
||
69 | 69 | case 'visible_in_shop': |
70 | 70 | if(self::getRecordFieldValue($record, $fieldPath)){ |
71 | 71 | return $W->Label($App->translate('Yes')); |
72 | - } |
|
73 | - else{ |
|
72 | + } else{ |
|
74 | 73 | return $W->Label($App->translate('No')); |
75 | 74 | } |
76 | 75 | break; |
@@ -55,14 +55,14 @@ discard block |
||
55 | 55 | |
56 | 56 | case '_actions_': |
57 | 57 | $box = $W->FlowItems(); |
58 | - if($record->isUpdatable()){ |
|
58 | + if ($record->isUpdatable()) { |
|
59 | 59 | $box->addItem($W->Link('', $App->Controller() |
60 | 60 | ->CustomField() |
61 | 61 | ->edit($record->id)) |
62 | 62 | ->addClass('icon', \FuncIcons::ACTIONS_DOCUMENT_EDIT) |
63 | 63 | ->setOpenMode(WidgetLink::OPEN_DIALOG_AND_RELOAD)); |
64 | 64 | } |
65 | - if($record->isDeletable()){ |
|
65 | + if ($record->isDeletable()) { |
|
66 | 66 | $box->addItem($W->Link('', $App->Controller() |
67 | 67 | ->CustomField() |
68 | 68 | ->confirmDelete($record->id)) |
@@ -74,10 +74,10 @@ discard block |
||
74 | 74 | |
75 | 75 | case 'mandatory': |
76 | 76 | case 'visible_in_shop': |
77 | - if(self::getRecordFieldValue($record, $fieldPath)){ |
|
77 | + if (self::getRecordFieldValue($record, $fieldPath)) { |
|
78 | 78 | return $W->Label($App->translate('Yes')); |
79 | 79 | } |
80 | - else{ |
|
80 | + else { |
|
81 | 81 | return $W->Label($App->translate('No')); |
82 | 82 | } |
83 | 83 | break; |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | $this->addColumn(Widget_TableModelViewColumn($recordSet->visible, $App->translate('Visible in list'))->addClass('widget-10em')); |
106 | 106 | $this->addColumn(Widget_TableModelViewColumn('_actions_', '')->setSortable(false) |
107 | 107 | ->addClass('widget-column-thin', 'widget-nowrap', FuncIcons::ICON_LEFT_SYMBOLIC)); |
108 | - if($App->onlineShop){ |
|
108 | + if ($App->onlineShop) { |
|
109 | 109 | $this->addColumn(Widget_TableModelViewColumn($recordSet->visible_in_shop, $App->translate('Visible in online shop'))); |
110 | 110 | } |
111 | 111 |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | public function display() |
36 | 36 | { |
37 | 37 | $App = $this->App(); |
38 | - if(!bab_isUserAdministrator()) { |
|
38 | + if (!bab_isUserAdministrator()) { |
|
39 | 39 | throw new AppAccessException($App->translate('You do not have access to this page')); |
40 | 40 | } |
41 | 41 | |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | public function configureSSE() |
75 | 75 | { |
76 | 76 | $App = $this->App(); |
77 | - if(!bab_isUserAdministrator()) { |
|
77 | + if (!bab_isUserAdministrator()) { |
|
78 | 78 | throw new AppAccessException($App->translate('You do not have access to this page')); |
79 | 79 | } |
80 | 80 |