Completed
Push — develop ( cb7ecf...5e631f )
by Dmytro
17s
created
manager/media/style/default/ajax.php 1 patch
Braces   +74 added lines, -74 removed lines patch added patch discarded remove patch
@@ -7,11 +7,11 @@  discard block
 block discarded – undo
7 7
 
8 8
 $modx->getDatabase()->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->getDatabase()->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->getDatabase()->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->getDatabase()->getRecordCount($sql)) {
140
-                    if ($count == $limit) {
139
+                if ($count = $modx->getDatabase()->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->getDatabase()->getRow($sql)) {
144
-                        if (($row['disabled'] || $row['locked']) && $role != 1) {
143
+                    while ($row = $modx->getDatabase()->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
 
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
             $sqlLike = $filter ? 'WHERE t1.username LIKE "' . $modx->getDatabase()->escape($filter) . '%"' : '';
170 170
             $sqlLimit = $sqlLike ? '' : 'LIMIT ' . $limit;
171 171
 
172
-            if(!$modx->hasPermission('save_role')) {
172
+            if(!$modx->hasPermission('save_role')) {
173 173
                 $sqlLike .= $sqlLike ? ' AND ' : 'WHERE ';
174 174
                 $sqlLike .= 't2.role != 1';
175 175
             }
@@ -181,22 +181,22 @@  discard block
 block discarded – undo
181 181
 				ORDER BY t1.username ASC
182 182
 				' . $sqlLimit);
183 183
 
184
-            if ($modx->hasPermission('new_user')) {
184
+            if ($modx->hasPermission('new_user')) {
185 185
                 $output .= '<li><a id="a_11" href="index.php?a=11" target="main"><i class="fa fa-plus"></i>' . $_lang['new_user'] . '</a></li>';
186 186
             }
187 187
 
188
-            if ($count = $modx->getDatabase()->getRecordCount($sql)) {
189
-                if ($count == $limit) {
188
+            if ($count = $modx->getDatabase()->getRecordCount($sql)) {
189
+                if ($count == $limit) {
190 190
                     $output .= '<li class="item-input"><input type="text" name="filter" class="dropdown-item form-control form-control-sm" autocomplete="off" /></li>';
191 191
                 }
192
-                while ($row = $modx->getDatabase()->getRow($sql)) {
192
+                while ($row = $modx->getDatabase()->getRow($sql)) {
193 193
                     $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>';
194 194
                 }
195 195
             }
196 196
 
197
-            if (isset($_REQUEST['filter'])) {
197
+            if (isset($_REQUEST['filter'])) {
198 198
                 $output = $items;
199
-            } else {
199
+            } else {
200 200
                 $output .= $items;
201 201
             }
202 202
 
@@ -220,22 +220,22 @@  discard block
 block discarded – undo
220 220
 				ORDER BY t1.username ASC
221 221
 				' . $sqlLimit);
222 222
 
223
-            if ($modx->hasPermission('new_web_user')) {
223
+            if ($modx->hasPermission('new_web_user')) {
224 224
                 $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>';
225 225
             }
226 226
 
227
-            if ($count = $modx->getDatabase()->getRecordCount($sql)) {
228
-                if ($count == $limit) {
227
+            if ($count = $modx->getDatabase()->getRecordCount($sql)) {
228
+                if ($count == $limit) {
229 229
                     $output .= '<li class="item-input"><input type="text" name="filter" class="dropdown-item form-control form-control-sm" autocomplete="off" /></li>';
230 230
                 }
231
-                while ($row = $modx->getDatabase()->getRow($sql)) {
231
+                while ($row = $modx->getDatabase()->getRow($sql)) {
232 232
                     $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>';
233 233
                 }
234 234
             }
235 235
 
236
-            if (isset($_REQUEST['filter'])) {
236
+            if (isset($_REQUEST['filter'])) {
237 237
                 $output = $items;
238
-            } else {
238
+            } else {
239 239
                 $output .= $items;
240 240
             }
241 241
 
@@ -249,8 +249,8 @@  discard block
 block discarded – undo
249 249
             $type = isset($_REQUEST['type']) && is_scalar($_REQUEST['type']) ? $modx->getDatabase()->escape($_REQUEST['type']) : false;
250 250
             $contextmenu = '';
251 251
 
252
-            if ($role && $name && $type) {
253
-                switch ($type) {
252
+            if ($role && $name && $type) {
253
+                switch ($type) {
254 254
                     case 'Snippet':
255 255
                     case 'SnippetNoCache': {
256 256
 
@@ -259,7 +259,7 @@  discard block
 block discarded – undo
259 259
 						WHERE name="' . $name . '"
260 260
 						LIMIT 1');
261 261
 
262
-                        if ($modx->getDatabase()->getRecordCount($sql)) {
262
+                        if ($modx->getDatabase()->getRecordCount($sql)) {
263 263
                             $row = $modx->getDatabase()->getRow($sql);
264 264
                             $contextmenu = array(
265 265
                                 'header' => array(
@@ -270,13 +270,13 @@  discard block
 block discarded – undo
270 270
                                     'url' => "index.php?a=22&id=" . $row['id']
271 271
                                 )
272 272
                             );
273
-                            if (!empty($row['description'])) {
273
+                            if (!empty($row['description'])) {
274 274
                                 $contextmenu['seperator'] = '';
275 275
                                 $contextmenu['description'] = array(
276 276
                                     'innerHTML' => '<i class="fa fa-info"></i> ' . $row['description']
277 277
                                 );
278 278
                             }
279
-                        } else {
279
+                        } else {
280 280
                             $contextmenu = array(
281 281
                                 'header' => array(
282 282
                                     'innerHTML' => '<i class="fa fa-code"></i> ' . $name
@@ -297,7 +297,7 @@  discard block
 block discarded – undo
297 297
 						WHERE name="' . $name . '"
298 298
 						LIMIT 1');
299 299
 
300
-                        if ($modx->getDatabase()->getRecordCount($sql)) {
300
+                        if ($modx->getDatabase()->getRecordCount($sql)) {
301 301
                             $row = $modx->getDatabase()->getRow($sql);
302 302
                             $contextmenu = array(
303 303
                                 'header' => array(
@@ -308,13 +308,13 @@  discard block
 block discarded – undo
308 308
                                     'url' => "index.php?a=78&id=" . $row['id']
309 309
                                 )
310 310
                             );
311
-                            if (!empty($row['description'])) {
311
+                            if (!empty($row['description'])) {
312 312
                                 $contextmenu['seperator'] = '';
313 313
                                 $contextmenu['description'] = array(
314 314
                                     'innerHTML' => '<i class="fa fa-info"></i> ' . $row['description']
315 315
                                 );
316 316
                             }
317
-                        } else {
317
+                        } else {
318 318
                             $contextmenu = array(
319 319
                                 'header' => array(
320 320
                                     'innerHTML' => '<i class="fa fa-th-large"></i> ' . $name
@@ -334,7 +334,7 @@  discard block
 block discarded – undo
334 334
 						WHERE name="' . $name . '"
335 335
 						LIMIT 1');
336 336
 
337
-                        if ($modx->getDatabase()->getRecordCount($sql)) {
337
+                        if ($modx->getDatabase()->getRecordCount($sql)) {
338 338
                             $row = $modx->getDatabase()->getRow($sql);
339 339
                             $contextmenu = array(
340 340
                                 'header' => array(
@@ -345,20 +345,20 @@  discard block
 block discarded – undo
345 345
                                     'url' => "index.php?a=78&id=" . $row['id']
346 346
                                 )
347 347
                             );
348
-                            if (!empty($row['description'])) {
348
+                            if (!empty($row['description'])) {
349 349
                                 $contextmenu['seperator'] = '';
350 350
                                 $contextmenu['description'] = array(
351 351
                                     'innerHTML' => '<i class="fa fa-info"></i> ' . $row['description']
352 352
                                 );
353 353
                             }
354
-                        } else {
354
+                        } else {
355 355
 
356 356
                             $sql = $modx->getDatabase()->query('SELECT *
357 357
 							FROM ' . $modx->getFullTableName('site_snippets') . '
358 358
 							WHERE name="' . $name . '"
359 359
 							LIMIT 1');
360 360
 
361
-                            if ($modx->getDatabase()->getRecordCount($sql)) {
361
+                            if ($modx->getDatabase()->getRecordCount($sql)) {
362 362
                                 $row = $modx->getDatabase()->getRow($sql);
363 363
                                 $contextmenu = array(
364 364
                                     'header' => array(
@@ -369,13 +369,13 @@  discard block
 block discarded – undo
369 369
                                         'url' => "index.php?a=22&id=" . $row['id']
370 370
                                     )
371 371
                                 );
372
-                                if (!empty($row['description'])) {
372
+                                if (!empty($row['description'])) {
373 373
                                     $contextmenu['seperator'] = '';
374 374
                                     $contextmenu['description'] = array(
375 375
                                         'innerHTML' => '<i class="fa fa-info"></i> ' . $row['description']
376 376
                                     );
377 377
                                 }
378
-                            } else {
378
+                            } else {
379 379
                                 $contextmenu = array(
380 380
                                     'header' => array(
381 381
                                         'innerHTML' => '<i class="fa fa-code"></i> ' . $name
@@ -437,7 +437,7 @@  discard block
 block discarded – undo
437 437
                             'alias_visible'
438 438
                         );
439 439
 
440
-                        if (in_array($name, $default_field)) {
440
+                        if (in_array($name, $default_field)) {
441 441
                             return;
442 442
                         }
443 443
 
@@ -446,7 +446,7 @@  discard block
 block discarded – undo
446 446
 						WHERE name="' . $name . '"
447 447
 						LIMIT 1');
448 448
 
449
-                        if ($modx->getDatabase()->getRecordCount($sql)) {
449
+                        if ($modx->getDatabase()->getRecordCount($sql)) {
450 450
                             $row = $modx->getDatabase()->getRow($sql);
451 451
                             $contextmenu = array(
452 452
                                 'header' => array(
@@ -457,13 +457,13 @@  discard block
 block discarded – undo
457 457
                                     'url' => "index.php?a=301&id=" . $row['id']
458 458
                                 )
459 459
                             );
460
-                            if (!empty($row['description'])) {
460
+                            if (!empty($row['description'])) {
461 461
                                 $contextmenu['seperator'] = '';
462 462
                                 $contextmenu['description'] = array(
463 463
                                     'innerHTML' => '<i class="fa fa-info"></i> ' . $row['description']
464 464
                                 );
465 465
                             }
466
-                        } else {
466
+                        } else {
467 467
                             $contextmenu = array(
468 468
                                 'header' => array(
469 469
                                     'innerHTML' => '<i class="fa fa-list-alt"></i> ' . $name
@@ -488,13 +488,13 @@  discard block
 block discarded – undo
488 488
         case 'movedocument' : {
489 489
             $json = array();
490 490
 
491
-            if ($modx->hasPermission('new_document') && $modx->hasPermission('edit_document') && $modx->hasPermission('save_document')) {
491
+            if ($modx->hasPermission('new_document') && $modx->hasPermission('edit_document') && $modx->hasPermission('save_document')) {
492 492
                 $id = !empty($_REQUEST['id']) ? (int)$_REQUEST['id'] : '';
493 493
                 $parent = isset($_REQUEST['parent']) ? (int)$_REQUEST['parent'] : 0;
494 494
                 $menuindex = isset($_REQUEST['menuindex']) && is_scalar($_REQUEST['menuindex']) ? $_REQUEST['menuindex'] : 0;
495 495
 
496 496
                 // set parent
497
-                if ($id && $parent >= 0) {
497
+                if ($id && $parent >= 0) {
498 498
 
499 499
                     // find older parent
500 500
                     $parentOld = $modx->getDatabase()->getValue($modx->getDatabase()->select('parent', $modx->getFullTableName('site_content'), 'id=' . $id));
@@ -505,31 +505,31 @@  discard block
 block discarded – undo
505 505
                         'new_parent'  => $parent,
506 506
                     ]);
507 507
 
508
-                    if (is_array($eventOut) && count($eventOut) > 0) {
508
+                    if (is_array($eventOut) && count($eventOut) > 0) {
509 509
                         $eventParent = array_pop($eventOut);
510 510
 
511
-                        if ($eventParent == $parentOld) {
511
+                        if ($eventParent == $parentOld) {
512 512
                             $json['errors'] = $_lang['error_movedocument2'];
513
-                        } else {
513
+                        } else {
514 514
                             $parent = $eventParent;
515 515
                         }
516 516
                     }
517 517
 
518
-                    if (empty($json['errors'])) {
518
+                    if (empty($json['errors'])) {
519 519
                         // check privileges user for move docs
520
-                        if (!empty($modx->config['tree_show_protected']) && $role != 1) {
520
+                        if (!empty($modx->config['tree_show_protected']) && $role != 1) {
521 521
                             $sql = $modx->getDatabase()->select('*', $modx->getFullTableName('document_groups'), 'document IN(' . $id . ',' . $parent . ',' . $parentOld . ')');
522
-                            if ($modx->getDatabase()->getRecordCount($sql)) {
522
+                            if ($modx->getDatabase()->getRecordCount($sql)) {
523 523
                                 $document_groups = array();
524
-                                while ($row = $modx->getDatabase()->getRow($sql)) {
524
+                                while ($row = $modx->getDatabase()->getRow($sql)) {
525 525
                                     $document_groups[$row['document']]['groups'][] = $row['document_group'];
526 526
                                 }
527
-                                foreach ($document_groups as $key => $value) {
528
-                                    if (($key == $parent || $key == $parentOld || $key == $id) && !in_array($role, $value['groups'])) {
527
+                                foreach ($document_groups as $key => $value) {
528
+                                    if (($key == $parent || $key == $parentOld || $key == $id) && !in_array($role, $value['groups'])) {
529 529
                                         $json['errors'] = $_lang["error_no_privileges"];
530 530
                                     }
531 531
                                 }
532
-                                if ($json['errors']) {
532
+                                if ($json['errors']) {
533 533
                                     header('content-type: application/json');
534 534
                                     echo json_encode($json, JSON_FORCE_OBJECT | JSON_UNESCAPED_UNICODE);
535 535
                                     break;
@@ -537,9 +537,9 @@  discard block
 block discarded – undo
537 537
                             }
538 538
                         }
539 539
 
540
-                        if ($parent == 0 && $parent != $parentOld && !$modx->config['udperms_allowroot'] && $role != 1) {
540
+                        if ($parent == 0 && $parent != $parentOld && !$modx->config['udperms_allowroot'] && $role != 1) {
541 541
                             $json['errors'] = $_lang["error_no_privileges"];
542
-                        } else {
542
+                        } else {
543 543
                             // set new parent
544 544
                             $modx->getDatabase()->update(array(
545 545
                                 'parent' => $parent
@@ -549,13 +549,13 @@  discard block
 block discarded – undo
549 549
                                 'isfolder' => 1
550 550
                             ), $modx->getFullTableName('site_content'), 'id=' . $parent);
551 551
 
552
-                            if ($parent != $parentOld) {
552
+                            if ($parent != $parentOld) {
553 553
                                 // check children docs and set parent isfolder
554
-                                if ($modx->getDatabase()->getRecordCount($modx->getDatabase()->select('id', $modx->getFullTableName('site_content'), 'parent=' . $parentOld))) {
554
+                                if ($modx->getDatabase()->getRecordCount($modx->getDatabase()->select('id', $modx->getFullTableName('site_content'), 'parent=' . $parentOld))) {
555 555
                                     $modx->getDatabase()->update(array(
556 556
                                         'isfolder' => 1
557 557
                                     ), $modx->getFullTableName('site_content'), 'id=' . $parentOld);
558
-                                } else {
558
+                                } else {
559 559
                                     $modx->getDatabase()->update(array(
560 560
                                         'isfolder' => 0
561 561
                                     ), $modx->getFullTableName('site_content'), 'id=' . $parentOld);
@@ -563,16 +563,16 @@  discard block
 block discarded – undo
563 563
                             }
564 564
 
565 565
                             // set menuindex
566
-                            if (!empty($menuindex)) {
566
+                            if (!empty($menuindex)) {
567 567
                                 $menuindex = explode(',', $menuindex);
568
-                                foreach ($menuindex as $key => $value) {
568
+                                foreach ($menuindex as $key => $value) {
569 569
                                     $modx->getDatabase()->query('UPDATE ' . $modx->getFullTableName('site_content') . ' SET menuindex=' . $key . ' WHERE id=' . $value);
570 570
                                 }
571
-                            } else {
571
+                            } else {
572 572
                                 // TODO: max(*) menuindex
573 573
                             }
574 574
 
575
-                            if (!$json['errors']) {
575
+                            if (!$json['errors']) {
576 576
                                 $json['success'] = $_lang["actioncomplete"];
577 577
 
578 578
                                 $modx->invokeEvent('onAfterMoveDocument', [
@@ -584,7 +584,7 @@  discard block
 block discarded – undo
584 584
                         }
585 585
                     }
586 586
                 }
587
-            } else {
587
+            } else {
588 588
                 $json['errors'] = $_lang["error_no_privileges"];
589 589
             }
590 590
 
@@ -600,7 +600,7 @@  discard block
 block discarded – undo
600 600
 
601 601
             $output = !!$modx->elementIsLocked($type, $id, true);
602 602
 
603
-            if (!$output) {
603
+            if (!$output) {
604 604
                 $docgrp = (isset($_SESSION['mgrDocgroups']) && is_array($_SESSION['mgrDocgroups'])) ? implode(',', $_SESSION['mgrDocgroups']) : '';
605 605
                 $docgrp_cond = $docgrp ? ' OR dg.document_group IN (' . $docgrp . ')' : '';
606 606
                 $sql = '
@@ -609,7 +609,7 @@  discard block
 block discarded – undo
609 609
                     LEFT JOIN ' . $modx->getFullTableName('document_groups') . ' dg ON dg.document=sc.id
610 610
                     WHERE sc.id=' . $id . ' GROUP BY sc.id';
611 611
                 $sql = $modx->getDatabase()->query($sql);
612
-                if ($modx->getDatabase()->getRecordCount($sql)) {
612
+                if ($modx->getDatabase()->getRecordCount($sql)) {
613 613
                     $row = $modx->getDatabase()->getRow($sql);
614 614
                     $output = !!$row['locked'];
615 615
                 }
Please login to merge, or discard this patch.
manager/frames/tree.php 1 patch
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@  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
 // invoke OnManagerTreeInit event
7 7
 $evtOut = $modx->invokeEvent('OnManagerTreeInit', $_REQUEST);
8
-if(is_array($evtOut)) {
8
+if(is_array($evtOut)) {
9 9
 	echo implode("\n", $evtOut);
10 10
 }
11 11
 ?>
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 		<?php
55 55
 		// invoke OnManagerTreePrerender event
56 56
 		$evtOut = $modx->invokeEvent('OnManagerTreePrerender', $modx->getDatabase()->escape($_REQUEST));
57
-		if(is_array($evtOut)) {
57
+		if(is_array($evtOut)) {
58 58
 			echo implode("\n", $evtOut);
59 59
 		}
60 60
 		?>
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 		<?php
67 67
 		// invoke OnManagerTreeRender event
68 68
 		$evtOut = $modx->invokeEvent('OnManagerTreeRender', $modx->getDatabase()->escape($_REQUEST));
69
-		if(is_array($evtOut)) {
69
+		if(is_array($evtOut)) {
70 70
 			echo implode("\n", $evtOut);
71 71
 		}
72 72
 		?>
Please login to merge, or discard this patch.
manager/frames/1.php 1 patch
Braces   +32 added lines, -29 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  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
 header("X-XSS-Protection: 0");
@@ -11,22 +11,22 @@  discard block
 block discarded – undo
11 11
 
12 12
 $mxla = $modx_lang_attribute ? $modx_lang_attribute : 'en';
13 13
 
14
-if (!isset($modx->config['manager_menu_height'])) {
14
+if (!isset($modx->config['manager_menu_height'])) {
15 15
     $modx->config['manager_menu_height'] = 2.2; // rem
16 16
 }
17 17
 
18
-if (!isset($modx->config['manager_tree_width'])) {
18
+if (!isset($modx->config['manager_tree_width'])) {
19 19
     $modx->config['manager_tree_width'] = 20; // rem
20 20
 }
21 21
 
22
-if (isset($_SESSION['onLoginForwardToAction']) && is_int($_SESSION['onLoginForwardToAction'])) {
22
+if (isset($_SESSION['onLoginForwardToAction']) && is_int($_SESSION['onLoginForwardToAction'])) {
23 23
     $initMainframeAction = $_SESSION['onLoginForwardToAction'];
24 24
     unset($_SESSION['onLoginForwardToAction']);
25
-} else {
25
+} else {
26 26
     $initMainframeAction = 2; // welcome.static
27 27
 }
28 28
 
29
-if (!isset($_SESSION['tree_show_only_folders'])) {
29
+if (!isset($_SESSION['tree_show_only_folders'])) {
30 30
     $_SESSION['tree_show_only_folders'] = 0;
31 31
 }
32 32
 
@@ -35,29 +35,29 @@  discard block
 block discarded – undo
35 35
 $tree_width = $modx->config['manager_tree_width'];
36 36
 $tree_min_width = 0;
37 37
 
38
-if (isset($_COOKIE['MODX_widthSideBar'])) {
38
+if (isset($_COOKIE['MODX_widthSideBar'])) {
39 39
     $MODX_widthSideBar = $_COOKIE['MODX_widthSideBar'];
40
-} else {
40
+} else {
41 41
     $MODX_widthSideBar = $tree_width;
42 42
 }
43 43
 
44
-if (!$MODX_widthSideBar) {
44
+if (!$MODX_widthSideBar) {
45 45
     $body_class .= 'sidebar-closed';
46 46
 }
47 47
 
48 48
 $theme_modes = array('', 'lightness', 'light', 'dark', 'darkness');
49
-if (!empty($theme_modes[$_COOKIE['MODX_themeMode']])) {
49
+if (!empty($theme_modes[$_COOKIE['MODX_themeMode']])) {
50 50
     $body_class .= ' ' . $theme_modes[$_COOKIE['MODX_themeMode']];
51
-} elseif (!empty($theme_modes[$modx->config['manager_theme_mode']])) {
51
+} elseif (!empty($theme_modes[$modx->config['manager_theme_mode']])) {
52 52
     $body_class .= ' ' . $theme_modes[$modx->config['manager_theme_mode']];
53 53
 }
54 54
 
55 55
 $navbar_position = $modx->config['manager_menu_position'];
56
-if ($navbar_position == 'left') {
56
+if ($navbar_position == 'left') {
57 57
     $body_class .= ' navbar-left navbar-left-icon-and-text';
58 58
 }
59 59
 
60
-if (isset($modx->pluginCache['ElementsInTree'])) {
60
+if (isset($modx->pluginCache['ElementsInTree'])) {
61 61
     $body_class .= ' ElementsInTree';
62 62
 }
63 63
 
@@ -73,19 +73,19 @@  discard block
 block discarded – undo
73 73
     'type8' => $_lang["lock_element_type_8"]
74 74
 );
75 75
 
76
-foreach ($unlockTranslations as $key => $value) {
76
+foreach ($unlockTranslations as $key => $value) {
77 77
     $unlockTranslations[$key] = iconv($modx->config["modx_charset"], "utf-8", $value);
78 78
 }
79 79
 
80 80
 $user = $modx->getUserInfo($modx->getLoginUserID());
81
-if ($user['which_browser'] == 'default') {
81
+if ($user['which_browser'] == 'default') {
82 82
     $user['which_browser'] = $modx->config['which_browser'];
83 83
 }
84 84
 
85 85
 $css = 'media/style/' . $modx->config['manager_theme'] . '/css/page.css?v=' . $lastInstallTime;
86 86
 
87
-if ($modx->config['manager_theme'] == 'default') {
88
-    if (!file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css') && is_writable(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css')) {
87
+if ($modx->config['manager_theme'] == 'default') {
88
+    if (!file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css') && is_writable(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css')) {
89 89
         require_once MODX_BASE_PATH . 'assets/lib/Formatter/CSSMinify.php';
90 90
         $minifier = new Formatter\CSSMinify();
91 91
         $minifier->addFile(MODX_MANAGER_PATH . 'media/style/common/bootstrap/css/bootstrap.min.css');
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
         $css = $minifier->minify();
103 103
         file_put_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css', $css);
104 104
     }
105
-    if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) {
105
+    if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) {
106 106
         $css = 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css?v=' . $lastInstallTime;
107 107
     }
108 108
 }
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
     <?php
258 258
     // invoke OnManagerTopPrerender event
259 259
     $evtOut = $modx->invokeEvent('OnManagerTopPrerender', $_REQUEST);
260
-    if (is_array($evtOut)) {
260
+    if (is_array($evtOut)) {
261 261
         echo implode("\n", $evtOut);
262 262
     }
263 263
     ?>
@@ -428,11 +428,14 @@  discard block
 block discarded – undo
428 428
             <div id="evo-tab-page-home" class="evo-tab-page show iframe-scroller">
429 429
                 <iframe id="mainframe" src="index.php?a=<?= $initMainframeAction ?>" scrolling="auto" frameborder="0" onload="modx.main.onload(event);"></iframe>
430 430
             </div>
431
-        <?php else: ?>
431
+        <?php else {
432
+    : ?>
432 433
             <div class="iframe-scroller">
433 434
                 <iframe id="mainframe" name="main" src="index.php?a=<?= $initMainframeAction ?>" scrolling="auto" frameborder="0" onload="modx.main.onload(event);"></iframe>
434 435
             </div>
435
-        <?php endif; ?>
436
+        <?php endif;
437
+}
438
+?>
436 439
         <script>
437 440
             if (/iPhone|iPad|iPod/i.test(navigator.userAgent)) {
438 441
                 document.getElementById('mainframe').setAttribute('scrolling', 'no');
@@ -451,11 +454,11 @@  discard block
 block discarded – undo
451 454
             'tree_sortdir',
452 455
             'tree_nodename'
453 456
         );
454
-        foreach ($sortParams as $param) {
455
-            if (isset($_REQUEST[$param])) {
457
+        foreach ($sortParams as $param) {
458
+            if (isset($_REQUEST[$param])) {
456 459
                 $modx->getManagerApi()->saveLastUserSetting($param, $_REQUEST[$param]);
457 460
                 $_SESSION[$param] = $_REQUEST[$param];
458
-            } else if (!isset($_SESSION[$param])) {
461
+            } else if (!isset($_SESSION[$param])) {
459 462
                 $_SESSION[$param] = $modx->getManagerApi()->getLastUserSetting($param);
460 463
             }
461 464
         }
@@ -506,16 +509,16 @@  discard block
 block discarded – undo
506 509
     </div>
507 510
 
508 511
     <?php
509
-    if(!function_exists('constructLink')) {
512
+    if(!function_exists('constructLink')) {
510 513
         /**
511 514
          * @param string $action
512 515
          * @param string $img
513 516
          * @param string $text
514 517
          * @param bool $allowed
515 518
          */
516
-        function constructLink($action, $img, $text, $allowed)
517
-        {
518
-            if ((bool)$allowed) {
519
+        function constructLink($action, $img, $text, $allowed)
520
+        {
521
+            if ((bool)$allowed) {
519 522
                 echo sprintf('<div class="menuLink" id="item%s" onclick="modx.tree.menuHandler(%s);">', $action,
520 523
                     $action);
521 524
                 echo sprintf('<i class="%s"></i> %s</div>', $img, $text);
@@ -650,7 +653,7 @@  discard block
 block discarded – undo
650 653
     ?>
651 654
 
652 655
 </div>
653
-<?php if ($modx->config['show_picker'] != "0") {
656
+<?php if ($modx->config['show_picker'] != "0") {
654 657
     include('media/style/' . $modx->config['manager_theme'] . '/color.switcher.php');
655 658
 } ?>
656 659
 </body>
Please login to merge, or discard this patch.
manager/frames/mainmenu.php 1 patch
Braces   +35 added lines, -33 removed lines patch added patch discarded remove patch
@@ -32,7 +32,7 @@  discard block
 block discarded – undo
32 32
 	'active'
33 33
 );
34 34
 
35
-if($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('file_manager')) {
35
+if($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('file_manager')) {
36 36
 	$sitemenu['elements'] = array(
37 37
 		'elements',
38 38
 		'main',
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 	);
49 49
 }
50 50
 
51
-if($modx->hasPermission('exec_module')) {
51
+if($modx->hasPermission('exec_module')) {
52 52
 	$sitemenu['modules'] = array(
53 53
 		'modules',
54 54
 		'main',
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
 	);
65 65
 }
66 66
 
67
-if($modx->hasPermission('edit_user') || $modx->hasPermission('edit_web_user') || $modx->hasPermission('edit_role') || $modx->hasPermission('access_permissions') || $modx->hasPermission('web_access_permissions')) {
67
+if($modx->hasPermission('edit_user') || $modx->hasPermission('edit_web_user') || $modx->hasPermission('edit_role') || $modx->hasPermission('access_permissions') || $modx->hasPermission('web_access_permissions')) {
68 68
 	$sitemenu['users'] = array(
69 69
 		'users',
70 70
 		'main',
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 	);
81 81
 }
82 82
 
83
-if($modx->hasPermission('empty_cache') || $modx->hasPermission('bk_manager') || $modx->hasPermission('remove_locks') || $modx->hasPermission('import_static') || $modx->hasPermission('export_static')) {
83
+if($modx->hasPermission('empty_cache') || $modx->hasPermission('bk_manager') || $modx->hasPermission('remove_locks') || $modx->hasPermission('import_static') || $modx->hasPermission('export_static')) {
84 84
 	$sitemenu['tools'] = array(
85 85
 		'tools',
86 86
 		'main',
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
 }
98 98
 
99 99
 $tab = 0;
100
-if($modx->hasPermission('edit_template')) {
100
+if($modx->hasPermission('edit_template')) {
101 101
 	$sitemenu['element_templates'] = array(
102 102
 		'element_templates',
103 103
 		'elements',
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 		'dropdown-toggle'
113 113
 	);
114 114
 }
115
-if($modx->hasPermission('edit_template') && $modx->hasPermission('edit_snippet') && $modx->hasPermission('edit_chunk') && $modx->hasPermission('edit_plugin')) {
115
+if($modx->hasPermission('edit_template') && $modx->hasPermission('edit_snippet') && $modx->hasPermission('edit_chunk') && $modx->hasPermission('edit_plugin')) {
116 116
 	$sitemenu['element_tplvars'] = array(
117 117
 		'element_tplvars',
118 118
 		'elements',
@@ -127,7 +127,7 @@  discard block
 block discarded – undo
127 127
 		'dropdown-toggle'
128 128
 	);
129 129
 }
130
-if($modx->hasPermission('edit_chunk')) {
130
+if($modx->hasPermission('edit_chunk')) {
131 131
 	$sitemenu['element_htmlsnippets'] = array(
132 132
 		'element_htmlsnippets',
133 133
 		'elements',
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 		'dropdown-toggle'
143 143
 	);
144 144
 }
145
-if($modx->hasPermission('edit_snippet')) {
145
+if($modx->hasPermission('edit_snippet')) {
146 146
 	$sitemenu['element_snippets'] = array(
147 147
 		'element_snippets',
148 148
 		'elements',
@@ -157,7 +157,7 @@  discard block
 block discarded – undo
157 157
 		'dropdown-toggle'
158 158
 	);
159 159
 }
160
-if($modx->hasPermission('edit_plugin')) {
160
+if($modx->hasPermission('edit_plugin')) {
161 161
 	$sitemenu['element_plugins'] = array(
162 162
 		'element_plugins',
163 163
 		'elements',
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
 }
175 175
 //$sitemenu['element_categories']     = array('element_categories','elements',$_lang['element_categories'],'index.php?a=76&tab=5',$_lang['element_categories'],'','new_template,edit_template,new_snippet,edit_snippet,new_chunk,edit_chunk,new_plugin,edit_plugin','main',1,60,'');
176 176
 
177
-if($modx->hasPermission('file_manager')) {
177
+if($modx->hasPermission('file_manager')) {
178 178
 	$sitemenu['manage_files'] = array(
179 179
 		'manage_files',
180 180
 		'elements',
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 		''
190 190
 	);
191 191
 }
192
-if($modx->hasPermission('category_manager')) {
192
+if($modx->hasPermission('category_manager')) {
193 193
 	$sitemenu['manage_categories'] = array(
194 194
 		'manage_categories',
195 195
 		'elements',
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
 }
207 207
 
208 208
 // Modules Menu Items
209
-if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module') || $modx->hasPermission('save_module')) {
209
+if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module') || $modx->hasPermission('save_module')) {
210 210
 	$sitemenu['new_module'] = array(
211 211
 		'new_module',
212 212
 		'modules',
@@ -222,19 +222,19 @@  discard block
 block discarded – undo
222 222
 	);
223 223
 }
224 224
 
225
-if($modx->hasPermission('exec_module')) {
226
-	if($_SESSION['mgrRole'] != 1 && !empty($modx->config['use_udperms'])) {
225
+if($modx->hasPermission('exec_module')) {
226
+	if($_SESSION['mgrRole'] != 1 && !empty($modx->config['use_udperms'])) {
227 227
 		$rs = $modx->getDatabase()->query('SELECT DISTINCT sm.id, sm.name, sm.icon, mg.member
228 228
 				FROM ' . $modx->getFullTableName('site_modules') . ' AS sm
229 229
 				LEFT JOIN ' . $modx->getFullTableName('site_module_access') . ' AS sma ON sma.module = sm.id
230 230
 				LEFT JOIN ' . $modx->getFullTableName('member_groups') . ' AS mg ON sma.usergroup = mg.user_group
231 231
                 WHERE (mg.member IS NULL OR mg.member = ' . $modx->getLoginUserID() . ') AND sm.disabled != 1 AND sm.locked != 1
232 232
                 ORDER BY sm.name');
233
-	} else {
233
+	} else {
234 234
 		$rs = $modx->getDatabase()->select('*', $modx->getFullTableName('site_modules'), 'disabled != 1', 'name');
235 235
 	}
236
-	if($modx->getDatabase()->getRecordCount($rs)) {
237
-	    while ($row = $modx->getDatabase()->getRow($rs)) {
236
+	if($modx->getDatabase()->getRecordCount($rs)) {
237
+	    while ($row = $modx->getDatabase()->getRow($rs)) {
238 238
             $sitemenu['module' . $row['id']] = array(
239 239
                 'module' . $row['id'],
240 240
                 'modules',
@@ -254,7 +254,7 @@  discard block
 block discarded – undo
254 254
 
255 255
 // security menu items (users)
256 256
 
257
-if($modx->hasPermission('edit_user')) {
257
+if($modx->hasPermission('edit_user')) {
258 258
 	$sitemenu['user_management_title'] = array(
259 259
 		'user_management_title',
260 260
 		'users',
@@ -270,7 +270,7 @@  discard block
 block discarded – undo
270 270
 	);
271 271
 }
272 272
 
273
-if($modx->hasPermission('edit_web_user')) {
273
+if($modx->hasPermission('edit_web_user')) {
274 274
 	$sitemenu['web_user_management_title'] = array(
275 275
 		'web_user_management_title',
276 276
 		'users',
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
 	);
287 287
 }
288 288
 
289
-if($modx->hasPermission('edit_role')) {
289
+if($modx->hasPermission('edit_role')) {
290 290
 	$sitemenu['role_management_title'] = array(
291 291
 		'role_management_title',
292 292
 		'users',
@@ -302,7 +302,7 @@  discard block
 block discarded – undo
302 302
 	);
303 303
 }
304 304
 
305
-if($modx->hasPermission('access_permissions')) {
305
+if($modx->hasPermission('access_permissions')) {
306 306
 	$sitemenu['manager_permissions'] = array(
307 307
 		'manager_permissions',
308 308
 		'users',
@@ -318,7 +318,7 @@  discard block
 block discarded – undo
318 318
 	);
319 319
 }
320 320
 
321
-if($modx->hasPermission('web_access_permissions')) {
321
+if($modx->hasPermission('web_access_permissions')) {
322 322
 	$sitemenu['web_permissions'] = array(
323 323
 		'web_permissions',
324 324
 		'users',
@@ -374,7 +374,7 @@  discard block
 block discarded – undo
374 374
 	''
375 375
 );
376 376
 
377
-if($modx->hasPermission('bk_manager')) {
377
+if($modx->hasPermission('bk_manager')) {
378 378
 	$sitemenu['bk_manager'] = array(
379 379
 		'bk_manager',
380 380
 		'tools',
@@ -390,7 +390,7 @@  discard block
 block discarded – undo
390 390
 	);
391 391
 }
392 392
 
393
-if($modx->hasPermission('remove_locks')) {
393
+if($modx->hasPermission('remove_locks')) {
394 394
 	$sitemenu['remove_locks'] = array(
395 395
 		'remove_locks',
396 396
 		'tools',
@@ -406,7 +406,7 @@  discard block
 block discarded – undo
406 406
 	);
407 407
 }
408 408
 
409
-if($modx->hasPermission('import_static')) {
409
+if($modx->hasPermission('import_static')) {
410 410
 	$sitemenu['import_site'] = array(
411 411
 		'import_site',
412 412
 		'tools',
@@ -422,7 +422,7 @@  discard block
 block discarded – undo
422 422
 	);
423 423
 }
424 424
 
425
-if($modx->hasPermission('export_static')) {
425
+if($modx->hasPermission('export_static')) {
426 426
 	$sitemenu['export_site'] = array(
427 427
 		'export_site',
428 428
 		'tools',
@@ -439,19 +439,21 @@  discard block
 block discarded – undo
439 439
 }
440 440
 
441 441
 $menu = $modx->invokeEvent("OnManagerMenuPrerender", array('menu' => $sitemenu));
442
-if(is_array($menu)) {
442
+if(is_array($menu)) {
443 443
 	$newmenu = array();
444
-	foreach($menu as $item){
445
-		if(is_array(unserialize($item))){
444
+	foreach($menu as $item) {
445
+		if(is_array(unserialize($item))) {
446 446
 			$newmenu = array_merge($newmenu, unserialize($item));
447 447
 		}
448 448
 	}
449
-	if(count($newmenu)> 0) $sitemenu = $newmenu;
450
-}
449
+	if(count($newmenu)> 0) {
450
+	    $sitemenu = $newmenu;
451
+	}
452
+	}
451 453
 
452
-if(file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/includes/menu.class.inc.php')) {
454
+if(file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/includes/menu.class.inc.php')) {
453 455
 	include_once(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/includes/menu.class.inc.php');
454
-} else {
456
+} else {
455 457
 	include_once(MODX_MANAGER_PATH . 'includes/menu.class.inc.php');
456 458
 }
457 459
 $menu = new EVOmenu();
Please login to merge, or discard this patch.
manager/actions/mutate_content.dynamic.php 1 patch
Braces   +10 added lines, -4 removed lines patch added patch discarded remove patch
@@ -476,7 +476,8 @@  discard block
 block discarded – undo
476 476
 			return s;
477 477
 		}
478 478
 
479
-		<?php if ($content['type'] == 'reference' || $modx->getManagerApi()->action == '72') { // Web Link specific ?>
479
+		<?php if ($content['type'] == 'reference' || $modx->getManagerApi()->action == '72') {
480
+// Web Link specific ?>
480 481
 		var lastImageCtrl;
481 482
 		var lastFileCtrl;
482 483
 
@@ -692,7 +693,8 @@  discard block
 block discarded – undo
692 693
 									</td>
693 694
 								</tr>
694 695
 
695
-								<?php if($content['type'] == 'reference' || $modx->getManagerApi()->action == '72') { // Web Link specific ?>
696
+								<?php if($content['type'] == 'reference' || $modx->getManagerApi()->action == '72') {
697
+// Web Link specific ?>
696 698
 
697 699
 									<tr>
698 700
 										<td><span class="warning"><?= $_lang['weblink'] ?></span>
@@ -1370,7 +1372,9 @@  discard block
 block discarded – undo
1370 1372
 						if($documentId > 0) {
1371 1373
 							// Load up, the permissions from the parent (if new document) or existing document
1372 1374
 							$rs = $modx->getDatabase()->select('id, document_group', $tbl_document_groups, "document='{$documentId}'");
1373
-							while($currentgroup = $modx->getDatabase()->getRow($rs)) $groupsarray[] = $currentgroup['document_group'] . ',' . $currentgroup['id'];
1375
+							while($currentgroup = $modx->getDatabase()->getRow($rs)) {
1376
+							    $groupsarray[] = $currentgroup['document_group'] . ',' . $currentgroup['id'];
1377
+							}
1374 1378
 
1375 1379
 							// Load up the current permissions and names
1376 1380
 							$vs = array(
@@ -1432,7 +1436,9 @@  discard block
 block discarded – undo
1432 1436
 
1433 1437
 							// Create attribute string list
1434 1438
 							$inputString = array();
1435
-							foreach($inputAttributes as $k => $v) $inputString[] = $k . '="' . $v . '"';
1439
+							foreach($inputAttributes as $k => $v) {
1440
+							    $inputString[] = $k . '="' . $v . '"';
1441
+							}
1436 1442
 
1437 1443
 							// Make the <input> HTML
1438 1444
 							$inputHTML = '<input ' . implode(' ', $inputString) . ' />';
Please login to merge, or discard this patch.
manager/actions/sysinfo.static.php 1 patch
Braces   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,8 +1,8 @@  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
-if (!$modx->hasPermission('logs')) {
5
+if (!$modx->hasPermission('logs')) {
6 6
     $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
                 <table class="table data table-sm nowrap">
56 56
                     <tbody>
57 57
                     <?php
58
-                    foreach ($serverArr as $key => $value) {
58
+                    foreach ($serverArr as $key => $value) {
59 59
                         ?>
60 60
                         <tr>
61 61
                             <td width="1%"><?= $key ?></td>
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
                     $sql = "SHOW TABLE STATUS FROM $dbase LIKE '" . $modx->getDatabase()->escape($modx->getDatabase()->config['table_prefix']) . "%';";
99 99
                     $rs = $modx->getDatabase()->query($sql);
100 100
                     $i = 0;
101
-                    while ($log_status = $modx->getDatabase()->getRow($rs)) {
101
+                    while ($log_status = $modx->getDatabase()->getRow($rs)) {
102 102
                         ?>
103 103
                         <tr>
104 104
                             <td class="text-primary"><b><?= $log_status['Name'] ?></b></td>
@@ -110,17 +110,17 @@  discard block
 block discarded – undo
110 110
                                 $modx->getDatabase()->config['table_prefix'] . 'event_log',
111 111
                                 $modx->getDatabase()->config['table_prefix'] . 'manager_log',
112 112
                             );
113
-                            if ($modx->hasPermission('settings') && in_array($log_status['Name'], $truncateable)) {
113
+                            if ($modx->hasPermission('settings') && in_array($log_status['Name'], $truncateable)) {
114 114
                                 echo "<td class=\"text-xs-right\">";
115 115
                                 echo "<a class=\"text-danger\" href='index.php?a=54&mode=$action&u=" . $log_status['Name'] . "' title='" . $_lang['truncate_table'] . "'>" . $modx->nicesize($log_status['Data_length'] + $log_status['Data_free']) . "</a>";
116 116
                                 echo "</td>";
117
-                            } else {
117
+                            } else {
118 118
                                 echo "<td class=\"text-xs-right\">" . $modx->nicesize($log_status['Data_length'] + $log_status['Data_free']) . "</td>";
119 119
                             }
120 120
 
121
-                            if ($modx->hasPermission('settings')) {
121
+                            if ($modx->hasPermission('settings')) {
122 122
                                 echo "<td class=\"text-xs-right\">" . ($log_status['Data_free'] > 0 ? "<a class=\"text-danger\" href='index.php?a=54&mode=$action&t=" . $log_status['Name'] . "' title='" . $_lang['optimize_table'] . "' ><span>" . $modx->nicesize($log_status['Data_free']) . "</span></a>" : "-") . "</td>";
123
-                            } else {
123
+                            } else {
124 124
                                 echo "<td class=\"text-xs-right\">" . ($log_status['Data_free'] > 0 ? $modx->nicesize($log_status['Data_free']) : "-") . "</td>";
125 125
                             }
126 126
                             ?>
Please login to merge, or discard this patch.
manager/actions/mutate_web_user.dynamic.php 1 patch
Braces   +27 added lines, -22 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@  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
-switch($modx->getManagerApi()->action) {
6
+switch($modx->getManagerApi()->action) {
7 7
 	case 88:
8
-		if(!$modx->hasPermission('edit_web_user')) {
8
+		if(!$modx->hasPermission('edit_web_user')) {
9 9
 			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
10 10
 		}
11 11
 		break;
12 12
 	case 87:
13
-		if(!$modx->hasPermission('new_web_user')) {
13
+		if(!$modx->hasPermission('new_web_user')) {
14 14
 			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
15 15
 		}
16 16
 		break;
@@ -23,33 +23,35 @@  discard block
 block discarded – undo
23 23
 
24 24
 // check to see the snippet editor isn't locked
25 25
 $rs = $modx->getDatabase()->select('username', $modx->getFullTableName('active_users'), "action=88 AND id='{$user}' AND internalKey!='" . $modx->getLoginUserID() . "'");
26
-if($username = $modx->getDatabase()->getValue($rs)) {
26
+if($username = $modx->getDatabase()->getValue($rs)) {
27 27
 	$modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "web user"));
28 28
 }
29 29
 // end check for lock
30 30
 
31
-if($modx->getManagerApi()->action == '88') {
31
+if($modx->getManagerApi()->action == '88') {
32 32
 	// get user attributes
33 33
 	$rs = $modx->getDatabase()->select('*', $modx->getFullTableName('web_user_attributes'), "internalKey = '{$user}'");
34 34
 	$userdata = $modx->getDatabase()->getRow($rs);
35
-	if(!$userdata) {
35
+	if(!$userdata) {
36 36
 		$modx->webAlertAndQuit("No user returned!");
37 37
 	}
38 38
 
39 39
 	// get user settings
40 40
 	$rs = $modx->getDatabase()->select('*', $modx->getFullTableName('web_user_settings'), "webuser = '{$user}'");
41 41
 	$usersettings = array();
42
-	while($row = $modx->getDatabase()->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value'];
42
+	while($row = $modx->getDatabase()->getRow($rs)) {
43
+	    $usersettings[$row['setting_name']] = $row['setting_value'];
44
+	}
43 45
 	extract($usersettings, EXTR_OVERWRITE);
44 46
 
45 47
 	// get user name
46 48
 	$rs = $modx->getDatabase()->select('*', $modx->getFullTableName('web_users'), "id = '{$user}'");
47 49
 	$usernamedata = $modx->getDatabase()->getRow($rs);
48
-	if(!$usernamedata) {
50
+	if(!$usernamedata) {
49 51
 		$modx->webAlertAndQuit("No user returned while getting username!");
50 52
 	}
51 53
 	$_SESSION['itemname'] = $usernamedata['username'];
52
-} else {
54
+} else {
53 55
 	$userdata = array();
54 56
 	$usersettings = array();
55 57
 	$usernamedata = array();
@@ -57,14 +59,14 @@  discard block
 block discarded – undo
57 59
 }
58 60
 
59 61
 // avoid doubling htmlspecialchars (already encoded in DB)
60
-foreach($userdata as $key => $val) {
62
+foreach($userdata as $key => $val) {
61 63
 	$userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']);
62 64
 };
63 65
 $usernamedata['username'] = html_entity_decode($usernamedata['username'], ENT_NOQUOTES, $modx->config['modx_charset']);
64 66
 
65 67
 // restore saved form
66 68
 $formRestored = false;
67
-if($modx->getManagerApi()->hasFormValues()) {
69
+if($modx->getManagerApi()->hasFormValues()) {
68 70
 	$modx->getManagerApi()->loadFormValues();
69 71
 	// restore post values
70 72
 	$userdata = array_merge($userdata, $_POST);
@@ -78,9 +80,9 @@  discard block
 block discarded – undo
78 80
 
79 81
 // include the country list language file
80 82
 $_country_lang = array();
81
-if($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) {
83
+if($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) {
82 84
 	include_once "lang/country/" . $manager_language . "_country.inc.php";
83
-} else {
85
+} else {
84 86
 	include_once "lang/country/english_country.inc.php";
85 87
 }
86 88
 asort($_country_lang);
@@ -191,7 +193,7 @@  discard block
 block discarded – undo
191 193
 	<?php
192 194
 	// invoke OnWUsrFormPrerender event
193 195
 	$evtOut = $modx->invokeEvent("OnWUsrFormPrerender", array("id" => $user));
194
-	if(is_array($evtOut)) {
196
+	if(is_array($evtOut)) {
195 197
 		echo implode("", $evtOut);
196 198
 	}
197 199
 	?>
@@ -324,7 +326,7 @@  discard block
 block discarded – undo
324 326
 								<?php $chosenCountry = isset($_POST['country']) ? $_POST['country'] : $userdata['country']; ?>
325 327
 								<option value="" <?php (!isset($chosenCountry) ? ' selected' : '') ?> >&nbsp;</option>
326 328
 								<?php
327
-								foreach($_country_lang as $key => $country) {
329
+								foreach($_country_lang as $key => $country) {
328 330
 									echo "<option value=\"$key\"" . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . ">$country</option>";
329 331
 								}
330 332
 								?>
@@ -496,17 +498,20 @@  discard block
 block discarded – undo
496 498
 				</table>
497 499
 			</div>
498 500
 			<?php
499
-			if($use_udperms == 1) {
501
+			if($use_udperms == 1) {
500 502
 
501 503
 			$groupsarray = array();
502 504
 
503
-			if($modx->getManagerApi()->action == '88') { // only do this bit if the user is being edited
505
+			if($modx->getManagerApi()->action == '88') {
506
+// only do this bit if the user is being edited
504 507
 				$rs = $modx->getDatabase()->select('webgroup', $modx->getFullTableName('web_groups'), "webuser='{$user}'");
505 508
 				$groupsarray = $modx->getDatabase()->getColumn('webgroup', $rs);
506 509
 			}
507 510
 			// retain selected user groups between post
508
-			if(is_array($_POST['user_groups'])) {
509
-				foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v;
511
+			if(is_array($_POST['user_groups'])) {
512
+				foreach($_POST['user_groups'] as $n => $v) {
513
+				    $groupsarray[] = $v;
514
+				}
510 515
 			}
511 516
 			?>
512 517
 			<div class="tab-page" id="tabPermissions">
@@ -515,7 +520,7 @@  discard block
 block discarded – undo
515 520
 				<p><?php echo $_lang['access_permissions_user_message'] ?></p>
516 521
 				<?php
517 522
 				$rs = $modx->getDatabase()->select('name, id', $modx->getFullTableName('webgroup_names'), '', 'name');
518
-				while($row = $modx->getDatabase()->getRow($rs)) {
523
+				while($row = $modx->getDatabase()->getRow($rs)) {
519 524
 					echo '<label><input type="checkbox" name="user_groups[]" value="' . $row['id'] . '"' . (in_array($row['id'], $groupsarray) ? ' checked="checked"' : '') . ' />' . $row['name'] . '</label><br />';
520 525
 				}
521 526
 				}
@@ -526,7 +531,7 @@  discard block
 block discarded – undo
526 531
 			$evtOut = $modx->invokeEvent("OnWUsrFormRender", array(
527 532
 				"id" => $user
528 533
 			));
529
-			if(is_array($evtOut)) {
534
+			if(is_array($evtOut)) {
530 535
 				echo implode("", $evtOut);
531 536
 			}
532 537
 			?>
Please login to merge, or discard this patch.
manager/actions/mutate_module.dynamic.php 1 patch
Braces   +20 added lines, -20 removed lines patch added patch discarded remove patch
@@ -1,15 +1,15 @@  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
-switch($modx->getManagerApi()->action) {
5
+switch($modx->getManagerApi()->action) {
6 6
 	case 107:
7
-		if(!$modx->hasPermission('new_module')) {
7
+		if(!$modx->hasPermission('new_module')) {
8 8
 			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
9 9
 		}
10 10
 		break;
11 11
 	case 108:
12
-		if(!$modx->hasPermission('edit_module')) {
12
+		if(!$modx->hasPermission('edit_module')) {
13 13
 			$modx->webAlertAndQuit($_lang["error_no_privileges"]);
14 14
 		}
15 15
 		break;
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 
32 32
 
33 33
 // check to see the module editor isn't locked
34
-if($lockedEl = $modx->elementIsLocked(6, $id)) {
34
+if($lockedEl = $modx->elementIsLocked(6, $id)) {
35 35
 	$modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['module']));
36 36
 }
37 37
 // end check for lock
@@ -39,22 +39,22 @@  discard block
 block discarded – undo
39 39
 // Lock snippet for other users to edit
40 40
 $modx->lockElement(6, $id);
41 41
 
42
-if(isset($_GET['id'])) {
42
+if(isset($_GET['id'])) {
43 43
 	$rs = $modx->getDatabase()->select('*', $tbl_site_modules, "id='{$id}'");
44 44
 	$content = $modx->getDatabase()->getRow($rs);
45
-	if(!$content) {
45
+	if(!$content) {
46 46
 		$modx->webAlertAndQuit("Module not found for id '{$id}'.");
47 47
 	}
48 48
 	$content['properties'] = str_replace("&", "&amp;", $content['properties']);
49 49
 	$_SESSION['itemname'] = $content['name'];
50
-	if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
50
+	if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) {
51 51
 		$modx->webAlertAndQuit($_lang["error_no_privileges"]);
52 52
 	}
53
-} else {
53
+} else {
54 54
 	$_SESSION['itemname'] = $_lang["new_module"];
55 55
 	$content['wrap'] = '1';
56 56
 }
57
-if($modx->getManagerApi()->hasFormValues()) {
57
+if($modx->getManagerApi()->hasFormValues()) {
58 58
 	$modx->getManagerApi()->loadFormValues();
59 59
 }
60 60
 
@@ -428,7 +428,7 @@  discard block
 block discarded – undo
428 428
 	<?php
429 429
 	// invoke OnModFormPrerender event
430 430
 	$evtOut = $modx->invokeEvent('OnModFormPrerender', array('id' => $id));
431
-	if(is_array($evtOut)) {
431
+	if(is_array($evtOut)) {
432 432
 		echo implode('', $evtOut);
433 433
 	}
434 434
 
@@ -491,7 +491,7 @@  discard block
 block discarded – undo
491 491
 								<option>&nbsp;</option>
492 492
 								<?php
493 493
 								include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php');
494
-								foreach(getCategories() as $n => $v) {
494
+								foreach(getCategories() as $n => $v) {
495 495
 									echo "\t\t\t" . '<option value="' . $v['id'] . '"' . ($content['category'] == $v['id'] ? ' selected="selected"' : '') . '>' . $modx->getPhpCompat()->htmlspecialchars($v['category']) . "</option>\n";
496 496
 								}
497 497
 								?>
@@ -643,7 +643,7 @@  discard block
 block discarded – undo
643 643
 					$rs = $modx->getDatabase()->select('usergroup', $tbl_site_module_access, "module='{$id}'");
644 644
 					$groupsarray = $modx->getDatabase()->getColumn('usergroup', $rs);
645 645
 
646
-					if($modx->hasPermission('access_permissions')) {
646
+					if($modx->hasPermission('access_permissions')) {
647 647
 						?>
648 648
 						<!-- User Group Access Permissions -->
649 649
 						<script type="text/javascript">
@@ -671,21 +671,21 @@  discard block
 block discarded – undo
671 671
 					}
672 672
 					$chk = '';
673 673
 					$rs = $modx->getDatabase()->select('name, id', $tbl_membergroup_names, '', 'name');
674
-					while($row = $modx->getDatabase()->getRow($rs)) {
674
+					while($row = $modx->getDatabase()->getRow($rs)) {
675 675
 						$groupsarray = is_numeric($id) && $id > 0 ? $groupsarray : array();
676 676
 						$checked = in_array($row['id'], $groupsarray);
677
-						if($modx->hasPermission('access_permissions')) {
678
-							if($checked) {
677
+						if($modx->hasPermission('access_permissions')) {
678
+							if($checked) {
679 679
 								$notPublic = true;
680 680
 							}
681 681
 							$chks .= '<label><input type="checkbox" name="usrgroups[]" value="' . $row['id'] . '"' . ($checked ? ' checked="checked"' : '') . ' onclick="makePublic(false)" /> ' . $row['name'] . "</label><br />\n";
682
-						} else {
683
-							if($checked) {
682
+						} else {
683
+							if($checked) {
684 684
 								$chks = '<input type="hidden" name="usrgroups[]"  value="' . $row['id'] . '" />' . "\n" . $chks;
685 685
 							}
686 686
 						}
687 687
 					}
688
-					if($modx->hasPermission('access_permissions')) {
688
+					if($modx->hasPermission('access_permissions')) {
689 689
 						$chks = '<label><input type="checkbox" name="chkallgroups"' . (!$notPublic ? ' checked="checked"' : '') . ' onclick="makePublic(true)" /><span class="warning"> ' . $_lang['all_usr_groups'] . '</span></label><br />' . "\n" . $chks;
690 690
 					}
691 691
 					echo $chks;
@@ -707,7 +707,7 @@  discard block
 block discarded – undo
707 707
 		<?php
708 708
 		// invoke OnModFormRender event
709 709
 		$evtOut = $modx->invokeEvent('OnModFormRender', array('id' => $id));
710
-		if(is_array($evtOut)) {
710
+		if(is_array($evtOut)) {
711 711
 			echo implode('', $evtOut);
712 712
 		}
713 713
 		?>
Please login to merge, or discard this patch.
manager/actions/mutate_settings.dynamic.php 1 patch
Braces   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,14 +1,14 @@  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 />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5
-if(!$modx->hasPermission('settings')) {
5
+if(!$modx->hasPermission('settings')) {
6 6
 	$modx->webAlertAndQuit($_lang['error_no_privileges']);
7 7
 }
8 8
 
9 9
 // check to see the edit settings page isn't locked
10 10
 $rs = $modx->getDatabase()->select('username', $modx->getFullTableName('active_users'), "action=17 AND internalKey!='" . $modx->getLoginUserID() . "'");
11
-if($username = $modx->getDatabase()->getValue($rs)) {
11
+if($username = $modx->getDatabase()->getValue($rs)) {
12 12
 	$modx->webAlertAndQuit(sprintf($_lang['lock_settings_msg'], $username));
13 13
 }
14 14
 // end check for lock
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 $settings = array();
19 19
 include_once(MODX_MANAGER_PATH . 'includes/default_config.php');
20 20
 $rs = $modx->getDatabase()->select('setting_name, setting_value', '[+prefix+]system_settings');
21
-while($row = $modx->getDatabase()->getRow($rs)) {
21
+while($row = $modx->getDatabase()->getRow($rs)) {
22 22
 	$settings[$row['setting_name']] = $row['setting_value'];
23 23
 }
24 24
 $settings['filemanager_path'] = preg_replace('@^' . preg_quote(MODX_BASE_PATH) . '@', '[(base_path)]', $settings['filemanager_path']);
@@ -29,8 +29,8 @@  discard block
 block discarded – undo
29 29
 // load languages and keys
30 30
 $lang_keys = array();
31 31
 $dir = dir('includes/lang');
32
-while($file = $dir->read()) {
33
-	if(strpos($file, '.inc.php') > 0) {
32
+while($file = $dir->read()) {
33
+	if(strpos($file, '.inc.php') > 0) {
34 34
 		$endpos = strpos($file, '.');
35 35
 		$languagename = substr($file, 0, $endpos);
36 36
 		$lang_keys[$languagename] = get_lang_keys($file);
@@ -129,6 +129,6 @@  discard block
 block discarded – undo
129 129
 		});
130 130
 	</script>
131 131
 <?php
132
-if(is_numeric($_GET['tab'])) {
132
+if(is_numeric($_GET['tab'])) {
133 133
 	echo '<script type="text/javascript">tpSettings.setSelectedIndex( ' . $_GET['tab'] . ' );</script>';
134 134
 }
Please login to merge, or discard this patch.