Passed
Push — master ( 02696d...e93494 )
by Robin
03:16
created
programs/ui/ui.class.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -34,13 +34,13 @@  discard block
 block discarded – undo
34 34
      */
35 35
     public function includeBase()
36 36
     {
37
-        require_once APP_UI_PATH . 'base.ui.php';
38
-        require_once APP_UI_PATH . 'ui.helpers.php';
37
+        require_once APP_UI_PATH.'base.ui.php';
38
+        require_once APP_UI_PATH.'ui.helpers.php';
39 39
     }
40 40
 
41 41
     public function includePage()
42 42
     {
43
-        require_once APP_UI_PATH . 'page.class.php';
43
+        require_once APP_UI_PATH.'page.class.php';
44 44
     }
45 45
 
46 46
     /**
@@ -77,25 +77,25 @@  discard block
 block discarded – undo
77 77
      */
78 78
     public function ExportSelectEditor($id, app_TableModelView $tableview, $filter = null)
79 79
     {
80
-        require_once dirname(__FILE__) . '/exportselect.ui.php';
80
+        require_once dirname(__FILE__).'/exportselect.ui.php';
81 81
         return new app_ExportSelectEditor($this->App(), $id, $tableview, $filter);
82 82
     }
83 83
     
84 84
     public function Chip($label, $labelIcon = null, $action = null, $actionIcon = null, $id = null)
85 85
     {
86
-        require_once APP_WIDGETS_PATH . 'chip.class.php';
86
+        require_once APP_WIDGETS_PATH.'chip.class.php';
87 87
         return new app_Chip($this->App(), $label, $labelIcon, $action, $actionIcon, $id);
88 88
     }
89 89
     
90 90
     public function CustomFieldTableView($id = null)
91 91
     {
92
-        require_once APP_UI_PATH . 'customfield.ui.php';
92
+        require_once APP_UI_PATH.'customfield.ui.php';
93 93
         return new app_CustomFieldTableView($this->App(), $id);
94 94
     }
95 95
     
96 96
     public function CustomFieldEditor(app_CustomField $customField = null, $id = null, $layout = null)
97 97
     {
98
-        require_once APP_UI_PATH . 'customfield.ui.php';
98
+        require_once APP_UI_PATH.'customfield.ui.php';
99 99
         return new app_CustomFieldEditor($this->App(), $customField, $id, $layout);
100 100
     }
101 101
 }
102 102
\ No newline at end of file
Please login to merge, or discard this patch.
programs/ui/base.ui.php 1 patch
Spacing   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 bab_Widgets()->includePhpClass('widget_InputWidget');
27 27
 bab_Widgets()->includePhpClass('widget_TableModelView');
28 28
 
29
-require_once dirname(__FILE__) . '/ui.helpers.php';
29
+require_once dirname(__FILE__).'/ui.helpers.php';
30 30
 
31 31
 /**
32 32
  * @return Widget_Form
@@ -676,7 +676,7 @@  discard block
 block discarded – undo
676 676
                 continue;
677 677
             }
678 678
 
679
-            list(, , $nbCol) = explode('-', $customSection->sizePolicy);
679
+            list(,, $nbCol) = explode('-', $customSection->sizePolicy);
680 680
 
681 681
             if ($currentColumn + $nbCol > 12) {
682 682
                 $this->addItem($row);
@@ -704,7 +704,7 @@  discard block
 block discarded – undo
704 704
                 $parameters = $displayField['parameters'];
705 705
                 $classname = isset($parameters['classname']) ? $parameters['classname'] : '';
706 706
                 $label = isset($parameters['label']) && $parameters['label'] !== '__' ? $parameters['label'] : '';
707
-                $displayFieldMethod = '_' . $displayFieldName;
707
+                $displayFieldMethod = '_'.$displayFieldName;
708 708
 
709 709
                 if (method_exists($this, $displayFieldMethod)) {
710 710
                     $widget = $this->$displayFieldMethod($customSection, $label);
@@ -762,7 +762,7 @@  discard block
 block discarded – undo
762 762
             $parameters = $displayField['parameters'];
763 763
             $classname = isset($parameters['classname']) ? $parameters['classname'] : '';
764 764
             $label = isset($parameters['label']) && $parameters['label'] !== '__' ? $parameters['label'] : '';
765
-            $displayFieldMethod = '_' . $displayFieldName;
765
+            $displayFieldMethod = '_'.$displayFieldName;
766 766
 
767 767
             if (method_exists($this, $displayFieldMethod)) {
768 768
                 $widget = $this->$displayFieldMethod($customSection, $label);
@@ -1047,7 +1047,7 @@  discard block
 block discarded – undo
1047 1047
         $row = $W->Items()->setSizePolicy('row');
1048 1048
         foreach ($customSections as $customSection) {
1049 1049
 
1050
-            list(, , $nbCol) = explode('-', $customSection->sizePolicy);
1050
+            list(,, $nbCol) = explode('-', $customSection->sizePolicy);
1051 1051
 
1052 1052
             if ($currentColumn + $nbCol > 12) {
1053 1053
                 $this->addItem($row);
@@ -1074,7 +1074,7 @@  discard block
 block discarded – undo
1074 1074
                 $parameters = $displayField['parameters'];
1075 1075
                 $classname = isset($parameters['classname']) ? $parameters['classname'] : '';
1076 1076
                 $label = isset($parameters['label']) ? $parameters['label'] : '';
1077
-                $displayFieldMethod = '_' . $displayFieldName;
1077
+                $displayFieldMethod = '_'.$displayFieldName;
1078 1078
 
1079 1079
                 if (method_exists($this, $displayFieldMethod)) {
1080 1080
                     $value = $this->$displayFieldMethod($customSection, $label);
@@ -1176,7 +1176,7 @@  discard block
 block discarded – undo
1176 1176
             // we try to select one according to the classname prefix.
1177 1177
             list($prefix) = explode('_', get_class($this));
1178 1178
             $functionalityName = ucwords($prefix);
1179
-            $this->app = @bab_functionality::get('App/' . $functionalityName);
1179
+            $this->app = @bab_functionality::get('App/'.$functionalityName);
1180 1180
             if (!$this->app) {
1181 1181
                 $this->app = @bab_functionality::get('App');
1182 1182
             }
@@ -1237,7 +1237,7 @@  discard block
 block discarded – undo
1237 1237
         $this->setCurrentPage(isset($filter['pageNumber']) ? $filter['pageNumber'] : $pageNumber);
1238 1238
 
1239 1239
         if (isset($name)) {
1240
-            $this->sortParameterName = $name . '[filter][sort]';
1240
+            $this->sortParameterName = $name.'[filter][sort]';
1241 1241
         } else {
1242 1242
             $this->sortParameterName = 'filter[sort]';
1243 1243
         }
@@ -1342,7 +1342,7 @@  discard block
 block discarded – undo
1342 1342
 
1343 1343
             $values = $set->select();
1344 1344
             foreach ($values as $record) {
1345
-                $widget->addOption($record->id, (string)$record->name);
1345
+                $widget->addOption($record->id, (string) $record->name);
1346 1346
             }
1347 1347
 
1348 1348
             return $widget;
@@ -1434,11 +1434,11 @@  discard block
 block discarded – undo
1434 1434
 
1435 1435
         foreach ($columns as $fieldName => $column) {
1436 1436
             $field = $column->getField();
1437
-            if (! $column->isSearchable()) {
1437
+            if (!$column->isSearchable()) {
1438 1438
                 continue;
1439 1439
             }
1440 1440
 
1441
-            if (! ($field instanceof ORM_Field)) {
1441
+            if (!($field instanceof ORM_Field)) {
1442 1442
                 $field = null;
1443 1443
             }
1444 1444
 
@@ -1453,7 +1453,7 @@  discard block
 block discarded – undo
1453 1453
                 $input->addClass('widget-100pc');
1454 1454
 
1455 1455
                 $formItem = $this->handleFilterLabel($label, $input);
1456
-                $formItem->addClass('field_' . $fieldName);
1456
+                $formItem->addClass('field_'.$fieldName);
1457 1457
 
1458 1458
                 $mainSearch = (method_exists($column, 'isMainSearch') && $column->isMainSearch());
1459 1459
 
@@ -1486,7 +1486,7 @@  discard block
 block discarded – undo
1486 1486
         }
1487 1487
 
1488 1488
 
1489
-        if (! $this->submit) {
1489
+        if (!$this->submit) {
1490 1490
             $this->submit = $W->SubmitButton();
1491 1491
             $this->submit->setLabel(widget_translate('Apply filter'));
1492 1492
         }
@@ -1525,7 +1525,7 @@  discard block
 block discarded – undo
1525 1525
 
1526 1526
 
1527 1527
                 foreach ($filterNames as $filterName) {
1528
-                    $filter = $W->getUserConfiguration($controller->getModelViewDefaultId() . '/filters/' . $filterName, 'widgets', false);
1528
+                    $filter = $W->getUserConfiguration($controller->getModelViewDefaultId().'/filters/'.$filterName, 'widgets', false);
1529 1529
 
1530 1530
 //                     $this->select->addItem(
1531 1531
 //                         $W->Link(
@@ -1639,7 +1639,7 @@  discard block
 block discarded – undo
1639 1639
 //        $this->setCurrentPage(isset($filter['pageNumber']) ? $filter['pageNumber'] : $pageNumber);
1640 1640
 
1641 1641
         if (isset($name)) {
1642
-            $this->sortParameterName = $name . '[filter][sort]';
1642
+            $this->sortParameterName = $name.'[filter][sort]';
1643 1643
         } else {
1644 1644
             $this->sortParameterName = 'filter[sort]';
1645 1645
         }
@@ -1737,7 +1737,7 @@  discard block
 block discarded – undo
1737 1737
 
1738 1738
     $tableview->setCurrentPage(isset($filterValues['pageNumber']) ? $filterValues['pageNumber'] : 0);
1739 1739
 
1740
-    $tableview->sortParameterName = $name . '[filter][sort]';
1740
+    $tableview->sortParameterName = $name.'[filter][sort]';
1741 1741
 
1742 1742
     if (isset($filterValues['sort'])) {
1743 1743
         $tableview->setSortField($filterValues['sort']);
@@ -2038,7 +2038,7 @@  discard block
 block discarded – undo
2038 2038
                 continue;
2039 2039
             }
2040 2040
 
2041
-            list(, , $nbCol) = explode('-', $customSection->sizePolicy);
2041
+            list(,, $nbCol) = explode('-', $customSection->sizePolicy);
2042 2042
 
2043 2043
             if ($currentColumn + $nbCol > 12) {
2044 2044
                 $this->addItem($row);
@@ -2089,7 +2089,7 @@  discard block
 block discarded – undo
2089 2089
                 $label = isset($parameters['label']) ? $parameters['label'] : null;
2090 2090
                 $sizePolicy = isset($parameters['sizePolicy']) ? $parameters['sizePolicy'] : '';
2091 2091
 
2092
-                $displayFieldMethod = '_' . $displayFieldName;
2092
+                $displayFieldMethod = '_'.$displayFieldName;
2093 2093
                 if (method_exists($this, $displayFieldMethod)) {
2094 2094
                     $item = $this->$displayFieldMethod($customSection, $label);
2095 2095
                 } else {
@@ -2120,7 +2120,7 @@  discard block
 block discarded – undo
2120 2120
             }
2121 2121
         }
2122 2122
 
2123
-        if ($currentColumn + $nbCol> 0) {
2123
+        if ($currentColumn + $nbCol > 0) {
2124 2124
             $this->addItem($row);
2125 2125
         }
2126 2126
     }
@@ -2241,7 +2241,7 @@  discard block
 block discarded – undo
2241 2241
 
2242 2242
         $displayable = $field->output($value);
2243 2243
 
2244
-        switch(true) {
2244
+        switch (true) {
2245 2245
             case ($field instanceof ORM_TextField):
2246 2246
                 $displayable = $W->RichText($displayable)->setRenderingOptions(BAB_HTML_ALL ^ BAB_HTML_P);
2247 2247
                 break;
Please login to merge, or discard this patch.
programs/ui/widgets/chip.class.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -70,14 +70,14 @@
 block discarded – undo
70 70
         
71 71
         $html = "<div class='chip'>";
72 72
         
73
-        if(isset($this->labelIcon)){
73
+        if (isset($this->labelIcon)) {
74 74
             $icon = $W->Label('')->setIconFormat(16, 'left')->setIcon($this->labelIcon);
75 75
             $html .= $icon->display($W->HtmlCanvas());
76 76
         }
77 77
         
78 78
         $html .= $this->label;
79 79
         
80
-        if(isset($this->action)){
80
+        if (isset($this->action)) {
81 81
             $icon = $W->Link('', $this->action)->setIconFormat(16, 'left')->setOpenMode(Widget_Link::OPEN_DIALOG_AND_RELOAD);
82 82
             $icon->setIcon(isset($this->actionIcon) ? $this->actionIcon : Func_Icons::ACTIONS_DIALOG_CANCEL);
83 83
             $icon->addClass('chip-right-action');
Please login to merge, or discard this patch.
programs/record.ctrl.php 1 patch
Spacing   +59 added lines, -59 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
  * @copyright Copyright (c) 2006 by CANTICO ({@link http://www.cantico.fr})
22 22
  */
23 23
 
24
-require_once dirname(__FILE__) . '/controller.class.php';
24
+require_once dirname(__FILE__).'/controller.class.php';
25 25
 
26 26
 
27 27
 
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
     protected function getRecordClassName()
38 38
     {
39 39
         $App = $this->App();
40
-        if($currentComponent = $App->getCurrentComponent()){
40
+        if ($currentComponent = $App->getCurrentComponent()) {
41 41
             return $currentComponent->getRecordClassName();
42 42
         }
43 43
         list(, $recordClassname) = explode('_Ctrl', $this->getClass());
@@ -55,11 +55,11 @@  discard block
 block discarded – undo
55 55
     protected function getRecordSet()
56 56
     {
57 57
         $App = $this->App();
58
-        if($currentComponent = $App->getCurrentComponent()){
58
+        if ($currentComponent = $App->getCurrentComponent()) {
59 59
             return $currentComponent->recordSet();
60 60
         }
61 61
         $recordClassname = $this->getRecordClassName();
62
-        $recordSetClassname = $recordClassname . 'Set';
62
+        $recordSetClassname = $recordClassname.'Set';
63 63
 
64 64
         $recordSet = $App->$recordSetClassname();
65 65
         return $recordSet;
@@ -111,9 +111,9 @@  discard block
 block discarded – undo
111 111
             if ($showLabel) {
112 112
                 $text = $actions->getTitle();
113 113
             }
114
-            $html = '<li><a class="icon ' . $actions->getIcon() .  '" href="' . $actions->url() . '">' . $text . '</a></li>';
114
+            $html = '<li><a class="icon '.$actions->getIcon().'" href="'.$actions->url().'">'.$text.'</a></li>';
115 115
         } elseif ($actions instanceof Widget_Link) {
116
-            $html = '<li>' . $actions->display($canvas) . '</li>';
116
+            $html = '<li>'.$actions->display($canvas).'</li>';
117 117
         } elseif (is_array($actions)) {
118 118
             if (isset($actions['items'])) {
119 119
                 $items = $actions['items'];
@@ -126,10 +126,10 @@  discard block
 block discarded – undo
126 126
             if (isset($actions['icon'])) {
127 127
 
128 128
                 $html = '<li class="dropdown">'
129
-                    . '<a href="#" class="' . $actions['icon'] . ' icon dropdown-toogle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">'
129
+                    . '<a href="#" class="'.$actions['icon'].' icon dropdown-toogle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">'
130 130
                     . ($actions['icon'] === 'actions-context-menu'/*Func_Icons::ACTIONS_CONTEXT_MENU*/ ? '' : '<span class="caret"></span>')
131 131
                     . '</a>'
132
-                    . '<ul class="dropdown-menu dropdown-menu-right ' . Func_Icons::ICON_LEFT_SYMBOLIC . '">'
132
+                    . '<ul class="dropdown-menu dropdown-menu-right '.Func_Icons::ICON_LEFT_SYMBOLIC.'">'
133 133
                     . $html
134 134
                     . '</ul>';
135 135
             }
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
 
153 153
         $recordClassname = $this->getRecordClassName();
154 154
 
155
-        $viewClassname =  $recordClassname . 'TableView';
155
+        $viewClassname = $recordClassname.'TableView';
156 156
         if (method_exists($Ui, $viewClassname)) {
157 157
             $types['table'] = array(
158 158
                 'classname' => $viewClassname,
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
             );
162 162
         }
163 163
 
164
-        $viewClassname =  $recordClassname . 'CardsView';
164
+        $viewClassname = $recordClassname.'CardsView';
165 165
         if (method_exists($Ui, $viewClassname)) {
166 166
             $types['cards'] = array(
167 167
                 'classname' => $viewClassname,
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
             );
171 171
         }
172 172
 
173
-        $viewClassname =  $recordClassname . 'MapView';
173
+        $viewClassname = $recordClassname.'MapView';
174 174
         if (method_exists($Ui, $viewClassname)) {
175 175
             $types['map'] = array(
176 176
                 'classname' => $viewClassname,
@@ -179,7 +179,7 @@  discard block
 block discarded – undo
179 179
             );
180 180
         }
181 181
 
182
-        $viewClassname =  $recordClassname . 'CalendarView';
182
+        $viewClassname = $recordClassname.'CalendarView';
183 183
         if (method_exists($Ui, $viewClassname)) {
184 184
             $types['calendar'] = array(
185 185
                 'classname' => $viewClassname,
@@ -258,11 +258,11 @@  discard block
 block discarded – undo
258 258
         $recordSet = $this->getEditRecordSet();
259 259
 
260 260
         $recordClassname = $this->getRecordClassName();
261
-        $editorClassname =  $recordClassname . 'SectionEditor';
261
+        $editorClassname = $recordClassname.'SectionEditor';
262 262
         /* @var $editor app_RecordEditor */
263 263
         $editor = $Ui->$editorClassname();
264 264
         if (!isset($itemId)) {
265
-            $itemId = $this->getClass() . '_' . __FUNCTION__;
265
+            $itemId = $this->getClass().'_'.__FUNCTION__;
266 266
         }
267 267
         $editor->setId($itemId);
268 268
         $editor->setHiddenValue('tg', $App->controllerTg);
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
     public function getModelViewDefaultId($itemId = null)
306 306
     {
307 307
         if (!isset($itemId)) {
308
-            $itemId = $this->getClass() . '_modelView';
308
+            $itemId = $this->getClass().'_modelView';
309 309
         }
310 310
 
311 311
         return $itemId;
@@ -323,10 +323,10 @@  discard block
 block discarded – undo
323 323
     protected function modelView($filter = null, $type = null, $columns = null, $itemId = null)
324 324
     {
325 325
         $App = $this->App();
326
-        if($currentComponent = $App->getCurrentComponent()){
326
+        if ($currentComponent = $App->getCurrentComponent()) {
327 327
             $Ui = $currentComponent->ui();
328 328
         }
329
-        else{
329
+        else {
330 330
             $Ui = $App->Ui();
331 331
         }
332 332
 
@@ -344,20 +344,20 @@  discard block
 block discarded – undo
344 344
 
345 345
         switch ($type) {
346 346
             case 'cards':
347
-                $tableviewClassname =  $currentComponent ? 'cardsView' : $recordClassname . 'CardsView';
347
+                $tableviewClassname = $currentComponent ? 'cardsView' : $recordClassname.'CardsView';
348 348
                 break;
349 349
 
350 350
             case 'map':
351
-                $tableviewClassname =  $currentComponent ? 'mapView' : $recordClassname . 'MapView';
351
+                $tableviewClassname = $currentComponent ? 'mapView' : $recordClassname.'MapView';
352 352
                 break;
353 353
 
354 354
             case 'calendar':
355
-                $tableviewClassname =  $currentComponent ? 'calendarView' : $recordClassname . 'CalendarView';
355
+                $tableviewClassname = $currentComponent ? 'calendarView' : $recordClassname.'CalendarView';
356 356
                 break;
357 357
 
358 358
             case 'table':
359 359
             default:
360
-                $tableviewClassname =  $currentComponent ? 'tableView' : $recordClassname . 'TableView';
360
+                $tableviewClassname = $currentComponent ? 'tableView' : $recordClassname.'TableView';
361 361
                 break;
362 362
         }
363 363
 
@@ -422,18 +422,18 @@  discard block
 block discarded – undo
422 422
     {
423 423
         $App = $this->App();
424 424
         $Ui = $App->Ui();
425
-        if($currentComponent = $App->getCurrentComponent()){
425
+        if ($currentComponent = $App->getCurrentComponent()) {
426 426
             $editor = $currentComponent->ui()->editor();
427 427
         }
428
-        else{
428
+        else {
429 429
 
430 430
             $recordClassname = $this->getRecordClassName();
431
-            $editorClassname =  $recordClassname . 'Editor';
431
+            $editorClassname = $recordClassname.'Editor';
432 432
             $editor = $Ui->$editorClassname();
433 433
         }
434 434
 
435 435
         if (!isset($itemId)) {
436
-            $itemId = $this->getClass() . '_' . __FUNCTION__;
436
+            $itemId = $this->getClass().'_'.__FUNCTION__;
437 437
         }
438 438
         $editor->setId($itemId);
439 439
         $editor->setHiddenValue('tg', $App->controllerTg);
@@ -478,7 +478,7 @@  discard block
 block discarded – undo
478 478
                     $W->Link(
479 479
                         '',
480 480
                         $proxy->setFilteredViewType($tableView->getId(), $viewTypeId)
481
-                    )->addClass('icon', $viewType['icon'] . ($filteredViewType=== $viewTypeId ? ' active' : ''))
481
+                    )->addClass('icon', $viewType['icon'].($filteredViewType === $viewTypeId ? ' active' : ''))
482 482
 //                    ->setSizePolicy('btn btn-xs btn-default ' . ($filteredViewType === $viewTypeId ? 'active' : ''))
483 483
                     ->setTitle($viewType['label'])
484 484
                     ->setAjaxAction()
@@ -522,7 +522,7 @@  discard block
 block discarded – undo
522 522
 
523 523
         $filterVisibility = $this->getFilterVisibility($itemId);
524 524
         $filterVisibility = !$filterVisibility;
525
-        $W->setUserConfiguration($itemId . '/filterVisibility', $filterVisibility);
525
+        $W->setUserConfiguration($itemId.'/filterVisibility', $filterVisibility);
526 526
 
527 527
         return true;
528 528
     }
@@ -535,10 +535,10 @@  discard block
 block discarded – undo
535 535
     protected function getFilterVisibility($itemId)
536 536
     {
537 537
         $W = bab_Widgets();
538
-        $filterVisibility = $W->getUserConfiguration($itemId . '/filterVisibility');
538
+        $filterVisibility = $W->getUserConfiguration($itemId.'/filterVisibility');
539 539
         if (!isset($filterVisibility)) {
540 540
             $filterVisibility = false;
541
-            $W->setUserConfiguration($itemId . '/filterVisibility', $filterVisibility);
541
+            $W->setUserConfiguration($itemId.'/filterVisibility', $filterVisibility);
542 542
         }
543 543
         return $filterVisibility;
544 544
     }
@@ -552,7 +552,7 @@  discard block
 block discarded – undo
552 552
     protected function getFilteredViewType($itemId)
553 553
     {
554 554
         $W = bab_Widgets();
555
-        $type = $W->getUserConfiguration($itemId . '/viewType');
555
+        $type = $W->getUserConfiguration($itemId.'/viewType');
556 556
         if (!isset($type)) {
557 557
             $type = 'table';
558 558
         }
@@ -568,7 +568,7 @@  discard block
 block discarded – undo
568 568
     public function setFilteredViewType($itemId, $type = null)
569 569
     {
570 570
         $W = bab_Widgets();
571
-        $W->setUserConfiguration($itemId . '/viewType', $type);
571
+        $W->setUserConfiguration($itemId.'/viewType', $type);
572 572
 
573 573
         return true;
574 574
     }
@@ -716,17 +716,17 @@  discard block
 block discarded – undo
716 716
 
717 717
         switch ($format) {
718 718
             case 'xlsx':
719
-                $tableview->downloadXlsx($filename . '.xlsx');
719
+                $tableview->downloadXlsx($filename.'.xlsx');
720 720
                 break;
721 721
             case 'xls':
722
-                $tableview->downloadExcel($filename . '.xls');
722
+                $tableview->downloadExcel($filename.'.xls');
723 723
                 break;
724 724
             case 'ssv':
725
-                $tableview->downloadCsv($filename . '.csv', ';', $inline, 'Windows-1252');
725
+                $tableview->downloadCsv($filename.'.csv', ';', $inline, 'Windows-1252');
726 726
                 break;
727 727
             case 'csv':
728 728
             default:
729
-                $tableview->downloadCsv($filename . '.csv', ',', $inline, bab_charset::getIso());
729
+                $tableview->downloadCsv($filename.'.csv', ',', $inline, bab_charset::getIso());
730 730
                 break;
731 731
         }
732 732
     }
@@ -755,7 +755,7 @@  discard block
 block discarded – undo
755 755
         $Ui = $App->Ui();
756 756
 
757 757
         $recordClassname = $this->getRecordClassName();
758
-        $fullFrameClassname =  $recordClassname . 'FullFrame';
758
+        $fullFrameClassname = $recordClassname.'FullFrame';
759 759
         $fullFrame = $Ui->$fullFrameClassname($record, $view);
760 760
 
761 761
 
@@ -918,7 +918,7 @@  discard block
 block discarded – undo
918 918
 
919 919
         $recordTitle = $record->getRecordTitle();
920 920
 
921
-        $message = sprintf($App->translate('%s has been deleted'), $App->translate($recordSet->getDescription()) . ' "' . $recordTitle . '"');
921
+        $message = sprintf($App->translate('%s has been deleted'), $App->translate($recordSet->getDescription()).' "'.$recordTitle.'"');
922 922
         return $message;
923 923
     }
924 924
 
@@ -1016,7 +1016,7 @@  discard block
 block discarded – undo
1016 1016
                 $this->addMessage($message);
1017 1017
             }
1018 1018
 
1019
-            $this->addReloadSelector('.depends-' . $this->getRecordClassName());
1019
+            $this->addReloadSelector('.depends-'.$this->getRecordClassName());
1020 1020
             return true;
1021 1021
         }
1022 1022
 
@@ -1048,7 +1048,7 @@  discard block
 block discarded – undo
1048 1048
             $this->addMessage($deletedMessage);
1049 1049
         }
1050 1050
 
1051
-        $this->addReloadSelector('.depends-' . $record->getClassName());
1051
+        $this->addReloadSelector('.depends-'.$record->getClassName());
1052 1052
 
1053 1053
         return true;
1054 1054
     }
@@ -1088,7 +1088,7 @@  discard block
 block discarded – undo
1088 1088
 
1089 1089
         $recordTitle = $record->getRecordTitle();
1090 1090
 
1091
-        $subTitle = $App->translate($recordSet->getDescription()) . ' "' . $recordTitle . '"';
1091
+        $subTitle = $App->translate($recordSet->getDescription()).' "'.$recordTitle.'"';
1092 1092
         $form->addItem($W->Title($subTitle, 5));
1093 1093
 
1094 1094
         $form->addItem($W->Title($App->translate('Confirm delete?'), 6));
@@ -1147,7 +1147,7 @@  discard block
 block discarded – undo
1147 1147
             }
1148 1148
         }
1149 1149
 
1150
-        $this->addReloadSelector('.depends-' . $record->getClassName());
1150
+        $this->addReloadSelector('.depends-'.$record->getClassName());
1151 1151
 
1152 1152
         return true;
1153 1153
     }
@@ -1176,7 +1176,7 @@  discard block
 block discarded – undo
1176 1176
 
1177 1177
         $recordTitle = $record->getRecordTitle();
1178 1178
 
1179
-        $subTitle = $App->translate($recordSet->getDescription()) . ' "' . $recordTitle . '"';
1179
+        $subTitle = $App->translate($recordSet->getDescription()).' "'.$recordTitle.'"';
1180 1180
         $form->addItem($W->Title($subTitle, 5));
1181 1181
 
1182 1182
         $form->addItem($W->Title($App->translate('Confirm delete?'), 6));
@@ -1220,7 +1220,7 @@  discard block
 block discarded – undo
1220 1220
         $record = null;
1221 1221
         foreach ($records as $record) {
1222 1222
         }
1223
-        if (! isset($record)) {
1223
+        if (!isset($record)) {
1224 1224
             throw new app_AccessException('Sorry, You are not allowed to perform this operation');
1225 1225
         }
1226 1226
         if (!$record->isRestorable()) {
@@ -1234,7 +1234,7 @@  discard block
 block discarded – undo
1234 1234
         $record->save();
1235 1235
         $this->addMessage($deletedMessage);
1236 1236
 
1237
-        $this->addReloadSelector('.depends-' . $record->getClassName());
1237
+        $this->addReloadSelector('.depends-'.$record->getClassName());
1238 1238
 
1239 1239
         return true;
1240 1240
     }
@@ -1256,7 +1256,7 @@  discard block
 block discarded – undo
1256 1256
         $record = null;
1257 1257
         foreach ($records as $record) {
1258 1258
         }
1259
-        if (! isset($record)) {
1259
+        if (!isset($record)) {
1260 1260
             throw new app_AccessException('Sorry, You are not allowed to perform this operation');
1261 1261
         }
1262 1262
 
@@ -1269,7 +1269,7 @@  discard block
 block discarded – undo
1269 1269
 
1270 1270
         $recordTitle = $record->getRecordTitle();
1271 1271
 
1272
-        $subTitle = $App->translate($recordSet->getDescription()) . ' "' . $recordTitle . '"';
1272
+        $subTitle = $App->translate($recordSet->getDescription()).' "'.$recordTitle.'"';
1273 1273
         $form->addItem($W->Title($subTitle, 5));
1274 1274
 
1275 1275
         $confirmedAction = $this->proxy()->restore($id);
@@ -1385,14 +1385,14 @@  discard block
 block discarded – undo
1385 1385
         $registry = bab_getRegistryInstance();
1386 1386
 
1387 1387
         $userId = '0';
1388
-        $registry->changeDirectory('/widgets/user/' . $userId . '/' . $id. '/filters');
1388
+        $registry->changeDirectory('/widgets/user/'.$userId.'/'.$id.'/filters');
1389 1389
 
1390 1390
         while ($filterName = $registry->fetchChildKey()) {
1391 1391
             $filters[] = $filterName;
1392 1392
         }
1393 1393
 
1394 1394
         $userId = bab_getUserId();
1395
-        $registry->changeDirectory('/widgets/user/' . $userId . '/' . $id. '/filters');
1395
+        $registry->changeDirectory('/widgets/user/'.$userId.'/'.$id.'/filters');
1396 1396
 
1397 1397
         while ($filterName = $registry->fetchChildKey()) {
1398 1398
             $filters[] = $filterName;
@@ -1413,15 +1413,15 @@  discard block
 block discarded – undo
1413 1413
     {
1414 1414
         $W = bab_Widgets();
1415 1415
         $tableview = $this->modelView(null, 'table');
1416
-        $W->setUserConfiguration($tableview->getId(). '/currentFilterName', $filterName, 'widgets', false);
1416
+        $W->setUserConfiguration($tableview->getId().'/currentFilterName', $filterName, 'widgets', false);
1417 1417
 
1418 1418
         $registry = bab_getRegistryInstance();
1419 1419
         $userId = '0';
1420
-        $registry->changeDirectory('/widgets/user/' . $userId . '/' . $tableview->getId() . '/filters');
1420
+        $registry->changeDirectory('/widgets/user/'.$userId.'/'.$tableview->getId().'/filters');
1421 1421
         $filterValues = $registry->getValue($filterName);
1422 1422
 
1423 1423
         if (!$filterValues) {
1424
-            $filterValues = $W->getUserConfiguration($tableview->getId() . '/filters/' . $filterName, 'widgets', false);
1424
+            $filterValues = $W->getUserConfiguration($tableview->getId().'/filters/'.$filterName, 'widgets', false);
1425 1425
         }
1426 1426
 
1427 1427
         $tableview = $this->modelView($filterValues, 'table');
@@ -1440,7 +1440,7 @@  discard block
 block discarded – undo
1440 1440
     {
1441 1441
         $W = bab_Widgets();
1442 1442
         $id = $this->getModelViewDefaultId();
1443
-        $filter = $W->getUserConfiguration($id. '/currentFilterName', 'widgets', false);
1443
+        $filter = $W->getUserConfiguration($id.'/currentFilterName', 'widgets', false);
1444 1444
 
1445 1445
         return $filter;
1446 1446
     }
@@ -1454,7 +1454,7 @@  discard block
 block discarded – undo
1454 1454
     {
1455 1455
         if (isset($name)) {
1456 1456
             $W = bab_Widgets();
1457
-            $filter = $W->getUserConfiguration($tableview->getId(). '/filters/' . $name, 'widgets', false);
1457
+            $filter = $W->getUserConfiguration($tableview->getId().'/filters/'.$name, 'widgets', false);
1458 1458
             $filterValues = $filter['values'];
1459 1459
         } else {
1460 1460
             $filterValues = null;
@@ -1485,7 +1485,7 @@  discard block
 block discarded – undo
1485 1485
             'values' => $filterValues,
1486 1486
         );
1487 1487
 
1488
-        $W->setUserConfiguration($tableview->getId(). '/filters/' . $name, $data, 'widgets', false);
1488
+        $W->setUserConfiguration($tableview->getId().'/filters/'.$name, $data, 'widgets', false);
1489 1489
 
1490 1490
         return true;
1491 1491
     }
@@ -1503,7 +1503,7 @@  discard block
 block discarded – undo
1503 1503
         $Ui = $App->Ui();
1504 1504
 
1505 1505
         $currentFilterName = $this->getCurrentFilterName();
1506
-        $filter = $W->getUserConfiguration($this->getModelViewDefaultId() . '/filters/' . $currentFilterName, 'widgets', false);
1506
+        $filter = $W->getUserConfiguration($this->getModelViewDefaultId().'/filters/'.$currentFilterName, 'widgets', false);
1507 1507
 
1508 1508
         $page = $Ui->Page();
1509 1509
 
@@ -1556,7 +1556,7 @@  discard block
 block discarded – undo
1556 1556
         $App = $this->App();
1557 1557
         $Ui = $App->Ui();
1558 1558
 
1559
-        $filter = $W->getUserConfiguration($this->getModelViewDefaultId() . '/filters/' . $name, 'widgets', false);
1559
+        $filter = $W->getUserConfiguration($this->getModelViewDefaultId().'/filters/'.$name, 'widgets', false);
1560 1560
 
1561 1561
         $page = $Ui->Page();
1562 1562
 
@@ -1608,7 +1608,7 @@  discard block
 block discarded – undo
1608 1608
 
1609 1609
         $filterNames = $this->getFilterNames();
1610 1610
         foreach ($filterNames as $filterName) {
1611
-            $filter = $W->getUserConfiguration($this->getModelViewDefaultId() . '/filters/' . $filterName, 'widgets', false);
1611
+            $filter = $W->getUserConfiguration($this->getModelViewDefaultId().'/filters/'.$filterName, 'widgets', false);
1612 1612
 
1613 1613
             $filterBox = $W->FlowItems()
1614 1614
                 ->setVerticalAlign('top')
@@ -1653,7 +1653,7 @@  discard block
 block discarded – undo
1653 1653
         $App = $this->App();
1654 1654
         $Ui = $App->Ui();
1655 1655
 
1656
-        $filter = $W->getUserConfiguration($this->getModelViewDefaultId() . '/filters/' . $name, 'widgets', false);
1656
+        $filter = $W->getUserConfiguration($this->getModelViewDefaultId().'/filters/'.$name, 'widgets', false);
1657 1657
 
1658 1658
         $page = $Ui->Page();
1659 1659
 
@@ -1690,7 +1690,7 @@  discard block
 block discarded – undo
1690 1690
         $this->requireDeleteMethod();
1691 1691
 
1692 1692
         $W = bab_Widgets();
1693
-        $W->deleteUserConfiguration($this->getModelViewDefaultId() . '/filters/' . $name, 'widgets', false);
1693
+        $W->deleteUserConfiguration($this->getModelViewDefaultId().'/filters/'.$name, 'widgets', false);
1694 1694
 
1695 1695
         return true;
1696 1696
     }
Please login to merge, or discard this patch.
programs/traceablerecord.class.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
             return parent::delete($criteria);
244 244
         }
245 245
 
246
-        require_once $GLOBALS['babInstallPath'] . '/utilit/dateTime.php';
246
+        require_once $GLOBALS['babInstallPath'].'/utilit/dateTime.php';
247 247
         $now = BAB_DateTime::now()->getIsoDateTime();
248 248
 
249 249
         $records = $this->select($criteria);
@@ -279,7 +279,7 @@  discard block
 block discarded – undo
279 279
             return parent::save($record);
280 280
         }
281 281
 
282
-        require_once $GLOBALS['babInstallPath'] . '/utilit/dateTime.php';
282
+        require_once $GLOBALS['babInstallPath'].'/utilit/dateTime.php';
283 283
 
284 284
         $now = BAB_DateTime::now()->getIsoDateTime();
285 285
 
@@ -309,11 +309,11 @@  discard block
 block discarded – undo
309 309
      */
310 310
     private function uuid()
311 311
     {
312
-        return sprintf( '%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
313
-            mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ),
314
-            mt_rand( 0, 0x0fff ) | 0x4000,
315
-            mt_rand( 0, 0x3fff ) | 0x8000,
316
-            mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ), mt_rand( 0, 0xffff ) );
312
+        return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
313
+            mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff),
314
+            mt_rand(0, 0x0fff) | 0x4000,
315
+            mt_rand(0, 0x3fff) | 0x8000,
316
+            mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff));
317 317
     }
318 318
 
319 319
     /**
@@ -384,10 +384,10 @@  discard block
 block discarded – undo
384 384
  */
385 385
 class app_TraceableRecord extends app_Record
386 386
 {
387
-    const DELETED_STATUS_EXISTING = 0;      // Normal status of a record
388
-    const DELETED_STATUS_DELETED = 1;       // Record is deleted by retrievable by admin
389
-    const DELETED_STATUS_IN_TRASH = 2;      // Record is deleted by retrievable by authorized users
390
-    const DELETED_STATUS_DRAFT = 3;         // Status is in draft (not yet created)
387
+    const DELETED_STATUS_EXISTING = 0; // Normal status of a record
388
+    const DELETED_STATUS_DELETED = 1; // Record is deleted by retrievable by admin
389
+    const DELETED_STATUS_IN_TRASH = 2; // Record is deleted by retrievable by authorized users
390
+    const DELETED_STATUS_DRAFT = 3; // Status is in draft (not yet created)
391 391
 
392 392
     public static function getDeletedStatuses()
393 393
     {
Please login to merge, or discard this patch.
programs/controller.class.php 1 patch
Spacing   +40 added lines, -40 removed lines patch added patch discarded remove patch
@@ -21,10 +21,10 @@  discard block
 block discarded – undo
21 21
  * @copyright Copyright (c) 2008 by CANTICO ({@link http://www.cantico.fr})
22 22
  */
23 23
 
24
-require_once $GLOBALS['babInstallPath'] . 'utilit/controller.class.php';
25
-require_once $GLOBALS['babInstallPath'] . 'utilit/json.php';
24
+require_once $GLOBALS['babInstallPath'].'utilit/controller.class.php';
25
+require_once $GLOBALS['babInstallPath'].'utilit/json.php';
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
 if ($App) {
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 {
37 37
 	public function __construct($action, $code = 0)
38 38
 	{
39
-		$message = 'Unknown method "' . $action->getController() . '::' . $action->getMethod() . '"';
39
+		$message = 'Unknown method "'.$action->getController().'::'.$action->getMethod().'"';
40 40
 		parent::__construct($message, $code);
41 41
 	}
42 42
 }
@@ -201,11 +201,11 @@  discard block
 block discarded – undo
201 201
         // we try to select one according to the classname prefix.
202 202
         list($prefix) = explode('_', __CLASS__);
203 203
         $functionalityName = ucwords($prefix);
204
-        $App = @bab_functionality::get('App/' . $functionalityName);
204
+        $App = @bab_functionality::get('App/'.$functionalityName);
205 205
 
206 206
         if (!$App)
207 207
         {
208
-            throw new app_Exception('Faild to autodetect functionality App/' . $functionalityName.', the getInstance method is deprecated, use $App->ControllerProxy() instead');
208
+            throw new app_Exception('Faild to autodetect functionality App/'.$functionalityName.', the getInstance method is deprecated, use $App->ControllerProxy() instead');
209 209
         }
210 210
 
211 211
         $controller = $App->ControllerProxy($classname, $proxy);
@@ -224,9 +224,9 @@  discard block
 block discarded – undo
224 224
     static function getProxyInstance(Func_App $App, $classname)
225 225
     {
226 226
         $class = new ReflectionClass($classname);
227
-        $proxyClassname = $class->getShortName() . self::PROXY_CLASS_SUFFIX;
227
+        $proxyClassname = $class->getShortName().self::PROXY_CLASS_SUFFIX;
228 228
         if (!class_exists($proxyClassname)) {
229
-            $classStr = 'class ' . $proxyClassname . ' extends ' . $class->name . ' {' . "\n";
229
+            $classStr = 'class '.$proxyClassname.' extends '.$class->name.' {'."\n";
230 230
             $methods = $class->getMethods();
231 231
 
232 232
             $classStr .= '	public function __construct(Func_App $App) {
@@ -239,24 +239,24 @@  discard block
 block discarded – undo
239 239
                 }
240 240
 
241 241
 
242
-                $classStr .= '	public function ' . $method->name . '(';
242
+                $classStr .= '	public function '.$method->name.'(';
243 243
                 $parameters = $method->getParameters();
244 244
                 $parametersStr = array();
245 245
                 foreach ($parameters as $parameter) {
246 246
 
247 247
                     if ($parameter->isDefaultValueAvailable()) {
248
-                        $parametersStr[] = '$' . $parameter->name . ' = ' . var_export($parameter->getDefaultValue(), true);
248
+                        $parametersStr[] = '$'.$parameter->name.' = '.var_export($parameter->getDefaultValue(), true);
249 249
                     } else {
250
-                        $parametersStr[] = '$' . $parameter->name;
250
+                        $parametersStr[] = '$'.$parameter->name;
251 251
                     }
252 252
                 }
253 253
                 $classStr .= implode(', ', $parametersStr);
254
-                $classStr .= ') {' . "\n";
255
-                $classStr .= '		$args = func_get_args();' . "\n";
256
-                $classStr .= '		return $this->getMethodAction(__FUNCTION__, $args);' . "\n";
257
-                $classStr .= '	}' . "\n";
254
+                $classStr .= ') {'."\n";
255
+                $classStr .= '		$args = func_get_args();'."\n";
256
+                $classStr .= '		return $this->getMethodAction(__FUNCTION__, $args);'."\n";
257
+                $classStr .= '	}'."\n";
258 258
             }
259
-            $classStr .= '}' . "\n";
259
+            $classStr .= '}'."\n";
260 260
 
261 261
             // We define the proxy class
262 262
             eval($classStr);
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
     protected function getObjectName($classname)
298 298
     {
299 299
         list($objectname) = explode('Controller', $classname);
300
-        if($this->App()->getComponentByName($objectname)){
300
+        if ($this->App()->getComponentByName($objectname)) {
301 301
             return strtolower($objectname);
302 302
         }
303 303
         list(, $objectname) = explode('_Ctrl', $classname);
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
 
320 320
         $reflector = new ReflectionClass(get_class($this));
321 321
         $parent = $reflector->getParentClass();
322
-        if($parent){
322
+        if ($parent) {
323 323
             $parentMethod = $parent->getMethod('__construct');
324 324
             $docComment = $parentMethod->getDocComment();
325 325
             if (strpos($docComment, '@isComponentController') !== false) {
@@ -330,7 +330,7 @@  discard block
 block discarded – undo
330 330
         $rc = new ReflectionClass($fullClassName);
331 331
 
332 332
         if (!$rc->hasMethod($methodName)) {
333
-            throw new bab_InvalidActionException($fullClassName . '::' . $methodName);
333
+            throw new bab_InvalidActionException($fullClassName.'::'.$methodName);
334 334
         }
335 335
         $method = new ReflectionMethod($fullClassName, $methodName);
336 336
 
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
 
354 354
         $action = new Widget_Action();
355 355
 
356
-        $action->setMethod($this->getControllerTg(), $objectName . '.' . $methodName, $actionParams);
356
+        $action->setMethod($this->getControllerTg(), $objectName.'.'.$methodName, $actionParams);
357 357
 
358 358
         $docComment = $method->getDocComment();
359 359
         if (strpos($docComment, '@ajax') !== false) {
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
         $action->setParameters($actionParams);
395 395
 
396 396
 
397
-        list(,,$file) = explode('/', $App->controllerTg);
397
+        list(,, $file) = explode('/', $App->controllerTg);
398 398
 
399 399
         $action->setParameter('addon', $App->getAddonName().'.'.$file);
400 400
         $action->setParameter('idx', $idx);
@@ -420,24 +420,24 @@  discard block
 block discarded – undo
420 420
             return false;
421 421
         }
422 422
 
423
-        list($objectName, ) = explode('.', $method);
423
+        list($objectName,) = explode('.', $method);
424 424
 
425 425
         if (!method_exists($this, $objectName)) {
426 426
             /* @var $component app_Component */
427 427
             $component = $this->app->getComponentByName(ucfirst($objectName));
428
-            if($component){
428
+            if ($component) {
429 429
                 $this->app->setCurrentComponent($component);
430 430
                 $objectController = $component->controller(false);
431 431
             }
432
-            else{
432
+            else {
433 433
                 header('HTTP/1.0 400 Bad Request');
434 434
                 throw new app_UnknownActionException($action);
435 435
             }
436 436
         }
437 437
 
438
-        if(!isset($component)){
438
+        if (!isset($component)) {
439 439
             $objectController = $this->{$objectName}(false);
440
-            if ( ! ($objectController instanceof app_Controller)) {
440
+            if (!($objectController instanceof app_Controller)) {
441 441
                 return false;
442 442
             }
443 443
         }
@@ -451,7 +451,7 @@  discard block
 block discarded – undo
451 451
             } else {
452 452
                 if ($this->isAjaxRequest()) {
453 453
 
454
-                    header($_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden', true, 403);
454
+                    header($_SERVER['SERVER_PROTOCOL'].' 403 Forbidden', true, 403);
455 455
 
456 456
                     die(
457 457
                         bab_json_encode(
@@ -472,7 +472,7 @@  discard block
 block discarded – undo
472 472
         } catch (app_SaveException $e) {
473 473
 
474 474
             if ($this->isAjaxRequest()) {
475
-                header($_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden', true, 403);
475
+                header($_SERVER['SERVER_PROTOCOL'].' 403 Forbidden', true, 403);
476 476
                 header('Cache-Control: no-cache, must-revalidate');
477 477
                 header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
478 478
                 header('Content-type: application/json');
@@ -527,7 +527,7 @@  discard block
 block discarded – undo
527 527
                         if (method_exists($htmlCanvas, 'sendPageTitle')) {
528 528
                             $htmlCanvas->sendPageTitle($pageTitle);
529 529
                         } else {
530
-                            header('X-Cto-PageTitle: ' . $pageTitle);
530
+                            header('X-Cto-PageTitle: '.$pageTitle);
531 531
                         }
532 532
                     }
533 533
                     $html = $returnedValue->display($htmlCanvas);
@@ -586,7 +586,7 @@  discard block
 block discarded – undo
586 586
     private function deletedItemPage(Widget_Action $action, app_DeletedRecordException $e)
587 587
     {
588 588
         if ($this->isAjaxRequest()) {
589
-            header($_SERVER['SERVER_PROTOCOL'] . ' 403 Forbidden', true, 403);
589
+            header($_SERVER['SERVER_PROTOCOL'].' 403 Forbidden', true, 403);
590 590
             header('Cache-Control: no-cache, must-revalidate');
591 591
             header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
592 592
             header('Content-type: application/json');
@@ -603,7 +603,7 @@  discard block
 block discarded – undo
603 603
                 );
604 604
 
605 605
         }
606
-        header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found', true, 404);
606
+        header($_SERVER['SERVER_PROTOCOL'].' 404 Not Found', true, 404);
607 607
 
608 608
         $App = $this->App();
609 609
         $W = bab_Widgets();
@@ -637,7 +637,7 @@  discard block
 block discarded – undo
637 637
     private function notFoundPage(Widget_Action $action, app_NotFoundException $e)
638 638
     {
639 639
         if ($this->isAjaxRequest()) {
640
-            $message = sprintf(app_translate('This %s does not exists'), $e->getObjectTitle() . ' (' . $e->getId() . ')');
640
+            $message = sprintf(app_translate('This %s does not exists'), $e->getObjectTitle().' ('.$e->getId().')');
641 641
             $json = array(
642 642
                 'messages' => array(
643 643
                     array(
@@ -649,7 +649,7 @@  discard block
 block discarded – undo
649 649
             echo bab_json_encode($json);
650 650
             die;
651 651
         }
652
-        header($_SERVER['SERVER_PROTOCOL'] . ' 404 Not Found', true, 404);
652
+        header($_SERVER['SERVER_PROTOCOL'].' 404 Not Found', true, 404);
653 653
         header('Cache-Control: no-cache, must-revalidate');
654 654
         header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
655 655
 
@@ -669,14 +669,14 @@  discard block
 block discarded – undo
669 669
 
670 670
     private function errorPage(Exception $e)
671 671
     {
672
-        header($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal server error', true, 500);
672
+        header($_SERVER['SERVER_PROTOCOL'].' 500 Internal server error', true, 500);
673 673
 
674
-        require_once $GLOBALS['babInstallPath'] . 'utilit/uiutil.php';
674
+        require_once $GLOBALS['babInstallPath'].'utilit/uiutil.php';
675 675
         $popup = new babBodyPopup();
676 676
         $popup->babEcho(
677
-            '<h1>' . $this->App()->translate('There was a problem when trying to perform this operation') . '</h1>'
678
-            . '<h2 class="error">' . $this->App()->translate('Additional debugging information:') . '</h2>'
679
-            . '<p class="error">' . $e->getMessage() . ' ' .  $e->getFile() . ' ' . $e->getLine()  . ' ' . $e->getTraceAsString() . '</p>'
677
+            '<h1>'.$this->App()->translate('There was a problem when trying to perform this operation').'</h1>'
678
+            . '<h2 class="error">'.$this->App()->translate('Additional debugging information:').'</h2>'
679
+            . '<p class="error">'.$e->getMessage().' '.$e->getFile().' '.$e->getLine().' '.$e->getTraceAsString().'</p>'
680 680
             );
681 681
 
682 682
 
@@ -721,7 +721,7 @@  discard block
 block discarded – undo
721 721
      */
722 722
     public function CustomField($proxy = true)
723 723
     {
724
-        require_once APP_CTRL_PATH . 'customfield.ctrl.php';
724
+        require_once APP_CTRL_PATH.'customfield.ctrl.php';
725 725
         return $this->App()->ControllerProxy('app_CtrlCustomField', $proxy);
726 726
     }
727 727
 
@@ -732,7 +732,7 @@  discard block
 block discarded – undo
732 732
      */
733 733
     public function CustomSection($proxy = true)
734 734
     {
735
-        require_once APP_CTRL_PATH . 'customsection.ctrl.php';
735
+        require_once APP_CTRL_PATH.'customsection.ctrl.php';
736 736
         return $this->App()->ControllerProxy('app_CtrlCustomSection', $proxy);
737 737
     }
738 738
 }
Please login to merge, or discard this patch.
programs/customfield.ctrl.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
  * @copyright Copyright (c) 2008 by CANTICO ({@link http://www.cantico.fr})
22 22
  */
23 23
 
24
-require_once APP_CTRL_PATH . '/record.ctrl.php';
24
+require_once APP_CTRL_PATH.'/record.ctrl.php';
25 25
 
26 26
 /**
27 27
  * This controller manages actions that can be performed on custom fields
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
             $W->Link(
40 40
                 $App->translate('Add a custom field'),
41 41
                 $this->proxy()->edit()
42
-            )->addClass('icon',  Func_Icons::ACTIONS_LIST_ADD)
42
+            )->addClass('icon', Func_Icons::ACTIONS_LIST_ADD)
43 43
             ->setOpenMode(Widget_Link::OPEN_DIALOG_AND_RELOAD)
44 44
         );
45 45
 
Please login to merge, or discard this patch.
programs/customfield.class.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -119,7 +119,7 @@
 block discarded – undo
119 119
             throw new app_SaveException($this->App()->translate('The name is mandatory'));
120 120
         }
121 121
         
122
-        return '_' . $name;
122
+        return '_'.$name;
123 123
     }
124 124
     
125 125
     
Please login to merge, or discard this patch.
programs/record.class.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
     {
192 192
         $App = $this->App();
193 193
 
194
-        $customFieldSet= $App->CustomFieldSet();
194
+        $customFieldSet = $App->CustomFieldSet();
195 195
         $object = mb_substr(get_class($this), mb_strlen($App->classPrefix), -mb_strlen('Set'));
196 196
 
197 197
         $customFields = $customFieldSet->select($customFieldSet->object->is($object));
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
 
318 318
         $linkSet->hasOne('sourceId', get_class($this));
319 319
 
320
-        $criteria =	$linkSet->targetClass->is(get_class($target))
320
+        $criteria = $linkSet->targetClass->is(get_class($target))
321 321
             ->_AND_($linkSet->targetId->is($target->id))
322 322
             ->_AND_($linkSet->sourceClass->is($this->getRecordClassName()));
323 323
         if (isset($linkType)) {
@@ -347,7 +347,7 @@  discard block
 block discarded – undo
347 347
 
348 348
         $linkSet->hasOne('targetId', get_class($this));
349 349
 
350
-        $criteria =	$linkSet->sourceClass->is(get_class($source))
350
+        $criteria = $linkSet->sourceClass->is(get_class($source))
351 351
             ->_AND_($linkSet->sourceId->is($source->id))
352 352
             ->_AND_($linkSet->targetClass->is($this->getRecordClassName()));
353 353
         if (isset($linkType)) {
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
             $sourcesCriteria[] = $linkSet->sourceClass->is($sourceClass)->_AND_($linkSet->sourceId->in($sourceIds));
392 392
         }
393 393
 
394
-        $criteria =	$linkSet->all(
394
+        $criteria = $linkSet->all(
395 395
             $linkSet->targetClass->is($this->getRecordClassName()),
396 396
             $linkSet->any($sourcesCriteria)
397 397
         );
@@ -436,7 +436,7 @@  discard block
 block discarded – undo
436 436
             $targetsCriteria[] = $linkSet->targetClass->is($targetClass)->_AND_($linkSet->targetId->in($targetIds));
437 437
         }
438 438
 
439
-        $criteria =	$linkSet->all(
439
+        $criteria = $linkSet->all(
440 440
             $linkSet->sourceClass->is($this->getRecordClassName()),
441 441
             $linkSet->any($targetsCriteria)
442 442
         );
@@ -673,7 +673,7 @@  discard block
 block discarded – undo
673 673
         $App = $this->App();
674 674
         $rClass = new ReflectionClass(get_class($this));
675 675
         $component = $App->getComponentByName($rClass->getShortName());
676
-        if(isset($component)){
676
+        if (isset($component)) {
677 677
             return $component->getRecordClassName();
678 678
 //             list(, $classname) = explode('_', $component->getRecordClassName());
679 679
 //             return $classname;
@@ -694,7 +694,7 @@  discard block
 block discarded – undo
694 694
             throw new app_Exception('Trying to get the reference string of a record without an id.');
695 695
         }
696 696
         $classname = $this->getClassName();
697
-        return $classname . ':' . $this->id;
697
+        return $classname.':'.$this->id;
698 698
     }
699 699
 
700 700
 
@@ -934,7 +934,7 @@  discard block
 block discarded – undo
934 934
     {
935 935
         $linkSet = $this->App()->LinkSet();
936 936
 
937
-        $criteria =	$linkSet->sourceClass->is(get_class($source))
937
+        $criteria = $linkSet->sourceClass->is(get_class($source))
938 938
         ->_AND_($linkSet->sourceId->is($source->id))
939 939
         ->_AND_($linkSet->targetClass->is(get_class($this)))
940 940
         ->_AND_($linkSet->targetId->is($this->id));
@@ -964,7 +964,7 @@  discard block
 block discarded – undo
964 964
     {
965 965
         $linkSet = $this->App()->LinkSet();
966 966
 
967
-        $criteria =	$linkSet->all(
967
+        $criteria = $linkSet->all(
968 968
             $linkSet->targetClass->is(get_class($target)),
969 969
             $linkSet->targetId->is($target->id),
970 970
             $linkSet->sourceClass->is(get_class($this)),
@@ -1059,13 +1059,13 @@  discard block
 block discarded – undo
1059 1059
      */
1060 1060
     protected function importDate($name, $value)
1061 1061
     {
1062
-        if (preg_match('/[0-9]{4}-[0-9]{2}-[0-9]{2}/',$value)) {
1062
+        if (preg_match('/[0-9]{4}-[0-9]{2}-[0-9]{2}/', $value)) {
1063 1063
             return $this->importProperty($name, $value);
1064 1064
         }
1065 1065
 
1066 1066
         // try in DD/MM/YYYY format
1067 1067
 
1068
-        if (preg_match('/(?P<day>[0-9]+)\/(?P<month>[0-9]+)\/(?P<year>[0-9]{2,4})/',$value, $matches)) {
1068
+        if (preg_match('/(?P<day>[0-9]+)\/(?P<month>[0-9]+)\/(?P<year>[0-9]{2,4})/', $value, $matches)) {
1069 1069
 
1070 1070
             $value = sprintf('%04d-%02d-%02d', (int) $matches['year'], (int) $matches['month'], (int) $matches['day']);
1071 1071
 
Please login to merge, or discard this patch.