Completed
Pull Request — develop (#714)
by Agel_Nash
15:06 queued 06:49
created
manager/actions/mutate_settings/tab2_furl_settings.inc.php 2 patches
Spacing   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -6,8 +6,8 @@  discard block
 block discarded – undo
6 6
 <tr>
7 7
 <td nowrap class="warning" valign="top"><?php echo $_lang['friendlyurls_title'] ?><br><small>[(friendly_urls)]</small></td>
8 8
 <td>
9
-    <?php echo wrap_label($_lang['yes'],form_radio('friendly_urls', 1, 'id="furlRowOn"'));?><br />
10
-    <?php echo wrap_label($_lang['no'], form_radio('friendly_urls', 0, 'id="furlRowOff"'));?>
9
+    <?php echo wrap_label($_lang['yes'], form_radio('friendly_urls', 1, 'id="furlRowOn"')); ?><br />
10
+    <?php echo wrap_label($_lang['no'], form_radio('friendly_urls', 0, 'id="furlRowOff"')); ?>
11 11
 </td>
12 12
 </tr>
13 13
 <tr>
@@ -20,8 +20,8 @@  discard block
 block discarded – undo
20 20
 <tr>
21 21
     <td nowrap class="warning"><?php echo $_lang['xhtml_urls_title'] ?><br><small>[(xhtml_urls)]</small></td>
22 22
     <td>
23
-        <?php echo wrap_label($_lang['yes'],form_radio('xhtml_urls', 1));?><br />
24
-        <?php echo wrap_label($_lang['no'], form_radio('xhtml_urls', 0));?>
23
+        <?php echo wrap_label($_lang['yes'], form_radio('xhtml_urls', 1)); ?><br />
24
+        <?php echo wrap_label($_lang['no'], form_radio('xhtml_urls', 0)); ?>
25 25
     </td>
26 26
 </tr>
27 27
 <tr>
@@ -31,135 +31,135 @@  discard block
 block discarded – undo
31 31
 <tr>
32 32
 <td colspan="2"><div class="split"></div></td>
33 33
 </tr>
34
-<tr class="furlRow" <?php echo showHide($friendly_urls==1);?>>
34
+<tr class="furlRow" <?php echo showHide($friendly_urls == 1); ?>>
35 35
 <td nowrap class="warning" valign="top"><?php echo $_lang['friendlyurlsprefix_title'] ?><br><small>[(friendly_url_prefix)]</small></td>
36 36
 <td><input onchange="documentDirty=true;" type="text" maxlength="50" style="width: 200px;" name="friendly_url_prefix" value="<?php echo $friendly_url_prefix; ?>" /></td>
37 37
 </tr>
38
-<tr class="furlRow" <?php echo showHide($friendly_urls==1);?>>
38
+<tr class="furlRow" <?php echo showHide($friendly_urls == 1); ?>>
39 39
 <td width="200">&nbsp;</td>
40 40
 <td class="comment"><?php echo $_lang['friendlyurlsprefix_message'] ?></td>
41 41
 </tr>
42
-<tr class="furlRow" <?php echo showHide($friendly_urls==1);?>>
42
+<tr class="furlRow" <?php echo showHide($friendly_urls == 1); ?>>
43 43
 <td colspan="2"><div class="split"></div></td>
44 44
 </tr>
45
-<tr class="furlRow" <?php echo showHide($friendly_urls==1);?>>
45
+<tr class="furlRow" <?php echo showHide($friendly_urls == 1); ?>>
46 46
 <td nowrap class="warning" valign="top"><?php echo $_lang['friendlyurlsuffix_title'] ?><br><small>[(friendly_url_suffix)]</small></td>
47 47
 <td><input onchange="documentDirty=true;" type="text" maxlength="50" style="width: 200px;" name="friendly_url_suffix" value="<?php echo $friendly_url_suffix; ?>" /></td>
48 48
 </tr>
49
-<tr class="furlRow" <?php echo showHide($friendly_urls==1);?>>
49
+<tr class="furlRow" <?php echo showHide($friendly_urls == 1); ?>>
50 50
 <td width="200">&nbsp;</td>
51 51
 <td class="comment"><?php echo $_lang['friendlyurlsuffix_message'] ?></td>
52 52
 </tr>
53
-<tr class="furlRow" <?php echo showHide($friendly_urls==1);?>>
53
+<tr class="furlRow" <?php echo showHide($friendly_urls == 1); ?>>
54 54
 <td colspan="2"><div class="split"></div></td>
55 55
 </tr>
56
-<tr class="furlRow" <?php echo showHide($friendly_urls==1);?>>
56
+<tr class="furlRow" <?php echo showHide($friendly_urls == 1); ?>>
57 57
 <th><?php echo $_lang['make_folders_title'] ?><br><small>[(make_folders)]</small></th>
58 58
 <td>
59
-  <?php echo wrap_label($_lang['yes'],form_radio('make_folders','1'));?><br />
60
-  <?php echo wrap_label($_lang['no'],form_radio('make_folders','0'));?>
59
+  <?php echo wrap_label($_lang['yes'], form_radio('make_folders', '1')); ?><br />
60
+  <?php echo wrap_label($_lang['no'], form_radio('make_folders', '0')); ?>
61 61
 </td>
62 62
 </tr>
63
-<tr class="furlRow" <?php echo showHide($friendly_urls==1);?>>
63
+<tr class="furlRow" <?php echo showHide($friendly_urls == 1); ?>>
64 64
         <td width="200">&nbsp;</td>
65 65
         <td class="comment"><?php echo $_lang['make_folders_message'] ?></td>
66 66
       </tr>
67
-<tr class="furlRow" <?php echo showHide($friendly_urls==1);?>>
67
+<tr class="furlRow" <?php echo showHide($friendly_urls == 1); ?>>
68 68
 <td colspan="2"><div class="split"></div></td>
69 69
 </tr>
70 70
   
71
-<tr class="furlRow" <?php echo showHide($friendly_urls==1);?>>
71
+<tr class="furlRow" <?php echo showHide($friendly_urls == 1); ?>>
72 72
 <th><?php echo $_lang['seostrict_title'] ?><br><small>[(seostrict)]</small></th>
73 73
 <td>
74
-  <?php echo wrap_label($_lang['yes'],form_radio('seostrict','1'));?><br />
75
-  <?php echo wrap_label($_lang['no'],form_radio('seostrict','0'));?>
74
+  <?php echo wrap_label($_lang['yes'], form_radio('seostrict', '1')); ?><br />
75
+  <?php echo wrap_label($_lang['no'], form_radio('seostrict', '0')); ?>
76 76
  </td>
77 77
 </tr>
78
-<tr class="furlRow" <?php echo showHide($friendly_urls==1);?>>
78
+<tr class="furlRow" <?php echo showHide($friendly_urls == 1); ?>>
79 79
         <td width="200">&nbsp;</td>
80 80
         <td class="comment"><?php echo $_lang['seostrict_message'] ?></td>
81 81
 </tr>
82
-<tr class="furlRow" <?php echo showHide($friendly_urls==1);?>>
82
+<tr class="furlRow" <?php echo showHide($friendly_urls == 1); ?>>
83 83
 <td colspan="2"><div class="split"></div></td>
84 84
 </tr>
85 85
 
86
-<tr class="furlRow" <?php echo showHide($friendly_urls==1);?>>
86
+<tr class="furlRow" <?php echo showHide($friendly_urls == 1); ?>>
87 87
   <th><?php echo $_lang['aliaslistingfolder_title'] ?><br><small>[(aliaslistingfolder)]</small></th>
88 88
   <td>
89
-      <?php echo wrap_label($_lang['yes'],form_radio('aliaslistingfolder','1'));?><br />
90
-      <?php echo wrap_label($_lang['no'],form_radio('aliaslistingfolder','0'));?>
89
+      <?php echo wrap_label($_lang['yes'], form_radio('aliaslistingfolder', '1')); ?><br />
90
+      <?php echo wrap_label($_lang['no'], form_radio('aliaslistingfolder', '0')); ?>
91 91
   </td>
92 92
 </tr>
93
-<tr class="furlRow" <?php echo showHide($friendly_urls==1);?>>
93
+<tr class="furlRow" <?php echo showHide($friendly_urls == 1); ?>>
94 94
   <td width="200">&nbsp;</td>
95 95
   <td class="comment"><?php echo $_lang['aliaslistingfolder_message'] ?></td>
96 96
 </tr>
97
-<tr class="furlRow" <?php echo showHide($friendly_urls==1);?>>
97
+<tr class="furlRow" <?php echo showHide($friendly_urls == 1); ?>>
98 98
   <td colspan="2"><div class="split"></div></td>
99 99
 </tr>
100 100
 
101
-<tr class="furlRow" <?php echo showHide($friendly_urls==1);?>>
101
+<tr class="furlRow" <?php echo showHide($friendly_urls == 1); ?>>
102 102
 <td nowrap class="warning" valign="top"><?php echo $_lang['friendly_alias_title'] ?><br><small>[(friendly_alias_urls)]</small></td>
103 103
 <td>
104
-  <?php echo wrap_label($_lang['yes'],form_radio('friendly_alias_urls','1'));?><br />
105
-  <?php echo wrap_label($_lang['no'],form_radio('friendly_alias_urls','0'));?>
104
+  <?php echo wrap_label($_lang['yes'], form_radio('friendly_alias_urls', '1')); ?><br />
105
+  <?php echo wrap_label($_lang['no'], form_radio('friendly_alias_urls', '0')); ?>
106 106
 </td>
107 107
 </tr>
108
-<tr class="furlRow" <?php echo showHide($friendly_urls==1);?>>
108
+<tr class="furlRow" <?php echo showHide($friendly_urls == 1); ?>>
109 109
 <td width="200">&nbsp;</td>
110 110
 <td class="comment"><?php echo $_lang['friendly_alias_message'] ?></td>
111 111
 </tr>
112
-<tr class="furlRow" <?php echo showHide($friendly_urls==1);?>>
112
+<tr class="furlRow" <?php echo showHide($friendly_urls == 1); ?>>
113 113
 <td colspan="2"><div class="split"></div></td>
114 114
 </tr>
115
-<tr class="furlRow" <?php echo showHide($friendly_urls==1);?>>
115
+<tr class="furlRow" <?php echo showHide($friendly_urls == 1); ?>>
116 116
 <td nowrap class="warning" valign="top"><?php echo $_lang['use_alias_path_title'] ?><br><small>[(use_alias_path)]</small></td>
117 117
 <td>
118
-  <?php echo wrap_label($_lang['yes'],form_radio('use_alias_path','1'));?><br />
119
-  <?php echo wrap_label($_lang['no'],form_radio('use_alias_path','0'));?>
118
+  <?php echo wrap_label($_lang['yes'], form_radio('use_alias_path', '1')); ?><br />
119
+  <?php echo wrap_label($_lang['no'], form_radio('use_alias_path', '0')); ?>
120 120
 </td>
121 121
 </tr>
122
-<tr class="furlRow" <?php echo showHide($friendly_urls==1);?>>
122
+<tr class="furlRow" <?php echo showHide($friendly_urls == 1); ?>>
123 123
 <td width="200">&nbsp;</td>
124 124
 <td class="comment"><?php echo $_lang['use_alias_path_message'] ?></td>
125 125
 </tr>
126
-<tr class="furlRow" <?php echo showHide($friendly_urls==1);?>>
126
+<tr class="furlRow" <?php echo showHide($friendly_urls == 1); ?>>
127 127
 <td colspan="2"><div class="split"></div></td>
128 128
 </tr>
129
-<tr class="furlRow" <?php echo showHide($friendly_urls==1);?>>
129
+<tr class="furlRow" <?php echo showHide($friendly_urls == 1); ?>>
130 130
 <td nowrap class="warning" valign="top"><?php echo $_lang['duplicate_alias_title'] ?><br><small>[(allow_duplicate_alias)]</small></td>
131 131
 <td>
132
-  <?php echo wrap_label($_lang['yes'],form_radio('allow_duplicate_alias','1'));?><br />
133
-  <?php echo wrap_label($_lang['no'],form_radio('allow_duplicate_alias','0'));?>
132
+  <?php echo wrap_label($_lang['yes'], form_radio('allow_duplicate_alias', '1')); ?><br />
133
+  <?php echo wrap_label($_lang['no'], form_radio('allow_duplicate_alias', '0')); ?>
134 134
 </td>
135 135
 </tr>
136
-<tr class="furlRow" <?php echo showHide($friendly_urls==1);?>>
136
+<tr class="furlRow" <?php echo showHide($friendly_urls == 1); ?>>
137 137
 <td width="200">&nbsp;</td>
138 138
 <td class="comment"><?php echo $_lang['duplicate_alias_message'] ?></td>
139 139
 </tr>
140
-<tr class="furlRow" <?php echo showHide($friendly_urls==1);?>>
140
+<tr class="furlRow" <?php echo showHide($friendly_urls == 1); ?>>
141 141
 <td colspan="2"><div class="split"></div></td>
142 142
 </tr>
143
-<tr class="furlRow" <?php echo showHide($friendly_urls==1);?>>
143
+<tr class="furlRow" <?php echo showHide($friendly_urls == 1); ?>>
144 144
 <td nowrap class="warning" valign="top"><?php echo $_lang['automatic_alias_title'] ?><br><small>[(automatic_alias)]</small></td>
145 145
 <td>
146
-  <?php echo wrap_label($_lang['yes'],form_radio('automatic_alias','1'));?><br />
147
-  <?php echo wrap_label($_lang['no'],form_radio('automatic_alias','0'));?>
146
+  <?php echo wrap_label($_lang['yes'], form_radio('automatic_alias', '1')); ?><br />
147
+  <?php echo wrap_label($_lang['no'], form_radio('automatic_alias', '0')); ?>
148 148
 </td>
149 149
 </tr>
150
-<tr class="furlRow" <?php echo showHide($friendly_urls==1);?>>
150
+<tr class="furlRow" <?php echo showHide($friendly_urls == 1); ?>>
151 151
 <td width="200">&nbsp;</td>
152 152
 <td class="comment"><?php echo $_lang['automatic_alias_message'] ?></td>
153 153
 </tr>
154
-<tr class="furlRow" <?php echo showHide($friendly_urls==1);?>>
154
+<tr class="furlRow" <?php echo showHide($friendly_urls == 1); ?>>
155 155
 <td colspan="2"><div class="split"></div></td>
156 156
 </tr>
157
-<tr class="furlRow" <?php echo showHide($friendly_urls==1);?>>
157
+<tr class="furlRow" <?php echo showHide($friendly_urls == 1); ?>>
158 158
 <td colspan="2">
159 159
     <?php
160 160
         // invoke OnFriendlyURLSettingsRender event
161 161
         $evtOut = $modx->invokeEvent('OnFriendlyURLSettingsRender');
162
-        if(is_array($evtOut)) echo implode("",$evtOut);
162
+        if (is_array($evtOut)) echo implode("", $evtOut);
163 163
     ?>
164 164
 </td>
165 165
 </tr>
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -159,7 +159,9 @@
 block discarded – undo
159 159
     <?php
160 160
         // invoke OnFriendlyURLSettingsRender event
161 161
         $evtOut = $modx->invokeEvent('OnFriendlyURLSettingsRender');
162
-        if(is_array($evtOut)) echo implode("",$evtOut);
162
+        if(is_array($evtOut)) {
163
+            echo implode("",$evtOut);
164
+        }
163 165
     ?>
164 166
 </td>
165 167
 </tr>
Please login to merge, or discard this patch.
manager/actions/files.dynamic.php 4 patches
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -801,7 +801,7 @@
 block discarded – undo
801 801
                 $complete_name = $path . str_replace('\\', '/', $zip_entry_name);
802 802
                 if (!file_exists($complete_path)) {
803 803
                     $tmp = '';
804
-                    foreach (explode('/', $complete_path) AS $k) {
804
+                    foreach (explode('/', $complete_path) as $k) {
805 805
                         $tmp .= $k . '/';
806 806
                         if (!is_dir($tmp)) {
807 807
                             mkdir($tmp, 0777);
Please login to merge, or discard this patch.
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -719,7 +719,7 @@  discard block
 block discarded – undo
719 719
 
720 720
 /**
721 721
  * @param string $string
722
- * @return bool|string
722
+ * @return string|false
723 723
  */
724 724
 function removeLastPath($string)
725 725
 {
@@ -734,7 +734,7 @@  discard block
 block discarded – undo
734 734
 
735 735
 /**
736 736
  * @param string $string
737
- * @return bool|string
737
+ * @return string|false
738 738
  */
739 739
 function getExtension($string)
740 740
 {
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -893,7 +893,9 @@
 block discarded – undo
893 893
     $modx = evolutionCMS(); global $_lang, $startpath, $filemanager_path, $uploadablefiles, $new_file_permissions;
894 894
     $msg = '';
895 895
     foreach ($_FILES['userfile']['name'] as $i => $name) {
896
-        if (empty($_FILES['userfile']['tmp_name'][$i])) continue;
896
+        if (empty($_FILES['userfile']['tmp_name'][$i])) {
897
+            continue;
898
+        }
897 899
         $userfile= array();
898 900
 
899 901
         $userfile['tmp_name'] = $_FILES['userfile']['tmp_name'][$i];
Please login to merge, or discard this patch.
Spacing   +106 added lines, -106 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
 if (!$modx->hasPermission('file_manager')) {
@@ -9,15 +9,15 @@  discard block
 block discarded – undo
9 9
 $newToken = makeToken();
10 10
 
11 11
 // settings
12
-$theme_image_path = $modx->config['site_manager_url'] . 'media/style/' . $modx->config['manager_theme'] . '/images/';
12
+$theme_image_path = $modx->config['site_manager_url'].'media/style/'.$modx->config['manager_theme'].'/images/';
13 13
 $excludes = array(
14 14
     '.',
15 15
     '..',
16 16
     '.svn'
17 17
 );
18
-$alias_suffix = (!empty($friendly_url_suffix)) ? ',' . ltrim($friendly_url_suffix, '.') : '';
19
-$editablefiles = explode(',', 'txt,php,tpl,less,sass,shtml,html,htm,xml,js,css,pageCache,htaccess,json,ini' . $alias_suffix);
20
-$inlineviewablefiles = explode(',', 'txt,php,tpl,less,sass,html,htm,xml,js,css,pageCache,htaccess,json,ini' . $alias_suffix);
18
+$alias_suffix = (!empty($friendly_url_suffix)) ? ','.ltrim($friendly_url_suffix, '.') : '';
19
+$editablefiles = explode(',', 'txt,php,tpl,less,sass,shtml,html,htm,xml,js,css,pageCache,htaccess,json,ini'.$alias_suffix);
20
+$inlineviewablefiles = explode(',', 'txt,php,tpl,less,sass,html,htm,xml,js,css,pageCache,htaccess,json,ini'.$alias_suffix);
21 21
 $viewablefiles = explode(',', 'jpg,gif,png,ico');
22 22
 
23 23
 $editablefiles = add_dot($editablefiles);
@@ -30,31 +30,31 @@  discard block
 block discarded – undo
30 30
 {
31 31
 */
32 32
 $protected_path[] = $modx->config['site_manager_path'];
33
-$protected_path[] = $modx->config['base_path'] . 'temp/backup';
34
-$protected_path[] = $modx->config['base_path'] . 'assets/backup';
33
+$protected_path[] = $modx->config['base_path'].'temp/backup';
34
+$protected_path[] = $modx->config['base_path'].'assets/backup';
35 35
 
36 36
 if (!$modx->hasPermission('save_plugin')) {
37
-    $protected_path[] = $modx->config['base_path'] . 'assets/plugins';
37
+    $protected_path[] = $modx->config['base_path'].'assets/plugins';
38 38
 }
39 39
 if (!$modx->hasPermission('save_snippet')) {
40
-    $protected_path[] = $modx->config['base_path'] . 'assets/snippets';
40
+    $protected_path[] = $modx->config['base_path'].'assets/snippets';
41 41
 }
42 42
 if (!$modx->hasPermission('save_template')) {
43
-    $protected_path[] = $modx->config['base_path'] . 'assets/templates';
43
+    $protected_path[] = $modx->config['base_path'].'assets/templates';
44 44
 }
45 45
 if (!$modx->hasPermission('save_module')) {
46
-    $protected_path[] = $modx->config['base_path'] . 'assets/modules';
46
+    $protected_path[] = $modx->config['base_path'].'assets/modules';
47 47
 }
48 48
 if (!$modx->hasPermission('empty_cache')) {
49
-    $protected_path[] = $modx->config['base_path'] . 'assets/cache';
49
+    $protected_path[] = $modx->config['base_path'].'assets/cache';
50 50
 }
51 51
 if (!$modx->hasPermission('import_static')) {
52
-    $protected_path[] = $modx->config['base_path'] . 'temp/import';
53
-    $protected_path[] = $modx->config['base_path'] . 'assets/import';
52
+    $protected_path[] = $modx->config['base_path'].'temp/import';
53
+    $protected_path[] = $modx->config['base_path'].'assets/import';
54 54
 }
55 55
 if (!$modx->hasPermission('export_static')) {
56
-    $protected_path[] = $modx->config['base_path'] . 'temp/export';
57
-    $protected_path[] = $modx->config['base_path'] . 'assets/export';
56
+    $protected_path[] = $modx->config['base_path'].'temp/export';
57
+    $protected_path[] = $modx->config['base_path'].'assets/export';
58 58
 }
59 59
 /*
60 60
 }
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 {
84 84
     $count = count($array);
85 85
     for ($i = 0; $i < $count; $i++) {
86
-        $array[$i] = '.' . strtolower(trim($array[$i])); // add a dot :)
86
+        $array[$i] = '.'.strtolower(trim($array[$i])); // add a dot :)
87 87
     }
88 88
     return $array;
89 89
 }
@@ -108,15 +108,15 @@  discard block
 block discarded – undo
108 108
 $rw = realpath('../');
109 109
 $webstart_path = str_replace('\\', '/', str_replace($rw, '', $rf));
110 110
 if (substr($webstart_path, 0, 1) == '/') {
111
-    $webstart_path = '..' . $webstart_path;
111
+    $webstart_path = '..'.$webstart_path;
112 112
 } else {
113
-    $webstart_path = '../' . $webstart_path;
113
+    $webstart_path = '../'.$webstart_path;
114 114
 }
115 115
 
116 116
 ?>
117 117
     <script type="text/javascript">
118 118
 
119
-        var current_path = '<?= $startpath;?>';
119
+        var current_path = '<?= $startpath; ?>';
120 120
 
121 121
         function viewfile (url)
122 122
         {
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
         function unzipFile (file)
153 153
         {
154 154
             if (confirmUnzip()) {
155
-                window.location.href = "index.php?a=31&mode=unzip&path=" + current_path + '/&file=' + file + "&token=<?= $newToken;?>";
155
+                window.location.href = "index.php?a=31&mode=unzip&path=" + current_path + '/&file=' + file + "&token=<?= $newToken; ?>";
156 156
                 return false;
157 157
             }
158 158
         }
@@ -174,7 +174,7 @@  discard block
 block discarded – undo
174 174
         function deleteFolder (folder, status)
175 175
         {
176 176
             if (confirmDeleteFolder(status)) {
177
-                window.location.href = "index.php?a=31&mode=deletefolder&path=" + current_path + "&folderpath=" + current_path + '/' + folder + "&token=<?= $newToken;?>";
177
+                window.location.href = "index.php?a=31&mode=deletefolder&path=" + current_path + "&folderpath=" + current_path + '/' + folder + "&token=<?= $newToken; ?>";
178 178
                 return false;
179 179
             }
180 180
         }
@@ -182,7 +182,7 @@  discard block
 block discarded – undo
182 182
         function deleteFile (file)
183 183
         {
184 184
             if (confirmDelete()) {
185
-                window.location.href = "index.php?a=31&mode=delete&path=" + current_path + '/' + file + "&token=<?= $newToken;?>";
185
+                window.location.href = "index.php?a=31&mode=delete&path=" + current_path + '/' + file + "&token=<?= $newToken; ?>";
186 186
                 return false;
187 187
             }
188 188
         }
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
         {
192 192
             var newFilename = prompt("<?= $_lang["files_dynamic_new_file_name"] ?>", file);
193 193
             if (newFilename !== null && newFilename !== file) {
194
-                window.location.href = "index.php?a=31&mode=duplicate&path=" + current_path + '/' + file + "&newFilename=" + newFilename + "&token=<?= $newToken;?>";
194
+                window.location.href = "index.php?a=31&mode=duplicate&path=" + current_path + '/' + file + "&newFilename=" + newFilename + "&token=<?= $newToken; ?>";
195 195
             }
196 196
         }
197 197
 
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
         {
200 200
             var newDirname = prompt("<?= $_lang["files_dynamic_new_folder_name"] ?>", dir);
201 201
             if (newDirname !== null && newDirname !== dir) {
202
-                window.location.href = "index.php?a=31&mode=renameFolder&path=" + current_path + '&dirname=' + dir + "&newDirname=" + newDirname + "&token=<?= $newToken;?>";
202
+                window.location.href = "index.php?a=31&mode=renameFolder&path=" + current_path + '&dirname=' + dir + "&newDirname=" + newDirname + "&token=<?= $newToken; ?>";
203 203
             }
204 204
         }
205 205
 
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
         {
208 208
             var newFilename = prompt("<?= $_lang["files_dynamic_new_file_name"] ?>", file);
209 209
             if (newFilename !== null && newFilename !== file) {
210
-                window.location.href = "index.php?a=31&mode=renameFile&path=" + current_path + '/' + file + "&newFilename=" + newFilename + "&token=<?= $newToken;?>";
210
+                window.location.href = "index.php?a=31&mode=renameFile&path=" + current_path + '/' + file + "&newFilename=" + newFilename + "&token=<?= $newToken; ?>";
211 211
             }
212 212
         }
213 213
 
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
             <?php endif ?>
227 227
             <?php
228 228
             if (isset($_GET['mode']) && $_GET['mode'] !== 'drill') {
229
-                $href = 'a=31&path=' . urlencode($_REQUEST['path']);
229
+                $href = 'a=31&path='.urlencode($_REQUEST['path']);
230 230
             } else {
231 231
                 $href = 'a=2';
232 232
             }
@@ -236,12 +236,12 @@  discard block
 block discarded – undo
236 236
                 $tpl = '<a class="btn btn-secondary" href="[+href+]" onclick="return getFolderName(this);"><i class="[+image+]"></i><span>[+subject+]</span></a>';
237 237
                 $ph['image'] = $_style['files_folder-open'];
238 238
                 $ph['subject'] = $_lang['add_folder'];
239
-                $ph['href'] = 'index.php?a=31&mode=newfolder&path=' . urlencode($startpath) . '&name=';
239
+                $ph['href'] = 'index.php?a=31&mode=newfolder&path='.urlencode($startpath).'&name=';
240 240
                 $_ = parsePlaceholder($tpl, $ph);
241 241
 
242
-                $tpl = '<a class="btn btn-secondary" href="[+href+]" onclick="return getFileName(this);"><i class="[+image+]"></i><span>' . $_lang['files.dynamic.php1'] . '</span></a>';
242
+                $tpl = '<a class="btn btn-secondary" href="[+href+]" onclick="return getFileName(this);"><i class="[+image+]"></i><span>'.$_lang['files.dynamic.php1'].'</span></a>';
243 243
                 $ph['image'] = $_style['files_page_html'];
244
-                $ph['href'] = 'index.php?a=31&mode=newfile&path=' . urlencode($startpath) . '&name=';
244
+                $ph['href'] = 'index.php?a=31&mode=newfile&path='.urlencode($startpath).'&name=';
245 245
                 $_ .= parsePlaceholder($tpl, $ph);
246 246
                 echo $_;
247 247
             }
@@ -271,12 +271,12 @@  discard block
 block discarded – undo
271 271
             $ph = array();
272 272
             $ph['style_path'] = $theme_image_path;
273 273
             // To Top Level with folder icon to the left
274
-            if ($startpath == $filemanager_path || $startpath . '/' == $filemanager_path) {
275
-                $ph['image'] = '' . $_style['files_top'] . '';
274
+            if ($startpath == $filemanager_path || $startpath.'/' == $filemanager_path) {
275
+                $ph['image'] = ''.$_style['files_top'].'';
276 276
                 $ph['subject'] = '<span>Top</span>';
277 277
             } else {
278
-                $ph['image'] = '' . $_style['files_top'] . '';
279
-                $ph['subject'] = '<a href="index.php?a=31&mode=drill&path=' . $filemanager_path . '">Top</a>/';
278
+                $ph['image'] = ''.$_style['files_top'].'';
279
+                $ph['subject'] = '<a href="index.php?a=31&mode=drill&path='.$filemanager_path.'">Top</a>/';
280 280
             }
281 281
 
282 282
             echo parsePlaceholder($tpl, $ph);
@@ -293,12 +293,12 @@  discard block
 block discarded – undo
293 293
                     if (empty($v)) {
294 294
                         continue;
295 295
                     }
296
-                    $path .= rtrim($v, '/') . '/';
296
+                    $path .= rtrim($v, '/').'/';
297 297
                     if (1 < $count) {
298
-                        $href = 'index.php?a=31&mode=drill&path=' . urlencode($filemanager_path . $path);
299
-                        $pieces[$i] = '<a href="' . $href . '">' . trim($v, '/') . '</a>';
298
+                        $href = 'index.php?a=31&mode=drill&path='.urlencode($filemanager_path.$path);
299
+                        $pieces[$i] = '<a href="'.$href.'">'.trim($v, '/').'</a>';
300 300
                     } else {
301
-                        $pieces[$i] = '<span>' . trim($v, '/') . '</span>';
301
+                        $pieces[$i] = '<span>'.trim($v, '/').'</span>';
302 302
                     }
303 303
                     $count--;
304 304
                 }
@@ -311,16 +311,16 @@  discard block
 block discarded – undo
311 311
         </div>
312 312
         <?php
313 313
         // check to see user isn't trying to move below the document_root
314
-        if (substr(strtolower(str_replace('//', '/', $startpath . "/")), 0, $len) != strtolower(str_replace('//', '/', $filemanager_path . '/'))) {
314
+        if (substr(strtolower(str_replace('//', '/', $startpath."/")), 0, $len) != strtolower(str_replace('//', '/', $filemanager_path.'/'))) {
315 315
             $modx->webAlertAndQuit($_lang["files_access_denied"]);
316 316
         }
317 317
 
318 318
         // Unzip .zip files - by Raymond
319 319
         if ($enablefileunzip && $_REQUEST['mode'] == 'unzip' && is_writable($startpath)) {
320
-            if (!$err = unzip(realpath("{$startpath}/" . $_REQUEST['file']), realpath($startpath))) {
321
-                echo '<span class="warning"><b>' . $_lang['file_unzip_fail'] . ($err === 0 ? 'Missing zip library (php_zip.dll / zip.so)' : '') . '</b></span><br /><br />';
320
+            if (!$err = unzip(realpath("{$startpath}/".$_REQUEST['file']), realpath($startpath))) {
321
+                echo '<span class="warning"><b>'.$_lang['file_unzip_fail'].($err === 0 ? 'Missing zip library (php_zip.dll / zip.so)' : '').'</b></span><br /><br />';
322 322
             } else {
323
-                echo '<span class="success"><b>' . $_lang['file_unzip'] . '</b></span><br /><br />';
323
+                echo '<span class="success"><b>'.$_lang['file_unzip'].'</b></span><br /><br />';
324 324
             }
325 325
         }
326 326
         // End Unzip - Raymond
@@ -332,9 +332,9 @@  discard block
 block discarded – undo
332 332
             if ($_REQUEST['mode'] == 'deletefolder') {
333 333
                 $folder = $_REQUEST['folderpath'];
334 334
                 if (!$token_check || !@rrmdir($folder)) {
335
-                    echo '<span class="warning"><b>' . $_lang['file_folder_not_deleted'] . '</b></span><br /><br />';
335
+                    echo '<span class="warning"><b>'.$_lang['file_folder_not_deleted'].'</b></span><br /><br />';
336 336
                 } else {
337
-                    echo '<span class="success"><b>' . $_lang['file_folder_deleted'] . '</b></span><br /><br />';
337
+                    echo '<span class="success"><b>'.$_lang['file_folder_deleted'].'</b></span><br /><br />';
338 338
                 }
339 339
             }
340 340
 
@@ -345,10 +345,10 @@  discard block
 block discarded – undo
345 345
                 if (!mkdirs("{$startpath}/{$foldername}", 0777)) {
346 346
                     echo '<span class="warning"><b>', $_lang['file_folder_not_created'], '</b></span><br /><br />';
347 347
                 } else {
348
-                    if (!@chmod($startpath . '/' . $foldername, $newfolderaccessmode)) {
349
-                        echo '<span class="warning"><b>' . $_lang['file_folder_chmod_error'] . '</b></span><br /><br />';
348
+                    if (!@chmod($startpath.'/'.$foldername, $newfolderaccessmode)) {
349
+                        echo '<span class="warning"><b>'.$_lang['file_folder_chmod_error'].'</b></span><br /><br />';
350 350
                     } else {
351
-                        echo '<span class="success"><b>' . $_lang['file_folder_created'] . '</b></span><br /><br />';
351
+                        echo '<span class="success"><b>'.$_lang['file_folder_created'].'</b></span><br /><br />';
352 352
                     }
353 353
                 }
354 354
                 umask($old_umask);
@@ -360,7 +360,7 @@  discard block
 block discarded – undo
360 360
                 $filename = $modx->db->escape($filename);
361 361
 
362 362
                 if (!checkExtension($filename)) {
363
-                    echo '<span class="warning"><b>' . $_lang['files_filetype_notok'] . '</b></span><br /><br />';
363
+                    echo '<span class="warning"><b>'.$_lang['files_filetype_notok'].'</b></span><br /><br />';
364 364
                 } elseif (preg_match('@(\\\\|\/|\:|\;|\,|\*|\?|\"|\<|\>|\||\?)@', $filename) !== 0) {
365 365
                     echo $_lang['files.dynamic.php3'];
366 366
                 } else {
@@ -382,11 +382,11 @@  discard block
 block discarded – undo
382 382
                 $newFilename = $modx->db->escape($newFilename);
383 383
 
384 384
                 if (!checkExtension($newFilename)) {
385
-                    echo '<span class="warning"><b>' . $_lang['files_filetype_notok'] . '</b></span><br /><br />';
385
+                    echo '<span class="warning"><b>'.$_lang['files_filetype_notok'].'</b></span><br /><br />';
386 386
                 } elseif (preg_match('@(\\\\|\/|\:|\;|\,|\*|\?|\"|\<|\>|\||\?)@', $newFilename) !== 0) {
387 387
                     echo $_lang['files.dynamic.php3'];
388 388
                 } else {
389
-                    if (!copy($filename, MODX_BASE_PATH . $newFilename)) {
389
+                    if (!copy($filename, MODX_BASE_PATH.$newFilename)) {
390 390
                         echo $_lang['files.dynamic.php5'];
391 391
                     }
392 392
                     umask($old_umask);
@@ -395,7 +395,7 @@  discard block
 block discarded – undo
395 395
             // Rename folder here
396 396
             if ($_REQUEST['mode'] == 'renameFolder') {
397 397
                 $old_umask = umask(0);
398
-                $dirname = $_REQUEST['path'] . '/' . $_REQUEST['dirname'];
398
+                $dirname = $_REQUEST['path'].'/'.$_REQUEST['dirname'];
399 399
                 $dirname = $modx->db->escape($dirname);
400 400
                 $newDirname = str_replace(array(
401 401
                     '..\\',
@@ -407,7 +407,7 @@  discard block
 block discarded – undo
407 407
 
408 408
                 if (preg_match('@(\\\\|\/|\:|\;|\,|\*|\?|\"|\<|\>|\||\?)@', $newDirname) !== 0) {
409 409
                     echo $_lang['files.dynamic.php3'];
410
-                } else if (!rename($dirname, $_REQUEST['path'] . '/' . $newDirname)) {
410
+                } else if (!rename($dirname, $_REQUEST['path'].'/'.$newDirname)) {
411 411
                     echo '<span class="warning"><b>', $_lang['file_folder_not_created'], '</b></span><br /><br />';
412 412
                 }
413 413
                 umask($old_umask);
@@ -427,11 +427,11 @@  discard block
 block discarded – undo
427 427
                 $newFilename = $modx->db->escape($newFilename);
428 428
 
429 429
                 if (!checkExtension($newFilename)) {
430
-                    echo '<span class="warning"><b>' . $_lang['files_filetype_notok'] . '</b></span><br /><br />';
430
+                    echo '<span class="warning"><b>'.$_lang['files_filetype_notok'].'</b></span><br /><br />';
431 431
                 } elseif (preg_match('@(\\\\|\/|\:|\;|\,|\*|\?|\"|\<|\>|\||\?)@', $newFilename) !== 0) {
432 432
                     echo $_lang['files.dynamic.php3'];
433 433
                 } else {
434
-                    if (!rename($filename, $path . '/' . $newFilename)) {
434
+                    if (!rename($filename, $path.'/'.$newFilename)) {
435 435
                         echo $_lang['files.dynamic.php5'];
436 436
                     }
437 437
                     umask($old_umask);
@@ -464,7 +464,7 @@  discard block
 block discarded – undo
464 464
                 ls($startpath);
465 465
                 echo "\n\n\n";
466 466
                 if ($folders == 0 && $files == 0) {
467
-                    echo '<tr><td colspan="4"><i class="' . $_style['files_deleted_folder'] . ' FilesDeletedFolder"></i> <span style="color:#888;cursor:default;"> ' . $_lang['files_directory_is_empty'] . ' </span></td></tr>';
467
+                    echo '<tr><td colspan="4"><i class="'.$_style['files_deleted_folder'].' FilesDeletedFolder"></i> <span style="color:#888;cursor:default;"> '.$_lang['files_directory_is_empty'].' </span></td></tr>';
468 468
                 }
469 469
                 ?>
470 470
             </table>
@@ -473,10 +473,10 @@  discard block
 block discarded – undo
473 473
         <div class="container">
474 474
             <p>
475 475
                 <?php
476
-                echo $_lang['files_directories'] . ': <b>' . $folders . '</b> ';
477
-                echo $_lang['files_files'] . ': <b>' . $files . '</b> ';
478
-                echo $_lang['files_data'] . ': <b><span dir="ltr">' . $modx->nicesize($filesizes) . '</span></b> ';
479
-                echo $_lang['files_dirwritable'] . ' <b>' . (is_writable($startpath) == 1 ? $_lang['yes'] . '.' : $_lang['no']) . '.</b>'
476
+                echo $_lang['files_directories'].': <b>'.$folders.'</b> ';
477
+                echo $_lang['files_files'].': <b>'.$files.'</b> ';
478
+                echo $_lang['files_data'].': <b><span dir="ltr">'.$modx->nicesize($filesizes).'</span></b> ';
479
+                echo $_lang['files_dirwritable'].' <b>'.(is_writable($startpath) == 1 ? $_lang['yes'].'.' : $_lang['no']).'.</b>'
480 480
                 ?>
481 481
             </p>
482 482
 
@@ -501,7 +501,7 @@  discard block
 block discarded – undo
501 501
                 </form>
502 502
                 <?php
503 503
             } else {
504
-                echo "<p>" . $_lang['files_upload_inhibited_msg'] . "</p>";
504
+                echo "<p>".$_lang['files_upload_inhibited_msg']."</p>";
505 505
             }
506 506
             ?>
507 507
             <div id="imageviewer"></div>
@@ -586,7 +586,7 @@  discard block
 block discarded – undo
586 586
     if ($file == $selFile) {
587 587
         $icon = isset($icons[$mode]) ? $icons[$mode] : $icons['default'];
588 588
     }
589
-    return '<i class="' . $icon . ' FilesPage"></i>';
589
+    return '<i class="'.$icon.' FilesPage"></i>';
590 590
 }
591 591
 
592 592
 /**
@@ -604,7 +604,7 @@  discard block
 block discarded – undo
604 604
     );
605 605
     if ($file == $selFile) {
606 606
         $class = isset($classNames[$mode]) ? $classNames[$mode] : $classNames['default'];
607
-        return ' class="' . $class . '"';
607
+        return ' class="'.$class.'"';
608 608
     }
609 609
     return '';
610 610
 }
@@ -618,7 +618,7 @@  discard block
 block discarded – undo
618 618
     global $excludes, $protected_path, $editablefiles, $inlineviewablefiles, $viewablefiles, $enablefileunzip, $enablefiledownload, $uploadablefiles, $folders, $files, $filesizes, $len, $dirs_array, $files_array, $webstart_path, $modx;
619 619
     $dircounter = 0;
620 620
     $filecounter = 0;
621
-    $curpath = str_replace('//', '/', $curpath . '/');
621
+    $curpath = str_replace('//', '/', $curpath.'/');
622 622
 
623 623
     if (!is_dir($curpath)) {
624 624
         echo 'Invalid path "', $curpath, '"<br />';
@@ -628,7 +628,7 @@  discard block
 block discarded – undo
628 628
 
629 629
     // first, get info
630 630
     foreach ($dir as $file) {
631
-        $newpath = $curpath . $file;
631
+        $newpath = $curpath.$file;
632 632
         if ($file === '..' || $file === '.') {
633 633
             continue;
634 634
         }
@@ -638,7 +638,7 @@  discard block
 block discarded – undo
638 638
             if ($file === '..' || $file === '.') {
639 639
                 continue;
640 640
             } elseif (!in_array($file, $excludes) && !in_array($newpath, $protected_path)) {
641
-                $dirs_array[$dircounter]['text'] = '<i class="' . $_style['files_folder'] . ' FilesFolder"></i> <a href="index.php?a=31&mode=drill&path=' . urlencode($newpath) . '"><b>' . $file . '</b></a>';
641
+                $dirs_array[$dircounter]['text'] = '<i class="'.$_style['files_folder'].' FilesFolder"></i> <a href="index.php?a=31&mode=drill&path='.urlencode($newpath).'"><b>'.$file.'</b></a>';
642 642
 
643 643
                 $dfiles = scandir($newpath);
644 644
                 foreach ($dfiles as $i => $infile) {
@@ -651,13 +651,13 @@  discard block
 block discarded – undo
651 651
                 }
652 652
                 $file_exists = (0 < count($dfiles)) ? 'file_exists' : '';
653 653
 
654
-                $dirs_array[$dircounter]['delete'] = is_writable($curpath) ? '<a href="javascript: deleteFolder(\'' . urlencode($file) . '\',\'' . $file_exists . '\');"><i class="' . $_style['files_delete'] . '" title="' . $_lang['file_delete_folder'] . '"></i></a>' : '';
654
+                $dirs_array[$dircounter]['delete'] = is_writable($curpath) ? '<a href="javascript: deleteFolder(\''.urlencode($file).'\',\''.$file_exists.'\');"><i class="'.$_style['files_delete'].'" title="'.$_lang['file_delete_folder'].'"></i></a>' : '';
655 655
             } else {
656
-                $dirs_array[$dircounter]['text'] = '<span><i class="' . $_style['files_deleted_folder'] . ' FilesDeletedFolder"></i> ' . $file . '</span>';
657
-                $dirs_array[$dircounter]['delete'] = is_writable($curpath) ? '<span class="disabled"><i class="' . $_style['files_delete'] . '" title="' . $_lang['file_delete_folder'] . '"></i></span>' : '';
656
+                $dirs_array[$dircounter]['text'] = '<span><i class="'.$_style['files_deleted_folder'].' FilesDeletedFolder"></i> '.$file.'</span>';
657
+                $dirs_array[$dircounter]['delete'] = is_writable($curpath) ? '<span class="disabled"><i class="'.$_style['files_delete'].'" title="'.$_lang['file_delete_folder'].'"></i></span>' : '';
658 658
             }
659 659
 
660
-            $dirs_array[$dircounter]['rename'] = is_writable($curpath) ? '<a href="javascript:renameFolder(\'' . urlencode($file) . '\');"><i class="' . $_style['files_rename'] . '" title="' . $_lang['rename'] . '"></i></a> ' : '';
660
+            $dirs_array[$dircounter]['rename'] = is_writable($curpath) ? '<a href="javascript:renameFolder(\''.urlencode($file).'\');"><i class="'.$_style['files_rename'].'" title="'.$_lang['rename'].'"></i></a> ' : '';
661 661
 
662 662
             // increment the counter
663 663
             $dircounter++;
@@ -665,14 +665,14 @@  discard block
 block discarded – undo
665 665
             $type = getExtension($newpath);
666 666
             $files_array[$filecounter]['file'] = $newpath;
667 667
             $files_array[$filecounter]['stats'] = lstat($newpath);
668
-            $files_array[$filecounter]['text'] = determineIcon($newpath, $_REQUEST['path'], $_REQUEST['mode']) . ' ' . $file;
669
-            $files_array[$filecounter]['view'] = (in_array($type, $viewablefiles)) ? '<a href="javascript:;" onclick="viewfile(\'' . $webstart_path . substr($newpath, $len, strlen($newpath)) . '\');"><i class="' . $_style['files_view'] . '" title="' . $_lang['files_viewfile'] . '"></i></a>' : (($enablefiledownload && in_array($type, $uploadablefiles)) ? '<a href="' . $webstart_path . implode('/', array_map('rawurlencode', explode('/', substr($newpath, $len, strlen($newpath))))) . '" style="cursor:pointer;"><i class="' . $_style['files_download'] . '" title="' . $_lang['file_download_file'] . '"></i></a>' : '<span class="disabled"><i class="' . $_style['files_view'] . '" title="' . $_lang['files_viewfile'] . '"></i></span>');
670
-            $files_array[$filecounter]['view'] = (in_array($type, $inlineviewablefiles)) ? '<a href="index.php?a=31&mode=view&path=' . urlencode($newpath) . '"><i class="' . $_style['files_view'] . '" title="' . $_lang['files_viewfile'] . '"></i></a>' : $files_array[$filecounter]['view'];
671
-            $files_array[$filecounter]['unzip'] = ($enablefileunzip && $type == '.zip') ? '<a href="javascript:unzipFile(\'' . urlencode($file) . '\');"><i class="' . $_style['files_unzip'] . '" title="' . $_lang['file_download_unzip'] . '"></i></a>' : '';
672
-            $files_array[$filecounter]['edit'] = (in_array($type, $editablefiles) && is_writable($curpath) && is_writable($newpath)) ? '<a href="index.php?a=31&mode=edit&path=' . urlencode($newpath) . '#file_editfile"><i class="' . $_style['files_edit'] . '" title="' . $_lang['files_editfile'] . '"></i></a>' : '<span class="disabled"><i class="' . $_style['files_edit'] . '" title="' . $_lang['files_editfile'] . '"></i></span>';
673
-            $files_array[$filecounter]['duplicate'] = (in_array($type, $editablefiles) && is_writable($curpath) && is_writable($newpath)) ? '<a href="javascript:duplicateFile(\'' . urlencode($file) . '\');"><i class="' . $_style['files_duplicate'] . '" title="' . $_lang['duplicate'] . '"></i></a>' : '<span class="disabled"><i class="' . $_style['files_duplicate'] . '" align="absmiddle" title="' . $_lang['duplicate'] . '"></i></span>';
674
-            $files_array[$filecounter]['rename'] = (in_array($type, $editablefiles) && is_writable($curpath) && is_writable($newpath)) ? '<a href="javascript:renameFile(\'' . urlencode($file) . '\');"><i class="' . $_style['files_rename'] . '" align="absmiddle" title="' . $_lang['rename'] . '"></i></a>' : '<span class="disabled"><i class="' . $_style['files_rename'] . '" align="absmiddle" title="' . $_lang['rename'] . '"></i></span>';
675
-            $files_array[$filecounter]['delete'] = is_writable($curpath) && is_writable($newpath) ? '<a href="javascript:deleteFile(\'' . urlencode($file) . '\');"><i class="' . $_style['files_delete'] . '" title="' . $_lang['file_delete_file'] . '"></i></a>' : '<span class="disabled"><i class="' . $_style['files_delete'] . '" title="' . $_lang['file_delete_file'] . '"></i></span>';
668
+            $files_array[$filecounter]['text'] = determineIcon($newpath, $_REQUEST['path'], $_REQUEST['mode']).' '.$file;
669
+            $files_array[$filecounter]['view'] = (in_array($type, $viewablefiles)) ? '<a href="javascript:;" onclick="viewfile(\''.$webstart_path.substr($newpath, $len, strlen($newpath)).'\');"><i class="'.$_style['files_view'].'" title="'.$_lang['files_viewfile'].'"></i></a>' : (($enablefiledownload && in_array($type, $uploadablefiles)) ? '<a href="'.$webstart_path.implode('/', array_map('rawurlencode', explode('/', substr($newpath, $len, strlen($newpath))))).'" style="cursor:pointer;"><i class="'.$_style['files_download'].'" title="'.$_lang['file_download_file'].'"></i></a>' : '<span class="disabled"><i class="'.$_style['files_view'].'" title="'.$_lang['files_viewfile'].'"></i></span>');
670
+            $files_array[$filecounter]['view'] = (in_array($type, $inlineviewablefiles)) ? '<a href="index.php?a=31&mode=view&path='.urlencode($newpath).'"><i class="'.$_style['files_view'].'" title="'.$_lang['files_viewfile'].'"></i></a>' : $files_array[$filecounter]['view'];
671
+            $files_array[$filecounter]['unzip'] = ($enablefileunzip && $type == '.zip') ? '<a href="javascript:unzipFile(\''.urlencode($file).'\');"><i class="'.$_style['files_unzip'].'" title="'.$_lang['file_download_unzip'].'"></i></a>' : '';
672
+            $files_array[$filecounter]['edit'] = (in_array($type, $editablefiles) && is_writable($curpath) && is_writable($newpath)) ? '<a href="index.php?a=31&mode=edit&path='.urlencode($newpath).'#file_editfile"><i class="'.$_style['files_edit'].'" title="'.$_lang['files_editfile'].'"></i></a>' : '<span class="disabled"><i class="'.$_style['files_edit'].'" title="'.$_lang['files_editfile'].'"></i></span>';
673
+            $files_array[$filecounter]['duplicate'] = (in_array($type, $editablefiles) && is_writable($curpath) && is_writable($newpath)) ? '<a href="javascript:duplicateFile(\''.urlencode($file).'\');"><i class="'.$_style['files_duplicate'].'" title="'.$_lang['duplicate'].'"></i></a>' : '<span class="disabled"><i class="'.$_style['files_duplicate'].'" align="absmiddle" title="'.$_lang['duplicate'].'"></i></span>';
674
+            $files_array[$filecounter]['rename'] = (in_array($type, $editablefiles) && is_writable($curpath) && is_writable($newpath)) ? '<a href="javascript:renameFile(\''.urlencode($file).'\');"><i class="'.$_style['files_rename'].'" align="absmiddle" title="'.$_lang['rename'].'"></i></a>' : '<span class="disabled"><i class="'.$_style['files_rename'].'" align="absmiddle" title="'.$_lang['rename'].'"></i></span>';
675
+            $files_array[$filecounter]['delete'] = is_writable($curpath) && is_writable($newpath) ? '<a href="javascript:deleteFile(\''.urlencode($file).'\');"><i class="'.$_style['files_delete'].'" title="'.$_lang['file_delete_file'].'"></i></a>' : '<span class="disabled"><i class="'.$_style['files_delete'].'" title="'.$_lang['file_delete_file'].'"></i></span>';
676 676
 
677 677
             // increment the counter
678 678
             $filecounter++;
@@ -685,9 +685,9 @@  discard block
 block discarded – undo
685 685
     for ($i = 0; $i < $folders; $i++) {
686 686
         $filesizes += $dirs_array[$i]['stats']['7'];
687 687
         echo '<tr>';
688
-        echo '<td>' . $dirs_array[$i]['text'] . '</td>';
689
-        echo '<td class="text-nowrap">' . $modx->toDateFormat($dirs_array[$i]['stats']['9']) . '</td>';
690
-        echo '<td class="text-right">' . $modx->nicesize($dirs_array[$i]['stats']['7']) . '</td>';
688
+        echo '<td>'.$dirs_array[$i]['text'].'</td>';
689
+        echo '<td class="text-nowrap">'.$modx->toDateFormat($dirs_array[$i]['stats']['9']).'</td>';
690
+        echo '<td class="text-right">'.$modx->nicesize($dirs_array[$i]['stats']['7']).'</td>';
691 691
         echo '<td class="actions text-right">';
692 692
         echo $dirs_array[$i]['rename'];
693 693
         echo $dirs_array[$i]['delete'];
@@ -700,10 +700,10 @@  discard block
 block discarded – undo
700 700
     sort($files_array); // sorting the array alphabetically (Thanks pxl8r!)
701 701
     for ($i = 0; $i < $files; $i++) {
702 702
         $filesizes += $files_array[$i]['stats']['7'];
703
-        echo '<tr ' . markRow($files_array[$i]['file'], $_REQUEST['path'], $_REQUEST['mode']) . '>';
704
-        echo '<td>' . $files_array[$i]['text'] . '</td>';
705
-        echo '<td class="text-nowrap">' . $modx->toDateFormat($files_array[$i]['stats']['9']) . '</td>';
706
-        echo '<td class="text-right">' . $modx->nicesize($files_array[$i]['stats']['7']) . '</td>';
703
+        echo '<tr '.markRow($files_array[$i]['file'], $_REQUEST['path'], $_REQUEST['mode']).'>';
704
+        echo '<td>'.$files_array[$i]['text'].'</td>';
705
+        echo '<td class="text-nowrap">'.$modx->toDateFormat($files_array[$i]['stats']['9']).'</td>';
706
+        echo '<td class="text-right">'.$modx->nicesize($files_array[$i]['stats']['7']).'</td>';
707 707
         echo '<td class="actions text-right">';
708 708
         echo $files_array[$i]['unzip'];
709 709
         echo $files_array[$i]['view'];
@@ -840,17 +840,17 @@  discard block
 block discarded – undo
840 840
     $zip = zip_open($file);
841 841
     if ($zip) {
842 842
         $old_umask = umask(0);
843
-        $path = rtrim($path, '/') . '/';
843
+        $path = rtrim($path, '/').'/';
844 844
         while ($zip_entry = zip_read($zip)) {
845 845
             if (zip_entry_filesize($zip_entry) > 0) {
846 846
                 // str_replace must be used under windows to convert "/" into "\"
847 847
                 $zip_entry_name = zip_entry_name($zip_entry);
848
-                $complete_path = $path . str_replace('\\', '/', dirname($zip_entry_name));
849
-                $complete_name = $path . str_replace('\\', '/', $zip_entry_name);
848
+                $complete_path = $path.str_replace('\\', '/', dirname($zip_entry_name));
849
+                $complete_name = $path.str_replace('\\', '/', $zip_entry_name);
850 850
                 if (!file_exists($complete_path)) {
851 851
                     $tmp = '';
852 852
                     foreach (explode('/', $complete_path) AS $k) {
853
-                        $tmp .= $k . '/';
853
+                        $tmp .= $k.'/';
854 854
                         if (!is_dir($tmp)) {
855 855
                             mkdir($tmp, 0777);
856 856
                         }
@@ -875,7 +875,7 @@  discard block
 block discarded – undo
875 875
  */
876 876
 function rrmdir($dir)
877 877
 {
878
-    foreach (glob($dir . '/*') as $file) {
878
+    foreach (glob($dir.'/*') as $file) {
879 879
         if (is_dir($file)) {
880 880
             rrmdir($file);
881 881
         } else {
@@ -894,7 +894,7 @@  discard block
 block discarded – undo
894 894
     $msg = '';
895 895
     foreach ($_FILES['userfile']['name'] as $i => $name) {
896 896
         if (empty($_FILES['userfile']['tmp_name'][$i])) continue;
897
-        $userfile= array();
897
+        $userfile = array();
898 898
 
899 899
         $userfile['tmp_name'] = $_FILES['userfile']['tmp_name'][$i];
900 900
         $userfile['error'] = $_FILES['userfile']['error'][$i];
@@ -911,12 +911,12 @@  discard block
 block discarded – undo
911 911
         $userfile['type'] = $_FILES['userfile']['type'][$i];
912 912
 
913 913
         // this seems to be an upload action.
914
-        $path = $modx->config['site_url'] . substr($startpath, strlen($filemanager_path), strlen($startpath));
915
-        $path = rtrim($path, '/') . '/' . $userfile['name'];
914
+        $path = $modx->config['site_url'].substr($startpath, strlen($filemanager_path), strlen($startpath));
915
+        $path = rtrim($path, '/').'/'.$userfile['name'];
916 916
         $msg .= $path;
917 917
         if ($userfile['error'] == 0) {
918
-            $img = (strpos($userfile['type'], 'image') !== false) ? '<br /><img src="' . $path . '" height="75" />' : '';
919
-            $msg .= "<p>" . $_lang['files_file_type'] . $userfile['type'] . ", " . $modx->nicesize(filesize($userfile['tmp_name'])) . $img . '</p>';
918
+            $img = (strpos($userfile['type'], 'image') !== false) ? '<br /><img src="'.$path.'" height="75" />' : '';
919
+            $msg .= "<p>".$_lang['files_file_type'].$userfile['type'].", ".$modx->nicesize(filesize($userfile['tmp_name'])).$img.'</p>';
920 920
         }
921 921
 
922 922
         $userfilename = $userfile['tmp_name'];
@@ -924,15 +924,15 @@  discard block
 block discarded – undo
924 924
         if (is_uploaded_file($userfilename)) {
925 925
             // file is uploaded file, process it!
926 926
             if (!checkExtension($userfile['name'])) {
927
-                $msg .= '<p><span class="warning">' . $_lang['files_filetype_notok'] . '</span></p>';
927
+                $msg .= '<p><span class="warning">'.$_lang['files_filetype_notok'].'</span></p>';
928 928
             } else {
929
-                if (@move_uploaded_file($userfile['tmp_name'], $_POST['path'] . '/' . $userfile['name'])) {
929
+                if (@move_uploaded_file($userfile['tmp_name'], $_POST['path'].'/'.$userfile['name'])) {
930 930
                     // Ryan: Repair broken permissions issue with file manager
931 931
                     if (strtoupper(substr(PHP_OS, 0, 3)) != 'WIN') {
932
-                        @chmod($_POST['path'] . "/" . $userfile['name'], $new_file_permissions);
932
+                        @chmod($_POST['path']."/".$userfile['name'], $new_file_permissions);
933 933
                     }
934 934
                     // Ryan: End
935
-                    $msg .= '<p><span class="success">' . $_lang['files_upload_ok'] . '</span></p><hr/>';
935
+                    $msg .= '<p><span class="success">'.$_lang['files_upload_ok'].'</span></p><hr/>';
936 936
 
937 937
                     // invoke OnFileManagerUpload event
938 938
                     $modx->invokeEvent('OnFileManagerUpload', array(
@@ -940,13 +940,13 @@  discard block
 block discarded – undo
940 940
                         'filename' => $userfile['name']
941 941
                     ));
942 942
                     // Log the change
943
-                    logFileChange('upload', $_POST['path'] . '/' . $userfile['name']);
943
+                    logFileChange('upload', $_POST['path'].'/'.$userfile['name']);
944 944
                 } else {
945
-                    $msg .= '<p><span class="warning">' . $_lang['files_upload_copyfailed'] . '</span> ' . $_lang["files_upload_permissions_error"] . '</p>';
945
+                    $msg .= '<p><span class="warning">'.$_lang['files_upload_copyfailed'].'</span> '.$_lang["files_upload_permissions_error"].'</p>';
946 946
                 }
947 947
             }
948 948
         } else {
949
-            $msg .= '<br /><span class="warning"><b>' . $_lang['files_upload_error'] . ':</b>';
949
+            $msg .= '<br /><span class="warning"><b>'.$_lang['files_upload_error'].':</b>';
950 950
             switch ($userfile['error']) {
951 951
                 case 0: //no error; possible file attack!
952 952
                     $msg .= $_lang['files_upload_error0'];
@@ -970,7 +970,7 @@  discard block
 block discarded – undo
970 970
             $msg .= '</span><br />';
971 971
         }
972 972
     }
973
-    return $msg . '<br/>';
973
+    return $msg.'<br/>';
974 974
 }
975 975
 
976 976
 /**
@@ -986,9 +986,9 @@  discard block
 block discarded – undo
986 986
 
987 987
     // Write $content to our opened file.
988 988
     if (file_put_contents($filename, $content) === false) {
989
-        $msg .= '<span class="warning"><b>' . $_lang['file_not_saved'] . '</b></span><br /><br />';
989
+        $msg .= '<span class="warning"><b>'.$_lang['file_not_saved'].'</b></span><br /><br />';
990 990
     } else {
991
-        $msg .= '<span class="success"><b>' . $_lang['file_saved'] . '</b></span><br /><br />';
991
+        $msg .= '<span class="success"><b>'.$_lang['file_saved'].'</b></span><br /><br />';
992 992
         $_REQUEST['mode'] = 'edit';
993 993
     }
994 994
     // Log the change
@@ -1007,9 +1007,9 @@  discard block
 block discarded – undo
1007 1007
 
1008 1008
     $file = $_REQUEST['path'];
1009 1009
     if (!$token_check || !@unlink($file)) {
1010
-        $msg .= '<span class="warning"><b>' . $_lang['file_not_deleted'] . '</b></span><br /><br />';
1010
+        $msg .= '<span class="warning"><b>'.$_lang['file_not_deleted'].'</b></span><br /><br />';
1011 1011
     } else {
1012
-        $msg .= '<span class="success"><b>' . $_lang['file_deleted'] . '</b></span><br /><br />';
1012
+        $msg .= '<span class="success"><b>'.$_lang['file_deleted'].'</b></span><br /><br />';
1013 1013
     }
1014 1014
 
1015 1015
     // Log the change
Please login to merge, or discard this patch.
manager/actions/refresh_site.dynamic.php 3 patches
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -29,10 +29,12 @@
 block discarded – undo
29 29
 
30 30
 <div class="tab-page">
31 31
 	<div class="container container-body">
32
-		<?php if($num_rows_pub)   printf('<p>' . $_lang["refresh_published"]   . '</p>', $num_rows_pub) ?>
32
+		<?php if($num_rows_pub) {
33
+    printf('<p>' . $_lang["refresh_published"]   . '</p>', $num_rows_pub) ?>
33 34
 		<?php if($num_rows_unpub) printf('<p>' . $_lang["refresh_unpublished"] . '</p>', $num_rows_unpub) ?>
34 35
 		<?php
35 36
 		$modx->clearCache('full', true);
37
+}
36 38
 		// invoke OnSiteRefresh event
37 39
 		$modx->invokeEvent("OnSiteRefresh");
38 40
 		?>
Please login to merge, or discard this patch.
Indentation   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3
-	die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
3
+    die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5 5
 
6 6
 // (un)publishing of documents, version 2!
@@ -32,9 +32,9 @@  discard block
 block discarded – undo
32 32
 		<?php if($num_rows_pub)   printf('<p>' . $_lang["refresh_published"]   . '</p>', $num_rows_pub) ?>
33 33
 		<?php if($num_rows_unpub) printf('<p>' . $_lang["refresh_unpublished"] . '</p>', $num_rows_unpub) ?>
34 34
 		<?php
35
-		$modx->clearCache('full', true);
36
-		// invoke OnSiteRefresh event
37
-		$modx->invokeEvent("OnSiteRefresh");
38
-		?>
35
+        $modx->clearCache('full', true);
36
+        // invoke OnSiteRefresh event
37
+        $modx->invokeEvent("OnSiteRefresh");
38
+        ?>
39 39
 	</div>
40 40
 </div>
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 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
 
@@ -29,8 +29,8 @@  discard block
 block discarded – undo
29 29
 
30 30
 <div class="tab-page">
31 31
 	<div class="container container-body">
32
-		<?php if($num_rows_pub)   printf('<p>' . $_lang["refresh_published"]   . '</p>', $num_rows_pub) ?>
33
-		<?php if($num_rows_unpub) printf('<p>' . $_lang["refresh_unpublished"] . '</p>', $num_rows_unpub) ?>
32
+		<?php if ($num_rows_pub)   printf('<p>'.$_lang["refresh_published"].'</p>', $num_rows_pub) ?>
33
+		<?php if ($num_rows_unpub) printf('<p>'.$_lang["refresh_unpublished"].'</p>', $num_rows_unpub) ?>
34 34
 		<?php
35 35
 		$modx->clearCache('full', true);
36 36
 		// invoke OnSiteRefresh event
Please login to merge, or discard this patch.
manager/processors/logout.processor.php 2 patches
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -7,10 +7,10 @@  discard block
 block discarded – undo
7 7
 
8 8
 // invoke OnBeforeManagerLogout event
9 9
 $modx->invokeEvent("OnBeforeManagerLogout",
10
-						array(
11
-							"userid"		=> $internalKey,
12
-							"username"		=> $username
13
-						));
10
+                        array(
11
+                            "userid"		=> $internalKey,
12
+                            "username"		=> $username
13
+                        ));
14 14
 
15 15
 //// Unset all of the session variables.
16 16
 //$_SESSION = array();
@@ -33,10 +33,10 @@  discard block
 block discarded – undo
33 33
 
34 34
 // invoke OnManagerLogout event
35 35
 $modx->invokeEvent("OnManagerLogout",
36
-						array(
37
-							"userid"		=> $internalKey,
38
-							"username"		=> $username
39
-						));
36
+                        array(
37
+                            "userid"		=> $internalKey,
38
+                            "username"		=> $username
39
+                        ));
40 40
 
41 41
 // show login screen
42 42
 header('Location: ' . MODX_MANAGER_URL);
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 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
 
@@ -41,4 +41,4 @@  discard block
 block discarded – undo
41 41
 						));
42 42
 
43 43
 // show login screen
44
-header('Location: ' . MODX_MANAGER_URL);
44
+header('Location: '.MODX_MANAGER_URL);
Please login to merge, or discard this patch.
manager/processors/save_settings.processor.php 4 patches
Upper-Lower-Casing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 		}
22 22
 		elseif(is_writable($htaccess))
23 23
 		{
24
-			$_ = preg_replace('@RewriteBase.+@',"RewriteBase {$dir}", $_);
24
+			$_ = preg_replace('@RewriteBase.+@',"rewritebase {$dir}", $_);
25 25
 			if(!@file_put_contents($htaccess,$_))
26 26
 			{
27 27
 				$warnings[] = $_lang["settings_friendlyurls_alert2"];
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 		elseif($modx->config['base_url']!=='/')
38 38
 		{
39 39
 			$_ = file_get_contents($htaccess);
40
-			$_ = preg_replace('@RewriteBase.+@',"RewriteBase {$dir}", $_);
40
+			$_ = preg_replace('@RewriteBase.+@',"rewritebase {$dir}", $_);
41 41
 			if(!@file_put_contents($htaccess,$_))
42 42
 			{
43 43
 				$warnings[] = $_lang["settings_friendlyurls_alert2"];
Please login to merge, or discard this patch.
Indentation   +109 added lines, -109 removed lines patch added patch discarded remove patch
@@ -3,7 +3,7 @@  discard block
 block discarded – undo
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
 if(!$modx->hasPermission('settings')) {
6
-	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
6
+    $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 $data = $_POST;
9 9
 // lose the POST now, gets rid of quirky issue with Safari 3 - see FS#972
@@ -11,41 +11,41 @@  discard block
 block discarded – undo
11 11
 
12 12
 if($data['friendly_urls']==='1' && strpos($_SERVER['SERVER_SOFTWARE'],'IIS')===false)
13 13
 {
14
-	$htaccess        = $modx->config['base_path'] . '.htaccess';
15
-	$sample_htaccess = $modx->config['base_path'] . 'ht.access';
16
-	$dir = '/' . trim($modx->config['base_url'],'/');
17
-	if(is_file($htaccess))
18
-	{
19
-		$_ = file_get_contents($htaccess);
20
-		if(strpos($_,'RewriteBase')===false)
21
-		{
22
-			$warnings[] = $_lang["settings_friendlyurls_alert2"];
23
-		}
24
-		elseif(is_writable($htaccess))
25
-		{
26
-			$_ = preg_replace('@RewriteBase.+@',"RewriteBase {$dir}", $_);
27
-			if(!@file_put_contents($htaccess,$_))
28
-			{
29
-				$warnings[] = $_lang["settings_friendlyurls_alert2"];
30
-			}
31
-		}
32
-	}
33
-	elseif(is_file($sample_htaccess))
34
-	{
35
-		if(!@rename($sample_htaccess,$htaccess))
14
+    $htaccess        = $modx->config['base_path'] . '.htaccess';
15
+    $sample_htaccess = $modx->config['base_path'] . 'ht.access';
16
+    $dir = '/' . trim($modx->config['base_url'],'/');
17
+    if(is_file($htaccess))
18
+    {
19
+        $_ = file_get_contents($htaccess);
20
+        if(strpos($_,'RewriteBase')===false)
36 21
         {
37
-        	$warnings[] = $_lang["settings_friendlyurls_alert"];
38
-		}
39
-		elseif($modx->config['base_url']!=='/')
40
-		{
41
-			$_ = file_get_contents($htaccess);
42
-			$_ = preg_replace('@RewriteBase.+@',"RewriteBase {$dir}", $_);
43
-			if(!@file_put_contents($htaccess,$_))
44
-			{
45
-				$warnings[] = $_lang["settings_friendlyurls_alert2"];
46
-			}
47
-		}
48
-	}
22
+            $warnings[] = $_lang["settings_friendlyurls_alert2"];
23
+        }
24
+        elseif(is_writable($htaccess))
25
+        {
26
+            $_ = preg_replace('@RewriteBase.+@',"RewriteBase {$dir}", $_);
27
+            if(!@file_put_contents($htaccess,$_))
28
+            {
29
+                $warnings[] = $_lang["settings_friendlyurls_alert2"];
30
+            }
31
+        }
32
+    }
33
+    elseif(is_file($sample_htaccess))
34
+    {
35
+        if(!@rename($sample_htaccess,$htaccess))
36
+        {
37
+            $warnings[] = $_lang["settings_friendlyurls_alert"];
38
+        }
39
+        elseif($modx->config['base_url']!=='/')
40
+        {
41
+            $_ = file_get_contents($htaccess);
42
+            $_ = preg_replace('@RewriteBase.+@',"RewriteBase {$dir}", $_);
43
+            if(!@file_put_contents($htaccess,$_))
44
+            {
45
+                $warnings[] = $_lang["settings_friendlyurls_alert2"];
46
+            }
47
+        }
48
+    }
49 49
 }
50 50
 
51 51
 if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) {
@@ -56,22 +56,22 @@  discard block
 block discarded – undo
56 56
 $data['rb_base_dir']      = str_replace('[(base_path)]',MODX_BASE_PATH,$data['rb_base_dir']);
57 57
 
58 58
 if (isset($data) && count($data) > 0) {
59
-	if(isset($data['manager_language'])) {
60
-		$lang_path = MODX_MANAGER_PATH . 'includes/lang/' . $data['manager_language'] . '.inc.php';
61
-		if(is_file($lang_path)) {
62
-			include($lang_path);
59
+    if(isset($data['manager_language'])) {
60
+        $lang_path = MODX_MANAGER_PATH . 'includes/lang/' . $data['manager_language'] . '.inc.php';
61
+        if(is_file($lang_path)) {
62
+            include($lang_path);
63 63
             global $modx_lang_attribute;
64 64
             $data['lang_code'] = !$modx_lang_attribute ? 'en' : $modx_lang_attribute;
65
-		}
66
-	}
67
-	$savethese = array();
68
-	$data['sys_files_checksum'] = $modx->manager->getSystemChecksum($data['check_files_onlogin']);
69
-	$data['mail_check_timeperiod'] = (int)$data['mail_check_timeperiod'] < 60 ? 60 : $data['mail_check_timeperiod']; // updateMail() in mainMenu no faster than every minute
70
-	foreach ($data as $k => $v) {
71
-		switch ($k) {
72
-			case 'site_name':
73
-				$v = htmlspecialchars($v);
74
-				break;
65
+        }
66
+    }
67
+    $savethese = array();
68
+    $data['sys_files_checksum'] = $modx->manager->getSystemChecksum($data['check_files_onlogin']);
69
+    $data['mail_check_timeperiod'] = (int)$data['mail_check_timeperiod'] < 60 ? 60 : $data['mail_check_timeperiod']; // updateMail() in mainMenu no faster than every minute
70
+    foreach ($data as $k => $v) {
71
+        switch ($k) {
72
+            case 'site_name':
73
+                $v = htmlspecialchars($v);
74
+                break;
75 75
             case 'settings_version':{
76 76
                 if($modx->getVersionData('version')!=$data['settings_version']){
77 77
                     $modx->logEvent(17,2,'<pre>'.var_export($data['settings_version'],true).'</pre>','fake settings_version');
@@ -79,24 +79,24 @@  discard block
 block discarded – undo
79 79
                 }
80 80
                 break;
81 81
             }
82
-			case 'error_page':
83
-			case 'unauthorized_page':
84
-			if (trim($v) == '' || !is_numeric($v)) {
85
-				$v = $data['site_start'];
86
-			}
87
-			break;
82
+            case 'error_page':
83
+            case 'unauthorized_page':
84
+            if (trim($v) == '' || !is_numeric($v)) {
85
+                $v = $data['site_start'];
86
+            }
87
+            break;
88 88
 
89
-			case 'lst_custom_contenttype':
90
-			case 'txt_custom_contenttype':
91
-				// Skip these
92
-				$k = '';
93
-				break;
94
-			case 'rb_base_dir':
95
-			case 'rb_base_url':
96
-			case 'filemanager_path':
97
-				$v = trim($v);
98
-				$v = rtrim($v,'/') . '/';
99
-				break;
89
+            case 'lst_custom_contenttype':
90
+            case 'txt_custom_contenttype':
91
+                // Skip these
92
+                $k = '';
93
+                break;
94
+            case 'rb_base_dir':
95
+            case 'rb_base_url':
96
+            case 'filemanager_path':
97
+                $v = trim($v);
98
+                $v = rtrim($v,'/') . '/';
99
+                break;
100 100
             case 'manager_language':
101 101
                 $langDir = realpath(MODX_MANAGER_PATH . 'includes/lang');
102 102
                 $langFile = realpath(MODX_MANAGER_PATH . 'includes/lang/' . $v . '.inc.php');
@@ -104,56 +104,56 @@  discard block
 block discarded – undo
104 104
                 if($langDir !== $langFileDir || !file_exists($langFile)) {
105 105
                     $v = 'english';
106 106
                 }
107
-				break;
108
-			case 'smtppw':
109
-				if ($v !== '********************' && $v !== '') {
110
-					$v = trim($v);
111
-					$v = base64_encode($v) . substr(str_shuffle('abcdefghjkmnpqrstuvxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789'), 0, 7);
112
-					$v = str_replace('=','%',$v);
113
-				} elseif ($v === '********************') {
114
-					$k = '';
115
-				}
116
-				break;
107
+                break;
108
+            case 'smtppw':
109
+                if ($v !== '********************' && $v !== '') {
110
+                    $v = trim($v);
111
+                    $v = base64_encode($v) . substr(str_shuffle('abcdefghjkmnpqrstuvxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789'), 0, 7);
112
+                    $v = str_replace('=','%',$v);
113
+                } elseif ($v === '********************') {
114
+                    $k = '';
115
+                }
116
+                break;
117 117
             case 'valid_hostnames':
118
-				$v = str_replace(array(' ,', ', '), ',', $v);
119
-				if ($v !== ',') {
120
-					$v = ($v != 'MODX_SITE_HOSTNAMES') ? $v : '';
121
-					$configString = '<?php' . "\n" . 'define(\'MODX_SITE_HOSTNAMES\', \'' . $v . '\');' . "\n";
122
-					@file_put_contents(MODX_BASE_PATH . 'assets/cache/siteHostnames.php', $configString);
123
-				}
124
-				$k = '';
125
-				break;
126
-			case 'session_timeout':
127
-				$mail_check_timeperiod = $data['mail_check_timeperiod'];
128
-				$v = (int)$v < ($data['mail_check_timeperiod']/60+1) ? ($data['mail_check_timeperiod']/60+1) : $v; // updateMail() in mainMenu pings as per mail_check_timeperiod, so +1min is minimum
129
-				break;
130
-			default:
131
-			break;
132
-		}
133
-		$v = is_array($v) ? implode(",", $v) : $v;
118
+                $v = str_replace(array(' ,', ', '), ',', $v);
119
+                if ($v !== ',') {
120
+                    $v = ($v != 'MODX_SITE_HOSTNAMES') ? $v : '';
121
+                    $configString = '<?php' . "\n" . 'define(\'MODX_SITE_HOSTNAMES\', \'' . $v . '\');' . "\n";
122
+                    @file_put_contents(MODX_BASE_PATH . 'assets/cache/siteHostnames.php', $configString);
123
+                }
124
+                $k = '';
125
+                break;
126
+            case 'session_timeout':
127
+                $mail_check_timeperiod = $data['mail_check_timeperiod'];
128
+                $v = (int)$v < ($data['mail_check_timeperiod']/60+1) ? ($data['mail_check_timeperiod']/60+1) : $v; // updateMail() in mainMenu pings as per mail_check_timeperiod, so +1min is minimum
129
+                break;
130
+            default:
131
+            break;
132
+        }
133
+        $v = is_array($v) ? implode(",", $v) : $v;
134 134
 
135
-		$modx->config[$k] = $v;
135
+        $modx->config[$k] = $v;
136 136
 
137
-		if(!empty($k)) $savethese[] = '(\''.$modx->db->escape($k).'\', \''.$modx->db->escape($v).'\')';
138
-	}
137
+        if(!empty($k)) $savethese[] = '(\''.$modx->db->escape($k).'\', \''.$modx->db->escape($v).'\')';
138
+    }
139 139
 
140
-	// Run a single query to save all the values
141
-	$sql = "REPLACE INTO ".$modx->getFullTableName("system_settings")." (setting_name, setting_value)
140
+    // Run a single query to save all the values
141
+    $sql = "REPLACE INTO ".$modx->getFullTableName("system_settings")." (setting_name, setting_value)
142 142
 		VALUES ".implode(', ', $savethese);
143
-	$modx->db->query($sql);
143
+    $modx->db->query($sql);
144 144
 
145
-	// Reset Template Pages
146
-	if (isset($data['reset_template'])) {
147
-		$newtemplate = (int)$data['default_template'];
148
-		$oldtemplate = (int)$data['old_template'];
149
-		$tbl = $modx->getFullTableName('site_content');
150
-		$reset = $data['reset_template'];
151
-		if($reset==1) $modx->db->update(array('template' => $newtemplate), $tbl, "type='document'");
152
-		else if($reset==2) $modx->db->update(array('template' => $newtemplate), $tbl, "template='{$oldtemplate}'");
153
-	}
145
+    // Reset Template Pages
146
+    if (isset($data['reset_template'])) {
147
+        $newtemplate = (int)$data['default_template'];
148
+        $oldtemplate = (int)$data['old_template'];
149
+        $tbl = $modx->getFullTableName('site_content');
150
+        $reset = $data['reset_template'];
151
+        if($reset==1) $modx->db->update(array('template' => $newtemplate), $tbl, "type='document'");
152
+        else if($reset==2) $modx->db->update(array('template' => $newtemplate), $tbl, "template='{$oldtemplate}'");
153
+    }
154 154
 
155
-	// empty cache
156
-	$modx->clearCache('full');
155
+    // empty cache
156
+    $modx->clearCache('full');
157 157
 }
158 158
 $header="Location: index.php?a=7&r=10";
159 159
 header($header);
Please login to merge, or discard this patch.
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -1,46 +1,46 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
2
+if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
3 3
     die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
4 4
 }
5
-if(!$modx->hasPermission('settings')) {
5
+if (!$modx->hasPermission('settings')) {
6 6
 	$modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 $data = $_POST;
9 9
 // lose the POST now, gets rid of quirky issue with Safari 3 - see FS#972
10 10
 unset($_POST);
11 11
 
12
-if($data['friendly_urls']==='1' && strpos($_SERVER['SERVER_SOFTWARE'],'IIS')===false)
12
+if ($data['friendly_urls'] === '1' && strpos($_SERVER['SERVER_SOFTWARE'], 'IIS') === false)
13 13
 {
14
-	$htaccess        = $modx->config['base_path'] . '.htaccess';
15
-	$sample_htaccess = $modx->config['base_path'] . 'ht.access';
16
-	$dir = '/' . trim($modx->config['base_url'],'/');
17
-	if(is_file($htaccess))
14
+	$htaccess        = $modx->config['base_path'].'.htaccess';
15
+	$sample_htaccess = $modx->config['base_path'].'ht.access';
16
+	$dir = '/'.trim($modx->config['base_url'], '/');
17
+	if (is_file($htaccess))
18 18
 	{
19 19
 		$_ = file_get_contents($htaccess);
20
-		if(strpos($_,'RewriteBase')===false)
20
+		if (strpos($_, 'RewriteBase') === false)
21 21
 		{
22 22
 			$warnings[] = $_lang["settings_friendlyurls_alert2"];
23 23
 		}
24
-		elseif(is_writable($htaccess))
24
+		elseif (is_writable($htaccess))
25 25
 		{
26
-			$_ = preg_replace('@RewriteBase.+@',"RewriteBase {$dir}", $_);
27
-			if(!@file_put_contents($htaccess,$_))
26
+			$_ = preg_replace('@RewriteBase.+@', "RewriteBase {$dir}", $_);
27
+			if (!@file_put_contents($htaccess, $_))
28 28
 			{
29 29
 				$warnings[] = $_lang["settings_friendlyurls_alert2"];
30 30
 			}
31 31
 		}
32 32
 	}
33
-	elseif(is_file($sample_htaccess))
33
+	elseif (is_file($sample_htaccess))
34 34
 	{
35
-		if(!@rename($sample_htaccess,$htaccess))
35
+		if (!@rename($sample_htaccess, $htaccess))
36 36
         {
37 37
         	$warnings[] = $_lang["settings_friendlyurls_alert"];
38 38
 		}
39
-		elseif($modx->config['base_url']!=='/')
39
+		elseif ($modx->config['base_url'] !== '/')
40 40
 		{
41 41
 			$_ = file_get_contents($htaccess);
42
-			$_ = preg_replace('@RewriteBase.+@',"RewriteBase {$dir}", $_);
43
-			if(!@file_put_contents($htaccess,$_))
42
+			$_ = preg_replace('@RewriteBase.+@', "RewriteBase {$dir}", $_);
43
+			if (!@file_put_contents($htaccess, $_))
44 44
 			{
45 45
 				$warnings[] = $_lang["settings_friendlyurls_alert2"];
46 46
 			}
@@ -48,17 +48,17 @@  discard block
 block discarded – undo
48 48
 	}
49 49
 }
50 50
 
51
-if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) {
52
-    unlink(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css');
51
+if (file_exists(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css')) {
52
+    unlink(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css');
53 53
 }
54 54
 
55
-$data['filemanager_path'] = str_replace('[(base_path)]',MODX_BASE_PATH,$data['filemanager_path']);
56
-$data['rb_base_dir']      = str_replace('[(base_path)]',MODX_BASE_PATH,$data['rb_base_dir']);
55
+$data['filemanager_path'] = str_replace('[(base_path)]', MODX_BASE_PATH, $data['filemanager_path']);
56
+$data['rb_base_dir']      = str_replace('[(base_path)]', MODX_BASE_PATH, $data['rb_base_dir']);
57 57
 
58 58
 if (isset($data) && count($data) > 0) {
59
-	if(isset($data['manager_language'])) {
60
-		$lang_path = MODX_MANAGER_PATH . 'includes/lang/' . $data['manager_language'] . '.inc.php';
61
-		if(is_file($lang_path)) {
59
+	if (isset($data['manager_language'])) {
60
+		$lang_path = MODX_MANAGER_PATH.'includes/lang/'.$data['manager_language'].'.inc.php';
61
+		if (is_file($lang_path)) {
62 62
 			include($lang_path);
63 63
             global $modx_lang_attribute;
64 64
             $data['lang_code'] = !$modx_lang_attribute ? 'en' : $modx_lang_attribute;
@@ -66,15 +66,15 @@  discard block
 block discarded – undo
66 66
 	}
67 67
 	$savethese = array();
68 68
 	$data['sys_files_checksum'] = $modx->manager->getSystemChecksum($data['check_files_onlogin']);
69
-	$data['mail_check_timeperiod'] = (int)$data['mail_check_timeperiod'] < 60 ? 60 : $data['mail_check_timeperiod']; // updateMail() in mainMenu no faster than every minute
69
+	$data['mail_check_timeperiod'] = (int) $data['mail_check_timeperiod'] < 60 ? 60 : $data['mail_check_timeperiod']; // updateMail() in mainMenu no faster than every minute
70 70
 	foreach ($data as $k => $v) {
71 71
 		switch ($k) {
72 72
 			case 'site_name':
73 73
 				$v = htmlspecialchars($v);
74 74
 				break;
75 75
             case 'settings_version':{
76
-                if($modx->getVersionData('version')!=$data['settings_version']){
77
-                    $modx->logEvent(17,2,'<pre>'.var_export($data['settings_version'],true).'</pre>','fake settings_version');
76
+                if ($modx->getVersionData('version') != $data['settings_version']) {
77
+                    $modx->logEvent(17, 2, '<pre>'.var_export($data['settings_version'], true).'</pre>', 'fake settings_version');
78 78
                     $v = $modx->getVersionData('version');
79 79
                 }
80 80
                 break;
@@ -95,21 +95,21 @@  discard block
 block discarded – undo
95 95
 			case 'rb_base_url':
96 96
 			case 'filemanager_path':
97 97
 				$v = trim($v);
98
-				$v = rtrim($v,'/') . '/';
98
+				$v = rtrim($v, '/').'/';
99 99
 				break;
100 100
             case 'manager_language':
101
-                $langDir = realpath(MODX_MANAGER_PATH . 'includes/lang');
102
-                $langFile = realpath(MODX_MANAGER_PATH . 'includes/lang/' . $v . '.inc.php');
101
+                $langDir = realpath(MODX_MANAGER_PATH.'includes/lang');
102
+                $langFile = realpath(MODX_MANAGER_PATH.'includes/lang/'.$v.'.inc.php');
103 103
                 $langFileDir = dirname($langFile);
104
-                if($langDir !== $langFileDir || !file_exists($langFile)) {
104
+                if ($langDir !== $langFileDir || !file_exists($langFile)) {
105 105
                     $v = 'english';
106 106
                 }
107 107
 				break;
108 108
 			case 'smtppw':
109 109
 				if ($v !== '********************' && $v !== '') {
110 110
 					$v = trim($v);
111
-					$v = base64_encode($v) . substr(str_shuffle('abcdefghjkmnpqrstuvxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789'), 0, 7);
112
-					$v = str_replace('=','%',$v);
111
+					$v = base64_encode($v).substr(str_shuffle('abcdefghjkmnpqrstuvxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789'), 0, 7);
112
+					$v = str_replace('=', '%', $v);
113 113
 				} elseif ($v === '********************') {
114 114
 					$k = '';
115 115
 				}
@@ -118,14 +118,14 @@  discard block
 block discarded – undo
118 118
 				$v = str_replace(array(' ,', ', '), ',', $v);
119 119
 				if ($v !== ',') {
120 120
 					$v = ($v != 'MODX_SITE_HOSTNAMES') ? $v : '';
121
-					$configString = '<?php' . "\n" . 'define(\'MODX_SITE_HOSTNAMES\', \'' . $v . '\');' . "\n";
122
-					@file_put_contents(MODX_BASE_PATH . 'assets/cache/siteHostnames.php', $configString);
121
+					$configString = '<?php'."\n".'define(\'MODX_SITE_HOSTNAMES\', \''.$v.'\');'."\n";
122
+					@file_put_contents(MODX_BASE_PATH.'assets/cache/siteHostnames.php', $configString);
123 123
 				}
124 124
 				$k = '';
125 125
 				break;
126 126
 			case 'session_timeout':
127 127
 				$mail_check_timeperiod = $data['mail_check_timeperiod'];
128
-				$v = (int)$v < ($data['mail_check_timeperiod']/60+1) ? ($data['mail_check_timeperiod']/60+1) : $v; // updateMail() in mainMenu pings as per mail_check_timeperiod, so +1min is minimum
128
+				$v = (int) $v < ($data['mail_check_timeperiod'] / 60 + 1) ? ($data['mail_check_timeperiod'] / 60 + 1) : $v; // updateMail() in mainMenu pings as per mail_check_timeperiod, so +1min is minimum
129 129
 				break;
130 130
 			default:
131 131
 			break;
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
 
135 135
 		$modx->config[$k] = $v;
136 136
 
137
-		if(!empty($k)) $savethese[] = '(\''.$modx->db->escape($k).'\', \''.$modx->db->escape($v).'\')';
137
+		if (!empty($k)) $savethese[] = '(\''.$modx->db->escape($k).'\', \''.$modx->db->escape($v).'\')';
138 138
 	}
139 139
 
140 140
 	// Run a single query to save all the values
@@ -144,16 +144,16 @@  discard block
 block discarded – undo
144 144
 
145 145
 	// Reset Template Pages
146 146
 	if (isset($data['reset_template'])) {
147
-		$newtemplate = (int)$data['default_template'];
148
-		$oldtemplate = (int)$data['old_template'];
147
+		$newtemplate = (int) $data['default_template'];
148
+		$oldtemplate = (int) $data['old_template'];
149 149
 		$tbl = $modx->getFullTableName('site_content');
150 150
 		$reset = $data['reset_template'];
151
-		if($reset==1) $modx->db->update(array('template' => $newtemplate), $tbl, "type='document'");
152
-		else if($reset==2) $modx->db->update(array('template' => $newtemplate), $tbl, "template='{$oldtemplate}'");
151
+		if ($reset == 1) $modx->db->update(array('template' => $newtemplate), $tbl, "type='document'");
152
+		else if ($reset == 2) $modx->db->update(array('template' => $newtemplate), $tbl, "template='{$oldtemplate}'");
153 153
 	}
154 154
 
155 155
 	// empty cache
156 156
 	$modx->clearCache('full');
157 157
 }
158
-$header="Location: index.php?a=7&r=10";
158
+$header = "Location: index.php?a=7&r=10";
159 159
 header($header);
Please login to merge, or discard this patch.
Braces   +18 added lines, -25 removed lines patch added patch discarded remove patch
@@ -9,39 +9,27 @@  discard block
 block discarded – undo
9 9
 // lose the POST now, gets rid of quirky issue with Safari 3 - see FS#972
10 10
 unset($_POST);
11 11
 
12
-if($data['friendly_urls']==='1' && strpos($_SERVER['SERVER_SOFTWARE'],'IIS')===false)
13
-{
12
+if($data['friendly_urls']==='1' && strpos($_SERVER['SERVER_SOFTWARE'],'IIS')===false) {
14 13
 	$htaccess        = $modx->config['base_path'] . '.htaccess';
15 14
 	$sample_htaccess = $modx->config['base_path'] . 'ht.access';
16 15
 	$dir = '/' . trim($modx->config['base_url'],'/');
17
-	if(is_file($htaccess))
18
-	{
16
+	if(is_file($htaccess)) {
19 17
 		$_ = file_get_contents($htaccess);
20
-		if(strpos($_,'RewriteBase')===false)
21
-		{
18
+		if(strpos($_,'RewriteBase')===false) {
22 19
 			$warnings[] = $_lang["settings_friendlyurls_alert2"];
23
-		}
24
-		elseif(is_writable($htaccess))
25
-		{
20
+		} elseif(is_writable($htaccess)) {
26 21
 			$_ = preg_replace('@RewriteBase.+@',"RewriteBase {$dir}", $_);
27
-			if(!@file_put_contents($htaccess,$_))
28
-			{
22
+			if(!@file_put_contents($htaccess,$_)) {
29 23
 				$warnings[] = $_lang["settings_friendlyurls_alert2"];
30 24
 			}
31 25
 		}
32
-	}
33
-	elseif(is_file($sample_htaccess))
34
-	{
35
-		if(!@rename($sample_htaccess,$htaccess))
36
-        {
26
+	} elseif(is_file($sample_htaccess)) {
27
+		if(!@rename($sample_htaccess,$htaccess)) {
37 28
         	$warnings[] = $_lang["settings_friendlyurls_alert"];
38
-		}
39
-		elseif($modx->config['base_url']!=='/')
40
-		{
29
+		} elseif($modx->config['base_url']!=='/') {
41 30
 			$_ = file_get_contents($htaccess);
42 31
 			$_ = preg_replace('@RewriteBase.+@',"RewriteBase {$dir}", $_);
43
-			if(!@file_put_contents($htaccess,$_))
44
-			{
32
+			if(!@file_put_contents($htaccess,$_)) {
45 33
 				$warnings[] = $_lang["settings_friendlyurls_alert2"];
46 34
 			}
47 35
 		}
@@ -73,7 +61,7 @@  discard block
 block discarded – undo
73 61
 				$v = htmlspecialchars($v);
74 62
 				break;
75 63
             case 'settings_version':{
76
-                if($modx->getVersionData('version')!=$data['settings_version']){
64
+                if($modx->getVersionData('version')!=$data['settings_version']) {
77 65
                     $modx->logEvent(17,2,'<pre>'.var_export($data['settings_version'],true).'</pre>','fake settings_version');
78 66
                     $v = $modx->getVersionData('version');
79 67
                 }
@@ -134,7 +122,9 @@  discard block
 block discarded – undo
134 122
 
135 123
 		$modx->config[$k] = $v;
136 124
 
137
-		if(!empty($k)) $savethese[] = '(\''.$modx->db->escape($k).'\', \''.$modx->db->escape($v).'\')';
125
+		if(!empty($k)) {
126
+		    $savethese[] = '(\''.$modx->db->escape($k).'\', \''.$modx->db->escape($v).'\')';
127
+		}
138 128
 	}
139 129
 
140 130
 	// Run a single query to save all the values
@@ -148,8 +138,11 @@  discard block
 block discarded – undo
148 138
 		$oldtemplate = (int)$data['old_template'];
149 139
 		$tbl = $modx->getFullTableName('site_content');
150 140
 		$reset = $data['reset_template'];
151
-		if($reset==1) $modx->db->update(array('template' => $newtemplate), $tbl, "type='document'");
152
-		else if($reset==2) $modx->db->update(array('template' => $newtemplate), $tbl, "template='{$oldtemplate}'");
141
+		if($reset==1) {
142
+		    $modx->db->update(array('template' => $newtemplate), $tbl, "type='document'");
143
+		} else if($reset==2) {
144
+		    $modx->db->update(array('template' => $newtemplate), $tbl, "template='{$oldtemplate}'");
145
+		}
153 146
 	}
154 147
 
155 148
 	// empty cache
Please login to merge, or discard this patch.
manager/processors/save_snippet.processor.php 2 patches
Switch Indentation   +107 added lines, -107 removed lines patch added patch discarded remove patch
@@ -66,111 +66,111 @@
 block discarded – undo
66 66
 }
67 67
 
68 68
 switch ($_POST['mode']) {
69
-    case '23': // Save new snippet
70
-
71
-        // invoke OnBeforeSnipFormSave event
72
-        $modx->invokeEvent("OnBeforeSnipFormSave", array(
73
-            "mode" => "new",
74
-            "id" => $id
75
-        ));
76
-
77
-        // disallow duplicate names for new snippets
78
-        $rs = $modx->db->select('COUNT(id)', $modx->getFullTableName('site_snippets'), "name='{$name}'");
79
-        $count = $modx->db->getValue($rs);
80
-        if ($count > 0) {
81
-            $modx->manager->saveFormValues(23);
82
-            $modx->webAlertAndQuit(sprintf($_lang['duplicate_name_found_general'], $_lang['snippet'], $name), "index.php?a=23");
83
-        }
84
-
85
-        //do stuff to save the new doc
86
-        $newid = $modx->db->insert(array(
87
-            'name' => $name,
88
-            'description' => $description,
89
-            'snippet' => $snippet,
90
-            'moduleguid' => $moduleguid,
91
-            'locked' => $locked,
92
-            'properties' => $properties,
93
-            'category' => $categoryid,
94
-            'disabled' => $disabled,
95
-            'createdon' => $currentdate,
96
-            'editedon' => $currentdate
97
-        ), $modx->getFullTableName('site_snippets'));
98
-
99
-        // invoke OnSnipFormSave event
100
-        $modx->invokeEvent("OnSnipFormSave", array(
101
-            "mode" => "new",
102
-            "id" => $newid
103
-        ));
104
-
105
-        // Set the item name for logger
106
-        $_SESSION['itemname'] = $name;
107
-
108
-        // empty cache
109
-        $modx->clearCache('full');
110
-
111
-        // finished emptying cache - redirect
112
-        if ($_POST['stay'] != '') {
113
-            $a = ($_POST['stay'] == '2') ? "22&id=$newid" : "23";
114
-            $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay'];
115
-            header($header);
116
-        } else {
117
-            $header = "Location: index.php?a=76&r=2";
118
-            header($header);
119
-        }
120
-        break;
121
-    case '22': // Save existing snippet
122
-        // invoke OnBeforeSnipFormSave event
123
-        $modx->invokeEvent("OnBeforeSnipFormSave", array(
124
-            "mode" => "upd",
125
-            "id" => $id
126
-        ));
127
-
128
-        // disallow duplicate names for snippets
129
-        $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('site_snippets'), "name='{$name}' AND id!='{$id}'");
130
-        if ($modx->db->getValue($rs) > 0) {
131
-            $modx->manager->saveFormValues(22);
132
-            $modx->webAlertAndQuit(sprintf($_lang['duplicate_name_found_general'], $_lang['snippet'], $name), "index.php?a=22&id={$id}");
133
-        }
134
-
135
-        //do stuff to save the edited doc
136
-        $modx->db->update(array(
137
-            'name' => $name,
138
-            'description' => $description,
139
-            'snippet' => $snippet,
140
-            'moduleguid' => $moduleguid,
141
-            'locked' => $locked,
142
-            'properties' => $properties,
143
-            'category' => $categoryid,
144
-            'disabled' => $disabled,
145
-            'editedon' => $currentdate
146
-        ), $modx->getFullTableName('site_snippets'), "id='{$id}'");
147
-
148
-        // invoke OnSnipFormSave event
149
-        $modx->invokeEvent("OnSnipFormSave", array(
150
-            "mode" => "upd",
151
-            "id" => $id
152
-        ));
153
-
154
-        // Set the item name for logger
155
-        $_SESSION['itemname'] = $name;
156
-
157
-        // empty cache
158
-        $modx->clearCache('full');
159
-
160
-        if ($_POST['runsnippet']) {
161
-            run_snippet($snippet);
162
-        }
163
-        // finished emptying cache - redirect
164
-        if ($_POST['stay'] != '') {
165
-            $a = ($_POST['stay'] == '2') ? "22&id=$id" : "23";
166
-            $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay'];
167
-            header($header);
168
-        } else {
169
-            $modx->unlockElement(4, $id);
170
-            $header = "Location: index.php?a=76&r=2";
171
-            header($header);
172
-        }
173
-        break;
174
-    default:
175
-        $modx->webAlertAndQuit("No operation set in request.");
69
+        case '23': // Save new snippet
70
+
71
+            // invoke OnBeforeSnipFormSave event
72
+            $modx->invokeEvent("OnBeforeSnipFormSave", array(
73
+                "mode" => "new",
74
+                "id" => $id
75
+            ));
76
+
77
+            // disallow duplicate names for new snippets
78
+            $rs = $modx->db->select('COUNT(id)', $modx->getFullTableName('site_snippets'), "name='{$name}'");
79
+            $count = $modx->db->getValue($rs);
80
+            if ($count > 0) {
81
+                $modx->manager->saveFormValues(23);
82
+                $modx->webAlertAndQuit(sprintf($_lang['duplicate_name_found_general'], $_lang['snippet'], $name), "index.php?a=23");
83
+            }
84
+
85
+            //do stuff to save the new doc
86
+            $newid = $modx->db->insert(array(
87
+                'name' => $name,
88
+                'description' => $description,
89
+                'snippet' => $snippet,
90
+                'moduleguid' => $moduleguid,
91
+                'locked' => $locked,
92
+                'properties' => $properties,
93
+                'category' => $categoryid,
94
+                'disabled' => $disabled,
95
+                'createdon' => $currentdate,
96
+                'editedon' => $currentdate
97
+            ), $modx->getFullTableName('site_snippets'));
98
+
99
+            // invoke OnSnipFormSave event
100
+            $modx->invokeEvent("OnSnipFormSave", array(
101
+                "mode" => "new",
102
+                "id" => $newid
103
+            ));
104
+
105
+            // Set the item name for logger
106
+            $_SESSION['itemname'] = $name;
107
+
108
+            // empty cache
109
+            $modx->clearCache('full');
110
+
111
+            // finished emptying cache - redirect
112
+            if ($_POST['stay'] != '') {
113
+                $a = ($_POST['stay'] == '2') ? "22&id=$newid" : "23";
114
+                $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay'];
115
+                header($header);
116
+            } else {
117
+                $header = "Location: index.php?a=76&r=2";
118
+                header($header);
119
+            }
120
+            break;
121
+        case '22': // Save existing snippet
122
+            // invoke OnBeforeSnipFormSave event
123
+            $modx->invokeEvent("OnBeforeSnipFormSave", array(
124
+                "mode" => "upd",
125
+                "id" => $id
126
+            ));
127
+
128
+            // disallow duplicate names for snippets
129
+            $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('site_snippets'), "name='{$name}' AND id!='{$id}'");
130
+            if ($modx->db->getValue($rs) > 0) {
131
+                $modx->manager->saveFormValues(22);
132
+                $modx->webAlertAndQuit(sprintf($_lang['duplicate_name_found_general'], $_lang['snippet'], $name), "index.php?a=22&id={$id}");
133
+            }
134
+
135
+            //do stuff to save the edited doc
136
+            $modx->db->update(array(
137
+                'name' => $name,
138
+                'description' => $description,
139
+                'snippet' => $snippet,
140
+                'moduleguid' => $moduleguid,
141
+                'locked' => $locked,
142
+                'properties' => $properties,
143
+                'category' => $categoryid,
144
+                'disabled' => $disabled,
145
+                'editedon' => $currentdate
146
+            ), $modx->getFullTableName('site_snippets'), "id='{$id}'");
147
+
148
+            // invoke OnSnipFormSave event
149
+            $modx->invokeEvent("OnSnipFormSave", array(
150
+                "mode" => "upd",
151
+                "id" => $id
152
+            ));
153
+
154
+            // Set the item name for logger
155
+            $_SESSION['itemname'] = $name;
156
+
157
+            // empty cache
158
+            $modx->clearCache('full');
159
+
160
+            if ($_POST['runsnippet']) {
161
+                run_snippet($snippet);
162
+            }
163
+            // finished emptying cache - redirect
164
+            if ($_POST['stay'] != '') {
165
+                $a = ($_POST['stay'] == '2') ? "22&id=$id" : "23";
166
+                $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay'];
167
+                header($header);
168
+            } else {
169
+                $modx->unlockElement(4, $id);
170
+                $header = "Location: index.php?a=76&r=2";
171
+                header($header);
172
+            }
173
+            break;
174
+        default:
175
+            $modx->webAlertAndQuit("No operation set in request.");
176 176
 }
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@  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
 if (!$modx->hasPermission('save_snippet')) {
6 6
     $modx->webAlertAndQuit($_lang["error_no_privileges"]);
7 7
 }
8 8
 
9
-$id = (int)$_POST['id'];
9
+$id = (int) $_POST['id'];
10 10
 $snippet = trim($_POST['post']);
11 11
 $name = $modx->db->escape(trim($_POST['name']));
12 12
 $description = $modx->db->escape($_POST['description']);
@@ -33,11 +33,11 @@  discard block
 block discarded – undo
33 33
 
34 34
 //Kyle Jaebker - added category support
35 35
 if (empty($_POST['newcategory']) && $_POST['categoryid'] > 0) {
36
-    $categoryid = (int)$_POST['categoryid'];
36
+    $categoryid = (int) $_POST['categoryid'];
37 37
 } elseif (empty($_POST['newcategory']) && $_POST['categoryid'] <= 0) {
38 38
     $categoryid = 0;
39 39
 } else {
40
-    include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php');
40
+    include_once(MODX_MANAGER_PATH.'includes/categories.inc.php');
41 41
     $categoryid = checkCategory($_POST['newcategory']);
42 42
     if (!$categoryid) {
43 43
         $categoryid = newCategory($_POST['newcategory']);
@@ -55,12 +55,12 @@  discard block
 block discarded – undo
55 55
     $moduleguid = isset($parsed['guid']) ? $parsed['guid'] : $moduleguid;
56 56
 
57 57
     $description = isset($parsed['description']) ? $parsed['description'] : $description;
58
-    $version = isset($parsed['version']) ? '<b>' . $parsed['version'] . '</b> ' : '';
58
+    $version = isset($parsed['version']) ? '<b>'.$parsed['version'].'</b> ' : '';
59 59
     if ($version) {
60
-        $description = $version . trim(preg_replace('/(<b>.+?)+(<\/b>)/i', '', $description));
60
+        $description = $version.trim(preg_replace('/(<b>.+?)+(<\/b>)/i', '', $description));
61 61
     }
62 62
     if (isset($parsed['modx_category'])) {
63
-        include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php');
63
+        include_once(MODX_MANAGER_PATH.'includes/categories.inc.php');
64 64
         $categoryid = getCategory($parsed['modx_category']);
65 65
     }
66 66
 }
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
         // finished emptying cache - redirect
112 112
         if ($_POST['stay'] != '') {
113 113
             $a = ($_POST['stay'] == '2') ? "22&id=$newid" : "23";
114
-            $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay'];
114
+            $header = "Location: index.php?a=".$a."&r=2&stay=".$_POST['stay'];
115 115
             header($header);
116 116
         } else {
117 117
             $header = "Location: index.php?a=76&r=2";
@@ -163,7 +163,7 @@  discard block
 block discarded – undo
163 163
         // finished emptying cache - redirect
164 164
         if ($_POST['stay'] != '') {
165 165
             $a = ($_POST['stay'] == '2') ? "22&id=$id" : "23";
166
-            $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay'];
166
+            $header = "Location: index.php?a=".$a."&r=2&stay=".$_POST['stay'];
167 167
             header($header);
168 168
         } else {
169 169
             $modx->unlockElement(4, $id);
Please login to merge, or discard this patch.
manager/processors/login.processor.php 4 patches
Upper-Lower-Casing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -239,7 +239,7 @@
 block discarded – undo
239 239
 	if(version_compare(PHP_VERSION, '5.2', '<')) {
240 240
 		setcookie('modx_remember_manager', $_SESSION['mgrShortname'], time() + 60 * 60 * 24 * 365, MODX_BASE_URL, '; HttpOnly', $secure);
241 241
 	} else {
242
-		setcookie('modx_remember_manager', $_SESSION['mgrShortname'], time() + 60 * 60 * 24 * 365, MODX_BASE_URL, NULL, $secure, true);
242
+		setcookie('modx_remember_manager', $_SESSION['mgrShortname'], time() + 60 * 60 * 24 * 365, MODX_BASE_URL, null, $secure, true);
243 243
 	}
244 244
 } else {
245 245
 	$_SESSION['modx.mgr.session.cookie.lifetime'] = 0;
Please login to merge, or discard this patch.
Braces   +15 added lines, -7 removed lines patch added patch discarded remove patch
@@ -296,7 +296,8 @@  discard block
 block discarded – undo
296 296
  *
297 297
  * @param string $msg
298 298
  */
299
-function jsAlert($msg) {
299
+function jsAlert($msg)
300
+{
300 301
 	$modx = evolutionCMS();
301 302
 	if($_POST['ajax'] != 1) {
302 303
 		echo "<script>window.setTimeout(\"alert('" . addslashes($modx->db->escape($msg)) . "')\",10);history.go(-1)</script>";
@@ -311,7 +312,8 @@  discard block
 block discarded – undo
311 312
  * @param string $dbasePassword
312 313
  * @return bool
313 314
  */
314
-function login($username, $givenPassword, $dbasePassword) {
315
+function login($username, $givenPassword, $dbasePassword)
316
+{
315 317
 	$modx = evolutionCMS();
316 318
 	return $modx->phpass->CheckPassword($givenPassword, $dbasePassword);
317 319
 }
@@ -323,7 +325,8 @@  discard block
 block discarded – undo
323 325
  * @param string $username
324 326
  * @return bool
325 327
  */
326
-function loginV1($internalKey, $givenPassword, $dbasePassword, $username) {
328
+function loginV1($internalKey, $givenPassword, $dbasePassword, $username)
329
+{
327 330
 	$modx = evolutionCMS();
328 331
 
329 332
 	$user_algo = $modx->manager->getV1UserHashAlgorithm($internalKey);
@@ -353,7 +356,8 @@  discard block
 block discarded – undo
353 356
  * @param string $username
354 357
  * @return bool
355 358
  */
356
-function loginMD5($internalKey, $givenPassword, $dbasePassword, $username) {
359
+function loginMD5($internalKey, $givenPassword, $dbasePassword, $username)
360
+{
357 361
 	$modx = evolutionCMS();
358 362
 
359 363
 	if($dbasePassword != md5($givenPassword)) {
@@ -367,7 +371,8 @@  discard block
 block discarded – undo
367 371
  * @param string $username
368 372
  * @param string $password
369 373
  */
370
-function updateNewHash($username, $password) {
374
+function updateNewHash($username, $password)
375
+{
371 376
 	$modx = evolutionCMS();
372 377
 
373 378
 	$field = array();
@@ -381,16 +386,19 @@  discard block
 block discarded – undo
381 386
  * @param int $failed_allowed
382 387
  * @param int $blocked_minutes
383 388
  */
384
-function incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes) {
389
+function incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes)
390
+{
385 391
 	$modx = evolutionCMS();
386 392
 
387 393
 	$failedlogins += 1;
388 394
 
389 395
 	$fields = array('failedlogincount' => $failedlogins);
390
-	if($failedlogins >= $failed_allowed) //block user for too many fail attempts
396
+	if($failedlogins >= $failed_allowed) {
397
+	    //block user for too many fail attempts
391 398
 	{
392 399
 		$fields['blockeduntil'] = time() + ($blocked_minutes * 60);
393 400
 	}
401
+	}
394 402
 
395 403
 	$modx->db->update($fields, '[+prefix+]user_attributes', "internalKey='{$internalKey}'");
396 404
 
Please login to merge, or discard this patch.
Indentation   +182 added lines, -182 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 if(!isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
3
-	header('HTTP/1.0 404 Not Found');
4
-	exit('error');
3
+    header('HTTP/1.0 404 Not Found');
4
+    exit('error');
5 5
 }
6 6
 define('IN_MANAGER_MODE', true);  // we use this to make sure files are accessed through
7 7
 define('MODX_API_MODE', true);
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 include_once("{$core_path}lang/english.inc.php");
19 19
 
20 20
 if($manager_language !== 'english' && is_file("{$core_path}lang/{$manager_language}.inc.php")) {
21
-	include_once("{$core_path}lang/{$manager_language}.inc.php");
21
+    include_once("{$core_path}lang/{$manager_language}.inc.php");
22 22
 }
23 23
 
24 24
 // include the logger
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 
27 27
 // Initialize System Alert Message Queque
28 28
 if(!isset($_SESSION['SystemAlertMsgQueque'])) {
29
-	$_SESSION['SystemAlertMsgQueque'] = array();
29
+    $_SESSION['SystemAlertMsgQueque'] = array();
30 30
 }
31 31
 $SystemAlertMsgQueque = &$_SESSION['SystemAlertMsgQueque'];
32 32
 
@@ -41,10 +41,10 @@  discard block
 block discarded – undo
41 41
 
42 42
 // invoke OnBeforeManagerLogin event
43 43
 $modx->invokeEvent('OnBeforeManagerLogin', array(
44
-		'username' => $username,
45
-		'userpassword' => $givenPassword,
46
-		'rememberme' => $rememberme
47
-	));
44
+        'username' => $username,
45
+        'userpassword' => $givenPassword,
46
+        'rememberme' => $rememberme
47
+    ));
48 48
 $fields = 'mu.*, ua.*';
49 49
 $from = '[+prefix+]manager_users AS mu, [+prefix+]user_attributes AS ua';
50 50
 $where = "BINARY mu.username='{$username}' and ua.internalKey=mu.id";
@@ -52,8 +52,8 @@  discard block
 block discarded – undo
52 52
 $limit = $modx->db->getRecordCount($rs);
53 53
 
54 54
 if($limit == 0 || $limit > 1) {
55
-	jsAlert($_lang['login_processor_unknown_user']);
56
-	return;
55
+    jsAlert($_lang['login_processor_unknown_user']);
56
+    return;
57 57
 }
58 58
 
59 59
 $row = $modx->db->getRow($rs);
@@ -74,127 +74,127 @@  discard block
 block discarded – undo
74 74
 // get the user settings from the database
75 75
 $rs = $modx->db->select('setting_name, setting_value', '[+prefix+]user_settings', "user='{$internalKey}' AND setting_value!=''");
76 76
 while($row = $modx->db->getRow($rs)) {
77
-	extract($row);
78
-	${$setting_name} = $setting_value;
77
+    extract($row);
78
+    ${$setting_name} = $setting_value;
79 79
 }
80 80
 
81 81
 // blocked due to number of login errors.
82 82
 if($failedlogins >= $failed_allowed && $blockeduntildate > time()) {
83
-	@session_destroy();
84
-	session_unset();
85
-	if($cip = getenv("HTTP_CLIENT_IP")) {
86
-		$ip = $cip;
87
-	} elseif($cip = getenv("HTTP_X_FORWARDED_FOR")) {
88
-		$ip = $cip;
89
-	} elseif($cip = getenv("REMOTE_ADDR")) {
90
-		$ip = $cip;
91
-	} else {
92
-		$ip = "UNKNOWN";
93
-	}
94
-	$log = new logHandler;
95
-	$log->initAndWriteLog("Login Fail (Temporary Block)", $internalKey, $username, "119", $internalKey, "IP: " . $ip);
96
-	jsAlert($_lang['login_processor_many_failed_logins']);
97
-	return;
83
+    @session_destroy();
84
+    session_unset();
85
+    if($cip = getenv("HTTP_CLIENT_IP")) {
86
+        $ip = $cip;
87
+    } elseif($cip = getenv("HTTP_X_FORWARDED_FOR")) {
88
+        $ip = $cip;
89
+    } elseif($cip = getenv("REMOTE_ADDR")) {
90
+        $ip = $cip;
91
+    } else {
92
+        $ip = "UNKNOWN";
93
+    }
94
+    $log = new logHandler;
95
+    $log->initAndWriteLog("Login Fail (Temporary Block)", $internalKey, $username, "119", $internalKey, "IP: " . $ip);
96
+    jsAlert($_lang['login_processor_many_failed_logins']);
97
+    return;
98 98
 }
99 99
 
100 100
 // blocked due to number of login errors, but get to try again
101 101
 if($failedlogins >= $failed_allowed && $blockeduntildate < time()) {
102
-	$fields = array();
103
-	$fields['failedlogincount'] = '0';
104
-	$fields['blockeduntil'] = time() - 1;
105
-	$modx->db->update($fields, '[+prefix+]user_attributes', "internalKey='{$internalKey}'");
102
+    $fields = array();
103
+    $fields['failedlogincount'] = '0';
104
+    $fields['blockeduntil'] = time() - 1;
105
+    $modx->db->update($fields, '[+prefix+]user_attributes', "internalKey='{$internalKey}'");
106 106
 }
107 107
 
108 108
 // this user has been blocked by an admin, so no way he's loggin in!
109 109
 if($blocked == '1') {
110
-	@session_destroy();
111
-	session_unset();
112
-	jsAlert($_lang['login_processor_blocked1']);
113
-	return;
110
+    @session_destroy();
111
+    session_unset();
112
+    jsAlert($_lang['login_processor_blocked1']);
113
+    return;
114 114
 }
115 115
 
116 116
 // blockuntil: this user has a block until date
117 117
 if($blockeduntildate > time()) {
118
-	@session_destroy();
119
-	session_unset();
120
-	jsAlert($_lang['login_processor_blocked2']);
121
-	return;
118
+    @session_destroy();
119
+    session_unset();
120
+    jsAlert($_lang['login_processor_blocked2']);
121
+    return;
122 122
 }
123 123
 
124 124
 // blockafter: this user has a block after date
125 125
 if($blockedafterdate > 0 && $blockedafterdate < time()) {
126
-	@session_destroy();
127
-	session_unset();
128
-	jsAlert($_lang['login_processor_blocked3']);
129
-	return;
126
+    @session_destroy();
127
+    session_unset();
128
+    jsAlert($_lang['login_processor_blocked3']);
129
+    return;
130 130
 }
131 131
 
132 132
 // allowed ip
133 133
 if($allowed_ip) {
134
-	if(($hostname = gethostbyaddr($_SERVER['REMOTE_ADDR'])) && ($hostname != $_SERVER['REMOTE_ADDR'])) {
135
-		if(gethostbyname($hostname) != $_SERVER['REMOTE_ADDR']) {
136
-			jsAlert($_lang['login_processor_remotehost_ip']);
137
-			return;
138
-		}
139
-	}
140
-	if(!in_array($_SERVER['REMOTE_ADDR'], array_filter(array_map('trim', explode(',', $allowed_ip))))) {
141
-		jsAlert($_lang['login_processor_remote_ip']);
142
-		return;
143
-	}
134
+    if(($hostname = gethostbyaddr($_SERVER['REMOTE_ADDR'])) && ($hostname != $_SERVER['REMOTE_ADDR'])) {
135
+        if(gethostbyname($hostname) != $_SERVER['REMOTE_ADDR']) {
136
+            jsAlert($_lang['login_processor_remotehost_ip']);
137
+            return;
138
+        }
139
+    }
140
+    if(!in_array($_SERVER['REMOTE_ADDR'], array_filter(array_map('trim', explode(',', $allowed_ip))))) {
141
+        jsAlert($_lang['login_processor_remote_ip']);
142
+        return;
143
+    }
144 144
 }
145 145
 
146 146
 // allowed days
147 147
 if($allowed_days) {
148
-	$date = getdate();
149
-	$day = $date['wday'] + 1;
150
-	if(!in_array($day,explode(',',$allowed_days))) {
151
-		jsAlert($_lang['login_processor_date']);
152
-		return;
153
-	}
148
+    $date = getdate();
149
+    $day = $date['wday'] + 1;
150
+    if(!in_array($day,explode(',',$allowed_days))) {
151
+        jsAlert($_lang['login_processor_date']);
152
+        return;
153
+    }
154 154
 }
155 155
 
156 156
 // invoke OnManagerAuthentication event
157 157
 $rt = $modx->invokeEvent('OnManagerAuthentication', array(
158
-		'userid' => $internalKey,
159
-		'username' => $username,
160
-		'userpassword' => $givenPassword,
161
-		'savedpassword' => $dbasePassword,
162
-		'rememberme' => $rememberme
163
-	));
158
+        'userid' => $internalKey,
159
+        'username' => $username,
160
+        'userpassword' => $givenPassword,
161
+        'savedpassword' => $dbasePassword,
162
+        'rememberme' => $rememberme
163
+    ));
164 164
 
165 165
 // check if plugin authenticated the user
166 166
 $matchPassword = false;
167 167
 if(!isset($rt) || !$rt || (is_array($rt) && !in_array(true, $rt))) {
168
-	// check user password - local authentication
169
-	$hashType = $modx->manager->getHashType($dbasePassword);
170
-	if($hashType == 'phpass') {
171
-		$matchPassword = login($username, $_REQUEST['password'], $dbasePassword);
172
-	} elseif($hashType == 'md5') {
173
-		$matchPassword = loginMD5($internalKey, $_REQUEST['password'], $dbasePassword, $username);
174
-	} elseif($hashType == 'v1') {
175
-		$matchPassword = loginV1($internalKey, $_REQUEST['password'], $dbasePassword, $username);
176
-	} else {
177
-		$matchPassword = false;
178
-	}
168
+    // check user password - local authentication
169
+    $hashType = $modx->manager->getHashType($dbasePassword);
170
+    if($hashType == 'phpass') {
171
+        $matchPassword = login($username, $_REQUEST['password'], $dbasePassword);
172
+    } elseif($hashType == 'md5') {
173
+        $matchPassword = loginMD5($internalKey, $_REQUEST['password'], $dbasePassword, $username);
174
+    } elseif($hashType == 'v1') {
175
+        $matchPassword = loginV1($internalKey, $_REQUEST['password'], $dbasePassword, $username);
176
+    } else {
177
+        $matchPassword = false;
178
+    }
179 179
 } else if($rt === true || (is_array($rt) && in_array(true, $rt))) {
180
-	$matchPassword = true;
180
+    $matchPassword = true;
181 181
 }
182 182
 
183 183
 if(!$matchPassword) {
184
-	jsAlert($_lang['login_processor_wrong_password']);
185
-	incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes);
186
-	return;
184
+    jsAlert($_lang['login_processor_wrong_password']);
185
+    incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes);
186
+    return;
187 187
 }
188 188
 
189 189
 if($modx->config['use_captcha'] == 1) {
190
-	if(!isset ($_SESSION['veriword'])) {
191
-		jsAlert($_lang['login_processor_captcha_config']);
192
-		return;
193
-	} elseif($_SESSION['veriword'] != $captcha_code) {
194
-		jsAlert($_lang['login_processor_bad_code']);
195
-		incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes);
196
-		return;
197
-	}
190
+    if(!isset ($_SESSION['veriword'])) {
191
+        jsAlert($_lang['login_processor_captcha_config']);
192
+        return;
193
+    } elseif($_SESSION['veriword'] != $captcha_code) {
194
+        jsAlert($_lang['login_processor_bad_code']);
195
+        incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes);
196
+        return;
197
+    }
198 198
 }
199 199
 
200 200
 $modx->cleanupExpiredLocks();
@@ -229,36 +229,36 @@  discard block
 block discarded – undo
229 229
 $_SESSION['mgrToken'] = md5($currentsessionid);
230 230
 
231 231
 if($rememberme == '1') {
232
-	$_SESSION['modx.mgr.session.cookie.lifetime'] = (int)$modx->config['session.cookie.lifetime'];
233
-
234
-	// Set a cookie separate from the session cookie with the username in it.
235
-	// Are we using secure connection? If so, make sure the cookie is secure
236
-	global $https_port;
237
-
238
-	$secure = ((isset ($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') || $_SERVER['SERVER_PORT'] == $https_port);
239
-	if(version_compare(PHP_VERSION, '5.2', '<')) {
240
-		setcookie('modx_remember_manager', $_SESSION['mgrShortname'], time() + 60 * 60 * 24 * 365, MODX_BASE_URL, '; HttpOnly', $secure);
241
-	} else {
242
-		setcookie('modx_remember_manager', $_SESSION['mgrShortname'], time() + 60 * 60 * 24 * 365, MODX_BASE_URL, NULL, $secure, true);
243
-	}
232
+    $_SESSION['modx.mgr.session.cookie.lifetime'] = (int)$modx->config['session.cookie.lifetime'];
233
+
234
+    // Set a cookie separate from the session cookie with the username in it.
235
+    // Are we using secure connection? If so, make sure the cookie is secure
236
+    global $https_port;
237
+
238
+    $secure = ((isset ($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') || $_SERVER['SERVER_PORT'] == $https_port);
239
+    if(version_compare(PHP_VERSION, '5.2', '<')) {
240
+        setcookie('modx_remember_manager', $_SESSION['mgrShortname'], time() + 60 * 60 * 24 * 365, MODX_BASE_URL, '; HttpOnly', $secure);
241
+    } else {
242
+        setcookie('modx_remember_manager', $_SESSION['mgrShortname'], time() + 60 * 60 * 24 * 365, MODX_BASE_URL, NULL, $secure, true);
243
+    }
244 244
 } else {
245
-	$_SESSION['modx.mgr.session.cookie.lifetime'] = 0;
245
+    $_SESSION['modx.mgr.session.cookie.lifetime'] = 0;
246 246
 
247
-	// Remove the Remember Me cookie
248
-	setcookie('modx_remember_manager', '', time() - 3600, MODX_BASE_URL);
247
+    // Remove the Remember Me cookie
248
+    setcookie('modx_remember_manager', '', time() - 3600, MODX_BASE_URL);
249 249
 }
250 250
 
251 251
 // Check if user already has an active session, if not check if user pressed logout end of last session
252 252
 $rs = $modx->db->select('lasthit', $modx->getFullTableName('active_user_sessions'), "internalKey='{$internalKey}'");
253 253
 $activeSession = $modx->db->getValue($rs);
254 254
 if(!$activeSession) {
255
-	$rs = $modx->db->select('lasthit', $modx->getFullTableName('active_users'), "internalKey='{$internalKey}' AND action != 8");
256
-	if($lastHit = $modx->db->getValue($rs)) {
257
-		$_SESSION['show_logout_reminder'] = array(
258
-			'type' => 'logout_reminder',
259
-			'lastHit' => $lastHit
260
-		);
261
-	}
255
+    $rs = $modx->db->select('lasthit', $modx->getFullTableName('active_users'), "internalKey='{$internalKey}' AND action != 8");
256
+    if($lastHit = $modx->db->getValue($rs)) {
257
+        $_SESSION['show_logout_reminder'] = array(
258
+            'type' => 'logout_reminder',
259
+            'lastHit' => $lastHit
260
+        );
261
+    }
262 262
 }
263 263
 
264 264
 $log = new logHandler;
@@ -266,29 +266,29 @@  discard block
 block discarded – undo
266 266
 
267 267
 // invoke OnManagerLogin event
268 268
 $modx->invokeEvent('OnManagerLogin', array(
269
-		'userid' => $internalKey,
270
-		'username' => $username,
271
-		'userpassword' => $givenPassword,
272
-		'rememberme' => $rememberme
273
-	));
269
+        'userid' => $internalKey,
270
+        'username' => $username,
271
+        'userpassword' => $givenPassword,
272
+        'rememberme' => $rememberme
273
+    ));
274 274
 
275 275
 // check if we should redirect user to a web page
276 276
 $rs = $modx->db->select('setting_value', '[+prefix+]user_settings', "user='{$internalKey}' AND setting_name='manager_login_startup'");
277 277
 $id = (int)$modx->db->getValue($rs);
278 278
 if($id > 0) {
279
-	$header = 'Location: ' . $modx->makeUrl($id, '', '', 'full');
280
-	if($_POST['ajax'] == 1) {
281
-		echo $header;
282
-	} else {
283
-		header($header);
284
-	}
279
+    $header = 'Location: ' . $modx->makeUrl($id, '', '', 'full');
280
+    if($_POST['ajax'] == 1) {
281
+        echo $header;
282
+    } else {
283
+        header($header);
284
+    }
285 285
 } else {
286
-	$header = 'Location: ' . MODX_MANAGER_URL;
287
-	if($_POST['ajax'] == 1) {
288
-		echo $header;
289
-	} else {
290
-		header($header);
291
-	}
286
+    $header = 'Location: ' . MODX_MANAGER_URL;
287
+    if($_POST['ajax'] == 1) {
288
+        echo $header;
289
+    } else {
290
+        header($header);
291
+    }
292 292
 }
293 293
 
294 294
 /**
@@ -297,12 +297,12 @@  discard block
 block discarded – undo
297 297
  * @param string $msg
298 298
  */
299 299
 function jsAlert($msg) {
300
-	$modx = evolutionCMS();
301
-	if($_POST['ajax'] != 1) {
302
-		echo "<script>window.setTimeout(\"alert('" . addslashes($modx->db->escape($msg)) . "')\",10);history.go(-1)</script>";
303
-	} else {
304
-		echo $msg . "\n";
305
-	}
300
+    $modx = evolutionCMS();
301
+    if($_POST['ajax'] != 1) {
302
+        echo "<script>window.setTimeout(\"alert('" . addslashes($modx->db->escape($msg)) . "')\",10);history.go(-1)</script>";
303
+    } else {
304
+        echo $msg . "\n";
305
+    }
306 306
 }
307 307
 
308 308
 /**
@@ -312,8 +312,8 @@  discard block
 block discarded – undo
312 312
  * @return bool
313 313
  */
314 314
 function login($username, $givenPassword, $dbasePassword) {
315
-	$modx = evolutionCMS();
316
-	return $modx->phpass->CheckPassword($givenPassword, $dbasePassword);
315
+    $modx = evolutionCMS();
316
+    return $modx->phpass->CheckPassword($givenPassword, $dbasePassword);
317 317
 }
318 318
 
319 319
 /**
@@ -324,26 +324,26 @@  discard block
 block discarded – undo
324 324
  * @return bool
325 325
  */
326 326
 function loginV1($internalKey, $givenPassword, $dbasePassword, $username) {
327
-	$modx = evolutionCMS();
327
+    $modx = evolutionCMS();
328 328
 
329
-	$user_algo = $modx->manager->getV1UserHashAlgorithm($internalKey);
329
+    $user_algo = $modx->manager->getV1UserHashAlgorithm($internalKey);
330 330
 
331
-	if(!isset($modx->config['pwd_hash_algo']) || empty($modx->config['pwd_hash_algo'])) {
332
-		$modx->config['pwd_hash_algo'] = 'UNCRYPT';
333
-	}
331
+    if(!isset($modx->config['pwd_hash_algo']) || empty($modx->config['pwd_hash_algo'])) {
332
+        $modx->config['pwd_hash_algo'] = 'UNCRYPT';
333
+    }
334 334
 
335
-	if($user_algo !== $modx->config['pwd_hash_algo']) {
336
-		$bk_pwd_hash_algo = $modx->config['pwd_hash_algo'];
337
-		$modx->config['pwd_hash_algo'] = $user_algo;
338
-	}
335
+    if($user_algo !== $modx->config['pwd_hash_algo']) {
336
+        $bk_pwd_hash_algo = $modx->config['pwd_hash_algo'];
337
+        $modx->config['pwd_hash_algo'] = $user_algo;
338
+    }
339 339
 
340
-	if($dbasePassword != $modx->manager->genV1Hash($givenPassword, $internalKey)) {
341
-		return false;
342
-	}
340
+    if($dbasePassword != $modx->manager->genV1Hash($givenPassword, $internalKey)) {
341
+        return false;
342
+    }
343 343
 
344
-	updateNewHash($username, $givenPassword);
344
+    updateNewHash($username, $givenPassword);
345 345
 
346
-	return true;
346
+    return true;
347 347
 }
348 348
 
349 349
 /**
@@ -354,13 +354,13 @@  discard block
 block discarded – undo
354 354
  * @return bool
355 355
  */
356 356
 function loginMD5($internalKey, $givenPassword, $dbasePassword, $username) {
357
-	$modx = evolutionCMS();
357
+    $modx = evolutionCMS();
358 358
 
359
-	if($dbasePassword != md5($givenPassword)) {
360
-		return false;
361
-	}
362
-	updateNewHash($username, $givenPassword);
363
-	return true;
359
+    if($dbasePassword != md5($givenPassword)) {
360
+        return false;
361
+    }
362
+    updateNewHash($username, $givenPassword);
363
+    return true;
364 364
 }
365 365
 
366 366
 /**
@@ -368,11 +368,11 @@  discard block
 block discarded – undo
368 368
  * @param string $password
369 369
  */
370 370
 function updateNewHash($username, $password) {
371
-	$modx = evolutionCMS();
371
+    $modx = evolutionCMS();
372 372
 
373
-	$field = array();
374
-	$field['password'] = $modx->phpass->HashPassword($password);
375
-	$modx->db->update($field, '[+prefix+]manager_users', "username='{$username}'");
373
+    $field = array();
374
+    $field['password'] = $modx->phpass->HashPassword($password);
375
+    $modx->db->update($field, '[+prefix+]manager_users', "username='{$username}'");
376 376
 }
377 377
 
378 378
 /**
@@ -382,27 +382,27 @@  discard block
 block discarded – undo
382 382
  * @param int $blocked_minutes
383 383
  */
384 384
 function incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes) {
385
-	$modx = evolutionCMS();
386
-
387
-	$failedlogins += 1;
388
-
389
-	$fields = array('failedlogincount' => $failedlogins);
390
-	if($failedlogins >= $failed_allowed) //block user for too many fail attempts
391
-	{
392
-		$fields['blockeduntil'] = time() + ($blocked_minutes * 60);
393
-	}
394
-
395
-	$modx->db->update($fields, '[+prefix+]user_attributes', "internalKey='{$internalKey}'");
396
-
397
-	if($failedlogins < $failed_allowed) {
398
-		//sleep to help prevent brute force attacks
399
-		$sleep = (int) $failedlogins / 2;
400
-		if($sleep > 5) {
401
-			$sleep = 5;
402
-		}
403
-		sleep($sleep);
404
-	}
405
-	@session_destroy();
406
-	session_unset();
407
-	return;
385
+    $modx = evolutionCMS();
386
+
387
+    $failedlogins += 1;
388
+
389
+    $fields = array('failedlogincount' => $failedlogins);
390
+    if($failedlogins >= $failed_allowed) //block user for too many fail attempts
391
+    {
392
+        $fields['blockeduntil'] = time() + ($blocked_minutes * 60);
393
+    }
394
+
395
+    $modx->db->update($fields, '[+prefix+]user_attributes', "internalKey='{$internalKey}'");
396
+
397
+    if($failedlogins < $failed_allowed) {
398
+        //sleep to help prevent brute force attacks
399
+        $sleep = (int) $failedlogins / 2;
400
+        if($sleep > 5) {
401
+            $sleep = 5;
402
+        }
403
+        sleep($sleep);
404
+    }
405
+    @session_destroy();
406
+    session_unset();
407
+    return;
408 408
 }
Please login to merge, or discard this patch.
Spacing   +62 added lines, -62 removed lines patch added patch discarded remove patch
@@ -1,23 +1,23 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(!isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
2
+if (!isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
3 3
 	header('HTTP/1.0 404 Not Found');
4 4
 	exit('error');
5 5
 }
6
-define('IN_MANAGER_MODE', true);  // we use this to make sure files are accessed through
6
+define('IN_MANAGER_MODE', true); // we use this to make sure files are accessed through
7 7
 define('MODX_API_MODE', true);
8
-include_once(__DIR__ . '/../../index.php');
8
+include_once(__DIR__.'/../../index.php');
9 9
 $modx->db->connect();
10 10
 $modx->getSettings();
11 11
 $modx->invokeEvent('OnManagerPageInit');
12 12
 $modx->loadExtension('ManagerAPI');
13 13
 $modx->loadExtension('phpass');
14 14
 
15
-$core_path = MODX_MANAGER_PATH . 'includes/';
15
+$core_path = MODX_MANAGER_PATH.'includes/';
16 16
 // include_once the language file
17 17
 $_lang = array();
18 18
 include_once("{$core_path}lang/english.inc.php");
19 19
 
20
-if($manager_language !== 'english' && is_file("{$core_path}lang/{$manager_language}.inc.php")) {
20
+if ($manager_language !== 'english' && is_file("{$core_path}lang/{$manager_language}.inc.php")) {
21 21
 	include_once("{$core_path}lang/{$manager_language}.inc.php");
22 22
 }
23 23
 
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 include_once("{$core_path}log.class.inc.php");
26 26
 
27 27
 // Initialize System Alert Message Queque
28
-if(!isset($_SESSION['SystemAlertMsgQueque'])) {
28
+if (!isset($_SESSION['SystemAlertMsgQueque'])) {
29 29
 	$_SESSION['SystemAlertMsgQueque'] = array();
30 30
 }
31 31
 $SystemAlertMsgQueque = &$_SESSION['SystemAlertMsgQueque'];
@@ -51,7 +51,7 @@  discard block
 block discarded – undo
51 51
 $rs = $modx->db->select($fields, $from, $where);
52 52
 $limit = $modx->db->getRecordCount($rs);
53 53
 
54
-if($limit == 0 || $limit > 1) {
54
+if ($limit == 0 || $limit > 1) {
55 55
 	jsAlert($_lang['login_processor_unknown_user']);
56 56
 	return;
57 57
 }
@@ -73,32 +73,32 @@  discard block
 block discarded – undo
73 73
 
74 74
 // get the user settings from the database
75 75
 $rs = $modx->db->select('setting_name, setting_value', '[+prefix+]user_settings', "user='{$internalKey}' AND setting_value!=''");
76
-while($row = $modx->db->getRow($rs)) {
76
+while ($row = $modx->db->getRow($rs)) {
77 77
 	extract($row);
78 78
 	${$setting_name} = $setting_value;
79 79
 }
80 80
 
81 81
 // blocked due to number of login errors.
82
-if($failedlogins >= $failed_allowed && $blockeduntildate > time()) {
82
+if ($failedlogins >= $failed_allowed && $blockeduntildate > time()) {
83 83
 	@session_destroy();
84 84
 	session_unset();
85
-	if($cip = getenv("HTTP_CLIENT_IP")) {
85
+	if ($cip = getenv("HTTP_CLIENT_IP")) {
86 86
 		$ip = $cip;
87
-	} elseif($cip = getenv("HTTP_X_FORWARDED_FOR")) {
87
+	} elseif ($cip = getenv("HTTP_X_FORWARDED_FOR")) {
88 88
 		$ip = $cip;
89
-	} elseif($cip = getenv("REMOTE_ADDR")) {
89
+	} elseif ($cip = getenv("REMOTE_ADDR")) {
90 90
 		$ip = $cip;
91 91
 	} else {
92 92
 		$ip = "UNKNOWN";
93 93
 	}
94 94
 	$log = new logHandler;
95
-	$log->initAndWriteLog("Login Fail (Temporary Block)", $internalKey, $username, "119", $internalKey, "IP: " . $ip);
95
+	$log->initAndWriteLog("Login Fail (Temporary Block)", $internalKey, $username, "119", $internalKey, "IP: ".$ip);
96 96
 	jsAlert($_lang['login_processor_many_failed_logins']);
97 97
 	return;
98 98
 }
99 99
 
100 100
 // blocked due to number of login errors, but get to try again
101
-if($failedlogins >= $failed_allowed && $blockeduntildate < time()) {
101
+if ($failedlogins >= $failed_allowed && $blockeduntildate < time()) {
102 102
 	$fields = array();
103 103
 	$fields['failedlogincount'] = '0';
104 104
 	$fields['blockeduntil'] = time() - 1;
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 }
107 107
 
108 108
 // this user has been blocked by an admin, so no way he's loggin in!
109
-if($blocked == '1') {
109
+if ($blocked == '1') {
110 110
 	@session_destroy();
111 111
 	session_unset();
112 112
 	jsAlert($_lang['login_processor_blocked1']);
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 }
115 115
 
116 116
 // blockuntil: this user has a block until date
117
-if($blockeduntildate > time()) {
117
+if ($blockeduntildate > time()) {
118 118
 	@session_destroy();
119 119
 	session_unset();
120 120
 	jsAlert($_lang['login_processor_blocked2']);
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 }
123 123
 
124 124
 // blockafter: this user has a block after date
125
-if($blockedafterdate > 0 && $blockedafterdate < time()) {
125
+if ($blockedafterdate > 0 && $blockedafterdate < time()) {
126 126
 	@session_destroy();
127 127
 	session_unset();
128 128
 	jsAlert($_lang['login_processor_blocked3']);
@@ -130,24 +130,24 @@  discard block
 block discarded – undo
130 130
 }
131 131
 
132 132
 // allowed ip
133
-if($allowed_ip) {
134
-	if(($hostname = gethostbyaddr($_SERVER['REMOTE_ADDR'])) && ($hostname != $_SERVER['REMOTE_ADDR'])) {
135
-		if(gethostbyname($hostname) != $_SERVER['REMOTE_ADDR']) {
133
+if ($allowed_ip) {
134
+	if (($hostname = gethostbyaddr($_SERVER['REMOTE_ADDR'])) && ($hostname != $_SERVER['REMOTE_ADDR'])) {
135
+		if (gethostbyname($hostname) != $_SERVER['REMOTE_ADDR']) {
136 136
 			jsAlert($_lang['login_processor_remotehost_ip']);
137 137
 			return;
138 138
 		}
139 139
 	}
140
-	if(!in_array($_SERVER['REMOTE_ADDR'], array_filter(array_map('trim', explode(',', $allowed_ip))))) {
140
+	if (!in_array($_SERVER['REMOTE_ADDR'], array_filter(array_map('trim', explode(',', $allowed_ip))))) {
141 141
 		jsAlert($_lang['login_processor_remote_ip']);
142 142
 		return;
143 143
 	}
144 144
 }
145 145
 
146 146
 // allowed days
147
-if($allowed_days) {
147
+if ($allowed_days) {
148 148
 	$date = getdate();
149 149
 	$day = $date['wday'] + 1;
150
-	if(!in_array($day,explode(',',$allowed_days))) {
150
+	if (!in_array($day, explode(',', $allowed_days))) {
151 151
 		jsAlert($_lang['login_processor_date']);
152 152
 		return;
153 153
 	}
@@ -164,33 +164,33 @@  discard block
 block discarded – undo
164 164
 
165 165
 // check if plugin authenticated the user
166 166
 $matchPassword = false;
167
-if(!isset($rt) || !$rt || (is_array($rt) && !in_array(true, $rt))) {
167
+if (!isset($rt) || !$rt || (is_array($rt) && !in_array(true, $rt))) {
168 168
 	// check user password - local authentication
169 169
 	$hashType = $modx->manager->getHashType($dbasePassword);
170
-	if($hashType == 'phpass') {
170
+	if ($hashType == 'phpass') {
171 171
 		$matchPassword = login($username, $_REQUEST['password'], $dbasePassword);
172
-	} elseif($hashType == 'md5') {
172
+	} elseif ($hashType == 'md5') {
173 173
 		$matchPassword = loginMD5($internalKey, $_REQUEST['password'], $dbasePassword, $username);
174
-	} elseif($hashType == 'v1') {
174
+	} elseif ($hashType == 'v1') {
175 175
 		$matchPassword = loginV1($internalKey, $_REQUEST['password'], $dbasePassword, $username);
176 176
 	} else {
177 177
 		$matchPassword = false;
178 178
 	}
179
-} else if($rt === true || (is_array($rt) && in_array(true, $rt))) {
179
+} else if ($rt === true || (is_array($rt) && in_array(true, $rt))) {
180 180
 	$matchPassword = true;
181 181
 }
182 182
 
183
-if(!$matchPassword) {
183
+if (!$matchPassword) {
184 184
 	jsAlert($_lang['login_processor_wrong_password']);
185 185
 	incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes);
186 186
 	return;
187 187
 }
188 188
 
189
-if($modx->config['use_captcha'] == 1) {
190
-	if(!isset ($_SESSION['veriword'])) {
189
+if ($modx->config['use_captcha'] == 1) {
190
+	if (!isset ($_SESSION['veriword'])) {
191 191
 		jsAlert($_lang['login_processor_captcha_config']);
192 192
 		return;
193
-	} elseif($_SESSION['veriword'] != $captcha_code) {
193
+	} elseif ($_SESSION['veriword'] != $captcha_code) {
194 194
 		jsAlert($_lang['login_processor_bad_code']);
195 195
 		incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes);
196 196
 		return;
@@ -218,25 +218,25 @@  discard block
 block discarded – undo
218 218
 $_SESSION['mgrPermissions'] = $modx->db->getRow($rs);
219 219
 
220 220
 // successful login so reset fail count and update key values
221
-$modx->db->update('failedlogincount=0, ' . 'logincount=logincount+1, ' . 'lastlogin=thislogin, ' . 'thislogin=' . time() . ', ' . "sessionid='{$currentsessionid}'", '[+prefix+]user_attributes', "internalKey='{$internalKey}'");
221
+$modx->db->update('failedlogincount=0, '.'logincount=logincount+1, '.'lastlogin=thislogin, '.'thislogin='.time().', '."sessionid='{$currentsessionid}'", '[+prefix+]user_attributes', "internalKey='{$internalKey}'");
222 222
 
223 223
 // get user's document groups
224 224
 $i = 0;
225
-$rs = $modx->db->select('uga.documentgroup', $modx->getFullTableName('member_groups') . ' ug
226
-		INNER JOIN ' . $modx->getFullTableName('membergroup_access') . ' uga ON uga.membergroup=ug.user_group', "ug.member='{$internalKey}'");
225
+$rs = $modx->db->select('uga.documentgroup', $modx->getFullTableName('member_groups').' ug
226
+		INNER JOIN ' . $modx->getFullTableName('membergroup_access').' uga ON uga.membergroup=ug.user_group', "ug.member='{$internalKey}'");
227 227
 $_SESSION['mgrDocgroups'] = $modx->db->getColumn('documentgroup', $rs);
228 228
 
229 229
 $_SESSION['mgrToken'] = md5($currentsessionid);
230 230
 
231
-if($rememberme == '1') {
232
-	$_SESSION['modx.mgr.session.cookie.lifetime'] = (int)$modx->config['session.cookie.lifetime'];
231
+if ($rememberme == '1') {
232
+	$_SESSION['modx.mgr.session.cookie.lifetime'] = (int) $modx->config['session.cookie.lifetime'];
233 233
 
234 234
 	// Set a cookie separate from the session cookie with the username in it.
235 235
 	// Are we using secure connection? If so, make sure the cookie is secure
236 236
 	global $https_port;
237 237
 
238 238
 	$secure = ((isset ($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) == 'on') || $_SERVER['SERVER_PORT'] == $https_port);
239
-	if(version_compare(PHP_VERSION, '5.2', '<')) {
239
+	if (version_compare(PHP_VERSION, '5.2', '<')) {
240 240
 		setcookie('modx_remember_manager', $_SESSION['mgrShortname'], time() + 60 * 60 * 24 * 365, MODX_BASE_URL, '; HttpOnly', $secure);
241 241
 	} else {
242 242
 		setcookie('modx_remember_manager', $_SESSION['mgrShortname'], time() + 60 * 60 * 24 * 365, MODX_BASE_URL, NULL, $secure, true);
@@ -251,9 +251,9 @@  discard block
 block discarded – undo
251 251
 // Check if user already has an active session, if not check if user pressed logout end of last session
252 252
 $rs = $modx->db->select('lasthit', $modx->getFullTableName('active_user_sessions'), "internalKey='{$internalKey}'");
253 253
 $activeSession = $modx->db->getValue($rs);
254
-if(!$activeSession) {
254
+if (!$activeSession) {
255 255
 	$rs = $modx->db->select('lasthit', $modx->getFullTableName('active_users'), "internalKey='{$internalKey}' AND action != 8");
256
-	if($lastHit = $modx->db->getValue($rs)) {
256
+	if ($lastHit = $modx->db->getValue($rs)) {
257 257
 		$_SESSION['show_logout_reminder'] = array(
258 258
 			'type' => 'logout_reminder',
259 259
 			'lastHit' => $lastHit
@@ -274,17 +274,17 @@  discard block
 block discarded – undo
274 274
 
275 275
 // check if we should redirect user to a web page
276 276
 $rs = $modx->db->select('setting_value', '[+prefix+]user_settings', "user='{$internalKey}' AND setting_name='manager_login_startup'");
277
-$id = (int)$modx->db->getValue($rs);
278
-if($id > 0) {
279
-	$header = 'Location: ' . $modx->makeUrl($id, '', '', 'full');
280
-	if($_POST['ajax'] == 1) {
277
+$id = (int) $modx->db->getValue($rs);
278
+if ($id > 0) {
279
+	$header = 'Location: '.$modx->makeUrl($id, '', '', 'full');
280
+	if ($_POST['ajax'] == 1) {
281 281
 		echo $header;
282 282
 	} else {
283 283
 		header($header);
284 284
 	}
285 285
 } else {
286
-	$header = 'Location: ' . MODX_MANAGER_URL;
287
-	if($_POST['ajax'] == 1) {
286
+	$header = 'Location: '.MODX_MANAGER_URL;
287
+	if ($_POST['ajax'] == 1) {
288 288
 		echo $header;
289 289
 	} else {
290 290
 		header($header);
@@ -296,12 +296,12 @@  discard block
 block discarded – undo
296 296
  *
297 297
  * @param string $msg
298 298
  */
299
-function jsAlert($msg) {
299
+function jsAlert($msg){
300 300
 	$modx = evolutionCMS();
301
-	if($_POST['ajax'] != 1) {
302
-		echo "<script>window.setTimeout(\"alert('" . addslashes($modx->db->escape($msg)) . "')\",10);history.go(-1)</script>";
301
+	if ($_POST['ajax'] != 1) {
302
+		echo "<script>window.setTimeout(\"alert('".addslashes($modx->db->escape($msg))."')\",10);history.go(-1)</script>";
303 303
 	} else {
304
-		echo $msg . "\n";
304
+		echo $msg."\n";
305 305
 	}
306 306
 }
307 307
 
@@ -311,7 +311,7 @@  discard block
 block discarded – undo
311 311
  * @param string $dbasePassword
312 312
  * @return bool
313 313
  */
314
-function login($username, $givenPassword, $dbasePassword) {
314
+function login($username, $givenPassword, $dbasePassword){
315 315
 	$modx = evolutionCMS();
316 316
 	return $modx->phpass->CheckPassword($givenPassword, $dbasePassword);
317 317
 }
@@ -323,21 +323,21 @@  discard block
 block discarded – undo
323 323
  * @param string $username
324 324
  * @return bool
325 325
  */
326
-function loginV1($internalKey, $givenPassword, $dbasePassword, $username) {
326
+function loginV1($internalKey, $givenPassword, $dbasePassword, $username){
327 327
 	$modx = evolutionCMS();
328 328
 
329 329
 	$user_algo = $modx->manager->getV1UserHashAlgorithm($internalKey);
330 330
 
331
-	if(!isset($modx->config['pwd_hash_algo']) || empty($modx->config['pwd_hash_algo'])) {
331
+	if (!isset($modx->config['pwd_hash_algo']) || empty($modx->config['pwd_hash_algo'])) {
332 332
 		$modx->config['pwd_hash_algo'] = 'UNCRYPT';
333 333
 	}
334 334
 
335
-	if($user_algo !== $modx->config['pwd_hash_algo']) {
335
+	if ($user_algo !== $modx->config['pwd_hash_algo']) {
336 336
 		$bk_pwd_hash_algo = $modx->config['pwd_hash_algo'];
337 337
 		$modx->config['pwd_hash_algo'] = $user_algo;
338 338
 	}
339 339
 
340
-	if($dbasePassword != $modx->manager->genV1Hash($givenPassword, $internalKey)) {
340
+	if ($dbasePassword != $modx->manager->genV1Hash($givenPassword, $internalKey)) {
341 341
 		return false;
342 342
 	}
343 343
 
@@ -353,10 +353,10 @@  discard block
 block discarded – undo
353 353
  * @param string $username
354 354
  * @return bool
355 355
  */
356
-function loginMD5($internalKey, $givenPassword, $dbasePassword, $username) {
356
+function loginMD5($internalKey, $givenPassword, $dbasePassword, $username){
357 357
 	$modx = evolutionCMS();
358 358
 
359
-	if($dbasePassword != md5($givenPassword)) {
359
+	if ($dbasePassword != md5($givenPassword)) {
360 360
 		return false;
361 361
 	}
362 362
 	updateNewHash($username, $givenPassword);
@@ -367,7 +367,7 @@  discard block
 block discarded – undo
367 367
  * @param string $username
368 368
  * @param string $password
369 369
  */
370
-function updateNewHash($username, $password) {
370
+function updateNewHash($username, $password){
371 371
 	$modx = evolutionCMS();
372 372
 
373 373
 	$field = array();
@@ -381,23 +381,23 @@  discard block
 block discarded – undo
381 381
  * @param int $failed_allowed
382 382
  * @param int $blocked_minutes
383 383
  */
384
-function incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes) {
384
+function incrementFailedLoginCount($internalKey, $failedlogins, $failed_allowed, $blocked_minutes){
385 385
 	$modx = evolutionCMS();
386 386
 
387 387
 	$failedlogins += 1;
388 388
 
389 389
 	$fields = array('failedlogincount' => $failedlogins);
390
-	if($failedlogins >= $failed_allowed) //block user for too many fail attempts
390
+	if ($failedlogins >= $failed_allowed) //block user for too many fail attempts
391 391
 	{
392 392
 		$fields['blockeduntil'] = time() + ($blocked_minutes * 60);
393 393
 	}
394 394
 
395 395
 	$modx->db->update($fields, '[+prefix+]user_attributes', "internalKey='{$internalKey}'");
396 396
 
397
-	if($failedlogins < $failed_allowed) {
397
+	if ($failedlogins < $failed_allowed) {
398 398
 		//sleep to help prevent brute force attacks
399 399
 		$sleep = (int) $failedlogins / 2;
400
-		if($sleep > 5) {
400
+		if ($sleep > 5) {
401 401
 			$sleep = 5;
402 402
 		}
403 403
 		sleep($sleep);
Please login to merge, or discard this patch.
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.