@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | if (empty($description)) { |
74 | 74 | $description = $field->getName(); |
75 | 75 | } |
76 | - $fieldLabel = $W->Label($description . ':'); |
|
76 | + $fieldLabel = $W->Label($description.':'); |
|
77 | 77 | |
78 | 78 | if ($field instanceof ORMDateField) { |
79 | 79 | $widget = $W->DatePicker(); |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | if (empty($description)) { |
130 | 130 | $description = $field->getName(); |
131 | 131 | } |
132 | - $fieldLabel = $W->Label($description . ':'); |
|
132 | + $fieldLabel = $W->Label($description.':'); |
|
133 | 133 | |
134 | 134 | if ($field instanceof ORMDateField) { |
135 | 135 | $widget = $W->PeriodPicker(); |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | $nbOptions = 0; |
233 | 233 | foreach ($iterator as $record) { |
234 | 234 | if (isset($record->code)) { |
235 | - $optionText = $record->code . ' - ' . $record->$fieldName; |
|
235 | + $optionText = $record->code.' - '.$record->$fieldName; |
|
236 | 236 | } else { |
237 | 237 | $optionText = $record->$fieldName; |
238 | 238 | } |
@@ -314,18 +314,18 @@ discard block |
||
314 | 314 | $set = $parentSet->$fieldName; |
315 | 315 | $records = $set->select(); |
316 | 316 | $pkName = $set->getPrimaryKey(); |
317 | - if($set->fieldExist("name")){ |
|
317 | + if ($set->fieldExist("name")) { |
|
318 | 318 | $displayField = $set->name->getName(); |
319 | - }else if(method_exists($set,"getDisplayNameField")){ |
|
319 | + } else if (method_exists($set, "getDisplayNameField")) { |
|
320 | 320 | $displayField = $set->getDisplayNameField()->getName(); |
321 | - }else{ |
|
321 | + } else { |
|
322 | 322 | $displayField = $pkName; |
323 | 323 | } |
324 | 324 | $records->orderAsc($set->$displayField); |
325 | - if($records->count() > 50){ |
|
325 | + if ($records->count() > 50) { |
|
326 | 326 | $widget = bab_Widgets()->select2(); |
327 | 327 | $widget->setDataSource($set->getController()->search()); |
328 | - }else{ |
|
328 | + } else { |
|
329 | 329 | $widget = $W->Select(); |
330 | 330 | $widget->addOption('', ''); |
331 | 331 | foreach ($records as $record) { |
@@ -316,16 +316,16 @@ |
||
316 | 316 | $pkName = $set->getPrimaryKey(); |
317 | 317 | if($set->fieldExist("name")){ |
318 | 318 | $displayField = $set->name->getName(); |
319 | - }else if(method_exists($set,"getDisplayNameField")){ |
|
319 | + } else if(method_exists($set,"getDisplayNameField")){ |
|
320 | 320 | $displayField = $set->getDisplayNameField()->getName(); |
321 | - }else{ |
|
321 | + } else{ |
|
322 | 322 | $displayField = $pkName; |
323 | 323 | } |
324 | 324 | $records->orderAsc($set->$displayField); |
325 | 325 | if($records->count() > 50){ |
326 | 326 | $widget = bab_Widgets()->select2(); |
327 | 327 | $widget->setDataSource($set->getController()->search()); |
328 | - }else{ |
|
328 | + } else{ |
|
329 | 329 | $widget = $W->Select(); |
330 | 330 | $widget->addOption('', ''); |
331 | 331 | foreach ($records as $record) { |
@@ -63,50 +63,50 @@ discard block |
||
63 | 63 | |
64 | 64 | function app_genericSetEditor(ORMRecordSet $set) |
65 | 65 | { |
66 | - $O = BabFunctionality::get('LibOrm'); |
|
67 | - $O->init(); |
|
68 | - $W = bab_Widgets(); |
|
69 | - $layout = $W->VBoxLayout(); |
|
70 | - $layout->setVerticalSpacing(1, 'em'); |
|
71 | - |
|
72 | - |
|
73 | - $fields = $set->getFields(); |
|
74 | - |
|
75 | - foreach ($fields as $field) { |
|
76 | - $description = $field->getDescription(); |
|
77 | - if (empty($description)) { |
|
78 | - $description = $field->getName(); |
|
79 | - } |
|
80 | - $fieldLabel = $W->Label($description . ':'); |
|
81 | - |
|
82 | - if ($field instanceof ORMDateField) { |
|
83 | - $widget = $W->DatePicker(); |
|
84 | - } else if ($field instanceof ORMTimeField) { |
|
85 | - $widget = $W->LineEdit()->setMaxSize(5)->setSize(5)->addClass('widget-timepicker'); |
|
86 | - } else if ($field instanceof ORMStringField) { |
|
87 | - $widget = $W->LineEdit()->setSize(min(array(80, $field->getMaxLength()))); |
|
88 | - } else if ($field instanceof ORMEnumField) { |
|
89 | - $widget = $W->Select(); |
|
90 | - $widget->addOption('', ''); |
|
91 | - foreach ($field->getValues() as $key => $text) { |
|
92 | - $widget->addOption($key, $text); |
|
93 | - } |
|
94 | - } else if ($field instanceof ORMIntField) { |
|
95 | - $widget = $W->LineEdit()->setSize(9); |
|
96 | - } else if ($field instanceof ORMTextField) { |
|
97 | - $widget = $W->TextEdit()->setColumns(80)->setLines(5); |
|
98 | - } else if ($field instanceof ORMRecordSet) { |
|
99 | - $widget = app_genericSetEditor($field); |
|
100 | - $widget->addClass('sub-form'); |
|
101 | - } else { |
|
102 | - $widget = null; |
|
103 | - } |
|
104 | - if (isset($widget)) { |
|
105 | - $layout->addItem($W->VBoxLayout()->addItem($fieldLabel)->addItem($widget)); |
|
106 | - } |
|
107 | - } |
|
108 | - |
|
109 | - return $layout; |
|
66 | + $O = BabFunctionality::get('LibOrm'); |
|
67 | + $O->init(); |
|
68 | + $W = bab_Widgets(); |
|
69 | + $layout = $W->VBoxLayout(); |
|
70 | + $layout->setVerticalSpacing(1, 'em'); |
|
71 | + |
|
72 | + |
|
73 | + $fields = $set->getFields(); |
|
74 | + |
|
75 | + foreach ($fields as $field) { |
|
76 | + $description = $field->getDescription(); |
|
77 | + if (empty($description)) { |
|
78 | + $description = $field->getName(); |
|
79 | + } |
|
80 | + $fieldLabel = $W->Label($description . ':'); |
|
81 | + |
|
82 | + if ($field instanceof ORMDateField) { |
|
83 | + $widget = $W->DatePicker(); |
|
84 | + } else if ($field instanceof ORMTimeField) { |
|
85 | + $widget = $W->LineEdit()->setMaxSize(5)->setSize(5)->addClass('widget-timepicker'); |
|
86 | + } else if ($field instanceof ORMStringField) { |
|
87 | + $widget = $W->LineEdit()->setSize(min(array(80, $field->getMaxLength()))); |
|
88 | + } else if ($field instanceof ORMEnumField) { |
|
89 | + $widget = $W->Select(); |
|
90 | + $widget->addOption('', ''); |
|
91 | + foreach ($field->getValues() as $key => $text) { |
|
92 | + $widget->addOption($key, $text); |
|
93 | + } |
|
94 | + } else if ($field instanceof ORMIntField) { |
|
95 | + $widget = $W->LineEdit()->setSize(9); |
|
96 | + } else if ($field instanceof ORMTextField) { |
|
97 | + $widget = $W->TextEdit()->setColumns(80)->setLines(5); |
|
98 | + } else if ($field instanceof ORMRecordSet) { |
|
99 | + $widget = app_genericSetEditor($field); |
|
100 | + $widget->addClass('sub-form'); |
|
101 | + } else { |
|
102 | + $widget = null; |
|
103 | + } |
|
104 | + if (isset($widget)) { |
|
105 | + $layout->addItem($W->VBoxLayout()->addItem($fieldLabel)->addItem($widget)); |
|
106 | + } |
|
107 | + } |
|
108 | + |
|
109 | + return $layout; |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | |
@@ -119,50 +119,50 @@ discard block |
||
119 | 119 | */ |
120 | 120 | function app_genericSetFilterForm(ORMRecordSet $set) |
121 | 121 | { |
122 | - $O = BabFunctionality::get('LibOrm'); |
|
123 | - $O->init(); |
|
124 | - $W = bab_Widgets(); |
|
125 | - $layout = $W->FlowLayout(); |
|
126 | - $layout->setVerticalSpacing(1, 'em')->setHorizontalSpacing(1, 'em'); |
|
127 | - |
|
128 | - |
|
129 | - $fields = $set->getFields(); |
|
130 | - |
|
131 | - foreach ($fields as $field) { |
|
132 | - $description = $field->getDescription(); |
|
133 | - if (empty($description)) { |
|
134 | - $description = $field->getName(); |
|
135 | - } |
|
136 | - $fieldLabel = $W->Label($description . ':'); |
|
137 | - |
|
138 | - if ($field instanceof ORMDateField) { |
|
139 | - $widget = $W->PeriodPicker(); |
|
140 | - } else if ($field instanceof ORMTimeField) { |
|
141 | - $widget = $W->TimePicker(); |
|
142 | - } else if ($field instanceof ORMStringField) { |
|
143 | - $widget = $W->LineEdit()->setSize(min(array(15, $field->getMaxLength()))); |
|
144 | - } else if ($field instanceof ORMEnumField) { |
|
145 | - $widget = $W->Select(); |
|
146 | - $widget->addOption('', ''); |
|
147 | - foreach ($field->getValues() as $key => $text) { |
|
148 | - $widget->addOption($key, $text); |
|
149 | - } |
|
150 | - } else if ($field instanceof ORMIntField) { |
|
151 | - $widget = $W->LineEdit()->setSize(9); |
|
152 | - } else if ($field instanceof ORMTextField) { |
|
153 | - $widget = $widget = $W->LineEdit()->setSize(15); |
|
154 | - } else if ($field instanceof ORMRecordSet) { |
|
155 | - $widget = app_genericSetFilterForm($field); |
|
156 | - $widget->addClass('sub-form'); |
|
157 | - } else { |
|
158 | - $widget = null; |
|
159 | - } |
|
160 | - if (isset($widget)) { |
|
161 | - $layout->addItem($W->VBoxLayout()->addItem($fieldLabel)->addItem($widget)); |
|
162 | - } |
|
163 | - } |
|
164 | - |
|
165 | - return $layout; |
|
122 | + $O = BabFunctionality::get('LibOrm'); |
|
123 | + $O->init(); |
|
124 | + $W = bab_Widgets(); |
|
125 | + $layout = $W->FlowLayout(); |
|
126 | + $layout->setVerticalSpacing(1, 'em')->setHorizontalSpacing(1, 'em'); |
|
127 | + |
|
128 | + |
|
129 | + $fields = $set->getFields(); |
|
130 | + |
|
131 | + foreach ($fields as $field) { |
|
132 | + $description = $field->getDescription(); |
|
133 | + if (empty($description)) { |
|
134 | + $description = $field->getName(); |
|
135 | + } |
|
136 | + $fieldLabel = $W->Label($description . ':'); |
|
137 | + |
|
138 | + if ($field instanceof ORMDateField) { |
|
139 | + $widget = $W->PeriodPicker(); |
|
140 | + } else if ($field instanceof ORMTimeField) { |
|
141 | + $widget = $W->TimePicker(); |
|
142 | + } else if ($field instanceof ORMStringField) { |
|
143 | + $widget = $W->LineEdit()->setSize(min(array(15, $field->getMaxLength()))); |
|
144 | + } else if ($field instanceof ORMEnumField) { |
|
145 | + $widget = $W->Select(); |
|
146 | + $widget->addOption('', ''); |
|
147 | + foreach ($field->getValues() as $key => $text) { |
|
148 | + $widget->addOption($key, $text); |
|
149 | + } |
|
150 | + } else if ($field instanceof ORMIntField) { |
|
151 | + $widget = $W->LineEdit()->setSize(9); |
|
152 | + } else if ($field instanceof ORMTextField) { |
|
153 | + $widget = $widget = $W->LineEdit()->setSize(15); |
|
154 | + } else if ($field instanceof ORMRecordSet) { |
|
155 | + $widget = app_genericSetFilterForm($field); |
|
156 | + $widget->addClass('sub-form'); |
|
157 | + } else { |
|
158 | + $widget = null; |
|
159 | + } |
|
160 | + if (isset($widget)) { |
|
161 | + $layout->addItem($W->VBoxLayout()->addItem($fieldLabel)->addItem($widget)); |
|
162 | + } |
|
163 | + } |
|
164 | + |
|
165 | + return $layout; |
|
166 | 166 | } |
167 | 167 | |
168 | 168 | |
@@ -175,47 +175,47 @@ discard block |
||
175 | 175 | */ |
176 | 176 | function app_LabelledWidget($labelText, WidgetDisplayableInterface $widget) |
177 | 177 | { |
178 | - $W = bab_Widgets(); |
|
179 | - |
|
180 | - $label = $W->Label($labelText); |
|
181 | - if ($widget instanceof WidgetInputWidget) { |
|
182 | - $label->setAssociatedWidget($widget); |
|
183 | - } |
|
184 | - |
|
185 | - if ($widget instanceof WidgetCheckBox) { |
|
186 | - $layout = $W->HBoxItems( |
|
187 | - $widget->setSizePolicy(WidgetSizePolicy::MINIMUM), |
|
188 | - $label |
|
189 | - )->setVerticalAlign('middle')->setHorizontalSpacing(0.5, 'em'); |
|
190 | - } else { |
|
191 | - $layout = $W->VBoxItems( |
|
192 | - $label, |
|
193 | - $widget |
|
194 | - )->setVerticalSpacing(0.5, 'em'); |
|
195 | - } |
|
196 | - |
|
197 | - return $layout; |
|
178 | + $W = bab_Widgets(); |
|
179 | + |
|
180 | + $label = $W->Label($labelText); |
|
181 | + if ($widget instanceof WidgetInputWidget) { |
|
182 | + $label->setAssociatedWidget($widget); |
|
183 | + } |
|
184 | + |
|
185 | + if ($widget instanceof WidgetCheckBox) { |
|
186 | + $layout = $W->HBoxItems( |
|
187 | + $widget->setSizePolicy(WidgetSizePolicy::MINIMUM), |
|
188 | + $label |
|
189 | + )->setVerticalAlign('middle')->setHorizontalSpacing(0.5, 'em'); |
|
190 | + } else { |
|
191 | + $layout = $W->VBoxItems( |
|
192 | + $label, |
|
193 | + $widget |
|
194 | + )->setVerticalSpacing(0.5, 'em'); |
|
195 | + } |
|
196 | + |
|
197 | + return $layout; |
|
198 | 198 | } |
199 | 199 | |
200 | 200 | |
201 | 201 | |
202 | 202 | function app_LabelledCheckbox($labelText, $checkboxName, $options = null) |
203 | 203 | { |
204 | - $W = bab_Widgets(); |
|
204 | + $W = bab_Widgets(); |
|
205 | 205 | |
206 | - $label = $W->Label($labelText)->colon(false); |
|
207 | - $checkbox = $W->Checkbox()->setName($checkboxName); |
|
208 | - $label->setAssociatedWidget($checkbox); |
|
209 | - if (isset($options)) { |
|
210 | - $label->setSizePolicy(WidgetSizePolicy::FIXED)->setCanvasOptions($options); |
|
211 | - } |
|
206 | + $label = $W->Label($labelText)->colon(false); |
|
207 | + $checkbox = $W->Checkbox()->setName($checkboxName); |
|
208 | + $label->setAssociatedWidget($checkbox); |
|
209 | + if (isset($options)) { |
|
210 | + $label->setSizePolicy(WidgetSizePolicy::FIXED)->setCanvasOptions($options); |
|
211 | + } |
|
212 | 212 | |
213 | - $layout = $W->HBoxItems( |
|
214 | - $checkbox->setSizePolicy(WidgetSizePolicy::MINIMUM), |
|
215 | - $label |
|
216 | - )->setVerticalAlign('middle')->setHorizontalSpacing(0.5, 'em'); |
|
213 | + $layout = $W->HBoxItems( |
|
214 | + $checkbox->setSizePolicy(WidgetSizePolicy::MINIMUM), |
|
215 | + $label |
|
216 | + )->setVerticalAlign('middle')->setHorizontalSpacing(0.5, 'em'); |
|
217 | 217 | |
218 | - return $layout; |
|
218 | + return $layout; |
|
219 | 219 | } |
220 | 220 | |
221 | 221 | |
@@ -223,42 +223,42 @@ discard block |
||
223 | 223 | |
224 | 224 | function app_LabelledOrmSelect(ORMMySqlIterator $iterator, $fieldName, $selectName, $label, $hidden = false, $groupFieldName = null) |
225 | 225 | { |
226 | - $W = bab_Widgets(); |
|
227 | - |
|
228 | - if (isset($groupFieldName)) { |
|
229 | - $groupPathElements = explode('/', $groupFieldName); |
|
230 | - } |
|
231 | - |
|
232 | - $select = $W->Select()->setName($selectName); |
|
233 | - |
|
234 | - $select->addOption('', ''); |
|
235 | - |
|
236 | - $nbOptions = 0; |
|
237 | - foreach ($iterator as $record) { |
|
238 | - if (isset($record->code)) { |
|
239 | - $optionText = $record->code . ' - ' . $record->$fieldName; |
|
240 | - } else { |
|
241 | - $optionText = $record->$fieldName; |
|
242 | - } |
|
243 | - if (isset($groupFieldName)) { |
|
244 | - $group = $record; |
|
245 | - foreach ($groupPathElements as $groupPathElement) { |
|
246 | - $group = $group->$groupPathElement; |
|
247 | - } |
|
248 | - $select->addOption($record->id, $optionText, $group); |
|
249 | - } else { |
|
250 | - $select->addOption($record->id, $optionText); |
|
251 | - } |
|
252 | - $nbOptions++; |
|
253 | - $lastId = $record->id; |
|
254 | - } |
|
255 | - |
|
256 | - if ($nbOptions == 1) { |
|
257 | - $select->setValue($lastId); |
|
258 | - } |
|
259 | - |
|
260 | - |
|
261 | - return app_LabelledWidget($label, $select); |
|
226 | + $W = bab_Widgets(); |
|
227 | + |
|
228 | + if (isset($groupFieldName)) { |
|
229 | + $groupPathElements = explode('/', $groupFieldName); |
|
230 | + } |
|
231 | + |
|
232 | + $select = $W->Select()->setName($selectName); |
|
233 | + |
|
234 | + $select->addOption('', ''); |
|
235 | + |
|
236 | + $nbOptions = 0; |
|
237 | + foreach ($iterator as $record) { |
|
238 | + if (isset($record->code)) { |
|
239 | + $optionText = $record->code . ' - ' . $record->$fieldName; |
|
240 | + } else { |
|
241 | + $optionText = $record->$fieldName; |
|
242 | + } |
|
243 | + if (isset($groupFieldName)) { |
|
244 | + $group = $record; |
|
245 | + foreach ($groupPathElements as $groupPathElement) { |
|
246 | + $group = $group->$groupPathElement; |
|
247 | + } |
|
248 | + $select->addOption($record->id, $optionText, $group); |
|
249 | + } else { |
|
250 | + $select->addOption($record->id, $optionText); |
|
251 | + } |
|
252 | + $nbOptions++; |
|
253 | + $lastId = $record->id; |
|
254 | + } |
|
255 | + |
|
256 | + if ($nbOptions == 1) { |
|
257 | + $select->setValue($lastId); |
|
258 | + } |
|
259 | + |
|
260 | + |
|
261 | + return app_LabelledWidget($label, $select); |
|
262 | 262 | } |
263 | 263 | |
264 | 264 | |
@@ -307,36 +307,36 @@ discard block |
||
307 | 307 | ->setMaxSize($field->getMaxLength()); |
308 | 308 | } else if ($field instanceof ORMTextField) { |
309 | 309 | $widget = $W->TextEdit() |
310 | - ->addClass('widget-autoresize'); |
|
310 | + ->addClass('widget-autoresize'); |
|
311 | 311 | } else if ($field instanceof ORMPkField) { |
312 | 312 | $widget = $W->Hidden(); |
313 | 313 | } else if ($field instanceof ORMFkField) { |
314 | 314 | |
315 | 315 | $fieldName = $field->getName(); |
316 | 316 | /** @var AppRecordSet $parentSet */ |
317 | - $parentSet = clone $field->getParentSet(); |
|
317 | + $parentSet = clone $field->getParentSet(); |
|
318 | 318 | $parentSet->join($fieldName); |
319 | 319 | $set = $parentSet->$fieldName; |
320 | 320 | $records = $set->select(); |
321 | - $pkName = $set->getPrimaryKey(); |
|
322 | - if($set->fieldExist("name")){ |
|
323 | - $displayField = $set->name->getName(); |
|
324 | - }else if(method_exists($set,"getDisplayNameField")){ |
|
325 | - $displayField = $set->getDisplayNameField()->getName(); |
|
326 | - }else{ |
|
327 | - $displayField = $pkName; |
|
328 | - } |
|
329 | - $records->orderAsc($set->$displayField); |
|
330 | - if($records->count() > 50){ |
|
331 | - $widget = bab_Widgets()->select2(); |
|
332 | - $widget->setDataSource($set->getController()->search()); |
|
333 | - }else{ |
|
334 | - $widget = $W->Select(); |
|
335 | - $widget->addOption('', ''); |
|
336 | - foreach ($records as $record) { |
|
337 | - $widget->addOption($record->$pkName, $record->$displayField); |
|
338 | - } |
|
339 | - } |
|
321 | + $pkName = $set->getPrimaryKey(); |
|
322 | + if($set->fieldExist("name")){ |
|
323 | + $displayField = $set->name->getName(); |
|
324 | + }else if(method_exists($set,"getDisplayNameField")){ |
|
325 | + $displayField = $set->getDisplayNameField()->getName(); |
|
326 | + }else{ |
|
327 | + $displayField = $pkName; |
|
328 | + } |
|
329 | + $records->orderAsc($set->$displayField); |
|
330 | + if($records->count() > 50){ |
|
331 | + $widget = bab_Widgets()->select2(); |
|
332 | + $widget->setDataSource($set->getController()->search()); |
|
333 | + }else{ |
|
334 | + $widget = $W->Select(); |
|
335 | + $widget->addOption('', ''); |
|
336 | + foreach ($records as $record) { |
|
337 | + $widget->addOption($record->$pkName, $record->$displayField); |
|
338 | + } |
|
339 | + } |
|
340 | 340 | } else if ($field instanceof ORMRecordSet) { |
341 | 341 | $widget = $W->Select(); |
342 | 342 | //// $widget = $W->MultiSelect()->setSingleSelect(); |
@@ -362,21 +362,21 @@ discard block |
||
362 | 362 | |
363 | 363 | function app_LabelledOrmWidget(ORMField $field, $label = null, $hidden = false) |
364 | 364 | { |
365 | - $W = bab_Widgets(); |
|
365 | + $W = bab_Widgets(); |
|
366 | 366 | |
367 | - if ($hidden) { |
|
368 | - $widget = $W->Hidden(); |
|
369 | - $widget->setName($field->getName()); |
|
370 | - return $widget; |
|
371 | - } |
|
367 | + if ($hidden) { |
|
368 | + $widget = $W->Hidden(); |
|
369 | + $widget->setName($field->getName()); |
|
370 | + return $widget; |
|
371 | + } |
|
372 | 372 | |
373 | - if (is_null($label)) { |
|
374 | - $label = $field->getDescription(); |
|
375 | - } |
|
373 | + if (is_null($label)) { |
|
374 | + $label = $field->getDescription(); |
|
375 | + } |
|
376 | 376 | |
377 | - $widget = app_OrmWidget($field); |
|
377 | + $widget = app_OrmWidget($field); |
|
378 | 378 | |
379 | - return app_LabelledWidget($label, $widget); |
|
379 | + return app_LabelledWidget($label, $widget); |
|
380 | 380 | } |
381 | 381 | |
382 | 382 | |
@@ -392,16 +392,16 @@ discard block |
||
392 | 392 | */ |
393 | 393 | function app_dateTime(ORMField $field, $value) { |
394 | 394 | |
395 | - $W = bab_Widgets(); |
|
396 | - $name = $field->getName(); |
|
397 | - $label = $W->Label($field->getDescription()); |
|
395 | + $W = bab_Widgets(); |
|
396 | + $name = $field->getName(); |
|
397 | + $label = $W->Label($field->getDescription()); |
|
398 | 398 | |
399 | - $frame = app_dateTimeField($name, $label, $value); |
|
399 | + $frame = app_dateTimeField($name, $label, $value); |
|
400 | 400 | |
401 | - return $W->VBoxItems( |
|
402 | - $label, |
|
403 | - $frame |
|
404 | - ); |
|
401 | + return $W->VBoxItems( |
|
402 | + $label, |
|
403 | + $frame |
|
404 | + ); |
|
405 | 405 | |
406 | 406 | } |
407 | 407 | |
@@ -415,24 +415,24 @@ discard block |
||
415 | 415 | */ |
416 | 416 | function app_dateTimeField($fieldName, WidgetLabel $label, $value = null) |
417 | 417 | { |
418 | - $W = bab_Widgets(); |
|
418 | + $W = bab_Widgets(); |
|
419 | 419 | |
420 | - $datepart = $W->DatePicker()->setAssociatedLabel($label)->setName('date'); |
|
421 | - $timepart = $W->TimePicker()->setName('time'); |
|
420 | + $datepart = $W->DatePicker()->setAssociatedLabel($label)->setName('date'); |
|
421 | + $timepart = $W->TimePicker()->setName('time'); |
|
422 | 422 | |
423 | - if (isset($value)) { |
|
423 | + if (isset($value)) { |
|
424 | 424 | |
425 | - $value = explode(' ', $value); |
|
425 | + $value = explode(' ', $value); |
|
426 | 426 | |
427 | - $datepart->setValue($value[0]); |
|
428 | - $timepart->setValue($value[1]); |
|
429 | - } |
|
427 | + $datepart->setValue($value[0]); |
|
428 | + $timepart->setValue($value[1]); |
|
429 | + } |
|
430 | 430 | |
431 | - $datetime = $W->Frame(null, $W->HBoxLayout())->setName($fieldName) |
|
432 | - ->addItem($datepart) |
|
433 | - ->addItem($timepart); |
|
431 | + $datetime = $W->Frame(null, $W->HBoxLayout())->setName($fieldName) |
|
432 | + ->addItem($datepart) |
|
433 | + ->addItem($timepart); |
|
434 | 434 | |
435 | - return $datetime; |
|
435 | + return $datetime; |
|
436 | 436 | } |
437 | 437 | |
438 | 438 |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | |
43 | 43 | $this->tableview = $tableview; |
44 | 44 | |
45 | - if(isset($filter)){ |
|
45 | + if (isset($filter)) { |
|
46 | 46 | $this->setHiddenValues('filter', $filter); |
47 | 47 | } |
48 | 48 | $this->setHiddenValue('tg', $App->controllerTg); |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | { |
56 | 56 | $W = bab_Widgets(); |
57 | 57 | $this->addItem($W->VBoxItems($W->FlexItems($this->format(), $this->charset()) |
58 | - ->addClass('customsection-field-box customsection-fieldsgroup-box'), $this->columns())->setVerticalSpacing(2,'em')); |
|
58 | + ->addClass('customsection-field-box customsection-fieldsgroup-box'), $this->columns())->setVerticalSpacing(2, 'em')); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | protected function format() |
@@ -109,8 +109,8 @@ discard block |
||
109 | 109 | |
110 | 110 | $columns = $this->tableview->getVisibleColumns(); |
111 | 111 | |
112 | - foreach ($columns as $path => $column){ |
|
113 | - if(! $column->isExportable()){ |
|
112 | + foreach ($columns as $path => $column) { |
|
113 | + if (!$column->isExportable()) { |
|
114 | 114 | continue; |
115 | 115 | } |
116 | 116 | $columnList->addItem($W->FlexItems($W->LabelledWidget($column->getSelectableName(), $checkbox = $W->CheckBox() |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | { |
44 | 44 | $this->modelView = $modelView; |
45 | 45 | $this->modelViewId = $modelView->getId(); |
46 | - if(! isset($id) || empty($id)){ |
|
46 | + if (!isset($id) || empty($id)) { |
|
47 | 47 | $id = $this->getDefaultEditorId(); |
48 | 48 | } |
49 | 49 | parent::__construct($app, $id, $layout); |
@@ -95,11 +95,11 @@ discard block |
||
95 | 95 | ); |
96 | 96 | |
97 | 97 | $select = $W->Select(); |
98 | - foreach ($pagesLengths as $pagesLength){ |
|
98 | + foreach ($pagesLengths as $pagesLength) { |
|
99 | 99 | $select->addOption($pagesLength, $pagesLength); |
100 | 100 | } |
101 | 101 | $value = 15; |
102 | - if(($temp = $W->getUserConfiguration($this->modelViewId . '/pageLength', 'widgets')) != null){ |
|
102 | + if (($temp = $W->getUserConfiguration($this->modelViewId.'/pageLength', 'widgets')) != null) { |
|
103 | 103 | $value = $temp; |
104 | 104 | } |
105 | 105 | $select->setValue($value); |
@@ -114,20 +114,20 @@ discard block |
||
114 | 114 | $W = bab_Widgets(); |
115 | 115 | $columns = $this->modelView->getVisibleColumns(); |
116 | 116 | $sum = false; |
117 | - foreach($columns as $column){ |
|
117 | + foreach ($columns as $column) { |
|
118 | 118 | /** |
119 | 119 | * @var WidgetTableModelViewColumn $column |
120 | 120 | */ |
121 | - if($column->isSummable()){ |
|
121 | + if ($column->isSummable()) { |
|
122 | 122 | $sum = true; |
123 | 123 | break; |
124 | 124 | } |
125 | 125 | } |
126 | - if(!$sum){ |
|
126 | + if (!$sum) { |
|
127 | 127 | return null; |
128 | 128 | } |
129 | 129 | $checkbox = $W->CheckBox(); |
130 | - $checkbox->setValue($W->getUserConfiguration($this->modelViewId . '/displaySubTotalRow', 'widgets')); |
|
130 | + $checkbox->setValue($W->getUserConfiguration($this->modelViewId.'/displaySubTotalRow', 'widgets')); |
|
131 | 131 | |
132 | 132 | return $W->LabelledWidget($this->App() |
133 | 133 | ->translate('Display subtotal rows'), $checkbox, 'displaySubTotalRow') |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | $columns = $this->modelView->getVisibleColumns(); |
143 | 143 | |
144 | 144 | $columnsBox = $W->VBoxItems(); |
145 | - $columnsBox->addAttribute("style","padding-top: 2em"); |
|
145 | + $columnsBox->addAttribute("style", "padding-top: 2em"); |
|
146 | 146 | $columnsBox->setId('tableviewColumnSelectionFormTopSubmitBox'); |
147 | 147 | $columnsBox->addClass('widget-100pc'); |
148 | 148 | |
@@ -158,12 +158,12 @@ discard block |
||
158 | 158 | ->setWrap(WidgetFlexLayout::FLEX_WRAP_WRAP))); |
159 | 159 | $col = 0; |
160 | 160 | |
161 | - foreach ($columns as $path => $column){ |
|
161 | + foreach ($columns as $path => $column) { |
|
162 | 162 | |
163 | - if(! $column->isInList()){ |
|
163 | + if (!$column->isInList()) { |
|
164 | 164 | continue; |
165 | 165 | } |
166 | - if($column->isSelectable() && $column->getSelectableName() != ''){ |
|
166 | + if ($column->isSelectable() && $column->getSelectableName() != '') { |
|
167 | 167 | $columnList->addItem($W->FlexItems($labelledWidget = $W->LabelledWidget($column->getSelectableName(), $W->CheckBox() |
168 | 168 | ->setValue($column->isVisible()), array( |
169 | 169 | 'columns', |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | ->addAttribute('style', 'flex-grow: 1; width: 33%;')); |
175 | 175 | $labelledWidget->getLabelWidget()->addClass('columnListElementLabel'); |
176 | 176 | } |
177 | - $col ++; |
|
177 | + $col++; |
|
178 | 178 | } |
179 | 179 | |
180 | 180 | return $columnsBox; |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | $W = $this->widgets; |
193 | 193 | $App = $this->App(); |
194 | 194 | |
195 | - if(isset($this->saveAction)){ |
|
195 | + if (isset($this->saveAction)) { |
|
196 | 196 | $saveLabel = isset($this->saveLabel) ? $this->saveLabel : $App->translate('Save'); |
197 | 197 | $submitButton = $W->SubmitButton(); |
198 | 198 | $submitButton->validate() |
@@ -200,13 +200,13 @@ discard block |
||
200 | 200 | ->setFailedAction($this->failedAction) |
201 | 201 | ->setSuccessAction($this->successAction) |
202 | 202 | ->setLabel($saveLabel); |
203 | - if($this->isAjax){ |
|
203 | + if ($this->isAjax) { |
|
204 | 204 | $submitButton->setAjaxAction(); |
205 | 205 | } |
206 | 206 | $this->addButton($submitButton); |
207 | 207 | } |
208 | 208 | |
209 | - if(isset($this->resetAction)){ |
|
209 | + if (isset($this->resetAction)) { |
|
210 | 210 | $resetLabel = isset($this->resetLabel) ? $this->resetLabel : $App->translate('Reset default columns'); |
211 | 211 | $resetButton = $W->SubmitButton(); |
212 | 212 | $resetButton->validate() |
@@ -215,13 +215,13 @@ discard block |
||
215 | 215 | ->setSuccessAction($this->resetAction) |
216 | 216 | ->addClass('resetButton') |
217 | 217 | ->setLabel($resetLabel); |
218 | - if($this->isAjax){ |
|
218 | + if ($this->isAjax) { |
|
219 | 219 | $resetButton->setAjaxAction(); |
220 | 220 | } |
221 | 221 | $this->addButton($resetButton); |
222 | 222 | } |
223 | 223 | |
224 | - if(isset($this->cancelAction)){ |
|
224 | + if (isset($this->cancelAction)) { |
|
225 | 225 | $cancelLabel = isset($this->cancelLabel) ? $this->cancelLabel : $App->translate('Cancel'); |
226 | 226 | $this->addButton($W->SubmitButton() |
227 | 227 | ->addClass('widget-close-dialog') |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | |
40 | 40 | public function __construct($id = null, WidgetLayout $layout = null) |
41 | 41 | { |
42 | - if(! isset($layout)){ |
|
42 | + if (!isset($layout)) { |
|
43 | 43 | $W = bab_Widgets(); |
44 | 44 | $layout = $W->FlowLayout()->setHorizontalSpacing(1, 'em'); |
45 | 45 | $layout->setVerticalAlign('top'); |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | { |
60 | 60 | $W = bab_Widgets(); |
61 | 61 | $button = $W->Link($labelText, $action, $id); |
62 | - if(isset($iconName)){ |
|
62 | + if (isset($iconName)) { |
|
63 | 63 | $button->addClass('icon', $iconName); |
64 | 64 | } |
65 | 65 | |
@@ -71,10 +71,10 @@ discard block |
||
71 | 71 | public function addInstantForm(WidgetDisplayableInterface $form, $labelText = null, $iconName = null, $action = null, $id = null) |
72 | 72 | { |
73 | 73 | $W = bab_Widgets(); |
74 | - if(isset($iconName)){ |
|
74 | + if (isset($iconName)) { |
|
75 | 75 | $content = $W->Icon($labelText, $iconName); |
76 | 76 | } |
77 | - else{ |
|
77 | + else { |
|
78 | 78 | $content = $labelText; |
79 | 79 | } |
80 | 80 | $button = $W->Link($content, $action, $id); |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | $this->addItem($W->VBoxItems($button->addClass('widget-instant-button'), $form->addClass('widget-instant-form')) |
83 | 83 | ->addClass('widget-instant-container')); |
84 | 84 | |
85 | - if($form->getTitle() === null){ |
|
85 | + if ($form->getTitle() === null) { |
|
86 | 86 | $form->setTitle($labelText); |
87 | 87 | } |
88 | 88 | |
@@ -91,10 +91,10 @@ discard block |
||
91 | 91 | |
92 | 92 | public function display(WidgetCanvas $canvas) |
93 | 93 | { |
94 | - if(! $this->local){ |
|
94 | + if (!$this->local) { |
|
95 | 95 | $this->addClass('widget-toolbar'); |
96 | 96 | } |
97 | - else{ |
|
97 | + else { |
|
98 | 98 | $this->addClass('app-toolbar'); |
99 | 99 | } |
100 | 100 | $this->addClass(FuncIcons::ICON_LEFT_16); |
@@ -73,8 +73,7 @@ discard block |
||
73 | 73 | $W = bab_Widgets(); |
74 | 74 | if(isset($iconName)){ |
75 | 75 | $content = $W->Icon($labelText, $iconName); |
76 | - } |
|
77 | - else{ |
|
76 | + } else{ |
|
78 | 77 | $content = $labelText; |
79 | 78 | } |
80 | 79 | $button = $W->Link($content, $action, $id); |
@@ -93,8 +92,7 @@ discard block |
||
93 | 92 | { |
94 | 93 | if(! $this->local){ |
95 | 94 | $this->addClass('widget-toolbar'); |
96 | - } |
|
97 | - else{ |
|
95 | + } else{ |
|
98 | 96 | $this->addClass('app-toolbar'); |
99 | 97 | } |
100 | 98 | $this->addClass(FuncIcons::ICON_LEFT_16); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | public function getSource() |
48 | 48 | { |
49 | 49 | $App = $this->App(); |
50 | - return $App->getRecordByRef($this->sourceClass . ':' . $this->sourceId); |
|
50 | + return $App->getRecordByRef($this->sourceClass.':'.$this->sourceId); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | /** |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | public function getTarget() |
57 | 57 | { |
58 | 58 | $App = $this->App(); |
59 | - return $App->getRecordByRef($this->targetClass . ':' . $this->targetId); |
|
59 | + return $App->getRecordByRef($this->targetClass.':'.$this->targetId); |
|
60 | 60 | } |
61 | 61 | } |
62 | 62 |
@@ -71,15 +71,15 @@ discard block |
||
71 | 71 | "requiredComponents" => array(), |
72 | 72 | "optionalComponents" => array() |
73 | 73 | ); |
74 | - if($main->hasMethod('getRequiredComponents')){ |
|
74 | + if ($main->hasMethod('getRequiredComponents')) { |
|
75 | 75 | $requiredComponents = $this->recordSet()->getRequiredComponents(); |
76 | - foreach ($requiredComponents as $requiredComponent){ |
|
76 | + foreach ($requiredComponents as $requiredComponent) { |
|
77 | 77 | $dependencies['requiredComponents'][] = $requiredComponent; |
78 | 78 | } |
79 | 79 | } |
80 | - if($main->hasMethod('getOptionalComponents')){ |
|
80 | + if ($main->hasMethod('getOptionalComponents')) { |
|
81 | 81 | $optionalComponents = $this->recordSet()->getOptionalComponents(); |
82 | - foreach ($optionalComponents as $optionalComponent){ |
|
82 | + foreach ($optionalComponents as $optionalComponent) { |
|
83 | 83 | $dependencies['optionalComponents'][] = $optionalComponent; |
84 | 84 | } |
85 | 85 | } |
@@ -95,20 +95,20 @@ discard block |
||
95 | 95 | |
96 | 96 | public function getPackageName() |
97 | 97 | { |
98 | - if(! isset($this->packageName) || empty($this->packageName)){ |
|
98 | + if (!isset($this->packageName) || empty($this->packageName)) { |
|
99 | 99 | $packageName = ''; |
100 | 100 | $setRc = new \ReflectionClass($this->set); |
101 | 101 | // Tries to automatically retrieve the package name from the definition.json |
102 | - if($setRc){ |
|
102 | + if ($setRc) { |
|
103 | 103 | // Get definition file path |
104 | 104 | $definitionPathParts = explode('/', $setRc->getFileName()); |
105 | 105 | $definitionPath = implode('/', (array_splice($definitionPathParts, 0, - 3))); |
106 | 106 | $definitionPath .= '/definition.json'; |
107 | 107 | $definitionContent = file_get_contents($definitionPath); |
108 | - if($definitionContent){ |
|
108 | + if ($definitionContent) { |
|
109 | 109 | // Get definition.json content |
110 | 110 | $definitionContent = json_decode($definitionContent, true); |
111 | - if($definitionContent && isset($definitionContent['name'])){ |
|
111 | + if ($definitionContent && isset($definitionContent['name'])) { |
|
112 | 112 | // Get name in definition.json |
113 | 113 | $definitionNameParts = explode('/', $definitionContent['name']); |
114 | 114 | $packageName = $definitionNameParts[count($definitionNameParts) - 1]; |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | public function onUpdate() |
129 | 129 | { |
130 | 130 | $main = new \ReflectionClass($this->set); |
131 | - if($main->hasMethod('onUpdate')){ |
|
131 | + if ($main->hasMethod('onUpdate')) { |
|
132 | 132 | $this->recordSet()->onUpdate(); |
133 | 133 | } |
134 | 134 | } |
@@ -138,12 +138,12 @@ discard block |
||
138 | 138 | */ |
139 | 139 | public function controller($proxy = true) |
140 | 140 | { |
141 | - if(! isset($this->controllerObject)){ |
|
141 | + if (!isset($this->controllerObject)) { |
|
142 | 142 | $this->app->includeRecordController(); |
143 | 143 | $ctrl = $this->controller; |
144 | 144 | $this->controllerObject = new $ctrl($this->app, $this); |
145 | 145 | } |
146 | - if($proxy){ |
|
146 | + if ($proxy) { |
|
147 | 147 | return $this->controllerObject->proxy(); |
148 | 148 | } |
149 | 149 | return $this->controllerObject; |
@@ -163,9 +163,9 @@ discard block |
||
163 | 163 | public function ui() |
164 | 164 | { |
165 | 165 | $this->app->includeUi(); |
166 | - if(! isset($this->uiObject)){ |
|
166 | + if (!isset($this->uiObject)) { |
|
167 | 167 | $ui = $this->ui; |
168 | - if(! isset($ui)){ |
|
168 | + if (!isset($ui)) { |
|
169 | 169 | return null; |
170 | 170 | } |
171 | 171 | $this->uiObject = new $ui($this->app); |
@@ -198,8 +198,8 @@ discard block |
||
198 | 198 | |
199 | 199 | public function getDefinition() |
200 | 200 | { |
201 | - $componentDefinitionObjectName = 'Capwelton\App\\' . $this->getPackageName() . '\ComponentDefinition\ComponentDefinition'; |
|
202 | - if(class_exists($componentDefinitionObjectName)){ |
|
201 | + $componentDefinitionObjectName = 'Capwelton\App\\'.$this->getPackageName().'\ComponentDefinition\ComponentDefinition'; |
|
202 | + if (class_exists($componentDefinitionObjectName)) { |
|
203 | 203 | return new $componentDefinitionObjectName(); |
204 | 204 | } |
205 | 205 | return null; |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | public function getLangPath() |
209 | 209 | { |
210 | 210 | $def = $this->getDefinition(); |
211 | - if($def){ |
|
211 | + if ($def) { |
|
212 | 212 | return $def->getLangPath($this->app); |
213 | 213 | } |
214 | 214 | return null; |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | public function getStylePath() |
218 | 218 | { |
219 | 219 | $def = $this->getDefinition(); |
220 | - if($def){ |
|
220 | + if ($def) { |
|
221 | 221 | return $def->getStylePath($this->app); |
222 | 222 | } |
223 | 223 | return null; |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | public function getScriptPath() |
227 | 227 | { |
228 | 228 | $def = $this->getDefinition(); |
229 | - if($def){ |
|
229 | + if ($def) { |
|
230 | 230 | return $def->getScriptPath($this->app); |
231 | 231 | } |
232 | 232 | return null; |
@@ -24,16 +24,16 @@ |
||
24 | 24 | use Capwelton\Widgets\Widgets\Helpers\WidgetAction; |
25 | 25 | use Cofy\Exception\BabUnknownActionException; |
26 | 26 | |
27 | -require_once dirname(__FILE__) . '/functions.php'; |
|
27 | +require_once dirname(__FILE__).'/functions.php'; |
|
28 | 28 | |
29 | 29 | $App = app_App(); |
30 | 30 | |
31 | -try{ |
|
31 | +try { |
|
32 | 32 | $controller = $App->Controller(); |
33 | 33 | $action = WidgetAction::fromRequest(); |
34 | 34 | $controller->execute($action); |
35 | 35 | } |
36 | -catch (BabUnknownActionException $e){ |
|
37 | - die('<div class="app-error">' . $App->translate('We have a problem finding this page...') . '</div>'); |
|
36 | +catch (BabUnknownActionException $e) { |
|
37 | + die('<div class="app-error">'.$App->translate('We have a problem finding this page...').'</div>'); |
|
38 | 38 | } |
39 | 39 |
@@ -32,8 +32,7 @@ |
||
32 | 32 | $controller = $App->Controller(); |
33 | 33 | $action = WidgetAction::fromRequest(); |
34 | 34 | $controller->execute($action); |
35 | -} |
|
36 | -catch (BabUnknownActionException $e){ |
|
35 | +} catch (BabUnknownActionException $e){ |
|
37 | 36 | die('<div class="app-error">' . $App->translate('We have a problem finding this page...') . '</div>'); |
38 | 37 | } |
39 | 38 |
@@ -36,25 +36,25 @@ |
||
36 | 36 | */ |
37 | 37 | public static function getLocaleApp() |
38 | 38 | { |
39 | - try{ |
|
39 | + try { |
|
40 | 40 | $rc = new \ReflectionClass(static::class); |
41 | 41 | $path = new BabPath($rc->getFileName()); |
42 | - for ($popLevel = 0; $popLevel < 7; $popLevel ++){ |
|
42 | + for ($popLevel = 0; $popLevel < 7; $popLevel++) { |
|
43 | 43 | $path->pop(); |
44 | 44 | } |
45 | 45 | $path->push('composer.json'); |
46 | - if(! $path->fileExists()){ |
|
46 | + if (!$path->fileExists()) { |
|
47 | 47 | return null; |
48 | 48 | } |
49 | 49 | |
50 | 50 | $composer = file_get_contents($path->tostring()); |
51 | 51 | $composerjson = json_decode($composer, true); |
52 | - if(!isset($composerjson['appFunctionality']) || empty($composerjson['appFunctionality'])){ |
|
52 | + if (!isset($composerjson['appFunctionality']) || empty($composerjson['appFunctionality'])) { |
|
53 | 53 | return null; |
54 | 54 | } |
55 | 55 | return BabFunctionality::get($composerjson['appFunctionality']); |
56 | 56 | } |
57 | - catch (\Exception $e){ |
|
57 | + catch (\Exception $e) { |
|
58 | 58 | return null; |
59 | 59 | } |
60 | 60 | } |
@@ -53,8 +53,7 @@ |
||
53 | 53 | return null; |
54 | 54 | } |
55 | 55 | return BabFunctionality::get($composerjson['appFunctionality']); |
56 | - } |
|
57 | - catch (\Exception $e){ |
|
56 | + } catch (\Exception $e){ |
|
58 | 57 | return null; |
59 | 58 | } |
60 | 59 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | $this->addon = bab_getAddonInfosInstance($app->getAddonName()); |
55 | 55 | } |
56 | 56 | |
57 | - public function getName(){ |
|
57 | + public function getName() { |
|
58 | 58 | return "Libapp portlet definition"; |
59 | 59 | } |
60 | 60 | |
@@ -94,13 +94,13 @@ discard block |
||
94 | 94 | { |
95 | 95 | $App = $this->App(); |
96 | 96 | $reflection = new ReflectionClass($App); |
97 | - if($reflection->inNamespace()){ |
|
97 | + if ($reflection->inNamespace()) { |
|
98 | 98 | $shortName = $reflection->getShortName(); |
99 | - }else{ |
|
99 | + } else { |
|
100 | 100 | $shortName = $reflection->getName(); |
101 | 101 | } |
102 | 102 | $app_path = BabFunctionalities::getPath($shortName); |
103 | - return $app_path . '*' . get_class($this); |
|
103 | + return $app_path.'*'.get_class($this); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | /** |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | { |
111 | 111 | $classname = get_class($this); |
112 | 112 | $suffix = mb_substr($classname, mb_strlen('AppPortletDefinition')); |
113 | - $classname = 'AppPortletUi' . $suffix; |
|
113 | + $classname = 'AppPortletUi'.$suffix; |
|
114 | 114 | |
115 | 115 | return new $classname($this->App()); |
116 | 116 | } |
@@ -96,7 +96,7 @@ |
||
96 | 96 | $reflection = new ReflectionClass($App); |
97 | 97 | if($reflection->inNamespace()){ |
98 | 98 | $shortName = $reflection->getShortName(); |
99 | - }else{ |
|
99 | + } else{ |
|
100 | 100 | $shortName = $reflection->getName(); |
101 | 101 | } |
102 | 102 | $app_path = BabFunctionalities::getPath($shortName); |