Passed
Push — master ( fda82f...bdc416 )
by Robin
02:13 queued 12s
created
programs/define.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -21,16 +21,16 @@
 block discarded – undo
21 21
  * @copyright Copyright (c) 2006 by CANTICO ({@link http://www.cantico.fr})
22 22
  */
23 23
 
24
-define('APP_PHP_PATH', dirname(__FILE__) . '/');
25
-define('APP_SET_PATH', dirname(__FILE__) . '/');
26
-define('APP_UI_PATH', dirname(__FILE__) . '/ui/');
27
-define('APP_WIDGETS_PATH', APP_UI_PATH . 'widgets/');
28
-define('APP_CTRL_PATH', dirname(__FILE__) . '/');
24
+define('APP_PHP_PATH', dirname(__FILE__).'/');
25
+define('APP_SET_PATH', dirname(__FILE__).'/');
26
+define('APP_UI_PATH', dirname(__FILE__).'/ui/');
27
+define('APP_WIDGETS_PATH', APP_UI_PATH.'widgets/');
28
+define('APP_CTRL_PATH', dirname(__FILE__).'/');
29 29
 
30
-require_once APP_PHP_PATH . 'base.class.php';
31
-require_once APP_UI_PATH . 'base.ui.php';
30
+require_once APP_PHP_PATH.'base.class.php';
31
+require_once APP_UI_PATH.'base.ui.php';
32 32
 
33
-require_once $GLOBALS['babInstallPath'] . 'utilit/dateTime.php';
33
+require_once $GLOBALS['babInstallPath'].'utilit/dateTime.php';
34 34
 
35 35
 
36 36
 
Please login to merge, or discard this patch.
programs/component.class.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
  * @copyright Copyright (c) 2019 by CapWelton ({@link http://www.capwelton.com})
22 22
  */
23 23
 
24
-require_once dirname(__FILE__). '/record.ctrl.php';
24
+require_once dirname(__FILE__).'/record.ctrl.php';
25 25
 
26 26
 class app_Component 
27 27
 {
@@ -56,15 +56,15 @@  discard block
 block discarded – undo
56 56
     {
57 57
         $main = new ReflectionClass($this->set);
58 58
         $dependencies = array();
59
-        if($main->hasMethod('getRequiredComponents')){
59
+        if ($main->hasMethod('getRequiredComponents')) {
60 60
             $requiredComponents = $this->recordSet()->getRequiredComponents();
61
-            foreach ($requiredComponents as $requiredComponent){
61
+            foreach ($requiredComponents as $requiredComponent) {
62 62
                 $dependencies['requiredComponents'][] = $requiredComponent;
63 63
             }
64 64
         }
65
-        if($main->hasMethod('getOptionalComponents')){
65
+        if ($main->hasMethod('getOptionalComponents')) {
66 66
             $optionalComponents = $this->recordSet()->getOptionalComponents();
67
-            foreach ($optionalComponents as $optionalComponent){
67
+            foreach ($optionalComponents as $optionalComponent) {
68 68
                 $dependencies['optionalComponents'][] = $optionalComponent;
69 69
             }
70 70
         }
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
     public function onUpdate()
80 80
     {
81 81
         $main = new ReflectionClass($this->set);
82
-        if($main->hasMethod('onUpdate')){
82
+        if ($main->hasMethod('onUpdate')) {
83 83
             $this->recordSet()->onUpdate();
84 84
         }
85 85
     }
@@ -89,12 +89,12 @@  discard block
 block discarded – undo
89 89
      */
90 90
     public function controller($proxy = true)
91 91
     {
92
-        if(!isset($this->controllerObject)){
92
+        if (!isset($this->controllerObject)) {
93 93
             $this->app->includeRecordController();
94 94
             $ctrl = $this->controller;
95 95
             $this->controllerObject = new $ctrl($this->app, $this);
96 96
         }
97
-        if($proxy){
97
+        if ($proxy) {
98 98
             return $this->controllerObject->proxy();
99 99
         }
100 100
         return $this->controllerObject;
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
      */
114 114
     public function ui()
115 115
     {
116
-        if(!isset($this->uiObject)){
116
+        if (!isset($this->uiObject)) {
117 117
             $ui = $this->ui;
118 118
             $this->uiObject = new $ui($this->app);
119 119
         }
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
     public function getSetClassName()
130 130
     {
131 131
         $reflectionClass = new ReflectionClass($this->set);
132
-        return $this->app->classPrefix . $reflectionClass->getShortName();
132
+        return $this->app->classPrefix.$reflectionClass->getShortName();
133 133
     }
134 134
     
135 135
     public function getRecordClassName()
Please login to merge, or discard this patch.
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/app.php 2 patches
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -355,8 +355,7 @@
 block discarded – undo
355 355
                 $sql .= $mysqlbackend->setToSql($set) . "\n";
356 356
                 
357 357
                 $component->onUpdate();
358
-            }
359
-            catch (Exception $e){
358
+            } catch (Exception $e){
360 359
                 
361 360
             }
362 361
         }
Please login to merge, or discard this patch.
Spacing   +60 added lines, -60 removed lines patch added patch discarded remove patch
@@ -21,9 +21,9 @@  discard block
 block discarded – undo
21 21
  * @copyright Copyright (c) 2018 by CANTICO ({@link http://www.cantico.fr})
22 22
  */
23 23
 
24
-require_once dirname(__FILE__) . '/define.php';
25
-require_once dirname(__FILE__) . '/functions.php';
26
-require_once dirname(__FILE__) . '/component.class.php';
24
+require_once dirname(__FILE__).'/define.php';
25
+require_once dirname(__FILE__).'/functions.php';
26
+require_once dirname(__FILE__).'/component.class.php';
27 27
 
28 28
 
29 29
 
@@ -59,14 +59,14 @@  discard block
 block discarded – undo
59 59
         $this->addonName = 'libapp';
60 60
         $this->addonPrefix = 'app';
61 61
 
62
-        $this->classPrefix = $this->addonPrefix . '_';
63
-        $this->controllerTg = 'addon/' . $this->addonName . '/main';
62
+        $this->classPrefix = $this->addonPrefix.'_';
63
+        $this->controllerTg = 'addon/'.$this->addonName.'/main';
64 64
 
65 65
         $addon = bab_getAddonInfosInstance($this->addonName);
66 66
         $this->phpPath = $addon->getPhpPath();
67 67
         $this->recordSetPath = $this->phpPath;
68 68
         $this->ctrlPath = $this->phpPath;
69
-        $this->uiPath = $this->phpPath . 'ui/';
69
+        $this->uiPath = $this->phpPath.'ui/';
70 70
 
71 71
         $babDB = bab_getDB();
72 72
 
@@ -92,7 +92,7 @@  discard block
 block discarded – undo
92 92
      */
93 93
     public function getComponentByName($componentName)
94 94
     {
95
-        if(isset($this->components[$componentName])){
95
+        if (isset($this->components[$componentName])) {
96 96
             return $this->components[$componentName];
97 97
         }
98 98
         return null;
@@ -131,12 +131,12 @@  discard block
 block discarded – undo
131 131
         
132 132
         $messages = array();
133 133
         
134
-        foreach ($components as $componentName => $component){
134
+        foreach ($components as $componentName => $component) {
135 135
             $dependencies = $component->checkDependencies();
136
-            foreach($dependencies['requiredComponents'] as $requiredComponent){
136
+            foreach ($dependencies['requiredComponents'] as $requiredComponent) {
137 137
                 $messages['requiredComponents'][$componentName][] = $requiredComponent;
138 138
             }
139
-            foreach($dependencies['optionalComponents'] as $optionalComponent){
139
+            foreach ($dependencies['optionalComponents'] as $optionalComponent) {
140 140
                 $messages['optionalComponents'][$componentName][] = $optionalComponent;
141 141
             }
142 142
         }
@@ -179,8 +179,8 @@  discard block
 block discarded – undo
179 179
     public function getRecordSetPathname($class)
180 180
     {
181 181
         // $App->MyRecordSet() -> myrecord.class.php
182
-        $file = strtolower(substr($class, strlen($this->classPrefix), -3)) . '.class.php';
183
-        return $this->recordSetPath . $file;
182
+        $file = strtolower(substr($class, strlen($this->classPrefix), -3)).'.class.php';
183
+        return $this->recordSetPath.$file;
184 184
     }
185 185
 
186 186
     /**
@@ -192,8 +192,8 @@  discard block
 block discarded – undo
192 192
     public function getRecordPathname($class)
193 193
     {
194 194
         // $App->MyRecord() -> myrecord.class.php
195
-        $file = strtolower(substr($class, strlen($this->classPrefix))) . '.class.php';
196
-        return $this->recordSetPath . $file;
195
+        $file = strtolower(substr($class, strlen($this->classPrefix))).'.class.php';
196
+        return $this->recordSetPath.$file;
197 197
     }
198 198
 
199 199
     /**
@@ -294,7 +294,7 @@  discard block
 block discarded – undo
294 294
 
295 295
             if (substr($method, 0, 7) === 'include' && substr($method, -3) === 'Set') {
296 296
                 $incl = $method;
297
-                $classNameMethod = substr($method, strlen('include')) . 'ClassName';
297
+                $classNameMethod = substr($method, strlen('include')).'ClassName';
298 298
 
299 299
 
300 300
                 $classname = $this->$classNameMethod();
@@ -316,7 +316,7 @@  discard block
 block discarded – undo
316 316
                                 // We need to revert to multilang fields before synchronizing.
317 317
                                 $set->useLang(false);
318 318
                             }
319
-                            $sql .= $mysqlbackend->setToSql($set) . "\n";
319
+                            $sql .= $mysqlbackend->setToSql($set)."\n";
320 320
                         }
321 321
                     }
322 322
                 }
@@ -342,9 +342,9 @@  discard block
 block discarded – undo
342 342
         $sql = 'SET FOREIGN_KEY_CHECKS=0;
343 343
             ';
344 344
 
345
-        foreach ($this->components as $component){
345
+        foreach ($this->components as $component) {
346 346
             /* @var $component app_Component */
347
-            try{
347
+            try {
348 348
                 /* @var $set ORM_RecordSet */
349 349
                 $set = $component->recordSet();
350 350
                 if (method_exists($set, 'useLang')) {
@@ -352,11 +352,11 @@  discard block
 block discarded – undo
352 352
                     // We need to revert to multilang fields before synchronizing.
353 353
                     $set->useLang(false);
354 354
                 }
355
-                $sql .= $mysqlbackend->setToSql($set) . "\n";
355
+                $sql .= $mysqlbackend->setToSql($set)."\n";
356 356
                 
357 357
                 $component->onUpdate();
358 358
             }
359
-            catch (Exception $e){
359
+            catch (Exception $e) {
360 360
                 
361 361
             }
362 362
         }
@@ -367,18 +367,18 @@  discard block
 block discarded – undo
367 367
         $synchronize->fromSqlString($sql);
368 368
         
369 369
         $dependencies = $this->checkComponentsDependencies();
370
-        foreach ($dependencies['requiredComponents'] as $componentName => $requiredComponents){
371
-            foreach ($requiredComponents as $requiredComponent){
370
+        foreach ($dependencies['requiredComponents'] as $componentName => $requiredComponents) {
371
+            foreach ($requiredComponents as $requiredComponent) {
372 372
                 $hasComponent = $this->getComponentByName($requiredComponent);
373
-                if(!$hasComponent){
373
+                if (!$hasComponent) {
374 374
                     bab_installWindow::message(sprintf($this->translate('The component %s is required for the component %s to work. You will encounter fatal errors'), $requiredComponent, $componentName));
375 375
                 }
376 376
             }
377 377
         }
378
-        foreach ($dependencies['optionalComponents'] as $componentName => $optionalComponents){
379
-            foreach ($optionalComponents as $optionalComponent){
378
+        foreach ($dependencies['optionalComponents'] as $componentName => $optionalComponents) {
379
+            foreach ($optionalComponents as $optionalComponent) {
380 380
                 $hasComponent = $this->getComponentByName($optionalComponent);
381
-                if(!$hasComponent){
381
+                if (!$hasComponent) {
382 382
                     bab_installWindow::message(sprintf($this->translate('The optional component %s has not been added. The component %s may have reduced functionalities'), $optionalComponent, $componentName));
383 383
                 }
384 384
             }
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
 
404 404
             if (substr($method, 0, strlen('include')) === 'include' && substr($method, -strlen('Set')) === 'Set') {
405 405
                 $incl = $method;
406
-                $classNameMethod = substr($method, strlen('include')) . 'ClassName';
406
+                $classNameMethod = substr($method, strlen('include')).'ClassName';
407 407
 
408 408
                 $classname = $this->$classNameMethod();
409 409
 
@@ -417,7 +417,7 @@  discard block
 block discarded – undo
417 417
 
418 418
                             if (class_exists($classname) && method_exists($this, $call)) {
419 419
                                 $set = $this->$call();
420
-                                $sql .= $mysqlbackend->setToSql($set) . "\n";
420
+                                $sql .= $mysqlbackend->setToSql($set)."\n";
421 421
                             }
422 422
                         }
423 423
                     }
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
 
432 432
     public function includeBase()
433 433
     {
434
-        require_once APP_PHP_PATH . 'base.class.php';
434
+        require_once APP_PHP_PATH.'base.class.php';
435 435
     }
436 436
 
437 437
     /**
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
439 439
      */
440 440
     public function includeRecordSet()
441 441
     {
442
-        require_once APP_SET_PATH . 'record.class.php';
442
+        require_once APP_SET_PATH.'record.class.php';
443 443
     }
444 444
 
445 445
 
@@ -448,7 +448,7 @@  discard block
 block discarded – undo
448 448
      */
449 449
     public function includeTraceableRecordSet()
450 450
     {
451
-        require_once APP_SET_PATH . 'traceablerecord.class.php';
451
+        require_once APP_SET_PATH.'traceablerecord.class.php';
452 452
     }
453 453
 
454 454
 
@@ -460,7 +460,7 @@  discard block
 block discarded – undo
460 460
     {
461 461
         static $accessManager = null;
462 462
         if (!isset($accessManager)) {
463
-            require_once APP_SET_PATH . 'accessmanager.class.php';
463
+            require_once APP_SET_PATH.'accessmanager.class.php';
464 464
             $accessManager = new app_AccessManager($this);
465 465
         }
466 466
 
@@ -478,7 +478,7 @@  discard block
 block discarded – undo
478 478
      */
479 479
     public function includeLogSet()
480 480
     {
481
-        require_once APP_SET_PATH . 'log.class.php';
481
+        require_once APP_SET_PATH.'log.class.php';
482 482
     }
483 483
 
484 484
     /**
@@ -494,7 +494,7 @@  discard block
 block discarded – undo
494 494
      */
495 495
     public function LogSetClassName()
496 496
     {
497
-        return $this->LogClassName() . 'Set';
497
+        return $this->LogClassName().'Set';
498 498
     }
499 499
 
500 500
     /**
@@ -516,7 +516,7 @@  discard block
 block discarded – undo
516 516
      */
517 517
     public function includeLinkSet()
518 518
     {
519
-        require_once APP_SET_PATH . 'link.class.php';
519
+        require_once APP_SET_PATH.'link.class.php';
520 520
     }
521 521
 
522 522
     /**
@@ -532,7 +532,7 @@  discard block
 block discarded – undo
532 532
      */
533 533
     public function LinkSetClassName()
534 534
     {
535
-        return $this->LinkClassName() . 'Set';
535
+        return $this->LinkClassName().'Set';
536 536
     }
537 537
 
538 538
     /**
@@ -556,10 +556,10 @@  discard block
 block discarded – undo
556 556
     public function getRecordSetByRef($recordClassname)
557 557
     {
558 558
         $component = $this->getComponentByName(str_replace($this->classPrefix, '', $recordClassname));
559
-        if(isset($component)){
559
+        if (isset($component)) {
560 560
             return $component->recordSet();
561 561
         }
562
-        $classSet = $recordClassname . 'Set';
562
+        $classSet = $recordClassname.'Set';
563 563
         $set = $this->$classSet();
564 564
         return $set;
565 565
     }
@@ -596,7 +596,7 @@  discard block
 block discarded – undo
596 596
     {
597 597
         $fullClassName = get_class($record);
598 598
         list(, $className) = explode('_', $fullClassName);
599
-        return $className . ':' . $record->id;
599
+        return $className.':'.$record->id;
600 600
     }
601 601
 
602 602
 
@@ -687,16 +687,16 @@  discard block
 block discarded – undo
687 687
      */
688 688
     public function mailTo($addr, $subject = null, $body = null)
689 689
     {
690
-        $mailTo = 'mailto:' . $addr;
690
+        $mailTo = 'mailto:'.$addr;
691 691
         $parameters = array();
692 692
         if (isset($subject)) {
693
-            $parameters[] = 'subject=' . $subject;
693
+            $parameters[] = 'subject='.$subject;
694 694
         }
695 695
         if (isset($body)) {
696
-            $parameters[] = 'body=' . $body;
696
+            $parameters[] = 'body='.$body;
697 697
         }
698 698
         if (!empty($parameters)) {
699
-            $mailTo .= '?' . implode('&', $parameters);
699
+            $mailTo .= '?'.implode('&', $parameters);
700 700
         }
701 701
 
702 702
         return $mailTo;
@@ -747,7 +747,7 @@  discard block
 block discarded – undo
747 747
         }
748 748
 
749 749
         $number = number_format($number, $decimals, ',', ' ');
750
-        return str_replace(' ', bab_nbsp(), $number . ' ' . $prefix . $unitSymbol);
750
+        return str_replace(' ', bab_nbsp(), $number.' '.$prefix.$unitSymbol);
751 751
     }
752 752
 
753 753
 
@@ -767,7 +767,7 @@  discard block
 block discarded – undo
767 767
         }
768 768
 
769 769
         if (!isset($format)) {
770
-            $format = bab_registry::get('/' . $this->addonName . '/numberFormat', $PhoneNumber->getDefaultFormat());
770
+            $format = bab_registry::get('/'.$this->addonName.'/numberFormat', $PhoneNumber->getDefaultFormat());
771 771
         }
772 772
         $phoneNumberUtil = $PhoneNumber->PhoneNumberUtil();
773 773
 
@@ -788,7 +788,7 @@  discard block
 block discarded – undo
788 788
      */
789 789
     public function includeController()
790 790
     {
791
-        require_once APP_PHP_PATH . '/controller.class.php';
791
+        require_once APP_PHP_PATH.'/controller.class.php';
792 792
     }
793 793
 
794 794
 
@@ -797,7 +797,7 @@  discard block
 block discarded – undo
797 797
      */
798 798
     public function includeRecordController()
799 799
     {
800
-        require_once APP_CTRL_PATH . '/record.ctrl.php';
800
+        require_once APP_CTRL_PATH.'/record.ctrl.php';
801 801
     }
802 802
 
803 803
 
@@ -837,7 +837,7 @@  discard block
 block discarded – undo
837 837
      */
838 838
     public function includeUi()
839 839
     {
840
-        require_once APP_UI_PATH . 'ui.class.php';
840
+        require_once APP_UI_PATH.'ui.class.php';
841 841
     }
842 842
 
843 843
 
@@ -849,7 +849,7 @@  discard block
 block discarded – undo
849 849
     public function Ui()
850 850
     {
851 851
         $this->includeUi();
852
-        return bab_getInstance($this->classPrefix . 'Ui');//->setApp($this);
852
+        return bab_getInstance($this->classPrefix.'Ui'); //->setApp($this);
853 853
     }
854 854
 
855 855
     /**
@@ -877,34 +877,34 @@  discard block
 block discarded – undo
877 877
 
878 878
             case substr($name, -strlen('SetClassName')) === 'SetClassName':
879 879
                 $className = substr($name, 0, strlen($name) - strlen('SetClassName'));
880
-                if($component = $this->getComponentByName(ucfirst($className))){
880
+                if ($component = $this->getComponentByName(ucfirst($className))) {
881 881
                     return $component->getSetClassName();
882 882
                 }
883 883
                 $setName = $className.'Set';
884
-                return $this->classPrefix . $setName;
884
+                return $this->classPrefix.$setName;
885 885
 
886 886
             case substr($name, -strlen('ClassName')) === 'ClassName':
887 887
                 $recordName = substr($name, 0, strlen($name) - strlen('ClassName'));
888
-                if($component = $this->getComponentByName(ucfirst($recordName))){
888
+                if ($component = $this->getComponentByName(ucfirst($recordName))) {
889 889
                     return $component->getRecordClassName();
890 890
                 }
891
-                return $this->classPrefix . $recordName;
891
+                return $this->classPrefix.$recordName;
892 892
 
893 893
             case substr($name, 0, strlen('include')) === 'include' && substr($name, -strlen('Set')) === 'Set':
894 894
                 $fileNameBase = strtolower(substr(substr($name, 0, strlen($name) - strlen('Set')), strlen('include')));
895
-                if($this->getComponentByName(ucfirst($fileNameBase))){
895
+                if ($this->getComponentByName(ucfirst($fileNameBase))) {
896 896
                     return;
897 897
                 }
898
-                require_once APP_SET_PATH . $fileNameBase . '.class.php';
898
+                require_once APP_SET_PATH.$fileNameBase.'.class.php';
899 899
                 return;
900 900
 
901 901
             case substr($name, -strlen('Set')) === 'Set':
902
-                if($component = $this->getComponentByName(ucfirst(substr($name, 0, strlen($name) -strlen('Set'))))){
902
+                if ($component = $this->getComponentByName(ucfirst(substr($name, 0, strlen($name) - strlen('Set'))))) {
903 903
                     return $component->recordSet();
904 904
                 }
905
-                $includeMethod = 'include' . $name;
905
+                $includeMethod = 'include'.$name;
906 906
                 $this->$includeMethod();
907
-                $setClassNameMethod = $name . 'ClassName';
907
+                $setClassNameMethod = $name.'ClassName';
908 908
                 $className = $this->$setClassNameMethod();
909 909
                 $set = new $className($this);
910 910
                 return $set;
@@ -912,8 +912,8 @@  discard block
 block discarded – undo
912 912
             case ($component = $this->getComponentByName(ucfirst($name))) != false:
913 913
                 return $component;
914 914
             default:
915
-                $setName = $name . 'Set';
916
-                $recordClassNameMethod = $name . 'ClassName';
915
+                $setName = $name.'Set';
916
+                $recordClassNameMethod = $name.'ClassName';
917 917
                 $recordClassName = $this->$recordClassNameMethod();
918 918
                 if (isset($arguments[0])) {
919 919
                     if ($arguments[0] instanceof $recordClassName) {
Please login to merge, or discard this patch.
programs/record.ctrl.php 2 patches
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.
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -325,8 +325,7 @@  discard block
 block discarded – undo
325 325
         $App = $this->App();
326 326
         if($currentComponent = $App->getCurrentComponent()){
327 327
             $Ui = $currentComponent->ui();
328
-        }
329
-        else{
328
+        } else{
330 329
             $Ui = $App->Ui();
331 330
         }
332 331
 
@@ -424,8 +423,7 @@  discard block
 block discarded – undo
424 423
         $Ui = $App->Ui();
425 424
         if($currentComponent = $App->getCurrentComponent()){
426 425
             $editor = $currentComponent->ui()->editor();
427
-        }
428
-        else{
426
+        } else{
429 427
 
430 428
             $recordClassname = $this->getRecordClassName();
431 429
             $editorClassname =  $recordClassname . 'Editor';
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 2 patches
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.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -428,8 +428,7 @@
 block discarded – undo
428 428
             if($component){
429 429
                 $this->app->setCurrentComponent($component);
430 430
                 $objectController = $component->controller(false);
431
-            }
432
-            else{
431
+            } else{
433 432
                 header('HTTP/1.0 400 Bad Request');
434 433
                 throw new app_UnknownActionException($action);
435 434
             }
Please login to merge, or discard this patch.