Completed
Push — develop ( 80f130...524d8a )
by Maxim
08:25
created
manager/actions/mutate_settings/tab7_filebrowser_settings.inc.php 1 patch
Spacing   +64 added lines, -64 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"><?php echo $_lang['rb_title']?><br><small>[(use_browser)]</small></td>
8 8
     <td>
9
-        <?php echo wrap_label($_lang['yes'],form_radio('use_browser', 1, 'id="rbRowOn"'));?><br />
10
-        <?php echo wrap_label($_lang['no'], form_radio('use_browser', 0, 'id="rbRowOff"'));?>
9
+        <?php echo wrap_label($_lang['yes'], form_radio('use_browser', 1, 'id="rbRowOn"')); ?><br />
10
+        <?php echo wrap_label($_lang['no'], form_radio('use_browser', 0, 'id="rbRowOff"')); ?>
11 11
     </td>
12 12
   </tr>
13 13
   <tr>
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
     <td colspan="2"><div class="split"></div></td>
19 19
   </tr>
20 20
   
21
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
21
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
22 22
     <td nowrap class="warning"><?php echo $_lang['which_browser_default_title']?><br><small>[(which_browser)]</small></td>
23 23
     <td>
24 24
         <select name="which_browser" size="1" class="inputBox" onchange="documentDirty=true;">
@@ -27,125 +27,125 @@  discard block
 block discarded – undo
27 27
                 $dir = str_replace('\\', '/', $dir);
28 28
                 $browser_name = substr($dir, strrpos($dir, '/') + 1);
29 29
                 $selected = $browser_name == $which_browser ? ' selected="selected"' : '';
30
-                echo '<option value="' . $browser_name . '"' . $selected . '>' . "{$browser_name}</option>\n";
30
+                echo '<option value="'.$browser_name.'"'.$selected.'>'."{$browser_name}</option>\n";
31 31
             }
32 32
             ?>
33 33
         </select>
34 34
     </td>
35 35
   </tr>
36
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
36
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
37 37
     <td width="200">&nbsp;</td>
38 38
     <td class="comment"><?php echo $_lang['which_browser_default_msg']?></td>
39 39
   </tr>
40 40
   <tr>
41 41
     <td colspan="2"><div class="split"></div></td>
42 42
   </tr>
43
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
43
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
44 44
     <td nowrap class="warning"><?php echo $_lang['rb_webuser_title']?><br><small>[(rb_webuser)]</small></td>
45 45
     <td>
46
-      <label><input type="radio" name="rb_webuser" value="1" <?php echo $rb_webuser=='1' ? 'checked="checked"' : "" ; ?> />
46
+      <label><input type="radio" name="rb_webuser" value="1" <?php echo $rb_webuser == '1' ? 'checked="checked"' : ""; ?> />
47 47
       <?php echo $_lang['yes']?></label><br />
48
-      <label><input type="radio" name="rb_webuser" value="0" <?php echo $rb_webuser=='0' ? 'checked="checked"' : "" ; ?> />
48
+      <label><input type="radio" name="rb_webuser" value="0" <?php echo $rb_webuser == '0' ? 'checked="checked"' : ""; ?> />
49 49
       <?php echo $_lang['no']?></label>
50 50
     </td>
51 51
   </tr>
52
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
52
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
53 53
     <td width="200">&nbsp;</td>
54 54
     <td class="comment"><?php echo $_lang['rb_webuser_message']?></td>
55 55
   </tr>
56
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
56
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
57 57
     <td colspan="2"><div class="split"></div></td>
58 58
   </tr>
59
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
59
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
60 60
     <td nowrap class="warning"><?php echo $_lang['rb_base_dir_title']?><br><small>[(rb_base_dir)]</small></td>
61 61
     <td>
62 62
         <?php echo $_lang['default']; ?> <span id="default_rb_base_dir">[(base_path)]assets/</span><br />
63 63
         <input onchange="documentDirty=true;" type="text" maxlength="255" style="width: 250px;" name="rb_base_dir" id="rb_base_dir" value="<?php echo $rb_base_dir; ?>" /> <input type="button" onclick="reset_path('rb_base_dir');" value="<?php echo $_lang['reset']; ?>" name="reset_rb_base_dir">
64 64
     </td>
65 65
   </tr>
66
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
66
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
67 67
     <td width="200">&nbsp;</td>
68 68
     <td class="comment"><?php echo $_lang['rb_base_dir_message']?></td>
69 69
   </tr>
70
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
70
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
71 71
     <td colspan="2"><div class="split"></div></td>
72 72
   </tr>
73
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
73
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
74 74
     <td nowrap class="warning"><?php echo $_lang['rb_base_url_title']?><br><small>[(rb_base_url)]</small></td>
75 75
     <td>
76 76
       <input onchange="documentDirty=true;" type="text" maxlength="255" style="width: 250px;" name="rb_base_url" value="<?php echo $rb_base_url; ?>" />
77 77
       </td>
78 78
   </tr>
79
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
79
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
80 80
     <td width="200">&nbsp;</td>
81 81
     <td class="comment"><?php echo $_lang['rb_base_url_message']?></td>
82 82
   </tr>
83
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
83
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
84 84
     <td colspan="2"><div class="split"></div></td>
85 85
   </tr>
86
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
86
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
87 87
       <td nowrap class="warning"><?php echo $_lang['clean_uploaded_filename']?><br><small>[(clean_uploaded_filename)]</small></td>
88 88
       <td>
89
-        <label><input type="radio" name="clean_uploaded_filename" value="1" <?php echo $clean_uploaded_filename=='1' ? 'checked="checked"' : "" ; ?> />
89
+        <label><input type="radio" name="clean_uploaded_filename" value="1" <?php echo $clean_uploaded_filename == '1' ? 'checked="checked"' : ""; ?> />
90 90
         <?php echo $_lang['yes']?></label><br />
91
-        <label><input type="radio" name="clean_uploaded_filename" value="0" <?php echo $clean_uploaded_filename=='0' ? 'checked="checked"' : "" ; ?> />
91
+        <label><input type="radio" name="clean_uploaded_filename" value="0" <?php echo $clean_uploaded_filename == '0' ? 'checked="checked"' : ""; ?> />
92 92
         <?php echo $_lang['no']?></label>
93 93
       </td>
94 94
   </tr>
95
-    <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
95
+    <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
96 96
       <td width="200">&nbsp;</td>
97
-      <td class="comment"><?php echo $_lang['clean_uploaded_filename_message'];?></td>
97
+      <td class="comment"><?php echo $_lang['clean_uploaded_filename_message']; ?></td>
98 98
     </tr>
99
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
99
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
100 100
   <td colspan="2"><div class="split"></div></td>
101 101
   </tr>
102
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
102
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
103 103
     <td nowrap class="warning"><?php echo $_lang['settings_strip_image_paths_title']?><br><small>[(strip_image_paths)]</small></td>
104 104
     <td>
105
-      <label><input type="radio" name="strip_image_paths" value="1" <?php echo $strip_image_paths=='1' ? 'checked="checked"' : "" ; ?> />
105
+      <label><input type="radio" name="strip_image_paths" value="1" <?php echo $strip_image_paths == '1' ? 'checked="checked"' : ""; ?> />
106 106
       <?php echo $_lang['yes']?></label><br />
107
-      <label><input type="radio" name="strip_image_paths" value="0" <?php echo $strip_image_paths=='0' ? 'checked="checked"' : "" ; ?> />
107
+      <label><input type="radio" name="strip_image_paths" value="0" <?php echo $strip_image_paths == '0' ? 'checked="checked"' : ""; ?> />
108 108
       <?php echo $_lang['no']?></label>
109 109
     </td>
110 110
   </tr>
111
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
111
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
112 112
     <td width="200">&nbsp;</td>
113 113
     <td class="comment"><?php echo $_lang['settings_strip_image_paths_message']?></td>
114 114
   </tr>
115
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
115
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
116 116
     <td colspan="2"><div class="split"></div></td>
117 117
   </tr>
118
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
118
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
119 119
     <td nowrap class="warning"><?php echo $_lang['maxImageWidth']?><br><small>[(maxImageWidth)]</small></td>
120 120
     <td>
121 121
       <input onchange="documentDirty=true;" type="text" maxlength="4" style="width: 50px;" name="maxImageWidth" value="<?php echo $maxImageWidth; ?>" />
122 122
     </td>
123 123
   </tr>
124
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
124
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
125 125
     <td width="200">&nbsp;</td>
126 126
     <td class="comment"><?php echo $_lang['maxImageWidth_message']?></td>
127 127
   </tr>
128
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
128
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
129 129
     <td colspan="2"><div class="split"></div></td>
130 130
   </tr>
131
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
131
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
132 132
     <td nowrap class="warning"><?php echo $_lang['maxImageHeight']?><br><small>[(maxImageHeight)]</small></td>
133 133
     <td>
134 134
       <input onchange="documentDirty=true;" type="text" maxlength="4" style="width: 50px;" name="maxImageHeight" value="<?php echo $maxImageHeight; ?>" />
135 135
     </td>
136 136
   </tr>
137
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
137
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
138 138
     <td width="200">&nbsp;</td>
139 139
     <td class="comment"><?php echo $_lang['maxImageHeight_message']?></td>
140 140
   </tr>
141
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
141
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
142 142
     <td colspan="2"><div class="split"></div></td>
143 143
   </tr>
144
-    <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
144
+    <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
145 145
         <td nowrap class="warning"><?php echo $_lang['clientResize']?><br><small>[(clientResize)]</small></td>
146 146
         <td>
147
-            <?php echo wrap_label($_lang['yes'],form_radio('clientResize', 1, ''));?><br />
148
-            <?php echo wrap_label($_lang['no'], form_radio('clientResize', 0, ''));?>
147
+            <?php echo wrap_label($_lang['yes'], form_radio('clientResize', 1, '')); ?><br />
148
+            <?php echo wrap_label($_lang['no'], form_radio('clientResize', 0, '')); ?>
149 149
         </td>
150 150
     </tr>
151 151
     <tr>
@@ -155,11 +155,11 @@  discard block
 block discarded – undo
155 155
     <tr>
156 156
         <td colspan="2"><div class="split"></div></td>
157 157
     </tr>
158
-    <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
158
+    <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
159 159
         <td nowrap class="warning"><?php echo $_lang['noThumbnailsRecreation']?><br><small>[(noThumbnailsRecreation)]</small></td>
160 160
         <td>
161
-            <?php echo wrap_label($_lang['yes'],form_radio('noThumbnailsRecreation', 1, ''));?><br />
162
-            <?php echo wrap_label($_lang['no'], form_radio('noThumbnailsRecreation', 0, ''));?>
161
+            <?php echo wrap_label($_lang['yes'], form_radio('noThumbnailsRecreation', 1, '')); ?><br />
162
+            <?php echo wrap_label($_lang['no'], form_radio('noThumbnailsRecreation', 0, '')); ?>
163 163
         </td>
164 164
     </tr>
165 165
     <tr>
@@ -170,92 +170,92 @@  discard block
 block discarded – undo
170 170
         <td colspan="2"><div class="split"></div></td>
171 171
     </tr>
172 172
 
173
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
173
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
174 174
     <td nowrap class="warning"><?php echo $_lang['thumbWidth']?><br><small>[(thumbWidth)]</small></td>
175 175
     <td>
176 176
       <input onchange="documentDirty=true;" type="text" maxlength="4" style="width: 50px;" name="thumbWidth" value="<?php echo $thumbWidth; ?>" />
177 177
     </td>
178 178
   </tr>
179
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
179
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
180 180
     <td width="200">&nbsp;</td>
181 181
     <td class="comment"><?php echo $_lang['thumbWidth_message']?></td>
182 182
   </tr>
183
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
183
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
184 184
     <td colspan="2"><div class="split"></div></td>
185 185
   </tr>
186
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
186
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
187 187
     <td nowrap class="warning"><?php echo $_lang['thumbHeight']?><br><small>[(thumbHeight)]</small></td>
188 188
     <td>
189 189
       <input onchange="documentDirty=true;" type="text" maxlength="4" style="width: 50px;" name="thumbHeight" value="<?php echo $thumbHeight; ?>" />
190 190
     </td>
191 191
   </tr>
192
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
192
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
193 193
     <td width="200">&nbsp;</td>
194 194
     <td class="comment"><?php echo $_lang['thumbHeight_message']?></td>
195 195
   </tr>
196
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
196
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
197 197
     <td colspan="2"><div class="split"></div></td>
198 198
   </tr>
199
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
199
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
200 200
     <td nowrap class="warning"><?php echo $_lang['thumbsDir']?><br><small>[(thumbsDir)]</small></td>
201 201
     <td>
202 202
       <input onchange="documentDirty=true;" type="text" maxlength="255" style="width: 250px;" name="thumbsDir" value="<?php echo $thumbsDir; ?>" />
203 203
     </td>
204 204
   </tr>
205
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
205
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
206 206
     <td width="200">&nbsp;</td>
207 207
     <td class="comment"><?php echo $_lang['thumbsDir_message']?></td>
208 208
   </tr>
209
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
209
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
210 210
     <td colspan="2"><div class="split"></div></td>
211 211
   </tr>
212
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
212
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
213 213
     <td nowrap class="warning"><?php echo $_lang['jpegQuality']?><br><small>[(jpegQuality)]</small></td>
214 214
     <td>
215 215
       <input onchange="documentDirty=true;" type="text" maxlength="4" style="width: 50px;" name="jpegQuality" value="<?php echo $jpegQuality; ?>" />
216 216
     </td>
217 217
   </tr>
218
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
218
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
219 219
     <td width="200">&nbsp;</td>
220 220
     <td class="comment"><?php echo $_lang['jpegQuality_message']?></td>
221 221
   </tr>
222
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
222
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
223 223
     <td colspan="2"><div class="split"></div></td>
224 224
   </tr>
225
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
225
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
226 226
        <td nowrap class="warning"><?php echo $_lang['denyZipDownload'] ?><br><small>[(denyZipDownload)]</small></td>
227 227
         <td>
228
-          <label><input type="radio" name="denyZipDownload" value="0" <?php echo $denyZipDownload=='0' ? 'checked="checked"' : ""; ?> />
228
+          <label><input type="radio" name="denyZipDownload" value="0" <?php echo $denyZipDownload == '0' ? 'checked="checked"' : ""; ?> />
229 229
           <?php echo $_lang['no']?></label><br />
230
-          <label><input type="radio" name="denyZipDownload" value="1" <?php echo $denyZipDownload=='1' ? 'checked="checked"' : ""; ?> />
230
+          <label><input type="radio" name="denyZipDownload" value="1" <?php echo $denyZipDownload == '1' ? 'checked="checked"' : ""; ?> />
231 231
           <?php echo $_lang['yes']?></label>
232 232
         </td>
233 233
   </tr>
234
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
234
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
235 235
     <td colspan="2"><div class="split"></div></td>
236 236
   </tr>
237
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
237
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
238 238
         <td nowrap class="warning"><?php echo $_lang['denyExtensionRename'] ?><br><small>[(denyExtensionRename)]</small></td>
239 239
         <td>
240
-           <label><input type="radio" name="denyExtensionRename" value="0" <?php echo $denyExtensionRename=='0' ? 'checked="checked"' : ""; ?> />
240
+           <label><input type="radio" name="denyExtensionRename" value="0" <?php echo $denyExtensionRename == '0' ? 'checked="checked"' : ""; ?> />
241 241
            <?php echo $_lang['no']?></label><br />
242
-           <label><input type="radio" name="denyExtensionRename" value="1" <?php echo $denyExtensionRename=='1' ? 'checked="checked"' : ""; ?> />
242
+           <label><input type="radio" name="denyExtensionRename" value="1" <?php echo $denyExtensionRename == '1' ? 'checked="checked"' : ""; ?> />
243 243
            <?php echo $_lang['yes']?></label>
244 244
         </td>
245 245
   </tr>
246
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
246
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
247 247
     <td colspan="2"><div class="split"></div></td>
248 248
   </tr>
249
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
249
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
250 250
        <td nowrap class="warning"><?php echo $_lang['showHiddenFiles'] ?><br><small>[(showHiddenFiles)]</small></td>
251 251
        <td>
252
-         <label><input type="radio" name="showHiddenFiles" value="0" <?php echo $showHiddenFiles=='0' ? 'checked="checked"' : ""; ?> />
252
+         <label><input type="radio" name="showHiddenFiles" value="0" <?php echo $showHiddenFiles == '0' ? 'checked="checked"' : ""; ?> />
253 253
          <?php echo $_lang['no']?></label><br />
254
-         <label><input type="radio" name="showHiddenFiles" value="1" <?php echo $showHiddenFiles=='1' ? 'checked="checked"' : ""; ?> />
254
+         <label><input type="radio" name="showHiddenFiles" value="1" <?php echo $showHiddenFiles == '1' ? 'checked="checked"' : ""; ?> />
255 255
          <?php echo $_lang['yes']?></label>
256 256
         </td>
257 257
   </tr>
258
-  <tr class="rbRow" <?php echo showHide($use_browser==1);?>>
258
+  <tr class="rbRow" <?php echo showHide($use_browser == 1); ?>>
259 259
     <td colspan="2"><div class="split"></div></td>
260 260
   </tr>
261 261
   
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
         <?php
265 265
             // invoke OnMiscSettingsRender event
266 266
             $evtOut = $modx->invokeEvent('OnMiscSettingsRender');
267
-            if(is_array($evtOut)) echo implode("",$evtOut);
267
+            if (is_array($evtOut)) echo implode("", $evtOut);
268 268
         ?>
269 269
     </td>
270 270
   </tr>
Please login to merge, or discard this patch.
manager/media/browser/mcpuk/config.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
     'assetsURL'           => rtrim($modx->config['rb_base_url'], '/'),
30 30
     'dirPerms'            => intval($modx->config['new_folder_permissions'], 8),
31 31
     'filePerms'           => intval($modx->config['new_file_permissions'], 8),
32
-    'maxfilesize'         => (int)$modx->config['upload_maxsize'],
32
+    'maxfilesize'         => (int) $modx->config['upload_maxsize'],
33 33
     'noThumbnailsRecreation' => $modx->config['noThumbnailsRecreation'],
34 34
 
35 35
     'access' => array(
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
 
89 89
     // THE FOLLOWING SETTINGS CANNOT BE OVERRIDED WITH SESSION CONFIGURATION
90 90
     '_check4htaccess' => false,
91
-    '_tinyMCEPath'    => MODX_BASE_URL . "assets/plugins/tinymce/tiny_mce",
91
+    '_tinyMCEPath'    => MODX_BASE_URL."assets/plugins/tinymce/tiny_mce",
92 92
 
93 93
     '_sessionVar' => &$_SESSION['KCFINDER'],
94 94
     //'_sessionLifetime' => 30,
Please login to merge, or discard this patch.
manager/media/browser/mcpuk/core/autoload.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -26,19 +26,19 @@  discard block
 block discarded – undo
26 26
 if (empty ($modx->config)) {
27 27
     $modx->getSettings();
28 28
 }
29
-if(!isset($_SESSION['mgrValidated'])) {
29
+if (!isset($_SESSION['mgrValidated'])) {
30 30
         die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
31 31
 }
32 32
 $manager_language = $modx->config['manager_language'];
33 33
 // Pass language code from MODX to KCFinder
34
-if(!file_exists("../../../includes/lang/".$manager_language.".inc.php")) {
34
+if (!file_exists("../../../includes/lang/".$manager_language.".inc.php")) {
35 35
     $manager_language = "english"; // if not set, get the english language file.
36 36
 }
37 37
 include_once "../../../includes/lang/".$manager_language.".inc.php";
38 38
 $_GET['langCode'] = $modx_lang_attribute;
39 39
 
40 40
 // MAGIC AUTOLOAD CLASSES FUNCTION
41
-function autoloadda9d06472ccb71b84928677ce2a6ca89($class) {
41
+function autoloadda9d06472ccb71b84928677ce2a6ca89($class){
42 42
     static $classes = null;
43 43
     if ($classes === null) {
44 44
         $classes = array(
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
         );
63 63
     }
64 64
     if (isset($classes[$class])) {
65
-        require dirname(__FILE__) . $classes[$class];
65
+        require dirname(__FILE__).$classes[$class];
66 66
     }
67 67
 }
68 68
 spl_autoload_register('autoloadda9d06472ccb71b84928677ce2a6ca89', true);
Please login to merge, or discard this patch.
manager/media/browser/mcpuk/core/uploader.php 1 patch
Spacing   +41 added lines, -42 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
   *      @link http://kcfinder.sunhater.com
13 13
   */
14 14
 
15
-class uploader {
15
+class uploader{
16 16
 
17 17
 /** Release version */
18 18
     const VERSION = "2.54";
@@ -72,8 +72,8 @@  discard block
 block discarded – undo
72 72
 
73 73
 /** Next three properties are got from the current language file
74 74
   * @var string */
75
-    protected $dateTimeFull;   // Currently not used
76
-    protected $dateTimeMid;    // Currently not used
75
+    protected $dateTimeFull; // Currently not used
76
+    protected $dateTimeMid; // Currently not used
77 77
     protected $dateTimeSmall;
78 78
 
79 79
 /** Contain Specified language labels
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
 /** Magic method which allows read-only access to protected or private class properties
105 105
   * @param string $property
106 106
   * @return mixed */
107
-    public function __get($property) {
107
+    public function __get($property){
108 108
         return property_exists($this, $property) ? $this->$property : null;
109 109
     }
110 110
 
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
      * uploader constructor.
113 113
      * @param DocumentParser $modx
114 114
      */
115
-    public function __construct(DocumentParser $modx) {
115
+    public function __construct(DocumentParser $modx){
116 116
 
117 117
         //MODX
118 118
         try {
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
 
196 196
         // COOKIES INIT
197 197
         $ip = '(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)';
198
-        $ip = '/^' . implode('\.', array($ip, $ip, $ip, $ip)) . '$/';
198
+        $ip = '/^'.implode('\.', array($ip, $ip, $ip, $ip)).'$/';
199 199
         if (preg_match($ip, $_SERVER['HTTP_HOST']) ||
200 200
             preg_match('/^[^\.]+$/', $_SERVER['HTTP_HOST'])
201 201
         )
@@ -213,7 +213,7 @@  discard block
 block discarded – undo
213 213
         ) {
214 214
             list($unused, $protocol, $domain, $unused, $port, $path) = $patt;
215 215
             $path = path::normalize($path);
216
-            $this->config['uploadURL'] = "$protocol://$domain" . (strlen($port) ? ":$port" : "") . "/$path";
216
+            $this->config['uploadURL'] = "$protocol://$domain".(strlen($port) ? ":$port" : "")."/$path";
217 217
             $this->config['uploadDir'] = strlen($this->config['uploadDir'])
218 218
                 ? path::normalize($this->config['uploadDir'])
219 219
                 : path::url2fullPath("/$path");
@@ -256,7 +256,7 @@  discard block
 block discarded – undo
256 256
         foreach ($this->langInputNames as $key)
257 257
             if (isset($this->get[$key]) &&
258 258
                 preg_match('/^[a-z][a-z\._\-]*$/i', $this->get[$key]) &&
259
-                file_exists("lang/" . strtolower($this->get[$key]) . ".php")
259
+                file_exists("lang/".strtolower($this->get[$key]).".php")
260 260
             ) {
261 261
                 $this->lang = $this->get[$key];
262 262
                 break;
@@ -290,12 +290,12 @@  discard block
 block discarded – undo
290 290
     /**
291 291
      * @return array|bool|int|null|string|void
292 292
      */
293
-    protected function getTransaliasSettings() {
293
+    protected function getTransaliasSettings(){
294 294
 		$modx = evolutionCMS();
295 295
 
296 296
 		// Cleaning uploaded filename?
297 297
 		$setting = $modx->getDatabase()->select('count(*)', $modx->getDatabase()->getFullTableName('system_settings'), 'setting_name="clean_uploaded_filename" AND setting_value=1');
298
-		if ($modx->getDatabase()->getValue($setting)>0) {
298
+		if ($modx->getDatabase()->getValue($setting) > 0) {
299 299
 			// Transalias plugin active?
300 300
 			$res = $modx->getDatabase()->select('properties', $modx->getDatabase()->getFullTableName('site_plugins'), 'name="TransAlias" AND disabled=0');
301 301
 			if ($properties = $modx->getDatabase()->getValue($res)) {
@@ -314,7 +314,7 @@  discard block
 block discarded – undo
314 314
      * @param $filename
315 315
      * @return mixed|string
316 316
      */
317
-    protected function normalizeFilename($filename) {
317
+    protected function normalizeFilename($filename){
318 318
 		if ($this->getTransaliasSettings()) {
319 319
         		$format = strrchr($filename, ".");
320 320
         		$filename = str_replace($format, "", $filename);
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
      * @param $dirname
328 328
      * @return string
329 329
      */
330
-    protected function normalizeDirname($dirname) {
330
+    protected function normalizeDirname($dirname){
331 331
         return $this->modx->stripAlias($dirname);
332 332
     }
333 333
 
@@ -335,7 +335,7 @@  discard block
 block discarded – undo
335 335
      * @param array|null $aFile
336 336
      * @return bool|mixed
337 337
      */
338
-    protected function checkUploadedFile(array $aFile=null) {
338
+    protected function checkUploadedFile(array $aFile = null){
339 339
         $config = &$this->config;
340 340
         $file = ($aFile === null) ? $this->file : $aFile;
341 341
 
@@ -361,8 +361,7 @@  discard block
 block discarded – undo
361 361
                 ($file['error'] == UPLOAD_ERR_NO_TMP_DIR) ?
362 362
                     $this->label("Missing a temporary folder.") : (
363 363
                 ($file['error'] == UPLOAD_ERR_CANT_WRITE) ?
364
-                    $this->label("Failed to write file.") :
365
-                    $this->label("Unknown error.")
364
+                    $this->label("Failed to write file.") : $this->label("Unknown error.")
366 365
             )))));
367 366
 
368 367
         // HIDDEN FILENAMES CHECK
@@ -397,7 +396,7 @@  discard block
 block discarded – undo
397 396
 
398 397
 
399 398
 	// CHECK FOR MODX MAX FILE SIZE
400
-	$actualfilesize=filesize($file['tmp_name']);
399
+	$actualfilesize = filesize($file['tmp_name']);
401 400
 	if (isset($this->config['maxfilesize']) && $actualfilesize > $this->config['maxfilesize'])
402 401
 	    return $this->label("File is too big: ".$actualfilesize." Bytes. (max ".$this->config['maxfilesize']." Bytes)");
403 402
 
@@ -410,7 +409,7 @@  discard block
 block discarded – undo
410 409
      * @param bool $existing
411 410
      * @return bool|string
412 411
      */
413
-    protected function checkInputDir($dir, $inclType=true, $existing=true) {
412
+    protected function checkInputDir($dir, $inclType = true, $existing = true){
414 413
         $dir = path::normalize($dir);
415 414
         if (substr($dir, 0, 1) == "/")
416 415
             $dir = substr($dir, 1);
@@ -441,7 +440,7 @@  discard block
 block discarded – undo
441 440
      * @param $type
442 441
      * @return bool
443 442
      */
444
-    protected function validateExtension($ext, $type) {
443
+    protected function validateExtension($ext, $type){
445 444
         $ext = trim(strtolower($ext));
446 445
         if (!isset($this->types[$type]))
447 446
             return false;
@@ -470,7 +469,7 @@  discard block
 block discarded – undo
470 469
      * @param $path
471 470
      * @return mixed
472 471
      */
473
-    protected function getTypeFromPath($path) {
472
+    protected function getTypeFromPath($path){
474 473
         return preg_match('/^([^\/]*)\/.*$/', $path, $patt)
475 474
             ? $patt[1] : $path;
476 475
     }
@@ -479,7 +478,7 @@  discard block
 block discarded – undo
479 478
      * @param $path
480 479
      * @return string
481 480
      */
482
-    protected function removeTypeFromPath($path) {
481
+    protected function removeTypeFromPath($path){
483 482
         return preg_match('/^[^\/]*\/(.*)$/', $path, $patt)
484 483
             ? $patt[1] : "";
485 484
     }
@@ -489,7 +488,7 @@  discard block
 block discarded – undo
489 488
      * @param null $file
490 489
      * @return bool
491 490
      */
492
-    protected function imageResize($image, $file=null) {
491
+    protected function imageResize($image, $file = null){
493 492
 
494 493
         if (!($image instanceof image)) {
495 494
             $img = image::factory($this->imageDriver, $image);
@@ -577,19 +576,19 @@  discard block
 block discarded – undo
577 576
             $img->watermark($this->config['watermark']['file'], $left, $top);
578 577
 		}
579 578
 
580
-        $options = array( 'file' => $file );
579
+        $options = array('file' => $file);
581 580
 
582
-        $type = exif_imagetype( $file );
581
+        $type = exif_imagetype($file);
583 582
 
584
-        switch ( $type ) {
583
+        switch ($type) {
585 584
             case IMAGETYPE_GIF:
586
-                return $img->output( 'gif', $options );
585
+                return $img->output('gif', $options);
587 586
 
588 587
             case IMAGETYPE_PNG:
589
-                return $img->output( 'png', $options );
588
+                return $img->output('png', $options);
590 589
 
591 590
             default:
592
-                return $img->output( 'jpeg', array_merge( $options, array( 'quality' => $this->config['jpegQuality'] ) ) );
591
+                return $img->output('jpeg', array_merge($options, array('quality' => $this->config['jpegQuality'])));
593 592
         }
594 593
 
595 594
     }
@@ -599,7 +598,7 @@  discard block
 block discarded – undo
599 598
      * @param bool $overwrite
600 599
      * @return bool
601 600
      */
602
-    protected function makeThumb($file, $overwrite=true) {
601
+    protected function makeThumb($file, $overwrite = true){
603 602
         $img = image::factory($this->imageDriver, $file);
604 603
 
605 604
         // Drop files which are not images
@@ -607,7 +606,7 @@  discard block
 block discarded – undo
607 606
             return true;
608 607
 
609 608
         $thumb = substr($file, strlen($this->config['uploadDir']));
610
-        $thumb = $this->config['uploadDir'] . "/" . $this->config['thumbsDir'] . "/" . $thumb;
609
+        $thumb = $this->config['uploadDir']."/".$this->config['thumbsDir']."/".$thumb;
611 610
         $thumb = path::normalize($thumb);
612 611
         $thumbDir = dirname($thumb);
613 612
         if (!is_dir($thumbDir) && !@mkdir($thumbDir, $this->config['dirPerms'], true))
@@ -630,15 +629,15 @@  discard block
 block discarded – undo
630 629
         if (!$img->resizeFit($this->config['thumbWidth'], $this->config['thumbHeight']))
631 630
             return false;
632 631
 
633
-        if ( $this->imageDriver == 'gd' ) {
634
-            $width  = imagesx( $img->image );
635
-            $height = imagesy( $img->image );
636
-            $back   = image::factory( $this->imageDriver, array( $width, $height ) );
637
-            $tile   = image::factory( $this->imageDriver, __DIR__ . '/../themes/' . $this->config['theme'] . '/img/bg_transparent.png' );
632
+        if ($this->imageDriver == 'gd') {
633
+            $width  = imagesx($img->image);
634
+            $height = imagesy($img->image);
635
+            $back   = image::factory($this->imageDriver, array($width, $height));
636
+            $tile   = image::factory($this->imageDriver, __DIR__.'/../themes/'.$this->config['theme'].'/img/bg_transparent.png');
638 637
 
639
-            imagesettile( $back->image, $tile->image );
640
-            imagefilledrectangle( $back->image, 0, 0, $width, $height, IMG_COLOR_TILED );
641
-            imagecopy( $back->image, $img->image, 0, 0, 0, 0, $width, $height );
638
+            imagesettile($back->image, $tile->image);
639
+            imagefilledrectangle($back->image, 0, 0, $width, $height, IMG_COLOR_TILED);
640
+            imagecopy($back->image, $img->image, 0, 0, 0, 0, $width, $height);
642 641
 
643 642
             $img = $back;
644 643
         }
@@ -653,7 +652,7 @@  discard block
 block discarded – undo
653 652
     /**
654 653
      * @param $langCode
655 654
      */
656
-    protected function localize($langCode) {
655
+    protected function localize($langCode){
657 656
         require "lang/{$langCode}.php";
658 657
         setlocale(LC_ALL, $lang['_locale']);
659 658
         $this->charset = $lang['_charset'];
@@ -673,7 +672,7 @@  discard block
 block discarded – undo
673 672
      * @param array|null $data
674 673
      * @return mixed
675 674
      */
676
-    protected function label($string, array $data=null) {
675
+    protected function label($string, array $data = null){
677 676
         $return = isset($this->labels[$string]) ? $this->labels[$string] : $string;
678 677
         if (is_array($data))
679 678
             foreach ($data as $key => $val)
@@ -685,7 +684,7 @@  discard block
 block discarded – undo
685 684
      * @param $message
686 685
      * @param array|null $data
687 686
      */
688
-    protected function backMsg($message, array $data=null) {
687
+    protected function backMsg($message, array $data = null){
689 688
         $message = $this->label($message, $data);
690 689
         if (isset($this->file['tmp_name']) && file_exists($this->file['tmp_name']))
691 690
             @unlink($this->file['tmp_name']);
@@ -697,7 +696,7 @@  discard block
 block discarded – undo
697 696
      * @param $url
698 697
      * @param string $message
699 698
      */
700
-    protected function callBack($url, $message="") {
699
+    protected function callBack($url, $message = ""){
701 700
         $message = text::jsValue($message);
702 701
         $CKfuncNum = isset($this->opener['CKEditor']['funcNum'])
703 702
             ? $this->opener['CKEditor']['funcNum'] : 0;
@@ -741,7 +740,7 @@  discard block
 block discarded – undo
741 740
     /**
742 741
      * @return string
743 742
      */
744
-    protected function get_htaccess() {
743
+    protected function get_htaccess(){
745 744
         return "<IfModule mod_php4.c>
746 745
   php_value engine off
747 746
 </IfModule>
Please login to merge, or discard this patch.
manager/media/browser/mcpuk/core/browser.php 1 patch
Spacing   +32 added lines, -32 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
             $this->get['dir'] = $dir;
43 43
         }
44 44
 
45
-        $thumbsDir = $this->config['uploadDir'] . "/" . $this->config['thumbsDir'];
45
+        $thumbsDir = $this->config['uploadDir']."/".$this->config['thumbsDir'];
46 46
         if ((
47 47
                 !is_dir($thumbsDir) &&
48 48
                 !@mkdir($thumbsDir, $this->config['dirPerms'])
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
             $this->session['dir'] = $this->type;
115 115
         } else {
116 116
             $type = $this->getTypeFromPath($this->session['dir']);
117
-            $dir = $this->config['uploadDir'] . "/" . $this->session['dir'];
117
+            $dir = $this->config['uploadDir']."/".$this->session['dir'];
118 118
             if (($type != $this->type) || !is_dir($dir) || !is_readable($dir)) {
119 119
                 $this->session['dir'] = $this->type;
120 120
             }
@@ -188,7 +188,7 @@  discard block
 block discarded – undo
188 188
         }
189 189
         $file = "{$this->thumbsDir}/{$this->type}/{$this->get['dir']}/$file";
190 190
         if (!is_file($file) || !is_readable($file)) {
191
-            $file = "{$this->config['uploadDir']}/{$this->type}/{$this->get['dir']}/" . basename($file);
191
+            $file = "{$this->config['uploadDir']}/{$this->type}/{$this->get['dir']}/".basename($file);
192 192
             if (!is_file($file) || !is_readable($file)) {
193 193
                 $this->sendDefaultThumb($file);
194 194
             }
@@ -227,7 +227,7 @@  discard block
 block discarded – undo
227 227
     protected function act_chDir()
228 228
     {
229 229
         $this->postDir(); // Just for existing check
230
-        $this->session['dir'] = $this->type . "/" . $this->post['dir'];
230
+        $this->session['dir'] = $this->type."/".$this->post['dir'];
231 231
         $dirWritable = dir::isWritable("{$this->config['uploadDir']}/{$this->session['dir']}");
232 232
 
233 233
         return json_encode(array(
@@ -292,12 +292,12 @@  discard block
 block discarded – undo
292 292
         if (substr($newName, 0, 1) == ".") {
293 293
             $this->errorMsg("Folder name shouldn't begins with '.'");
294 294
         }
295
-        if (!@rename($dir, dirname($dir) . "/$newName")) {
295
+        if (!@rename($dir, dirname($dir)."/$newName")) {
296 296
             $this->errorMsg("Cannot rename the folder.");
297 297
         }
298 298
         $thumbDir = "$this->thumbsTypeDir/{$this->post['dir']}";
299 299
         if (is_dir($thumbDir)) {
300
-            @rename($thumbDir, dirname($thumbDir) . "/$newName");
300
+            @rename($thumbDir, dirname($thumbDir)."/$newName");
301 301
         }
302 302
 
303 303
         return json_encode(array('name' => $newName));
@@ -375,9 +375,9 @@  discard block
 block discarded – undo
375 375
         header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
376 376
         header("Cache-Control: private", false);
377 377
         header("Content-Type: application/octet-stream");
378
-        header('Content-Disposition: attachment; filename="' . str_replace('"', "_", $this->post['file']) . '"');
378
+        header('Content-Disposition: attachment; filename="'.str_replace('"', "_", $this->post['file']).'"');
379 379
         header("Content-Transfer-Encoding:­ binary");
380
-        header("Content-Length: " . filesize($file));
380
+        header("Content-Length: ".filesize($file));
381 381
         readfile($file);
382 382
         die;
383 383
     }
@@ -434,7 +434,7 @@  discard block
 block discarded – undo
434 434
         $thumbFile = "$thumbDir/{$this->post['file']}";
435 435
 
436 436
         if (file_exists($thumbFile)) {
437
-            @rename($thumbFile, "$thumbDir/" . basename($newName));
437
+            @rename($thumbFile, "$thumbDir/".basename($newName));
438 438
         }
439 439
 
440 440
         return true;
@@ -514,11 +514,11 @@  discard block
 block discarded – undo
514 514
             if (!file_exists($path)) {
515 515
                 $error[] = $this->label("The file '{file}' does not exist.", $replace);
516 516
             } elseif (substr($base, 0, 1) == ".") {
517
-                $error[] = "$base: " . $this->label("File name shouldn't begins with '.'");
517
+                $error[] = "$base: ".$this->label("File name shouldn't begins with '.'");
518 518
             } elseif (!$this->validateExtension($ext, $type)) {
519
-                $error[] = "$base: " . $this->label("Denied file extension.");
519
+                $error[] = "$base: ".$this->label("Denied file extension.");
520 520
             } elseif (file_exists("$dir/$base")) {
521
-                $error[] = "$base: " . $this->label("A file or folder with that name already exists.");
521
+                $error[] = "$base: ".$this->label("A file or folder with that name already exists.");
522 522
             } elseif (!is_readable($path) || !is_file($path)) {
523 523
                 $error[] = $this->label("Cannot read '{file}'.", $replace);
524 524
             } elseif (!@copy($path, "$dir/$base")) {
@@ -578,11 +578,11 @@  discard block
 block discarded – undo
578 578
             if (!file_exists($path)) {
579 579
                 $error[] = $this->label("The file '{file}' does not exist.", $replace);
580 580
             } elseif (substr($base, 0, 1) == ".") {
581
-                $error[] = "$base: " . $this->label("File name shouldn't begins with '.'");
581
+                $error[] = "$base: ".$this->label("File name shouldn't begins with '.'");
582 582
             } elseif (!$this->validateExtension($ext, $type)) {
583
-                $error[] = "$base: " . $this->label("Denied file extension.");
583
+                $error[] = "$base: ".$this->label("Denied file extension.");
584 584
             } elseif (file_exists("$dir/$base")) {
585
-                $error[] = "$base: " . $this->label("A file or folder with that name already exists.");
585
+                $error[] = "$base: ".$this->label("A file or folder with that name already exists.");
586 586
             } elseif (!is_readable($path) || !is_file($path)) {
587 587
                 $error[] = $this->label("Cannot read '{file}'.", $replace);
588 588
             } elseif (!file::isWritable($path) || !@rename($path, "$dir/$base")) {
@@ -635,7 +635,7 @@  discard block
 block discarded – undo
635 635
             }
636 636
             $path = "{$this->config['uploadDir']}/$file";
637 637
             $base = basename($file);
638
-            $filepath = str_replace('/' . $base, '', $path);
638
+            $filepath = str_replace('/'.$base, '', $path);
639 639
             $replace = array('file' => $base);
640 640
             if (!is_file($path)) {
641 641
                 $error[] = $this->label("The file '{file}' does not exist.", $replace);
@@ -681,15 +681,15 @@  discard block
 block discarded – undo
681 681
         if (!isset($this->post['dir']) || $this->config['denyZipDownload']) {
682 682
             $this->errorMsg("Unknown error.");
683 683
         }
684
-        $filename = basename($dir) . ".zip";
684
+        $filename = basename($dir).".zip";
685 685
         do {
686
-            $file = md5(time() . session_id());
686
+            $file = md5(time().session_id());
687 687
             $file = "{$this->config['uploadDir']}/$file.zip";
688 688
         } while (file_exists($file));
689 689
         new zipFolder($file, $dir);
690 690
         header("Content-Type: application/x-zip");
691
-        header('Content-Disposition: attachment; filename="' . str_replace('"', "_", $filename) . '"');
692
-        header("Content-Length: " . filesize($file));
691
+        header('Content-Disposition: attachment; filename="'.str_replace('"', "_", $filename).'"');
692
+        header("Content-Length: ".filesize($file));
693 693
         readfile($file);
694 694
         unlink($file);
695 695
         die;
@@ -723,7 +723,7 @@  discard block
 block discarded – undo
723 723
         }
724 724
 
725 725
         do {
726
-            $file = md5(time() . session_id());
726
+            $file = md5(time().session_id());
727 727
             $file = "{$this->config['uploadDir']}/$file.zip";
728 728
         } while (file_exists($file));
729 729
 
@@ -736,8 +736,8 @@  discard block
 block discarded – undo
736 736
             $zip->close();
737 737
         }
738 738
         header("Content-Type: application/x-zip");
739
-        header('Content-Disposition: attachment; filename="selected_files_' . basename($file) . '"');
740
-        header("Content-Length: " . filesize($file));
739
+        header('Content-Disposition: attachment; filename="selected_files_'.basename($file).'"');
740
+        header("Content-Length: ".filesize($file));
741 741
         readfile($file);
742 742
         unlink($file);
743 743
         die;
@@ -766,7 +766,7 @@  discard block
 block discarded – undo
766 766
             if ($type != $this->type) {
767 767
                 continue;
768 768
             }
769
-            $file = $this->config['uploadDir'] . "/$file";
769
+            $file = $this->config['uploadDir']."/$file";
770 770
             if (!is_file($file) || !is_readable($file)) {
771 771
                 continue;
772 772
             }
@@ -774,7 +774,7 @@  discard block
 block discarded – undo
774 774
         }
775 775
 
776 776
         do {
777
-            $file = md5(time() . session_id());
777
+            $file = md5(time().session_id());
778 778
             $file = "{$this->config['uploadDir']}/$file.zip";
779 779
         } while (file_exists($file));
780 780
 
@@ -787,8 +787,8 @@  discard block
 block discarded – undo
787 787
             $zip->close();
788 788
         }
789 789
         header("Content-Type: application/x-zip");
790
-        header('Content-Disposition: attachment; filename="clipboard_' . basename($file) . '"');
791
-        header("Content-Length: " . filesize($file));
790
+        header('Content-Disposition: attachment; filename="clipboard_'.basename($file).'"');
791
+        header("Content-Length: ".filesize($file));
792 792
         readfile($file);
793 793
         unlink($file);
794 794
         die;
@@ -824,7 +824,7 @@  discard block
 block discarded – undo
824 824
             return $response;
825 825
         }
826 826
         $filename = $this->normalizeFilename($file['name']);
827
-        $target = "$dir/" . file::getInexistantFilename($filename, $dir);
827
+        $target = "$dir/".file::getInexistantFilename($filename, $dir);
828 828
 
829 829
         if (!@move_uploaded_file($file['tmp_name'], $target) &&
830 830
             !@rename($file['tmp_name'], $target) &&
@@ -890,7 +890,7 @@  discard block
 block discarded – undo
890 890
                 if (is_array($size) && count($size)) {
891 891
                     $preview = true;
892 892
                     if (!$this->config['noThumbnailsRecreation']) {
893
-                        $thumb_file = "$thumbDir/" . basename($file);
893
+                        $thumb_file = "$thumbDir/".basename($file);
894 894
                         if (!is_file($thumb_file) || filemtime($file) > filemtime($thumb_file)) {
895 895
                             $this->makeThumb($file);
896 896
                         }
@@ -907,7 +907,7 @@  discard block
 block discarded – undo
907 907
             }
908 908
             $name = basename($file);
909 909
             $types = $this->config['types'];
910
-            $types = explode(' ', $types['images'] . ' ' . $types['image']);
910
+            $types = explode(' ', $types['images'].' '.$types['image']);
911 911
             if (substr($name, 0, 1) == '.' && !$this->config['showHiddenFiles']) {
912 912
                 continue;
913 913
             }
@@ -987,7 +987,7 @@  discard block
 block discarded – undo
987 987
     {
988 988
         $dir = $this->typeDir;
989 989
         if (isset($this->post['dir'])) {
990
-            $dir .= "/" . $this->post['dir'];
990
+            $dir .= "/".$this->post['dir'];
991 991
         }
992 992
         if ($existent && (!is_dir($dir) || !is_readable($dir))) {
993 993
             $this->errorMsg("Inexistant or inaccessible folder.");
@@ -1004,7 +1004,7 @@  discard block
 block discarded – undo
1004 1004
     {
1005 1005
         $dir = $this->typeDir;
1006 1006
         if (isset($this->get['dir'])) {
1007
-            $dir .= "/" . $this->get['dir'];
1007
+            $dir .= "/".$this->get['dir'];
1008 1008
         }
1009 1009
         if ($existent && (!is_dir($dir) || !is_readable($dir))) {
1010 1010
             $this->errorMsg("Inexistant or inaccessible folder.");
Please login to merge, or discard this patch.
manager/media/browser/mcpuk/lib/class_image.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -12,7 +12,7 @@  discard block
 block discarded – undo
12 12
   *      @link http://kcfinder.sunhater.com
13 13
   */
14 14
 
15
-abstract class image {
15
+abstract class image{
16 16
     const DEFAULT_JPEG_QUALITY = 75;
17 17
 
18 18
 /** Image resource or object
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
   * @param string $property
42 42
   * @return mixed */
43 43
 
44
-    final public function __get($property) {
44
+    final public function __get($property){
45 45
         return property_exists($this, $property) ? $this->$property : null;
46 46
     }
47 47
 
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
   * @param mixed $image
58 58
   * @param array $options */
59 59
 
60
-    public function __construct($image, array $options=array()) {
60
+    public function __construct($image, array $options = array()){
61 61
         $this->image = $this->width = $this->height = null;
62 62
         $imageDetails = $this->buildImage($image);
63 63
 
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
   * @param mixed $image
76 76
   * @return object */
77 77
 
78
-    final static function factory($driver, $image, array $options=array()) {
78
+    final static function factory($driver, $image, array $options = array()){
79 79
         $class = "image_$driver";
80 80
         return new $class($image, $options);
81 81
     }
@@ -86,7 +86,7 @@  discard block
 block discarded – undo
86 86
   * @param array $drivers
87 87
   * @return string */
88 88
 
89
-    final static function getDriver(array $drivers=array('gd')) {
89
+    final static function getDriver(array $drivers = array('gd')){
90 90
         foreach ($drivers as $driver) {
91 91
             if (!preg_match('/^[a-z0-9\_]+$/i', $driver))
92 92
                 continue;
@@ -105,7 +105,7 @@  discard block
 block discarded – undo
105 105
   * @param mixed $image
106 106
   * @return array */
107 107
 
108
-    final protected function buildImage($image) {
108
+    final protected function buildImage($image){
109 109
         $class = get_class($this);
110 110
         if ($image instanceof $class) {
111 111
             $width = $image->width;
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
   * @param integer $resizedHeight
130 130
   * @return integer */
131 131
 
132
-    final public function getPropWidth($resizedHeight) {
132
+    final public function getPropWidth($resizedHeight){
133 133
         $width = round(($this->width * $resizedHeight) / $this->height);
134 134
         if (!$width) $width = 1;
135 135
         return $width;
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
   * @param integer $resizedWidth
141 141
   * @return integer */
142 142
 
143
-    final public function getPropHeight($resizedWidth) {
143
+    final public function getPropHeight($resizedWidth){
144 144
         $height = round(($this->height * $resizedWidth) / $this->width);
145 145
         if (!$height) $height = 1;
146 146
         return $height;
@@ -151,13 +151,13 @@  discard block
 block discarded – undo
151 151
   * static method should be implemented into driver classes like abstract
152 152
   * methods
153 153
   * @return bool */
154
-    static function available() { return false; }
154
+    static function available(){ return false; }
155 155
 
156 156
 /** Checks if file is an image. This static method should be implemented into
157 157
   * driver classes like abstract methods
158 158
   * @param string $file
159 159
   * @return bool */
160
-    static function checkImage($file) { return false; }
160
+    static function checkImage($file){ return false; }
161 161
 
162 162
 /** Resize image. Should return TRUE on success or FALSE on failure
163 163
   * @param integer $width
@@ -173,21 +173,21 @@  discard block
 block discarded – undo
173 173
   * @param integer $height
174 174
   * @param mixed $background
175 175
   * @return bool */
176
-    abstract public function resizeFit($width, $height, $background=false);
176
+    abstract public function resizeFit($width, $height, $background = false);
177 177
 
178 178
 /** Resize and crop the image to fit in given resolution. Returns TRUE on
179 179
   * success or FALSE on failure
180 180
   * @param mixed $src
181 181
   * @param integer $offset
182 182
   * @return bool */
183
-    abstract public function resizeCrop($width, $height, $offset=false);
183
+    abstract public function resizeCrop($width, $height, $offset = false);
184 184
 
185 185
 
186 186
 /** Rotate image
187 187
   * @param integer $angle
188 188
   * @param string $background
189 189
   * @return bool */
190
-    abstract public function rotate($angle, $background="#000000");
190
+    abstract public function rotate($angle, $background = "#000000");
191 191
 
192 192
     abstract public function flipHorizontal();
193 193
 
@@ -203,7 +203,7 @@  discard block
 block discarded – undo
203 203
   * @param mixed $top
204 204
   * @param mixed $left
205 205
   * @return bool */
206
-    abstract public function watermark($file, $left=false, $top=false);
206
+    abstract public function watermark($file, $left = false, $top = false);
207 207
 
208 208
 /** Should output the image. Second parameter is used to pass some options like
209 209
   *   'file' - if is set, the output will be written to a file
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
   * @param string $type
213 213
   * @param array $options
214 214
   * @return bool */
215
-    abstract public function output($type='jpeg', array $options=array());
215
+    abstract public function output($type = 'jpeg', array $options = array());
216 216
 
217 217
 /** This method should create a blank image with selected size. Should returns
218 218
   * resource or object related to the created image, which will be passed to
Please login to merge, or discard this patch.