Completed
Push — develop ( 7e4f1d...c463ba )
by Dmytro
11:42 queued 04:02
created
manager/frames/1.php 3 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -236,9 +236,9 @@
 block discarded – undo
236 236
         lockedElementsTranslation: <?= json_encode($unlockTranslations, JSON_FORCE_OBJECT | JSON_UNESCAPED_UNICODE) . "\n" ?>
237 237
       };
238 238
       <?php
239
-      $opened = array_filter(array_map('intval', explode('|', $_SESSION['openedArray'])));
240
-      echo (empty($opened) ? '' : 'modx.openedArray[' . implode("] = 1;\n		modx.openedArray[", $opened) . '] = 1;') . "\n";
241
-      ?>
239
+        $opened = array_filter(array_map('intval', explode('|', $_SESSION['openedArray'])));
240
+        echo (empty($opened) ? '' : 'modx.openedArray[' . implode("] = 1;\n		modx.openedArray[", $opened) . '] = 1;') . "\n";
241
+        ?>
242 242
     </script>
243 243
     <script src="media/style/<?= $modx->config['manager_theme'] ?>/js/modx.min.js?v=<?= $lastInstallTime ?>"></script>
244 244
     <?php if ($modx->config['show_picker'] != "0") { ?>
Please login to merge, or discard this patch.
Spacing   +41 added lines, -41 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");
@@ -47,9 +47,9 @@  discard block
 block discarded – undo
47 47
 
48 48
 $theme_modes = array('', 'lightness', 'light', 'dark', 'darkness');
49 49
 if (!empty($theme_modes[$_COOKIE['MODX_themeMode']])) {
50
-    $body_class .= ' ' . $theme_modes[$_COOKIE['MODX_themeMode']];
50
+    $body_class .= ' '.$theme_modes[$_COOKIE['MODX_themeMode']];
51 51
 } elseif (!empty($theme_modes[$modx->config['manager_theme_mode']])) {
52
-    $body_class .= ' ' . $theme_modes[$modx->config['manager_theme_mode']];
52
+    $body_class .= ' '.$theme_modes[$modx->config['manager_theme_mode']];
53 53
 }
54 54
 
55 55
 $navbar_position = $modx->config['manager_menu_position'];
@@ -82,36 +82,36 @@  discard block
 block discarded – undo
82 82
     $user['which_browser'] = $modx->config['which_browser'];
83 83
 }
84 84
 
85
-$css = 'media/style/' . $modx->config['manager_theme'] . '/css/page.css?v=' . $lastInstallTime;
85
+$css = 'media/style/'.$modx->config['manager_theme'].'/css/page.css?v='.$lastInstallTime;
86 86
 
87 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
-        require_once MODX_BASE_PATH . 'assets/lib/Formatter/CSSMinify.php';
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
+        require_once MODX_BASE_PATH.'assets/lib/Formatter/CSSMinify.php';
90 90
         $minifier = new Formatter\CSSMinify();
91
-        $minifier->addFile(MODX_MANAGER_PATH . 'media/style/common/bootstrap/css/bootstrap.min.css');
92
-        $minifier->addFile(MODX_MANAGER_PATH . 'media/style/common/font-awesome/css/font-awesome.min.css');
93
-        $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/fonts.css');
94
-        $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/forms.css');
95
-        $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/mainmenu.css');
96
-        $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/tree.css');
97
-        $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/custom.css');
98
-        $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/tabpane.css');
99
-        $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/contextmenu.css');
100
-        $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/index.css');
101
-        $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/main.css');
91
+        $minifier->addFile(MODX_MANAGER_PATH.'media/style/common/bootstrap/css/bootstrap.min.css');
92
+        $minifier->addFile(MODX_MANAGER_PATH.'media/style/common/font-awesome/css/font-awesome.min.css');
93
+        $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/fonts.css');
94
+        $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/forms.css');
95
+        $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/mainmenu.css');
96
+        $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/tree.css');
97
+        $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/custom.css');
98
+        $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/tabpane.css');
99
+        $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/contextmenu.css');
100
+        $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/index.css');
101
+        $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/main.css');
102 102
         $css = $minifier->minify();
103
-        file_put_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css', $css);
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')) {
106
-        $css = 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css?v=' . $lastInstallTime;
105
+    if (file_exists(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css')) {
106
+        $css = 'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css?v='.$lastInstallTime;
107 107
     }
108 108
 }
109 109
 
110
-$modx->config['global_tabs'] = (int)($modx->config['global_tabs'] && ($user['role'] == 1 || $modx->hasPermission('edit_template') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_plugin')));
110
+$modx->config['global_tabs'] = (int) ($modx->config['global_tabs'] && ($user['role'] == 1 || $modx->hasPermission('edit_template') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_plugin')));
111 111
 
112 112
 ?>
113 113
 <!DOCTYPE html>
114
-<html <?= (isset($modx_textdir) && $modx_textdir ? 'dir="rtl" lang="' : 'lang="') . $mxla . '" xml:lang="' . $mxla . '"' ?>>
114
+<html <?= (isset($modx_textdir) && $modx_textdir ? 'dir="rtl" lang="' : 'lang="').$mxla.'" xml:lang="'.$mxla.'"' ?>>
115 115
 <head>
116 116
     <title><?= $site_name ?>- (EVO CMS Manager)</title>
117 117
     <meta http-equiv="Content-Type" content="text/html; charset=<?= $modx_manager_charset ?>" />
@@ -142,21 +142,21 @@  discard block
 block discarded – undo
142 142
         MODX_SITE_URL: '<?= MODX_SITE_URL ?>',
143 143
         MODX_MANAGER_URL: '<?= MODX_MANAGER_URL ?>',
144 144
         user: {
145
-          role: <?= (int)$user['role'] ?>,
145
+          role: <?= (int) $user['role'] ?>,
146 146
           username: '<?= $user['username'] ?>'
147 147
         },
148 148
         config: {
149 149
           mail_check_timeperiod: <?= $modx->config['mail_check_timeperiod'] ?>,
150
-          menu_height: <?= (int)$menu_height ?>,
151
-          tree_width: <?= (int)$tree_width ?>,
152
-          tree_min_width: <?= (int)$tree_min_width ?>,
153
-          session_timeout: <?= (int)$modx->config['session_timeout'] ?>,
154
-          site_start: <?= (int)$modx->config['site_start'] ?>,
155
-          tree_page_click: <?=(!empty($modx->config['tree_page_click']) ? (int)$modx->config['tree_page_click'] : 27) ?>,
150
+          menu_height: <?= (int) $menu_height ?>,
151
+          tree_width: <?= (int) $tree_width ?>,
152
+          tree_min_width: <?= (int) $tree_min_width ?>,
153
+          session_timeout: <?= (int) $modx->config['session_timeout'] ?>,
154
+          site_start: <?= (int) $modx->config['site_start'] ?>,
155
+          tree_page_click: <?=(!empty($modx->config['tree_page_click']) ? (int) $modx->config['tree_page_click'] : 27) ?>,
156 156
           theme: '<?= $modx->config['manager_theme'] ?>',
157 157
           theme_mode: '<?= $modx->config['manager_theme_mode'] ?>',
158 158
           which_browser: '<?= $user['which_browser'] ?>',
159
-          layout: <?= (int)$manager_layout ?>,
159
+          layout: <?= (int) $manager_layout ?>,
160 160
           textdir: '<?= $modx_textdir ?>',
161 161
           global_tabs: <?= $modx->config['global_tabs'] ?>
162 162
 
@@ -241,11 +241,11 @@  discard block
 block discarded – undo
241 241
           delete a[b];
242 242
         },
243 243
         openedArray: [],
244
-        lockedElementsTranslation: <?= json_encode($unlockTranslations, JSON_FORCE_OBJECT | JSON_UNESCAPED_UNICODE) . "\n" ?>
244
+        lockedElementsTranslation: <?= json_encode($unlockTranslations, JSON_FORCE_OBJECT | JSON_UNESCAPED_UNICODE)."\n" ?>
245 245
       };
246 246
       <?php
247 247
       $opened = array_filter(array_map('intval', explode('|', $_SESSION['openedArray'])));
248
-      echo (empty($opened) ? '' : 'modx.openedArray[' . implode("] = 1;\n		modx.openedArray[", $opened) . '] = 1;') . "\n";
248
+      echo (empty($opened) ? '' : 'modx.openedArray['.implode("] = 1;\n		modx.openedArray[", $opened).'] = 1;')."\n";
249 249
       ?>
250 250
     </script>
251 251
     <script src="media/style/<?= $modx->config['manager_theme'] ?>/js/modx.min.js?v=<?= $lastInstallTime ?>"></script>
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
                             <a href="javascript:;" class="dropdown-toggle" onclick="return false;">
328 328
                                 <span class="username"><?= $user['username'] ?></span>
329 329
                                 <?php if ($user['photo']) { ?>
330
-                                    <span class="icon photo" style="background-image: url(<?= MODX_SITE_URL . $user['photo'] ?>);"></span>
330
+                                    <span class="icon photo" style="background-image: url(<?= MODX_SITE_URL.$user['photo'] ?>);"></span>
331 331
                                 <?php } else { ?>
332 332
                                     <span class="icon"><?= $_style['menu_user'] ?></span>
333 333
                                 <?php } ?>
@@ -354,7 +354,7 @@  discard block
 block discarded – undo
354 354
                                 $version = 'Evolution';
355 355
                                 ?>
356 356
                                 <?php
357
-                                echo sprintf('<li><span class="dropdown-item" title="%s &ndash; %s" %s>' . $version . ' %s</span></li>', $site_name, $modx->getVersionData('full_appname'), $style, $modx->config['settings_version']);
357
+                                echo sprintf('<li><span class="dropdown-item" title="%s &ndash; %s" %s>'.$version.' %s</span></li>', $site_name, $modx->getVersionData('full_appname'), $style, $modx->config['settings_version']);
358 358
                                 ?>
359 359
                             </ul>
360 360
                         </li>
@@ -537,7 +537,7 @@  discard block
 block discarded – undo
537 537
      */
538 538
     function constructLink($action, $img, $text, $allowed)
539 539
     {
540
-        if ((bool)$allowed) {
540
+        if ((bool) $allowed) {
541 541
             echo sprintf('<div class="menuLink" id="item%s" onclick="modx.tree.menuHandler(%s);">', $action, $action);
542 542
             echo sprintf('<i class="%s"></i> %s</div>', $img, $text);
543 543
         }
@@ -548,7 +548,7 @@  discard block
 block discarded – undo
548 548
     <script type="text/javascript">
549 549
 
550 550
       if (document.getElementById('treeMenu')) {
551
-          <?php if($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin')) { ?>
551
+          <?php if ($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin')) { ?>
552 552
 
553 553
         document.getElementById('treeMenu_openelements').onclick = function(e) {
554 554
           e.preventDefault();
@@ -566,12 +566,12 @@  discard block
 block discarded – undo
566 566
           }
567 567
         };
568 568
           <?php } ?>
569
-          <?php if($use_browser && $modx->hasPermission('assets_images')) { ?>
569
+          <?php if ($use_browser && $modx->hasPermission('assets_images')) { ?>
570 570
 
571 571
         document.getElementById('treeMenu_openimages').onclick = function(e) {
572 572
           e.preventDefault();
573 573
           if (modx.config.global_tabs && !e.shiftKey) {
574
-            modx.tabs({url: '<?= MODX_MANAGER_URL . 'media/browser/' . $which_browser . '/browse.php?filemanager=media/browser/' . $which_browser . '/browse.php&type=images' ?>', title: '<?= $_lang["images_management"] ?>'});
574
+            modx.tabs({url: '<?= MODX_MANAGER_URL.'media/browser/'.$which_browser.'/browse.php?filemanager=media/browser/'.$which_browser.'/browse.php&type=images' ?>', title: '<?= $_lang["images_management"] ?>'});
575 575
           } else {
576 576
             var randomNum = '<?= $_lang["files_files"] ?>';
577 577
             if (e.shiftKey) {
@@ -584,12 +584,12 @@  discard block
 block discarded – undo
584 584
           }
585 585
         };
586 586
           <?php } ?>
587
-          <?php if($use_browser && $modx->hasPermission('assets_files')) { ?>
587
+          <?php if ($use_browser && $modx->hasPermission('assets_files')) { ?>
588 588
 
589 589
         document.getElementById('treeMenu_openfiles').onclick = function(e) {
590 590
           e.preventDefault();
591 591
           if (modx.config.global_tabs && !e.shiftKey) {
592
-            modx.tabs({url: '<?= MODX_MANAGER_URL . 'media/browser/' . $which_browser . '/browse.php?filemanager=media/browser/' . $which_browser . '/browse.php&type=files' ?>', title: '<?= $_lang["files_files"] ?>'});
592
+            modx.tabs({url: '<?= MODX_MANAGER_URL.'media/browser/'.$which_browser.'/browse.php?filemanager=media/browser/'.$which_browser.'/browse.php&type=files' ?>', title: '<?= $_lang["files_files"] ?>'});
593 593
           } else {
594 594
             var randomNum = '<?= $_lang["files_files"] ?>';
595 595
             if (e.shiftKey) {
@@ -643,7 +643,7 @@  discard block
 block discarded – undo
643 643
 
644 644
 </div>
645 645
 <?php if ($modx->config['show_picker'] != "0") {
646
-    include('media/style/' . $modx->config['manager_theme'] . '/color.switcher.php');
646
+    include('media/style/'.$modx->config['manager_theme'].'/color.switcher.php');
647 647
 } ?>
648 648
 </body>
649 649
 </html>
Please login to merge, or discard this patch.
Braces   +31 added lines, -28 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->manager->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->manager->getLastUserSetting($param);
460 463
             }
461 464
         }
@@ -541,9 +544,9 @@  discard block
 block discarded – undo
541 544
      * @param string $text
542 545
      * @param bool $allowed
543 546
      */
544
-    function constructLink($action, $img, $text, $allowed)
545
-    {
546
-        if ((bool)$allowed) {
547
+    function constructLink($action, $img, $text, $allowed)
548
+    {
549
+        if ((bool)$allowed) {
547 550
             echo sprintf('<div class="menuLink" id="item%s" onclick="modx.tree.menuHandler(%s);">', $action, $action);
548 551
             echo sprintf('<i class="%s"></i> %s</div>', $img, $text);
549 552
         }
@@ -648,7 +651,7 @@  discard block
 block discarded – undo
648 651
     ?>
649 652
 
650 653
 </div>
651
-<?php if ($modx->config['show_picker'] != "0") {
654
+<?php if ($modx->config['show_picker'] != "0") {
652 655
     include('media/style/' . $modx->config['manager_theme'] . '/color.switcher.php');
653 656
 } ?>
654 657
 </body>
Please login to merge, or discard this patch.
manager/frames/mainmenu.php 3 patches
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->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,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.
Indentation   +325 added lines, -325 removed lines patch added patch discarded remove patch
@@ -4,237 +4,237 @@  discard block
 block discarded – undo
4 4
 */
5 5
 
6 6
 $sitemenu['bars'] = array(
7
-	'bars',
8
-	'main',
9
-	'<i class="fa fa-bars"></i>',
10
-	'javascript:;',
11
-	$_lang['home'],
12
-	'modx.resizer.toggle(); return false;',
13
-	' return false;',
14
-	'',
15
-	0,
16
-	10,
17
-	''
7
+    'bars',
8
+    'main',
9
+    '<i class="fa fa-bars"></i>',
10
+    'javascript:;',
11
+    $_lang['home'],
12
+    'modx.resizer.toggle(); return false;',
13
+    ' return false;',
14
+    '',
15
+    0,
16
+    10,
17
+    ''
18 18
 );
19 19
 
20 20
 //mainMenu
21 21
 $sitemenu['site'] = array(
22
-	'site',
23
-	'main',
24
-	'<i class="fa fa-tachometer"></i><span class="menu-item-text">' . $_lang['home'] . '</span>',
25
-	'index.php?a=2',
26
-	$_lang['home'],
27
-	'',
28
-	'',
29
-	'main',
30
-	0,
31
-	10,
32
-	'active'
22
+    'site',
23
+    'main',
24
+    '<i class="fa fa-tachometer"></i><span class="menu-item-text">' . $_lang['home'] . '</span>',
25
+    'index.php?a=2',
26
+    $_lang['home'],
27
+    '',
28
+    '',
29
+    'main',
30
+    0,
31
+    10,
32
+    'active'
33 33
 );
34 34
 
35 35
 if($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('file_manager')) {
36
-	$sitemenu['elements'] = array(
37
-		'elements',
38
-		'main',
39
-		'<i class="fa fa-th"></i><span class="menu-item-text">' . $_lang['elements'] . '</span>',
40
-		'javascript:;',
41
-		$_lang['elements'],
42
-		' return false;',
43
-		'',
44
-		'',
45
-		0,
46
-		20,
47
-		''
48
-	);
36
+    $sitemenu['elements'] = array(
37
+        'elements',
38
+        'main',
39
+        '<i class="fa fa-th"></i><span class="menu-item-text">' . $_lang['elements'] . '</span>',
40
+        'javascript:;',
41
+        $_lang['elements'],
42
+        ' return false;',
43
+        '',
44
+        '',
45
+        0,
46
+        20,
47
+        ''
48
+    );
49 49
 }
50 50
 
51 51
 if($modx->hasPermission('exec_module')) {
52
-	$sitemenu['modules'] = array(
53
-		'modules',
54
-		'main',
55
-		'<i class="'.$_style['icons_modules'] .'"></i><span class="menu-item-text">' . $_lang['modules'] . '</span>',
56
-		'javascript:;',
57
-		$_lang['modules'],
58
-		' return false;',
59
-		'',
60
-		'',
61
-		0,
62
-		30,
63
-		''
64
-	);
52
+    $sitemenu['modules'] = array(
53
+        'modules',
54
+        'main',
55
+        '<i class="'.$_style['icons_modules'] .'"></i><span class="menu-item-text">' . $_lang['modules'] . '</span>',
56
+        'javascript:;',
57
+        $_lang['modules'],
58
+        ' return false;',
59
+        '',
60
+        '',
61
+        0,
62
+        30,
63
+        ''
64
+    );
65 65
 }
66 66
 
67 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
-	$sitemenu['users'] = array(
69
-		'users',
70
-		'main',
71
-		'<i class="fa fa-users"></i><span class="menu-item-text">' . $_lang['users'] . '</span>',
72
-		'javascript:;',
73
-		$_lang['users'],
74
-		' return false;',
75
-		'edit_user',
76
-		'',
77
-		0,
78
-		40,
79
-		''
80
-	);
68
+    $sitemenu['users'] = array(
69
+        'users',
70
+        'main',
71
+        '<i class="fa fa-users"></i><span class="menu-item-text">' . $_lang['users'] . '</span>',
72
+        'javascript:;',
73
+        $_lang['users'],
74
+        ' return false;',
75
+        'edit_user',
76
+        '',
77
+        0,
78
+        40,
79
+        ''
80
+    );
81 81
 }
82 82
 
83 83
 if($modx->hasPermission('empty_cache') || $modx->hasPermission('bk_manager') || $modx->hasPermission('remove_locks') || $modx->hasPermission('import_static') || $modx->hasPermission('export_static')) {
84
-	$sitemenu['tools'] = array(
85
-		'tools',
86
-		'main',
87
-		'<i class="fa fa-wrench"></i><span class="menu-item-text">' . $_lang['tools'] . '</span>',
88
-		'javascript:;',
89
-		$_lang['tools'],
90
-		' return false;',
91
-		'',
92
-		'',
93
-		0,
94
-		50,
95
-		''
96
-	);
84
+    $sitemenu['tools'] = array(
85
+        'tools',
86
+        'main',
87
+        '<i class="fa fa-wrench"></i><span class="menu-item-text">' . $_lang['tools'] . '</span>',
88
+        'javascript:;',
89
+        $_lang['tools'],
90
+        ' return false;',
91
+        '',
92
+        '',
93
+        0,
94
+        50,
95
+        ''
96
+    );
97 97
 }
98 98
 
99 99
 $tab = 0;
100 100
 if($modx->hasPermission('edit_template')) {
101
-	$sitemenu['element_templates'] = array(
102
-		'element_templates',
103
-		'elements',
104
-		'<i class="fa fa-newspaper-o"></i>' . $_lang['manage_templates'] . '<i class="fa fa-angle-right toggle"></i>',
105
-		'index.php?a=76&tab=' . $tab++,
106
-		$_lang['manage_templates'],
107
-		'',
108
-		'new_template,edit_template',
109
-		'main',
110
-		0,
111
-		10,
112
-		'dropdown-toggle'
113
-	);
101
+    $sitemenu['element_templates'] = array(
102
+        'element_templates',
103
+        'elements',
104
+        '<i class="fa fa-newspaper-o"></i>' . $_lang['manage_templates'] . '<i class="fa fa-angle-right toggle"></i>',
105
+        'index.php?a=76&tab=' . $tab++,
106
+        $_lang['manage_templates'],
107
+        '',
108
+        'new_template,edit_template',
109
+        'main',
110
+        0,
111
+        10,
112
+        'dropdown-toggle'
113
+    );
114 114
 }
115 115
 if($modx->hasPermission('edit_template') && $modx->hasPermission('edit_snippet') && $modx->hasPermission('edit_chunk') && $modx->hasPermission('edit_plugin')) {
116
-	$sitemenu['element_tplvars'] = array(
117
-		'element_tplvars',
118
-		'elements',
119
-		'<i class="fa fa-list-alt"></i>' . $_lang['tmplvars'] . '<i class="fa fa-angle-right toggle"></i>',
120
-		'index.php?a=76&tab=' . $tab++,
121
-		$_lang['tmplvars'],
122
-		'',
123
-		'new_template,edit_template',
124
-		'main',
125
-		0,
126
-		20,
127
-		'dropdown-toggle'
128
-	);
116
+    $sitemenu['element_tplvars'] = array(
117
+        'element_tplvars',
118
+        'elements',
119
+        '<i class="fa fa-list-alt"></i>' . $_lang['tmplvars'] . '<i class="fa fa-angle-right toggle"></i>',
120
+        'index.php?a=76&tab=' . $tab++,
121
+        $_lang['tmplvars'],
122
+        '',
123
+        'new_template,edit_template',
124
+        'main',
125
+        0,
126
+        20,
127
+        'dropdown-toggle'
128
+    );
129 129
 }
130 130
 if($modx->hasPermission('edit_chunk')) {
131
-	$sitemenu['element_htmlsnippets'] = array(
132
-		'element_htmlsnippets',
133
-		'elements',
134
-		'<i class="fa fa-th-large"></i>' . $_lang['manage_htmlsnippets'] . '<i class="fa fa-angle-right toggle"></i>',
135
-		'index.php?a=76&tab=' . $tab++,
136
-		$_lang['manage_htmlsnippets'],
137
-		'',
138
-		'new_chunk,edit_chunk',
139
-		'main',
140
-		0,
141
-		30,
142
-		'dropdown-toggle'
143
-	);
131
+    $sitemenu['element_htmlsnippets'] = array(
132
+        'element_htmlsnippets',
133
+        'elements',
134
+        '<i class="fa fa-th-large"></i>' . $_lang['manage_htmlsnippets'] . '<i class="fa fa-angle-right toggle"></i>',
135
+        'index.php?a=76&tab=' . $tab++,
136
+        $_lang['manage_htmlsnippets'],
137
+        '',
138
+        'new_chunk,edit_chunk',
139
+        'main',
140
+        0,
141
+        30,
142
+        'dropdown-toggle'
143
+    );
144 144
 }
145 145
 if($modx->hasPermission('edit_snippet')) {
146
-	$sitemenu['element_snippets'] = array(
147
-		'element_snippets',
148
-		'elements',
149
-		'<i class="fa fa-code"></i>' . $_lang['manage_snippets'] . '<i class="fa fa-angle-right toggle"></i>',
150
-		'index.php?a=76&tab=' . $tab++,
151
-		$_lang['manage_snippets'],
152
-		'',
153
-		'new_snippet,edit_snippet',
154
-		'main',
155
-		0,
156
-		40,
157
-		'dropdown-toggle'
158
-	);
146
+    $sitemenu['element_snippets'] = array(
147
+        'element_snippets',
148
+        'elements',
149
+        '<i class="fa fa-code"></i>' . $_lang['manage_snippets'] . '<i class="fa fa-angle-right toggle"></i>',
150
+        'index.php?a=76&tab=' . $tab++,
151
+        $_lang['manage_snippets'],
152
+        '',
153
+        'new_snippet,edit_snippet',
154
+        'main',
155
+        0,
156
+        40,
157
+        'dropdown-toggle'
158
+    );
159 159
 }
160 160
 if($modx->hasPermission('edit_plugin')) {
161
-	$sitemenu['element_plugins'] = array(
162
-		'element_plugins',
163
-		'elements',
164
-		'<i class="fa fa-plug"></i>' . $_lang['manage_plugins'] . '<i class="fa fa-angle-right toggle"></i>',
165
-		'index.php?a=76&tab=' . $tab++,
166
-		$_lang['manage_plugins'],
167
-		'',
168
-		'new_plugin,edit_plugin',
169
-		'main',
170
-		0,
171
-		50,
172
-		'dropdown-toggle'
173
-	);
161
+    $sitemenu['element_plugins'] = array(
162
+        'element_plugins',
163
+        'elements',
164
+        '<i class="fa fa-plug"></i>' . $_lang['manage_plugins'] . '<i class="fa fa-angle-right toggle"></i>',
165
+        'index.php?a=76&tab=' . $tab++,
166
+        $_lang['manage_plugins'],
167
+        '',
168
+        'new_plugin,edit_plugin',
169
+        'main',
170
+        0,
171
+        50,
172
+        'dropdown-toggle'
173
+    );
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 177
 if($modx->hasPermission('file_manager')) {
178
-	$sitemenu['manage_files'] = array(
179
-		'manage_files',
180
-		'elements',
181
-		'<i class="fa fa-folder-open-o"></i>' . $_lang['manage_files'],
182
-		'index.php?a=31',
183
-		$_lang['manage_files'],
184
-		'',
185
-		'file_manager',
186
-		'main',
187
-		0,
188
-		80,
189
-		''
190
-	);
178
+    $sitemenu['manage_files'] = array(
179
+        'manage_files',
180
+        'elements',
181
+        '<i class="fa fa-folder-open-o"></i>' . $_lang['manage_files'],
182
+        'index.php?a=31',
183
+        $_lang['manage_files'],
184
+        '',
185
+        'file_manager',
186
+        'main',
187
+        0,
188
+        80,
189
+        ''
190
+    );
191 191
 }
192 192
 if($modx->hasPermission('category_manager')) {
193
-	$sitemenu['manage_categories'] = array(
194
-		'manage_categories',
195
-		'elements',
196
-		'<i class="fa fa-object-group"></i>' . $_lang['manage_categories'],
197
-		'index.php?a=120',
198
-		$_lang['manage_categories'],
199
-		'',
200
-		'category_manager',
201
-		'main',
202
-		0,
203
-		70,
204
-		''
205
-	);
193
+    $sitemenu['manage_categories'] = array(
194
+        'manage_categories',
195
+        'elements',
196
+        '<i class="fa fa-object-group"></i>' . $_lang['manage_categories'],
197
+        'index.php?a=120',
198
+        $_lang['manage_categories'],
199
+        '',
200
+        'category_manager',
201
+        'main',
202
+        0,
203
+        70,
204
+        ''
205
+    );
206 206
 }
207 207
 
208 208
 // Modules Menu Items
209 209
 if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module') || $modx->hasPermission('save_module')) {
210
-	$sitemenu['new_module'] = array(
211
-		'new_module',
212
-		'modules',
213
-		'<i class="'.$_style['icons_modules'] .'"></i>' . $_lang['module_management'],
214
-		'index.php?a=106',
215
-		$_lang['module_management'],
216
-		'',
217
-		'new_module,edit_module',
218
-		'main',
219
-		1,
220
-		0,
221
-		''
222
-	);
210
+    $sitemenu['new_module'] = array(
211
+        'new_module',
212
+        'modules',
213
+        '<i class="'.$_style['icons_modules'] .'"></i>' . $_lang['module_management'],
214
+        'index.php?a=106',
215
+        $_lang['module_management'],
216
+        '',
217
+        'new_module,edit_module',
218
+        'main',
219
+        1,
220
+        0,
221
+        ''
222
+    );
223 223
 }
224 224
 
225 225
 if($modx->hasPermission('exec_module')) {
226
-	if($_SESSION['mgrRole'] != 1 && !empty($modx->config['use_udperms'])) {
227
-		$rs = $modx->db->query('SELECT DISTINCT sm.id, sm.name, sm.icon, mg.member
226
+    if($_SESSION['mgrRole'] != 1 && !empty($modx->config['use_udperms'])) {
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 {
234
-		$rs = $modx->db->select('*', $modx->getFullTableName('site_modules'), 'disabled != 1', 'name');
235
-	}
236
-	if($modx->db->getRecordCount($rs)) {
237
-	    while ($row = $modx->db->getRow($rs)) {
233
+    } else {
234
+        $rs = $modx->db->select('*', $modx->getFullTableName('site_modules'), 'disabled != 1', 'name');
235
+    }
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',
@@ -255,83 +255,83 @@  discard block
 block discarded – undo
255 255
 // security menu items (users)
256 256
 
257 257
 if($modx->hasPermission('edit_user')) {
258
-	$sitemenu['user_management_title'] = array(
259
-		'user_management_title',
260
-		'users',
261
-		'<i class="fa fa fa-user"></i>' . $_lang['user_management_title'] . '<i class="fa fa-angle-right toggle"></i>',
262
-		'index.php?a=75',
263
-		$_lang['user_management_title'],
264
-		'',
265
-		'edit_user',
266
-		'main',
267
-		0,
268
-		10,
269
-		'dropdown-toggle'
270
-	);
258
+    $sitemenu['user_management_title'] = array(
259
+        'user_management_title',
260
+        'users',
261
+        '<i class="fa fa fa-user"></i>' . $_lang['user_management_title'] . '<i class="fa fa-angle-right toggle"></i>',
262
+        'index.php?a=75',
263
+        $_lang['user_management_title'],
264
+        '',
265
+        'edit_user',
266
+        'main',
267
+        0,
268
+        10,
269
+        'dropdown-toggle'
270
+    );
271 271
 }
272 272
 
273 273
 if($modx->hasPermission('edit_web_user')) {
274
-	$sitemenu['web_user_management_title'] = array(
275
-		'web_user_management_title',
276
-		'users',
277
-		'<i class="fa fa-users"></i>' . $_lang['web_user_management_title'] . '<i class="fa fa-angle-right toggle"></i>',
278
-		'index.php?a=99',
279
-		$_lang['web_user_management_title'],
280
-		'',
281
-		'edit_web_user',
282
-		'main',
283
-		0,
284
-		20,
285
-		'dropdown-toggle'
286
-	);
274
+    $sitemenu['web_user_management_title'] = array(
275
+        'web_user_management_title',
276
+        'users',
277
+        '<i class="fa fa-users"></i>' . $_lang['web_user_management_title'] . '<i class="fa fa-angle-right toggle"></i>',
278
+        'index.php?a=99',
279
+        $_lang['web_user_management_title'],
280
+        '',
281
+        'edit_web_user',
282
+        'main',
283
+        0,
284
+        20,
285
+        'dropdown-toggle'
286
+    );
287 287
 }
288 288
 
289 289
 if($modx->hasPermission('edit_role')) {
290
-	$sitemenu['role_management_title'] = array(
291
-		'role_management_title',
292
-		'users',
293
-		'<i class="fa fa-legal"></i>' . $_lang['role_management_title'],
294
-		'index.php?a=86',
295
-		$_lang['role_management_title'],
296
-		'',
297
-		'new_role,edit_role,delete_role',
298
-		'main',
299
-		0,
300
-		30,
301
-		''
302
-	);
290
+    $sitemenu['role_management_title'] = array(
291
+        'role_management_title',
292
+        'users',
293
+        '<i class="fa fa-legal"></i>' . $_lang['role_management_title'],
294
+        'index.php?a=86',
295
+        $_lang['role_management_title'],
296
+        '',
297
+        'new_role,edit_role,delete_role',
298
+        'main',
299
+        0,
300
+        30,
301
+        ''
302
+    );
303 303
 }
304 304
 
305 305
 if($modx->hasPermission('access_permissions')) {
306
-	$sitemenu['manager_permissions'] = array(
307
-		'manager_permissions',
308
-		'users',
309
-		'<i class="fa fa-male"></i>' . $_lang['manager_permissions'],
310
-		'index.php?a=40',
311
-		$_lang['manager_permissions'],
312
-		'',
313
-		'access_permissions',
314
-		'main',
315
-		0,
316
-		40,
317
-		''
318
-	);
306
+    $sitemenu['manager_permissions'] = array(
307
+        'manager_permissions',
308
+        'users',
309
+        '<i class="fa fa-male"></i>' . $_lang['manager_permissions'],
310
+        'index.php?a=40',
311
+        $_lang['manager_permissions'],
312
+        '',
313
+        'access_permissions',
314
+        'main',
315
+        0,
316
+        40,
317
+        ''
318
+    );
319 319
 }
320 320
 
321 321
 if($modx->hasPermission('web_access_permissions')) {
322
-	$sitemenu['web_permissions'] = array(
323
-		'web_permissions',
324
-		'users',
325
-		'<i class="fa fa-universal-access"></i>' . $_lang['web_permissions'],
326
-		'index.php?a=91',
327
-		$_lang['web_permissions'],
328
-		'',
329
-		'web_access_permissions',
330
-		'main',
331
-		0,
332
-		50,
333
-		''
334
-	);
322
+    $sitemenu['web_permissions'] = array(
323
+        'web_permissions',
324
+        'users',
325
+        '<i class="fa fa-universal-access"></i>' . $_lang['web_permissions'],
326
+        'index.php?a=91',
327
+        $_lang['web_permissions'],
328
+        '',
329
+        'web_access_permissions',
330
+        'main',
331
+        0,
332
+        50,
333
+        ''
334
+    );
335 335
 }
336 336
 
337 337
 // Tools Menu
@@ -361,104 +361,104 @@  discard block
 block discarded – undo
361 361
 );
362 362
 
363 363
 $sitemenu['search'] = array(
364
-	'search',
365
-	'tools',
366
-	'<i class="fa fa-search"></i>' . $_lang['search'],
367
-	'index.php?a=71',
368
-	$_lang['search'],
369
-	'',
370
-	'',
371
-	'main',
372
-	1,
373
-	9,
374
-	''
364
+    'search',
365
+    'tools',
366
+    '<i class="fa fa-search"></i>' . $_lang['search'],
367
+    'index.php?a=71',
368
+    $_lang['search'],
369
+    '',
370
+    '',
371
+    'main',
372
+    1,
373
+    9,
374
+    ''
375 375
 );
376 376
 
377 377
 if($modx->hasPermission('bk_manager')) {
378
-	$sitemenu['bk_manager'] = array(
379
-		'bk_manager',
380
-		'tools',
381
-		'<i class="fa fa-database"></i>' . $_lang['bk_manager'],
382
-		'index.php?a=93',
383
-		$_lang['bk_manager'],
384
-		'',
385
-		'bk_manager',
386
-		'main',
387
-		0,
388
-		10,
389
-		''
390
-	);
378
+    $sitemenu['bk_manager'] = array(
379
+        'bk_manager',
380
+        'tools',
381
+        '<i class="fa fa-database"></i>' . $_lang['bk_manager'],
382
+        'index.php?a=93',
383
+        $_lang['bk_manager'],
384
+        '',
385
+        'bk_manager',
386
+        'main',
387
+        0,
388
+        10,
389
+        ''
390
+    );
391 391
 }
392 392
 
393 393
 if($modx->hasPermission('remove_locks')) {
394
-	$sitemenu['remove_locks'] = array(
395
-		'remove_locks',
396
-		'tools',
397
-		'<i class="fa fa-hourglass"></i>' . $_lang['remove_locks'],
398
-		'javascript:modx.removeLocks();',
399
-		$_lang['remove_locks'],
400
-		'',
401
-		'remove_locks',
402
-		'',
403
-		0,
404
-		20,
405
-		''
406
-	);
394
+    $sitemenu['remove_locks'] = array(
395
+        'remove_locks',
396
+        'tools',
397
+        '<i class="fa fa-hourglass"></i>' . $_lang['remove_locks'],
398
+        'javascript:modx.removeLocks();',
399
+        $_lang['remove_locks'],
400
+        '',
401
+        'remove_locks',
402
+        '',
403
+        0,
404
+        20,
405
+        ''
406
+    );
407 407
 }
408 408
 
409 409
 if($modx->hasPermission('import_static')) {
410
-	$sitemenu['import_site'] = array(
411
-		'import_site',
412
-		'tools',
413
-		'<i class="fa fa-upload"></i>' . $_lang['import_site'],
414
-		'index.php?a=95',
415
-		$_lang['import_site'],
416
-		'',
417
-		'import_static',
418
-		'main',
419
-		0,
420
-		30,
421
-		''
422
-	);
410
+    $sitemenu['import_site'] = array(
411
+        'import_site',
412
+        'tools',
413
+        '<i class="fa fa-upload"></i>' . $_lang['import_site'],
414
+        'index.php?a=95',
415
+        $_lang['import_site'],
416
+        '',
417
+        'import_static',
418
+        'main',
419
+        0,
420
+        30,
421
+        ''
422
+    );
423 423
 }
424 424
 
425 425
 if($modx->hasPermission('export_static')) {
426
-	$sitemenu['export_site'] = array(
427
-		'export_site',
428
-		'tools',
429
-		'<i class="fa fa-download"></i>' . $_lang['export_site'],
430
-		'index.php?a=83',
431
-		$_lang['export_site'],
432
-		'',
433
-		'export_static',
434
-		'main',
435
-		1,
436
-		40,
437
-		''
438
-	);
426
+    $sitemenu['export_site'] = array(
427
+        'export_site',
428
+        'tools',
429
+        '<i class="fa fa-download"></i>' . $_lang['export_site'],
430
+        'index.php?a=83',
431
+        $_lang['export_site'],
432
+        '',
433
+        'export_static',
434
+        'main',
435
+        1,
436
+        40,
437
+        ''
438
+    );
439 439
 }
440 440
 
441 441
 $menu = $modx->invokeEvent("OnManagerMenuPrerender", array('menu' => $sitemenu));
442 442
 if(is_array($menu)) {
443
-	$newmenu = array();
444
-	foreach($menu as $item){
445
-		if(is_array(unserialize($item))){
446
-			$newmenu = array_merge($newmenu, unserialize($item));
447
-		}
448
-	}
449
-	if(count($newmenu)> 0) $sitemenu = $newmenu;
443
+    $newmenu = array();
444
+    foreach($menu as $item){
445
+        if(is_array(unserialize($item))){
446
+            $newmenu = array_merge($newmenu, unserialize($item));
447
+        }
448
+    }
449
+    if(count($newmenu)> 0) $sitemenu = $newmenu;
450 450
 }
451 451
 
452 452
 if(file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/includes/menu.class.inc.php')) {
453
-	include_once(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/includes/menu.class.inc.php');
453
+    include_once(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/includes/menu.class.inc.php');
454 454
 } else {
455
-	include_once(MODX_MANAGER_PATH . 'includes/menu.class.inc.php');
455
+    include_once(MODX_MANAGER_PATH . 'includes/menu.class.inc.php');
456 456
 }
457 457
 $menu = new EVOmenu();
458 458
 $menu->Build($sitemenu, array(
459
-	'outerClass' => 'nav',
460
-	'innerClass' => 'dropdown-menu',
461
-	'parentClass' => 'dropdown',
459
+    'outerClass' => 'nav',
460
+    'innerClass' => 'dropdown-menu',
461
+    'parentClass' => 'dropdown',
462 462
     'parentLinkClass' => 'dropdown-toggle',
463 463
     'parentLinkAttr' => '',
464 464
     'parentLinkIn' => ''
Please login to merge, or discard this patch.
Spacing   +69 added lines, -69 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 $sitemenu['site'] = array(
22 22
 	'site',
23 23
 	'main',
24
-	'<i class="fa fa-tachometer"></i><span class="menu-item-text">' . $_lang['home'] . '</span>',
24
+	'<i class="fa fa-tachometer"></i><span class="menu-item-text">'.$_lang['home'].'</span>',
25 25
 	'index.php?a=2',
26 26
 	$_lang['home'],
27 27
 	'',
@@ -32,11 +32,11 @@  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',
39
-		'<i class="fa fa-th"></i><span class="menu-item-text">' . $_lang['elements'] . '</span>',
39
+		'<i class="fa fa-th"></i><span class="menu-item-text">'.$_lang['elements'].'</span>',
40 40
 		'javascript:;',
41 41
 		$_lang['elements'],
42 42
 		' return false;',
@@ -48,11 +48,11 @@  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',
55
-		'<i class="'.$_style['icons_modules'] .'"></i><span class="menu-item-text">' . $_lang['modules'] . '</span>',
55
+		'<i class="'.$_style['icons_modules'].'"></i><span class="menu-item-text">'.$_lang['modules'].'</span>',
56 56
 		'javascript:;',
57 57
 		$_lang['modules'],
58 58
 		' return false;',
@@ -64,11 +64,11 @@  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',
71
-		'<i class="fa fa-users"></i><span class="menu-item-text">' . $_lang['users'] . '</span>',
71
+		'<i class="fa fa-users"></i><span class="menu-item-text">'.$_lang['users'].'</span>',
72 72
 		'javascript:;',
73 73
 		$_lang['users'],
74 74
 		' return false;',
@@ -80,11 +80,11 @@  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',
87
-		'<i class="fa fa-wrench"></i><span class="menu-item-text">' . $_lang['tools'] . '</span>',
87
+		'<i class="fa fa-wrench"></i><span class="menu-item-text">'.$_lang['tools'].'</span>',
88 88
 		'javascript:;',
89 89
 		$_lang['tools'],
90 90
 		' return false;',
@@ -97,12 +97,12 @@  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',
104
-		'<i class="fa fa-newspaper-o"></i>' . $_lang['manage_templates'] . '<i class="fa fa-angle-right toggle"></i>',
105
-		'index.php?a=76&tab=' . $tab++,
104
+		'<i class="fa fa-newspaper-o"></i>'.$_lang['manage_templates'].'<i class="fa fa-angle-right toggle"></i>',
105
+		'index.php?a=76&tab='.$tab++,
106 106
 		$_lang['manage_templates'],
107 107
 		'',
108 108
 		'new_template,edit_template',
@@ -112,12 +112,12 @@  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',
119
-		'<i class="fa fa-list-alt"></i>' . $_lang['tmplvars'] . '<i class="fa fa-angle-right toggle"></i>',
120
-		'index.php?a=76&tab=' . $tab++,
119
+		'<i class="fa fa-list-alt"></i>'.$_lang['tmplvars'].'<i class="fa fa-angle-right toggle"></i>',
120
+		'index.php?a=76&tab='.$tab++,
121 121
 		$_lang['tmplvars'],
122 122
 		'',
123 123
 		'new_template,edit_template',
@@ -127,12 +127,12 @@  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',
134
-		'<i class="fa fa-th-large"></i>' . $_lang['manage_htmlsnippets'] . '<i class="fa fa-angle-right toggle"></i>',
135
-		'index.php?a=76&tab=' . $tab++,
134
+		'<i class="fa fa-th-large"></i>'.$_lang['manage_htmlsnippets'].'<i class="fa fa-angle-right toggle"></i>',
135
+		'index.php?a=76&tab='.$tab++,
136 136
 		$_lang['manage_htmlsnippets'],
137 137
 		'',
138 138
 		'new_chunk,edit_chunk',
@@ -142,12 +142,12 @@  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',
149
-		'<i class="fa fa-code"></i>' . $_lang['manage_snippets'] . '<i class="fa fa-angle-right toggle"></i>',
150
-		'index.php?a=76&tab=' . $tab++,
149
+		'<i class="fa fa-code"></i>'.$_lang['manage_snippets'].'<i class="fa fa-angle-right toggle"></i>',
150
+		'index.php?a=76&tab='.$tab++,
151 151
 		$_lang['manage_snippets'],
152 152
 		'',
153 153
 		'new_snippet,edit_snippet',
@@ -157,12 +157,12 @@  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',
164
-		'<i class="fa fa-plug"></i>' . $_lang['manage_plugins'] . '<i class="fa fa-angle-right toggle"></i>',
165
-		'index.php?a=76&tab=' . $tab++,
164
+		'<i class="fa fa-plug"></i>'.$_lang['manage_plugins'].'<i class="fa fa-angle-right toggle"></i>',
165
+		'index.php?a=76&tab='.$tab++,
166 166
 		$_lang['manage_plugins'],
167 167
 		'',
168 168
 		'new_plugin,edit_plugin',
@@ -174,11 +174,11 @@  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',
181
-		'<i class="fa fa-folder-open-o"></i>' . $_lang['manage_files'],
181
+		'<i class="fa fa-folder-open-o"></i>'.$_lang['manage_files'],
182 182
 		'index.php?a=31',
183 183
 		$_lang['manage_files'],
184 184
 		'',
@@ -189,11 +189,11 @@  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',
196
-		'<i class="fa fa-object-group"></i>' . $_lang['manage_categories'],
196
+		'<i class="fa fa-object-group"></i>'.$_lang['manage_categories'],
197 197
 		'index.php?a=120',
198 198
 		$_lang['manage_categories'],
199 199
 		'',
@@ -206,11 +206,11 @@  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',
213
-		'<i class="'.$_style['icons_modules'] .'"></i>' . $_lang['module_management'],
213
+		'<i class="'.$_style['icons_modules'].'"></i>'.$_lang['module_management'],
214 214
 		'index.php?a=106',
215 215
 		$_lang['module_management'],
216 216
 		'',
@@ -222,24 +222,24 @@  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
-				FROM ' . $modx->getFullTableName('site_modules') . ' AS sm
229
-				LEFT JOIN ' . $modx->getFullTableName('site_module_access') . ' AS sma ON sma.module = sm.id
230
-				LEFT JOIN ' . $modx->getFullTableName('member_groups') . ' AS mg ON sma.usergroup = mg.user_group
231
-                WHERE (mg.member IS NULL OR mg.member = ' . $modx->getLoginUserID() . ') AND sm.disabled != 1 AND sm.locked != 1
228
+				FROM ' . $modx->getFullTableName('site_modules').' AS sm
229
+				LEFT JOIN ' . $modx->getFullTableName('site_module_access').' AS sma ON sma.module = sm.id
230
+				LEFT JOIN ' . $modx->getFullTableName('member_groups').' AS mg ON sma.usergroup = mg.user_group
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 233
 	} else {
234 234
 		$rs = $modx->db->select('*', $modx->getFullTableName('site_modules'), 'disabled != 1', 'name');
235 235
 	}
236
-	if($modx->db->getRecordCount($rs)) {
236
+	if ($modx->db->getRecordCount($rs)) {
237 237
 	    while ($row = $modx->db->getRow($rs)) {
238
-            $sitemenu['module' . $row['id']] = array(
239
-                'module' . $row['id'],
238
+            $sitemenu['module'.$row['id']] = array(
239
+                'module'.$row['id'],
240 240
                 'modules',
241
-                ($row['icon'] != '' ? '<i class="'.$row['icon'].'"></i>' : '<i class="'.$_style['icons_module'].'"></i>') . $row['name'],
242
-                'index.php?a=112&id=' . $row['id'],
241
+                ($row['icon'] != '' ? '<i class="'.$row['icon'].'"></i>' : '<i class="'.$_style['icons_module'].'"></i>').$row['name'],
242
+                'index.php?a=112&id='.$row['id'],
243 243
                 $row['name'],
244 244
                 '',
245 245
                 '',
@@ -254,11 +254,11 @@  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',
261
-		'<i class="fa fa fa-user"></i>' . $_lang['user_management_title'] . '<i class="fa fa-angle-right toggle"></i>',
261
+		'<i class="fa fa fa-user"></i>'.$_lang['user_management_title'].'<i class="fa fa-angle-right toggle"></i>',
262 262
 		'index.php?a=75',
263 263
 		$_lang['user_management_title'],
264 264
 		'',
@@ -270,11 +270,11 @@  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',
277
-		'<i class="fa fa-users"></i>' . $_lang['web_user_management_title'] . '<i class="fa fa-angle-right toggle"></i>',
277
+		'<i class="fa fa-users"></i>'.$_lang['web_user_management_title'].'<i class="fa fa-angle-right toggle"></i>',
278 278
 		'index.php?a=99',
279 279
 		$_lang['web_user_management_title'],
280 280
 		'',
@@ -286,11 +286,11 @@  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',
293
-		'<i class="fa fa-legal"></i>' . $_lang['role_management_title'],
293
+		'<i class="fa fa-legal"></i>'.$_lang['role_management_title'],
294 294
 		'index.php?a=86',
295 295
 		$_lang['role_management_title'],
296 296
 		'',
@@ -302,11 +302,11 @@  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',
309
-		'<i class="fa fa-male"></i>' . $_lang['manager_permissions'],
309
+		'<i class="fa fa-male"></i>'.$_lang['manager_permissions'],
310 310
 		'index.php?a=40',
311 311
 		$_lang['manager_permissions'],
312 312
 		'',
@@ -318,11 +318,11 @@  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',
325
-		'<i class="fa fa-universal-access"></i>' . $_lang['web_permissions'],
325
+		'<i class="fa fa-universal-access"></i>'.$_lang['web_permissions'],
326 326
 		'index.php?a=91',
327 327
 		$_lang['web_permissions'],
328 328
 		'',
@@ -339,7 +339,7 @@  discard block
 block discarded – undo
339 339
 $sitemenu['refresh_site'] = array(
340 340
     'refresh_site',
341 341
     'tools',
342
-    '<i class="fa fa-recycle"></i>' . $_lang['refresh_site'],
342
+    '<i class="fa fa-recycle"></i>'.$_lang['refresh_site'],
343 343
     'index.php?a=26',
344 344
     $_lang['refresh_site'],
345 345
     '',
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
             'a', // tag
354 354
             'javascript:;', // href
355 355
             'btn btn-secondary', // class or btn-success
356
-            'modx.popup({url:\'index.php?a=26\', title:\'' . $_lang['refresh_site'] . '\', icon: \'fa-recycle\', iframe: \'ajax\', selector: \'.tab-page>.container\', position: \'right top\', width: \'auto\', maxheight: \'50%\', wrap: \'body\' })', // onclick
356
+            'modx.popup({url:\'index.php?a=26\', title:\''.$_lang['refresh_site'].'\', icon: \'fa-recycle\', iframe: \'ajax\', selector: \'.tab-page>.container\', position: \'right top\', width: \'auto\', maxheight: \'50%\', wrap: \'body\' })', // onclick
357 357
             $_lang['refresh_site'], // title
358 358
             '<i class="fa fa-recycle"></i>' // innerHTML
359 359
         )
@@ -363,7 +363,7 @@  discard block
 block discarded – undo
363 363
 $sitemenu['search'] = array(
364 364
 	'search',
365 365
 	'tools',
366
-	'<i class="fa fa-search"></i>' . $_lang['search'],
366
+	'<i class="fa fa-search"></i>'.$_lang['search'],
367 367
 	'index.php?a=71',
368 368
 	$_lang['search'],
369 369
 	'',
@@ -374,11 +374,11 @@  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',
381
-		'<i class="fa fa-database"></i>' . $_lang['bk_manager'],
381
+		'<i class="fa fa-database"></i>'.$_lang['bk_manager'],
382 382
 		'index.php?a=93',
383 383
 		$_lang['bk_manager'],
384 384
 		'',
@@ -390,11 +390,11 @@  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',
397
-		'<i class="fa fa-hourglass"></i>' . $_lang['remove_locks'],
397
+		'<i class="fa fa-hourglass"></i>'.$_lang['remove_locks'],
398 398
 		'javascript:modx.removeLocks();',
399 399
 		$_lang['remove_locks'],
400 400
 		'',
@@ -406,11 +406,11 @@  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',
413
-		'<i class="fa fa-upload"></i>' . $_lang['import_site'],
413
+		'<i class="fa fa-upload"></i>'.$_lang['import_site'],
414 414
 		'index.php?a=95',
415 415
 		$_lang['import_site'],
416 416
 		'',
@@ -422,11 +422,11 @@  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',
429
-		'<i class="fa fa-download"></i>' . $_lang['export_site'],
429
+		'<i class="fa fa-download"></i>'.$_lang['export_site'],
430 430
 		'index.php?a=83',
431 431
 		$_lang['export_site'],
432 432
 		'',
@@ -439,20 +439,20 @@  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;
449
+	if (count($newmenu) > 0) $sitemenu = $newmenu;
450 450
 }
451 451
 
452
-if(file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/includes/menu.class.inc.php')) {
453
-	include_once(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/includes/menu.class.inc.php');
452
+if (file_exists(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/includes/menu.class.inc.php')) {
453
+	include_once(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/includes/menu.class.inc.php');
454 454
 } else {
455
-	include_once(MODX_MANAGER_PATH . 'includes/menu.class.inc.php');
455
+	include_once(MODX_MANAGER_PATH.'includes/menu.class.inc.php');
456 456
 }
457 457
 $menu = new EVOmenu();
458 458
 $menu->Build($sitemenu, array(
Please login to merge, or discard this patch.
manager/media/browser/mcpuk/core/types/type_img.php 3 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 /** This file is part of KCFinder project
4
-  *
5
-  *      @desc Image detection class
6
-  *   @package KCFinder
7
-  *   @version 2.54
8
-  *    @author Pavel Tzonkov <[email protected]>
9
-  * @copyright 2010-2014 KCFinder Project
10
-  *   @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2
11
-  *   @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2
12
-  *      @link http://kcfinder.sunhater.com
13
-  */
4
+ *
5
+ *      @desc Image detection class
6
+ *   @package KCFinder
7
+ *   @version 2.54
8
+ *    @author Pavel Tzonkov <[email protected]>
9
+ * @copyright 2010-2014 KCFinder Project
10
+ *   @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2
11
+ *   @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2
12
+ *      @link http://kcfinder.sunhater.com
13
+ */
14 14
 
15 15
 class type_img {
16 16
 
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -12,9 +12,9 @@
 block discarded – undo
12 12
   *      @link http://kcfinder.sunhater.com
13 13
   */
14 14
 
15
-class type_img {
15
+class type_img{
16 16
 
17
-    public function checkFile($file, array $config) {
17
+    public function checkFile($file, array $config){
18 18
 
19 19
         $driver = isset($config['imageDriversPriority'])
20 20
             ? image::getDriver(explode(" ", $config['imageDriversPriority'])) : "gd";
Please login to merge, or discard this patch.
Braces   +7 added lines, -4 removed lines patch added patch discarded remove patch
@@ -12,17 +12,20 @@
 block discarded – undo
12 12
   *      @link http://kcfinder.sunhater.com
13 13
   */
14 14
 
15
-class type_img {
15
+class type_img
16
+{
16 17
 
17
-    public function checkFile($file, array $config) {
18
+    public function checkFile($file, array $config)
19
+    {
18 20
 
19 21
         $driver = isset($config['imageDriversPriority'])
20 22
             ? image::getDriver(explode(" ", $config['imageDriversPriority'])) : "gd";
21 23
 
22 24
         $img = image::factory($driver, $file);
23 25
 
24
-        if ($img->initError)
25
-            return "Unknown image format/encoding.";
26
+        if ($img->initError) {
27
+                    return "Unknown image format/encoding.";
28
+        }
26 29
 
27 30
         return true;
28 31
     }
Please login to merge, or discard this patch.
manager/media/browser/mcpuk/core/types/type_mime.php 3 patches
Indentation   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -1,16 +1,16 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 /** This file is part of KCFinder project
4
-  *
5
-  *      @desc MIME type detection class
6
-  *   @package KCFinder
7
-  *   @version 2.54
8
-  *    @author Pavel Tzonkov <[email protected]>
9
-  * @copyright 2010-2014 KCFinder Project
10
-  *   @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2
11
-  *   @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2
12
-  *      @link http://kcfinder.sunhater.com
13
-  */
4
+ *
5
+ *      @desc MIME type detection class
6
+ *   @package KCFinder
7
+ *   @version 2.54
8
+ *    @author Pavel Tzonkov <[email protected]>
9
+ * @copyright 2010-2014 KCFinder Project
10
+ *   @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2
11
+ *   @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2
12
+ *      @link http://kcfinder.sunhater.com
13
+ */
14 14
 
15 15
 class type_mime {
16 16
 
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -12,9 +12,9 @@  discard block
 block discarded – undo
12 12
   *      @link http://kcfinder.sunhater.com
13 13
   */
14 14
 
15
-class type_mime {
15
+class type_mime{
16 16
 
17
-    public function checkFile($file, array $config) {
17
+    public function checkFile($file, array $config){
18 18
         if (!class_exists("finfo"))
19 19
             return "Fileinfo PECL extension is missing.";
20 20
 
@@ -33,12 +33,12 @@  discard block
 block discarded – undo
33 33
         $mimes = $config['params'];
34 34
         if (substr($mimes, 0, 1) == "!") {
35 35
             $mimes = trim(substr($mimes, 1));
36
-            return in_array($type , explode(" ", $mimes))
36
+            return in_array($type, explode(" ", $mimes))
37 37
                 ? "You can't upload such files."
38 38
                 : true;
39 39
         }
40 40
 
41
-        return !in_array($type , explode(" ", $mimes))
41
+        return !in_array($type, explode(" ", $mimes))
42 42
             ? "You can't upload such files."
43 43
             : true;
44 44
     }
Please login to merge, or discard this patch.
Braces   +13 added lines, -8 removed lines patch added patch discarded remove patch
@@ -12,20 +12,25 @@
 block discarded – undo
12 12
   *      @link http://kcfinder.sunhater.com
13 13
   */
14 14
 
15
-class type_mime {
15
+class type_mime
16
+{
16 17
 
17
-    public function checkFile($file, array $config) {
18
-        if (!class_exists("finfo"))
19
-            return "Fileinfo PECL extension is missing.";
18
+    public function checkFile($file, array $config)
19
+    {
20
+        if (!class_exists("finfo")) {
21
+                    return "Fileinfo PECL extension is missing.";
22
+        }
20 23
 
21
-        if (!isset($config['params']))
22
-            return "Undefined MIME types.";
24
+        if (!isset($config['params'])) {
25
+                    return "Undefined MIME types.";
26
+        }
23 27
 
24 28
         $finfo = strlen($config['mime_magic'])
25 29
             ? new finfo(FILEINFO_MIME, $config['mime_magic'])
26 30
             : new finfo(FILEINFO_MIME);
27
-        if (!$finfo)
28
-            return "Opening fileinfo database failed.";
31
+        if (!$finfo) {
32
+                    return "Opening fileinfo database failed.";
33
+        }
29 34
 
30 35
         $type = $finfo->file($file);
31 36
         $type = substr($type, 0, strrpos($type, ";"));
Please login to merge, or discard this patch.
manager/media/browser/mcpuk/core/autoload.php 3 patches
Indentation   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -1,24 +1,24 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 /** This file is part of KCFinder project
4
-  *
5
-  *      @desc This file is included first, before each other
6
-  *   @package KCFinder
7
-  *   @version 2.54
8
-  *    @author Pavel Tzonkov <[email protected]>
9
-  * @copyright 2010-2014 KCFinder Project
10
-  *   @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2
11
-  *   @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2
12
-  *      @link http://kcfinder.sunhater.com
13
-  *
14
-  * This file is the place you can put any code (at the end of the file),
15
-  * which will be executed before any other. Suitable for:
16
-  *     1. Set PHP ini settings using ini_set()
17
-  *     2. Custom session save handler with session_set_save_handler()
18
-  *     3. Any custom integration code. If you use any global variables
19
-  *        here, they can be accessed in config.php via $GLOBALS array.
20
-  *        It's recommended to use constants instead.
21
-  */
4
+ *
5
+ *      @desc This file is included first, before each other
6
+ *   @package KCFinder
7
+ *   @version 2.54
8
+ *    @author Pavel Tzonkov <[email protected]>
9
+ * @copyright 2010-2014 KCFinder Project
10
+ *   @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2
11
+ *   @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2
12
+ *      @link http://kcfinder.sunhater.com
13
+ *
14
+ * This file is the place you can put any code (at the end of the file),
15
+ * which will be executed before any other. Suitable for:
16
+ *     1. Set PHP ini settings using ini_set()
17
+ *     2. Custom session save handler with session_set_save_handler()
18
+ *     3. Any custom integration code. If you use any global variables
19
+ *        here, they can be accessed in config.php via $GLOBALS array.
20
+ *        It's recommended to use constants instead.
21
+ */
22 22
 include_once(dirname(__FILE__)."/../../../../../assets/cache/siteManager.php");
23 23
 require_once('../../../includes/protect.inc.php');
24 24
 include_once('../../../includes/config.inc.php');
Please login to merge, or discard this patch.
Braces   +25 added lines, -15 removed lines patch added patch discarded remove patch
@@ -41,17 +41,20 @@  discard block
 block discarded – undo
41 41
 $_GET['langCode'] = $modx_lang_attribute;
42 42
 
43 43
 // PHP VERSION CHECK
44
-if (substr(PHP_VERSION, 0, strpos(PHP_VERSION, '.')) < 5)
44
+if (substr(PHP_VERSION, 0, strpos(PHP_VERSION, '.')) < 5) {
45 45
     die("You are using PHP " . PHP_VERSION . " when KCFinder require at least version 5! Some systems has an option to change the active PHP version. Please refer to your hosting provider or upgrade your PHP distribution.");
46
+}
46 47
 
47 48
 
48 49
 // SAFE MODE CHECK
49
-if (ini_get("safe_mode"))
50
+if (ini_get("safe_mode")) {
50 51
     die("The \"safe_mode\" PHP ini setting is turned on! You cannot run KCFinder in safe mode.");
52
+}
51 53
 
52 54
 
53 55
 // MAGIC AUTOLOAD CLASSES FUNCTION
54
-function autoloadda9d06472ccb71b84928677ce2a6ca89($class) {
56
+function autoloadda9d06472ccb71b84928677ce2a6ca89($class)
57
+{
55 58
     static $classes = null;
56 59
     if ($classes === null) {
57 60
         $classes = array(
@@ -84,7 +87,8 @@  discard block
 block discarded – undo
84 87
 // json_encode() IMPLEMENTATION IF JSON EXTENSION IS MISSING
85 88
 if (!function_exists("json_encode")) {
86 89
 
87
-    function kcfinder_json_string_encode($string) {
90
+    function kcfinder_json_string_encode($string)
91
+    {
88 92
         return '"' .
89 93
             str_replace('/', "\\/",
90 94
             str_replace("\t", "\\t",
@@ -95,37 +99,43 @@  discard block
 block discarded – undo
95 99
         $string)))))) . '"';
96 100
     }
97 101
 
98
-    function json_encode($data) {
102
+    function json_encode($data)
103
+    {
99 104
 
100 105
         if (is_array($data)) {
101 106
             $ret = array();
102 107
 
103 108
             // OBJECT
104 109
             if (array_keys($data) !== range(0, count($data) - 1)) {
105
-                foreach ($data as $key => $val)
106
-                    $ret[] = kcfinder_json_string_encode($key) . ':' . json_encode($val);
110
+                foreach ($data as $key => $val) {
111
+                                    $ret[] = kcfinder_json_string_encode($key) . ':' . json_encode($val);
112
+                }
107 113
                 return "{" . implode(",", $ret) . "}";
108 114
 
109 115
             // ARRAY
110 116
             } else {
111
-                foreach ($data as $val)
112
-                    $ret[] = json_encode($val);
117
+                foreach ($data as $val) {
118
+                                    $ret[] = json_encode($val);
119
+                }
113 120
                 return "[" . implode(",", $ret) . "]";
114 121
             }
115 122
 
116 123
         // BOOLEAN OR NULL
117
-        } elseif (is_bool($data) || ($data === null))
118
-            return ($data === null)
124
+        } elseif (is_bool($data) || ($data === null)) {
125
+                    return ($data === null)
119 126
                 ? "null"
120 127
                 : ($data ? "true" : "false");
128
+        }
121 129
 
122 130
         // FLOAT
123
-        elseif (is_float($data))
124
-            return rtrim(rtrim(number_format($data, 14, ".", ""), "0"), ".");
131
+        elseif (is_float($data)) {
132
+                    return rtrim(rtrim(number_format($data, 14, ".", ""), "0"), ".");
133
+        }
125 134
 
126 135
         // INTEGER
127
-        elseif (is_int($data))
128
-            return $data;
136
+        elseif (is_int($data)) {
137
+                    return $data;
138
+        }
129 139
 
130 140
         // STRING
131 141
         return kcfinder_json_string_encode($data);
Please login to merge, or discard this patch.
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 $modx = evolutionCMS();
27 27
 $modx->db->connect();
28 28
 startCMSSession();
29
-if(!isset($_SESSION['mgrValidated'])) {
29
+if (!isset($_SESSION['mgrValidated'])) {
30 30
         die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
31 31
 }
32 32
 define('IN_MANAGER_MODE', true);
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 
35 35
 $manager_language = $modx->config['manager_language'];
36 36
 // Pass language code from MODX to KCFinder
37
-if(!file_exists("../../../includes/lang/".$manager_language.".inc.php")) {
37
+if (!file_exists("../../../includes/lang/".$manager_language.".inc.php")) {
38 38
     $manager_language = "english"; // if not set, get the english language file.
39 39
 }
40 40
 include_once "../../../includes/lang/".$manager_language.".inc.php";
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 
43 43
 // PHP VERSION CHECK
44 44
 if (substr(PHP_VERSION, 0, strpos(PHP_VERSION, '.')) < 5)
45
-    die("You are using PHP " . PHP_VERSION . " when KCFinder require at least version 5! Some systems has an option to change the active PHP version. Please refer to your hosting provider or upgrade your PHP distribution.");
45
+    die("You are using PHP ".PHP_VERSION." when KCFinder require at least version 5! Some systems has an option to change the active PHP version. Please refer to your hosting provider or upgrade your PHP distribution.");
46 46
 
47 47
 
48 48
 // SAFE MODE CHECK
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 
52 52
 
53 53
 // MAGIC AUTOLOAD CLASSES FUNCTION
54
-function autoloadda9d06472ccb71b84928677ce2a6ca89($class) {
54
+function autoloadda9d06472ccb71b84928677ce2a6ca89($class){
55 55
     static $classes = null;
56 56
     if ($classes === null) {
57 57
         $classes = array(
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
         );
76 76
     }
77 77
     if (isset($classes[$class])) {
78
-        require dirname(__FILE__) . $classes[$class];
78
+        require dirname(__FILE__).$classes[$class];
79 79
     }
80 80
 }
81 81
 spl_autoload_register('autoloadda9d06472ccb71b84928677ce2a6ca89', true);
@@ -84,18 +84,18 @@  discard block
 block discarded – undo
84 84
 // json_encode() IMPLEMENTATION IF JSON EXTENSION IS MISSING
85 85
 if (!function_exists("json_encode")) {
86 86
 
87
-    function kcfinder_json_string_encode($string) {
88
-        return '"' .
87
+    function kcfinder_json_string_encode($string){
88
+        return '"'.
89 89
             str_replace('/', "\\/",
90 90
             str_replace("\t", "\\t",
91 91
             str_replace("\r", "\\r",
92 92
             str_replace("\n", "\\n",
93 93
             str_replace('"', "\\\"",
94 94
             str_replace("\\", "\\\\",
95
-        $string)))))) . '"';
95
+        $string)))))).'"';
96 96
     }
97 97
 
98
-    function json_encode($data) {
98
+    function json_encode($data){
99 99
 
100 100
         if (is_array($data)) {
101 101
             $ret = array();
@@ -103,14 +103,14 @@  discard block
 block discarded – undo
103 103
             // OBJECT
104 104
             if (array_keys($data) !== range(0, count($data) - 1)) {
105 105
                 foreach ($data as $key => $val)
106
-                    $ret[] = kcfinder_json_string_encode($key) . ':' . json_encode($val);
107
-                return "{" . implode(",", $ret) . "}";
106
+                    $ret[] = kcfinder_json_string_encode($key).':'.json_encode($val);
107
+                return "{".implode(",", $ret)."}";
108 108
 
109 109
             // ARRAY
110 110
             } else {
111 111
                 foreach ($data as $val)
112 112
                     $ret[] = json_encode($val);
113
-                return "[" . implode(",", $ret) . "]";
113
+                return "[".implode(",", $ret)."]";
114 114
             }
115 115
 
116 116
         // BOOLEAN OR NULL
Please login to merge, or discard this patch.
manager/media/browser/mcpuk/tpl/tpl_css.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,2 +1,2 @@
 block discarded – undo
1
-<link href="css.php?type=<?php echo $this->type ?><?php echo ($this->cms ? "&amp;cms={$this->cms}" : "" ) ?>" rel="stylesheet" type="text/css" />
1
+<link href="css.php?type=<?php echo $this->type ?><?php echo ($this->cms ? "&amp;cms={$this->cms}" : "") ?>" rel="stylesheet" type="text/css" />
2 2
 <link href="themes/<?php echo $this->config['theme'] ?>/style.css" rel="stylesheet" type="text/css" />
Please login to merge, or discard this patch.
manager/media/browser/mcpuk/tpl/tpl_javascript.php 1 patch
Upper-Lower-Casing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -4,12 +4,12 @@  discard block
 block discarded – undo
4 4
 <script src="js/helper.js" type="text/javascript"></script>
5 5
 <script src="js/browser/joiner.php" type="text/javascript"></script>
6 6
 <script src="js_localize.php?lng=<?php echo $this->lang ?>" type="text/javascript"></script>
7
-<?php IF (isset($this->opener['TinyMCE']) && $this->opener['TinyMCE']): ?>
7
+<?php if (isset($this->opener['TinyMCE']) && $this->opener['TinyMCE']): ?>
8 8
 <script src="<?php echo $this->config['_tinyMCEPath'] ?>/tiny_mce_popup.js" type="text/javascript"></script>
9
-<?php ENDIF ?>
10
-<?php IF (file_exists("themes/{$this->config['theme']}/init.js")): ?>
9
+<?php endif ?>
10
+<?php if (file_exists("themes/{$this->config['theme']}/init.js")): ?>
11 11
 <script src="themes/<?php echo $this->config['theme'] ?>/init.js" type="text/javascript"></script>
12
-<?php ENDIF ?>
12
+<?php endif ?>
13 13
 <script type="text/javascript">
14 14
 browser.version = "<?php echo self::VERSION ?>";
15 15
 browser.support.chromeFrame = <?php echo (strpos(strtolower($_SERVER['HTTP_USER_AGENT']), " chromeframe") !== false) ? "true" : "false" ?>;
@@ -23,19 +23,19 @@  discard block
 block discarded – undo
23 23
 browser.siteURL = "<?php echo text::jsValue($this->config['siteURL']) ?>";
24 24
 browser.assetsURL = "<?php echo text::jsValue($this->config['assetsURL']) ?>";
25 25
 browser.thumbsURL = browser.assetsURL + "/<?php echo text::jsValue($this->config['thumbsDir']) ?>";
26
-<?php IF (isset($this->get['opener']) && strlen($this->get['opener'])): ?>
26
+<?php if (isset($this->get['opener']) && strlen($this->get['opener'])): ?>
27 27
 browser.opener.name = "<?php echo text::jsValue($this->get['opener']) ?>";
28
-<?php ENDIF ?>
29
-<?php IF (isset($this->opener['CKEditor']['funcNum']) && preg_match('/^\d+$/', $this->opener['CKEditor']['funcNum'])): ?>
28
+<?php endif ?>
29
+<?php if (isset($this->opener['CKEditor']['funcNum']) && preg_match('/^\d+$/', $this->opener['CKEditor']['funcNum'])): ?>
30 30
 browser.opener.CKEditor = {};
31 31
 browser.opener.CKEditor.funcNum = <?php echo $this->opener['CKEditor']['funcNum'] ?>;
32
-<?php ENDIF ?>
33
-<?php IF (isset($this->opener['TinyMCE']) && $this->opener['TinyMCE']): ?>
32
+<?php endif ?>
33
+<?php if (isset($this->opener['TinyMCE']) && $this->opener['TinyMCE']): ?>
34 34
 browser.opener.TinyMCE = true;
35
-<?php ENDIF ?>
36
-<?php IF (isset($this->get['opener']) && ($this->get['opener'] == "tinymce4") && isset($this->get['field'])): ?>
35
+<?php endif ?>
36
+<?php if (isset($this->get['opener']) && ($this->get['opener'] == "tinymce4") && isset($this->get['field'])): ?>
37 37
 browser.opener.TinyMCE4 = "<?= text::jsValue($this->get['field']) ?>";
38
-<?php ENDIF ?>
38
+<?php endif ?>
39 39
 browser.cms = "<?php echo text::jsValue($this->cms) ?>";
40 40
 _.kuki.domain = "<?php echo text::jsValue($this->config['cookieDomain']) ?>";
41 41
 _.kuki.path = "<?php echo text::jsValue($this->config['cookiePath']) ?>";
Please login to merge, or discard this patch.
manager/media/browser/mcpuk/tpl/tpl_browser.php 1 patch
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -4,8 +4,8 @@
 block discarded – undo
4 4
 <head>
5 5
     <title>KCFinder: /
6 6
         <?php echo $this->session['dir'] ?></title>
7
-    <?php INCLUDE "tpl/tpl_css.php" ?>
8
-    <?php INCLUDE "tpl/tpl_javascript.php" ?>
7
+    <?php include "tpl/tpl_css.php" ?>
8
+    <?php include "tpl/tpl_javascript.php" ?>
9 9
 </head>
10 10
 
11 11
 <body>
Please login to merge, or discard this patch.
manager/media/browser/mcpuk/lang/uk.php 1 patch
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 /** Ukrainian localization file for KCFinder
4
-	* author: Myroslav Dobra
5
-	* E-mail: [email protected]
6
-  */
4
+ * author: Myroslav Dobra
5
+ * E-mail: [email protected]
6
+ */
7 7
 
8 8
 $lang = array(
9 9
 
Please login to merge, or discard this patch.