Completed
Push — develop ( d568f8...c061fc )
by Agel_Nash
06:25
created
manager/frames/tree.php 1 patch
Braces   +10 added lines, -10 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
 ?>
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 
18 18
 		<a class="treeButton" id="treeMenu_collapsetree" onclick="modx.tree.collapseTree();" title="<?php echo $_lang['collapse_tree']; ?>"><?php echo $_style['collapse_tree']; ?></a>
19 19
 
20
-		<?php if ($modx->hasPermission('new_document')) {
20
+		<?php if ($modx->hasPermission('new_document')) {
21 21
     ?>
22 22
 			<a class="treeButton" id="treeMenu_addresource" onclick="modx.tabs({url:'<?= MODX_MANAGER_URL ?>?a=4', title: '<?php echo $_lang['add_resource']; ?>'});" title="<?php echo $_lang['add_resource']; ?>"><?php echo $_style['add_doc_tree']; ?></a>
23 23
 			<a class="treeButton" id="treeMenu_addweblink" onclick="modx.tabs({url:'<?= MODX_MANAGER_URL ?>?a=72', title: '<?php echo $_lang['add_weblink']; ?>'});" title="<?php echo $_lang['add_weblink']; ?>"><?php echo $_style['add_weblink_tree']; ?></a>
@@ -28,31 +28,31 @@  discard block
 block discarded – undo
28 28
 
29 29
 		<a class="treeButton" id="treeMenu_sortingtree" onclick="modx.tree.showSorter(event);" title="<?php echo $_lang['sort_tree']; ?>"><?php echo $_style['sort_tree']; ?></a>
30 30
 
31
-		<?php if ($modx->hasPermission('edit_document') && $modx->hasPermission('save_document')) {
31
+		<?php if ($modx->hasPermission('edit_document') && $modx->hasPermission('save_document')) {
32 32
         ?>
33 33
 			<a class="treeButton" id="treeMenu_sortingindex" onclick="modx.tabs({url: '<?= MODX_MANAGER_URL ?>?a=56&id=0', title: '<?php echo $_lang['sort_menuindex']; ?>'});" title="<?php echo $_lang['sort_menuindex']; ?>"><?php echo $_style['sort_menuindex']; ?></a>
34 34
 		<?php
35 35
     } ?>
36 36
 
37
-		<?php if ($use_browser && $modx->hasPermission('assets_images')) {
37
+		<?php if ($use_browser && $modx->hasPermission('assets_images')) {
38 38
         ?>
39 39
 			<a class="treeButton" id="treeMenu_openimages" title="<?php echo $_lang["images_management"] . "\n" . $_lang['em_button_shift'] ?>"><?php echo $_style['images_management']; ?></a>
40 40
 		<?php
41 41
     } ?>
42 42
 
43
-		<?php if ($use_browser && $modx->hasPermission('assets_files')) {
43
+		<?php if ($use_browser && $modx->hasPermission('assets_files')) {
44 44
         ?>
45 45
 			<a class="treeButton" id="treeMenu_openfiles" title="<?php echo $_lang["files_management"] . "\n" . $_lang['em_button_shift'] ?>"><?php echo $_style['files_management']; ?></a>
46 46
 		<?php
47 47
     } ?>
48 48
 
49
-		<?php if ($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin')) {
49
+		<?php if ($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin')) {
50 50
         ?>
51 51
 			<a class="treeButton" id="treeMenu_openelements" title="<?php echo $_lang["element_management"] . "\n" . $_lang['em_button_shift'] ?>"><?php echo $_style['element_management']; ?></a>
52 52
 		<?php
53 53
     } ?>
54 54
 
55
-		<?php if ($modx->hasPermission('empty_trash')) {
55
+		<?php if ($modx->hasPermission('empty_trash')) {
56 56
         ?>
57 57
 			<a class="treeButton treeButtonDisabled" id="treeMenu_emptytrash" title="<?php echo $_lang['empty_recycle_bin_empty']; ?>"><?php echo $_style['empty_recycle_bin_empty']; ?></a>
58 58
 		<?php
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 		<?php
67 67
         // invoke OnManagerTreePrerender event
68 68
         $evtOut = $modx->invokeEvent('OnManagerTreePrerender', $modx->db->escape($_REQUEST));
69
-        if (is_array($evtOut)) {
69
+        if (is_array($evtOut)) {
70 70
             echo implode("\n", $evtOut);
71 71
         }
72 72
         ?>
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
 		<?php
79 79
         // invoke OnManagerTreeRender event
80 80
         $evtOut = $modx->invokeEvent('OnManagerTreeRender', $modx->db->escape($_REQUEST));
81
-        if (is_array($evtOut)) {
81
+        if (is_array($evtOut)) {
82 82
             echo implode("\n", $evtOut);
83 83
         }
84 84
         ?>
Please login to merge, or discard this patch.
manager/frames/mainmenu.php 1 patch
Braces   +32 added lines, -32 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->db->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->db->select('*', $modx->getFullTableName('site_modules'), 'disabled != 1', 'name');
235 235
     }
236
-    if ($modx->db->getRecordCount($rs)) {
237
-        while ($row = $modx->db->getRow($rs)) {
236
+    if ($modx->db->getRecordCount($rs)) {
237
+        while ($row = $modx->db->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,21 +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) {
449
+    if (count($newmenu)> 0) {
450 450
         $sitemenu = $newmenu;
451 451
     }
452 452
 }
453 453
 
454
-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')) {
455 455
     include_once(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/includes/menu.class.inc.php');
456
-} else {
456
+} else {
457 457
     include_once(MODX_MANAGER_PATH . 'includes/menu.class.inc.php');
458 458
 }
459 459
 $menu = new EVOmenu();
Please login to merge, or discard this patch.
manager/frames/1.php 1 patch
Braces   +52 added lines, -49 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
 }
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
     <meta name="theme-color" content="#1d2023" />
120 120
     <meta http-equiv="X-UA-Compatible" content="IE=edge" />
121 121
     <link rel="stylesheet" type="text/css" href="<?= $css ?>" />
122
-    <?php if ($modx->config['show_picker'] != "0") {
122
+    <?php if ($modx->config['show_picker'] != "0") {
123 123
     ?>
124 124
         <link rel="stylesheet" href="media/style/common/spectrum/spectrum.css" />
125 125
         <link rel="stylesheet" type="text/css" href="media/style/<?= $modx->config['manager_theme'] ?>/css/color.switcher.css" />
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
       ?>
252 252
     </script>
253 253
     <script src="media/style/<?= $modx->config['manager_theme'] ?>/js/modx.min.js?v=<?= $lastInstallTime ?>"></script>
254
-    <?php if ($modx->config['show_picker'] != "0") {
254
+    <?php if ($modx->config['show_picker'] != "0") {
255 255
           ?>
256 256
         <script src="media/script/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
257 257
         <script src="media/script/spectrum/spectrum.evo.min.js" type="text/javascript"></script>
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
     <?php
262 262
     // invoke OnManagerTopPrerender event
263 263
     $evtOut = $modx->invokeEvent('OnManagerTopPrerender', $_REQUEST);
264
-    if (is_array($evtOut)) {
264
+    if (is_array($evtOut)) {
265 265
         echo implode("\n", $evtOut);
266 266
     }
267 267
     ?>
@@ -287,14 +287,14 @@  discard block
 block discarded – undo
287 287
                                 <div class="mask"></div>
288 288
                             </form>
289 289
                         </li>
290
-                        <?php if ($modx->config['show_newresource_btn'] != "0") {
290
+                        <?php if ($modx->config['show_newresource_btn'] != "0") {
291 291
         ?>
292
-                            <?php if ($modx->hasPermission('new_document')) {
292
+                            <?php if ($modx->hasPermission('new_document')) {
293 293
             ?>
294 294
                                 <li id="newresource" class="dropdown newresource">
295 295
                                     <a href="javascript:;" class="dropdown-toggle" onclick="return false;" title="<?= $_lang['add_resource'] ?>"><?= $_style['menu_new_resource'] ?></a>
296 296
                                     <ul class="dropdown-menu">
297
-                                        <?php if ($modx->hasPermission('new_document')) {
297
+                                        <?php if ($modx->hasPermission('new_document')) {
298 298
                 ?>
299 299
                                             <li>
300 300
                                                 <a onclick="" href="index.php?a=4" target="main">
@@ -308,7 +308,7 @@  discard block
 block discarded – undo
308 308
                                             </li>
309 309
                                         <?php
310 310
             } ?>
311
-                                        <?php if ($use_browser && $modx->hasPermission('assets_images')) {
311
+                                        <?php if ($use_browser && $modx->hasPermission('assets_images')) {
312 312
                 ?>
313 313
                                             <li>
314 314
                                                 <a onclick="" href="media/browser/<?= $which_browser ?>/browse.php?&type=images" target="main">
@@ -317,7 +317,7 @@  discard block
 block discarded – undo
317 317
                                             </li>
318 318
                                         <?php
319 319
             } ?>
320
-                                        <?php if ($use_browser && $modx->hasPermission('assets_files')) {
320
+                                        <?php if ($use_browser && $modx->hasPermission('assets_files')) {
321 321
                 ?>
322 322
                                             <li>
323 323
                                                 <a onclick="" href="media/browser/<?= $which_browser ?>/browse.php?&type=files" target="main">
@@ -340,11 +340,11 @@  discard block
 block discarded – undo
340 340
                         <li id="account" class="dropdown account">
341 341
                             <a href="javascript:;" class="dropdown-toggle" onclick="return false;">
342 342
                                 <span class="username"><?= $user['username'] ?></span>
343
-                                <?php if ($user['photo']) {
343
+                                <?php if ($user['photo']) {
344 344
         ?>
345 345
                                     <span class="icon photo" style="background-image: url(<?= MODX_SITE_URL . $user['photo'] ?>);"></span>
346 346
                                 <?php
347
-    } else {
347
+    } else {
348 348
         ?>
349 349
                                     <span class="icon"><?= $_style['menu_user'] ?></span>
350 350
                                 <?php
@@ -355,7 +355,7 @@  discard block
 block discarded – undo
355 355
                                 <?php if ($modx->hasPermission('messages')): ?>
356 356
                                     <li id="newMail"></li>
357 357
                                 <?php endif; ?>
358
-                                <?php if ($modx->hasPermission('change_password')) {
358
+                                <?php if ($modx->hasPermission('change_password')) {
359 359
         ?>
360 360
                                     <li>
361 361
                                         <a onclick="" href="index.php?a=28" target="main">
@@ -378,12 +378,12 @@  discard block
 block discarded – undo
378 378
                                 ?>
379 379
                             </ul>
380 380
                         </li>
381
-                        <?php if ($modx->hasPermission('settings') || $modx->hasPermission('view_eventlog') || $modx->hasPermission('logs') || $modx->hasPermission('help')) {
381
+                        <?php if ($modx->hasPermission('settings') || $modx->hasPermission('view_eventlog') || $modx->hasPermission('logs') || $modx->hasPermission('help')) {
382 382
                                     ?>
383 383
                             <li id="system" class="dropdown">
384 384
                                 <a href="javascript:;" class="dropdown-toggle" title="<?= $_lang['system'] ?>" onclick="return false;"><?= $_style['menu_system'] ?></a>
385 385
                                 <ul class="dropdown-menu">
386
-                                    <?php if ($modx->hasPermission('settings')) {
386
+                                    <?php if ($modx->hasPermission('settings')) {
387 387
                                         ?>
388 388
                                         <li>
389 389
                                             <a href="index.php?a=17" target="main">
@@ -392,7 +392,7 @@  discard block
 block discarded – undo
392 392
                                         </li>
393 393
                                     <?php
394 394
                                     } ?>
395
-                                    <?php if ($modx->hasPermission('view_eventlog')) {
395
+                                    <?php if ($modx->hasPermission('view_eventlog')) {
396 396
                                         ?>
397 397
                                         <li>
398 398
                                             <a href="index.php?a=70" target="main">
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
                                         </li>
402 402
                                     <?php
403 403
                                     } ?>
404
-                                    <?php if ($modx->hasPermission('view_eventlog')) {
404
+                                    <?php if ($modx->hasPermission('view_eventlog')) {
405 405
                                         ?>
406 406
                                         <li>
407 407
                                             <a href="index.php?a=114" target="main">
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
                                         </li>
411 411
                                     <?php
412 412
                                     } ?>
413
-                                    <?php if ($modx->hasPermission('logs')) {
413
+                                    <?php if ($modx->hasPermission('logs')) {
414 414
                                         ?>
415 415
                                         <li>
416 416
                                             <a href="index.php?a=13" target="main">
@@ -424,7 +424,7 @@  discard block
 block discarded – undo
424 424
                                         </li>
425 425
                                     <?php
426 426
                                     } ?>
427
-                                    <?php if ($modx->hasPermission('help')) {
427
+                                    <?php if ($modx->hasPermission('help')) {
428 428
                                         ?>
429 429
                                         <li>
430 430
                                             <a href="index.php?a=9" target="main">
@@ -437,7 +437,7 @@  discard block
 block discarded – undo
437 437
                             </li>
438 438
                         <?php
439 439
                                 } ?>
440
-                        <?php if ($modx->config['show_fullscreen_btn'] != "0") {
440
+                        <?php if ($modx->config['show_fullscreen_btn'] != "0") {
441 441
                                     ?>
442 442
                             <li id="fullscreen">
443 443
                                 <a href="javascript:;" onclick="toggleFullScreen();" id="toggleFullScreen" title="<?= $_lang["toggle_fullscreen"] ?>">
@@ -462,11 +462,14 @@  discard block
 block discarded – undo
462 462
             <div id="evo-tab-page-home" class="evo-tab-page show iframe-scroller">
463 463
                 <iframe id="mainframe" src="index.php?a=<?= $initMainframeAction ?>" scrolling="auto" frameborder="0" onload="modx.main.onload(event);"></iframe>
464 464
             </div>
465
-        <?php else: ?>
465
+        <?php else {
466
+    : ?>
466 467
             <div class="iframe-scroller">
467 468
                 <iframe id="mainframe" name="main" src="index.php?a=<?= $initMainframeAction ?>" scrolling="auto" frameborder="0" onload="modx.main.onload(event);"></iframe>
468 469
             </div>
469
-        <?php endif; ?>
470
+        <?php endif;
471
+}
472
+?>
470 473
         <script>
471 474
             if (/iPhone|iPad|iPod/i.test(navigator.userAgent)) {
472 475
                 document.getElementById('mainframe').setAttribute('scrolling', 'no');
@@ -485,11 +488,11 @@  discard block
 block discarded – undo
485 488
             'tree_sortdir',
486 489
             'tree_nodename'
487 490
         );
488
-        foreach ($sortParams as $param) {
489
-            if (isset($_REQUEST[$param])) {
491
+        foreach ($sortParams as $param) {
492
+            if (isset($_REQUEST[$param])) {
490 493
                 $modx->manager->saveLastUserSetting($param, $_REQUEST[$param]);
491 494
                 $_SESSION[$param] = $_REQUEST[$param];
492
-            } elseif (!isset($_SESSION[$param])) {
495
+            } elseif (!isset($_SESSION[$param])) {
493 496
                 $_SESSION[$param] = $modx->manager->getLastUserSetting($param);
494 497
             }
495 498
         }
@@ -575,9 +578,9 @@  discard block
 block discarded – undo
575 578
      * @param string $text
576 579
      * @param bool $allowed
577 580
      */
578
-    function constructLink($action, $img, $text, $allowed)
579
-    {
580
-        if ((bool)$allowed) {
581
+    function constructLink($action, $img, $text, $allowed)
582
+    {
583
+        if ((bool)$allowed) {
581 584
             echo sprintf('<div class="menuLink" id="item%s" onclick="modx.tree.menuHandler(%s);">', $action, $action);
582 585
             echo sprintf('<i class="%s"></i> %s</div>', $img, $text);
583 586
         }
@@ -588,7 +591,7 @@  discard block
 block discarded – undo
588 591
     <script type="text/javascript">
589 592
 
590 593
       if (document.getElementById('treeMenu')) {
591
-          <?php if ($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin')) {
594
+          <?php if ($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin')) {
592 595
         ?>
593 596
 
594 597
         document.getElementById('treeMenu_openelements').onclick = function(e) {
@@ -608,7 +611,7 @@  discard block
 block discarded – undo
608 611
         };
609 612
           <?php
610 613
     } ?>
611
-          <?php if ($use_browser && $modx->hasPermission('assets_images')) {
614
+          <?php if ($use_browser && $modx->hasPermission('assets_images')) {
612 615
         ?>
613 616
 
614 617
         document.getElementById('treeMenu_openimages').onclick = function(e) {
@@ -628,7 +631,7 @@  discard block
 block discarded – undo
628 631
         };
629 632
           <?php
630 633
     } ?>
631
-          <?php if ($use_browser && $modx->hasPermission('assets_files')) {
634
+          <?php if ($use_browser && $modx->hasPermission('assets_files')) {
632 635
         ?>
633 636
 
634 637
         document.getElementById('treeMenu_openfiles').onclick = function(e) {
@@ -652,7 +655,7 @@  discard block
 block discarded – undo
652 655
       }
653 656
 
654 657
     </script>
655
-    <?php if ($modx->config['show_fullscreen_btn'] != "0") {
658
+    <?php if ($modx->config['show_fullscreen_btn'] != "0") {
656 659
         ?>
657 660
         <script>
658 661
           function toggleFullScreen()
@@ -690,7 +693,7 @@  discard block
 block discarded – undo
690 693
     ?>
691 694
 
692 695
 </div>
693
-<?php if ($modx->config['show_picker'] != "0") {
696
+<?php if ($modx->config['show_picker'] != "0") {
694 697
         include('media/style/' . $modx->config['manager_theme'] . '/color.switcher.php');
695 698
     } ?>
696 699
 </body>
Please login to merge, or discard this patch.
manager/media/browser/mcpuk/lib/class_image_gmagick.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,7 +22,8 @@  discard block
 block discarded – undo
22 22
     // ABSTRACT PUBLIC METHODS
23 23
 
24 24
     public function resize($width, $height)
25
-    {//
25
+    {
26
+//
26 27
         if (!$width) {
27 28
             $width = 1;
28 29
         }
@@ -40,7 +41,8 @@  discard block
 block discarded – undo
40 41
     }
41 42
 
42 43
     public function resizeFit($width, $height, $background=false)
43
-    {//
44
+    {
45
+//
44 46
         if (!$width) {
45 47
             $width = 1;
46 48
         }
Please login to merge, or discard this patch.
manager/media/browser/mcpuk/lib/class_gd.php 1 patch
Braces   +94 added lines, -94 removed lines patch added patch discarded remove patch
@@ -12,8 +12,8 @@  discard block
 block discarded – undo
12 12
   *      @link http://kcfinder.sunhater.com
13 13
   */
14 14
 
15
-class gd
16
-{
15
+class gd
16
+{
17 17
 
18 18
   /** GD resource
19 19
     * @var resource */
@@ -41,20 +41,20 @@  discard block
 block discarded – undo
41 41
       * @param mixed $image
42 42
       * @return array */
43 43
 
44
-    protected function build_image($image)
45
-    {
46
-        if ($image instanceof gd) {
44
+    protected function build_image($image)
45
+    {
46
+        if ($image instanceof gd) {
47 47
             $width = $image->get_width();
48 48
             $height = $image->get_height();
49 49
             $image = $image->get_image();
50
-        } elseif (is_resource($image) && (get_resource_type($image) == "gd")) {
50
+        } elseif (is_resource($image) && (get_resource_type($image) == "gd")) {
51 51
             $width = @imagesx($image);
52 52
             $height = @imagesy($image);
53
-        } elseif (is_array($image)) {
53
+        } elseif (is_array($image)) {
54 54
             list($key, $width) = each($image);
55 55
             list($key, $height) = each($image);
56 56
             $image = imagecreatetruecolor($width, $height);
57
-        } elseif (false !== (list($width, $height, $type) = @getimagesize($image))) {
57
+        } elseif (false !== (list($width, $height, $type) = @getimagesize($image))) {
58 58
             $image =
59 59
                 ($type == IMAGETYPE_GIF)      ? @imagecreatefromgif($image)  : (
60 60
                 ($type == IMAGETYPE_WBMP)     ? @imagecreatefromwbmp($image) : (
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
                 ($type == IMAGETYPE_XBM)      ? @imagecreatefromxbm($image)  : false
65 65
             )))));
66 66
 
67
-            if ($type == IMAGETYPE_PNG) {
67
+            if ($type == IMAGETYPE_PNG) {
68 68
                 imagealphablending($image, false);
69 69
             }
70 70
         }
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
             ? array($image, $width, $height)
81 81
             : false;
82 82
 
83
-        if (($return !== false) && isset($type)) {
83
+        if (($return !== false) && isset($type)) {
84 84
             $this->type = $type;
85 85
         }
86 86
 
@@ -98,22 +98,22 @@  discard block
 block discarded – undo
98 98
       * @param integer $bigger_size
99 99
       * @return gd */
100 100
 
101
-    public function __construct($image, $bigger_size=null)
102
-    {
101
+    public function __construct($image, $bigger_size=null)
102
+    {
103 103
         $this->image = $this->width = $this->height = null;
104 104
 
105 105
         $image_details = $this->build_image($image);
106 106
 
107
-        if ($image_details !== false) {
107
+        if ($image_details !== false) {
108 108
             list($this->image, $this->width, $this->height) = $image_details;
109
-        } else {
109
+        } else {
110 110
             $this->init_error = true;
111 111
         }
112 112
 
113 113
         if (!is_null($this->image) &&
114 114
             !is_null($bigger_size) &&
115 115
             (preg_match('/^[1-9][0-9]*$/', $bigger_size) !== false)
116
-        ) {
116
+        ) {
117 117
             $image = $this->image;
118 118
             list($width, $height) = $this->get_prop_size($bigger_size);
119 119
             $this->image = imagecreatetruecolor($width, $height);
@@ -128,24 +128,24 @@  discard block
 block discarded – undo
128 128
     /** Returns the GD resource
129 129
       * @return resource */
130 130
 
131
-    public function get_image()
132
-    {
131
+    public function get_image()
132
+    {
133 133
         return $this->image;
134 134
     }
135 135
 
136 136
     /** Returns the image width
137 137
       * @return integer */
138 138
 
139
-    public function get_width()
140
-    {
139
+    public function get_width()
140
+    {
141 141
         return $this->width;
142 142
     }
143 143
 
144 144
     /** Returns the image height
145 145
       * @return integer */
146 146
 
147
-    public function get_height()
148
-    {
147
+    public function get_height()
148
+    {
149 149
         return $this->height;
150 150
     }
151 151
 
@@ -153,10 +153,10 @@  discard block
 block discarded – undo
153 153
       * @param integer $resized_height
154 154
       * @return integer */
155 155
 
156
-    public function get_prop_width($resized_height)
157
-    {
156
+    public function get_prop_width($resized_height)
157
+    {
158 158
         $width = intval(($this->width * $resized_height) / $this->height);
159
-        if (!$width) {
159
+        if (!$width) {
160 160
             $width = 1;
161 161
         }
162 162
         return $width;
@@ -166,10 +166,10 @@  discard block
 block discarded – undo
166 166
       * @param integer $resized_width
167 167
       * @return integer */
168 168
 
169
-    public function get_prop_height($resized_width)
170
-    {
169
+    public function get_prop_height($resized_width)
170
+    {
171 171
         $height = intval(($this->height * $resized_width) / $this->width);
172
-        if (!$height) {
172
+        if (!$height) {
173 173
             $height = 1;
174 174
         }
175 175
         return $height;
@@ -181,15 +181,15 @@  discard block
 block discarded – undo
181 181
       * @param integer $bigger_size
182 182
       * @return array */
183 183
 
184
-    public function get_prop_size($bigger_size)
185
-    {
186
-        if ($this->width > $this->height) {
184
+    public function get_prop_size($bigger_size)
185
+    {
186
+        if ($this->width > $this->height) {
187 187
             $width = $bigger_size;
188 188
             $height = $this->get_prop_height($width);
189
-        } elseif ($this->height > $this->width) {
189
+        } elseif ($this->height > $this->width) {
190 190
             $height = $bigger_size;
191 191
             $width = $this->get_prop_width($height);
192
-        } else {
192
+        } else {
193 193
             $width = $height = $bigger_size;
194 194
         }
195 195
 
@@ -201,12 +201,12 @@  discard block
 block discarded – undo
201 201
       * @param integer $height
202 202
       * @return bool */
203 203
 
204
-    public function resize($width, $height)
205
-    {
206
-        if (!$width) {
204
+    public function resize($width, $height)
205
+    {
206
+        if (!$width) {
207 207
             $width = 1;
208 208
         }
209
-        if (!$height) {
209
+        if (!$height) {
210 210
             $height = 1;
211 211
         }
212 212
         return (
@@ -223,19 +223,19 @@  discard block
 block discarded – undo
223 223
       * @param mixed $src
224 224
       * @return bool */
225 225
 
226
-    public function resize_crop($src)
227
-    {
226
+    public function resize_crop($src)
227
+    {
228 228
         $image_details = $this->build_image($src);
229 229
 
230
-        if ($image_details !== false) {
230
+        if ($image_details !== false) {
231 231
             list($src, $src_width, $src_height) = $image_details;
232 232
 
233
-            if (($src_width / $src_height) > ($this->width / $this->height)) {
233
+            if (($src_width / $src_height) > ($this->width / $this->height)) {
234 234
                 $src_w = $this->get_prop_width($src_height);
235 235
                 $src_h = $src_height;
236 236
                 $src_x = intval(($src_width - $src_w) / 2);
237 237
                 $src_y = 0;
238
-            } else {
238
+            } else {
239 239
                 $src_w = $src_width;
240 240
                 $src_h = $this->get_prop_height($src_width);
241 241
                 $src_x = 0;
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
             }
244 244
 
245 245
             return imagecopyresampled($this->image, $src, 0, 0, $src_x, $src_y, $this->width, $this->height, $src_w, $src_h);
246
-        } else {
246
+        } else {
247 247
             return false;
248 248
         }
249 249
     }
@@ -253,20 +253,20 @@  discard block
 block discarded – undo
253 253
       * @param integer $height
254 254
       * @return bool */
255 255
 
256
-    public function resize_fit($width, $height)
257
-    {
258
-        if ((!$width && !$height) || (($width == $this->width) && ($height == $this->height))) {
256
+    public function resize_fit($width, $height)
257
+    {
258
+        if ((!$width && !$height) || (($width == $this->width) && ($height == $this->height))) {
259 259
             return true;
260 260
         }
261
-        if (!$width || (($height / $width) < ($this->height / $this->width))) {
261
+        if (!$width || (($height / $width) < ($this->height / $this->width))) {
262 262
             $width = intval(($this->width * $height) / $this->height);
263
-        } elseif (!$height || (($width / $height) < ($this->width / $this->height))) {
263
+        } elseif (!$height || (($width / $height) < ($this->width / $this->height))) {
264 264
             $height = intval(($this->height * $width) / $this->width);
265 265
         }
266
-        if (!$width) {
266
+        if (!$width) {
267 267
             $width = 1;
268 268
         }
269
-        if (!$height) {
269
+        if (!$height) {
270 270
             $height = 1;
271 271
         }
272 272
         return $this->resize($width, $height);
@@ -279,8 +279,8 @@  discard block
 block discarded – undo
279 279
       * @param integer $height
280 280
       * @return bool */
281 281
 
282
-    public function resize_overflow($width, $height)
283
-    {
282
+    public function resize_overflow($width, $height)
283
+    {
284 284
         $big = (($this->width / $this->height) > ($width / $height))
285 285
             ? ($this->width * $height) / $this->height
286 286
             : ($this->height * $width) / $this->width;
@@ -288,7 +288,7 @@  discard block
 block discarded – undo
288 288
 
289 289
         $return = ($img = new gd($this->image, $big));
290 290
 
291
-        if ($return) {
291
+        if ($return) {
292 292
             $this->image = $img->get_image();
293 293
             $this->width = $img->get_width();
294 294
             $this->height = $img->get_height();
@@ -297,8 +297,8 @@  discard block
 block discarded – undo
297 297
         return $return;
298 298
     }
299 299
 
300
-    public function gd_color()
301
-    {
300
+    public function gd_color()
301
+    {
302 302
         $args = func_get_args();
303 303
 
304 304
         $expr_rgb = '/^rgb\(\s*(\d{1,3})\s*\,\s*(\d{1,3})\s*\,\s*(\d{1,3})\s*\)$/i';
@@ -306,20 +306,20 @@  discard block
 block discarded – undo
306 306
         $expr_hex2 = '/^\#?([0-9a-f])([0-9a-f])([0-9a-f])$/i';
307 307
         $expr_byte = '/^([01]?\d?\d|2[0-4]\d|25[0-5])$/';
308 308
 
309
-        if (!isset($args[0])) {
309
+        if (!isset($args[0])) {
310 310
             return false;
311 311
         }
312 312
 
313
-        if (count($args[0]) == 3) {
313
+        if (count($args[0]) == 3) {
314 314
             list($r, $g, $b) = $args[0];
315
-        } elseif (preg_match($expr_rgb, $args[0])) {
315
+        } elseif (preg_match($expr_rgb, $args[0])) {
316 316
             list($r, $g, $b) = explode(" ", preg_replace($expr_rgb, "$1 $2 $3", $args[0]));
317
-        } elseif (preg_match($expr_hex1, $args[0])) {
317
+        } elseif (preg_match($expr_hex1, $args[0])) {
318 318
             list($r, $g, $b) = explode(" ", preg_replace($expr_hex1, "$1 $2 $3", $args[0]));
319 319
             $r = hexdec($r);
320 320
             $g = hexdec($g);
321 321
             $b = hexdec($b);
322
-        } elseif (preg_match($expr_hex2, $args[0])) {
322
+        } elseif (preg_match($expr_hex2, $args[0])) {
323 323
             list($r, $g, $b) = explode(" ", preg_replace($expr_hex2, "$1$1 $2$2 $3$3", $args[0]));
324 324
             $r = hexdec($r);
325 325
             $g = hexdec($g);
@@ -328,17 +328,17 @@  discard block
 block discarded – undo
328 328
             preg_match($expr_byte, $args[0]) &&
329 329
             preg_match($expr_byte, $args[1]) &&
330 330
             preg_match($expr_byte, $args[2])
331
-        ) {
331
+        ) {
332 332
             list($r, $g, $b) = $args;
333
-        } else {
333
+        } else {
334 334
             return false;
335 335
         }
336 336
 
337 337
         return imagecolorallocate($this->image, $r, $g, $b);
338 338
     }
339 339
 
340
-    public function fill_color($color)
341
-    {
340
+    public function fill_color($color)
341
+    {
342 342
         return $this->imagefilledrectangle(0, 0, $this->width - 1, $this->height - 1, $color);
343 343
     }
344 344
 
@@ -351,26 +351,26 @@  discard block
 block discarded – undo
351 351
         $src_x=0, $src_y=0,
352 352
         $dst_w=null, $dst_h=null,
353 353
         $src_w=null, $src_h=null
354
-    ) {
354
+    ) {
355 355
         $image_details = $this->build_image($src);
356 356
 
357
-        if ($image_details !== false) {
357
+        if ($image_details !== false) {
358 358
             list($src, $src_width, $src_height) = $image_details;
359 359
 
360
-            if (is_null($dst_w)) {
360
+            if (is_null($dst_w)) {
361 361
                 $dst_w = $this->width - $dst_x;
362 362
             }
363
-            if (is_null($dst_h)) {
363
+            if (is_null($dst_h)) {
364 364
                 $dst_h = $this->height - $dst_y;
365 365
             }
366
-            if (is_null($src_w)) {
366
+            if (is_null($src_w)) {
367 367
                 $src_w = $src_width - $src_x;
368 368
             }
369
-            if (is_null($src_h)) {
369
+            if (is_null($src_h)) {
370 370
                 $src_h = $src_height - $src_y;
371 371
             }
372 372
             return imagecopy($this->image, $src, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h);
373
-        } else {
373
+        } else {
374 374
             return false;
375 375
         }
376 376
     }
@@ -381,22 +381,22 @@  discard block
 block discarded – undo
381 381
         $src_x=0, $src_y=0,
382 382
         $dst_w=null, $dst_h=null,
383 383
         $src_w=null, $src_h=null
384
-    ) {
384
+    ) {
385 385
         $image_details = $this->build_image($src);
386 386
 
387
-        if ($image_details !== false) {
387
+        if ($image_details !== false) {
388 388
             list($src, $src_width, $src_height) = $image_details;
389 389
 
390
-            if (is_null($dst_w)) {
390
+            if (is_null($dst_w)) {
391 391
                 $dst_w = $this->width - $dst_x;
392 392
             }
393
-            if (is_null($dst_h)) {
393
+            if (is_null($dst_h)) {
394 394
                 $dst_h = $this->height - $dst_y;
395 395
             }
396
-            if (is_null($src_w)) {
396
+            if (is_null($src_w)) {
397 397
                 $src_w = $src_width - $src_x;
398 398
             }
399
-            if (is_null($src_h)) {
399
+            if (is_null($src_h)) {
400 400
                 $src_h = $src_height - $src_y;
401 401
             }
402 402
             imagealphablending($this->image, false);
@@ -409,7 +409,7 @@  discard block
 block discarded – undo
409 409
 
410 410
             $transindex = imagecolortransparent($src);
411 411
             $palletsize = imagecolorstotal($src);
412
-            if ($transindex >= 0 && $transindex < $palletsize) {
412
+            if ($transindex >= 0 && $transindex < $palletsize) {
413 413
                 $transcol = imagecolorsforindex($src, $transindex);
414 414
 
415 415
                 /*** end gif transparent fix ***/
@@ -418,54 +418,54 @@  discard block
 block discarded – undo
418 418
                 imagefilledrectangle($this->image, 0, 0, $dst_w, $dst_h, $transindex);
419 419
                 imagecopyresampled($this->image, $src, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h);
420 420
                 imagecolortransparent($this->image, $transindex);
421
-                for ($y=0; $y<$dst_h; ++$y) {
422
-                    for ($x=0; $x<$dst_w; ++$x) {
423
-                        if (((imagecolorat($this->image, $x, $y)>>24) & 0x7F) >= 100) {
421
+                for ($y=0; $y<$dst_h; ++$y) {
422
+                    for ($x=0; $x<$dst_w; ++$x) {
423
+                        if (((imagecolorat($this->image, $x, $y)>>24) & 0x7F) >= 100) {
424 424
                             imagesetpixel($this->image, $x, $y, $transindex);
425 425
                         }
426 426
                     }
427 427
                 }
428 428
                 imagetruecolortopalette($this->image, true, 255);
429
-            } else {
429
+            } else {
430 430
                 $transparent = imagecolorallocatealpha($this->image, 255, 255, 255, 127);
431 431
                 imagefilledrectangle($this->image, 0, 0, $dst_w, $dst_h, $transparent);
432 432
                 imagecopyresampled($this->image, $src, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h);
433 433
             }
434 434
             return $this->image;
435
-        } else {
435
+        } else {
436 436
             return false;
437 437
         }
438 438
     }
439 439
 
440
-    public function imagefilledrectangle($x1, $y1, $x2, $y2, $color)
441
-    {
440
+    public function imagefilledrectangle($x1, $y1, $x2, $y2, $color)
441
+    {
442 442
         $color = $this->gd_color($color);
443
-        if ($color === false) {
443
+        if ($color === false) {
444 444
             return false;
445 445
         }
446 446
         return imagefilledrectangle($this->image, $x1, $y1, $x2, $y2, $color);
447 447
     }
448 448
 
449
-    public function imagepng($filename=null, $quality=null, $filters=null)
450
-    {
451
-        if (is_null($filename) && !headers_sent()) {
449
+    public function imagepng($filename=null, $quality=null, $filters=null)
450
+    {
451
+        if (is_null($filename) && !headers_sent()) {
452 452
             header("Content-Type: image/png");
453 453
         }
454 454
         @imagesavealpha($this->image, true);
455 455
         return imagepng($this->image, $filename, $quality, $filters);
456 456
     }
457 457
 
458
-    public function imagejpeg($filename=null, $quality=75)
459
-    {
460
-        if (is_null($filename) && !headers_sent()) {
458
+    public function imagejpeg($filename=null, $quality=75)
459
+    {
460
+        if (is_null($filename) && !headers_sent()) {
461 461
             header("Content-Type: image/jpeg");
462 462
         }
463 463
         return imagejpeg($this->image, $filename, $quality);
464 464
     }
465 465
 
466
-    public function imagegif($filename=null)
467
-    {
468
-        if (is_null($filename) && !headers_sent()) {
466
+    public function imagegif($filename=null)
467
+    {
468
+        if (is_null($filename) && !headers_sent()) {
469 469
             header("Content-Type: image/gif");
470 470
         }
471 471
         @imagesavealpha($this->image, true);
Please login to merge, or discard this patch.
manager/media/browser/mcpuk/lib/class_image_imagick.php 1 patch
Braces   +4 added lines, -2 removed lines patch added patch discarded remove patch
@@ -22,7 +22,8 @@  discard block
 block discarded – undo
22 22
     // ABSTRACT PUBLIC METHODS
23 23
 
24 24
     public function resize($width, $height)
25
-    {//
25
+    {
26
+//
26 27
         if (!$width) {
27 28
             $width = 1;
28 29
         }
@@ -40,7 +41,8 @@  discard block
 block discarded – undo
40 41
     }
41 42
 
42 43
     public function resizeFit($width, $height, $background=false)
43
-    {//
44
+    {
45
+//
44 46
         if (!$width) {
45 47
             $width = 1;
46 48
         }
Please login to merge, or discard this patch.
manager/media/browser/mcpuk/browser.php 1 patch
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -10,15 +10,15 @@
 block discarded – undo
10 10
 			}
11 11
 		};
12 12
 <?php
13
-    if (isset($_GET['type'])) {
13
+    if (isset($_GET['type'])) {
14 14
         $type = htmlspecialchars(trim($_GET['type']), ENT_QUOTES);
15
-    } elseif (isset($_GET['Type'])) {
15
+    } elseif (isset($_GET['Type'])) {
16 16
         $type = htmlspecialchars(trim($_GET['Type']), ENT_QUOTES);
17
-    } else {
17
+    } else {
18 18
         $type = 'images';
19 19
     }
20 20
     
21
-    if ($type==='image') {
21
+    if ($type==='image') {
22 22
         $type = 'images';
23 23
     }
24 24
     
Please login to merge, or discard this patch.
manager/media/style/default/style.php 1 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
-} elseif (isset($_SESSION['stay'])) {
270
+} elseif (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/media/style/default/ajax.php 1 patch
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,19 +340,19 @@  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
                             $sql = $modx->db->query('SELECT *
351 351
 							FROM ' . $modx->getFullTableName('site_snippets') . '
352 352
 							WHERE name="' . $name . '"
353 353
 							LIMIT 1');
354 354
 
355
-                            if ($modx->db->getRecordCount($sql)) {
355
+                            if ($modx->db->getRecordCount($sql)) {
356 356
                                 $row = $modx->db->getRow($sql);
357 357
                                 $contextmenu = array(
358 358
                                     'header' => array(
@@ -363,13 +363,13 @@  discard block
 block discarded – undo
363 363
                                         'url' => "index.php?a=22&id=" . $row['id']
364 364
                                     )
365 365
                                 );
366
-                                if (!empty($row['description'])) {
366
+                                if (!empty($row['description'])) {
367 367
                                     $contextmenu['seperator'] = '';
368 368
                                     $contextmenu['description'] = array(
369 369
                                         'innerHTML' => '<i class="fa fa-info"></i> ' . $row['description']
370 370
                                     );
371 371
                                 }
372
-                            } else {
372
+                            } else {
373 373
                                 $contextmenu = array(
374 374
                                     'header' => array(
375 375
                                         'innerHTML' => '<i class="fa fa-code"></i> ' . $name
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
                             'alias_visible'
432 432
                         );
433 433
 
434
-                        if (in_array($name, $default_field)) {
434
+                        if (in_array($name, $default_field)) {
435 435
                             return;
436 436
                         }
437 437
 
@@ -440,7 +440,7 @@  discard block
 block discarded – undo
440 440
 						WHERE name="' . $name . '"
441 441
 						LIMIT 1');
442 442
 
443
-                        if ($modx->db->getRecordCount($sql)) {
443
+                        if ($modx->db->getRecordCount($sql)) {
444 444
                             $row = $modx->db->getRow($sql);
445 445
                             $contextmenu = array(
446 446
                                 'header' => array(
@@ -451,13 +451,13 @@  discard block
 block discarded – undo
451 451
                                     'url' => "index.php?a=301&id=" . $row['id']
452 452
                                 )
453 453
                             );
454
-                            if (!empty($row['description'])) {
454
+                            if (!empty($row['description'])) {
455 455
                                 $contextmenu['seperator'] = '';
456 456
                                 $contextmenu['description'] = array(
457 457
                                     'innerHTML' => '<i class="fa fa-info"></i> ' . $row['description']
458 458
                                 );
459 459
                             }
460
-                        } else {
460
+                        } else {
461 461
                             $contextmenu = array(
462 462
                                 'header' => array(
463 463
                                     'innerHTML' => '<i class="fa fa-list-alt"></i> ' . $name
@@ -482,13 +482,13 @@  discard block
 block discarded – undo
482 482
         case 'movedocument': {
483 483
             $json = array();
484 484
 
485
-            if ($modx->hasPermission('new_document') && $modx->hasPermission('edit_document') && $modx->hasPermission('save_document')) {
485
+            if ($modx->hasPermission('new_document') && $modx->hasPermission('edit_document') && $modx->hasPermission('save_document')) {
486 486
                 $id = !empty($_REQUEST['id']) ? (int)$_REQUEST['id'] : '';
487 487
                 $parent = isset($_REQUEST['parent']) ? (int)$_REQUEST['parent'] : 0;
488 488
                 $menuindex = isset($_REQUEST['menuindex']) && is_scalar($_REQUEST['menuindex']) ? $_REQUEST['menuindex'] : 0;
489 489
 
490 490
                 // set parent
491
-                if ($id && $parent >= 0) {
491
+                if ($id && $parent >= 0) {
492 492
 
493 493
                     // find older parent
494 494
                     $parentOld = $modx->db->getValue($modx->db->select('parent', $modx->getFullTableName('site_content'), 'id=' . $id));
@@ -499,31 +499,31 @@  discard block
 block discarded – undo
499 499
                         'new_parent'  => $parent,
500 500
                     ));
501 501
 
502
-                    if (is_array($eventOut) && count($eventOut) > 0) {
502
+                    if (is_array($eventOut) && count($eventOut) > 0) {
503 503
                         $eventParent = array_pop($eventOut);
504 504
 
505
-                        if ($eventParent == $parentOld) {
505
+                        if ($eventParent == $parentOld) {
506 506
                             $json['errors'] = $_lang['error_movedocument2'];
507
-                        } else {
507
+                        } else {
508 508
                             $parent = $eventParent;
509 509
                         }
510 510
                     }
511 511
 
512
-                    if (empty($json['errors'])) {
512
+                    if (empty($json['errors'])) {
513 513
                         // check privileges user for move docs
514
-                        if (!empty($modx->config['tree_show_protected']) && $role != 1) {
514
+                        if (!empty($modx->config['tree_show_protected']) && $role != 1) {
515 515
                             $sql = $modx->db->select('*', $modx->getFullTableName('document_groups'), 'document IN(' . $id . ',' . $parent . ',' . $parentOld . ')');
516
-                            if ($modx->db->getRecordCount($sql)) {
516
+                            if ($modx->db->getRecordCount($sql)) {
517 517
                                 $document_groups = array();
518
-                                while ($row = $modx->db->getRow($sql)) {
518
+                                while ($row = $modx->db->getRow($sql)) {
519 519
                                     $document_groups[$row['document']]['groups'][] = $row['document_group'];
520 520
                                 }
521
-                                foreach ($document_groups as $key => $value) {
522
-                                    if (($key == $parent || $key == $parentOld || $key == $id) && !in_array($role, $value['groups'])) {
521
+                                foreach ($document_groups as $key => $value) {
522
+                                    if (($key == $parent || $key == $parentOld || $key == $id) && !in_array($role, $value['groups'])) {
523 523
                                         $json['errors'] = $_lang["error_no_privileges"];
524 524
                                     }
525 525
                                 }
526
-                                if ($json['errors']) {
526
+                                if ($json['errors']) {
527 527
                                     header('content-type: application/json');
528 528
                                     echo json_encode($json, JSON_FORCE_OBJECT | JSON_UNESCAPED_UNICODE);
529 529
                                     break;
@@ -531,9 +531,9 @@  discard block
 block discarded – undo
531 531
                             }
532 532
                         }
533 533
 
534
-                        if ($parent == 0 && $parent != $parentOld && !$modx->config['udperms_allowroot'] && $role != 1) {
534
+                        if ($parent == 0 && $parent != $parentOld && !$modx->config['udperms_allowroot'] && $role != 1) {
535 535
                             $json['errors'] = $_lang["error_no_privileges"];
536
-                        } else {
536
+                        } else {
537 537
                             // set new parent
538 538
                             $modx->db->update(array(
539 539
                                 'parent' => $parent
@@ -543,13 +543,13 @@  discard block
 block discarded – undo
543 543
                                 'isfolder' => 1
544 544
                             ), $modx->getFullTableName('site_content'), 'id=' . $parent);
545 545
 
546
-                            if ($parent != $parentOld) {
546
+                            if ($parent != $parentOld) {
547 547
                                 // check children docs and set parent isfolder
548
-                                if ($modx->db->getRecordCount($modx->db->select('id', $modx->getFullTableName('site_content'), 'parent=' . $parentOld))) {
548
+                                if ($modx->db->getRecordCount($modx->db->select('id', $modx->getFullTableName('site_content'), 'parent=' . $parentOld))) {
549 549
                                     $modx->db->update(array(
550 550
                                         'isfolder' => 1
551 551
                                     ), $modx->getFullTableName('site_content'), 'id=' . $parentOld);
552
-                                } else {
552
+                                } else {
553 553
                                     $modx->db->update(array(
554 554
                                         'isfolder' => 0
555 555
                                     ), $modx->getFullTableName('site_content'), 'id=' . $parentOld);
@@ -557,16 +557,16 @@  discard block
 block discarded – undo
557 557
                             }
558 558
 
559 559
                             // set menuindex
560
-                            if (!empty($menuindex)) {
560
+                            if (!empty($menuindex)) {
561 561
                                 $menuindex = explode(',', $menuindex);
562
-                                foreach ($menuindex as $key => $value) {
562
+                                foreach ($menuindex as $key => $value) {
563 563
                                     $modx->db->query('UPDATE ' . $modx->getFullTableName('site_content') . ' SET menuindex=' . $key . ' WHERE id=' . $value);
564 564
                                 }
565
-                            } else {
565
+                            } else {
566 566
                                 // TODO: max(*) menuindex
567 567
                             }
568 568
 
569
-                            if (!$json['errors']) {
569
+                            if (!$json['errors']) {
570 570
                                 $json['success'] = $_lang["actioncomplete"];
571 571
 
572 572
                                 $modx->invokeEvent('onAfterMoveDocument', array(
@@ -578,7 +578,7 @@  discard block
 block discarded – undo
578 578
                         }
579 579
                     }
580 580
                 }
581
-            } else {
581
+            } else {
582 582
                 $json['errors'] = $_lang["error_no_privileges"];
583 583
             }
584 584
 
@@ -594,7 +594,7 @@  discard block
 block discarded – undo
594 594
 
595 595
             $output = !!$modx->elementIsLocked($type, $id, true);
596 596
 
597
-            if (!$output) {
597
+            if (!$output) {
598 598
                 $docgrp = (isset($_SESSION['mgrDocgroups']) && is_array($_SESSION['mgrDocgroups'])) ? implode(',', $_SESSION['mgrDocgroups']) : '';
599 599
                 $docgrp_cond = $docgrp ? ' OR dg.document_group IN (' . $docgrp . ')' : '';
600 600
                 $sql = '
@@ -603,7 +603,7 @@  discard block
 block discarded – undo
603 603
                     LEFT JOIN ' . $modx->getFullTableName('document_groups') . ' dg ON dg.document=sc.id
604 604
                     WHERE sc.id=' . $id . ' GROUP BY sc.id';
605 605
                 $sql = $modx->db->query($sql);
606
-                if ($modx->db->getRecordCount($sql)) {
606
+                if ($modx->db->getRecordCount($sql)) {
607 607
                     $row = $modx->db->getRow($sql);
608 608
                     $output = !!$row['locked'];
609 609
                 }
Please login to merge, or discard this patch.