Completed
Branch develop (923a1c)
by Agel_Nash
06:47
created
manager/actions/mutate_settings/tab2_furl_settings.inc.php 1 patch
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.
manager/actions/move_document.dynamic.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
 }
14 14
 
15 15
 // check permissions on the document
16
-include_once MODX_MANAGER_PATH . "processors/user_documents_permissions.class.php";
16
+include_once MODX_MANAGER_PATH."processors/user_documents_permissions.class.php";
17 17
 $udperms = new udperms();
18 18
 $udperms->user = $modx->getLoginUserID();
19 19
 $udperms->document = $id;
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
     },
40 40
     cancel: function() {
41 41
       documentDirty = false;
42
-        <?= ($id == 0 ? 'document.location.href="index.php?a=2";' : 'document.location.href="index.php?a=3&id=' . $id . '";') ?>
42
+        <?= ($id == 0 ? 'document.location.href="index.php?a=2";' : 'document.location.href="index.php?a=3&id='.$id.'";') ?>
43 43
     }
44 44
   };
45 45
 
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 </script>
81 81
 
82 82
 <h1>
83
-    <i class="fa fa-arrows"></i><?= ($pagetitle ? $pagetitle . '<small>(' . $id . ')</small>' : $_lang['move_resource_title']) ?>
83
+    <i class="fa fa-arrows"></i><?= ($pagetitle ? $pagetitle.'<small>('.$id.')</small>' : $_lang['move_resource_title']) ?>
84 84
 </h1>
85 85
 
86 86
 <?= $_style['actionbuttons']['dynamic']['save'] ?>
Please login to merge, or discard this patch.
manager/actions/mutate_htmlsnippet.dynamic.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
 // Add lock-element JS-Script
66 66
 $lockElementId = $id;
67 67
 $lockElementType = 3;
68
-require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php');
68
+require_once(MODX_MANAGER_PATH.'includes/active_user_locks.inc.php');
69 69
 
70 70
 // Print RTE Javascript function
71 71
 ?>
@@ -136,7 +136,7 @@  discard block
 block discarded – undo
136 136
         <input type="hidden" name="mode" value="<?= $modx->manager->action ?>" />
137 137
 
138 138
         <h1>
139
-            <i class="fa fa-th-large"></i><?= ($content['name'] ? $content['name'] . '<small>(' . $content['id'] . ')</small>' : $_lang['new_htmlsnippet']) ?><i class="fa fa-question-circle help"></i>
139
+            <i class="fa fa-th-large"></i><?= ($content['name'] ? $content['name'].'<small>('.$content['id'].')</small>' : $_lang['new_htmlsnippet']) ?><i class="fa fa-question-circle help"></i>
140 140
         </h1>
141 141
 
142 142
         <?= $_style['actionbuttons']['dynamic']['element'] ?>
@@ -160,7 +160,7 @@  discard block
 block discarded – undo
160 160
                             <div class="form-control-name clearfix">
161 161
                                 <input name="name" type="text" maxlength="100" value="<?= $modx->htmlspecialchars($content['name']) ?>" class="form-control form-control-lg" onchange="documentDirty=true;" />
162 162
                                 <?php if ($modx->hasPermission('save_role')): ?>
163
-                                    <label class="custom-control" title="<?= $_lang['lock_htmlsnippet'] . "\n" . $_lang['lock_htmlsnippet_msg'] ?>" tooltip>
163
+                                    <label class="custom-control" title="<?= $_lang['lock_htmlsnippet']."\n".$_lang['lock_htmlsnippet_msg'] ?>" tooltip>
164 164
                                         <input name="locked" type="checkbox" value="on"<?= ($content['locked'] == 1 || $content['locked'] == 'on' ? ' checked="checked"' : '') ?> />
165 165
                                         <i class="fa fa-lock"></i>
166 166
                                     </label>
@@ -184,9 +184,9 @@  discard block
 block discarded – undo
184 184
                             <select name="categoryid" class="form-control" onchange="documentDirty=true;">
185 185
                                 <option>&nbsp;</option>
186 186
                                 <?php
187
-                                include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php');
187
+                                include_once(MODX_MANAGER_PATH.'includes/categories.inc.php');
188 188
                                 foreach (getCategories() as $n => $v) {
189
-                                    echo "\t\t\t\t" . '<option value="' . $v['id'] . '"' . ($content['category'] == $v['id'] || (empty($content['category']) && $_POST['categoryid'] == $v['id']) ? ' selected="selected"' : '') . '>' . $modx->htmlspecialchars($v['category']) . "</option>\n";
189
+                                    echo "\t\t\t\t".'<option value="'.$v['id'].'"'.($content['category'] == $v['id'] || (empty($content['category']) && $_POST['categoryid'] == $v['id']) ? ' selected="selected"' : '').'>'.$modx->htmlspecialchars($v['category'])."</option>\n";
190 190
                                 }
191 191
                                 ?>
192 192
                             </select>
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
                     </div>
201 201
                     <?php if ($_SESSION['mgrRole'] == 1): ?>
202 202
                         <div class="form-row">
203
-                            <label><input name="disabled" type="checkbox" value="on"<?= ($content['disabled'] == 1 ? ' checked="checked"' : '') ?> /> <?= ($content['disabled'] == 1 ? "<span class='text-danger'>" . $_lang['disabled'] . "</span>" : $_lang['disabled']) ?></label>
203
+                            <label><input name="disabled" type="checkbox" value="on"<?= ($content['disabled'] == 1 ? ' checked="checked"' : '') ?> /> <?= ($content['disabled'] == 1 ? "<span class='text-danger'>".$_lang['disabled']."</span>" : $_lang['disabled']) ?></label>
204 204
                         </div>
205 205
                     <?php endif; ?>
206 206
                 </div>
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
                             $evtOut = $modx->invokeEvent('OnRichTextEditorRegister');
217 217
                             if (is_array($evtOut)) {
218 218
                                 foreach ($evtOut as $i => $editor) {
219
-                                    echo "\t" . '<option value="' . $editor . '"' . ($which_editor == $editor ? ' selected="selected"' : '') . '>' . $editor . "</option>\n";
219
+                                    echo "\t".'<option value="'.$editor.'"'.($which_editor == $editor ? ' selected="selected"' : '').'>'.$editor."</option>\n";
220 220
                                 }
221 221
                             }
222 222
                             ?>
Please login to merge, or discard this patch.
manager/actions/help.static.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -1,12 +1,12 @@  discard block
 block discarded – undo
1 1
 <?php
2
-if(IN_MANAGER_MODE != "true") {
2
+if (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
 $helpBasePath = "actions/help/";
6 6
 ?>
7 7
 
8 8
 <h1>
9
-	<?php echo $_style['page_help'];  echo $_lang['help']; ?>
9
+	<?php echo $_style['page_help']; echo $_lang['help']; ?>
10 10
 </h1>
11 11
 
12 12
 <div class="sectionBody">
@@ -16,9 +16,9 @@  discard block
 block discarded – undo
16 16
 		</script>
17 17
 
18 18
 		<?php
19
-		if($handle = opendir('actions/help')) {
20
-			while(false !== ($file = readdir($handle))) {
21
-				if($file != "." && $file != ".." && $file != ".svn" && $file != 'index.html' && !is_dir($helpBasePath . $file)) {
19
+		if ($handle = opendir('actions/help')) {
20
+			while (false !== ($file = readdir($handle))) {
21
+				if ($file != "." && $file != ".." && $file != ".svn" && $file != 'index.html' && !is_dir($helpBasePath.$file)) {
22 22
 					$help[] = $file;
23 23
 				}
24 24
 			}
@@ -27,22 +27,22 @@  discard block
 block discarded – undo
27 27
 
28 28
 		natcasesort($help);
29 29
 
30
-		foreach($help as $k => $v) {
30
+		foreach ($help as $k => $v) {
31 31
 
32 32
 			$helpname = substr($v, 0, strrpos($v, '.'));
33 33
 
34 34
 			$prefix = substr($helpname, 0, 2);
35
-			if(is_numeric($prefix)) {
35
+			if (is_numeric($prefix)) {
36 36
 				$helpname = substr($helpname, 2, strlen($helpname) - 1);
37 37
 			}
38 38
 
39 39
 			$hnLower = strtolower($helpname);
40 40
 			$helpname = isset($_lang[$hnLower]) ? $_lang[$hnLower] : str_replace('_', ' ', $helpname);
41 41
 
42
-			echo '<div class="tab-page" id="tab' . $k . 'Help">';
43
-			echo '<h2 class="tab">' . $helpname . '</h2>';
44
-			echo '<script type="text/javascript">tp.addTabPage( document.getElementById( "tab' . $k . 'Help" ) );</script>';
45
-			include_once($helpBasePath . "{$v}");
42
+			echo '<div class="tab-page" id="tab'.$k.'Help">';
43
+			echo '<h2 class="tab">'.$helpname.'</h2>';
44
+			echo '<script type="text/javascript">tp.addTabPage( document.getElementById( "tab'.$k.'Help" ) );</script>';
45
+			include_once($helpBasePath."{$v}");
46 46
 			echo '</div>';
47 47
 		}
48 48
 		?>
Please login to merge, or discard this patch.
manager/actions/files.dynamic.php 1 patch
Spacing   +104 added lines, -104 removed lines patch added patch discarded remove patch
@@ -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' . $alias_suffix);
20
-$inlineviewablefiles = explode(',', 'txt,php,tpl,less,sass,html,htm,xml,js,css,pageCache,htaccess,json' . $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'.$alias_suffix);
20
+$inlineviewablefiles = explode(',', 'txt,php,tpl,less,sass,html,htm,xml,js,css,pageCache,htaccess,json'.$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
 }
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 {
80 80
     $count = count($array);
81 81
     for ($i = 0; $i < $count; $i++) {
82
-        $array[$i] = '.' . strtolower(trim($array[$i])); // add a dot :)
82
+        $array[$i] = '.'.strtolower(trim($array[$i])); // add a dot :)
83 83
     }
84 84
     return $array;
85 85
 }
@@ -104,15 +104,15 @@  discard block
 block discarded – undo
104 104
 $rw = realpath('../');
105 105
 $webstart_path = str_replace('\\', '/', str_replace($rw, '', $rf));
106 106
 if (substr($webstart_path, 0, 1) == '/') {
107
-    $webstart_path = '..' . $webstart_path;
107
+    $webstart_path = '..'.$webstart_path;
108 108
 } else {
109
-    $webstart_path = '../' . $webstart_path;
109
+    $webstart_path = '../'.$webstart_path;
110 110
 }
111 111
 
112 112
 ?>
113 113
     <script type="text/javascript">
114 114
 
115
-        var current_path = '<?= $startpath;?>';
115
+        var current_path = '<?= $startpath; ?>';
116 116
 
117 117
         function viewfile (url)
118 118
         {
@@ -148,7 +148,7 @@  discard block
 block discarded – undo
148 148
         function unzipFile (file)
149 149
         {
150 150
             if (confirmUnzip()) {
151
-                window.location.href = "index.php?a=31&mode=unzip&path=" + current_path + '/&file=' + file + "&token=<?= $newToken;?>";
151
+                window.location.href = "index.php?a=31&mode=unzip&path=" + current_path + '/&file=' + file + "&token=<?= $newToken; ?>";
152 152
                 return false;
153 153
             }
154 154
         }
@@ -170,7 +170,7 @@  discard block
 block discarded – undo
170 170
         function deleteFolder (folder, status)
171 171
         {
172 172
             if (confirmDeleteFolder(status)) {
173
-                window.location.href = "index.php?a=31&mode=deletefolder&path=" + current_path + "&folderpath=" + current_path + '/' + folder + "&token=<?= $newToken;?>";
173
+                window.location.href = "index.php?a=31&mode=deletefolder&path=" + current_path + "&folderpath=" + current_path + '/' + folder + "&token=<?= $newToken; ?>";
174 174
                 return false;
175 175
             }
176 176
         }
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
         function deleteFile (file)
179 179
         {
180 180
             if (confirmDelete()) {
181
-                window.location.href = "index.php?a=31&mode=delete&path=" + current_path + '/' + file + "&token=<?= $newToken;?>";
181
+                window.location.href = "index.php?a=31&mode=delete&path=" + current_path + '/' + file + "&token=<?= $newToken; ?>";
182 182
                 return false;
183 183
             }
184 184
         }
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
         {
188 188
             var newFilename = prompt("<?= $_lang["files_dynamic_new_file_name"] ?>", file);
189 189
             if (newFilename !== null && newFilename !== file) {
190
-                window.location.href = "index.php?a=31&mode=duplicate&path=" + current_path + '/' + file + "&newFilename=" + newFilename + "&token=<?= $newToken;?>";
190
+                window.location.href = "index.php?a=31&mode=duplicate&path=" + current_path + '/' + file + "&newFilename=" + newFilename + "&token=<?= $newToken; ?>";
191 191
             }
192 192
         }
193 193
 
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
         {
196 196
             var newDirname = prompt("<?= $_lang["files_dynamic_new_folder_name"] ?>", dir);
197 197
             if (newDirname !== null && newDirname !== dir) {
198
-                window.location.href = "index.php?a=31&mode=renameFolder&path=" + current_path + '&dirname=' + dir + "&newDirname=" + newDirname + "&token=<?= $newToken;?>";
198
+                window.location.href = "index.php?a=31&mode=renameFolder&path=" + current_path + '&dirname=' + dir + "&newDirname=" + newDirname + "&token=<?= $newToken; ?>";
199 199
             }
200 200
         }
201 201
 
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
         {
204 204
             var newFilename = prompt("<?= $_lang["files_dynamic_new_file_name"] ?>", file);
205 205
             if (newFilename !== null && newFilename !== file) {
206
-                window.location.href = "index.php?a=31&mode=renameFile&path=" + current_path + '/' + file + "&newFilename=" + newFilename + "&token=<?= $newToken;?>";
206
+                window.location.href = "index.php?a=31&mode=renameFile&path=" + current_path + '/' + file + "&newFilename=" + newFilename + "&token=<?= $newToken; ?>";
207 207
             }
208 208
         }
209 209
 
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
             <?php endif ?>
223 223
             <?php
224 224
             if (isset($_GET['mode']) && $_GET['mode'] !== 'drill') {
225
-                $href = 'a=31&path=' . urlencode($_REQUEST['path']);
225
+                $href = 'a=31&path='.urlencode($_REQUEST['path']);
226 226
             } else {
227 227
                 $href = 'a=2';
228 228
             }
@@ -232,12 +232,12 @@  discard block
 block discarded – undo
232 232
                 $tpl = '<a class="btn btn-secondary" href="[+href+]" onclick="return getFolderName(this);"><i class="[+image+]"></i><span>[+subject+]</span></a>';
233 233
                 $ph['image'] = $_style['files_folder-open'];
234 234
                 $ph['subject'] = $_lang['add_folder'];
235
-                $ph['href'] = 'index.php?a=31&mode=newfolder&path=' . urlencode($startpath) . '&name=';
235
+                $ph['href'] = 'index.php?a=31&mode=newfolder&path='.urlencode($startpath).'&name=';
236 236
                 $_ = parsePlaceholder($tpl, $ph);
237 237
 
238
-                $tpl = '<a class="btn btn-secondary" href="[+href+]" onclick="return getFileName(this);"><i class="[+image+]"></i><span>' . $_lang['files.dynamic.php1'] . '</span></a>';
238
+                $tpl = '<a class="btn btn-secondary" href="[+href+]" onclick="return getFileName(this);"><i class="[+image+]"></i><span>'.$_lang['files.dynamic.php1'].'</span></a>';
239 239
                 $ph['image'] = $_style['files_page_html'];
240
-                $ph['href'] = 'index.php?a=31&mode=newfile&path=' . urlencode($startpath) . '&name=';
240
+                $ph['href'] = 'index.php?a=31&mode=newfile&path='.urlencode($startpath).'&name=';
241 241
                 $_ .= parsePlaceholder($tpl, $ph);
242 242
                 echo $_;
243 243
             }
@@ -267,12 +267,12 @@  discard block
 block discarded – undo
267 267
             $ph = array();
268 268
             $ph['style_path'] = $theme_image_path;
269 269
             // To Top Level with folder icon to the left
270
-            if ($startpath == $filemanager_path || $startpath . '/' == $filemanager_path) {
271
-                $ph['image'] = '' . $_style['files_top'] . '';
270
+            if ($startpath == $filemanager_path || $startpath.'/' == $filemanager_path) {
271
+                $ph['image'] = ''.$_style['files_top'].'';
272 272
                 $ph['subject'] = '<span>Top</span>';
273 273
             } else {
274
-                $ph['image'] = '' . $_style['files_top'] . '';
275
-                $ph['subject'] = '<a href="index.php?a=31&mode=drill&path=' . $filemanager_path . '">Top</a>/';
274
+                $ph['image'] = ''.$_style['files_top'].'';
275
+                $ph['subject'] = '<a href="index.php?a=31&mode=drill&path='.$filemanager_path.'">Top</a>/';
276 276
             }
277 277
 
278 278
             echo parsePlaceholder($tpl, $ph);
@@ -289,12 +289,12 @@  discard block
 block discarded – undo
289 289
                     if (empty($v)) {
290 290
                         continue;
291 291
                     }
292
-                    $path .= rtrim($v, '/') . '/';
292
+                    $path .= rtrim($v, '/').'/';
293 293
                     if (1 < $count) {
294
-                        $href = 'index.php?a=31&mode=drill&path=' . urlencode($filemanager_path . $path);
295
-                        $pieces[$i] = '<a href="' . $href . '">' . trim($v, '/') . '</a>';
294
+                        $href = 'index.php?a=31&mode=drill&path='.urlencode($filemanager_path.$path);
295
+                        $pieces[$i] = '<a href="'.$href.'">'.trim($v, '/').'</a>';
296 296
                     } else {
297
-                        $pieces[$i] = '<span>' . trim($v, '/') . '</span>';
297
+                        $pieces[$i] = '<span>'.trim($v, '/').'</span>';
298 298
                     }
299 299
                     $count--;
300 300
                 }
@@ -307,16 +307,16 @@  discard block
 block discarded – undo
307 307
         </div>
308 308
         <?php
309 309
         // check to see user isn't trying to move below the document_root
310
-        if (substr(strtolower(str_replace('//', '/', $startpath . "/")), 0, $len) != strtolower(str_replace('//', '/', $filemanager_path . '/'))) {
310
+        if (substr(strtolower(str_replace('//', '/', $startpath."/")), 0, $len) != strtolower(str_replace('//', '/', $filemanager_path.'/'))) {
311 311
             $modx->webAlertAndQuit($_lang["files_access_denied"]);
312 312
         }
313 313
 
314 314
         // Unzip .zip files - by Raymond
315 315
         if ($enablefileunzip && $_REQUEST['mode'] == 'unzip' && is_writable($startpath)) {
316
-            if (!$err = unzip(realpath("{$startpath}/" . $_REQUEST['file']), realpath($startpath))) {
317
-                echo '<span class="warning"><b>' . $_lang['file_unzip_fail'] . ($err === 0 ? 'Missing zip library (php_zip.dll / zip.so)' : '') . '</b></span><br /><br />';
316
+            if (!$err = unzip(realpath("{$startpath}/".$_REQUEST['file']), realpath($startpath))) {
317
+                echo '<span class="warning"><b>'.$_lang['file_unzip_fail'].($err === 0 ? 'Missing zip library (php_zip.dll / zip.so)' : '').'</b></span><br /><br />';
318 318
             } else {
319
-                echo '<span class="success"><b>' . $_lang['file_unzip'] . '</b></span><br /><br />';
319
+                echo '<span class="success"><b>'.$_lang['file_unzip'].'</b></span><br /><br />';
320 320
             }
321 321
         }
322 322
         // End Unzip - Raymond
@@ -328,9 +328,9 @@  discard block
 block discarded – undo
328 328
             if ($_REQUEST['mode'] == 'deletefolder') {
329 329
                 $folder = $_REQUEST['folderpath'];
330 330
                 if (!$token_check || !@rrmdir($folder)) {
331
-                    echo '<span class="warning"><b>' . $_lang['file_folder_not_deleted'] . '</b></span><br /><br />';
331
+                    echo '<span class="warning"><b>'.$_lang['file_folder_not_deleted'].'</b></span><br /><br />';
332 332
                 } else {
333
-                    echo '<span class="success"><b>' . $_lang['file_folder_deleted'] . '</b></span><br /><br />';
333
+                    echo '<span class="success"><b>'.$_lang['file_folder_deleted'].'</b></span><br /><br />';
334 334
                 }
335 335
             }
336 336
 
@@ -341,10 +341,10 @@  discard block
 block discarded – undo
341 341
                 if (!mkdirs("{$startpath}/{$foldername}", 0777)) {
342 342
                     echo '<span class="warning"><b>', $_lang['file_folder_not_created'], '</b></span><br /><br />';
343 343
                 } else {
344
-                    if (!@chmod($startpath . '/' . $foldername, $newfolderaccessmode)) {
345
-                        echo '<span class="warning"><b>' . $_lang['file_folder_chmod_error'] . '</b></span><br /><br />';
344
+                    if (!@chmod($startpath.'/'.$foldername, $newfolderaccessmode)) {
345
+                        echo '<span class="warning"><b>'.$_lang['file_folder_chmod_error'].'</b></span><br /><br />';
346 346
                     } else {
347
-                        echo '<span class="success"><b>' . $_lang['file_folder_created'] . '</b></span><br /><br />';
347
+                        echo '<span class="success"><b>'.$_lang['file_folder_created'].'</b></span><br /><br />';
348 348
                     }
349 349
                 }
350 350
                 umask($old_umask);
@@ -356,7 +356,7 @@  discard block
 block discarded – undo
356 356
                 $filename = $modx->db->escape($filename);
357 357
 
358 358
                 if (!checkExtension($filename)) {
359
-                    echo '<span class="warning"><b>' . $_lang['files_filetype_notok'] . '</b></span><br /><br />';
359
+                    echo '<span class="warning"><b>'.$_lang['files_filetype_notok'].'</b></span><br /><br />';
360 360
                 } elseif (preg_match('@(\\\\|\/|\:|\;|\,|\*|\?|\"|\<|\>|\||\?)@', $filename) !== 0) {
361 361
                     echo $_lang['files.dynamic.php3'];
362 362
                 } else {
@@ -378,11 +378,11 @@  discard block
 block discarded – undo
378 378
                 $newFilename = $modx->db->escape($newFilename);
379 379
 
380 380
                 if (!checkExtension($newFilename)) {
381
-                    echo '<span class="warning"><b>' . $_lang['files_filetype_notok'] . '</b></span><br /><br />';
381
+                    echo '<span class="warning"><b>'.$_lang['files_filetype_notok'].'</b></span><br /><br />';
382 382
                 } elseif (preg_match('@(\\\\|\/|\:|\;|\,|\*|\?|\"|\<|\>|\||\?)@', $newFilename) !== 0) {
383 383
                     echo $_lang['files.dynamic.php3'];
384 384
                 } else {
385
-                    if (!copy($filename, MODX_BASE_PATH . $newFilename)) {
385
+                    if (!copy($filename, MODX_BASE_PATH.$newFilename)) {
386 386
                         echo $_lang['files.dynamic.php5'];
387 387
                     }
388 388
                     umask($old_umask);
@@ -391,7 +391,7 @@  discard block
 block discarded – undo
391 391
             // Rename folder here
392 392
             if ($_REQUEST['mode'] == 'renameFolder') {
393 393
                 $old_umask = umask(0);
394
-                $dirname = $_REQUEST['path'] . '/' . $_REQUEST['dirname'];
394
+                $dirname = $_REQUEST['path'].'/'.$_REQUEST['dirname'];
395 395
                 $dirname = $modx->db->escape($dirname);
396 396
                 $newDirname = str_replace(array(
397 397
                     '..\\',
@@ -403,7 +403,7 @@  discard block
 block discarded – undo
403 403
 
404 404
                 if (preg_match('@(\\\\|\/|\:|\;|\,|\*|\?|\"|\<|\>|\||\?)@', $newDirname) !== 0) {
405 405
                     echo $_lang['files.dynamic.php3'];
406
-                } else if (!rename($dirname, $_REQUEST['path'] . '/' . $newDirname)) {
406
+                } else if (!rename($dirname, $_REQUEST['path'].'/'.$newDirname)) {
407 407
                     echo '<span class="warning"><b>', $_lang['file_folder_not_created'], '</b></span><br /><br />';
408 408
                 }
409 409
                 umask($old_umask);
@@ -423,11 +423,11 @@  discard block
 block discarded – undo
423 423
                 $newFilename = $modx->db->escape($newFilename);
424 424
 
425 425
                 if (!checkExtension($newFilename)) {
426
-                    echo '<span class="warning"><b>' . $_lang['files_filetype_notok'] . '</b></span><br /><br />';
426
+                    echo '<span class="warning"><b>'.$_lang['files_filetype_notok'].'</b></span><br /><br />';
427 427
                 } elseif (preg_match('@(\\\\|\/|\:|\;|\,|\*|\?|\"|\<|\>|\||\?)@', $newFilename) !== 0) {
428 428
                     echo $_lang['files.dynamic.php3'];
429 429
                 } else {
430
-                    if (!rename($filename, $path . '/' . $newFilename)) {
430
+                    if (!rename($filename, $path.'/'.$newFilename)) {
431 431
                         echo $_lang['files.dynamic.php5'];
432 432
                     }
433 433
                     umask($old_umask);
@@ -460,7 +460,7 @@  discard block
 block discarded – undo
460 460
                 ls($startpath);
461 461
                 echo "\n\n\n";
462 462
                 if ($folders == 0 && $files == 0) {
463
-                    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>';
463
+                    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>';
464 464
                 }
465 465
                 ?>
466 466
             </table>
@@ -469,10 +469,10 @@  discard block
 block discarded – undo
469 469
         <div class="container">
470 470
             <p>
471 471
                 <?php
472
-                echo $_lang['files_directories'] . ': <b>' . $folders . '</b> ';
473
-                echo $_lang['files_files'] . ': <b>' . $files . '</b> ';
474
-                echo $_lang['files_data'] . ': <b><span dir="ltr">' . $modx->nicesize($filesizes) . '</span></b> ';
475
-                echo $_lang['files_dirwritable'] . ' <b>' . (is_writable($startpath) == 1 ? $_lang['yes'] . '.' : $_lang['no']) . '.</b>'
472
+                echo $_lang['files_directories'].': <b>'.$folders.'</b> ';
473
+                echo $_lang['files_files'].': <b>'.$files.'</b> ';
474
+                echo $_lang['files_data'].': <b><span dir="ltr">'.$modx->nicesize($filesizes).'</span></b> ';
475
+                echo $_lang['files_dirwritable'].' <b>'.(is_writable($startpath) == 1 ? $_lang['yes'].'.' : $_lang['no']).'.</b>'
476 476
                 ?>
477 477
             </p>
478 478
 
@@ -497,7 +497,7 @@  discard block
 block discarded – undo
497 497
                 </form>
498 498
                 <?php
499 499
             } else {
500
-                echo "<p>" . $_lang['files_upload_inhibited_msg'] . "</p>";
500
+                echo "<p>".$_lang['files_upload_inhibited_msg']."</p>";
501 501
             }
502 502
             ?>
503 503
             <div id="imageviewer"></div>
@@ -576,7 +576,7 @@  discard block
 block discarded – undo
576 576
     if ($file == $selFile) {
577 577
         $icon = isset($icons[$mode]) ? $icons[$mode] : $icons['default'];
578 578
     }
579
-    return '<i class="' . $icon . ' FilesPage"></i>';
579
+    return '<i class="'.$icon.' FilesPage"></i>';
580 580
 }
581 581
 
582 582
 function markRow($file, $selFile, $mode)
@@ -588,7 +588,7 @@  discard block
 block discarded – undo
588 588
     );
589 589
     if ($file == $selFile) {
590 590
         $class = isset($classNames[$mode]) ? $classNames[$mode] : $classNames['default'];
591
-        return ' class="' . $class . '"';
591
+        return ' class="'.$class.'"';
592 592
     }
593 593
     return '';
594 594
 }
@@ -599,7 +599,7 @@  discard block
 block discarded – undo
599 599
     global $excludes, $protected_path, $editablefiles, $inlineviewablefiles, $viewablefiles, $enablefileunzip, $enablefiledownload, $uploadablefiles, $folders, $files, $filesizes, $len, $dirs_array, $files_array, $webstart_path, $modx;
600 600
     $dircounter = 0;
601 601
     $filecounter = 0;
602
-    $curpath = str_replace('//', '/', $curpath . '/');
602
+    $curpath = str_replace('//', '/', $curpath.'/');
603 603
 
604 604
     if (!is_dir($curpath)) {
605 605
         echo 'Invalid path "', $curpath, '"<br />';
@@ -609,7 +609,7 @@  discard block
 block discarded – undo
609 609
 
610 610
     // first, get info
611 611
     foreach ($dir as $file) {
612
-        $newpath = $curpath . $file;
612
+        $newpath = $curpath.$file;
613 613
         if ($file === '..' || $file === '.') {
614 614
             continue;
615 615
         }
@@ -619,7 +619,7 @@  discard block
 block discarded – undo
619 619
             if ($file === '..' || $file === '.') {
620 620
                 continue;
621 621
             } elseif (!in_array($file, $excludes) && !in_array($newpath, $protected_path)) {
622
-                $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>';
622
+                $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>';
623 623
 
624 624
                 $dfiles = scandir($newpath);
625 625
                 foreach ($dfiles as $i => $infile) {
@@ -632,13 +632,13 @@  discard block
 block discarded – undo
632 632
                 }
633 633
                 $file_exists = (0 < count($dfiles)) ? 'file_exists' : '';
634 634
 
635
-                $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>' : '';
635
+                $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>' : '';
636 636
             } else {
637
-                $dirs_array[$dircounter]['text'] = '<span><i class="' . $_style['files_deleted_folder'] . ' FilesDeletedFolder"></i> ' . $file . '</span>';
638
-                $dirs_array[$dircounter]['delete'] = is_writable($curpath) ? '<span class="disabled"><i class="' . $_style['files_delete'] . '" title="' . $_lang['file_delete_folder'] . '"></i></span>' : '';
637
+                $dirs_array[$dircounter]['text'] = '<span><i class="'.$_style['files_deleted_folder'].' FilesDeletedFolder"></i> '.$file.'</span>';
638
+                $dirs_array[$dircounter]['delete'] = is_writable($curpath) ? '<span class="disabled"><i class="'.$_style['files_delete'].'" title="'.$_lang['file_delete_folder'].'"></i></span>' : '';
639 639
             }
640 640
 
641
-            $dirs_array[$dircounter]['rename'] = is_writable($curpath) ? '<a href="javascript:renameFolder(\'' . urlencode($file) . '\');"><i class="' . $_style['files_rename'] . '" title="' . $_lang['rename'] . '"></i></a> ' : '';
641
+            $dirs_array[$dircounter]['rename'] = is_writable($curpath) ? '<a href="javascript:renameFolder(\''.urlencode($file).'\');"><i class="'.$_style['files_rename'].'" title="'.$_lang['rename'].'"></i></a> ' : '';
642 642
 
643 643
             // increment the counter
644 644
             $dircounter++;
@@ -646,14 +646,14 @@  discard block
 block discarded – undo
646 646
             $type = getExtension($newpath);
647 647
             $files_array[$filecounter]['file'] = $newpath;
648 648
             $files_array[$filecounter]['stats'] = lstat($newpath);
649
-            $files_array[$filecounter]['text'] = determineIcon($newpath, $_REQUEST['path'], $_REQUEST['mode']) . ' ' . $file;
650
-            $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>');
651
-            $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'];
652
-            $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>' : '';
653
-            $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>';
654
-            $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>';
655
-            $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>';
656
-            $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>';
649
+            $files_array[$filecounter]['text'] = determineIcon($newpath, $_REQUEST['path'], $_REQUEST['mode']).' '.$file;
650
+            $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>');
651
+            $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'];
652
+            $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>' : '';
653
+            $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>';
654
+            $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>';
655
+            $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>';
656
+            $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>';
657 657
 
658 658
             // increment the counter
659 659
             $filecounter++;
@@ -666,9 +666,9 @@  discard block
 block discarded – undo
666 666
     for ($i = 0; $i < $folders; $i++) {
667 667
         $filesizes += $dirs_array[$i]['stats']['7'];
668 668
         echo '<tr>';
669
-        echo '<td>' . $dirs_array[$i]['text'] . '</td>';
670
-        echo '<td class="text-nowrap">' . $modx->toDateFormat($dirs_array[$i]['stats']['9']) . '</td>';
671
-        echo '<td class="text-right">' . $modx->nicesize($dirs_array[$i]['stats']['7']) . '</td>';
669
+        echo '<td>'.$dirs_array[$i]['text'].'</td>';
670
+        echo '<td class="text-nowrap">'.$modx->toDateFormat($dirs_array[$i]['stats']['9']).'</td>';
671
+        echo '<td class="text-right">'.$modx->nicesize($dirs_array[$i]['stats']['7']).'</td>';
672 672
         echo '<td class="actions text-right">';
673 673
         echo $dirs_array[$i]['rename'];
674 674
         echo $dirs_array[$i]['delete'];
@@ -681,10 +681,10 @@  discard block
 block discarded – undo
681 681
     sort($files_array); // sorting the array alphabetically (Thanks pxl8r!)
682 682
     for ($i = 0; $i < $files; $i++) {
683 683
         $filesizes += $files_array[$i]['stats']['7'];
684
-        echo '<tr ' . markRow($files_array[$i]['file'], $_REQUEST['path'], $_REQUEST['mode']) . '>';
685
-        echo '<td>' . $files_array[$i]['text'] . '</td>';
686
-        echo '<td class="text-nowrap">' . $modx->toDateFormat($files_array[$i]['stats']['9']) . '</td>';
687
-        echo '<td class="text-right">' . $modx->nicesize($files_array[$i]['stats']['7']) . '</td>';
684
+        echo '<tr '.markRow($files_array[$i]['file'], $_REQUEST['path'], $_REQUEST['mode']).'>';
685
+        echo '<td>'.$files_array[$i]['text'].'</td>';
686
+        echo '<td class="text-nowrap">'.$modx->toDateFormat($files_array[$i]['stats']['9']).'</td>';
687
+        echo '<td class="text-right">'.$modx->nicesize($files_array[$i]['stats']['7']).'</td>';
688 688
         echo '<td class="actions text-right">';
689 689
         echo $files_array[$i]['unzip'];
690 690
         echo $files_array[$i]['view'];
@@ -792,17 +792,17 @@  discard block
 block discarded – undo
792 792
     $zip = zip_open($file);
793 793
     if ($zip) {
794 794
         $old_umask = umask(0);
795
-        $path = rtrim($path, '/') . '/';
795
+        $path = rtrim($path, '/').'/';
796 796
         while ($zip_entry = zip_read($zip)) {
797 797
             if (zip_entry_filesize($zip_entry) > 0) {
798 798
                 // str_replace must be used under windows to convert "/" into "\"
799 799
                 $zip_entry_name = zip_entry_name($zip_entry);
800
-                $complete_path = $path . str_replace('\\', '/', dirname($zip_entry_name));
801
-                $complete_name = $path . str_replace('\\', '/', $zip_entry_name);
800
+                $complete_path = $path.str_replace('\\', '/', dirname($zip_entry_name));
801
+                $complete_name = $path.str_replace('\\', '/', $zip_entry_name);
802 802
                 if (!file_exists($complete_path)) {
803 803
                     $tmp = '';
804 804
                     foreach (explode('/', $complete_path) AS $k) {
805
-                        $tmp .= $k . '/';
805
+                        $tmp .= $k.'/';
806 806
                         if (!is_dir($tmp)) {
807 807
                             mkdir($tmp, 0777);
808 808
                         }
@@ -823,7 +823,7 @@  discard block
 block discarded – undo
823 823
 
824 824
 function rrmdir($dir)
825 825
 {
826
-    foreach (glob($dir . '/*') as $file) {
826
+    foreach (glob($dir.'/*') as $file) {
827 827
         if (is_dir($file)) {
828 828
             rrmdir($file);
829 829
         } else {
@@ -855,12 +855,12 @@  discard block
 block discarded – undo
855 855
             $userfile['type'] = $_FILES['userfile']['type'][$i];
856 856
 
857 857
             // this seems to be an upload action.
858
-            $path = $modx->config['site_url'] . substr($startpath, strlen($filemanager_path), strlen($startpath));
859
-            $path = rtrim($path, '/') . '/' . $userfile['name'];
858
+            $path = $modx->config['site_url'].substr($startpath, strlen($filemanager_path), strlen($startpath));
859
+            $path = rtrim($path, '/').'/'.$userfile['name'];
860 860
             $msg .= $path;
861 861
             if ($userfile['error'] == 0) {
862
-                $img = (strpos($userfile['type'], 'image') !== false) ? '<br /><img src="' . $path . '" height="75" />' : '';
863
-                $msg .= "<p>" . $_lang['files_file_type'] . $userfile['type'] . ", " . $modx->nicesize(filesize($userfile['tmp_name'])) . $img . '</p>';
862
+                $img = (strpos($userfile['type'], 'image') !== false) ? '<br /><img src="'.$path.'" height="75" />' : '';
863
+                $msg .= "<p>".$_lang['files_file_type'].$userfile['type'].", ".$modx->nicesize(filesize($userfile['tmp_name'])).$img.'</p>';
864 864
             }
865 865
 
866 866
             $userfilename = $userfile['tmp_name'];
@@ -868,15 +868,15 @@  discard block
 block discarded – undo
868 868
             if (is_uploaded_file($userfilename)) {
869 869
                 // file is uploaded file, process it!
870 870
                 if (!checkExtension($userfile['name'])) {
871
-                    $msg .= '<p><span class="warning">' . $_lang['files_filetype_notok'] . '</span></p>';
871
+                    $msg .= '<p><span class="warning">'.$_lang['files_filetype_notok'].'</span></p>';
872 872
                 } else {
873
-                    if (@move_uploaded_file($userfile['tmp_name'], $_POST['path'] . '/' . $userfile['name'])) {
873
+                    if (@move_uploaded_file($userfile['tmp_name'], $_POST['path'].'/'.$userfile['name'])) {
874 874
                         // Ryan: Repair broken permissions issue with file manager
875 875
                         if (strtoupper(substr(PHP_OS, 0, 3)) != 'WIN') {
876
-                            @chmod($_POST['path'] . "/" . $userfile['name'], $new_file_permissions);
876
+                            @chmod($_POST['path']."/".$userfile['name'], $new_file_permissions);
877 877
                         }
878 878
                         // Ryan: End
879
-                        $msg .= '<p><span class="success">' . $_lang['files_upload_ok'] . '</span></p><hr/>';
879
+                        $msg .= '<p><span class="success">'.$_lang['files_upload_ok'].'</span></p><hr/>';
880 880
 
881 881
                         // invoke OnFileManagerUpload event
882 882
                         $modx->invokeEvent('OnFileManagerUpload', array(
@@ -884,13 +884,13 @@  discard block
 block discarded – undo
884 884
                             'filename' => $userfile['name']
885 885
                         ));
886 886
                         // Log the change
887
-                        logFileChange('upload', $_POST['path'] . '/' . $userfile['name']);
887
+                        logFileChange('upload', $_POST['path'].'/'.$userfile['name']);
888 888
                     } else {
889
-                        $msg .= '<p><span class="warning">' . $_lang['files_upload_copyfailed'] . '</span> ' . $_lang["files_upload_permissions_error"] . '</p>';
889
+                        $msg .= '<p><span class="warning">'.$_lang['files_upload_copyfailed'].'</span> '.$_lang["files_upload_permissions_error"].'</p>';
890 890
                     }
891 891
                 }
892 892
             } else {
893
-                $msg .= '<br /><span class="warning"><b>' . $_lang['files_upload_error'] . ':</b>';
893
+                $msg .= '<br /><span class="warning"><b>'.$_lang['files_upload_error'].':</b>';
894 894
                 switch ($userfile['error']) {
895 895
                     case 0: //no error; possible file attack!
896 896
                         $msg .= $_lang['files_upload_error0'];
@@ -915,7 +915,7 @@  discard block
 block discarded – undo
915 915
             }
916 916
         }
917 917
     }
918
-    return $msg . '<br/>';
918
+    return $msg.'<br/>';
919 919
 }
920 920
 
921 921
 function textsave()
@@ -928,9 +928,9 @@  discard block
 block discarded – undo
928 928
 
929 929
     // Write $content to our opened file.
930 930
     if (file_put_contents($filename, $content) === false) {
931
-        $msg .= '<span class="warning"><b>' . $_lang['file_not_saved'] . '</b></span><br /><br />';
931
+        $msg .= '<span class="warning"><b>'.$_lang['file_not_saved'].'</b></span><br /><br />';
932 932
     } else {
933
-        $msg .= '<span class="success"><b>' . $_lang['file_saved'] . '</b></span><br /><br />';
933
+        $msg .= '<span class="success"><b>'.$_lang['file_saved'].'</b></span><br /><br />';
934 934
         $_REQUEST['mode'] = 'edit';
935 935
     }
936 936
     // Log the change
@@ -946,9 +946,9 @@  discard block
 block discarded – undo
946 946
 
947 947
     $file = $_REQUEST['path'];
948 948
     if (!$token_check || !@unlink($file)) {
949
-        $msg .= '<span class="warning"><b>' . $_lang['file_not_deleted'] . '</b></span><br /><br />';
949
+        $msg .= '<span class="warning"><b>'.$_lang['file_not_deleted'].'</b></span><br /><br />';
950 950
     } else {
951
-        $msg .= '<span class="success"><b>' . $_lang['file_deleted'] . '</b></span><br /><br />';
951
+        $msg .= '<span class="success"><b>'.$_lang['file_deleted'].'</b></span><br /><br />';
952 952
     }
953 953
 
954 954
     // Log the change
Please login to merge, or discard this patch.
manager/actions/help/04Changelog.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -5,8 +5,8 @@
 block discarded – undo
5 5
 <div class="sectionHeader">Changelog</div>
6 6
 <div class="sectionBody">
7 7
 <?php
8
-	$changeLog = MODX_BASE_PATH . 'assets/docs/changelog.txt';
9
-	if(is_readable($changeLog))
10
-		echo str_replace("\n",'<br>',file_get_contents($changeLog));
8
+	$changeLog = MODX_BASE_PATH.'assets/docs/changelog.txt';
9
+	if (is_readable($changeLog))
10
+		echo str_replace("\n", '<br>', file_get_contents($changeLog));
11 11
 ?>
12 12
 </div>
13 13
\ No newline at end of file
Please login to merge, or discard this patch.
manager/actions/help/02Documentation.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-if(IN_MANAGER_MODE!="true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
2
+if (IN_MANAGER_MODE != "true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
3 3
 ?>
4 4
 
5 5
 <div class="sectionHeader"><?php echo $_lang['documentation']; ?></div><div class="sectionBody">
Please login to merge, or discard this patch.
manager/actions/help/03Version_Notices.php 1 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(IN_MANAGER_MODE!="true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
2
+if (IN_MANAGER_MODE != "true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
3 3
 
4 4
     if ($handle = opendir('actions/help/version_notices')) {
5 5
         while (false !== ($file = readdir($handle))) {
@@ -13,7 +13,7 @@  discard block
 block discarded – undo
13 13
     usort($notices, 'version_compare');
14 14
     $notices = array_reverse($notices);
15 15
     
16
-    foreach($notices as $v) {
16
+    foreach ($notices as $v) {
17 17
         if ($v >= '1.3.0') {
18 18
             $cms = 'EVO';
19 19
         }
Please login to merge, or discard this patch.
manager/actions/help/version_notices/1.3.4.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@
 block discarded – undo
1 1
 <?php
2
-if(IN_MANAGER_MODE!="true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
2
+if (IN_MANAGER_MODE != "true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
3 3
 ?>
4 4
 <p></p>
5 5
 <ul>
Please login to merge, or discard this patch.