Completed
Push — develop ( 7e4f1d...c463ba )
by Dmytro
11:42 queued 04:02
created
manager/media/browser/mcpuk/browse.php 3 patches
Indentation   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -1,23 +1,23 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 /** This file is part of KCFinder project
4
-  *
5
-  *      @desc Browser calling script
6
-  *   @package KCFinder
7
-  *   @version 2.54
8
-  *    @author Pavel Tzonkov <[email protected]>
9
-  * @copyright 2010-2014 KCFinder Project
10
-  *   @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2
11
-  *   @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2
12
-  *      @link http://kcfinder.sunhater.com
13
-  */
4
+ *
5
+ *      @desc Browser calling script
6
+ *   @package KCFinder
7
+ *   @version 2.54
8
+ *    @author Pavel Tzonkov <[email protected]>
9
+ * @copyright 2010-2014 KCFinder Project
10
+ *   @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2
11
+ *   @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2
12
+ *      @link http://kcfinder.sunhater.com
13
+ */
14 14
 
15 15
 require "core/autoload.php"; // Init MODX
16 16
 
17 17
 function returnNoPermissionsMessage($role) {
18
-	global $_lang;
19
-	echo sprintf($_lang['files_management_no_permission'], $role);
20
-	exit;
18
+    global $_lang;
19
+    echo sprintf($_lang['files_management_no_permission'], $role);
20
+    exit;
21 21
 }
22 22
 
23 23
 if( $_GET['type'] == 'images' && !$modx->hasPermission('file_manager') && !$modx->hasPermission('assets_images')) returnNoPermissionsMessage('assets_images');
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -14,14 +14,14 @@
 block discarded – undo
14 14
 
15 15
 require "core/autoload.php"; // Init MODX
16 16
 
17
-function returnNoPermissionsMessage($role) {
17
+function returnNoPermissionsMessage($role){
18 18
 	global $_lang;
19 19
 	echo sprintf($_lang['files_management_no_permission'], $role);
20 20
 	exit;
21 21
 }
22 22
 
23
-if( $_GET['type'] == 'images' && !$modx->hasPermission('file_manager') && !$modx->hasPermission('assets_images')) returnNoPermissionsMessage('assets_images');
24
-if( $_GET['type'] == 'files'  && !$modx->hasPermission('file_manager') && !$modx->hasPermission('assets_files'))  returnNoPermissionsMessage('assets_files');
23
+if ($_GET['type'] == 'images' && !$modx->hasPermission('file_manager') && !$modx->hasPermission('assets_images')) returnNoPermissionsMessage('assets_images');
24
+if ($_GET['type'] == 'files' && !$modx->hasPermission('file_manager') && !$modx->hasPermission('assets_files'))  returnNoPermissionsMessage('assets_files');
25 25
 
26 26
 $browser = new browser($modx);
27 27
 $browser->action();
Please login to merge, or discard this patch.
Braces   +8 added lines, -3 removed lines patch added patch discarded remove patch
@@ -14,14 +14,19 @@
 block discarded – undo
14 14
 
15 15
 require "core/autoload.php"; // Init MODX
16 16
 
17
-function returnNoPermissionsMessage($role) {
17
+function returnNoPermissionsMessage($role)
18
+{
18 19
 	global $_lang;
19 20
 	echo sprintf($_lang['files_management_no_permission'], $role);
20 21
 	exit;
21 22
 }
22 23
 
23
-if( $_GET['type'] == 'images' && !$modx->hasPermission('file_manager') && !$modx->hasPermission('assets_images')) returnNoPermissionsMessage('assets_images');
24
-if( $_GET['type'] == 'files'  && !$modx->hasPermission('file_manager') && !$modx->hasPermission('assets_files'))  returnNoPermissionsMessage('assets_files');
24
+if( $_GET['type'] == 'images' && !$modx->hasPermission('file_manager') && !$modx->hasPermission('assets_images')) {
25
+    returnNoPermissionsMessage('assets_images');
26
+}
27
+if( $_GET['type'] == 'files'  && !$modx->hasPermission('file_manager') && !$modx->hasPermission('assets_files')) {
28
+    returnNoPermissionsMessage('assets_files');
29
+}
25 30
 
26 31
 $browser = new browser($modx);
27 32
 $browser->action();
Please login to merge, or discard this patch.
manager/media/style/default/welcome.php 2 patches
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,15 +1,15 @@
 block discarded – undo
1 1
 <?php
2 2
 $modx->config['enable_filter'] = 1;
3 3
 
4
-$modx->addSnippet('hasPermission','return $modx->hasPermission($key);');
4
+$modx->addSnippet('hasPermission', 'return $modx->hasPermission($key);');
5 5
 
6
-if($modx->hasPermission('new_template') || $modx->hasPermission('edit_template') || $modx->hasPermission('new_snippet') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('new_plugin') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('manage_metatags'))
6
+if ($modx->hasPermission('new_template') || $modx->hasPermission('edit_template') || $modx->hasPermission('new_snippet') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('new_plugin') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('manage_metatags'))
7 7
     $hasAnyPermission = 1;
8 8
 else $hasAnyPermission = 0;
9
-$modx->addSnippet('hasAnyPermission','global $hasAnyPermission; return $hasAnyPermission;');
10
-$modx->addSnippet('getLoginUserName','return $modx->getLoginUserName();');
9
+$modx->addSnippet('hasAnyPermission', 'global $hasAnyPermission; return $hasAnyPermission;');
10
+$modx->addSnippet('getLoginUserName', 'return $modx->getLoginUserName();');
11 11
 $code = 'global $_lang;return $_SESSION["nrtotalmessages"] ? sprintf($_lang["welcome_messages"], $_SESSION["nrtotalmessages"], \'<span style="color:red;">\' . $_SESSION["nrnewmessages"] . "</span>") : $_lang["messages_no_messages"];';
12
-$modx->addSnippet('getMessageCount',$code);
12
+$modx->addSnippet('getMessageCount', $code);
13 13
 
14 14
 // Large Icons
15 15
 $_style['icons_backup_large']       = 'fa fa-database fa-fw fa-2x';
Please login to merge, or discard this patch.
Braces   +5 added lines, -3 removed lines patch added patch discarded remove patch
@@ -3,9 +3,11 @@
 block discarded – undo
3 3
 
4 4
 $modx->addSnippet('hasPermission','return $modx->hasPermission($key);');
5 5
 
6
-if($modx->hasPermission('new_template') || $modx->hasPermission('edit_template') || $modx->hasPermission('new_snippet') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('new_plugin') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('manage_metatags'))
7
-    $hasAnyPermission = 1;
8
-else $hasAnyPermission = 0;
6
+if($modx->hasPermission('new_template') || $modx->hasPermission('edit_template') || $modx->hasPermission('new_snippet') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('new_plugin') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('manage_metatags')) {
7
+    $hasAnyPermission = 1;
8
+} else {
9
+    $hasAnyPermission = 0;
10
+}
9 11
 $modx->addSnippet('hasAnyPermission','global $hasAnyPermission; return $hasAnyPermission;');
10 12
 $modx->addSnippet('getLoginUserName','return $modx->getLoginUserName();');
11 13
 $code = 'global $_lang;return $_SESSION["nrtotalmessages"] ? sprintf($_lang["welcome_messages"], $_SESSION["nrtotalmessages"], \'<span style="color:red;">\' . $_SESSION["nrnewmessages"] . "</span>") : $_lang["messages_no_messages"];';
Please login to merge, or discard this patch.
manager/media/style/default/ajax.php 2 patches
Braces   +73 added lines, -73 removed lines patch added patch discarded remove patch
@@ -7,11 +7,11 @@  discard block
 block discarded – undo
7 7
 
8 8
 $modx->db->connect();
9 9
 
10
-if (empty ($modx->config)) {
10
+if (empty ($modx->config)) {
11 11
     $modx->getSettings();
12 12
 }
13 13
 
14
-if (!isset($_SESSION['mgrValidated']) || !isset($_SERVER['HTTP_X_REQUESTED_WITH']) || (strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') || ($_SERVER['REQUEST_METHOD'] != 'POST')) {
14
+if (!isset($_SESSION['mgrValidated']) || !isset($_SERVER['HTTP_X_REQUESTED_WITH']) || (strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') || ($_SERVER['REQUEST_METHOD'] != 'POST')) {
15 15
     $modx->sendErrorPage();
16 16
 }
17 17
 
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 
21 21
 $_lang = array();
22 22
 include_once MODX_MANAGER_PATH . '/includes/lang/english.inc.php';
23
-if ($modx->config['manager_language'] != 'english') {
23
+if ($modx->config['manager_language'] != 'english') {
24 24
     include_once MODX_MANAGER_PATH . '/includes/lang/' . $modx->config['manager_language'] . '.inc.php';
25 25
 }
26 26
 include_once MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/style.php';
@@ -33,12 +33,12 @@  discard block
 block discarded – undo
33 33
 // set limit sql query
34 34
 $limit = !empty($modx->config['number_of_results']) ? (int) $modx->config['number_of_results'] : 100;
35 35
 
36
-if (isset($action)) {
37
-    switch ($action) {
36
+if (isset($action)) {
37
+    switch ($action) {
38 38
 
39 39
         case '1': {
40 40
 
41
-            switch ($frame) {
41
+            switch ($frame) {
42 42
                 case 'nodes':
43 43
                     include_once MODX_MANAGER_PATH . '/frames/nodes.php';
44 44
 
@@ -52,7 +52,7 @@  discard block
 block discarded – undo
52 52
 
53 53
             $elements = isset($_REQUEST['elements']) && is_scalar($_REQUEST['elements']) ? htmlentities($_REQUEST['elements']) : '';
54 54
 
55
-            if ($elements) {
55
+            if ($elements) {
56 56
                 $output = '';
57 57
                 $items = '';
58 58
                 $sql = '';
@@ -61,7 +61,7 @@  discard block
 block discarded – undo
61 61
                 $sqlLike = $filter ? 'WHERE t1.name LIKE "' . $modx->db->escape($filter) . '%"' : '';
62 62
                 $sqlLimit = $sqlLike ? '' : 'LIMIT ' . $limit;
63 63
 
64
-                switch ($elements) {
64
+                switch ($elements) {
65 65
                     case 'element_templates':
66 66
                         $a = 16;
67 67
                         $sqlLike = $filter ? 'WHERE t1.templatename LIKE "' . $modx->db->escape($filter) . '%"' : '';
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
                         ORDER BY t1.templatename ASC
72 72
                         ' . $sqlLimit);
73 73
 
74
-                        if ($modx->hasPermission('new_template')) {
74
+                        if ($modx->hasPermission('new_template')) {
75 75
                             $output .= '<li><a id="a_19" href="index.php?a=19" target="main"><i class="fa fa-plus"></i>' . $_lang['new_template'] . '</a></li>';
76 76
                         }
77 77
 
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
                         ORDER BY t1.name ASC
88 88
                         ' . $sqlLimit);
89 89
 
90
-                        if ($modx->hasPermission('edit_template') && $modx->hasPermission('edit_snippet') && $modx->hasPermission('edit_chunk') && $modx->hasPermission('edit_plugin')) {
90
+                        if ($modx->hasPermission('edit_template') && $modx->hasPermission('edit_snippet') && $modx->hasPermission('edit_chunk') && $modx->hasPermission('edit_plugin')) {
91 91
                             $output .= '<li><a id="a_300" href="index.php?a=300" target="main"><i class="fa fa-plus"></i>' . $_lang['new_tmplvars'] . '</a></li>';
92 92
                         }
93 93
 
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
                         ORDER BY t1.name ASC
102 102
                         ' . $sqlLimit);
103 103
 
104
-                        if ($modx->hasPermission('new_chunk')) {
104
+                        if ($modx->hasPermission('new_chunk')) {
105 105
                             $output .= '<li><a id="a_77" href="index.php?a=77" target="main"><i class="fa fa-plus"></i>' . $_lang['new_htmlsnippet'] . '</a></li>';
106 106
                         }
107 107
 
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
                         ORDER BY t1.name ASC
116 116
                         ' . $sqlLimit);
117 117
 
118
-                        if ($modx->hasPermission('new_snippet')) {
118
+                        if ($modx->hasPermission('new_snippet')) {
119 119
                             $output .= '<li><a id="a_23" href="index.php?a=23" target="main"><i class="fa fa-plus"></i>' . $_lang['new_snippet'] . '</a></li>';
120 120
                         }
121 121
 
@@ -129,19 +129,19 @@  discard block
 block discarded – undo
129 129
                         ORDER BY t1.name ASC
130 130
                         ' . $sqlLimit);
131 131
 
132
-                        if ($modx->hasPermission('new_plugin')) {
132
+                        if ($modx->hasPermission('new_plugin')) {
133 133
                             $output .= '<li><a id="a_101" href="index.php?a=101" target="main"><i class="fa fa-plus"></i>' . $_lang['new_plugin'] . '</a></li>';
134 134
                         }
135 135
 
136 136
                         break;
137 137
                 }
138 138
 
139
-                if ($count = $modx->db->getRecordCount($sql)) {
140
-                    if ($count == $limit) {
139
+                if ($count = $modx->db->getRecordCount($sql)) {
140
+                    if ($count == $limit) {
141 141
                         $output .= '<li class="item-input"><input type="text" name="filter" class="dropdown-item form-control form-control-sm" autocomplete="off" /></li>';
142 142
                     }
143
-                    while ($row = $modx->db->getRow($sql)) {
144
-                        if (($row['disabled'] || $row['locked']) && $role != 1) {
143
+                    while ($row = $modx->db->getRow($sql)) {
144
+                        if (($row['disabled'] || $row['locked']) && $role != 1) {
145 145
                             continue;
146 146
                         }
147 147
 
@@ -149,9 +149,9 @@  discard block
 block discarded – undo
149 149
                     }
150 150
                 }
151 151
 
152
-                if (isset($_REQUEST['filter'])) {
152
+                if (isset($_REQUEST['filter'])) {
153 153
                     $output = $items;
154
-                } else {
154
+                } else {
155 155
                     $output .= $items;
156 156
                 }
157 157
 
@@ -176,22 +176,22 @@  discard block
 block discarded – undo
176 176
 				ORDER BY t1.username ASC
177 177
 				' . $sqlLimit);
178 178
 
179
-            if ($modx->hasPermission('new_user')) {
179
+            if ($modx->hasPermission('new_user')) {
180 180
                 $output .= '<li><a id="a_11" href="index.php?a=11" target="main"><i class="fa fa-plus"></i>' . $_lang['new_user'] . '</a></li>';
181 181
             }
182 182
 
183
-            if ($count = $modx->db->getRecordCount($sql)) {
184
-                if ($count == $limit) {
183
+            if ($count = $modx->db->getRecordCount($sql)) {
184
+                if ($count == $limit) {
185 185
                     $output .= '<li class="item-input"><input type="text" name="filter" class="dropdown-item form-control form-control-sm" autocomplete="off" /></li>';
186 186
                 }
187
-                while ($row = $modx->db->getRow($sql)) {
187
+                while ($row = $modx->db->getRow($sql)) {
188 188
                     $items .= '<li class="item ' . ($row['blocked'] ? 'disabled' : '') . '"><a id="a_' . $a . '__id_' . $row['id'] . '" href="index.php?a=' . $a . '&id=' . $row['id'] . '" target="main">' . $row['name'] . ' <small>(' . $row['id'] . ')</small></a></li>';
189 189
                 }
190 190
             }
191 191
 
192
-            if (isset($_REQUEST['filter'])) {
192
+            if (isset($_REQUEST['filter'])) {
193 193
                 $output = $items;
194
-            } else {
194
+            } else {
195 195
                 $output .= $items;
196 196
             }
197 197
 
@@ -215,22 +215,22 @@  discard block
 block discarded – undo
215 215
 				ORDER BY t1.username ASC
216 216
 				' . $sqlLimit);
217 217
 
218
-            if ($modx->hasPermission('new_web_user')) {
218
+            if ($modx->hasPermission('new_web_user')) {
219 219
                 $output .= '<li><a id="a_87" href="index.php?a=87" target="main"><i class="fa fa-plus"></i>' . $_lang['new_web_user'] . '</a></li>';
220 220
             }
221 221
 
222
-            if ($count = $modx->db->getRecordCount($sql)) {
223
-                if ($count == $limit) {
222
+            if ($count = $modx->db->getRecordCount($sql)) {
223
+                if ($count == $limit) {
224 224
                     $output .= '<li class="item-input"><input type="text" name="filter" class="dropdown-item form-control form-control-sm" autocomplete="off" /></li>';
225 225
                 }
226
-                while ($row = $modx->db->getRow($sql)) {
226
+                while ($row = $modx->db->getRow($sql)) {
227 227
                     $items .= '<li class="item ' . ($row['blocked'] ? 'disabled' : '') . '"><a id="a_' . $a . '__id_' . $row['id'] . '" href="index.php?a=' . $a . '&id=' . $row['id'] . '" target="main">' . $row['name'] . ' <small>(' . $row['id'] . ')</small></a></li>';
228 228
                 }
229 229
             }
230 230
 
231
-            if (isset($_REQUEST['filter'])) {
231
+            if (isset($_REQUEST['filter'])) {
232 232
                 $output = $items;
233
-            } else {
233
+            } else {
234 234
                 $output .= $items;
235 235
             }
236 236
 
@@ -244,8 +244,8 @@  discard block
 block discarded – undo
244 244
             $type = isset($_REQUEST['type']) && is_scalar($_REQUEST['type']) ? $modx->db->escape($_REQUEST['type']) : false;
245 245
             $contextmenu = '';
246 246
 
247
-            if ($role && $name && $type) {
248
-                switch ($type) {
247
+            if ($role && $name && $type) {
248
+                switch ($type) {
249 249
                     case 'Snippet':
250 250
                     case 'SnippetNoCache': {
251 251
 
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
 						WHERE name="' . $name . '"
255 255
 						LIMIT 1');
256 256
 
257
-                        if ($modx->db->getRecordCount($sql)) {
257
+                        if ($modx->db->getRecordCount($sql)) {
258 258
                             $row = $modx->db->getRow($sql);
259 259
                             $contextmenu = array(
260 260
                                 'header' => array(
@@ -265,13 +265,13 @@  discard block
 block discarded – undo
265 265
                                     'url' => "index.php?a=22&id=" . $row['id']
266 266
                                 )
267 267
                             );
268
-                            if (!empty($row['description'])) {
268
+                            if (!empty($row['description'])) {
269 269
                                 $contextmenu['seperator'] = '';
270 270
                                 $contextmenu['description'] = array(
271 271
                                     'innerHTML' => '<i class="fa fa-info"></i> ' . $row['description']
272 272
                                 );
273 273
                             }
274
-                        } else {
274
+                        } else {
275 275
                             $contextmenu = array(
276 276
                                 'header' => array(
277 277
                                     'innerHTML' => '<i class="fa fa-code"></i> ' . $name
@@ -292,7 +292,7 @@  discard block
 block discarded – undo
292 292
 						WHERE name="' . $name . '"
293 293
 						LIMIT 1');
294 294
 
295
-                        if ($modx->db->getRecordCount($sql)) {
295
+                        if ($modx->db->getRecordCount($sql)) {
296 296
                             $row = $modx->db->getRow($sql);
297 297
                             $contextmenu = array(
298 298
                                 'header' => array(
@@ -303,13 +303,13 @@  discard block
 block discarded – undo
303 303
                                     'url' => "index.php?a=78&id=" . $row['id']
304 304
                                 )
305 305
                             );
306
-                            if (!empty($row['description'])) {
306
+                            if (!empty($row['description'])) {
307 307
                                 $contextmenu['seperator'] = '';
308 308
                                 $contextmenu['description'] = array(
309 309
                                     'innerHTML' => '<i class="fa fa-info"></i> ' . $row['description']
310 310
                                 );
311 311
                             }
312
-                        } else {
312
+                        } else {
313 313
                             $contextmenu = array(
314 314
                                 'header' => array(
315 315
                                     'innerHTML' => '<i class="fa fa-th-large"></i> ' . $name
@@ -329,7 +329,7 @@  discard block
 block discarded – undo
329 329
 						WHERE name="' . $name . '"
330 330
 						LIMIT 1');
331 331
 
332
-                        if ($modx->db->getRecordCount($sql)) {
332
+                        if ($modx->db->getRecordCount($sql)) {
333 333
                             $row = $modx->db->getRow($sql);
334 334
                             $contextmenu = array(
335 335
                                 'header' => array(
@@ -340,20 +340,20 @@  discard block
 block discarded – undo
340 340
                                     'url' => "index.php?a=78&id=" . $row['id']
341 341
                                 )
342 342
                             );
343
-                            if (!empty($row['description'])) {
343
+                            if (!empty($row['description'])) {
344 344
                                 $contextmenu['seperator'] = '';
345 345
                                 $contextmenu['description'] = array(
346 346
                                     'innerHTML' => '<i class="fa fa-info"></i> ' . $row['description']
347 347
                                 );
348 348
                             }
349
-                        } else {
349
+                        } else {
350 350
 
351 351
                             $sql = $modx->db->query('SELECT *
352 352
 							FROM ' . $modx->getFullTableName('site_snippets') . '
353 353
 							WHERE name="' . $name . '"
354 354
 							LIMIT 1');
355 355
 
356
-                            if ($modx->db->getRecordCount($sql)) {
356
+                            if ($modx->db->getRecordCount($sql)) {
357 357
                                 $row = $modx->db->getRow($sql);
358 358
                                 $contextmenu = array(
359 359
                                     'header' => array(
@@ -364,13 +364,13 @@  discard block
 block discarded – undo
364 364
                                         'url' => "index.php?a=22&id=" . $row['id']
365 365
                                     )
366 366
                                 );
367
-                                if (!empty($row['description'])) {
367
+                                if (!empty($row['description'])) {
368 368
                                     $contextmenu['seperator'] = '';
369 369
                                     $contextmenu['description'] = array(
370 370
                                         'innerHTML' => '<i class="fa fa-info"></i> ' . $row['description']
371 371
                                     );
372 372
                                 }
373
-                            } else {
373
+                            } else {
374 374
                                 $contextmenu = array(
375 375
                                     'header' => array(
376 376
                                         'innerHTML' => '<i class="fa fa-code"></i> ' . $name
@@ -432,7 +432,7 @@  discard block
 block discarded – undo
432 432
                             'alias_visible'
433 433
                         );
434 434
 
435
-                        if (in_array($name, $default_field)) {
435
+                        if (in_array($name, $default_field)) {
436 436
                             return;
437 437
                         }
438 438
 
@@ -441,7 +441,7 @@  discard block
 block discarded – undo
441 441
 						WHERE name="' . $name . '"
442 442
 						LIMIT 1');
443 443
 
444
-                        if ($modx->db->getRecordCount($sql)) {
444
+                        if ($modx->db->getRecordCount($sql)) {
445 445
                             $row = $modx->db->getRow($sql);
446 446
                             $contextmenu = array(
447 447
                                 'header' => array(
@@ -452,13 +452,13 @@  discard block
 block discarded – undo
452 452
                                     'url' => "index.php?a=301&id=" . $row['id']
453 453
                                 )
454 454
                             );
455
-                            if (!empty($row['description'])) {
455
+                            if (!empty($row['description'])) {
456 456
                                 $contextmenu['seperator'] = '';
457 457
                                 $contextmenu['description'] = array(
458 458
                                     'innerHTML' => '<i class="fa fa-info"></i> ' . $row['description']
459 459
                                 );
460 460
                             }
461
-                        } else {
461
+                        } else {
462 462
                             $contextmenu = array(
463 463
                                 'header' => array(
464 464
                                     'innerHTML' => '<i class="fa fa-list-alt"></i> ' . $name
@@ -483,13 +483,13 @@  discard block
 block discarded – undo
483 483
         case 'movedocument' : {
484 484
             $json = array();
485 485
 
486
-            if ($modx->hasPermission('new_document') && $modx->hasPermission('edit_document') && $modx->hasPermission('save_document')) {
486
+            if ($modx->hasPermission('new_document') && $modx->hasPermission('edit_document') && $modx->hasPermission('save_document')) {
487 487
                 $id = !empty($_REQUEST['id']) ? (int)$_REQUEST['id'] : '';
488 488
                 $parent = isset($_REQUEST['parent']) ? (int)$_REQUEST['parent'] : 0;
489 489
                 $menuindex = isset($_REQUEST['menuindex']) && is_scalar($_REQUEST['menuindex']) ? $_REQUEST['menuindex'] : 0;
490 490
 
491 491
                 // set parent
492
-                if ($id && $parent >= 0) {
492
+                if ($id && $parent >= 0) {
493 493
 
494 494
                     // find older parent
495 495
                     $parentOld = $modx->db->getValue($modx->db->select('parent', $modx->getFullTableName('site_content'), 'id=' . $id));
@@ -500,31 +500,31 @@  discard block
 block discarded – undo
500 500
                         'new_parent'  => $parent,
501 501
                     ]);
502 502
 
503
-                    if (is_array($eventOut) && count($eventOut) > 0) {
503
+                    if (is_array($eventOut) && count($eventOut) > 0) {
504 504
                         $eventParent = array_pop($eventOut);
505 505
 
506
-                        if ($eventParent == $parentOld) {
506
+                        if ($eventParent == $parentOld) {
507 507
                             $json['errors'] = $_lang['error_movedocument2'];
508
-                        } else {
508
+                        } else {
509 509
                             $parent = $eventParent;
510 510
                         }
511 511
                     }
512 512
 
513
-                    if (empty($json['errors'])) {
513
+                    if (empty($json['errors'])) {
514 514
                         // check privileges user for move docs
515
-                        if (!empty($modx->config['tree_show_protected']) && $role != 1) {
515
+                        if (!empty($modx->config['tree_show_protected']) && $role != 1) {
516 516
                             $sql = $modx->db->select('*', $modx->getFullTableName('document_groups'), 'document IN(' . $id . ',' . $parent . ',' . $parentOld . ')');
517
-                            if ($modx->db->getRecordCount($sql)) {
517
+                            if ($modx->db->getRecordCount($sql)) {
518 518
                                 $document_groups = array();
519
-                                while ($row = $modx->db->getRow($sql)) {
519
+                                while ($row = $modx->db->getRow($sql)) {
520 520
                                     $document_groups[$row['document']]['groups'][] = $row['document_group'];
521 521
                                 }
522
-                                foreach ($document_groups as $key => $value) {
523
-                                    if (($key == $parent || $key == $parentOld || $key == $id) && !in_array($role, $value['groups'])) {
522
+                                foreach ($document_groups as $key => $value) {
523
+                                    if (($key == $parent || $key == $parentOld || $key == $id) && !in_array($role, $value['groups'])) {
524 524
                                         $json['errors'] = $_lang["error_no_privileges"];
525 525
                                     }
526 526
                                 }
527
-                                if ($json['errors']) {
527
+                                if ($json['errors']) {
528 528
                                     header('content-type: application/json');
529 529
                                     echo json_encode($json, JSON_FORCE_OBJECT | JSON_UNESCAPED_UNICODE);
530 530
                                     break;
@@ -532,9 +532,9 @@  discard block
 block discarded – undo
532 532
                             }
533 533
                         }
534 534
 
535
-                        if ($parent == 0 && $parent != $parentOld && !$modx->config['udperms_allowroot'] && $role != 1) {
535
+                        if ($parent == 0 && $parent != $parentOld && !$modx->config['udperms_allowroot'] && $role != 1) {
536 536
                             $json['errors'] = $_lang["error_no_privileges"];
537
-                        } else {
537
+                        } else {
538 538
                             // set new parent
539 539
                             $modx->db->update(array(
540 540
                                 'parent' => $parent
@@ -544,13 +544,13 @@  discard block
 block discarded – undo
544 544
                                 'isfolder' => 1
545 545
                             ), $modx->getFullTableName('site_content'), 'id=' . $parent);
546 546
 
547
-                            if ($parent != $parentOld) {
547
+                            if ($parent != $parentOld) {
548 548
                                 // check children docs and set parent isfolder
549
-                                if ($modx->db->getRecordCount($modx->db->select('id', $modx->getFullTableName('site_content'), 'parent=' . $parentOld))) {
549
+                                if ($modx->db->getRecordCount($modx->db->select('id', $modx->getFullTableName('site_content'), 'parent=' . $parentOld))) {
550 550
                                     $modx->db->update(array(
551 551
                                         'isfolder' => 1
552 552
                                     ), $modx->getFullTableName('site_content'), 'id=' . $parentOld);
553
-                                } else {
553
+                                } else {
554 554
                                     $modx->db->update(array(
555 555
                                         'isfolder' => 0
556 556
                                     ), $modx->getFullTableName('site_content'), 'id=' . $parentOld);
@@ -558,16 +558,16 @@  discard block
 block discarded – undo
558 558
                             }
559 559
 
560 560
                             // set menuindex
561
-                            if (!empty($menuindex)) {
561
+                            if (!empty($menuindex)) {
562 562
                                 $menuindex = explode(',', $menuindex);
563
-                                foreach ($menuindex as $key => $value) {
563
+                                foreach ($menuindex as $key => $value) {
564 564
                                     $modx->db->query('UPDATE ' . $modx->getFullTableName('site_content') . ' SET menuindex=' . $key . ' WHERE id=' . $value);
565 565
                                 }
566
-                            } else {
566
+                            } else {
567 567
                                 // TODO: max(*) menuindex
568 568
                             }
569 569
 
570
-                            if (!$json['errors']) {
570
+                            if (!$json['errors']) {
571 571
                                 $json['success'] = $_lang["actioncomplete"];
572 572
 
573 573
                                 $modx->invokeEvent('onAfterMoveDocument', [
@@ -579,7 +579,7 @@  discard block
 block discarded – undo
579 579
                         }
580 580
                     }
581 581
                 }
582
-            } else {
582
+            } else {
583 583
                 $json['errors'] = $_lang["error_no_privileges"];
584 584
             }
585 585
 
@@ -595,7 +595,7 @@  discard block
 block discarded – undo
595 595
 
596 596
             $output = !!$modx->elementIsLocked($type, $id, true);
597 597
 
598
-            if (!$output) {
598
+            if (!$output) {
599 599
                 $docgrp = (isset($_SESSION['mgrDocgroups']) && is_array($_SESSION['mgrDocgroups'])) ? implode(',', $_SESSION['mgrDocgroups']) : '';
600 600
                 $docgrp_cond = $docgrp ? ' OR dg.document_group IN (' . $docgrp . ')' : '';
601 601
                 $sql = '
@@ -604,7 +604,7 @@  discard block
 block discarded – undo
604 604
                     LEFT JOIN ' . $modx->getFullTableName('document_groups') . ' dg ON dg.document=sc.id
605 605
                     WHERE sc.id=' . $id . ' GROUP BY sc.id';
606 606
                 $sql = $modx->db->query($sql);
607
-                if ($modx->db->getRecordCount($sql)) {
607
+                if ($modx->db->getRecordCount($sql)) {
608 608
                     $row = $modx->db->getRow($sql);
609 609
                     $output = !!$row['locked'];
610 610
                 }
Please login to merge, or discard this patch.
Spacing   +98 added lines, -98 removed lines patch added patch discarded remove patch
@@ -19,11 +19,11 @@  discard block
 block discarded – undo
19 19
 $modx->loadExtension("ManagerAPI");
20 20
 
21 21
 $_lang = array();
22
-include_once MODX_MANAGER_PATH . '/includes/lang/english.inc.php';
22
+include_once MODX_MANAGER_PATH.'/includes/lang/english.inc.php';
23 23
 if ($modx->config['manager_language'] != 'english') {
24
-    include_once MODX_MANAGER_PATH . '/includes/lang/' . $modx->config['manager_language'] . '.inc.php';
24
+    include_once MODX_MANAGER_PATH.'/includes/lang/'.$modx->config['manager_language'].'.inc.php';
25 25
 }
26
-include_once MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/style.php';
26
+include_once MODX_MANAGER_PATH.'/media/style/'.$modx->config['manager_theme'].'/style.php';
27 27
 
28 28
 $action = isset($_REQUEST['a']) ? $_REQUEST['a'] : '';
29 29
 $frame = isset($_REQUEST['f']) ? $_REQUEST['f'] : '';
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 
41 41
             switch ($frame) {
42 42
                 case 'nodes':
43
-                    include_once MODX_MANAGER_PATH . '/frames/nodes.php';
43
+                    include_once MODX_MANAGER_PATH.'/frames/nodes.php';
44 44
 
45 45
                     break;
46 46
             }
@@ -58,21 +58,21 @@  discard block
 block discarded – undo
58 58
                 $sql = '';
59 59
                 $a = '';
60 60
                 $filter = !empty($_REQUEST['filter']) && is_scalar($_REQUEST['filter']) ? addcslashes(trim($_REQUEST['filter']), '%*_') : '';
61
-                $sqlLike = $filter ? 'WHERE t1.name LIKE "' . $modx->db->escape($filter) . '%"' : '';
62
-                $sqlLimit = $sqlLike ? '' : 'LIMIT ' . $limit;
61
+                $sqlLike = $filter ? 'WHERE t1.name LIKE "'.$modx->db->escape($filter).'%"' : '';
62
+                $sqlLimit = $sqlLike ? '' : 'LIMIT '.$limit;
63 63
 
64 64
                 switch ($elements) {
65 65
                     case 'element_templates':
66 66
                         $a = 16;
67
-                        $sqlLike = $filter ? 'WHERE t1.templatename LIKE "' . $modx->db->escape($filter) . '%"' : '';
67
+                        $sqlLike = $filter ? 'WHERE t1.templatename LIKE "'.$modx->db->escape($filter).'%"' : '';
68 68
                         $sql = $modx->db->query('SELECT t1.*, t1.templatename AS name
69
-                        FROM ' . $modx->getFullTableName('site_templates') . ' AS t1
70
-                        ' . $sqlLike . '
69
+                        FROM ' . $modx->getFullTableName('site_templates').' AS t1
70
+                        ' . $sqlLike.'
71 71
                         ORDER BY t1.templatename ASC
72 72
                         ' . $sqlLimit);
73 73
 
74 74
                         if ($modx->hasPermission('new_template')) {
75
-                            $output .= '<li><a id="a_19" href="index.php?a=19" target="main"><i class="fa fa-plus"></i>' . $_lang['new_template'] . '</a></li>';
75
+                            $output .= '<li><a id="a_19" href="index.php?a=19" target="main"><i class="fa fa-plus"></i>'.$_lang['new_template'].'</a></li>';
76 76
                         }
77 77
 
78 78
                         break;
@@ -80,15 +80,15 @@  discard block
 block discarded – undo
80 80
                     case 'element_tplvars':
81 81
                         $a = 301;
82 82
                         $sql = $modx->db->query('SELECT t1.id,t1.name,t1.locked, IF(MIN(t2.tmplvarid),0,1) AS disabled
83
-                        FROM ' . $modx->getFullTableName('site_tmplvars') . ' AS t1
84
-                        LEFT JOIN ' . $modx->getFullTableName('site_tmplvar_templates') . ' AS t2 ON t1.id=t2.tmplvarid
85
-                        ' . $sqlLike . '
83
+                        FROM ' . $modx->getFullTableName('site_tmplvars').' AS t1
84
+                        LEFT JOIN ' . $modx->getFullTableName('site_tmplvar_templates').' AS t2 ON t1.id=t2.tmplvarid
85
+                        ' . $sqlLike.'
86 86
                         GROUP BY t1.id
87 87
                         ORDER BY t1.name ASC
88 88
                         ' . $sqlLimit);
89 89
 
90 90
                         if ($modx->hasPermission('edit_template') && $modx->hasPermission('edit_snippet') && $modx->hasPermission('edit_chunk') && $modx->hasPermission('edit_plugin')) {
91
-                            $output .= '<li><a id="a_300" href="index.php?a=300" target="main"><i class="fa fa-plus"></i>' . $_lang['new_tmplvars'] . '</a></li>';
91
+                            $output .= '<li><a id="a_300" href="index.php?a=300" target="main"><i class="fa fa-plus"></i>'.$_lang['new_tmplvars'].'</a></li>';
92 92
                         }
93 93
 
94 94
                         break;
@@ -96,13 +96,13 @@  discard block
 block discarded – undo
96 96
                     case 'element_htmlsnippets':
97 97
                         $a = 78;
98 98
                         $sql = $modx->db->query('SELECT t1.*
99
-                        FROM ' . $modx->getFullTableName('site_htmlsnippets') . ' AS t1
100
-                        ' . $sqlLike . '
99
+                        FROM ' . $modx->getFullTableName('site_htmlsnippets').' AS t1
100
+                        ' . $sqlLike.'
101 101
                         ORDER BY t1.name ASC
102 102
                         ' . $sqlLimit);
103 103
 
104 104
                         if ($modx->hasPermission('new_chunk')) {
105
-                            $output .= '<li><a id="a_77" href="index.php?a=77" target="main"><i class="fa fa-plus"></i>' . $_lang['new_htmlsnippet'] . '</a></li>';
105
+                            $output .= '<li><a id="a_77" href="index.php?a=77" target="main"><i class="fa fa-plus"></i>'.$_lang['new_htmlsnippet'].'</a></li>';
106 106
                         }
107 107
 
108 108
                         break;
@@ -110,13 +110,13 @@  discard block
 block discarded – undo
110 110
                     case 'element_snippets':
111 111
                         $a = 22;
112 112
                         $sql = $modx->db->query('SELECT t1.*
113
-                        FROM ' . $modx->getFullTableName('site_snippets') . ' AS t1
114
-                        ' . $sqlLike . '
113
+                        FROM ' . $modx->getFullTableName('site_snippets').' AS t1
114
+                        ' . $sqlLike.'
115 115
                         ORDER BY t1.name ASC
116 116
                         ' . $sqlLimit);
117 117
 
118 118
                         if ($modx->hasPermission('new_snippet')) {
119
-                            $output .= '<li><a id="a_23" href="index.php?a=23" target="main"><i class="fa fa-plus"></i>' . $_lang['new_snippet'] . '</a></li>';
119
+                            $output .= '<li><a id="a_23" href="index.php?a=23" target="main"><i class="fa fa-plus"></i>'.$_lang['new_snippet'].'</a></li>';
120 120
                         }
121 121
 
122 122
                         break;
@@ -124,13 +124,13 @@  discard block
 block discarded – undo
124 124
                     case 'element_plugins':
125 125
                         $a = 102;
126 126
                         $sql = $modx->db->query('SELECT t1.*
127
-                        FROM ' . $modx->getFullTableName('site_plugins') . ' AS t1
128
-                        ' . $sqlLike . '
127
+                        FROM ' . $modx->getFullTableName('site_plugins').' AS t1
128
+                        ' . $sqlLike.'
129 129
                         ORDER BY t1.name ASC
130 130
                         ' . $sqlLimit);
131 131
 
132 132
                         if ($modx->hasPermission('new_plugin')) {
133
-                            $output .= '<li><a id="a_101" href="index.php?a=101" target="main"><i class="fa fa-plus"></i>' . $_lang['new_plugin'] . '</a></li>';
133
+                            $output .= '<li><a id="a_101" href="index.php?a=101" target="main"><i class="fa fa-plus"></i>'.$_lang['new_plugin'].'</a></li>';
134 134
                         }
135 135
 
136 136
                         break;
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
                             continue;
146 146
                         }
147 147
 
148
-                        $items .= '<li class="item ' . ($row['disabled'] ? 'disabled' : '') . ($row['locked'] ? ' locked' : '') . '"><a id="a_' . $a . '__id_' . $row['id'] . '" href="index.php?a=' . $a . '&id=' . $row['id'] . '" target="main" data-parent-id="a_76__elements_' . $elements . '">' . $row['name'] . ' <small>(' . $row['id'] . ')</small></a></li>' . "\n";
148
+                        $items .= '<li class="item '.($row['disabled'] ? 'disabled' : '').($row['locked'] ? ' locked' : '').'"><a id="a_'.$a.'__id_'.$row['id'].'" href="index.php?a='.$a.'&id='.$row['id'].'" target="main" data-parent-id="a_76__elements_'.$elements.'">'.$row['name'].' <small>('.$row['id'].')</small></a></li>'."\n";
149 149
                     }
150 150
                 }
151 151
 
@@ -166,18 +166,18 @@  discard block
 block discarded – undo
166 166
             $output = '';
167 167
             $items = '';
168 168
             $filter = !empty($_REQUEST['filter']) && is_scalar($_REQUEST['filter']) ? addcslashes(trim($_REQUEST['filter']), '\%*_') : '';
169
-            $sqlLike = $filter ? 'WHERE t1.username LIKE "' . $modx->db->escape($filter) . '%"' : '';
170
-            $sqlLimit = $sqlLike ? '' : 'LIMIT ' . $limit;
169
+            $sqlLike = $filter ? 'WHERE t1.username LIKE "'.$modx->db->escape($filter).'%"' : '';
170
+            $sqlLimit = $sqlLike ? '' : 'LIMIT '.$limit;
171 171
 
172 172
             $sql = $modx->db->query('SELECT t1.*, t1.username AS name, t2.blocked
173
-				FROM ' . $modx->getFullTableName('manager_users') . ' AS t1
174
-				LEFT JOIN ' . $modx->getFullTableName('user_attributes') . ' AS t2 ON t1.id=t2.internalKey
175
-				' . $sqlLike . '
173
+				FROM ' . $modx->getFullTableName('manager_users').' AS t1
174
+				LEFT JOIN ' . $modx->getFullTableName('user_attributes').' AS t2 ON t1.id=t2.internalKey
175
+				' . $sqlLike.'
176 176
 				ORDER BY t1.username ASC
177 177
 				' . $sqlLimit);
178 178
 
179 179
             if ($modx->hasPermission('new_user')) {
180
-                $output .= '<li><a id="a_11" href="index.php?a=11" target="main"><i class="fa fa-plus"></i>' . $_lang['new_user'] . '</a></li>';
180
+                $output .= '<li><a id="a_11" href="index.php?a=11" target="main"><i class="fa fa-plus"></i>'.$_lang['new_user'].'</a></li>';
181 181
             }
182 182
 
183 183
             if ($count = $modx->db->getRecordCount($sql)) {
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
                     $output .= '<li class="item-input"><input type="text" name="filter" class="dropdown-item form-control form-control-sm" autocomplete="off" /></li>';
186 186
                 }
187 187
                 while ($row = $modx->db->getRow($sql)) {
188
-                    $items .= '<li class="item ' . ($row['blocked'] ? 'disabled' : '') . '"><a id="a_' . $a . '__id_' . $row['id'] . '" href="index.php?a=' . $a . '&id=' . $row['id'] . '" target="main">' . $row['name'] . ' <small>(' . $row['id'] . ')</small></a></li>';
188
+                    $items .= '<li class="item '.($row['blocked'] ? 'disabled' : '').'"><a id="a_'.$a.'__id_'.$row['id'].'" href="index.php?a='.$a.'&id='.$row['id'].'" target="main">'.$row['name'].' <small>('.$row['id'].')</small></a></li>';
189 189
                 }
190 190
             }
191 191
 
@@ -205,18 +205,18 @@  discard block
 block discarded – undo
205 205
             $output = '';
206 206
             $items = '';
207 207
             $filter = !empty($_REQUEST['filter']) && is_scalar($_REQUEST['filter']) ? addcslashes(trim($_REQUEST['filter']), '\%*_') : '';
208
-            $sqlLike = $filter ? 'WHERE t1.username LIKE "' . $modx->db->escape($filter) . '%"' : '';
209
-            $sqlLimit = $sqlLike ? '' : 'LIMIT ' . $limit;
208
+            $sqlLike = $filter ? 'WHERE t1.username LIKE "'.$modx->db->escape($filter).'%"' : '';
209
+            $sqlLimit = $sqlLike ? '' : 'LIMIT '.$limit;
210 210
 
211 211
             $sql = $modx->db->query('SELECT t1.*, t1.username AS name, t2.blocked
212
-				FROM ' . $modx->getFullTableName('web_users') . ' AS t1
213
-				LEFT JOIN ' . $modx->getFullTableName('web_user_attributes') . ' AS t2 ON t1.id=t2.internalKey
214
-				' . $sqlLike . '
212
+				FROM ' . $modx->getFullTableName('web_users').' AS t1
213
+				LEFT JOIN ' . $modx->getFullTableName('web_user_attributes').' AS t2 ON t1.id=t2.internalKey
214
+				' . $sqlLike.'
215 215
 				ORDER BY t1.username ASC
216 216
 				' . $sqlLimit);
217 217
 
218 218
             if ($modx->hasPermission('new_web_user')) {
219
-                $output .= '<li><a id="a_87" href="index.php?a=87" target="main"><i class="fa fa-plus"></i>' . $_lang['new_web_user'] . '</a></li>';
219
+                $output .= '<li><a id="a_87" href="index.php?a=87" target="main"><i class="fa fa-plus"></i>'.$_lang['new_web_user'].'</a></li>';
220 220
             }
221 221
 
222 222
             if ($count = $modx->db->getRecordCount($sql)) {
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
                     $output .= '<li class="item-input"><input type="text" name="filter" class="dropdown-item form-control form-control-sm" autocomplete="off" /></li>';
225 225
                 }
226 226
                 while ($row = $modx->db->getRow($sql)) {
227
-                    $items .= '<li class="item ' . ($row['blocked'] ? 'disabled' : '') . '"><a id="a_' . $a . '__id_' . $row['id'] . '" href="index.php?a=' . $a . '&id=' . $row['id'] . '" target="main">' . $row['name'] . ' <small>(' . $row['id'] . ')</small></a></li>';
227
+                    $items .= '<li class="item '.($row['blocked'] ? 'disabled' : '').'"><a id="a_'.$a.'__id_'.$row['id'].'" href="index.php?a='.$a.'&id='.$row['id'].'" target="main">'.$row['name'].' <small>('.$row['id'].')</small></a></li>';
228 228
                 }
229 229
             }
230 230
 
@@ -250,35 +250,35 @@  discard block
 block discarded – undo
250 250
                     case 'SnippetNoCache': {
251 251
 
252 252
                         $sql = $modx->db->query('SELECT *
253
-						FROM ' . $modx->getFullTableName('site_snippets') . '
254
-						WHERE name="' . $name . '"
253
+						FROM ' . $modx->getFullTableName('site_snippets').'
254
+						WHERE name="' . $name.'"
255 255
 						LIMIT 1');
256 256
 
257 257
                         if ($modx->db->getRecordCount($sql)) {
258 258
                             $row = $modx->db->getRow($sql);
259 259
                             $contextmenu = array(
260 260
                                 'header' => array(
261
-                                    'innerHTML' => '<i class="fa fa-code"></i> ' . $row['name']
261
+                                    'innerHTML' => '<i class="fa fa-code"></i> '.$row['name']
262 262
                                 ),
263 263
                                 'item' => array(
264
-                                    'innerHTML' => '<i class="fa fa-pencil-square-o"></i> ' . $_lang['edit'],
265
-                                    'url' => "index.php?a=22&id=" . $row['id']
264
+                                    'innerHTML' => '<i class="fa fa-pencil-square-o"></i> '.$_lang['edit'],
265
+                                    'url' => "index.php?a=22&id=".$row['id']
266 266
                                 )
267 267
                             );
268 268
                             if (!empty($row['description'])) {
269 269
                                 $contextmenu['seperator'] = '';
270 270
                                 $contextmenu['description'] = array(
271
-                                    'innerHTML' => '<i class="fa fa-info"></i> ' . $row['description']
271
+                                    'innerHTML' => '<i class="fa fa-info"></i> '.$row['description']
272 272
                                 );
273 273
                             }
274 274
                         } else {
275 275
                             $contextmenu = array(
276 276
                                 'header' => array(
277
-                                    'innerHTML' => '<i class="fa fa-code"></i> ' . $name
277
+                                    'innerHTML' => '<i class="fa fa-code"></i> '.$name
278 278
                                 ),
279 279
                                 'item' => array(
280
-                                    'innerHTML' => '<i class="fa fa-plus"></i> ' . $_lang['new_snippet'],
281
-                                    'url' => "index.php?a=23&itemname=" . $name
280
+                                    'innerHTML' => '<i class="fa fa-plus"></i> '.$_lang['new_snippet'],
281
+                                    'url' => "index.php?a=23&itemname=".$name
282 282
                                 )
283 283
                             );
284 284
                         }
@@ -288,35 +288,35 @@  discard block
 block discarded – undo
288 288
                     case 'Chunk' : {
289 289
 
290 290
                         $sql = $modx->db->query('SELECT *
291
-						FROM ' . $modx->getFullTableName('site_htmlsnippets') . '
292
-						WHERE name="' . $name . '"
291
+						FROM ' . $modx->getFullTableName('site_htmlsnippets').'
292
+						WHERE name="' . $name.'"
293 293
 						LIMIT 1');
294 294
 
295 295
                         if ($modx->db->getRecordCount($sql)) {
296 296
                             $row = $modx->db->getRow($sql);
297 297
                             $contextmenu = array(
298 298
                                 'header' => array(
299
-                                    'innerHTML' => '<i class="fa fa-th-large"></i> ' . $row['name']
299
+                                    'innerHTML' => '<i class="fa fa-th-large"></i> '.$row['name']
300 300
                                 ),
301 301
                                 'item' => array(
302
-                                    'innerHTML' => '<i class="fa fa-pencil-square-o"></i> ' . $_lang['edit'],
303
-                                    'url' => "index.php?a=78&id=" . $row['id']
302
+                                    'innerHTML' => '<i class="fa fa-pencil-square-o"></i> '.$_lang['edit'],
303
+                                    'url' => "index.php?a=78&id=".$row['id']
304 304
                                 )
305 305
                             );
306 306
                             if (!empty($row['description'])) {
307 307
                                 $contextmenu['seperator'] = '';
308 308
                                 $contextmenu['description'] = array(
309
-                                    'innerHTML' => '<i class="fa fa-info"></i> ' . $row['description']
309
+                                    'innerHTML' => '<i class="fa fa-info"></i> '.$row['description']
310 310
                                 );
311 311
                             }
312 312
                         } else {
313 313
                             $contextmenu = array(
314 314
                                 'header' => array(
315
-                                    'innerHTML' => '<i class="fa fa-th-large"></i> ' . $name
315
+                                    'innerHTML' => '<i class="fa fa-th-large"></i> '.$name
316 316
                                 ),
317 317
                                 'item' => array(
318
-                                    'innerHTML' => '<i class="fa fa-plus"></i> ' . $_lang['new_htmlsnippet'],
319
-                                    'url' => "index.php?a=77&itemname=" . $name
318
+                                    'innerHTML' => '<i class="fa fa-plus"></i> '.$_lang['new_htmlsnippet'],
319
+                                    'url' => "index.php?a=77&itemname=".$name
320 320
                                 )
321 321
                             );
322 322
                         }
@@ -325,8 +325,8 @@  discard block
 block discarded – undo
325 325
                     }
326 326
                     case 'AttributeValue': {
327 327
                         $sql = $modx->db->query('SELECT *
328
-						FROM ' . $modx->getFullTableName('site_htmlsnippets') . '
329
-						WHERE name="' . $name . '"
328
+						FROM ' . $modx->getFullTableName('site_htmlsnippets').'
329
+						WHERE name="' . $name.'"
330 330
 						LIMIT 1');
331 331
 
332 332
                         if ($modx->db->getRecordCount($sql)) {
@@ -336,52 +336,52 @@  discard block
 block discarded – undo
336 336
                                     'innerText' => $row['name']
337 337
                                 ),
338 338
                                 'item' => array(
339
-                                    'innerHTML' => '<i class="fa fa-pencil-square-o"></i> ' . $_lang['edit'],
340
-                                    'url' => "index.php?a=78&id=" . $row['id']
339
+                                    'innerHTML' => '<i class="fa fa-pencil-square-o"></i> '.$_lang['edit'],
340
+                                    'url' => "index.php?a=78&id=".$row['id']
341 341
                                 )
342 342
                             );
343 343
                             if (!empty($row['description'])) {
344 344
                                 $contextmenu['seperator'] = '';
345 345
                                 $contextmenu['description'] = array(
346
-                                    'innerHTML' => '<i class="fa fa-info"></i> ' . $row['description']
346
+                                    'innerHTML' => '<i class="fa fa-info"></i> '.$row['description']
347 347
                                 );
348 348
                             }
349 349
                         } else {
350 350
 
351 351
                             $sql = $modx->db->query('SELECT *
352
-							FROM ' . $modx->getFullTableName('site_snippets') . '
353
-							WHERE name="' . $name . '"
352
+							FROM ' . $modx->getFullTableName('site_snippets').'
353
+							WHERE name="' . $name.'"
354 354
 							LIMIT 1');
355 355
 
356 356
                             if ($modx->db->getRecordCount($sql)) {
357 357
                                 $row = $modx->db->getRow($sql);
358 358
                                 $contextmenu = array(
359 359
                                     'header' => array(
360
-                                        'innerHTML' => '<i class="fa fa-code"></i> ' . $row['name']
360
+                                        'innerHTML' => '<i class="fa fa-code"></i> '.$row['name']
361 361
                                     ),
362 362
                                     'item' => array(
363
-                                        'innerHTML' => '<i class="fa fa-pencil-square-o"></i> ' . $_lang['edit'],
364
-                                        'url' => "index.php?a=22&id=" . $row['id']
363
+                                        'innerHTML' => '<i class="fa fa-pencil-square-o"></i> '.$_lang['edit'],
364
+                                        'url' => "index.php?a=22&id=".$row['id']
365 365
                                     )
366 366
                                 );
367 367
                                 if (!empty($row['description'])) {
368 368
                                     $contextmenu['seperator'] = '';
369 369
                                     $contextmenu['description'] = array(
370
-                                        'innerHTML' => '<i class="fa fa-info"></i> ' . $row['description']
370
+                                        'innerHTML' => '<i class="fa fa-info"></i> '.$row['description']
371 371
                                     );
372 372
                                 }
373 373
                             } else {
374 374
                                 $contextmenu = array(
375 375
                                     'header' => array(
376
-                                        'innerHTML' => '<i class="fa fa-code"></i> ' . $name
376
+                                        'innerHTML' => '<i class="fa fa-code"></i> '.$name
377 377
                                     ),
378 378
                                     'item' => array(
379
-                                        'innerHTML' => '<i class="fa fa-plus"></i> ' . $_lang['new_htmlsnippet'],
380
-                                        'url' => "index.php?a=77&itemname=" . $name
379
+                                        'innerHTML' => '<i class="fa fa-plus"></i> '.$_lang['new_htmlsnippet'],
380
+                                        'url' => "index.php?a=77&itemname=".$name
381 381
                                     ),
382 382
                                     'item2' => array(
383
-                                        'innerHTML' => '<i class="fa fa-plus"></i> ' . $_lang['new_snippet'],
384
-                                        'url' => "index.php?a=23&itemname=" . $name
383
+                                        'innerHTML' => '<i class="fa fa-plus"></i> '.$_lang['new_snippet'],
384
+                                        'url' => "index.php?a=23&itemname=".$name
385 385
                                     )
386 386
                                 );
387 387
                             }
@@ -437,35 +437,35 @@  discard block
 block discarded – undo
437 437
                         }
438 438
 
439 439
                         $sql = $modx->db->query('SELECT *
440
-						FROM ' . $modx->getFullTableName('site_tmplvars') . '
441
-						WHERE name="' . $name . '"
440
+						FROM ' . $modx->getFullTableName('site_tmplvars').'
441
+						WHERE name="' . $name.'"
442 442
 						LIMIT 1');
443 443
 
444 444
                         if ($modx->db->getRecordCount($sql)) {
445 445
                             $row = $modx->db->getRow($sql);
446 446
                             $contextmenu = array(
447 447
                                 'header' => array(
448
-                                    'innerHTML' => '<i class="fa fa-list-alt"></i> ' . $row['name']
448
+                                    'innerHTML' => '<i class="fa fa-list-alt"></i> '.$row['name']
449 449
                                 ),
450 450
                                 'item' => array(
451
-                                    'innerHTML' => '<i class="fa fa-pencil-square-o"></i> ' . $_lang['edit'],
452
-                                    'url' => "index.php?a=301&id=" . $row['id']
451
+                                    'innerHTML' => '<i class="fa fa-pencil-square-o"></i> '.$_lang['edit'],
452
+                                    'url' => "index.php?a=301&id=".$row['id']
453 453
                                 )
454 454
                             );
455 455
                             if (!empty($row['description'])) {
456 456
                                 $contextmenu['seperator'] = '';
457 457
                                 $contextmenu['description'] = array(
458
-                                    'innerHTML' => '<i class="fa fa-info"></i> ' . $row['description']
458
+                                    'innerHTML' => '<i class="fa fa-info"></i> '.$row['description']
459 459
                                 );
460 460
                             }
461 461
                         } else {
462 462
                             $contextmenu = array(
463 463
                                 'header' => array(
464
-                                    'innerHTML' => '<i class="fa fa-list-alt"></i> ' . $name
464
+                                    'innerHTML' => '<i class="fa fa-list-alt"></i> '.$name
465 465
                                 ),
466 466
                                 'item' => array(
467
-                                    'innerHTML' => '<i class="fa fa-plus"></i> ' . $_lang['new_tmplvars'],
468
-                                    'url' => "index.php?a=300&itemname=" . $name
467
+                                    'innerHTML' => '<i class="fa fa-plus"></i> '.$_lang['new_tmplvars'],
468
+                                    'url' => "index.php?a=300&itemname=".$name
469 469
                                 )
470 470
                             );
471 471
                         }
@@ -484,15 +484,15 @@  discard block
 block discarded – undo
484 484
             $json = array();
485 485
 
486 486
             if ($modx->hasPermission('new_document') && $modx->hasPermission('edit_document') && $modx->hasPermission('save_document')) {
487
-                $id = !empty($_REQUEST['id']) ? (int)$_REQUEST['id'] : '';
488
-                $parent = isset($_REQUEST['parent']) ? (int)$_REQUEST['parent'] : 0;
487
+                $id = !empty($_REQUEST['id']) ? (int) $_REQUEST['id'] : '';
488
+                $parent = isset($_REQUEST['parent']) ? (int) $_REQUEST['parent'] : 0;
489 489
                 $menuindex = isset($_REQUEST['menuindex']) && is_scalar($_REQUEST['menuindex']) ? $_REQUEST['menuindex'] : 0;
490 490
 
491 491
                 // set parent
492 492
                 if ($id && $parent >= 0) {
493 493
 
494 494
                     // find older parent
495
-                    $parentOld = $modx->db->getValue($modx->db->select('parent', $modx->getFullTableName('site_content'), 'id=' . $id));
495
+                    $parentOld = $modx->db->getValue($modx->db->select('parent', $modx->getFullTableName('site_content'), 'id='.$id));
496 496
 
497 497
                     $eventOut = $modx->invokeEvent('onBeforeMoveDocument', [
498 498
                         'id_document' => $id,
@@ -513,7 +513,7 @@  discard block
 block discarded – undo
513 513
                     if (empty($json['errors'])) {
514 514
                         // check privileges user for move docs
515 515
                         if (!empty($modx->config['tree_show_protected']) && $role != 1) {
516
-                            $sql = $modx->db->select('*', $modx->getFullTableName('document_groups'), 'document IN(' . $id . ',' . $parent . ',' . $parentOld . ')');
516
+                            $sql = $modx->db->select('*', $modx->getFullTableName('document_groups'), 'document IN('.$id.','.$parent.','.$parentOld.')');
517 517
                             if ($modx->db->getRecordCount($sql)) {
518 518
                                 $document_groups = array();
519 519
                                 while ($row = $modx->db->getRow($sql)) {
@@ -538,22 +538,22 @@  discard block
 block discarded – undo
538 538
                             // set new parent
539 539
                             $modx->db->update(array(
540 540
                                 'parent' => $parent
541
-                            ), $modx->getFullTableName('site_content'), 'id=' . $id);
541
+                            ), $modx->getFullTableName('site_content'), 'id='.$id);
542 542
                             // set parent isfolder = 1
543 543
                             $modx->db->update(array(
544 544
                                 'isfolder' => 1
545
-                            ), $modx->getFullTableName('site_content'), 'id=' . $parent);
545
+                            ), $modx->getFullTableName('site_content'), 'id='.$parent);
546 546
 
547 547
                             if ($parent != $parentOld) {
548 548
                                 // check children docs and set parent isfolder
549
-                                if ($modx->db->getRecordCount($modx->db->select('id', $modx->getFullTableName('site_content'), 'parent=' . $parentOld))) {
549
+                                if ($modx->db->getRecordCount($modx->db->select('id', $modx->getFullTableName('site_content'), 'parent='.$parentOld))) {
550 550
                                     $modx->db->update(array(
551 551
                                         'isfolder' => 1
552
-                                    ), $modx->getFullTableName('site_content'), 'id=' . $parentOld);
552
+                                    ), $modx->getFullTableName('site_content'), 'id='.$parentOld);
553 553
                                 } else {
554 554
                                     $modx->db->update(array(
555 555
                                         'isfolder' => 0
556
-                                    ), $modx->getFullTableName('site_content'), 'id=' . $parentOld);
556
+                                    ), $modx->getFullTableName('site_content'), 'id='.$parentOld);
557 557
                                 }
558 558
                             }
559 559
 
@@ -561,7 +561,7 @@  discard block
 block discarded – undo
561 561
                             if (!empty($menuindex)) {
562 562
                                 $menuindex = explode(',', $menuindex);
563 563
                                 foreach ($menuindex as $key => $value) {
564
-                                    $modx->db->query('UPDATE ' . $modx->getFullTableName('site_content') . ' SET menuindex=' . $key . ' WHERE id=' . $value);
564
+                                    $modx->db->query('UPDATE '.$modx->getFullTableName('site_content').' SET menuindex='.$key.' WHERE id='.$value);
565 565
                                 }
566 566
                             } else {
567 567
                                 // TODO: max(*) menuindex
@@ -590,19 +590,19 @@  discard block
 block discarded – undo
590 590
         }
591 591
 
592 592
         case 'getLockedElements': {
593
-            $type = isset($_REQUEST['type']) ? (int)$_REQUEST['type'] : 0;
594
-            $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0;
593
+            $type = isset($_REQUEST['type']) ? (int) $_REQUEST['type'] : 0;
594
+            $id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0;
595 595
 
596 596
             $output = !!$modx->elementIsLocked($type, $id, true);
597 597
 
598 598
             if (!$output) {
599 599
                 $docgrp = (isset($_SESSION['mgrDocgroups']) && is_array($_SESSION['mgrDocgroups'])) ? implode(',', $_SESSION['mgrDocgroups']) : '';
600
-                $docgrp_cond = $docgrp ? ' OR dg.document_group IN (' . $docgrp . ')' : '';
600
+                $docgrp_cond = $docgrp ? ' OR dg.document_group IN ('.$docgrp.')' : '';
601 601
                 $sql = '
602
-                    SELECT MAX(IF(1=' . $role . ' OR sc.privatemgr=0' . $docgrp_cond . ', 0, 1)) AS locked
603
-                    FROM ' . $modx->getFullTableName('site_content') . ' AS sc 
604
-                    LEFT JOIN ' . $modx->getFullTableName('document_groups') . ' dg ON dg.document=sc.id
605
-                    WHERE sc.id=' . $id . ' GROUP BY sc.id';
602
+                    SELECT MAX(IF(1=' . $role.' OR sc.privatemgr=0'.$docgrp_cond.', 0, 1)) AS locked
603
+                    FROM ' . $modx->getFullTableName('site_content').' AS sc 
604
+                    LEFT JOIN ' . $modx->getFullTableName('document_groups').' dg ON dg.document=sc.id
605
+                    WHERE sc.id=' . $id.' GROUP BY sc.id';
606 606
                 $sql = $modx->db->query($sql);
607 607
                 if ($modx->db->getRecordCount($sql)) {
608 608
                     $row = $modx->db->getRow($sql);
Please login to merge, or discard this patch.
manager/media/style/default/style.php 3 patches
Indentation   +73 added lines, -73 removed lines patch added patch discarded remove patch
@@ -11,12 +11,12 @@  discard block
 block discarded – undo
11 11
 $style_path = 'media/style/' . $modx->config['manager_theme'] . '/images/';
12 12
 $modx->config['mgr_date_picker_path'] = 'media/calendar/datepicker.inc.php';
13 13
 if(!$modx->config['lang_code']) {
14
-	global $modx_lang_attribute;
15
-	$modx->config['lang_code'] = !$modx_lang_attribute ? 'en' : $modx_lang_attribute;
14
+    global $modx_lang_attribute;
15
+    $modx->config['lang_code'] = !$modx_lang_attribute ? 'en' : $modx_lang_attribute;
16 16
 }
17 17
 
18 18
 if($_GET['a'] == 2) {
19
-	include_once('welcome.php');
19
+    include_once('welcome.php');
20 20
 }
21 21
 
22 22
 // Favicon
@@ -274,66 +274,66 @@  discard block
 block discarded – undo
274 274
 $addnew = 0;
275 275
 $run = 0;
276 276
 switch($action) {
277
-	case '3':
278
-	case '4':
279
-	case '27':
280
-	case '72':
281
-		if($modx->hasPermission('new_document')) {
282
-			$addnew = 1;
283
-		}
284
-		break;
285
-	case '16':
286
-	case '19':
287
-		if($modx->hasPermission('new_template')) {
288
-			$addnew = 1;
289
-		}
290
-		break;
291
-	case '300':
292
-	case '301':
293
-		if($modx->hasPermission('new_snippet') && $modx->hasPermission('new_chunk') && $modx->hasPermission('new_plugin')) {
294
-			$addnew = 1;
295
-		}
296
-		break;
297
-	case '77':
298
-	case '78':
299
-		if($modx->hasPermission('new_chunk')) {
300
-			$addnew = 1;
301
-		}
302
-		break;
303
-	case '22':
304
-	case '23':
305
-		if($modx->hasPermission('new_snippet')) {
306
-			$addnew = 1;
307
-		}
308
-		break;
309
-	case '101':
310
-	case '102':
311
-		if($modx->hasPermission('new_plugin')) {
312
-			$addnew = 1;
313
-		}
314
-		break;
315
-	case '106':
316
-	case '107':
317
-	case '108':
318
-		if($modx->hasPermission('new_module')) {
319
-			$addnew = 1;
320
-		}
321
-		if($modx->hasPermission('exec_module')) {
322
-			$run = 1;
323
-		}
324
-		break;
325
-	case '88':
326
-		if($modx->hasPermission('new_web_user')) {
327
-			$addnew = 1;
328
-		}
329
-		break;
277
+    case '3':
278
+    case '4':
279
+    case '27':
280
+    case '72':
281
+        if($modx->hasPermission('new_document')) {
282
+            $addnew = 1;
283
+        }
284
+        break;
285
+    case '16':
286
+    case '19':
287
+        if($modx->hasPermission('new_template')) {
288
+            $addnew = 1;
289
+        }
290
+        break;
291
+    case '300':
292
+    case '301':
293
+        if($modx->hasPermission('new_snippet') && $modx->hasPermission('new_chunk') && $modx->hasPermission('new_plugin')) {
294
+            $addnew = 1;
295
+        }
296
+        break;
297
+    case '77':
298
+    case '78':
299
+        if($modx->hasPermission('new_chunk')) {
300
+            $addnew = 1;
301
+        }
302
+        break;
303
+    case '22':
304
+    case '23':
305
+        if($modx->hasPermission('new_snippet')) {
306
+            $addnew = 1;
307
+        }
308
+        break;
309
+    case '101':
310
+    case '102':
311
+        if($modx->hasPermission('new_plugin')) {
312
+            $addnew = 1;
313
+        }
314
+        break;
315
+    case '106':
316
+    case '107':
317
+    case '108':
318
+        if($modx->hasPermission('new_module')) {
319
+            $addnew = 1;
320
+        }
321
+        if($modx->hasPermission('exec_module')) {
322
+            $run = 1;
323
+        }
324
+        break;
325
+    case '88':
326
+        if($modx->hasPermission('new_web_user')) {
327
+            $addnew = 1;
328
+        }
329
+        break;
330 330
 }
331 331
 
332 332
 $disabled = ($action == '19' || $action == '300' || $action == '77' || $action == '23' || $action == '101' || $action == '4' || $action == '72' || $action == '87' || $action == '11' || $action == '107' || $action == '38') ? ' disabled' : '';
333 333
 
334 334
 $_style['actionbuttons'] = array(
335
-	'dynamic' => array(
336
-		'document' => '<div id="actions">
335
+    'dynamic' => array(
336
+        'document' => '<div id="actions">
337 337
 			<div class="btn-group">
338 338
 				<div class="btn-group">
339 339
 					<a id="Button1" class="btn btn-success" href="javascript:;" onclick="actions.save();">
@@ -348,7 +348,7 @@  discard block
 block discarded – undo
348 348
 						<option id="stay3" value="" ' . ($stay == '' ? ' selected="selected"' : '') . '>' . $_lang['close'] . '</option>
349 349
 					</select>
350 350
 				</div>' .
351
-					($addnew ? '
351
+                    ($addnew ? '
352 352
 					<a id="Button6" class="btn btn-secondary' . $disabled . '" href="javascript:;" onclick="actions.duplicate();">
353 353
 						<i class="' . $_style["actions_duplicate"] . '"></i><span>' . $_lang['duplicate'] . '</span>
354 354
 					</a>
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
 				</a>
365 365
 			</div>
366 366
 		</div>',
367
-		'user' => '<div id="actions">
367
+        'user' => '<div id="actions">
368 368
 			<div class="btn-group">
369 369
 				<div class="btn-group">
370 370
 					<a id="Button1" class="btn btn-success" href="javascript:;" onclick="actions.save();">
@@ -387,7 +387,7 @@  discard block
 block discarded – undo
387 387
 				</a>
388 388
 			</div>
389 389
 		</div>',
390
-		'element' => '<div id="actions">
390
+        'element' => '<div id="actions">
391 391
 			<div class="btn-group">
392 392
 				<div class="btn-group">
393 393
 					<a id="Button1" class="btn btn-success" href="javascript:;" onclick="actions.save();">
@@ -420,21 +420,21 @@  discard block
 block discarded – undo
420 420
 				' : '') . '
421 421
 			</div>
422 422
 		</div>',
423
-		'newmodule' => ($addnew ? '<div id="actions">
423
+        'newmodule' => ($addnew ? '<div id="actions">
424 424
 			<div class="btn-group">
425 425
 				<a id="newModule" class="btn btn-secondary" href="javascript:;" onclick="actions.new();">
426 426
 					<i class="' . $_style["actions_new"] . '"></i><span>' . $_lang['new_module'] . '</span>
427 427
 				</a>
428 428
 			</div>
429 429
 		</div>' : ''),
430
-		'close' => '<div id="actions">
430
+        'close' => '<div id="actions">
431 431
 			<div class="btn-group">
432 432
 				<a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.close();">
433 433
 					<i class="' . $_style["actions_close"] . '"></i><span>' . $_lang['close'] . '</span>
434 434
 				</a>
435 435
 			</div>
436 436
 		</div>',
437
-		'save' => '<div id="actions">
437
+        'save' => '<div id="actions">
438 438
 			<div class="btn-group">
439 439
 				<a id="Button1" class="btn btn-success" href="javascript:;" onclick="actions.save();">
440 440
 					<i class="' . $_style["actions_save"] . '"></i><span>' . $_lang['save'] . '</span>
@@ -444,7 +444,7 @@  discard block
 block discarded – undo
444 444
 				</a>
445 445
 			</div>
446 446
 		</div>',
447
-		'savedelete' => '<div id="actions">
447
+        'savedelete' => '<div id="actions">
448 448
 			<div class="btn-group">
449 449
 				<a id="Button1" class="btn btn-success" href="javascript:;" onclick="actions.save();">
450 450
 					<i class="' . $_style["actions_save"] . '"></i><span>' . $_lang['save'] . '</span>
@@ -457,14 +457,14 @@  discard block
 block discarded – undo
457 457
 				</a>
458 458
 			</div>
459 459
 		</div>',
460
-		'cancel' => '<div id="actions">
460
+        'cancel' => '<div id="actions">
461 461
 			<div class="btn-group">
462 462
 				<a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.cancel();">
463 463
 					<i class="' . $_style["actions_cancel"] . '"></i><span>' . $_lang['cancel'] . '</span>
464 464
 				</a>
465 465
 			</div>
466 466
 		</div>',
467
-		'canceldelete' => '<div id="actions">
467
+        'canceldelete' => '<div id="actions">
468 468
 			<div class="btn-group">
469 469
 				<a id="Button3" class="btn btn-secondary' . $disabled . '" href="javascript:;" onclick="actions.delete();">
470 470
 					<i class="' . $_style["actions_delete"] . '"></i><span>' . $_lang['delete'] . '</span>
@@ -474,11 +474,11 @@  discard block
 block discarded – undo
474 474
 				</a>
475 475
 			</div>
476 476
 		</div>',
477
-	),
478
-	'static' => array(
479
-		'document' => '<div id="actions">
477
+    ),
478
+    'static' => array(
479
+        'document' => '<div id="actions">
480 480
 			<div class="btn-group">' .
481
-				($addnew ? '
481
+                ($addnew ? '
482 482
 					<a class="btn btn-secondary" href="javascript:;" onclick="actions.new();">
483 483
 						<i class="' . $_style["icons_new_document"] . '"></i><span>' . $_lang['create_resource_here'] . '</span>
484 484
 					</a>
@@ -503,12 +503,12 @@  discard block
 block discarded – undo
503 503
 				</a>
504 504
 			</div>
505 505
 		</div>',
506
-		'cancel' => '<div id="actions">
506
+        'cancel' => '<div id="actions">
507 507
 			<div class="btn-group">
508 508
 				<a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.cancel();">
509 509
 					<i class="' . $_style["actions_cancel"] . '"></i><span>' . $_lang['cancel'] . '</span>
510 510
 				</a>
511 511
 			</div>
512 512
 		</div>',
513
-	)
513
+    )
514 514
 );
Please login to merge, or discard this patch.
Spacing   +75 added lines, -75 removed lines patch added patch discarded remove patch
@@ -8,19 +8,19 @@  discard block
 block discarded – undo
8 8
  * Version:        1.1
9 9
  * MODX version:   1.0.3
10 10
  */
11
-$style_path = 'media/style/' . $modx->config['manager_theme'] . '/images/';
11
+$style_path = 'media/style/'.$modx->config['manager_theme'].'/images/';
12 12
 $modx->config['mgr_date_picker_path'] = 'media/calendar/datepicker.inc.php';
13
-if(!$modx->config['lang_code']) {
13
+if (!$modx->config['lang_code']) {
14 14
 	global $modx_lang_attribute;
15 15
 	$modx->config['lang_code'] = !$modx_lang_attribute ? 'en' : $modx_lang_attribute;
16 16
 }
17 17
 
18
-if($_GET['a'] == 2) {
18
+if ($_GET['a'] == 2) {
19 19
 	include_once('welcome.php');
20 20
 }
21 21
 
22 22
 // Favicon
23
-$_style['favicon']                  = (file_exists(MODX_BASE_PATH . 'favicon.ico') ? MODX_SITE_URL . 'favicon.ico' : 'media/style/' . $modx->config['manager_theme'] . '/images/favicon.ico');
23
+$_style['favicon']                  = (file_exists(MODX_BASE_PATH.'favicon.ico') ? MODX_SITE_URL . 'favicon.ico' : 'media/style/'.$modx->config['manager_theme'].'/images/favicon.ico');
24 24
 
25 25
 //Main Menu
26 26
 $_style['menu_search']              = '<i class="fa fa-search"></i>';
@@ -99,10 +99,10 @@  discard block
 block discarded – undo
99 99
 $_style['tree_page_word']           = "<i class='fa fa-file-word-o'></i>";
100 100
 $_style['tree_page_excel']          = "<i class='fa fa-file-excel-o'></i>";
101 101
 
102
-$_style['tree_minusnode']           = "<i class='fa fa-angle-down'></i>";//$style_path.'tree/angle-down.png';
103
-$_style['tree_plusnode']            = "<i class='fa fa-angle-right'></i>";//$style_path.'tree/angle-right.png';
102
+$_style['tree_minusnode']           = "<i class='fa fa-angle-down'></i>"; //$style_path.'tree/angle-down.png';
103
+$_style['tree_plusnode']            = "<i class='fa fa-angle-right'></i>"; //$style_path.'tree/angle-right.png';
104 104
 $_style['tree_weblink']             = $style_path.'tree/link.png';
105
-$_style['tree_preview_resource']    = "<i class='fa fa-eye'></i>";//$style_path.'icons/eye.png';
105
+$_style['tree_preview_resource']    = "<i class='fa fa-eye'></i>"; //$style_path.'icons/eye.png';
106 106
 
107 107
 $_style['tree_showtree']            = '<i class="fa fa-sitemap"></i>';
108 108
 $_style['tree_working']             = '<i class="fa fa-warning"></i>';
@@ -137,8 +137,8 @@  discard block
 block discarded – undo
137 137
 $_style['icons_edit_document']      = $style_path.'icons/save.png';
138 138
 $_style['icons_delete_document']    = $style_path.'icons/trash.png';
139 139
 //locks
140
-$_style['icons_preview_resource']   = $style_path.'icons/eye.png';//$style_path.'icons/eye.png';
141
-$_style['icons_secured']            = "<i class='fa fa-lock'></i>";//$style_path.'icons/lock.png';
140
+$_style['icons_preview_resource']   = $style_path.'icons/eye.png'; //$style_path.'icons/eye.png';
141
+$_style['icons_secured']            = "<i class='fa fa-lock'></i>"; //$style_path.'icons/lock.png';
142 142
 
143 143
 //file manager icons
144 144
 $_style['files_save']               = 'fa fa-floppy-o';
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
 $_style['icons_set_parent']         = $style_path.'icons/folder-open.png';
214 214
 
215 215
 //modules
216
-$_style['icons_module']            = 'fa fa-cube';
216
+$_style['icons_module'] = 'fa fa-cube';
217 217
 $_style['icons_modules']            = 'fa fa-cubes'; //$style_path.'icons/modules.png';
218 218
 $_style['icons_run']                = $style_path.'icons/play.png';
219 219
 
@@ -273,57 +273,57 @@  discard block
 block discarded – undo
273 273
 $stay = isset($_REQUEST['stay']) ? $_REQUEST['stay'] : '';
274 274
 $addnew = 0;
275 275
 $run = 0;
276
-switch($action) {
276
+switch ($action) {
277 277
 	case '3':
278 278
 	case '4':
279 279
 	case '27':
280 280
 	case '72':
281
-		if($modx->hasPermission('new_document')) {
281
+		if ($modx->hasPermission('new_document')) {
282 282
 			$addnew = 1;
283 283
 		}
284 284
 		break;
285 285
 	case '16':
286 286
 	case '19':
287
-		if($modx->hasPermission('new_template')) {
287
+		if ($modx->hasPermission('new_template')) {
288 288
 			$addnew = 1;
289 289
 		}
290 290
 		break;
291 291
 	case '300':
292 292
 	case '301':
293
-		if($modx->hasPermission('new_snippet') && $modx->hasPermission('new_chunk') && $modx->hasPermission('new_plugin')) {
293
+		if ($modx->hasPermission('new_snippet') && $modx->hasPermission('new_chunk') && $modx->hasPermission('new_plugin')) {
294 294
 			$addnew = 1;
295 295
 		}
296 296
 		break;
297 297
 	case '77':
298 298
 	case '78':
299
-		if($modx->hasPermission('new_chunk')) {
299
+		if ($modx->hasPermission('new_chunk')) {
300 300
 			$addnew = 1;
301 301
 		}
302 302
 		break;
303 303
 	case '22':
304 304
 	case '23':
305
-		if($modx->hasPermission('new_snippet')) {
305
+		if ($modx->hasPermission('new_snippet')) {
306 306
 			$addnew = 1;
307 307
 		}
308 308
 		break;
309 309
 	case '101':
310 310
 	case '102':
311
-		if($modx->hasPermission('new_plugin')) {
311
+		if ($modx->hasPermission('new_plugin')) {
312 312
 			$addnew = 1;
313 313
 		}
314 314
 		break;
315 315
 	case '106':
316 316
 	case '107':
317 317
 	case '108':
318
-		if($modx->hasPermission('new_module')) {
318
+		if ($modx->hasPermission('new_module')) {
319 319
 			$addnew = 1;
320 320
 		}
321
-		if($modx->hasPermission('exec_module')) {
321
+		if ($modx->hasPermission('exec_module')) {
322 322
 			$run = 1;
323 323
 		}
324 324
 		break;
325 325
 	case '88':
326
-		if($modx->hasPermission('new_web_user')) {
326
+		if ($modx->hasPermission('new_web_user')) {
327 327
 			$addnew = 1;
328 328
 		}
329 329
 		break;
@@ -337,30 +337,30 @@  discard block
 block discarded – undo
337 337
 			<div class="btn-group">
338 338
 				<div class="btn-group">
339 339
 					<a id="Button1" class="btn btn-success" href="javascript:;" onclick="actions.save();">
340
-						<i class="' . $_style["actions_save"] . '"></i><span>' . $_lang['save'] . '</span>
340
+						<i class="' . $_style["actions_save"].'"></i><span>'.$_lang['save'].'</span>
341 341
 					</a>
342 342
 					<span class="btn btn-success plus dropdown-toggle"></span>
343 343
 					<select id="stay" name="stay">
344 344
 						' . ($addnew ? '
345
-							<option id="stay1" value="1" ' . ($stay == '1' ? ' selected="selected"' : '') . '>' . $_lang['stay_new'] . '</option>
346
-						' : '') . '
347
-						<option id="stay2" value="2" ' . ($stay == '2' ? ' selected="selected"' : '') . '>' . $_lang['stay'] . '</option>
348
-						<option id="stay3" value="" ' . ($stay == '' ? ' selected="selected"' : '') . '>' . $_lang['close'] . '</option>
345
+							<option id="stay1" value="1" ' . ($stay == '1' ? ' selected="selected"' : '').'>'.$_lang['stay_new'].'</option>
346
+						' : '').'
347
+						<option id="stay2" value="2" ' . ($stay == '2' ? ' selected="selected"' : '').'>'.$_lang['stay'].'</option>
348
+						<option id="stay3" value="" ' . ($stay == '' ? ' selected="selected"' : '').'>'.$_lang['close'].'</option>
349 349
 					</select>
350 350
 				</div>' .
351 351
 					($addnew ? '
352
-					<a id="Button6" class="btn btn-secondary' . $disabled . '" href="javascript:;" onclick="actions.duplicate();">
353
-						<i class="' . $_style["actions_duplicate"] . '"></i><span>' . $_lang['duplicate'] . '</span>
352
+					<a id="Button6" class="btn btn-secondary' . $disabled.'" href="javascript:;" onclick="actions.duplicate();">
353
+						<i class="' . $_style["actions_duplicate"].'"></i><span>'.$_lang['duplicate'].'</span>
354 354
 					</a>
355
-					' : '') . '
356
-				<a id="Button3" class="btn btn-secondary' . $disabled . '" href="javascript:;" onclick="actions.delete();">
357
-					<i class="' . $_style["actions_delete"] . '"></i><span>' . $_lang['delete'] . '</span>
355
+					' : '').'
356
+				<a id="Button3" class="btn btn-secondary' . $disabled.'" href="javascript:;" onclick="actions.delete();">
357
+					<i class="' . $_style["actions_delete"].'"></i><span>'.$_lang['delete'].'</span>
358 358
 				</a>
359 359
 				<a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.cancel();">
360
-					<i class="' . $_style["actions_cancel"] . '"></i><span>' . $_lang['cancel'] . '</span>
360
+					<i class="' . $_style["actions_cancel"].'"></i><span>'.$_lang['cancel'].'</span>
361 361
 				</a>
362 362
 				<a id="Button4" class="btn btn-secondary" href="javascript:;" onclick="actions.view();">
363
-					<i class="' . $_style["actions_preview"] . '"></i><span>' . $_lang['preview'] . '</span>
363
+					<i class="' . $_style["actions_preview"].'"></i><span>'.$_lang['preview'].'</span>
364 364
 				</a>
365 365
 			</div>
366 366
 		</div>',
@@ -368,22 +368,22 @@  discard block
 block discarded – undo
368 368
 			<div class="btn-group">
369 369
 				<div class="btn-group">
370 370
 					<a id="Button1" class="btn btn-success" href="javascript:;" onclick="actions.save();">
371
-						<i class="' . $_style["actions_save"] . '"></i><span>' . $_lang['save'] . '</span>
371
+						<i class="' . $_style["actions_save"].'"></i><span>'.$_lang['save'].'</span>
372 372
 					</a>
373 373
 					<span class="btn btn-success plus dropdown-toggle"></span>
374 374
 					<select id="stay" name="stay">
375 375
 						' . ($addnew ? '
376
-							<option id="stay1" value="1" ' . ($stay == '1' ? ' selected="selected"' : '') . '>' . $_lang['stay_new'] . '</option>
377
-						' : '') . '
378
-						<option id="stay2" value="2" ' . ($stay == '2' ? ' selected="selected"' : '') . '>' . $_lang['stay'] . '</option>
379
-						<option id="stay3" value="" ' . ($stay == '' ? ' selected="selected"' : '') . '>' . $_lang['close'] . '</option>
376
+							<option id="stay1" value="1" ' . ($stay == '1' ? ' selected="selected"' : '').'>'.$_lang['stay_new'].'</option>
377
+						' : '').'
378
+						<option id="stay2" value="2" ' . ($stay == '2' ? ' selected="selected"' : '').'>'.$_lang['stay'].'</option>
379
+						<option id="stay3" value="" ' . ($stay == '' ? ' selected="selected"' : '').'>'.$_lang['close'].'</option>
380 380
 					</select>
381 381
 				</div>
382
-				<a id="Button3" class="btn btn-secondary' . $disabled . '" href="javascript:;" onclick="actions.delete();">
383
-					<i class="' . $_style["actions_delete"] . '"></i><span>' . $_lang['delete'] . '</span>
382
+				<a id="Button3" class="btn btn-secondary' . $disabled.'" href="javascript:;" onclick="actions.delete();">
383
+					<i class="' . $_style["actions_delete"].'"></i><span>'.$_lang['delete'].'</span>
384 384
 				</a>
385 385
 				<a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.cancel();">
386
-					<i class="' . $_style["actions_cancel"] . '"></i><span>' . $_lang['cancel'] . '</span>
386
+					<i class="' . $_style["actions_cancel"].'"></i><span>'.$_lang['cancel'].'</span>
387 387
 				</a>
388 388
 			</div>
389 389
 		</div>',
@@ -391,86 +391,86 @@  discard block
 block discarded – undo
391 391
 			<div class="btn-group">
392 392
 				<div class="btn-group">
393 393
 					<a id="Button1" class="btn btn-success" href="javascript:;" onclick="actions.save();">
394
-						<i class="' . $_style["actions_save"] . '"></i><span>' . $_lang['save'] . '</span>
394
+						<i class="' . $_style["actions_save"].'"></i><span>'.$_lang['save'].'</span>
395 395
 					</a>
396 396
 					<span class="btn btn-success plus dropdown-toggle"></span>
397 397
 					<select id="stay" name="stay">
398 398
 						' . ($addnew ? '
399
-							<option id="stay1" value="1" ' . ($stay == '1' ? ' selected="selected"' : '') . '>' . $_lang['stay_new'] . '</option>
400
-						' : '') . '
401
-						<option id="stay2" value="2" ' . ($stay == '2' ? ' selected="selected"' : '') . '>' . $_lang['stay'] . '</option>
402
-						<option id="stay3" value="" ' . ($stay == '' ? ' selected="selected"' : '') . '>' . $_lang['close'] . '</option>
399
+							<option id="stay1" value="1" ' . ($stay == '1' ? ' selected="selected"' : '').'>'.$_lang['stay_new'].'</option>
400
+						' : '').'
401
+						<option id="stay2" value="2" ' . ($stay == '2' ? ' selected="selected"' : '').'>'.$_lang['stay'].'</option>
402
+						<option id="stay3" value="" ' . ($stay == '' ? ' selected="selected"' : '').'>'.$_lang['close'].'</option>
403 403
 					</select>
404 404
 				</div>
405 405
 				' . ($addnew ? '
406
-				<a id="Button6" class="btn btn-secondary' . $disabled . '" href="javascript:;" onclick="actions.duplicate();">
407
-					<i class="' . $_style["actions_duplicate"] . '"></i><span>' . $_lang['duplicate'] . '</span>
406
+				<a id="Button6" class="btn btn-secondary' . $disabled.'" href="javascript:;" onclick="actions.duplicate();">
407
+					<i class="' . $_style["actions_duplicate"].'"></i><span>'.$_lang['duplicate'].'</span>
408 408
 				</a>
409
-				' : '') . '
410
-				<a id="Button3" class="btn btn-secondary' . $disabled . '" href="javascript:;" onclick="actions.delete();">
411
-					<i class="' . $_style["actions_delete"] . '"></i><span>' . $_lang['delete'] . '</span>
409
+				' : '').'
410
+				<a id="Button3" class="btn btn-secondary' . $disabled.'" href="javascript:;" onclick="actions.delete();">
411
+					<i class="' . $_style["actions_delete"].'"></i><span>'.$_lang['delete'].'</span>
412 412
 				</a>
413 413
 				<a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.cancel();">
414
-					<i class="' . $_style["actions_cancel"] . '"></i><span>' . $_lang['cancel'] . '</span>
414
+					<i class="' . $_style["actions_cancel"].'"></i><span>'.$_lang['cancel'].'</span>
415 415
 				</a>
416 416
 				' . ($run ? '
417
-				<a id="Button4" class="btn btn-secondary' . $disabled . '" href="javascript:;" onclick="actions.run();">
418
-					<i class="' . $_style["actions_run"] . '"></i><span>' . $_lang['run_module'] . '</span>
417
+				<a id="Button4" class="btn btn-secondary' . $disabled.'" href="javascript:;" onclick="actions.run();">
418
+					<i class="' . $_style["actions_run"].'"></i><span>'.$_lang['run_module'].'</span>
419 419
 				</a>
420
-				' : '') . '
420
+				' : '').'
421 421
 			</div>
422 422
 		</div>',
423 423
 		'newmodule' => ($addnew ? '<div id="actions">
424 424
 			<div class="btn-group">
425 425
 				<a id="newModule" class="btn btn-secondary" href="javascript:;" onclick="actions.new();">
426
-					<i class="' . $_style["actions_new"] . '"></i><span>' . $_lang['new_module'] . '</span>
426
+					<i class="' . $_style["actions_new"].'"></i><span>'.$_lang['new_module'].'</span>
427 427
 				</a>
428 428
 			</div>
429 429
 		</div>' : ''),
430 430
 		'close' => '<div id="actions">
431 431
 			<div class="btn-group">
432 432
 				<a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.close();">
433
-					<i class="' . $_style["actions_close"] . '"></i><span>' . $_lang['close'] . '</span>
433
+					<i class="' . $_style["actions_close"].'"></i><span>'.$_lang['close'].'</span>
434 434
 				</a>
435 435
 			</div>
436 436
 		</div>',
437 437
 		'save' => '<div id="actions">
438 438
 			<div class="btn-group">
439 439
 				<a id="Button1" class="btn btn-success" href="javascript:;" onclick="actions.save();">
440
-					<i class="' . $_style["actions_save"] . '"></i><span>' . $_lang['save'] . '</span>
440
+					<i class="' . $_style["actions_save"].'"></i><span>'.$_lang['save'].'</span>
441 441
 				</a>
442 442
 				<a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.cancel();">
443
-					<i class="' . $_style["actions_cancel"] . '"></i><span>' . $_lang['cancel'] . '</span>
443
+					<i class="' . $_style["actions_cancel"].'"></i><span>'.$_lang['cancel'].'</span>
444 444
 				</a>
445 445
 			</div>
446 446
 		</div>',
447 447
 		'savedelete' => '<div id="actions">
448 448
 			<div class="btn-group">
449 449
 				<a id="Button1" class="btn btn-success" href="javascript:;" onclick="actions.save();">
450
-					<i class="' . $_style["actions_save"] . '"></i><span>' . $_lang['save'] . '</span>
450
+					<i class="' . $_style["actions_save"].'"></i><span>'.$_lang['save'].'</span>
451 451
 				</a>
452
-				<a id="Button3" class="btn btn-secondary' . $disabled . '" href="javascript:;" onclick="actions.delete();">
453
-					<i class="' . $_style["actions_delete"] . '"></i><span>' . $_lang['delete'] . '</span>
452
+				<a id="Button3" class="btn btn-secondary' . $disabled.'" href="javascript:;" onclick="actions.delete();">
453
+					<i class="' . $_style["actions_delete"].'"></i><span>'.$_lang['delete'].'</span>
454 454
 				</a>
455 455
 				<a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.cancel();">
456
-					<i class="' . $_style["actions_cancel"] . '"></i><span>' . $_lang['cancel'] . '</span>
456
+					<i class="' . $_style["actions_cancel"].'"></i><span>'.$_lang['cancel'].'</span>
457 457
 				</a>
458 458
 			</div>
459 459
 		</div>',
460 460
 		'cancel' => '<div id="actions">
461 461
 			<div class="btn-group">
462 462
 				<a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.cancel();">
463
-					<i class="' . $_style["actions_cancel"] . '"></i><span>' . $_lang['cancel'] . '</span>
463
+					<i class="' . $_style["actions_cancel"].'"></i><span>'.$_lang['cancel'].'</span>
464 464
 				</a>
465 465
 			</div>
466 466
 		</div>',
467 467
 		'canceldelete' => '<div id="actions">
468 468
 			<div class="btn-group">
469
-				<a id="Button3" class="btn btn-secondary' . $disabled . '" href="javascript:;" onclick="actions.delete();">
470
-					<i class="' . $_style["actions_delete"] . '"></i><span>' . $_lang['delete'] . '</span>
469
+				<a id="Button3" class="btn btn-secondary' . $disabled.'" href="javascript:;" onclick="actions.delete();">
470
+					<i class="' . $_style["actions_delete"].'"></i><span>'.$_lang['delete'].'</span>
471 471
 				</a>
472 472
 				<a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.cancel();">
473
-					<i class="' . $_style["actions_cancel"] . '"></i><span>' . $_lang['cancel'] . '</span>
473
+					<i class="' . $_style["actions_cancel"].'"></i><span>'.$_lang['cancel'].'</span>
474 474
 				</a>
475 475
 			</div>
476 476
 		</div>',
@@ -480,33 +480,33 @@  discard block
 block discarded – undo
480 480
 			<div class="btn-group">' .
481 481
 				($addnew ? '
482 482
 					<a class="btn btn-secondary" href="javascript:;" onclick="actions.new();">
483
-						<i class="' . $_style["icons_new_document"] . '"></i><span>' . $_lang['create_resource_here'] . '</span>
483
+						<i class="' . $_style["icons_new_document"].'"></i><span>'.$_lang['create_resource_here'].'</span>
484 484
 					</a>
485 485
 					<a class="btn btn-secondary" href="javascript:;" onclick="actions.newlink();">
486
-						<i class="' . $_style["icons_new_weblink"] . '"></i><span>' . $_lang['create_weblink_here'] . '</span>
486
+						<i class="' . $_style["icons_new_weblink"].'"></i><span>'.$_lang['create_weblink_here'].'</span>
487 487
 					</a>
488
-				' : '') . '
488
+				' : '').'
489 489
 				<a id="Button1" class="btn btn-success" href="javascript:;" onclick="actions.edit();">
490
-					<i class="' . $_style["actions_edit"] . '"></i><span>' . $_lang['edit'] . '</span>
490
+					<i class="' . $_style["actions_edit"].'"></i><span>'.$_lang['edit'].'</span>
491 491
 				</a>
492 492
 				<a id="Button2" class="btn btn-secondary" href="javascript:;" onclick="actions.move();">
493
-					<i class="' . $_style["actions_move"] . '"></i><span>' . $_lang['move'] . '</span>
493
+					<i class="' . $_style["actions_move"].'"></i><span>'.$_lang['move'].'</span>
494 494
 				</a>
495 495
 				<a id="Button6" class="btn btn-secondary" href="javascript:;" onclick="actions.duplicate();">
496
-					<i class="' . $_style["actions_duplicate"] . '"></i><span>' . $_lang['duplicate'] . '</span>
496
+					<i class="' . $_style["actions_duplicate"].'"></i><span>'.$_lang['duplicate'].'</span>
497 497
 				</a>
498 498
 				<a id="Button3" class="btn btn-secondary" href="javascript:;" onclick="actions.delete();">
499
-					<i class="' . $_style["actions_delete"] . '"></i><span>' . $_lang['delete'] . '</span>
499
+					<i class="' . $_style["actions_delete"].'"></i><span>'.$_lang['delete'].'</span>
500 500
 				</a>
501 501
 				<a id="Button4" class="btn btn-secondary" href="javascript:;" onclick="actions.view();">
502
-					<i class="' . $_style["actions_preview"] . '"></i><span>' . $_lang['preview'] . '</span>
502
+					<i class="' . $_style["actions_preview"].'"></i><span>'.$_lang['preview'].'</span>
503 503
 				</a>
504 504
 			</div>
505 505
 		</div>',
506 506
 		'cancel' => '<div id="actions">
507 507
 			<div class="btn-group">
508 508
 				<a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.cancel();">
509
-					<i class="' . $_style["actions_cancel"] . '"></i><span>' . $_lang['cancel'] . '</span>
509
+					<i class="' . $_style["actions_cancel"].'"></i><span>'.$_lang['cancel'].'</span>
510 510
 				</a>
511 511
 			</div>
512 512
 		</div>',
Please login to merge, or discard this patch.
Braces   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -10,12 +10,12 @@  discard block
 block discarded – undo
10 10
  */
11 11
 $style_path = 'media/style/' . $modx->config['manager_theme'] . '/images/';
12 12
 $modx->config['mgr_date_picker_path'] = 'media/calendar/datepicker.inc.php';
13
-if(!$modx->config['lang_code']) {
13
+if(!$modx->config['lang_code']) {
14 14
 	global $modx_lang_attribute;
15 15
 	$modx->config['lang_code'] = !$modx_lang_attribute ? 'en' : $modx_lang_attribute;
16 16
 }
17 17
 
18
-if($_GET['a'] == 2) {
18
+if($_GET['a'] == 2) {
19 19
 	include_once('welcome.php');
20 20
 }
21 21
 
@@ -262,68 +262,68 @@  discard block
 block discarded – undo
262 262
 
263 263
 // actions buttons templates
264 264
 $action = isset($_REQUEST['a']) ? $_REQUEST['a'] : '';
265
-if (!empty($modx->config['global_tabs']) && !isset($_SESSION['stay'])) {
265
+if (!empty($modx->config['global_tabs']) && !isset($_SESSION['stay'])) {
266 266
     $_REQUEST['stay'] = 2;
267 267
 }
268
-if (isset($_REQUEST['stay'])) {
268
+if (isset($_REQUEST['stay'])) {
269 269
     $_SESSION['stay'] = $_REQUEST['stay'];
270
-} else if (isset($_SESSION['stay'])) {
270
+} else if (isset($_SESSION['stay'])) {
271 271
     $_REQUEST['stay'] = $_SESSION['stay'];
272 272
 }
273 273
 $stay = isset($_REQUEST['stay']) ? $_REQUEST['stay'] : '';
274 274
 $addnew = 0;
275 275
 $run = 0;
276
-switch($action) {
276
+switch($action) {
277 277
 	case '3':
278 278
 	case '4':
279 279
 	case '27':
280 280
 	case '72':
281
-		if($modx->hasPermission('new_document')) {
281
+		if($modx->hasPermission('new_document')) {
282 282
 			$addnew = 1;
283 283
 		}
284 284
 		break;
285 285
 	case '16':
286 286
 	case '19':
287
-		if($modx->hasPermission('new_template')) {
287
+		if($modx->hasPermission('new_template')) {
288 288
 			$addnew = 1;
289 289
 		}
290 290
 		break;
291 291
 	case '300':
292 292
 	case '301':
293
-		if($modx->hasPermission('new_snippet') && $modx->hasPermission('new_chunk') && $modx->hasPermission('new_plugin')) {
293
+		if($modx->hasPermission('new_snippet') && $modx->hasPermission('new_chunk') && $modx->hasPermission('new_plugin')) {
294 294
 			$addnew = 1;
295 295
 		}
296 296
 		break;
297 297
 	case '77':
298 298
 	case '78':
299
-		if($modx->hasPermission('new_chunk')) {
299
+		if($modx->hasPermission('new_chunk')) {
300 300
 			$addnew = 1;
301 301
 		}
302 302
 		break;
303 303
 	case '22':
304 304
 	case '23':
305
-		if($modx->hasPermission('new_snippet')) {
305
+		if($modx->hasPermission('new_snippet')) {
306 306
 			$addnew = 1;
307 307
 		}
308 308
 		break;
309 309
 	case '101':
310 310
 	case '102':
311
-		if($modx->hasPermission('new_plugin')) {
311
+		if($modx->hasPermission('new_plugin')) {
312 312
 			$addnew = 1;
313 313
 		}
314 314
 		break;
315 315
 	case '106':
316 316
 	case '107':
317 317
 	case '108':
318
-		if($modx->hasPermission('new_module')) {
318
+		if($modx->hasPermission('new_module')) {
319 319
 			$addnew = 1;
320 320
 		}
321
-		if($modx->hasPermission('exec_module')) {
321
+		if($modx->hasPermission('exec_module')) {
322 322
 			$run = 1;
323 323
 		}
324 324
 		break;
325 325
 	case '88':
326
-		if($modx->hasPermission('new_web_user')) {
326
+		if($modx->hasPermission('new_web_user')) {
327 327
 			$addnew = 1;
328 328
 		}
329 329
 		break;
Please login to merge, or discard this patch.
manager/includes/charsets.php 2 patches
Braces   +31 added lines, -15 removed lines patch added patch discarded remove patch
@@ -65,21 +65,37 @@
 block discarded – undo
65 65
 $_['macintosh']         = 'Western European (Mac) - macintosh';
66 66
 $_['Windows-1252']      = 'Western European (Windows) - Windows-1252';
67 67
 
68
-if($modx_charset     == 'euc-jp')      $_['euc-jp']      = 'Japanese (EUC) - euc-jp';
69
-elseif($modx_charset == 'shift_jis')   $_['shift_jis']   = 'Japanese (Shift-JIS) - shift_jis';
70
-elseif($modx_charset == 'iso-2022-jp') $_['iso-2022-jp'] = 'Japanese (JIS-Allow 1 byte Kana - SO/SI) - iso-2022-jp';
71
-elseif($modx_charset == 'csISO2022JP') $_['csISO2022JP'] = 'Japanese (JIS-Allow 1 byte Kana) - csISO2022JP';
72
-elseif($modx_charset == 'EUC-CN')            $_['EUC-CN']            = 'Chinese Simplified (EUC) - EUC-CN';
73
-elseif($modx_charset == 'hz-gb-2312')        $_['hz-gb-2312']        = 'Chinese Simplified (HZ) - hz-gb-2312';
74
-elseif($modx_charset == 'x-mac-chinesesimp') $_['x-mac-chinesesimp'] = 'Chinese Simplified (Mac) - x-mac-chinesesimp';
75
-elseif($modx_charset == 'x-Chinese-CNS')     $_['x-Chinese-CNS']     = 'Chinese Traditional (CNS) - x-Chinese-CNS';
76
-elseif($modx_charset == 'x-Chinese-Eten')    $_['x-Chinese-Eten']    = 'Chinese Traditional (Eten) - x-Chinese-Eten';
77
-elseif($modx_charset == 'x-mac-chinesetrad') $_['x-mac-chinesetrad'] = 'Chinese Traditional (Mac) - x-mac-chinesetrad';
78
-elseif($modx_charset == 'ks_c_5601-1987') $_['ks_c_5601-1987'] = 'Korean - ks_c_5601-1987';
79
-elseif($modx_charset == 'euc-kr')         $_['euc-kr']         = 'Korean (EUC) - euc-kr';
80
-elseif($modx_charset == 'iso-2022-kr')    $_['iso-2022-kr']    = 'Korean (ISO) - iso-2022-kr';
81
-elseif($modx_charset == 'Johab')          $_['Johab']          = 'Korean (Johab) - Johab';
82
-elseif($modx_charset == 'x-mac-korean')   $_['x-mac-korean']   = 'Korean (Mac) - x-mac-korean';
68
+if($modx_charset     == 'euc-jp') {
69
+    $_['euc-jp']      = 'Japanese (EUC) - euc-jp';
70
+} elseif($modx_charset == 'shift_jis') {
71
+    $_['shift_jis']   = 'Japanese (Shift-JIS) - shift_jis';
72
+} elseif($modx_charset == 'iso-2022-jp') {
73
+    $_['iso-2022-jp'] = 'Japanese (JIS-Allow 1 byte Kana - SO/SI) - iso-2022-jp';
74
+} elseif($modx_charset == 'csISO2022JP') {
75
+    $_['csISO2022JP'] = 'Japanese (JIS-Allow 1 byte Kana) - csISO2022JP';
76
+} elseif($modx_charset == 'EUC-CN') {
77
+    $_['EUC-CN']            = 'Chinese Simplified (EUC) - EUC-CN';
78
+} elseif($modx_charset == 'hz-gb-2312') {
79
+    $_['hz-gb-2312']        = 'Chinese Simplified (HZ) - hz-gb-2312';
80
+} elseif($modx_charset == 'x-mac-chinesesimp') {
81
+    $_['x-mac-chinesesimp'] = 'Chinese Simplified (Mac) - x-mac-chinesesimp';
82
+} elseif($modx_charset == 'x-Chinese-CNS') {
83
+    $_['x-Chinese-CNS']     = 'Chinese Traditional (CNS) - x-Chinese-CNS';
84
+} elseif($modx_charset == 'x-Chinese-Eten') {
85
+    $_['x-Chinese-Eten']    = 'Chinese Traditional (Eten) - x-Chinese-Eten';
86
+} elseif($modx_charset == 'x-mac-chinesetrad') {
87
+    $_['x-mac-chinesetrad'] = 'Chinese Traditional (Mac) - x-mac-chinesetrad';
88
+} elseif($modx_charset == 'ks_c_5601-1987') {
89
+    $_['ks_c_5601-1987'] = 'Korean - ks_c_5601-1987';
90
+} elseif($modx_charset == 'euc-kr') {
91
+    $_['euc-kr']         = 'Korean (EUC) - euc-kr';
92
+} elseif($modx_charset == 'iso-2022-kr') {
93
+    $_['iso-2022-kr']    = 'Korean (ISO) - iso-2022-kr';
94
+} elseif($modx_charset == 'Johab') {
95
+    $_['Johab']          = 'Korean (Johab) - Johab';
96
+} elseif($modx_charset == 'x-mac-korean') {
97
+    $_['x-mac-korean']   = 'Korean (Mac) - x-mac-korean';
98
+}
83 99
 
84 100
 $tpl = '<option value="%s" %s>%s</option>';
85 101
 $options = array();
Please login to merge, or discard this patch.
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -65,26 +65,26 @@
 block discarded – undo
65 65
 $_['macintosh']         = 'Western European (Mac) - macintosh';
66 66
 $_['Windows-1252']      = 'Western European (Windows) - Windows-1252';
67 67
 
68
-if($modx_charset     == 'euc-jp')      $_['euc-jp']      = 'Japanese (EUC) - euc-jp';
69
-elseif($modx_charset == 'shift_jis')   $_['shift_jis']   = 'Japanese (Shift-JIS) - shift_jis';
70
-elseif($modx_charset == 'iso-2022-jp') $_['iso-2022-jp'] = 'Japanese (JIS-Allow 1 byte Kana - SO/SI) - iso-2022-jp';
71
-elseif($modx_charset == 'csISO2022JP') $_['csISO2022JP'] = 'Japanese (JIS-Allow 1 byte Kana) - csISO2022JP';
72
-elseif($modx_charset == 'EUC-CN')            $_['EUC-CN']            = 'Chinese Simplified (EUC) - EUC-CN';
73
-elseif($modx_charset == 'hz-gb-2312')        $_['hz-gb-2312']        = 'Chinese Simplified (HZ) - hz-gb-2312';
74
-elseif($modx_charset == 'x-mac-chinesesimp') $_['x-mac-chinesesimp'] = 'Chinese Simplified (Mac) - x-mac-chinesesimp';
75
-elseif($modx_charset == 'x-Chinese-CNS')     $_['x-Chinese-CNS']     = 'Chinese Traditional (CNS) - x-Chinese-CNS';
76
-elseif($modx_charset == 'x-Chinese-Eten')    $_['x-Chinese-Eten']    = 'Chinese Traditional (Eten) - x-Chinese-Eten';
77
-elseif($modx_charset == 'x-mac-chinesetrad') $_['x-mac-chinesetrad'] = 'Chinese Traditional (Mac) - x-mac-chinesetrad';
78
-elseif($modx_charset == 'ks_c_5601-1987') $_['ks_c_5601-1987'] = 'Korean - ks_c_5601-1987';
79
-elseif($modx_charset == 'euc-kr')         $_['euc-kr']         = 'Korean (EUC) - euc-kr';
80
-elseif($modx_charset == 'iso-2022-kr')    $_['iso-2022-kr']    = 'Korean (ISO) - iso-2022-kr';
81
-elseif($modx_charset == 'Johab')          $_['Johab']          = 'Korean (Johab) - Johab';
82
-elseif($modx_charset == 'x-mac-korean')   $_['x-mac-korean']   = 'Korean (Mac) - x-mac-korean';
68
+if ($modx_charset == 'euc-jp')      $_['euc-jp']      = 'Japanese (EUC) - euc-jp';
69
+elseif ($modx_charset == 'shift_jis')   $_['shift_jis']   = 'Japanese (Shift-JIS) - shift_jis';
70
+elseif ($modx_charset == 'iso-2022-jp') $_['iso-2022-jp'] = 'Japanese (JIS-Allow 1 byte Kana - SO/SI) - iso-2022-jp';
71
+elseif ($modx_charset == 'csISO2022JP') $_['csISO2022JP'] = 'Japanese (JIS-Allow 1 byte Kana) - csISO2022JP';
72
+elseif ($modx_charset == 'EUC-CN')            $_['EUC-CN']            = 'Chinese Simplified (EUC) - EUC-CN';
73
+elseif ($modx_charset == 'hz-gb-2312')        $_['hz-gb-2312']        = 'Chinese Simplified (HZ) - hz-gb-2312';
74
+elseif ($modx_charset == 'x-mac-chinesesimp') $_['x-mac-chinesesimp'] = 'Chinese Simplified (Mac) - x-mac-chinesesimp';
75
+elseif ($modx_charset == 'x-Chinese-CNS')     $_['x-Chinese-CNS']     = 'Chinese Traditional (CNS) - x-Chinese-CNS';
76
+elseif ($modx_charset == 'x-Chinese-Eten')    $_['x-Chinese-Eten']    = 'Chinese Traditional (Eten) - x-Chinese-Eten';
77
+elseif ($modx_charset == 'x-mac-chinesetrad') $_['x-mac-chinesetrad'] = 'Chinese Traditional (Mac) - x-mac-chinesetrad';
78
+elseif ($modx_charset == 'ks_c_5601-1987') $_['ks_c_5601-1987'] = 'Korean - ks_c_5601-1987';
79
+elseif ($modx_charset == 'euc-kr')         $_['euc-kr']         = 'Korean (EUC) - euc-kr';
80
+elseif ($modx_charset == 'iso-2022-kr')    $_['iso-2022-kr']    = 'Korean (ISO) - iso-2022-kr';
81
+elseif ($modx_charset == 'Johab')          $_['Johab']          = 'Korean (Johab) - Johab';
82
+elseif ($modx_charset == 'x-mac-korean')   $_['x-mac-korean']   = 'Korean (Mac) - x-mac-korean';
83 83
 
84 84
 $tpl = '<option value="%s" %s>%s</option>';
85 85
 $options = array();
86
-foreach($_ as $value=>$label) {
87
-    $selected = $value===$modx_charset ? 'selected' : '';
86
+foreach ($_ as $value=>$label) {
87
+    $selected = $value === $modx_charset ? 'selected' : '';
88 88
     $options[] = sprintf($tpl, $value, $selected, $label);
89 89
 }
90 90
 echo implode("\n", $options);
Please login to merge, or discard this patch.
manager/includes/sysalert.display.inc.php 2 patches
Indentation   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -1,30 +1,30 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-	/**
4
-	 *	System Alert Message Queue Display file
5
-	 *	Written By Raymond Irving, April, 2005
6
-	 *
7
-	 *	Used to display system alert messages inside the browser
8
-	 *
9
-	 */
3
+    /**
4
+     *	System Alert Message Queue Display file
5
+     *	Written By Raymond Irving, April, 2005
6
+     *
7
+     *	Used to display system alert messages inside the browser
8
+     *
9
+     */
10 10
 
11
-	require_once(dirname(__FILE__).'/protect.inc.php');
11
+    require_once(dirname(__FILE__).'/protect.inc.php');
12 12
 
13
-	$sysMsgs = "";
14
-	$limit = count($SystemAlertMsgQueque);
15
-	for($i=0;$i<$limit;$i++) {
16
-		$sysMsgs .= $SystemAlertMsgQueque[$i]."<hr sys/>";
17
-	}
18
-	// reset message queque
19
-	unset($_SESSION['SystemAlertMsgQueque']);
20
-	$_SESSION['SystemAlertMsgQueque'] = array();
21
-	$SystemAlertMsgQueque = &$_SESSION['SystemAlertMsgQueque'];
13
+    $sysMsgs = "";
14
+    $limit = count($SystemAlertMsgQueque);
15
+    for($i=0;$i<$limit;$i++) {
16
+        $sysMsgs .= $SystemAlertMsgQueque[$i]."<hr sys/>";
17
+    }
18
+    // reset message queque
19
+    unset($_SESSION['SystemAlertMsgQueque']);
20
+    $_SESSION['SystemAlertMsgQueque'] = array();
21
+    $SystemAlertMsgQueque = &$_SESSION['SystemAlertMsgQueque'];
22 22
 
23
-	if($sysMsgs!="") {
23
+    if($sysMsgs!="") {
24 24
 ?>
25 25
 
26 26
 <?php // fetch the styles
27
-	echo '<link rel="stylesheet" type="text/css" href="'.MODX_MANAGER_URL.'media/style/'.$manager_theme.'/style.css'.'" />';
27
+    echo '<link rel="stylesheet" type="text/css" href="'.MODX_MANAGER_URL.'media/style/'.$manager_theme.'/style.css'.'" />';
28 28
 ?>
29 29
 <script type="text/javascript">
30 30
 // <![CDATA[
@@ -42,5 +42,5 @@  discard block
 block discarded – undo
42 42
 // ]]>
43 43
 </script>
44 44
 <?php
45
-	}
45
+    }
46 46
 ?>
47 47
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
 
13 13
 	$sysMsgs = "";
14 14
 	$limit = count($SystemAlertMsgQueque);
15
-	for($i=0;$i<$limit;$i++) {
15
+	for ($i = 0; $i < $limit; $i++) {
16 16
 		$sysMsgs .= $SystemAlertMsgQueque[$i]."<hr sys/>";
17 17
 	}
18 18
 	// reset message queque
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 	$_SESSION['SystemAlertMsgQueque'] = array();
21 21
 	$SystemAlertMsgQueque = &$_SESSION['SystemAlertMsgQueque'];
22 22
 
23
-	if($sysMsgs!="") {
23
+	if ($sysMsgs != "") {
24 24
 ?>
25 25
 
26 26
 <?php // fetch the styles
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 			var sysAlert = new Element('div').setProperties({
33 33
 				'class': 'sysAlert'
34 34
 			});
35
-			sysAlert.innerHTML = '<?php echo $modx->db->escape($sysMsgs);?>';
35
+			sysAlert.innerHTML = '<?php echo $modx->db->escape($sysMsgs); ?>';
36 36
 			var boxHtml = new MooPrompt('<?php echo $_lang['sys_alert']; ?>', sysAlert, {
37 37
 				buttons: 1,
38 38
 				button1: 'Ok',
Please login to merge, or discard this patch.
manager/includes/config_check.inc.php 4 patches
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@
 block discarded – undo
88 88
 }
89 89
 </script>
90 90
 
91
-JS;
91
+js;
92 92
         $modx->regClientScript($script);
93 93
         }
94 94
     }
Please login to merge, or discard this patch.
Indentation   +16 added lines, -16 removed lines patch added patch discarded remove patch
@@ -5,14 +5,14 @@  discard block
 block discarded – undo
5 5
 
6 6
 // PROCESSOR FIRST
7 7
 if($_SESSION['mgrRole'] == 1) {
8
-	if($_REQUEST['b'] == 'resetSysfilesChecksum' && $modx->hasPermission('settings')) {
9
-		$current = $modx->manager->getSystemChecksum($modx->config['check_files_onlogin']);
10
-		if(!empty($current)) {
11
-			$modx->manager->setSystemChecksum($current);
12
-			$modx->clearCache('full');
13
-			$modx->config['sys_files_checksum'] = $current;
14
-		};
15
-	}
8
+    if($_REQUEST['b'] == 'resetSysfilesChecksum' && $modx->hasPermission('settings')) {
9
+        $current = $modx->manager->getSystemChecksum($modx->config['check_files_onlogin']);
10
+        if(!empty($current)) {
11
+            $modx->manager->setSystemChecksum($current);
12
+            $modx->clearCache('full');
13
+            $modx->config['sys_files_checksum'] = $current;
14
+        };
15
+    }
16 16
 }
17 17
 
18 18
 // NOW CHECK CONFIG
@@ -20,15 +20,15 @@  discard block
 block discarded – undo
20 20
 
21 21
 $sysfiles_check = $modx->manager->checkSystemChecksum();
22 22
 if ($sysfiles_check!=='0'){
23
-      $warningspresent = 1;
24
-      $warnings[] = array($_lang['configcheck_sysfiles_mod']);
23
+        $warningspresent = 1;
24
+        $warnings[] = array($_lang['configcheck_sysfiles_mod']);
25 25
 }
26 26
 
27 27
 if (is_writable("includes/config.inc.php")){
28 28
     // Warn if world writable
29 29
     if(@fileperms('includes/config.inc.php') & 0x0002) {
30
-      $warningspresent = 1;
31
-      $warnings[] = array($_lang['configcheck_configinc']);
30
+        $warningspresent = 1;
31
+        $warnings[] = array($_lang['configcheck_configinc']);
32 32
     }
33 33
 }
34 34
 
@@ -179,10 +179,10 @@  discard block
 block discarded – undo
179 179
             break;
180 180
         case $_lang['configcheck_sysfiles_mod']:
181 181
             $warnings[$i][1] = $_lang["configcheck_sysfiles_mod_msg"];
182
-			$warnings[$i][2] = '<ul><li>'. implode('</li><li>', $sysfiles_check) .'</li></ul>';
183
-			if($modx->hasPermission('settings')) {
184
-				$warnings[$i][2] .= '<ul class="actionButtons" style="float:right"><li><a href="index.php?a=2&b=resetSysfilesChecksum" onclick="return confirm(\'' . $_lang["reset_sysfiles_checksum_alert"] . '\')">' . $_lang["reset_sysfiles_checksum_button"] . '</a></li></ul>';
185
-			}
182
+            $warnings[$i][2] = '<ul><li>'. implode('</li><li>', $sysfiles_check) .'</li></ul>';
183
+            if($modx->hasPermission('settings')) {
184
+                $warnings[$i][2] .= '<ul class="actionButtons" style="float:right"><li><a href="index.php?a=2&b=resetSysfilesChecksum" onclick="return confirm(\'' . $_lang["reset_sysfiles_checksum_alert"] . '\')">' . $_lang["reset_sysfiles_checksum_button"] . '</a></li></ul>';
185
+            }
186 186
             if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,3,$warnings[$i][1]." ".implode(', ',$sysfiles_check),$_lang['configcheck_sysfiles_mod']);
187 187
             break;
188 188
         case $_lang['configcheck_lang_difference'] :
Please login to merge, or discard this patch.
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 
6 6
 // PROCESSOR FIRST
7
-if($_SESSION['mgrRole'] == 1) {
8
-	if($_REQUEST['b'] == 'resetSysfilesChecksum' && $modx->hasPermission('settings')) {
7
+if ($_SESSION['mgrRole'] == 1) {
8
+	if ($_REQUEST['b'] == 'resetSysfilesChecksum' && $modx->hasPermission('settings')) {
9 9
 		$current = $modx->manager->getSystemChecksum($modx->config['check_files_onlogin']);
10
-		if(!empty($current)) {
10
+		if (!empty($current)) {
11 11
 			$modx->manager->setSystemChecksum($current);
12 12
 			$modx->clearCache('full');
13 13
 			$modx->config['sys_files_checksum'] = $current;
@@ -19,14 +19,14 @@  discard block
 block discarded – undo
19 19
 $warningspresent = 0;
20 20
 
21 21
 $sysfiles_check = $modx->manager->checkSystemChecksum();
22
-if ($sysfiles_check!=='0'){
22
+if ($sysfiles_check !== '0') {
23 23
       $warningspresent = 1;
24 24
       $warnings[] = array($_lang['configcheck_sysfiles_mod']);
25 25
 }
26 26
 
27
-if (is_writable("includes/config.inc.php")){
27
+if (is_writable("includes/config.inc.php")) {
28 28
     // Warn if world writable
29
-    if(@fileperms('includes/config.inc.php') & 0x0002) {
29
+    if (@fileperms('includes/config.inc.php') & 0x0002) {
30 30
       $warningspresent = 1;
31 31
       $warnings[] = array($_lang['configcheck_configinc']);
32 32
     }
@@ -42,8 +42,8 @@  discard block
 block discarded – undo
42 42
     $warnings[] = array($_lang['configcheck_php_gdzip']);
43 43
 }
44 44
 
45
-if(!isset($modx->config['_hide_configcheck_validate_referer']) || $modx->config['_hide_configcheck_validate_referer'] !== '1') {
46
-    if(isset($_SESSION['mgrPermissions']['settings']) && $_SESSION['mgrPermissions']['settings'] == '1') {
45
+if (!isset($modx->config['_hide_configcheck_validate_referer']) || $modx->config['_hide_configcheck_validate_referer'] !== '1') {
46
+    if (isset($_SESSION['mgrPermissions']['settings']) && $_SESSION['mgrPermissions']['settings'] == '1') {
47 47
         if ($modx->db->getValue($modx->db->select('COUNT(setting_value)', $modx->getFullTableName('system_settings'), "setting_name='validate_referer' AND setting_value='0'"))) {
48 48
             $warningspresent = 1;
49 49
             $warnings[] = array($_lang['configcheck_validate_referer']);
@@ -52,11 +52,11 @@  discard block
 block discarded – undo
52 52
 }
53 53
 
54 54
 // check for Template Switcher plugin
55
-if(!isset($modx->config['_hide_configcheck_templateswitcher_present']) || $modx->config['_hide_configcheck_templateswitcher_present'] !== '1') {
56
-    if(isset($_SESSION['mgrPermissions']['edit_plugin']) && $_SESSION['mgrPermissions']['edit_plugin'] == '1') {
55
+if (!isset($modx->config['_hide_configcheck_templateswitcher_present']) || $modx->config['_hide_configcheck_templateswitcher_present'] !== '1') {
56
+    if (isset($_SESSION['mgrPermissions']['edit_plugin']) && $_SESSION['mgrPermissions']['edit_plugin'] == '1') {
57 57
         $rs = $modx->db->select('name, disabled', $modx->getFullTableName('site_plugins'), "name IN ('TemplateSwitcher', 'Template Switcher', 'templateswitcher', 'template_switcher', 'template switcher') OR plugincode LIKE '%TemplateSwitcher%'");
58 58
         $row = $modx->db->getRow($rs);
59
-        if($row && $row['disabled'] == 0) {
59
+        if ($row && $row['disabled'] == 0) {
60 60
             $warningspresent = 1;
61 61
             $warnings[] = array($_lang['configcheck_templateswitcher_present']);
62 62
             $tplName = $row['name'];
@@ -120,36 +120,36 @@  discard block
 block discarded – undo
120 120
     /**
121 121
      * @return bool
122 122
      */
123
-    function checkSiteCache() {
123
+    function checkSiteCache(){
124 124
         $modx = evolutionCMS();
125
-        $checked= true;
126
-        if (file_exists($modx->config['base_path'] . 'assets/cache/siteCache.idx.php')) {
127
-            $checked= @include_once ($modx->config['base_path'] . 'assets/cache/siteCache.idx.php');
125
+        $checked = true;
126
+        if (file_exists($modx->config['base_path'].'assets/cache/siteCache.idx.php')) {
127
+            $checked = @include_once ($modx->config['base_path'].'assets/cache/siteCache.idx.php');
128 128
         }
129 129
         return $checked;
130 130
     }
131 131
 }
132 132
 
133
-if (!is_writable(MODX_BASE_PATH . "assets/cache/")) {
133
+if (!is_writable(MODX_BASE_PATH."assets/cache/")) {
134 134
     $warningspresent = 1;
135 135
     $warnings[] = array($_lang['configcheck_cache']);
136 136
 }
137 137
 
138 138
 if (!checkSiteCache()) {
139 139
     $warningspresent = 1;
140
-    $warnings[]= array($lang['configcheck_sitecache_integrity']);
140
+    $warnings[] = array($lang['configcheck_sitecache_integrity']);
141 141
 }
142 142
 
143
-if (!is_writable(MODX_BASE_PATH . "assets/images/")) {
143
+if (!is_writable(MODX_BASE_PATH."assets/images/")) {
144 144
     $warningspresent = 1;
145 145
     $warnings[] = array($_lang['configcheck_images']);
146 146
 }
147 147
 
148
-if(strpos($modx->config['rb_base_dir'],MODX_BASE_PATH)!==0) {
148
+if (strpos($modx->config['rb_base_dir'], MODX_BASE_PATH) !== 0) {
149 149
     $warningspresent = 1;
150 150
     $warnings[] = array($_lang['configcheck_rb_base_dir']);
151 151
 }
152
-if(strpos($modx->config['filemanager_path'],MODX_BASE_PATH)!==0) {
152
+if (strpos($modx->config['filemanager_path'], MODX_BASE_PATH) !== 0) {
153 153
     $warningspresent = 1;
154 154
     $warnings[] = array($_lang['configcheck_filemanager_path']);
155 155
 }
@@ -157,36 +157,36 @@  discard block
 block discarded – undo
157 157
 // clear file info cache
158 158
 clearstatcache();
159 159
 
160
-if ($warningspresent==1) {
160
+if ($warningspresent == 1) {
161 161
 
162
-if(!isset($modx->config['send_errormail'])) $modx->config['send_errormail']='3';
162
+if (!isset($modx->config['send_errormail'])) $modx->config['send_errormail'] = '3';
163 163
 $config_check_results = "<h3>".$_lang['configcheck_notok']."</h3>";
164 164
 
165
-for ($i=0;$i<count($warnings);$i++) {
165
+for ($i = 0; $i < count($warnings); $i++) {
166 166
     switch ($warnings[$i][0]) {
167 167
         case $_lang['configcheck_configinc'];
168 168
             $warnings[$i][1] = $_lang['configcheck_configinc_msg'];
169
-            if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,3,$warnings[$i][1],$_lang['configcheck_configinc']);
169
+            if (!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0, 3, $warnings[$i][1], $_lang['configcheck_configinc']);
170 170
             break;
171 171
         case $_lang['configcheck_installer'] :
172 172
             $warnings[$i][1] = $_lang['configcheck_installer_msg'];
173
-            if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,3,$warnings[$i][1],$_lang['configcheck_installer']);
173
+            if (!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0, 3, $warnings[$i][1], $_lang['configcheck_installer']);
174 174
             break;
175 175
         case $_lang['configcheck_cache'] :
176 176
             $warnings[$i][1] = $_lang['configcheck_cache_msg'];
177
-            if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,2,$warnings[$i][1],$_lang['configcheck_cache']);
177
+            if (!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0, 2, $warnings[$i][1], $_lang['configcheck_cache']);
178 178
             break;
179 179
         case $_lang['configcheck_images'] :
180 180
             $warnings[$i][1] = $_lang['configcheck_images_msg'];
181
-            if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,2,$warnings[$i][1],$_lang['configcheck_images']);
181
+            if (!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0, 2, $warnings[$i][1], $_lang['configcheck_images']);
182 182
             break;
183 183
         case $_lang['configcheck_sysfiles_mod']:
184 184
             $warnings[$i][1] = $_lang["configcheck_sysfiles_mod_msg"];
185
-			$warnings[$i][2] = '<ul><li>'. implode('</li><li>', $sysfiles_check) .'</li></ul>';
186
-			if($modx->hasPermission('settings')) {
187
-				$warnings[$i][2] .= '<ul class="actionButtons" style="float:right"><li><a href="index.php?a=2&b=resetSysfilesChecksum" onclick="return confirm(\'' . $_lang["reset_sysfiles_checksum_alert"] . '\')">' . $_lang["reset_sysfiles_checksum_button"] . '</a></li></ul>';
185
+			$warnings[$i][2] = '<ul><li>'.implode('</li><li>', $sysfiles_check).'</li></ul>';
186
+			if ($modx->hasPermission('settings')) {
187
+				$warnings[$i][2] .= '<ul class="actionButtons" style="float:right"><li><a href="index.php?a=2&b=resetSysfilesChecksum" onclick="return confirm(\''.$_lang["reset_sysfiles_checksum_alert"].'\')">'.$_lang["reset_sysfiles_checksum_button"].'</a></li></ul>';
188 188
 			}
189
-            if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,3,$warnings[$i][1]." ".implode(', ',$sysfiles_check),$_lang['configcheck_sysfiles_mod']);
189
+            if (!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0, 3, $warnings[$i][1]." ".implode(', ', $sysfiles_check), $_lang['configcheck_sysfiles_mod']);
190 190
             break;
191 191
         case $_lang['configcheck_lang_difference'] :
192 192
             $warnings[$i][1] = $_lang['configcheck_lang_difference_msg'];
@@ -208,18 +208,18 @@  discard block
 block discarded – undo
208 208
             break;
209 209
         case $_lang['configcheck_validate_referer'] :
210 210
             $msg = $_lang['configcheck_validate_referer_msg'];
211
-            $msg .= '<br />' . sprintf($_lang["configcheck_hide_warning"], 'validate_referer');
211
+            $msg .= '<br />'.sprintf($_lang["configcheck_hide_warning"], 'validate_referer');
212 212
             $warnings[$i][1] = "<span id=\"validate_referer_warning_wrapper\">{$msg}</span>\n";
213 213
             break;
214 214
         case $_lang['configcheck_templateswitcher_present'] :
215 215
             $msg = $_lang["configcheck_templateswitcher_present_msg"];
216
-            if(isset($_SESSION['mgrPermissions']['save_plugin']) && $_SESSION['mgrPermissions']['save_plugin'] == '1') {
217
-                $msg .= '<br />' . $_lang["configcheck_templateswitcher_present_disable"];
216
+            if (isset($_SESSION['mgrPermissions']['save_plugin']) && $_SESSION['mgrPermissions']['save_plugin'] == '1') {
217
+                $msg .= '<br />'.$_lang["configcheck_templateswitcher_present_disable"];
218 218
             }
219
-            if(isset($_SESSION['mgrPermissions']['delete_plugin']) && $_SESSION['mgrPermissions']['delete_plugin'] == '1') {
220
-                $msg .= '<br />' . $_lang["configcheck_templateswitcher_present_delete"];
219
+            if (isset($_SESSION['mgrPermissions']['delete_plugin']) && $_SESSION['mgrPermissions']['delete_plugin'] == '1') {
220
+                $msg .= '<br />'.$_lang["configcheck_templateswitcher_present_delete"];
221 221
             }
222
-            $msg .= '<br />' . sprintf($_lang["configcheck_hide_warning"], 'templateswitcher_present');
222
+            $msg .= '<br />'.sprintf($_lang["configcheck_hide_warning"], 'templateswitcher_present');
223 223
             $warnings[$i][1] = "<span id=\"templateswitcher_present_warning_wrapper\">{$msg}</span>\n";
224 224
             break;
225 225
         case $_lang['configcheck_rb_base_dir'] :
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
             $warnings[$i][1] = $_lang['configcheck_default_msg'];
233 233
     }
234 234
 
235
-    $admin_warning = $_SESSION['mgrRole']!=1 ? $_lang['configcheck_admin'] : "" ;
235
+    $admin_warning = $_SESSION['mgrRole'] != 1 ? $_lang['configcheck_admin'] : "";
236 236
     $config_check_results .= "
237 237
             <fieldset>
238 238
             <p><strong>".$_lang['configcheck_warning']."</strong> '".$warnings[$i][0]."'</p>
@@ -241,11 +241,11 @@  discard block
 block discarded – undo
241 241
             ".(isset($warnings[$i][2]) ? '<div style="padding-left:1em">'.$warnings[$i][2].'</div>' : '')."
242 242
             </fieldset>
243 243
 ";
244
-        if ($i!=count($warnings)-1) {
244
+        if ($i != count($warnings) - 1) {
245 245
             $config_check_results .= "<br />";
246 246
         }
247 247
     }
248
-    $_SESSION["mgrConfigCheck"]=true;
248
+    $_SESSION["mgrConfigCheck"] = true;
249 249
 } else {
250 250
     $config_check_results = $_lang['configcheck_ok'];
251 251
 }
Please login to merge, or discard this patch.
Braces   +22 added lines, -9 removed lines patch added patch discarded remove patch
@@ -19,12 +19,12 @@  discard block
 block discarded – undo
19 19
 $warningspresent = 0;
20 20
 
21 21
 $sysfiles_check = $modx->manager->checkSystemChecksum();
22
-if ($sysfiles_check!=='0'){
22
+if ($sysfiles_check!=='0') {
23 23
       $warningspresent = 1;
24 24
       $warnings[] = array($_lang['configcheck_sysfiles_mod']);
25 25
 }
26 26
 
27
-if (is_writable("includes/config.inc.php")){
27
+if (is_writable("includes/config.inc.php")) {
28 28
     // Warn if world writable
29 29
     if(@fileperms('includes/config.inc.php') & 0x0002) {
30 30
       $warningspresent = 1;
@@ -120,7 +120,8 @@  discard block
 block discarded – undo
120 120
     /**
121 121
      * @return bool
122 122
      */
123
-    function checkSiteCache() {
123
+    function checkSiteCache()
124
+    {
124 125
         $modx = evolutionCMS();
125 126
         $checked= true;
126 127
         if (file_exists($modx->config['base_path'] . 'assets/cache/siteCache.idx.php')) {
@@ -159,26 +160,36 @@  discard block
 block discarded – undo
159 160
 
160 161
 if ($warningspresent==1) {
161 162
 
162
-if(!isset($modx->config['send_errormail'])) $modx->config['send_errormail']='3';
163
+if(!isset($modx->config['send_errormail'])) {
164
+    $modx->config['send_errormail']='3';
165
+}
163 166
 $config_check_results = "<h3>".$_lang['configcheck_notok']."</h3>";
164 167
 
165 168
 for ($i=0;$i<count($warnings);$i++) {
166 169
     switch ($warnings[$i][0]) {
167 170
         case $_lang['configcheck_configinc'];
168 171
             $warnings[$i][1] = $_lang['configcheck_configinc_msg'];
169
-            if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,3,$warnings[$i][1],$_lang['configcheck_configinc']);
172
+            if(!$_SESSION["mgrConfigCheck"]) {
173
+                $modx->logEvent(0,3,$warnings[$i][1],$_lang['configcheck_configinc']);
174
+            }
170 175
             break;
171 176
         case $_lang['configcheck_installer'] :
172 177
             $warnings[$i][1] = $_lang['configcheck_installer_msg'];
173
-            if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,3,$warnings[$i][1],$_lang['configcheck_installer']);
178
+            if(!$_SESSION["mgrConfigCheck"]) {
179
+                $modx->logEvent(0,3,$warnings[$i][1],$_lang['configcheck_installer']);
180
+            }
174 181
             break;
175 182
         case $_lang['configcheck_cache'] :
176 183
             $warnings[$i][1] = $_lang['configcheck_cache_msg'];
177
-            if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,2,$warnings[$i][1],$_lang['configcheck_cache']);
184
+            if(!$_SESSION["mgrConfigCheck"]) {
185
+                $modx->logEvent(0,2,$warnings[$i][1],$_lang['configcheck_cache']);
186
+            }
178 187
             break;
179 188
         case $_lang['configcheck_images'] :
180 189
             $warnings[$i][1] = $_lang['configcheck_images_msg'];
181
-            if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,2,$warnings[$i][1],$_lang['configcheck_images']);
190
+            if(!$_SESSION["mgrConfigCheck"]) {
191
+                $modx->logEvent(0,2,$warnings[$i][1],$_lang['configcheck_images']);
192
+            }
182 193
             break;
183 194
         case $_lang['configcheck_sysfiles_mod']:
184 195
             $warnings[$i][1] = $_lang["configcheck_sysfiles_mod_msg"];
@@ -186,7 +197,9 @@  discard block
 block discarded – undo
186 197
 			if($modx->hasPermission('settings')) {
187 198
 				$warnings[$i][2] .= '<ul class="actionButtons" style="float:right"><li><a href="index.php?a=2&b=resetSysfilesChecksum" onclick="return confirm(\'' . $_lang["reset_sysfiles_checksum_alert"] . '\')">' . $_lang["reset_sysfiles_checksum_button"] . '</a></li></ul>';
188 199
 			}
189
-            if(!$_SESSION["mgrConfigCheck"]) $modx->logEvent(0,3,$warnings[$i][1]." ".implode(', ',$sysfiles_check),$_lang['configcheck_sysfiles_mod']);
200
+            if(!$_SESSION["mgrConfigCheck"]) {
201
+                $modx->logEvent(0,3,$warnings[$i][1]." ".implode(', ',$sysfiles_check),$_lang['configcheck_sysfiles_mod']);
202
+            }
190 203
             break;
191 204
         case $_lang['configcheck_lang_difference'] :
192 205
             $warnings[$i][1] = $_lang['configcheck_lang_difference_msg'];
Please login to merge, or discard this patch.
manager/includes/debug.inc.php 2 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
3 3
 
4 4
 // show debug information
5 5
 if(isset($enable_debug) && $enable_debug==true) {
6
-	?>
6
+    ?>
7 7
 	<script language="javascript">
8 8
 	//document.onload = removeDebug();
9 9
 	
@@ -33,8 +33,8 @@  discard block
 block discarded – undo
33 33
 	}
34 34
 	</style>
35 35
 	<?php
36
-	$mtime = microtime(); $mtime = explode(" ",$mtime); $mtime = $mtime[1] + $mtime[0]; $tend = $mtime; $totaltime = ($tend - $tstart);
37
-	?>
36
+    $mtime = microtime(); $mtime = explode(" ",$mtime); $mtime = $mtime[1] + $mtime[0]; $tend = $mtime; $totaltime = ($tend - $tstart);
37
+    ?>
38 38
 	<div class='debug' id='debug' name='debug' onClick="removeDebugDiv();">
39 39
 		<table border="0" cellspacing="0" cellpadding="0">
40 40
 		  <tr>
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,10 +1,10 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 
6 6
 // show debug information
7
-if(isset($enable_debug) && $enable_debug==true) {
7
+if (isset($enable_debug) && $enable_debug == true) {
8 8
 	?>
9 9
 	<script language="javascript">
10 10
 	//document.onload = removeDebug();
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 	}
36 36
 	</style>
37 37
 	<?php
38
-	$mtime = microtime(); $mtime = explode(" ",$mtime); $mtime = $mtime[1] + $mtime[0]; $tend = $mtime; $totaltime = ($tend - $tstart);
38
+	$mtime = microtime(); $mtime = explode(" ", $mtime); $mtime = $mtime[1] + $mtime[0]; $tend = $mtime; $totaltime = ($tend - $tstart);
39 39
 	?>
40 40
 	<div class='debug' id='debug' name='debug' onClick="removeDebugDiv();">
41 41
 		<table border="0" cellspacing="0" cellpadding="0">
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
 		  </tr>
45 45
 		  <tr>
46 46
 			<td width="70">Time taken</td>
47
-			<td width="80"><?php echo printf ("%6.5f s", $totaltime); ?></td>
47
+			<td width="80"><?php echo printf("%6.5f s", $totaltime); ?></td>
48 48
 		  </tr>
49 49
 		</table>
50 50
 	</div>
Please login to merge, or discard this patch.
manager/includes/controls/phpmailer/SMTP.php 2 patches
Spacing   +31 added lines, -31 removed lines patch added patch discarded remove patch
@@ -307,7 +307,7 @@  discard block
 block discarded – undo
307 307
         }
308 308
         // Connect to the SMTP server
309 309
         $this->edebug(
310
-            "Connection: opening to $host:$port, timeout=$timeout, options=" .
310
+            "Connection: opening to $host:$port, timeout=$timeout, options=".
311 311
             (count($options) > 0 ? var_export($options, true) : 'array()'),
312 312
             self::DEBUG_CONNECTION
313 313
         );
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
             $socket_context = stream_context_create($options);
318 318
             set_error_handler([$this, 'errorHandler']);
319 319
             $this->smtp_conn = stream_socket_client(
320
-                $host . ':' . $port,
320
+                $host.':'.$port,
321 321
                 $errno,
322 322
                 $errstr,
323 323
                 $timeout,
@@ -350,7 +350,7 @@  discard block
 block discarded – undo
350 350
                 (string) $errstr
351 351
             );
352 352
             $this->edebug(
353
-                'SMTP ERROR: ' . $this->error['error']
353
+                'SMTP ERROR: '.$this->error['error']
354 354
                 . ": $errstr ($errno)",
355 355
                 self::DEBUG_CLIENT
356 356
             );
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
         }
371 371
         // Get any announcement
372 372
         $announce = $this->get_lines();
373
-        $this->edebug('SERVER -> CLIENT: ' . $announce, self::DEBUG_SERVER);
373
+        $this->edebug('SERVER -> CLIENT: '.$announce, self::DEBUG_SERVER);
374 374
 
375 375
         return true;
376 376
     }
@@ -426,7 +426,7 @@  discard block
 block discarded – undo
426 426
         $password,
427 427
         $authtype = null,
428 428
         $OAuth = null
429
-    ) {
429
+    ){
430 430
         if (!$this->server_caps) {
431 431
             $this->setError('Authentication is not allowed before HELO/EHLO');
432 432
 
@@ -443,15 +443,15 @@  discard block
 block discarded – undo
443 443
                 return false;
444 444
             }
445 445
 
446
-            $this->edebug('Auth method requested: ' . ($authtype ? $authtype : 'UNKNOWN'), self::DEBUG_LOWLEVEL);
446
+            $this->edebug('Auth method requested: '.($authtype ? $authtype : 'UNKNOWN'), self::DEBUG_LOWLEVEL);
447 447
             $this->edebug(
448
-                'Auth methods available on the server: ' . implode(',', $this->server_caps['AUTH']),
448
+                'Auth methods available on the server: '.implode(',', $this->server_caps['AUTH']),
449 449
                 self::DEBUG_LOWLEVEL
450 450
             );
451 451
 
452 452
             //If we have requested a specific auth type, check the server supports it before trying others
453 453
             if (!in_array($authtype, $this->server_caps['AUTH'])) {
454
-                $this->edebug('Requested auth method not available: ' . $authtype, self::DEBUG_LOWLEVEL);
454
+                $this->edebug('Requested auth method not available: '.$authtype, self::DEBUG_LOWLEVEL);
455 455
                 $authtype = null;
456 456
             }
457 457
 
@@ -469,7 +469,7 @@  discard block
 block discarded – undo
469 469
 
470 470
                     return false;
471 471
                 }
472
-                self::edebug('Auth method selected: ' . $authtype, self::DEBUG_LOWLEVEL);
472
+                self::edebug('Auth method selected: '.$authtype, self::DEBUG_LOWLEVEL);
473 473
             }
474 474
 
475 475
             if (!in_array($authtype, $this->server_caps['AUTH'])) {
@@ -489,7 +489,7 @@  discard block
 block discarded – undo
489 489
                 // Send encoded username and password
490 490
                 if (!$this->sendCommand(
491 491
                     'User & Password',
492
-                    base64_encode("\0" . $username . "\0" . $password),
492
+                    base64_encode("\0".$username."\0".$password),
493 493
                     235
494 494
                 )
495 495
                 ) {
@@ -517,7 +517,7 @@  discard block
 block discarded – undo
517 517
                 $challenge = base64_decode(substr($this->last_reply, 4));
518 518
 
519 519
                 // Build the response
520
-                $response = $username . ' ' . $this->hmac($challenge, $password);
520
+                $response = $username.' '.$this->hmac($challenge, $password);
521 521
 
522 522
                 // send encoded credentials
523 523
                 return $this->sendCommand('Username', base64_encode($response), 235);
@@ -529,7 +529,7 @@  discard block
 block discarded – undo
529 529
                 $oauth = $OAuth->getOauth64();
530 530
 
531 531
                 // Start authentication
532
-                if (!$this->sendCommand('AUTH', 'AUTH XOAUTH2 ' . $oauth, 235)) {
532
+                if (!$this->sendCommand('AUTH', 'AUTH XOAUTH2 '.$oauth, 235)) {
533 533
                     return false;
534 534
                 }
535 535
                 break;
@@ -576,7 +576,7 @@  discard block
 block discarded – undo
576 576
         $k_ipad = $key ^ $ipad;
577 577
         $k_opad = $key ^ $opad;
578 578
 
579
-        return md5($k_opad . pack('H*', md5($k_ipad . $data)));
579
+        return md5($k_opad.pack('H*', md5($k_ipad.$data)));
580 580
     }
581 581
 
582 582
     /**
@@ -691,7 +691,7 @@  discard block
 block discarded – undo
691 691
                 }
692 692
                 //If processing headers add a LWSP-char to the front of new line RFC822 section 3.1.1
693 693
                 if ($in_headers) {
694
-                    $line = "\t" . $line;
694
+                    $line = "\t".$line;
695 695
                 }
696 696
             }
697 697
             $lines_out[] = $line;
@@ -700,9 +700,9 @@  discard block
 block discarded – undo
700 700
             foreach ($lines_out as $line_out) {
701 701
                 //RFC2821 section 4.5.2
702 702
                 if (!empty($line_out) and $line_out[0] == '.') {
703
-                    $line_out = '.' . $line_out;
703
+                    $line_out = '.'.$line_out;
704 704
                 }
705
-                $this->client_send($line_out . static::LE, 'DATA');
705
+                $this->client_send($line_out.static::LE, 'DATA');
706 706
             }
707 707
         }
708 708
 
@@ -748,7 +748,7 @@  discard block
 block discarded – undo
748 748
      */
749 749
     protected function sendHello($hello, $host)
750 750
     {
751
-        $noerror = $this->sendCommand($hello, $hello . ' ' . $host, 250);
751
+        $noerror = $this->sendCommand($hello, $hello.' '.$host, 250);
752 752
         $this->helo_rply = $this->last_reply;
753 753
         if ($noerror) {
754 754
             $this->parseHelloFields($hello);
@@ -819,7 +819,7 @@  discard block
 block discarded – undo
819 819
 
820 820
         return $this->sendCommand(
821 821
             'MAIL FROM',
822
-            'MAIL FROM:<' . $from . '>' . $useVerp,
822
+            'MAIL FROM:<'.$from.'>'.$useVerp,
823 823
             250
824 824
         );
825 825
     }
@@ -859,7 +859,7 @@  discard block
 block discarded – undo
859 859
     {
860 860
         return $this->sendCommand(
861 861
             'RCPT TO',
862
-            'RCPT TO:<' . $address . '>',
862
+            'RCPT TO:<'.$address.'>',
863 863
             [250, 251]
864 864
         );
865 865
     }
@@ -898,7 +898,7 @@  discard block
 block discarded – undo
898 898
 
899 899
             return false;
900 900
         }
901
-        $this->client_send($commandstring . static::LE, $command);
901
+        $this->client_send($commandstring.static::LE, $command);
902 902
 
903 903
         $this->last_reply = $this->get_lines();
904 904
         // Fetch SMTP code and possible error code explanation
@@ -908,8 +908,8 @@  discard block
 block discarded – undo
908 908
             $code_ex = (count($matches) > 2 ? $matches[2] : null);
909 909
             // Cut off error code from each response line
910 910
             $detail = preg_replace(
911
-                "/{$code}[ -]" .
912
-                ($code_ex ? str_replace('.', '\\.', $code_ex) . ' ' : '') . '/m',
911
+                "/{$code}[ -]".
912
+                ($code_ex ? str_replace('.', '\\.', $code_ex).' ' : '').'/m',
913 913
                 '',
914 914
                 $this->last_reply
915 915
             );
@@ -920,7 +920,7 @@  discard block
 block discarded – undo
920 920
             $detail = substr($this->last_reply, 4);
921 921
         }
922 922
 
923
-        $this->edebug('SERVER -> CLIENT: ' . $this->last_reply, self::DEBUG_SERVER);
923
+        $this->edebug('SERVER -> CLIENT: '.$this->last_reply, self::DEBUG_SERVER);
924 924
 
925 925
         if (!in_array($code, (array) $expect)) {
926 926
             $this->setError(
@@ -930,7 +930,7 @@  discard block
 block discarded – undo
930 930
                 $code_ex
931 931
             );
932 932
             $this->edebug(
933
-                'SMTP ERROR: ' . $this->error['error'] . ': ' . $this->last_reply,
933
+                'SMTP ERROR: '.$this->error['error'].': '.$this->last_reply,
934 934
                 self::DEBUG_CLIENT
935 935
             );
936 936
 
@@ -996,7 +996,7 @@  discard block
 block discarded – undo
996 996
     public function turn()
997 997
     {
998 998
         $this->setError('The SMTP TURN command is not implemented');
999
-        $this->edebug('SMTP NOTICE: ' . $this->error['error'], self::DEBUG_CLIENT);
999
+        $this->edebug('SMTP NOTICE: '.$this->error['error'], self::DEBUG_CLIENT);
1000 1000
 
1001 1001
         return false;
1002 1002
     }
@@ -1017,7 +1017,7 @@  discard block
 block discarded – undo
1017 1017
             in_array($command, ['User & Password', 'Username', 'Password'], true)) {
1018 1018
             $this->edebug('CLIENT -> SERVER: <credentials hidden>', self::DEBUG_CLIENT);
1019 1019
         } else {
1020
-            $this->edebug('CLIENT -> SERVER: ' . $data, self::DEBUG_CLIENT);
1020
+            $this->edebug('CLIENT -> SERVER: '.$data, self::DEBUG_CLIENT);
1021 1021
         }
1022 1022
         set_error_handler([$this, 'errorHandler']);
1023 1023
         $result = fwrite($this->smtp_conn, $data);
@@ -1123,14 +1123,14 @@  discard block
 block discarded – undo
1123 1123
             //Must pass vars in here as params are by reference
1124 1124
             if (!stream_select($selR, $selW, $selW, $this->Timelimit)) {
1125 1125
                 $this->edebug(
1126
-                    'SMTP -> get_lines(): timed-out (' . $this->Timeout . ' sec)',
1126
+                    'SMTP -> get_lines(): timed-out ('.$this->Timeout.' sec)',
1127 1127
                     self::DEBUG_LOWLEVEL
1128 1128
                 );
1129 1129
                 break;
1130 1130
             }
1131 1131
             //Deliberate noise suppression - errors are handled afterwards
1132 1132
             $str = @fgets($this->smtp_conn, 515);
1133
-            $this->edebug('SMTP INBOUND: "' . trim($str) . '"', self::DEBUG_LOWLEVEL);
1133
+            $this->edebug('SMTP INBOUND: "'.trim($str).'"', self::DEBUG_LOWLEVEL);
1134 1134
             $data .= $str;
1135 1135
             // If response is only 3 chars (not valid, but RFC5321 S4.2 says it must be handled),
1136 1136
             // or 4th character is a space, we are done reading, break the loop,
@@ -1142,7 +1142,7 @@  discard block
 block discarded – undo
1142 1142
             $info = stream_get_meta_data($this->smtp_conn);
1143 1143
             if ($info['timed_out']) {
1144 1144
                 $this->edebug(
1145
-                    'SMTP -> get_lines(): timed-out (' . $this->Timeout . ' sec)',
1145
+                    'SMTP -> get_lines(): timed-out ('.$this->Timeout.' sec)',
1146 1146
                     self::DEBUG_LOWLEVEL
1147 1147
                 );
1148 1148
                 break;
@@ -1150,8 +1150,8 @@  discard block
 block discarded – undo
1150 1150
             // Now check if reads took too long
1151 1151
             if ($endtime and time() > $endtime) {
1152 1152
                 $this->edebug(
1153
-                    'SMTP -> get_lines(): timelimit reached (' .
1154
-                    $this->Timelimit . ' sec)',
1153
+                    'SMTP -> get_lines(): timelimit reached ('.
1154
+                    $this->Timelimit.' sec)',
1155 1155
                     self::DEBUG_LOWLEVEL
1156 1156
                 );
1157 1157
                 break;
Please login to merge, or discard this patch.
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -888,7 +888,7 @@  discard block
 block discarded – undo
888 888
     protected function sendCommand($command, $commandstring, $expect)
889 889
     {
890 890
         if (!$this->connected()) {
891
-            $this->setError("Called $command without being connected");
891
+            $this->setError("called $command without being connected");
892 892
 
893 893
             return false;
894 894
         }
@@ -970,7 +970,7 @@  discard block
 block discarded – undo
970 970
      */
971 971
     public function verify($name)
972 972
     {
973
-        return $this->sendCommand('VRFY', "VRFY $name", [250, 251]);
973
+        return $this->sendCommand('VRFY', "vrfy $name", [250, 251]);
974 974
     }
975 975
 
976 976
     /**
Please login to merge, or discard this patch.