Passed
Branchfeature/useWidgetsNamespaces (eb4650)
by Robin
02:57
created
programs/Ui/AppExportSelectEditor.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
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);
@@ -109,8 +109,8 @@  discard block
 block discarded – undo
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()
Please login to merge, or discard this patch.
programs/Ui/Page/AppPage.php 2 patches
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -137,8 +137,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
         
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
         
60 60
         /** @var \Func_Icons  $I */
61 61
         $I = \bab_Functionality::get('Icons');
62
-        if($I){
62
+        if ($I) {
63 63
             $I->includeCss();
64 64
         }
65 65
         
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
      */
107 107
     public function addItem(WidgetDisplayableInterface $item = null, $order = null)
108 108
     {
109
-        if(! isset($this->mainPanel)){
109
+        if (!isset($this->mainPanel)) {
110 110
             $W = bab_widgets();
111 111
             $this->mainPanel = $W->VBoxLayout();
112 112
         }
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
     {
128 128
         $W = bab_widgets();
129 129
         
130
-        if(null === $this->context){
130
+        if (null === $this->context) {
131 131
             
132 132
             $isAjaxRequest = (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest');
133 133
             $contextPanelId = $isAjaxRequest ? null : 'app_context_panel';
@@ -135,10 +135,10 @@  discard block
 block discarded – undo
135 135
             $this->context = $W->Frame($contextPanelId, $W->VBoxLayout()
136 136
                 ->setVerticalSpacing(2, 'em'));
137 137
         }
138
-        if(isset($title)){
138
+        if (isset($title)) {
139 139
             $this->context->addItem($W->Section($title, $item, 4), $position);
140 140
         }
141
-        else{
141
+        else {
142 142
             $this->context->addItem($item, $position);
143 143
         }
144 144
         return $this;
@@ -154,7 +154,7 @@  discard block
 block discarded – undo
154 154
     {
155 155
         $W = bab_widgets();
156 156
         
157
-        if(null === $this->toolbars){
157
+        if (null === $this->toolbars) {
158 158
             $this->toolbars = $W->Frame(null, $W->VBoxItems());
159 159
         }
160 160
         $this->toolbars->addItem($item);
@@ -167,10 +167,10 @@  discard block
 block discarded – undo
167 167
         $W = bab_widgets();
168 168
         
169 169
         $mainPanel = $W->Frame(null, $this->mainPanel);
170
-        if(bab_isAjaxRequest()){
170
+        if (bab_isAjaxRequest()) {
171 171
             $mainPanel->addClass('app_main_panel');
172 172
         }
173
-        else{
173
+        else {
174 174
             $mainPanel->setId('app_main_panel');
175 175
         }
176 176
         
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
     {
188 188
         $mainPanel = $this->getMainPanel();
189 189
         
190
-        if($this->context){
190
+        if ($this->context) {
191 191
             
192 192
             $W = bab_widgets();
193 193
             
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
     
205 205
     protected function addToolbars(WidgetItem $mainPanel)
206 206
     {
207
-        if($this->toolbars){
207
+        if ($this->toolbars) {
208 208
             
209 209
             $W = bab_widgets();
210 210
             
@@ -244,12 +244,12 @@  discard block
 block discarded – undo
244 244
      */
245 245
     public function addMessageInfo()
246 246
     {
247
-        if(isset($_SESSION['app_msginfo'])){
247
+        if (isset($_SESSION['app_msginfo'])) {
248 248
             
249 249
             // all widget have static id to not change id of others widgets in page
250 250
             
251 251
             $infoMessages = $_SESSION['app_msginfo'];
252
-            foreach ($infoMessages as $infoLine){
252
+            foreach ($infoMessages as $infoLine) {
253 253
                 $this->App()
254 254
                     ->Controller()
255 255
                     ->addMessage($infoLine);
Please login to merge, or discard this patch.
programs/Ui/AppRecordEditor.php 2 patches
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
      */
52 52
     protected function getRecordSet()
53 53
     {
54
-        if(!isset($this->recordSet)){
54
+        if (!isset($this->recordSet)) {
55 55
             $this->recordSet = parent::getRecordSet();
56 56
         }
57 57
         return $this->recordSet;
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 
188 188
     public function addSections($view)
189 189
     {
190
-        echo '<!-- VIEW (' . $view . ') -->';
190
+        echo '<!-- VIEW ('.$view.') -->';
191 191
         $App = $this->App();
192 192
         $W = bab_Widgets();
193 193
 
@@ -235,7 +235,7 @@  discard block
 block discarded – undo
235 235
                     continue;
236 236
                 }
237 237
     
238
-                list(, , $nbCol) = explode('-', $customSection->sizePolicy);
238
+                list(,, $nbCol) = explode('-', $customSection->sizePolicy);
239 239
     
240 240
                 if ($currentColumn + $nbCol > 12) {
241 241
                     $container->addItem($row);
@@ -267,14 +267,14 @@  discard block
 block discarded – undo
267 267
                     $sizePolicy = 'customsection-field-box ';
268 268
                     $sizePolicy .= isset($parameters['sizePolicy']) ? $parameters['sizePolicy'] : '';
269 269
                     $sizePolicy .= isset($parameters['transparentBackground']) && $parameters['transparentBackground'] ? 'customsection-field-box-transparentBackground' : '';
270
-                    $displayFieldMethod = '_' . $displayFieldName;
270
+                    $displayFieldMethod = '_'.$displayFieldName;
271 271
     
272 272
                     if (!$isGroupField && method_exists($this, $displayFieldMethod)) {
273 273
                         $widget = $this->$displayFieldMethod($customSection, $label);
274 274
                         $item = $widget;
275 275
                     } 
276 276
                     else {
277
-                        if($isGroupField){
277
+                        if ($isGroupField) {
278 278
                             list(, $groupId) = explode('_fieldsGroup', $displayFieldId);
279 279
                             if (method_exists($this, '__fieldsGroup')) {
280 280
                                 $customSection->fieldsLayout = $groupFieldsLayout;
@@ -283,8 +283,8 @@  discard block
 block discarded – undo
283 283
                             }
284 284
                             $sizePolicy .= ' customsection-fieldsgroup-box';
285 285
                         }
286
-                        else{
287
-                            try{
286
+                        else {
287
+                            try {
288 288
                                 $field = $recordSet->getField($displayFieldName);
289 289
                                 if ($label === '' || $label === '__') {
290 290
                                     $label = $field->getDescription();
@@ -346,14 +346,14 @@  discard block
 block discarded – undo
346 346
             $parameters = $displayField['parameters'];
347 347
             $classname = isset($parameters['classname']) ? $parameters['classname'] : '';
348 348
             $label = isset($parameters['label']) && !empty($parameters['label']) && $parameters['label'] !== '__' ? $parameters['label'] : null;
349
-            $displayFieldMethod = '_' . $displayFieldName;
349
+            $displayFieldMethod = '_'.$displayFieldName;
350 350
             $sizePolicy = 'customsection-field-box ';
351 351
             $sizePolicy .= isset($parameters['sizePolicy']) ? $parameters['sizePolicy'] : '';
352 352
             if (!$isGroupField && method_exists($this, $displayFieldMethod)) {
353 353
                 $item = $this->$displayFieldMethod($customSection, $label);
354 354
             }
355
-            else{
356
-                if($isGroupField){
355
+            else {
356
+                if ($isGroupField) {
357 357
                     list(, $groupId) = explode('_fieldsGroup', $displayFieldId);
358 358
                     if (method_exists($this, '__fieldsGroup')) {
359 359
                         $customSection->fieldsLayout = $groupFieldsLayout;
@@ -362,7 +362,7 @@  discard block
 block discarded – undo
362 362
                     }
363 363
                     $sizePolicy .= ' customsection-fieldsgroup-box';
364 364
                 }
365
-                else{
365
+                else {
366 366
                     try {
367 367
                         $field = $this->recordSet->getField($displayFieldName);
368 368
                         if (!isset($label) || empty($label)) {
@@ -404,14 +404,14 @@  discard block
 block discarded – undo
404 404
         $groupField = $customSection->getField('_fieldsGroup'.$groupId);
405 405
         $recordSet = $this->getRecordSet();
406 406
         
407
-        if(isset($groupField['fields'])){
408
-            foreach ($groupField['fields'] as $field){
407
+        if (isset($groupField['fields'])) {
408
+            foreach ($groupField['fields'] as $field) {
409 409
                 $item = null;
410 410
                 
411 411
                 $labelField = isset($field['parameters']['label']) ? $field['parameters']['label'] : '';
412 412
                 $itemClass = isset($field['parameters']['classname']) ? $field['parameters']['classname'] : '';
413 413
                 $displayFieldName = $field['fieldname'];
414
-                $displayFieldMethod = '_' . $displayFieldName;
414
+                $displayFieldMethod = '_'.$displayFieldName;
415 415
                 if (method_exists($this, $displayFieldMethod)) {
416 416
                     $item = $this->$displayFieldMethod($customSection, $labelField);
417 417
                 }
@@ -429,7 +429,7 @@  discard block
 block discarded – undo
429 429
                     }
430 430
                     $item = $this->getValueItem($customSection, $field, $labelField, $item);
431 431
                 }
432
-                if(isset($item)){
432
+                if (isset($item)) {
433 433
                     $item->addClass('app-customsection-groupedfield');
434 434
                     $item->addClass($itemClass);
435 435
                     $box->addItem($item);
Please login to merge, or discard this patch.
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -272,8 +272,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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();
Please login to merge, or discard this patch.
programs/Ui/AppCustomFieldTableView.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -48,14 +48,14 @@  discard block
 block discarded – undo
48 48
             
49 49
             case '_actions_':
50 50
                 $box = $W->FlowItems();
51
-                if($record->isUpdatable()){
51
+                if ($record->isUpdatable()) {
52 52
                     $box->addItem($W->Link('', $App->Controller()
53 53
                         ->CustomField()
54 54
                         ->edit($record->id))
55 55
                         ->addClass('icon', \Func_Icons::ACTIONS_DOCUMENT_EDIT)
56 56
                         ->setOpenMode(WidgetLink::OPEN_DIALOG_AND_RELOAD));
57 57
                 }
58
-                if($record->isDeletable()){
58
+                if ($record->isDeletable()) {
59 59
                     $box->addItem($W->Link('', $App->Controller()
60 60
                         ->CustomField()
61 61
                         ->confirmDelete($record->id))
@@ -67,10 +67,10 @@  discard block
 block discarded – undo
67 67
             
68 68
             case 'mandatory':
69 69
             case 'visible_in_shop':
70
-                if(self::getRecordFieldValue($record, $fieldPath)){
70
+                if (self::getRecordFieldValue($record, $fieldPath)) {
71 71
                     return $W->Label($App->translate('Yes'));
72 72
                 }
73
-                else{
73
+                else {
74 74
                     return $W->Label($App->translate('No'));
75 75
                 }
76 76
                 break;
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
         $this->addColumn(WidgetTableModelViewColumn($recordSet->visible, $App->translate('Visible in list'))->addClass('widget-10em'));
99 99
         $this->addColumn(WidgetTableModelViewColumn('_actions_', '')->setSortable(false)
100 100
             ->addClass('widget-column-thin', 'widget-nowrap', \Func_Icons::ICON_LEFT_SYMBOLIC));
101
-        if($App->onlineShop){
101
+        if ($App->onlineShop) {
102 102
             $this->addColumn(WidgetTableModelViewColumn($recordSet->visible_in_shop, $App->translate('Visible in online shop')));
103 103
         }
104 104
         
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -69,8 +69,7 @@
 block discarded – undo
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;
Please login to merge, or discard this patch.
programs/main.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -23,16 +23,16 @@
 block discarded – undo
23 23
  */
24 24
 use Capwelton\Widgets\Widgets\Helpers\WidgetAction;
25 25
 
26
-require_once dirname(__FILE__) . '/functions.php';
26
+require_once dirname(__FILE__).'/functions.php';
27 27
 
28 28
 $App = app_App();
29 29
 
30
-try{
30
+try {
31 31
     $controller = $App->Controller();
32 32
     $action = WidgetAction::fromRequest();
33 33
     $controller->execute($action);
34 34
 }
35
-catch (bab_UnknownActionException $e){
36
-    die('<div class="app-error">' . $App->translate('We have a problem finding this page...') . '</div>');
35
+catch (bab_UnknownActionException $e) {
36
+    die('<div class="app-error">'.$App->translate('We have a problem finding this page...').'</div>');
37 37
 }
38 38
 
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -31,8 +31,7 @@
 block discarded – undo
31 31
     $controller = $App->Controller();
32 32
     $action = WidgetAction::fromRequest();
33 33
     $controller->execute($action);
34
-}
35
-catch (bab_UnknownActionException $e){
34
+} catch (bab_UnknownActionException $e){
36 35
     die('<div class="app-error">' . $App->translate('We have a problem finding this page...') . '</div>');
37 36
 }
38 37
 
Please login to merge, or discard this patch.
programs/AppComponent.php 1 patch
Spacing   +19 added lines, -19 removed lines patch added patch discarded remove patch
@@ -68,15 +68,15 @@  discard block
 block discarded – undo
68 68
     {
69 69
         $main = new \ReflectionClass($this->set);
70 70
         $dependencies = array();
71
-        if($main->hasMethod('getRequiredComponents')){
71
+        if ($main->hasMethod('getRequiredComponents')) {
72 72
             $requiredComponents = $this->recordSet()->getRequiredComponents();
73
-            foreach ($requiredComponents as $requiredComponent){
73
+            foreach ($requiredComponents as $requiredComponent) {
74 74
                 $dependencies['requiredComponents'][] = $requiredComponent;
75 75
             }
76 76
         }
77
-        if($main->hasMethod('getOptionalComponents')){
77
+        if ($main->hasMethod('getOptionalComponents')) {
78 78
             $optionalComponents = $this->recordSet()->getOptionalComponents();
79
-            foreach ($optionalComponents as $optionalComponent){
79
+            foreach ($optionalComponents as $optionalComponent) {
80 80
                 $dependencies['optionalComponents'][] = $optionalComponent;
81 81
             }
82 82
         }
@@ -92,20 +92,20 @@  discard block
 block discarded – undo
92 92
     
93 93
     public function getPackageName()
94 94
     {
95
-        if(! isset($this->packageName) || empty($this->packageName)){
95
+        if (!isset($this->packageName) || empty($this->packageName)) {
96 96
             $packageName = '';
97 97
             $setRc = new \ReflectionClass($this->set);
98 98
             // Tries to automatically retrieve the package name from the definition.json
99
-            if($setRc){
99
+            if ($setRc) {
100 100
                 // Get definition file path
101 101
                 $definitionPathParts = explode('/', $setRc->getFileName());
102 102
                 $definitionPath = implode('/', (array_splice($definitionPathParts, 0, - 3)));
103 103
                 $definitionPath .= '/definition.json';
104 104
                 $definitionContent = file_get_contents($definitionPath);
105
-                if($definitionContent){
105
+                if ($definitionContent) {
106 106
                     // Get definition.json content
107 107
                     $definitionContent = json_decode($definitionContent, true);
108
-                    if($definitionContent && isset($definitionContent['name'])){
108
+                    if ($definitionContent && isset($definitionContent['name'])) {
109 109
                         // Get name in definition.json
110 110
                         $definitionNameParts = explode('/', $definitionContent['name']);
111 111
                         $packageName = $definitionNameParts[count($definitionNameParts) - 1];
@@ -125,7 +125,7 @@  discard block
 block discarded – undo
125 125
     public function onUpdate()
126 126
     {
127 127
         $main = new \ReflectionClass($this->set);
128
-        if($main->hasMethod('onUpdate')){
128
+        if ($main->hasMethod('onUpdate')) {
129 129
             $this->recordSet()->onUpdate();
130 130
         }
131 131
     }
@@ -135,12 +135,12 @@  discard block
 block discarded – undo
135 135
      */
136 136
     public function controller($proxy = true)
137 137
     {
138
-        if(! isset($this->controllerObject)){
138
+        if (!isset($this->controllerObject)) {
139 139
             $this->app->includeRecordController();
140 140
             $ctrl = $this->controller;
141 141
             $this->controllerObject = new $ctrl($this->app, $this);
142 142
         }
143
-        if($proxy){
143
+        if ($proxy) {
144 144
             return $this->controllerObject->proxy();
145 145
         }
146 146
         return $this->controllerObject;
@@ -160,9 +160,9 @@  discard block
 block discarded – undo
160 160
     public function ui()
161 161
     {
162 162
         $this->app->includeUi();
163
-        if(! isset($this->uiObject)){
163
+        if (!isset($this->uiObject)) {
164 164
             $ui = $this->ui;
165
-            if(! isset($ui)){
165
+            if (!isset($ui)) {
166 166
                 return null;
167 167
             }
168 168
             $this->uiObject = new $ui($this->app);
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
     public function getSetClassName()
180 180
     {
181 181
         $reflectionClass = new \ReflectionClass($this->set);
182
-        return $this->app->classPrefix . $reflectionClass->getShortName();
182
+        return $this->app->classPrefix.$reflectionClass->getShortName();
183 183
     }
184 184
     
185 185
     public function getRecordClassName()
@@ -195,8 +195,8 @@  discard block
 block discarded – undo
195 195
     
196 196
     public function getDefinition()
197 197
     {
198
-        $componentDefinitionObjectName = 'Capwelton\App\\' . $this->getPackageName() . '\ComponentDefinition\ComponentDefinition';
199
-        if(class_exists($componentDefinitionObjectName)){
198
+        $componentDefinitionObjectName = 'Capwelton\App\\'.$this->getPackageName().'\ComponentDefinition\ComponentDefinition';
199
+        if (class_exists($componentDefinitionObjectName)) {
200 200
             return new $componentDefinitionObjectName();
201 201
         }
202 202
         return null;
@@ -205,7 +205,7 @@  discard block
 block discarded – undo
205 205
     public function getLangPath()
206 206
     {
207 207
         $def = $this->getDefinition();
208
-        if($def){
208
+        if ($def) {
209 209
             return $def->getLangPath($this->app);
210 210
         }
211 211
         return null;
@@ -214,7 +214,7 @@  discard block
 block discarded – undo
214 214
     public function getStylePath()
215 215
     {
216 216
         $def = $this->getDefinition();
217
-        if($def){
217
+        if ($def) {
218 218
             return $def->getStylePath($this->app);
219 219
         }
220 220
         return null;
@@ -223,7 +223,7 @@  discard block
 block discarded – undo
223 223
     public function getScriptPath()
224 224
     {
225 225
         $def = $this->getDefinition();
226
-        if($def){
226
+        if ($def) {
227 227
             return $def->getScriptPath($this->app);
228 228
         }
229 229
         return null;
Please login to merge, or discard this patch.
programs/Ctrl/AppCtrlAddonConfiguration.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
         
Please login to merge, or discard this patch.
programs/Ctrl/AppCtrlCustomField.php 2 patches
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -131,8 +131,7 @@  discard block
 block discarded – undo
131 131
         
132 132
         if(empty($customfield['id'])){
133 133
             $record = $set->newRecord();
134
-        }
135
-        else{
134
+        } else{
136 135
             $record = $set->get($customfield['id']);
137 136
         }
138 137
         
@@ -142,8 +141,7 @@  discard block
 block discarded – undo
142 141
                 $enumvalues[$enumkey] = $set->enumvalues->input($enumvalue);
143 142
             }
144 143
             $record->enumvalues = serialize($enumvalues);
145
-        }
146
-        else{
144
+        } else{
147 145
             $record->enumvalues = '';
148 146
         }
149 147
         
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
         $page->addClass('app-page-editor');
103 103
         $page->setTitle($App->translate('Edit custom field'));
104 104
         
105
-        if(null !== $customfield){
105
+        if (null !== $customfield) {
106 106
             $set = $App->CustomFieldSet();
107 107
             $customfield = $set->request($customfield);
108 108
         }
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
         
112 112
         $page->addItem($form);
113 113
         
114
-        if($customfield instanceof AppCustomField){
114
+        if ($customfield instanceof AppCustomField) {
115 115
             $actionsFrame = $page->ActionsFrame();
116 116
             $page->addContextItem($actionsFrame);
117 117
             
@@ -131,21 +131,21 @@  discard block
 block discarded – undo
131 131
         
132 132
         $set = $App->CustomFieldSet();
133 133
         
134
-        if(empty($customfield['id'])){
134
+        if (empty($customfield['id'])) {
135 135
             $record = $set->newRecord();
136 136
         }
137
-        else{
137
+        else {
138 138
             $record = $set->get($customfield['id']);
139 139
         }
140 140
         
141
-        if('Enum' === $customfield['fieldtype'] || 'Set' === $customfield['fieldtype']){
141
+        if ('Enum' === $customfield['fieldtype'] || 'Set' === $customfield['fieldtype']) {
142 142
             $enumvalues = array();
143
-            foreach ($customfield['enumvalues'] as $enumkey => $enumvalue){
143
+            foreach ($customfield['enumvalues'] as $enumkey => $enumvalue) {
144 144
                 $enumvalues[$enumkey] = $set->enumvalues->input($enumvalue);
145 145
             }
146 146
             $record->enumvalues = serialize($enumvalues);
147 147
         }
148
-        else{
148
+        else {
149 149
             $record->enumvalues = '';
150 150
         }
151 151
         
@@ -156,11 +156,11 @@  discard block
 block discarded – undo
156 156
         
157 157
         // refresh target table structure
158 158
         
159
-        $object = $record->object . 'Set';
159
+        $object = $record->object.'Set';
160 160
         $mysqlbackend = new ORMMySqlBackend($GLOBALS['babDB']);
161 161
         
162 162
         $recordSet = $App->$object();
163
-        if(method_exists($recordSet, 'useLang')){
163
+        if (method_exists($recordSet, 'useLang')) {
164 164
             // This is necessary if the recordSet constructor uses a setLang().
165 165
             // We need to revert to multilang fields before synchronizing.
166 166
             $recordSet->useLang(false);
@@ -168,7 +168,7 @@  discard block
 block discarded – undo
168 168
         
169 169
         $sql = $mysqlbackend->setToSql($recordSet);
170 170
         
171
-        require_once $GLOBALS['babInstallPath'] . 'utilit/devtools.php';
171
+        require_once $GLOBALS['babInstallPath'].'utilit/devtools.php';
172 172
         $synchronize = new \bab_synchronizeSql();
173 173
         $synchronize->fromSqlString($sql);
174 174
         
@@ -183,17 +183,17 @@  discard block
 block discarded – undo
183 183
     {
184 184
         $App = $this->App();
185 185
         
186
-        if(! $customfield){
186
+        if (!$customfield) {
187 187
             throw new AppAccessException($App->translate('Access denied'));
188 188
         }
189 189
         
190 190
         $set = $App->CustomFieldSet();
191 191
         $record = $set->request($customfield);
192
-        $object = $record->object . 'Set';
192
+        $object = $record->object.'Set';
193 193
         $set->delete($set->id->is($customfield));
194 194
         
195 195
         $recordSet = $App->$object();
196
-        if(method_exists($recordSet, 'useLang')){
196
+        if (method_exists($recordSet, 'useLang')) {
197 197
             // This is necessary if the recordSet constructor uses a setLang().
198 198
             // We need to revert to multilang fields before synchronizing.
199 199
             $recordSet->useLang(false);
@@ -202,7 +202,7 @@  discard block
 block discarded – undo
202 202
         $mysqlbackend = new ORMMySqlBackend($GLOBALS['babDB']);
203 203
         $sql = $mysqlbackend->setToSql($recordSet);
204 204
         
205
-        require_once $GLOBALS['babInstallPath'] . 'utilit/devtools.php';
205
+        require_once $GLOBALS['babInstallPath'].'utilit/devtools.php';
206 206
         $synchronize = new \bab_synchronizeSql();
207 207
         $synchronize->fromSqlString($sql);
208 208
         
Please login to merge, or discard this patch.
programs/Ctrl/AppCtrlNotification.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 use Capwelton\Widgets\Widgets\Item\WidgetLink;
27 27
 use Capwelton\Widgets\Widgets\Layout\WidgetFlexLayout;
28 28
 use Capwelton\LibApp\Set\AppNotification;
29
-require_once APP_CTRL_PATH . '/record.ctrl.php';
29
+require_once APP_CTRL_PATH.'/record.ctrl.php';
30 30
 
31 31
 /**
32 32
  * This controller manages actions that can be performed on notifications
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
             ->popup($notifBox->getId()));
57 57
         $page->addClass(AppNotification::NOTIFICATION_PORTLET_CLASS);
58 58
         
59
-        foreach ($notifications as $notification){
59
+        foreach ($notifications as $notification) {
60 60
             $notifBox->addItem($W->Link($notification->title, $this->proxy()
61 61
                 ->display($notification->id))
62 62
                 ->setOpenMode(WidgetLink::OPEN_DIALOG));
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
     {
70 70
         $set = $this->getRecordSet();
71 71
         $record = $set->get($id);
72
-        if(! $record){
72
+        if (!$record) {
73 73
             return true;
74 74
         }
75 75
         
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
         $notifSet = $App->NotificationSet();
113 113
         
114 114
         $box = $W->FlowItems()->setIconFormat(24, 'center');
115
-        if(isset($itemId)){
115
+        if (isset($itemId)) {
116 116
             $box->setId($itemId);
117 117
         }
118 118
         $notifs = $notifSet->selectUserNotifications();
@@ -123,7 +123,7 @@  discard block
 block discarded – undo
123 123
         
124 124
         $box->addItem($btnWidget = $W->FlexItems())
125 125
             ->setIcon(16, 'left');
126
-        if($nbNotif > 0){
126
+        if ($nbNotif > 0) {
127 127
             $btnWidget->addItem($W->Label($nbNotif)
128 128
                 ->addClass('notificationNumber'));
129 129
             $btnWidget->addClass('notificationDisplayButton');
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
                 ->addClass('notificationBoxElements')
147 147
                 ->setDirection(WidgetFlexLayout::FLEX_DIRECTION_COL));
148 148
             
149
-            foreach ($notifs as $notif){
149
+            foreach ($notifs as $notif) {
150 150
                 $notificationBoxElements->addItem($W->Link($el = $W->FlexItems($W->Label($notif->title)
151 151
                     ->addClass('notificationElementTitle'), $W->Label(date('d/m/Y H:i', strtotime($notif->createdOn)))
152 152
                     ->addClass('notificationElementDate'))
@@ -154,10 +154,10 @@  discard block
 block discarded – undo
154 154
                     ->display($notif->id))
155 155
                     ->addClass('notificationBoxElement')
156 156
                     ->setOpenMode(WidgetLink::OPEN_DIALOG));
157
-                if(! empty($notif->description)){
157
+                if (!empty($notif->description)) {
158 158
                     $desc = $notif->description;
159
-                    if(strlen($desc) > 40){
160
-                        $desc = trim(substr($desc, 0, 40)) . '...';
159
+                    if (strlen($desc) > 40) {
160
+                        $desc = trim(substr($desc, 0, 40)).'...';
161 161
                     }
162 162
                     $el->addItem($W->Label($desc)
163 163
                         ->addClass('notificationElementDescription'), 1);
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
             
170 170
             $box->addItem($notificationBox);
171 171
         }
172
-        else{
172
+        else {
173 173
             $notifIcon .= 'webapp-bell-o';
174 174
         }
175 175
         
@@ -211,7 +211,7 @@  discard block
 block discarded – undo
211 211
         
212 212
         $notifSet = $App->NotificationSet();
213 213
         $notifs = $notifSet->selectUserNotifications();
214
-        foreach ($notifs as $notif){
214
+        foreach ($notifs as $notif) {
215 215
             $notif->markAsSeen();
216 216
         }
217 217
         
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -168,8 +168,7 @@
 block discarded – undo
168 168
                 ->addClass('notificationElementShowMore'));
169 169
             
170 170
             $box->addItem($notificationBox);
171
-        }
172
-        else{
171
+        } else{
173 172
             $notifIcon .= 'webapp-bell-o';
174 173
         }
175 174
         
Please login to merge, or discard this patch.