Completed
Pull Request — develop (#716)
by Agel_Nash
09:56
created
manager/includes/src/Legacy/mgrResources.php 2 patches
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php namespace EvolutionCMS\Legacy;
2 2
 
3
-class mgrResources {
3
+class mgrResources{
4 4
     /**
5 5
      * @var array
6 6
      */
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
     /**
22 22
      * mgrResources constructor.
23 23
      */
24
-    public function __construct() {
24
+    public function __construct(){
25 25
         $this->setTypes();
26 26
         $this->queryItemsFromDB();
27 27
         $this->prepareCategoryArrays();
@@ -30,47 +30,47 @@  discard block
 block discarded – undo
30 30
     /**
31 31
      * @return void
32 32
      */
33
-    public function setTypes() {
33
+    public function setTypes(){
34 34
         global $_lang;
35
-        $this->types['site_templates']    = array(
35
+        $this->types['site_templates'] = array(
36 36
             'title'=>$_lang["manage_templates"],
37
-            'actions'=>array( 'edit'=>array(16,'edit_template'), 'duplicate'=>array(96,'new_template'), 'remove'=>array(21,'delete_template') ),
38
-            'permissions'=>array('new_template','edit_template'),
37
+            'actions'=>array('edit'=>array(16, 'edit_template'), 'duplicate'=>array(96, 'new_template'), 'remove'=>array(21, 'delete_template')),
38
+            'permissions'=>array('new_template', 'edit_template'),
39 39
             'name'=>'templatename'
40 40
         );
41
-        $this->types['site_tmplvars']     = array(
41
+        $this->types['site_tmplvars'] = array(
42 42
             'title'=>$_lang["tmplvars"],
43
-            'actions'=>array('edit'=>array(301,'edit_template'), 'duplicate'=>array(304,'edit_template'), 'remove'=>array(303,'edit_template')),
44
-            'permissions'=>array('new_template','edit_template'),
43
+            'actions'=>array('edit'=>array(301, 'edit_template'), 'duplicate'=>array(304, 'edit_template'), 'remove'=>array(303, 'edit_template')),
44
+            'permissions'=>array('new_template', 'edit_template'),
45 45
         );
46 46
         $this->types['site_htmlsnippets'] = array(
47 47
             'title'=>$_lang["manage_htmlsnippets"],
48
-            'actions'=>array('edit'=>array(78,'edit_chunk'), 'duplicate'=>array(97,'new_chunk'), 'remove'=>array(80,'delete_chunk')),
49
-            'permissions'=>array('new_chunk','edit_chunk'),
48
+            'actions'=>array('edit'=>array(78, 'edit_chunk'), 'duplicate'=>array(97, 'new_chunk'), 'remove'=>array(80, 'delete_chunk')),
49
+            'permissions'=>array('new_chunk', 'edit_chunk'),
50 50
         );
51
-        $this->types['site_snippets']     = array(
51
+        $this->types['site_snippets'] = array(
52 52
             'title'=>$_lang["manage_snippets"],
53
-            'actions'=>array('edit'=>array(22,'edit_snippet'), 'duplicate'=>array(98,'new_snippet'), 'remove'=>array(25,'delete_snippet')),
54
-            'permissions'=>array('new_snippet','edit_snippet'),
53
+            'actions'=>array('edit'=>array(22, 'edit_snippet'), 'duplicate'=>array(98, 'new_snippet'), 'remove'=>array(25, 'delete_snippet')),
54
+            'permissions'=>array('new_snippet', 'edit_snippet'),
55 55
         );
56
-        $this->types['site_plugins']      = array(
56
+        $this->types['site_plugins'] = array(
57 57
             'title'=>$_lang["manage_plugins"],
58
-            'actions'=>array('edit'=>array(102,'edit_plugin'), 'duplicate'=>array(105,'new_plugin'), 'remove'=>array(104,'delete_plugin')),
59
-            'permissions'=>array('new_plugin','edit_plugin'),
58
+            'actions'=>array('edit'=>array(102, 'edit_plugin'), 'duplicate'=>array(105, 'new_plugin'), 'remove'=>array(104, 'delete_plugin')),
59
+            'permissions'=>array('new_plugin', 'edit_plugin'),
60 60
         );
61
-        $this->types['site_modules']      = array(
61
+        $this->types['site_modules'] = array(
62 62
             'title'=>$_lang["manage_modules"],
63
-            'actions'=>array('edit'=>array(108,'edit_module'), 'duplicate'=>array(111,'new_module'), 'remove'=>array(110,'delete_module')),
64
-            'permissions'=>array('new_module','edit_module'),
63
+            'actions'=>array('edit'=>array(108, 'edit_module'), 'duplicate'=>array(111, 'new_module'), 'remove'=>array(110, 'delete_module')),
64
+            'permissions'=>array('new_module', 'edit_module'),
65 65
         );
66 66
     }
67 67
 
68 68
     /**
69 69
      * @return void
70 70
      */
71
-    public function queryItemsFromDB() {
72
-        foreach($this->types as $resourceTable=>$type) {
73
-            if($this->hasAnyPermissions($type['permissions'])) {
71
+    public function queryItemsFromDB(){
72
+        foreach ($this->types as $resourceTable=>$type) {
73
+            if ($this->hasAnyPermissions($type['permissions'])) {
74 74
                 $nameField = isset($type['name']) ? $type['name'] : 'name';
75 75
                 $this->items[$resourceTable] = $this->queryResources($resourceTable, $nameField);
76 76
             }
@@ -81,11 +81,11 @@  discard block
 block discarded – undo
81 81
      * @param array $permissions
82 82
      * @return bool
83 83
      */
84
-    public function hasAnyPermissions($permissions) {
84
+    public function hasAnyPermissions($permissions){
85 85
         $modx = evolutionCMS();
86 86
 
87
-        foreach($permissions as $p)
88
-            if($modx->hasPermission($p)) return true;
87
+        foreach ($permissions as $p)
88
+            if ($modx->hasPermission($p)) return true;
89 89
 
90 90
         return false;
91 91
     }
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
      * @param string $nameField
96 96
      * @return array|bool
97 97
      */
98
-    public function queryResources($resourceTable, $nameField = 'name') {
98
+    public function queryResources($resourceTable, $nameField = 'name'){
99 99
         $modx = evolutionCMS(); global $_lang;
100 100
 
101 101
         $allowed = array(
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
             'site_plugins',
105 105
             'site_modules'
106 106
         );
107
-        $pluginsql = !empty($resourceTable) && in_array($resourceTable, $allowed) ? $resourceTable . '.disabled, ' : '';
107
+        $pluginsql = !empty($resourceTable) && in_array($resourceTable, $allowed) ? $resourceTable.'.disabled, ' : '';
108 108
 
109 109
         $tvsql  = '';
110 110
         $tvjoin = '';
@@ -119,14 +119,14 @@  discard block
 block discarded – undo
119 119
 
120 120
         $rs = $modx->db->select(
121 121
             "{$sttfield} {$pluginsql} {$tvsql} {$resourceTable}.{$nameField} as name, {$resourceTable}.id, {$resourceTable}.description, {$resourceTable}.locked, {$selectableTemplates}IF(isnull(categories.category),'{$_lang['no_category']}',categories.category) as category, categories.id as catid",
122
-            $modx->getFullTableName($resourceTable) . " AS {$resourceTable}
123
-	            LEFT JOIN " . $modx->getFullTableName('categories') . " AS categories ON {$resourceTable}.category = categories.id {$tvjoin}",
122
+            $modx->getFullTableName($resourceTable)." AS {$resourceTable}
123
+	            LEFT JOIN ".$modx->getFullTableName('categories')." AS categories ON {$resourceTable}.category = categories.id {$tvjoin}",
124 124
             "",
125 125
             "category,name"
126 126
         );
127 127
         $limit = $modx->db->getRecordCount($rs);
128 128
 
129
-        if($limit < 1) return false;
129
+        if ($limit < 1) return false;
130 130
 
131 131
         $result = array();
132 132
         while ($row = $modx->db->getRow($rs)) {
@@ -138,9 +138,9 @@  discard block
 block discarded – undo
138 138
     /**
139 139
      * @return void
140 140
      */
141
-    public function prepareCategoryArrays() {
142
-        foreach($this->items as $type=>$items) {
143
-            foreach((array)$items as $item) {
141
+    public function prepareCategoryArrays(){
142
+        foreach ($this->items as $type=>$items) {
143
+            foreach ((array) $items as $item) {
144 144
                 $catid = $item['catid'] ? $item['catid'] : 0;
145 145
                 $this->categories[$catid] = $item['category'];
146 146
 
@@ -153,8 +153,8 @@  discard block
 block discarded – undo
153 153
         natcasesort($this->categories);
154 154
 
155 155
         // Now sort by name
156
-        foreach($this->itemsPerCategory as $catid=>$items) {
157
-            usort($this->itemsPerCategory[$catid], function ($a, $b) {
156
+        foreach ($this->itemsPerCategory as $catid=>$items) {
157
+            usort($this->itemsPerCategory[$catid], function($a, $b){
158 158
                 return strcasecmp($a['name'], $b['name']);
159 159
             });
160 160
         }
Please login to merge, or discard this patch.
Braces   +23 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,6 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php namespace EvolutionCMS\Legacy;
2 2
 
3
-class mgrResources {
3
+class mgrResources
4
+{
4 5
     /**
5 6
      * @var array
6 7
      */
@@ -21,7 +22,8 @@  discard block
 block discarded – undo
21 22
     /**
22 23
      * mgrResources constructor.
23 24
      */
24
-    public function __construct() {
25
+    public function __construct()
26
+    {
25 27
         $this->setTypes();
26 28
         $this->queryItemsFromDB();
27 29
         $this->prepareCategoryArrays();
@@ -30,7 +32,8 @@  discard block
 block discarded – undo
30 32
     /**
31 33
      * @return void
32 34
      */
33
-    public function setTypes() {
35
+    public function setTypes()
36
+    {
34 37
         global $_lang;
35 38
         $this->types['site_templates']    = array(
36 39
             'title'=>$_lang["manage_templates"],
@@ -68,7 +71,8 @@  discard block
 block discarded – undo
68 71
     /**
69 72
      * @return void
70 73
      */
71
-    public function queryItemsFromDB() {
74
+    public function queryItemsFromDB()
75
+    {
72 76
         foreach($this->types as $resourceTable=>$type) {
73 77
             if($this->hasAnyPermissions($type['permissions'])) {
74 78
                 $nameField = isset($type['name']) ? $type['name'] : 'name';
@@ -81,11 +85,13 @@  discard block
 block discarded – undo
81 85
      * @param array $permissions
82 86
      * @return bool
83 87
      */
84
-    public function hasAnyPermissions($permissions) {
88
+    public function hasAnyPermissions($permissions)
89
+    {
85 90
         $modx = evolutionCMS();
86 91
 
87
-        foreach($permissions as $p)
88
-            if($modx->hasPermission($p)) return true;
92
+        foreach($permissions as $p) {
93
+                    if($modx->hasPermission($p)) return true;
94
+        }
89 95
 
90 96
         return false;
91 97
     }
@@ -95,7 +101,8 @@  discard block
 block discarded – undo
95 101
      * @param string $nameField
96 102
      * @return array|bool
97 103
      */
98
-    public function queryResources($resourceTable, $nameField = 'name') {
104
+    public function queryResources($resourceTable, $nameField = 'name')
105
+    {
99 106
         $modx = evolutionCMS(); global $_lang;
100 107
 
101 108
         $allowed = array(
@@ -112,8 +119,9 @@  discard block
 block discarded – undo
112 119
             $tvsql    = 'site_tmplvars.caption, ';
113 120
             $tvjoin   = sprintf('LEFT JOIN %s AS stt ON site_tmplvars.id=stt.tmplvarid GROUP BY site_tmplvars.id,reltpl', $modx->getFullTableName('site_tmplvar_templates'));
114 121
             $sttfield = 'IF(stt.templateid,1,0) AS reltpl,';
122
+        } else {
123
+            $sttfield = '';
115 124
         }
116
-        else $sttfield = '';
117 125
 
118 126
         $selectableTemplates = $resourceTable === 'site_templates' ? "{$resourceTable}.selectable, " : "";
119 127
 
@@ -126,7 +134,9 @@  discard block
 block discarded – undo
126 134
         );
127 135
         $limit = $modx->db->getRecordCount($rs);
128 136
 
129
-        if($limit < 1) return false;
137
+        if($limit < 1) {
138
+            return false;
139
+        }
130 140
 
131 141
         $result = array();
132 142
         while ($row = $modx->db->getRow($rs)) {
@@ -138,7 +148,8 @@  discard block
 block discarded – undo
138 148
     /**
139 149
      * @return void
140 150
      */
141
-    public function prepareCategoryArrays() {
151
+    public function prepareCategoryArrays()
152
+    {
142 153
         foreach($this->items as $type=>$items) {
143 154
             foreach((array)$items as $item) {
144 155
                 $catid = $item['catid'] ? $item['catid'] : 0;
@@ -154,7 +165,7 @@  discard block
 block discarded – undo
154 165
 
155 166
         // Now sort by name
156 167
         foreach($this->itemsPerCategory as $catid=>$items) {
157
-            usort($this->itemsPerCategory[$catid], function ($a, $b) {
168
+            usort($this->itemsPerCategory[$catid], function ($a, $b){
158 169
                 return strcasecmp($a['name'], $b['name']);
159 170
             });
160 171
         }
Please login to merge, or discard this patch.
manager/includes/src/Legacy/TemplateParser.php 3 patches
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -8,46 +8,46 @@  discard block
 block discarded – undo
8 8
      * @param array $data
9 9
      * @return string
10 10
      */
11
-    public function output($config = array(), $data = array()) {
11
+    public function output($config = array(), $data = array()){
12 12
         $modx = evolutionCMS();
13 13
 
14 14
         $output = '';
15 15
         $action = !empty($config['action']) ? $config['action'] : (!empty($_REQUEST['a']) ? $_REQUEST['a'] : '');
16
-        $tab = isset($config['tab']) ? ' AND tab IN(' . $config['tab'] . ')' : '';
16
+        $tab = isset($config['tab']) ? ' AND tab IN('.$config['tab'].')' : '';
17 17
 
18
-        if($action) {
18
+        if ($action) {
19 19
             $sql = $modx->db->query('SELECT t1.*, IF(t1.alias=\'\',t1.name,t1.alias) AS alias, t2.category AS category_name
20
-			FROM ' . $modx->getFullTableName('system_templates') . ' AS t1
21
-			INNER JOIN ' . $modx->getFullTableName('categories') . ' AS t2 ON t2.id=t1.category
22
-			WHERE t1.action IN(' . $action . ') ' . $tab . '
20
+			FROM ' . $modx->getFullTableName('system_templates').' AS t1
21
+			INNER JOIN ' . $modx->getFullTableName('categories').' AS t2 ON t2.id=t1.category
22
+			WHERE t1.action IN(' . $action.') '.$tab.'
23 23
 			ORDER BY t1.tab ASC, t1.rank ASC');
24 24
 
25
-            if($modx->db->getRecordCount($sql)) {
25
+            if ($modx->db->getRecordCount($sql)) {
26 26
                 $tabs = array();
27
-                while($row = $modx->db->getRow($sql)) {
28
-                    if(!$row['value'] && !empty($data[$row['name']])) {
27
+                while ($row = $modx->db->getRow($sql)) {
28
+                    if (!$row['value'] && !empty($data[$row['name']])) {
29 29
                         $row['value'] = $data[$row['name']];
30 30
                     }
31 31
                     $tabs[$row['tab']]['category_name'] = $row['category_name'];
32 32
                     $tabs[$row['tab']][$row['name']] = $this->render($row);
33 33
                 }
34 34
 
35
-                if(!empty($config['toArray'])) {
35
+                if (!empty($config['toArray'])) {
36 36
                     $output = $tabs;
37 37
                 } else {
38
-                    $output .= '<div class="tab-pane" id="pane_' . $action . '">';
38
+                    $output .= '<div class="tab-pane" id="pane_'.$action.'">';
39 39
                     $output .= '
40 40
 					<script type="text/javascript">
41
-						var pane_' . $action . ' = new WebFXTabPane(document.getElementById("pane_' . $action . '"), ' . ($modx->config['remember_last_tab'] == 1 ? 'true' : 'false') . ');
41
+						var pane_' . $action.' = new WebFXTabPane(document.getElementById("pane_'.$action.'"), '.($modx->config['remember_last_tab'] == 1 ? 'true' : 'false').');
42 42
 					</script>';
43 43
 
44
-                    foreach($tabs as $idTab => $tab) {
45
-                        $output .= '<div class="tab-page" id="tab_' . $action . '_' . $idTab . '">';
44
+                    foreach ($tabs as $idTab => $tab) {
45
+                        $output .= '<div class="tab-page" id="tab_'.$action.'_'.$idTab.'">';
46 46
                         $output .= '
47
-						<h2 class="tab">' . (!empty($config['tabs'][$idTab]) ? $config['tabs'][$idTab] : $tab['category_name']) . '</h2>
48
-						<script type="text/javascript">pane_' . $action . '.addTabPage(document.getElementById("tab_' . $action . '_' . $idTab . '"));</script>';
47
+						<h2 class="tab">' . (!empty($config['tabs'][$idTab]) ? $config['tabs'][$idTab] : $tab['category_name']).'</h2>
48
+						<script type="text/javascript">pane_' . $action.'.addTabPage(document.getElementById("tab_'.$action.'_'.$idTab.'"));</script>';
49 49
                         unset($tab['category_name']);
50
-                        foreach($tab as $item) {
50
+                        foreach ($tab as $item) {
51 51
                             $output .= $item;
52 52
                         }
53 53
                         $output .= '</div>';
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
      * @param array $data
65 65
      * @return string
66 66
      */
67
-    private function render($data) {
67
+    private function render($data){
68 68
         $modx = evolutionCMS(); global $_lang, $_country_lang;
69 69
 
70 70
         $data['lang.name'] = (isset($_lang[$data['alias']]) ? $_lang[$data['alias']] : $data['alias']);
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
         $output = '';
75 75
         $output .= '<div class="form-group row">';
76 76
 
77
-        switch($data['type']) {
77
+        switch ($data['type']) {
78 78
 
79 79
             case 'text':
80 80
                 $output .= '<label class="col-sm-3" for="[+name+]">[+lang.name+]</label>
@@ -108,18 +108,18 @@  discard block
 block discarded – undo
108 108
                 $output .= '<label class="col-sm-3" for="[+name+]">[+lang.name+]</label>';
109 109
                 $output .= '<div class="col-sm-7">';
110 110
                 $output .= '<select name="[+name+]" class="form-control" id="[+name+]" onChange="documentDirty=true;">';
111
-                if($data['name'] == 'country' && isset($_country_lang)) {
111
+                if ($data['name'] == 'country' && isset($_country_lang)) {
112 112
                     $chosenCountry = isset($_POST['country']) ? $_POST['country'] : $data['country'];
113
-                    $output .= '<option value=""' . (!isset($chosenCountry) ? ' selected' : '') . '>&nbsp;</option>';
114
-                    foreach($_country_lang as $key => $value) {
115
-                        $output .= '<option value="' . $key . '"' . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . '>' . $value . '</option>';
113
+                    $output .= '<option value=""'.(!isset($chosenCountry) ? ' selected' : '').'>&nbsp;</option>';
114
+                    foreach ($_country_lang as $key => $value) {
115
+                        $output .= '<option value="'.$key.'"'.(isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '').'>'.$value.'</option>';
116 116
                     }
117 117
                 } else {
118
-                    if($data['elements']) {
118
+                    if ($data['elements']) {
119 119
                         $elements = explode('||', $data['elements']);
120
-                        foreach($elements as $key => $value) {
120
+                        foreach ($elements as $key => $value) {
121 121
                             $value = explode('==', $value);
122
-                            $output .= '<option value="' . $value[1] . '">' . (isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]) . '</option>';
122
+                            $output .= '<option value="'.$value[1].'">'.(isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]).'</option>';
123 123
                         }
124 124
                     }
125 125
                 }
@@ -133,11 +133,11 @@  discard block
 block discarded – undo
133 133
                 $output .= '<label class="col-sm-3" for="[+name+]">[+lang.name+]</label>';
134 134
                 $output .= '<div class="col-sm-7">';
135 135
                 $output .= '<input type="checkbox" name="[+name+]" class="form-control" id="[+name+]" value="[+value+]" onChange="documentDirty=true;"[+readonly+] />';
136
-                if($data['elements']) {
136
+                if ($data['elements']) {
137 137
                     $elements = explode('||', $data['elements']);
138
-                    foreach($elements as $key => $value) {
138
+                    foreach ($elements as $key => $value) {
139 139
                         $value = explode('==', $value);
140
-                        $output .= '<br /><input type="checkbox" name="' . $value[0] . '" class="form-control" id="' . $value[0] . '" value="' . $value[1] . '" onChange="documentDirty=true;"[+readonly+] /> ' . (isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]);
140
+                        $output .= '<br /><input type="checkbox" name="'.$value[0].'" class="form-control" id="'.$value[0].'" value="'.$value[1].'" onChange="documentDirty=true;"[+readonly+] /> '.(isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]);
141 141
                     }
142 142
                 }
143 143
                 $output .= $data['content'];
@@ -149,11 +149,11 @@  discard block
 block discarded – undo
149 149
                 $output .= '<label class="col-sm-3" for="[+name+]">[+lang.name+]</label>';
150 150
                 $output .= '<div class="col-sm-7">';
151 151
                 $output .= '<input type="radio" name="[+name+]" class="form-control" id="[+name+]" value="[+value+]" onChange="documentDirty=true;"[+readonly+] />';
152
-                if($data['elements']) {
152
+                if ($data['elements']) {
153 153
                     $elements = explode('||', $data['elements']);
154
-                    foreach($elements as $key => $value) {
154
+                    foreach ($elements as $key => $value) {
155 155
                         $value = explode('==', $value);
156
-                        $output .= '<br /><input type="radio" name="[+name+]" class="form-control" id="[+name+]_' . $key . '" value="' . $value[1] . '" onChange="documentDirty=true;"[+readonly+] /> ' . (isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]);
156
+                        $output .= '<br /><input type="radio" name="[+name+]" class="form-control" id="[+name+]_'.$key.'" value="'.$value[1].'" onChange="documentDirty=true;"[+readonly+] /> '.(isset($_lang[$value[0]]) ? $_lang[$value[0]] : $value[0]);
157 157
                     }
158 158
                 }
159 159
                 $output .= $data['content'];
Please login to merge, or discard this patch.
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -8,7 +8,8 @@  discard block
 block discarded – undo
8 8
      * @param array $data
9 9
      * @return string
10 10
      */
11
-    public function output($config = array(), $data = array()) {
11
+    public function output($config = array(), $data = array())
12
+    {
12 13
         $modx = evolutionCMS();
13 14
 
14 15
         $output = '';
@@ -64,7 +65,8 @@  discard block
 block discarded – undo
64 65
      * @param array $data
65 66
      * @return string
66 67
      */
67
-    private function render($data) {
68
+    private function render($data)
69
+    {
68 70
         $modx = evolutionCMS(); global $_lang, $_country_lang;
69 71
 
70 72
         $data['lang.name'] = (isset($_lang[$data['alias']]) ? $_lang[$data['alias']] : $data['alias']);
Please login to merge, or discard this patch.
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@
 block discarded – undo
1 1
 <?php namespace EvolutionCMS\Legacy;
2 2
 
3
-Class TemplateParser
3
+class TemplateParser
4 4
 {
5 5
 
6 6
     /**
Please login to merge, or discard this patch.
manager/includes/src/Legacy/ModuleCategoriesManager.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -85,8 +85,8 @@  discard block
 block discarded – undo
85 85
     {
86 86
         global $_lang, $_style;
87 87
 
88
-        $filename = trim($view_name) . '.tpl.phtml';
89
-        $file = self::get('views_dir') . $filename;
88
+        $filename = trim($view_name).'.tpl.phtml';
89
+        $file = self::get('views_dir').$filename;
90 90
         $view = &$this;
91 91
 
92 92
         if (is_file($file)
@@ -111,14 +111,14 @@  discard block
 block discarded – undo
111 111
     {
112 112
 
113 113
         $_update = array(
114
-            'id'       => (int)$element_id,
115
-            'category' => (int)$category_id
114
+            'id'       => (int) $element_id,
115
+            'category' => (int) $category_id
116 116
         );
117 117
 
118 118
         $this->db->update(
119 119
             $_update,
120 120
             $this->db_tbl[$element],
121
-            "`id` = '" . (int)$element_id . "'"
121
+            "`id` = '".(int) $element_id."'"
122 122
         );
123 123
 
124 124
         return $this->db->getAffectedRows() === 1;
Please login to merge, or discard this patch.
manager/includes/src/Support/Menu.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -90,14 +90,14 @@  discard block
 block discarded – undo
90 90
                 $countChild++;
91 91
                 $id = $value[0];
92 92
                 $ph['id'] = $id;
93
-                $ph['li_class'] = $this->getItemClass($id) . $value[10];
93
+                $ph['li_class'] = $this->getItemClass($id).$value[10];
94 94
                 $ph['href'] = $value[3];
95 95
                 $ph['alt'] = $value[4];
96 96
                 $ph['target'] = $value[7];
97 97
                 $ph['onclick'] = $value[5];
98 98
                 $ph['a_class'] = $this->getLinkClass($id);
99 99
                 $ph['LinkAttr'] = $this->getLinkAttr($id);
100
-                $ph['itemName'] = $value[2] . $this->getItemName($id);
100
+                $ph['itemName'] = $value[2].$this->getItemName($id);
101 101
 
102 102
                 $ph['DrawSub'] = '';
103 103
 
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
     public function getLinkClass($id)
146 146
     {
147 147
         if (isset($this->menu[$id])) {
148
-            return ' class="' . $this->defaults['parentLinkClass'] . '"';
148
+            return ' class="'.$this->defaults['parentLinkClass'].'"';
149 149
         } else {
150 150
             return '';
151 151
         }
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
     public function getItemClass($id)
172 172
     {
173 173
         if (isset($this->menu[$id])) {
174
-            return $this->defaults['parentClass'] . ' ';
174
+            return $this->defaults['parentClass'].' ';
175 175
         } else {
176 176
             return '';
177 177
         }
Please login to merge, or discard this patch.
manager/includes/src/Support/MysqlDumper.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 
74 74
         // Set line feed
75 75
         $lf = "\n";
76
-        $tempfile_path = $modx->config['base_path'] . 'assets/backup/temp.php';
76
+        $tempfile_path = $modx->config['base_path'].'assets/backup/temp.php';
77 77
 
78 78
         $result = $modx->db->query('SHOW TABLES');
79 79
         $tables = $this->result2Array(0, $result);
@@ -86,15 +86,15 @@  discard block
 block discarded – undo
86 86
 
87 87
         // Set header
88 88
         $output = "#{$lf}";
89
-        $output .= "# " . addslashes($modx->config['site_name']) . " Database Dump{$lf}";
89
+        $output .= "# ".addslashes($modx->config['site_name'])." Database Dump{$lf}";
90 90
         $output .= "# MODX Version:{$version['version']}{$lf}";
91 91
         $output .= "# {$lf}";
92 92
         $output .= "# Host: {$this->database_server}{$lf}";
93
-        $output .= "# Generation Time: " . $modx->toDateFormat(time()) . $lf;
94
-        $output .= "# Server version: " . $modx->db->getVersion() . $lf;
95
-        $output .= "# PHP Version: " . phpversion() . $lf;
93
+        $output .= "# Generation Time: ".$modx->toDateFormat(time()).$lf;
94
+        $output .= "# Server version: ".$modx->db->getVersion().$lf;
95
+        $output .= "# PHP Version: ".phpversion().$lf;
96 96
         $output .= "# Database: `{$this->dbname}`{$lf}";
97
-        $output .= "# Description: " . trim($_REQUEST['backup_title']) . "{$lf}";
97
+        $output .= "# Description: ".trim($_REQUEST['backup_title'])."{$lf}";
98 98
         $output .= "#";
99 99
         file_put_contents($tempfile_path, $output, FILE_APPEND | LOCK_EX);
100 100
         $output = '';
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
                 }
114 114
             }
115 115
             if ($callBack === 'snapshot') {
116
-                if (!preg_match('@^' . $modx->db->config['table_prefix'] . '@', $tblval)) {
116
+                if (!preg_match('@^'.$modx->db->config['table_prefix'].'@', $tblval)) {
117 117
                     continue;
118 118
                 }
119 119
             }
@@ -150,9 +150,9 @@  discard block
 block discarded – undo
150 150
                         ), '\\n', $value);
151 151
                         $value = "'{$value}'";
152 152
                     }
153
-                    $insertdump .= $value . ',';
153
+                    $insertdump .= $value.',';
154 154
                 }
155
-                $output .= rtrim($insertdump, ',') . ");\n";
155
+                $output .= rtrim($insertdump, ',').");\n";
156 156
                 if (1048576 < strlen($output)) {
157 157
                     file_put_contents($tempfile_path, $output, FILE_APPEND | LOCK_EX);
158 158
                     $output = '';
Please login to merge, or discard this patch.
manager/includes/src/Support/Captcha.php 2 patches
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -43,44 +43,44 @@  discard block
 block discarded – undo
43 43
     public $im_height  = 0;
44 44
     public $im;
45 45
 
46
-    public function __construct($w=200, $h=80) {
46
+    public function __construct($w = 200, $h = 80){
47 47
         /* create session to set word for verification */
48 48
         $this->setVeriword();
49
-        $this->dir_font = MODX_BASE_PATH . 'assets/' . $this->dir_font;
49
+        $this->dir_font = MODX_BASE_PATH.'assets/'.$this->dir_font;
50 50
         $this->im_width         = $w;
51 51
         $this->im_height        = $h;
52 52
     }
53 53
 
54
-    public function setVeriword() {
54
+    public function setVeriword(){
55 55
         /* create session variable for verification,
56 56
            you may change the session variable name */
57 57
         $this->word             = $this->makeText();
58 58
         $_SESSION['veriword']   = $this->word;
59 59
     }
60 60
 
61
-    public function output() {
61
+    public function output(){
62 62
         /* output the image as jpeg */
63 63
         $this->drawImage();
64 64
         header("Content-type: image/jpeg");
65 65
         imagejpeg($this->im);
66 66
     }
67 67
 
68
-    public function makeText() {
68
+    public function makeText(){
69 69
         $modx = evolutionCMS();
70 70
         // set default words
71
-        $words="MODX,Access,Better,BitCode,Chunk,Cache,Desc,Design,Excell,Enjoy,URLs,TechView,Gerald,Griff,Humphrey,Holiday,Intel,Integration,Joystick,Join(),Oscope,Genetic,Light,Likeness,Marit,Maaike,Niche,Netherlands,Ordinance,Oscillo,Parser,Phusion,Query,Question,Regalia,Righteous,Snippet,Sentinel,Template,Thespian,Unity,Enterprise,Verily,Veri,Website,WideWeb,Yap,Yellow,Zebra,Zygote";
71
+        $words = "MODX,Access,Better,BitCode,Chunk,Cache,Desc,Design,Excell,Enjoy,URLs,TechView,Gerald,Griff,Humphrey,Holiday,Intel,Integration,Joystick,Join(),Oscope,Genetic,Light,Likeness,Marit,Maaike,Niche,Netherlands,Ordinance,Oscillo,Parser,Phusion,Query,Question,Regalia,Righteous,Snippet,Sentinel,Template,Thespian,Unity,Enterprise,Verily,Veri,Website,WideWeb,Yap,Yellow,Zebra,Zygote";
72 72
         $words = $modx->config['captcha_words'] ? $modx->config['captcha_words'] : $words;
73 73
         $arr_words = array_filter(array_map('trim', explode(',', $words)));
74 74
 
75 75
         /* pick one randomly for text verification */
76
-        return (string) $arr_words[array_rand($arr_words)].rand(10,999);
76
+        return (string) $arr_words[array_rand($arr_words)].rand(10, 999);
77 77
     }
78 78
 
79
-    public function drawText() {
79
+    public function drawText(){
80 80
         $dir = dir($this->dir_font);
81 81
         $fontstmp = array();
82 82
         while (false !== ($file = $dir->read())) {
83
-            if(substr($file, -4) == '.ttf') {
83
+            if (substr($file, -4) == '.ttf') {
84 84
                 $fontstmp[] = $this->dir_font.$file;
85 85
             }
86 86
         }
@@ -88,35 +88,35 @@  discard block
 block discarded – undo
88 88
         $text_font = (string) $fontstmp[array_rand($fontstmp)];
89 89
 
90 90
         /* angle for text inclination */
91
-        $text_angle = rand(-9,9);
91
+        $text_angle = rand(-9, 9);
92 92
         /* initial text size */
93 93
         $text_size  = 30;
94 94
         /* calculate text width and height */
95
-        $box        = imagettfbbox ( $text_size, $text_angle, $text_font, $this->word);
96
-        $text_width = $box[2]-$box[0]; //text width
97
-        $text_height= $box[5]-$box[3]; //text height
95
+        $box        = imagettfbbox($text_size, $text_angle, $text_font, $this->word);
96
+        $text_width = $box[2] - $box[0]; //text width
97
+        $text_height = $box[5] - $box[3]; //text height
98 98
 
99 99
         /* adjust text size */
100
-        $text_size  = round((20 * $this->im_width)/$text_width);
100
+        $text_size  = round((20 * $this->im_width) / $text_width);
101 101
 
102 102
         /* recalculate text width and height */
103
-        $box        = imagettfbbox ( $text_size, $text_angle, $text_font, $this->word);
104
-        $text_width = $box[2]-$box[0]; //text width
105
-        $text_height= $box[5]-$box[3]; //text height
103
+        $box        = imagettfbbox($text_size, $text_angle, $text_font, $this->word);
104
+        $text_width = $box[2] - $box[0]; //text width
105
+        $text_height = $box[5] - $box[3]; //text height
106 106
 
107 107
         /* calculate center position of text */
108
-        $text_x         = ($this->im_width - $text_width)/2;
109
-        $text_y         = ($this->im_height - $text_height)/2;
108
+        $text_x         = ($this->im_width - $text_width) / 2;
109
+        $text_y         = ($this->im_height - $text_height) / 2;
110 110
 
111 111
         /* create canvas for text drawing */
112
-        $im_text        = imagecreate ($this->im_width, $this->im_height);
113
-        $bg_color       = imagecolorallocate ($im_text, 255, 255, 255);
112
+        $im_text        = imagecreate($this->im_width, $this->im_height);
113
+        $bg_color       = imagecolorallocate($im_text, 255, 255, 255);
114 114
 
115 115
         /* pick color for text */
116
-        $text_color     = imagecolorallocate ($im_text, 0, 51, 153);
116
+        $text_color     = imagecolorallocate($im_text, 0, 51, 153);
117 117
 
118 118
         /* draw text into canvas */
119
-        imagettftext    (   $im_text,
119
+        imagettftext($im_text,
120 120
             $text_size,
121 121
             $text_angle,
122 122
             $text_x,
@@ -131,19 +131,19 @@  discard block
 block discarded – undo
131 131
     }
132 132
 
133 133
 
134
-    public function drawImage() {
134
+    public function drawImage(){
135 135
 
136 136
         /* pick one background image randomly from image directory */
137
-        $img_file       = MODX_BASE_PATH . 'assets/' . $this->dir_noise."noise".rand(1,4).".jpg";
137
+        $img_file       = MODX_BASE_PATH.'assets/'.$this->dir_noise."noise".rand(1, 4).".jpg";
138 138
 
139 139
         /* create "noise" background image from your image stock*/
140
-        $noise_img      = @imagecreatefromjpeg ($img_file);
140
+        $noise_img      = @imagecreatefromjpeg($img_file);
141 141
         $noise_width    = imagesx($noise_img);
142 142
         $noise_height   = imagesy($noise_img);
143 143
 
144 144
         /* resize the background image to fit the size of image output */
145
-        $this->im       = imagecreatetruecolor($this->im_width,$this->im_height);
146
-        imagecopyresampled ($this->im,
145
+        $this->im       = imagecreatetruecolor($this->im_width, $this->im_height);
146
+        imagecopyresampled($this->im,
147 147
             $noise_img,
148 148
             0, 0, 0, 0,
149 149
             $this->im_width,
@@ -152,17 +152,17 @@  discard block
 block discarded – undo
152 152
             $noise_height);
153 153
 
154 154
         /* put text image into background image */
155
-        imagecopymerge (    $this->im,
155
+        imagecopymerge($this->im,
156 156
             $this->drawText(),
157 157
             0, 0, 0, 0,
158 158
             $this->im_width,
159 159
             $this->im_height,
160
-            70 );
160
+            70);
161 161
 
162 162
         return $this->im;
163 163
     }
164 164
 
165
-    public function destroy() {
165
+    public function destroy(){
166 166
         imagedestroy($this->im);
167 167
     }
168 168
 }
Please login to merge, or discard this patch.
Braces   +14 added lines, -7 removed lines patch added patch discarded remove patch
@@ -43,7 +43,8 @@  discard block
 block discarded – undo
43 43
     public $im_height  = 0;
44 44
     public $im;
45 45
 
46
-    public function __construct($w=200, $h=80) {
46
+    public function __construct($w=200, $h=80)
47
+    {
47 48
         /* create session to set word for verification */
48 49
         $this->setVeriword();
49 50
         $this->dir_font = MODX_BASE_PATH . 'assets/' . $this->dir_font;
@@ -51,21 +52,24 @@  discard block
 block discarded – undo
51 52
         $this->im_height        = $h;
52 53
     }
53 54
 
54
-    public function setVeriword() {
55
+    public function setVeriword()
56
+    {
55 57
         /* create session variable for verification,
56 58
            you may change the session variable name */
57 59
         $this->word             = $this->makeText();
58 60
         $_SESSION['veriword']   = $this->word;
59 61
     }
60 62
 
61
-    public function output() {
63
+    public function output()
64
+    {
62 65
         /* output the image as jpeg */
63 66
         $this->drawImage();
64 67
         header("Content-type: image/jpeg");
65 68
         imagejpeg($this->im);
66 69
     }
67 70
 
68
-    public function makeText() {
71
+    public function makeText()
72
+    {
69 73
         $modx = evolutionCMS();
70 74
         // set default words
71 75
         $words="MODX,Access,Better,BitCode,Chunk,Cache,Desc,Design,Excell,Enjoy,URLs,TechView,Gerald,Griff,Humphrey,Holiday,Intel,Integration,Joystick,Join(),Oscope,Genetic,Light,Likeness,Marit,Maaike,Niche,Netherlands,Ordinance,Oscillo,Parser,Phusion,Query,Question,Regalia,Righteous,Snippet,Sentinel,Template,Thespian,Unity,Enterprise,Verily,Veri,Website,WideWeb,Yap,Yellow,Zebra,Zygote";
@@ -76,7 +80,8 @@  discard block
 block discarded – undo
76 80
         return (string) $arr_words[array_rand($arr_words)].rand(10,999);
77 81
     }
78 82
 
79
-    public function drawText() {
83
+    public function drawText()
84
+    {
80 85
         $dir = dir($this->dir_font);
81 86
         $fontstmp = array();
82 87
         while (false !== ($file = $dir->read())) {
@@ -131,7 +136,8 @@  discard block
 block discarded – undo
131 136
     }
132 137
 
133 138
 
134
-    public function drawImage() {
139
+    public function drawImage()
140
+    {
135 141
 
136 142
         /* pick one background image randomly from image directory */
137 143
         $img_file       = MODX_BASE_PATH . 'assets/' . $this->dir_noise."noise".rand(1,4).".jpg";
@@ -162,7 +168,8 @@  discard block
 block discarded – undo
162 168
         return $this->im;
163 169
     }
164 170
 
165
-    public function destroy() {
171
+    public function destroy()
172
+    {
166 173
         imagedestroy($this->im);
167 174
     }
168 175
 }
Please login to merge, or discard this patch.
manager/includes/tmplvars.commands.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,3 +1,3 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-include_once MODX_BASE_PATH . 'functions/tv.php';
3
+include_once MODX_BASE_PATH.'functions/tv.php';
Please login to merge, or discard this patch.
manager/includes/tmplvars.format.inc.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,3 +1,3 @@
 block discarded – undo
1 1
 <?php
2 2
 
3
-include_once MODX_BASE_PATH . 'functions/tv.php';
3
+include_once MODX_BASE_PATH.'functions/tv.php';
Please login to merge, or discard this patch.
manager/includes/accesscontrol.inc.php 1 patch
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -18,13 +18,13 @@  discard block
 block discarded – undo
18 18
 }
19 19
 
20 20
 // andrazk 20070416 - if installer is running, destroy active sessions
21
-if (file_exists(MODX_BASE_PATH . 'assets/cache/installProc.inc.php')) {
22
-    include_once(MODX_BASE_PATH . 'assets/cache/installProc.inc.php');
21
+if (file_exists(MODX_BASE_PATH.'assets/cache/installProc.inc.php')) {
22
+    include_once(MODX_BASE_PATH.'assets/cache/installProc.inc.php');
23 23
     if (isset($installStartTime)) {
24 24
         if ((time() - $installStartTime) > 5 * 60) { // if install flag older than 5 minutes, discard
25 25
             unset($installStartTime);
26
-            @ chmod(MODX_BASE_PATH . 'assets/cache/installProc.inc.php', 0755);
27
-            unlink(MODX_BASE_PATH . 'assets/cache/installProc.inc.php');
26
+            @ chmod(MODX_BASE_PATH.'assets/cache/installProc.inc.php', 0755);
27
+            unlink(MODX_BASE_PATH.'assets/cache/installProc.inc.php');
28 28
         } else {
29 29
             if ($_SERVER['REQUEST_METHOD'] != 'POST') {
30 30
                 if (isset($_COOKIE[session_name()])) {
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
                         //						setcookie(session_name(), '', 0, MODX_BASE_URL);
51 51
                     }
52 52
                     header('HTTP/1.0 307 Redirect');
53
-                    header('Location: ' . MODX_MANAGER_URL . 'index.php?installGoingOn=2');
53
+                    header('Location: '.MODX_MANAGER_URL.'index.php?installGoingOn=2');
54 54
                 }
55 55
             }
56 56
         }
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
         // establish fallback to English default
63 63
         include_once "lang/english.inc.php";
64 64
         // include localized overrides
65
-        include_once "lang/" . $manager_language . ".inc.php";
65
+        include_once "lang/".$manager_language.".inc.php";
66 66
     } else {
67 67
         include_once "lang/english.inc.php";
68 68
     }
@@ -70,7 +70,7 @@  discard block
 block discarded – undo
70 70
     $modx->setPlaceholder('modx_charset', $modx_manager_charset);
71 71
     $modx->setPlaceholder('theme', $manager_theme);
72 72
     $modx->setPlaceholder('favicon',
73
-        (file_exists(MODX_BASE_PATH . 'favicon.ico') ? MODX_SITE_URL . 'favicon.ico' : 'media/style/' . $modx->config['manager_theme'] . '/images/favicon.ico'));
73
+        (file_exists(MODX_BASE_PATH.'favicon.ico') ? MODX_SITE_URL . 'favicon.ico' : 'media/style/'.$modx->config['manager_theme'].'/images/favicon.ico'));
74 74
 
75 75
     // invoke OnManagerLoginFormPrerender event
76 76
     $evtOut = $modx->invokeEvent('OnManagerLoginFormPrerender');
@@ -81,25 +81,25 @@  discard block
 block discarded – undo
81 81
     $modx->setPlaceholder('manager_path', MGR_DIR);
82 82
     $modx->setPlaceholder('logo_slogan', $_lang["logo_slogan"]);
83 83
     $modx->setPlaceholder('login_message', $_lang["login_message"]);
84
-    $modx->setPlaceholder('manager_theme_url', MODX_MANAGER_URL . 'media/style/' . $modx->config['manager_theme'] . '/');
84
+    $modx->setPlaceholder('manager_theme_url', MODX_MANAGER_URL.'media/style/'.$modx->config['manager_theme'].'/');
85 85
     $modx->setPlaceholder('year', date('Y'));
86 86
 
87 87
     // set login logo image
88
-    if ( !empty($modx->config['login_logo']) ) {
89
-        $modx->setPlaceholder('login_logo', MODX_SITE_URL . $modx->config['login_logo']);
88
+    if (!empty($modx->config['login_logo'])) {
89
+        $modx->setPlaceholder('login_logo', MODX_SITE_URL.$modx->config['login_logo']);
90 90
     } else {
91
-        $modx->setPlaceholder('login_logo', MODX_MANAGER_URL . 'media/style/' . $modx->config['manager_theme'] . '/images/login/default/login-logo.png');
91
+        $modx->setPlaceholder('login_logo', MODX_MANAGER_URL.'media/style/'.$modx->config['manager_theme'].'/images/login/default/login-logo.png');
92 92
     }
93 93
 
94 94
     // set login background image
95
-    if ( !empty($modx->config['login_bg']) ) {
96
-        $modx->setPlaceholder('login_bg', MODX_SITE_URL . $modx->config['login_bg']);
95
+    if (!empty($modx->config['login_bg'])) {
96
+        $modx->setPlaceholder('login_bg', MODX_SITE_URL.$modx->config['login_bg']);
97 97
     } else {
98
-        $modx->setPlaceholder('login_bg', MODX_MANAGER_URL . 'media/style/' . $modx->config['manager_theme'] . '/images/login/default/login-background.jpg');
98
+        $modx->setPlaceholder('login_bg', MODX_MANAGER_URL.'media/style/'.$modx->config['manager_theme'].'/images/login/default/login-background.jpg');
99 99
     }
100 100
 
101 101
     // set form position css class
102
-    $modx->setPlaceholder('login_form_position_class', 'loginbox-' . $modx->config['login_form_position']);
102
+    $modx->setPlaceholder('login_form_position_class', 'loginbox-'.$modx->config['login_form_position']);
103 103
 
104 104
     switch ($modx->config['manager_theme_mode']) {
105 105
       case '1':
@@ -124,11 +124,11 @@  discard block
 block discarded – undo
124 124
         switch ($installGoingOn) {
125 125
             case 1 :
126 126
                 $modx->setPlaceholder('login_message',
127
-                    "<p><span class=\"fail\">" . $_lang["login_cancelled_install_in_progress"] . "</p><p>" . $_lang["login_message"] . "</p>");
127
+                    "<p><span class=\"fail\">".$_lang["login_cancelled_install_in_progress"]."</p><p>".$_lang["login_message"]."</p>");
128 128
                 break;
129 129
             case 2 :
130 130
                 $modx->setPlaceholder('login_message',
131
-                    "<p><span class=\"fail\">" . $_lang["login_cancelled_site_was_updated"] . "</p><p>" . $_lang["login_message"] . "</p>");
131
+                    "<p><span class=\"fail\">".$_lang["login_cancelled_site_was_updated"]."</p><p>".$_lang["login_message"]."</p>");
132 132
                 break;
133 133
         }
134 134
     }
@@ -136,9 +136,9 @@  discard block
 block discarded – undo
136 136
     if ($modx->config['use_captcha'] == 1) {
137 137
         $modx->setPlaceholder('login_captcha_message', $_lang["login_captcha_message"]);
138 138
         $modx->setPlaceholder('captcha_image',
139
-            '<a href="' . MODX_MANAGER_URL . '" class="loginCaptcha"><img id="captcha_image" src="' . MODX_MANAGER_URL . 'captcha.php?rand=' . rand() . '" alt="' . $_lang["login_captcha_message"] . '" /></a>');
139
+            '<a href="'.MODX_MANAGER_URL.'" class="loginCaptcha"><img id="captcha_image" src="'.MODX_MANAGER_URL.'captcha.php?rand='.rand().'" alt="'.$_lang["login_captcha_message"].'" /></a>');
140 140
         $modx->setPlaceholder('captcha_input',
141
-            '<label>' . $_lang["captcha_code"] . '</label> <input type="text" name="captcha_code" tabindex="3" value="" />');
141
+            '<label>'.$_lang["captcha_code"].'</label> <input type="text" name="captcha_code" tabindex="3" value="" />');
142 142
     }
143 143
 
144 144
     // login info
@@ -156,7 +156,7 @@  discard block
 block discarded – undo
156 156
 
157 157
     // invoke OnManagerLoginFormRender event
158 158
     $evtOut = $modx->invokeEvent('OnManagerLoginFormRender');
159
-    $html = is_array($evtOut) ? '<div id="onManagerLoginFormRender">' . implode('', $evtOut) . '</div>' : '';
159
+    $html = is_array($evtOut) ? '<div id="onManagerLoginFormRender">'.implode('', $evtOut).'</div>' : '';
160 160
     $modx->setPlaceholder('OnManagerLoginFormRender', $html);
161 161
 
162 162
     // load template
@@ -174,29 +174,29 @@  discard block
 block discarded – undo
174 174
             $login_tpl = file_get_contents($target);
175 175
         }
176 176
     } else {
177
-        $theme_path = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/';
178
-        if (is_file($theme_path . 'style.php')) {
179
-            include($theme_path . 'style.php');
177
+        $theme_path = MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/';
178
+        if (is_file($theme_path.'style.php')) {
179
+            include($theme_path.'style.php');
180 180
         }
181 181
         $chunk = $modx->getChunk($target);
182 182
         if ($chunk !== false && !empty($chunk)) {
183 183
             $login_tpl = $chunk;
184
-        } elseif (is_file(MODX_BASE_PATH . $target)) {
185
-            $target = MODX_BASE_PATH . $target;
184
+        } elseif (is_file(MODX_BASE_PATH.$target)) {
185
+            $target = MODX_BASE_PATH.$target;
186 186
             $login_tpl = file_get_contents($target);
187 187
         } elseif (is_file($target)) {
188 188
             $login_tpl = file_get_contents($target);
189
-        } elseif (is_file($theme_path . 'login.tpl')) {
190
-            $target = $theme_path . 'login.tpl';
189
+        } elseif (is_file($theme_path.'login.tpl')) {
190
+            $target = $theme_path.'login.tpl';
191 191
             $login_tpl = file_get_contents($target);
192
-        } elseif (is_file($theme_path . 'templates/actions/login.tpl')) {
193
-            $target = $theme_path . 'templates/actions/login.tpl';
192
+        } elseif (is_file($theme_path.'templates/actions/login.tpl')) {
193
+            $target = $theme_path.'templates/actions/login.tpl';
194 194
             $login_tpl = file_get_contents($target);
195
-        } elseif (is_file($theme_path . 'html/login.html')) { // ClipperCMS compatible
196
-            $target = $theme_path . 'html/login.html';
195
+        } elseif (is_file($theme_path.'html/login.html')) { // ClipperCMS compatible
196
+            $target = $theme_path.'html/login.html';
197 197
             $login_tpl = file_get_contents($target);
198 198
         } else {
199
-            $target = MODX_MANAGER_PATH . 'media/style/common/login.tpl';
199
+            $target = MODX_MANAGER_PATH.'media/style/common/login.tpl';
200 200
             $login_tpl = file_get_contents($target);
201 201
         }
202 202
     }
@@ -216,17 +216,17 @@  discard block
 block discarded – undo
216 216
     $modx->updateValidatedUserSession();
217 217
 
218 218
     // Update last action in table active_users
219
-    $itemid = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : '';
219
+    $itemid = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : '';
220 220
     $lasthittime = time();
221
-    $action = isset($_REQUEST['a']) ? (int)$_REQUEST['a'] : 1;
221
+    $action = isset($_REQUEST['a']) ? (int) $_REQUEST['a'] : 1;
222 222
 
223 223
     if ($action !== 1) {
224
-        if ((int)$itemid <= 0) {
224
+        if ((int) $itemid <= 0) {
225 225
             $itemid = null;
226 226
         }
227 227
         $sql = sprintf("REPLACE INTO %s (sid, internalKey, username, lasthit, action, id) VALUES ('%s', %d, '%s', %d, '%s', %s)",
228 228
             $modx->getFullTableName('active_users') // Table
229
-            , session_id(), $modx->getLoginUserID(), $_SESSION['mgrShortname'], $lasthittime, (string)$action,
229
+            , session_id(), $modx->getLoginUserID(), $_SESSION['mgrShortname'], $lasthittime, (string) $action,
230 230
             $itemid == null ? var_export(null, true) : $itemid);
231 231
         $modx->db->query($sql);
232 232
     }
Please login to merge, or discard this patch.