GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — 2.8 ( 757b80...f8dd9b )
by Thorsten
86:54 queued 69:27
created
phpmyfaq/admin/editor/plugins/ajaxfilemanager/ajaxfilemanager.php 3 patches
Indentation   +117 added lines, -117 removed lines patch added patch discarded remove patch
@@ -1,57 +1,57 @@  discard block
 block discarded – undo
1 1
 <?php
2
-	/**
3
-	 * file manager platform
4
-	 * @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
5
-	 * @link www.phpletter.com
6
-	 * @since 22/May/2007
7
-	 *
8
-	 */
9
-	require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php");
10
-	$session->gc();
11
-	require_once(CLASS_SESSION_ACTION);
12
-	$sessionAction = new SessionAction();	
13
-	if(CONFIG_LOAD_DOC_LATTER)
14
-	{
15
-		$fileList = array();
16
-		$folderInfo = array('path'=>getCurrentFolderPath());
17
-	}else 
18
-	{
19
-		require_once(CLASS_MANAGER);
2
+    /**
3
+     * file manager platform
4
+     * @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
5
+     * @link www.phpletter.com
6
+     * @since 22/May/2007
7
+     *
8
+     */
9
+    require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php");
10
+    $session->gc();
11
+    require_once(CLASS_SESSION_ACTION);
12
+    $sessionAction = new SessionAction();	
13
+    if(CONFIG_LOAD_DOC_LATTER)
14
+    {
15
+        $fileList = array();
16
+        $folderInfo = array('path'=>getCurrentFolderPath());
17
+    }else 
18
+    {
19
+        require_once(CLASS_MANAGER);
20 20
 
21 21
 	
22
-		$manager = new manager();
23
-		$manager->setSessionAction($sessionAction);
24
-		$fileList = $manager->getFileList();
25
-		$folderInfo = $manager->getFolderInfo();		
26
-	}
27
-	if(CONFIG_SYS_THUMBNAIL_VIEW_ENABLE)
28
-	{
29
-	$views = array(
30
-		'detail'=>LBL_BTN_VIEW_DETAILS,
31
-		'thumbnail'=>LBL_BTN_VIEW_THUMBNAIL,
32
-	);		
33
-	}else 
34
-	{
35
-	$views = array(
36
-		'detail'=>LBL_BTN_VIEW_DETAILS,
37
-	);		
38
-	}
39
-
40
-	if(!empty($_GET['view']))
41
-	{
42
-		switch($_GET['view'])
43
-		{
44
-			case 'detail':
45
-			case 'thumbnail':
46
-				$view = $_GET['view'];
47
-				break;
48
-			default:
49
-				$view = CONFIG_DEFAULT_VIEW;
50
-		}
51
-	}else 
52
-	{
53
-		$view = CONFIG_DEFAULT_VIEW;
54
-	}
22
+        $manager = new manager();
23
+        $manager->setSessionAction($sessionAction);
24
+        $fileList = $manager->getFileList();
25
+        $folderInfo = $manager->getFolderInfo();		
26
+    }
27
+    if(CONFIG_SYS_THUMBNAIL_VIEW_ENABLE)
28
+    {
29
+    $views = array(
30
+        'detail'=>LBL_BTN_VIEW_DETAILS,
31
+        'thumbnail'=>LBL_BTN_VIEW_THUMBNAIL,
32
+    );		
33
+    }else 
34
+    {
35
+    $views = array(
36
+        'detail'=>LBL_BTN_VIEW_DETAILS,
37
+    );		
38
+    }
39
+
40
+    if(!empty($_GET['view']))
41
+    {
42
+        switch($_GET['view'])
43
+        {
44
+            case 'detail':
45
+            case 'thumbnail':
46
+                $view = $_GET['view'];
47
+                break;
48
+            default:
49
+                $view = CONFIG_DEFAULT_VIEW;
50
+        }
51
+    }else 
52
+    {
53
+        $view = CONFIG_DEFAULT_VIEW;
54
+    }
55 55
 
56 56
 ?>
57 57
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@@ -177,12 +177,12 @@  discard block
 block discarded – undo
177 177
 	
178 178
 </script>
179 179
 <?php
180
-	if(file_exists(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'jscripts' . DIRECTORY_SEPARATOR . 'for_' . CONFIG_EDITOR_NAME . ".js")
181
-	{
182
-	?>
180
+    if(file_exists(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'jscripts' . DIRECTORY_SEPARATOR . 'for_' . CONFIG_EDITOR_NAME . ".js")
181
+    {
182
+    ?>
183 183
 	<script type="text/javascript" src="jscripts/<?php echo 'for_' . CONFIG_EDITOR_NAME . '.js'; ?>"></script>
184 184
 	<?php
185
-	}
185
+    }
186 186
 ?>
187 187
 <link rel="stylesheet" type="text/css" href="theme/<?php echo CONFIG_THEME_NAME; ?>/css/ajaxfilemanager.css" />
188 188
 <link rel="stylesheet" type="text/css" href="theme/<?php echo CONFIG_THEME_NAME; ?>/css/<?php echo CONFIG_EDITOR_NAME; ?>.css" />
@@ -204,66 +204,66 @@  discard block
 block discarded – undo
204 204
     	
205 205
     			<label><?php echo LBL_BTN_VIEW_OPTIONS; ?></label>
206 206
 					<?php 
207
-						foreach($views as $k=>$v)
208
-						{
209
-							?>
207
+                        foreach($views as $k=>$v)
208
+                        {
209
+                            ?>
210 210
 							<input type="radio" name="view"  class="radio" onclick="return changeView(this);" value="<?php echo $k; ?>" <?php echo ($k==$view?'checked':''); ?>> <?php echo $v; ?> &nbsp;&nbsp;
211 211
 							
212 212
 							<?php
213
-						}
214
-					?></div>
213
+                        }
214
+                    ?></div>
215 215
 				<ul id="actionHeader">
216 216
 					<li><a href="#" id="actionRefresh" onclick="return windowRefresh();"><span><?php echo LBL_ACTION_REFRESH; ?></span></a></li>
217 217
 					<li><a href="#" id="actionSelectAll" class="check_all" onclick="return checkAll(this);"><span><?php echo LBL_ACTION_SELECT_ALL; ?></span></a></li>
218 218
 					<?php 
219
-						if(CONFIG_OPTIONS_DELETE)
220
-						{
221
-							?>
219
+                        if(CONFIG_OPTIONS_DELETE)
220
+                        {
221
+                            ?>
222 222
 							<li><a href="#" id="actionDelete" onclick="return deleteDocuments();"><span><?php echo LBL_ACTION_DELETE; ?></span></a></li>
223 223
 							<?php
224
-						}
225
-					?>
224
+                        }
225
+                    ?>
226 226
 					<?php 
227
-						if(CONFIG_OPTIONS_CUT)
228
-						{
229
-							?>
227
+                        if(CONFIG_OPTIONS_CUT)
228
+                        {
229
+                            ?>
230 230
 							<li><a href="#" id="actionCut" onclick="return cutDocuments('<?php echo ERR_NOT_DOC_SELECTED_FOR_CUT; ?>');"><span><?php echo LBL_ACTION_CUT; ?></span></a></li>			
231 231
 							<?php
232
-						}
233
-					?>
232
+                        }
233
+                    ?>
234 234
 					<?php 
235
-						if(CONFIG_OPTIONS_COPY)
236
-						{
237
-							?>
235
+                        if(CONFIG_OPTIONS_COPY)
236
+                        {
237
+                            ?>
238 238
 							<li><a href="#" id="actionCopy" onclick="return copyDocuments('<?php echo ERR_NOT_DOC_SELECTED_FOR_COPY; ?>');"><span><?php echo LBL_ACTION_COPY; ?></span></a></li>
239 239
 							<?php
240
-						}
241
-					?>
240
+                        }
241
+                    ?>
242 242
 					<?php 
243
-						if(CONFIG_OPTIONS_CUT || CONFIG_OPTIONS_COPY)
244
-						{
245
-							?>
243
+                        if(CONFIG_OPTIONS_CUT || CONFIG_OPTIONS_COPY)
244
+                        {
245
+                            ?>
246 246
 							<li><a href="#" id="actionPaste" onclick="return pasteDocuments('<?php echo ERR_NOT_DOC_SELECTED_FOR_PASTE; ?>');"><span><?php echo LBL_ACTION_PASTE; ?></span></a></li>
247 247
 							<?php
248
-						}
249
-					?>															
248
+                        }
249
+                    ?>															
250 250
 					
251 251
 					<?php 
252
-						if(CONFIG_OPTIONS_NEWFOLDER)
253
-						{
254
-							?>
252
+                        if(CONFIG_OPTIONS_NEWFOLDER)
253
+                        {
254
+                            ?>
255 255
 							<li><a  id="actionNewFolder" href="#" onclick="return newFolderWin(this);"><span><?php echo LBL_BTN_NEW_FOLDER; ?></span></a></li>
256 256
 							<?php
257
-						}
258
-					?>
257
+                        }
258
+                    ?>
259 259
 					<?php 
260
-						if(CONFIG_OPTIONS_UPLOAD)
261
-						{
262
-							?>
260
+                        if(CONFIG_OPTIONS_UPLOAD)
261
+                        {
262
+                            ?>
263 263
 							<li><a  id="actionUpload" href="#" onclick="return uploadFileWin(this);"><span><?php echo LBL_BTN_UPLOAD; ?></span></a></li>
264 264
 							<?php
265
-						}
266
-					?>
265
+                        }
266
+                    ?>
267 267
 																	
268 268
 					
269 269
 					
@@ -284,10 +284,10 @@  discard block
 block discarded – undo
284 284
          
285 285
       <div id="rightCol">
286 286
 	      	<?php
287
-			if(CONFIG_LOAD_DOC_LATTER )
288
-			{
289
-				$currentPath = getCurrentFolderPath();
290
-				?>
287
+            if(CONFIG_LOAD_DOC_LATTER )
288
+            {
289
+                $currentPath = getCurrentFolderPath();
290
+                ?>
291 291
 				<script type="text/javascript">
292 292
 				parentFolder = {path:'<?php echo getParentFolderPath($currentPath); ?>'}; 
293 293
 				currentFolder = {'friendly_path':'<?php echo transformFilePath($currentPath); ?>'};
@@ -309,19 +309,19 @@  discard block
 block discarded – undo
309 309
 					);
310 310
 				</script>
311 311
 				<?php
312
-			}else 
313
-			{
314
-				include_once(CONFIG_URL_LIST_LISTING);
315
-			}
316
-	      	 ?>
312
+            }else 
313
+            {
314
+                include_once(CONFIG_URL_LIST_LISTING);
315
+            }
316
+                ?>
317 317
       </div> 
318 318
       
319 319
       <div id="leftCol">
320 320
       
321 321
       	<?php
322
-      		if(CONFIG_OPTIONS_SEARCH)
323
-      		{
324
-      	?>
322
+                if(CONFIG_OPTIONS_SEARCH)
323
+                {
324
+            ?>
325 325
       	<fieldset class="boxSearch">
326 326
       		<legend><?php echo LBL_SEARCH; ?></legend>
327 327
 
@@ -340,9 +340,9 @@  discard block
 block discarded – undo
340 340
 	          	<b><?php echo LBL_SEARCH_FOLDER; ?></b><br />
341 341
 	          	<span id="searchFolderContainer">
342 342
 	          	<?php
343
-	          		if(CONFIG_LOAD_DOC_LATTER)
344
-	          		{
345
-	          			?>
343
+                        if(CONFIG_LOAD_DOC_LATTER)
344
+                        {
345
+                            ?>
346 346
 	          			<script type="text/javascript">
347 347
 	          				$(document).ready(
348 348
 	          					function()
@@ -353,24 +353,24 @@  discard block
 block discarded – undo
353 353
 	          				);
354 354
 	          			</script>
355 355
 	          			<?php
356
-	          		}else 
357
-	          		{
358
-	          	?>
356
+                        }else 
357
+                        {
358
+                    ?>
359 359
 		            <select class="input inputSearch" name="search_folder" id="search_folder">
360 360
 		            	<?php 
361 361
 		            		
362
-										foreach(getFolderListing(CONFIG_SYS_ROOT_PATH) as $k=>$v)
363
-										{
364
-											?>
362
+                                        foreach(getFolderListing(CONFIG_SYS_ROOT_PATH) as $k=>$v)
363
+                                        {
364
+                                            ?>
365 365
 		                  <option value="<?php echo $v; ?>" <?php echo (removeTrailingSlash(backslashToSlash(($folderInfo['path']))) == removeTrailingSlash(backslashToSlash(($v)))?' selected="selected"':''); ?>><?php echo shortenFileName($k, 30); ?></option>
366 366
 		                  <?php 
367
-										}
367
+                                        }
368 368
 		            		
369
-									?>            	
369
+                                    ?>            	
370 370
 		            </select>
371 371
 		      <?php
372
-	          		}
373
-		      ?></span>
372
+                        }
373
+                ?></span>
374 374
 	          </td>
375 375
 	         </tr>  
376 376
         		<tr>
@@ -414,8 +414,8 @@  discard block
 block discarded – undo
414 414
         <div class="clear"></div>
415 415
         </fieldset>
416 416
 	<?php
417
-      		}
418
-	?>  
417
+                }
418
+    ?>  
419 419
 
420 420
 				<fieldset id="folderFieldSet" >
421 421
 					
Please login to merge, or discard this patch.
Spacing   +39 added lines, -39 removed lines patch added patch discarded remove patch
@@ -6,15 +6,15 @@  discard block
 block discarded – undo
6 6
 	 * @since 22/May/2007
7 7
 	 *
8 8
 	 */
9
-	require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php");
9
+	require_once(dirname(__FILE__).DIRECTORY_SEPARATOR."inc".DIRECTORY_SEPARATOR."config.php");
10 10
 	$session->gc();
11 11
 	require_once(CLASS_SESSION_ACTION);
12 12
 	$sessionAction = new SessionAction();	
13
-	if(CONFIG_LOAD_DOC_LATTER)
13
+	if (CONFIG_LOAD_DOC_LATTER)
14 14
 	{
15 15
 		$fileList = array();
16 16
 		$folderInfo = array('path'=>getCurrentFolderPath());
17
-	}else 
17
+	} else 
18 18
 	{
19 19
 		require_once(CLASS_MANAGER);
20 20
 
@@ -24,22 +24,22 @@  discard block
 block discarded – undo
24 24
 		$fileList = $manager->getFileList();
25 25
 		$folderInfo = $manager->getFolderInfo();		
26 26
 	}
27
-	if(CONFIG_SYS_THUMBNAIL_VIEW_ENABLE)
27
+	if (CONFIG_SYS_THUMBNAIL_VIEW_ENABLE)
28 28
 	{
29 29
 	$views = array(
30 30
 		'detail'=>LBL_BTN_VIEW_DETAILS,
31 31
 		'thumbnail'=>LBL_BTN_VIEW_THUMBNAIL,
32 32
 	);		
33
-	}else 
33
+	} else 
34 34
 	{
35 35
 	$views = array(
36 36
 		'detail'=>LBL_BTN_VIEW_DETAILS,
37 37
 	);		
38 38
 	}
39 39
 
40
-	if(!empty($_GET['view']))
40
+	if (!empty($_GET['view']))
41 41
 	{
42
-		switch($_GET['view'])
42
+		switch ($_GET['view'])
43 43
 		{
44 44
 			case 'detail':
45 45
 			case 'thumbnail':
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 			default:
49 49
 				$view = CONFIG_DEFAULT_VIEW;
50 50
 		}
51
-	}else 
51
+	} else 
52 52
 	{
53 53
 		$view = CONFIG_DEFAULT_VIEW;
54 54
 	}
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
 			'paste':'<?php echo CONFIG_URL_FILE_PASTE; ?>',
83 83
 			'delete':'<?php echo CONFIG_URL_DELETE; ?>',
84 84
 			'rename':'<?php echo CONFIG_URL_SAVE_NAME; ?>',
85
-			'thumbnail':'<?php echo CONFIG_URL_IMG_THUMBNAIL;  ?>',
85
+			'thumbnail':'<?php echo CONFIG_URL_IMG_THUMBNAIL; ?>',
86 86
 			'create_folder':'<?php echo CONFIG_URL_CREATE_FOLDER; ?>',
87 87
 			'text_editor':'<?php echo  CONFIG_URL_TEXT_EDITOR; ?>',
88 88
 			'image_editor':'<?php echo  CONFIG_URL_IMAGE_EDITOR; ?>',
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 			'home':'<?php echo CONFIG_URL_HOME; ?>',
92 92
 			'view':'<?php echo CONFIG_URL_LIST_LISTING; ?>'			
93 93
 		};
94
-	var permits = {'del':<?php echo (CONFIG_OPTIONS_DELETE?1:0); ?>, 'cut':<?php echo (CONFIG_OPTIONS_CUT?'1':'0'); ?>, 'copy':<?php echo (CONFIG_OPTIONS_COPY?1:0); ?>, 'newfolder':<?php echo (CONFIG_OPTIONS_NEWFOLDER?1:0); ?>, 'rename':<?php echo (CONFIG_OPTIONS_RENAME?1:0); ?>, 'upload':<?php echo (CONFIG_OPTIONS_UPLOAD?1:0); ?>, 'edit':<?php echo (CONFIG_OPTIONS_EDITABLE?1:0); ?>, 'view_only':<?php echo (CONFIG_SYS_VIEW_ONLY?1:0); ?>};
94
+	var permits = {'del':<?php echo (CONFIG_OPTIONS_DELETE ? 1 : 0); ?>, 'cut':<?php echo (CONFIG_OPTIONS_CUT ? '1' : '0'); ?>, 'copy':<?php echo (CONFIG_OPTIONS_COPY ? 1 : 0); ?>, 'newfolder':<?php echo (CONFIG_OPTIONS_NEWFOLDER ? 1 : 0); ?>, 'rename':<?php echo (CONFIG_OPTIONS_RENAME ? 1 : 0); ?>, 'upload':<?php echo (CONFIG_OPTIONS_UPLOAD ? 1 : 0); ?>, 'edit':<?php echo (CONFIG_OPTIONS_EDITABLE ? 1 : 0); ?>, 'view_only':<?php echo (CONFIG_SYS_VIEW_ONLY ? 1 : 0); ?>};
95 95
 	var currentFolder = {};
96 96
 	var warningDelete = '<?php echo WARNING_DELETE; ?>';
97 97
 	var newFile = {'num':1, 'label':'<?php echo FILE_LABEL_SELECT; ?>', 'upload':'<?php echo FILE_LBL_UPLOAD; ?>'};
@@ -128,7 +128,7 @@  discard block
 block discarded – undo
128 128
 	var searchRequired = false;
129 129
 	var supporedPreviewExts = '<?php echo CONFIG_VIEWABLE_VALID_EXTS; ?>'; 
130 130
 	var supportedUploadExts = '<?php echo CONFIG_UPLOAD_VALID_EXTS; ?>'
131
-	var elementId = <?php  echo (!empty($_GET['elementId'])?"'" . $_GET['elementId'] . "'":'null'); ?>;
131
+	var elementId = <?php  echo (!empty($_GET['elementId']) ? "'".$_GET['elementId']."'" : 'null'); ?>;
132 132
 	var files = {};
133 133
 $(document).ready(
134 134
 	function()
@@ -177,10 +177,10 @@  discard block
 block discarded – undo
177 177
 	
178 178
 </script>
179 179
 <?php
180
-	if(file_exists(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'jscripts' . DIRECTORY_SEPARATOR . 'for_' . CONFIG_EDITOR_NAME . ".js")
180
+	if (file_exists(dirname(__FILE__)).DIRECTORY_SEPARATOR.'jscripts'.DIRECTORY_SEPARATOR.'for_'.CONFIG_EDITOR_NAME.".js")
181 181
 	{
182 182
 	?>
183
-	<script type="text/javascript" src="jscripts/<?php echo 'for_' . CONFIG_EDITOR_NAME . '.js'; ?>"></script>
183
+	<script type="text/javascript" src="jscripts/<?php echo 'for_'.CONFIG_EDITOR_NAME.'.js'; ?>"></script>
184 184
 	<?php
185 185
 	}
186 186
 ?>
@@ -204,10 +204,10 @@  discard block
 block discarded – undo
204 204
     	
205 205
     			<label><?php echo LBL_BTN_VIEW_OPTIONS; ?></label>
206 206
 					<?php 
207
-						foreach($views as $k=>$v)
207
+						foreach ($views as $k=>$v)
208 208
 						{
209 209
 							?>
210
-							<input type="radio" name="view"  class="radio" onclick="return changeView(this);" value="<?php echo $k; ?>" <?php echo ($k==$view?'checked':''); ?>> <?php echo $v; ?> &nbsp;&nbsp;
210
+							<input type="radio" name="view"  class="radio" onclick="return changeView(this);" value="<?php echo $k; ?>" <?php echo ($k == $view ? 'checked' : ''); ?>> <?php echo $v; ?> &nbsp;&nbsp;
211 211
 							
212 212
 							<?php
213 213
 						}
@@ -216,7 +216,7 @@  discard block
 block discarded – undo
216 216
 					<li><a href="#" id="actionRefresh" onclick="return windowRefresh();"><span><?php echo LBL_ACTION_REFRESH; ?></span></a></li>
217 217
 					<li><a href="#" id="actionSelectAll" class="check_all" onclick="return checkAll(this);"><span><?php echo LBL_ACTION_SELECT_ALL; ?></span></a></li>
218 218
 					<?php 
219
-						if(CONFIG_OPTIONS_DELETE)
219
+						if (CONFIG_OPTIONS_DELETE)
220 220
 						{
221 221
 							?>
222 222
 							<li><a href="#" id="actionDelete" onclick="return deleteDocuments();"><span><?php echo LBL_ACTION_DELETE; ?></span></a></li>
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
 						}
225 225
 					?>
226 226
 					<?php 
227
-						if(CONFIG_OPTIONS_CUT)
227
+						if (CONFIG_OPTIONS_CUT)
228 228
 						{
229 229
 							?>
230 230
 							<li><a href="#" id="actionCut" onclick="return cutDocuments('<?php echo ERR_NOT_DOC_SELECTED_FOR_CUT; ?>');"><span><?php echo LBL_ACTION_CUT; ?></span></a></li>			
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
 						}
233 233
 					?>
234 234
 					<?php 
235
-						if(CONFIG_OPTIONS_COPY)
235
+						if (CONFIG_OPTIONS_COPY)
236 236
 						{
237 237
 							?>
238 238
 							<li><a href="#" id="actionCopy" onclick="return copyDocuments('<?php echo ERR_NOT_DOC_SELECTED_FOR_COPY; ?>');"><span><?php echo LBL_ACTION_COPY; ?></span></a></li>
@@ -240,7 +240,7 @@  discard block
 block discarded – undo
240 240
 						}
241 241
 					?>
242 242
 					<?php 
243
-						if(CONFIG_OPTIONS_CUT || CONFIG_OPTIONS_COPY)
243
+						if (CONFIG_OPTIONS_CUT || CONFIG_OPTIONS_COPY)
244 244
 						{
245 245
 							?>
246 246
 							<li><a href="#" id="actionPaste" onclick="return pasteDocuments('<?php echo ERR_NOT_DOC_SELECTED_FOR_PASTE; ?>');"><span><?php echo LBL_ACTION_PASTE; ?></span></a></li>
@@ -249,7 +249,7 @@  discard block
 block discarded – undo
249 249
 					?>															
250 250
 					
251 251
 					<?php 
252
-						if(CONFIG_OPTIONS_NEWFOLDER)
252
+						if (CONFIG_OPTIONS_NEWFOLDER)
253 253
 						{
254 254
 							?>
255 255
 							<li><a  id="actionNewFolder" href="#" onclick="return newFolderWin(this);"><span><?php echo LBL_BTN_NEW_FOLDER; ?></span></a></li>
@@ -257,7 +257,7 @@  discard block
 block discarded – undo
257 257
 						}
258 258
 					?>
259 259
 					<?php 
260
-						if(CONFIG_OPTIONS_UPLOAD)
260
+						if (CONFIG_OPTIONS_UPLOAD)
261 261
 						{
262 262
 							?>
263 263
 							<li><a  id="actionUpload" href="#" onclick="return uploadFileWin(this);"><span><?php echo LBL_BTN_UPLOAD; ?></span></a></li>
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
          
285 285
       <div id="rightCol">
286 286
 	      	<?php
287
-			if(CONFIG_LOAD_DOC_LATTER )
287
+			if (CONFIG_LOAD_DOC_LATTER)
288 288
 			{
289 289
 				$currentPath = getCurrentFolderPath();
290 290
 				?>
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
 					);
310 310
 				</script>
311 311
 				<?php
312
-			}else 
312
+			} else 
313 313
 			{
314 314
 				include_once(CONFIG_URL_LIST_LISTING);
315 315
 			}
@@ -319,7 +319,7 @@  discard block
 block discarded – undo
319 319
       <div id="leftCol">
320 320
       
321 321
       	<?php
322
-      		if(CONFIG_OPTIONS_SEARCH)
322
+      		if (CONFIG_OPTIONS_SEARCH)
323 323
       		{
324 324
       	?>
325 325
       	<fieldset class="boxSearch">
@@ -340,7 +340,7 @@  discard block
 block discarded – undo
340 340
 	          	<b><?php echo LBL_SEARCH_FOLDER; ?></b><br />
341 341
 	          	<span id="searchFolderContainer">
342 342
 	          	<?php
343
-	          		if(CONFIG_LOAD_DOC_LATTER)
343
+	          		if (CONFIG_LOAD_DOC_LATTER)
344 344
 	          		{
345 345
 	          			?>
346 346
 	          			<script type="text/javascript">
@@ -353,16 +353,16 @@  discard block
 block discarded – undo
353 353
 	          				);
354 354
 	          			</script>
355 355
 	          			<?php
356
-	          		}else 
356
+	          		} else 
357 357
 	          		{
358 358
 	          	?>
359 359
 		            <select class="input inputSearch" name="search_folder" id="search_folder">
360 360
 		            	<?php 
361 361
 		            		
362
-										foreach(getFolderListing(CONFIG_SYS_ROOT_PATH) as $k=>$v)
362
+										foreach (getFolderListing(CONFIG_SYS_ROOT_PATH) as $k=>$v)
363 363
 										{
364 364
 											?>
365
-		                  <option value="<?php echo $v; ?>" <?php echo (removeTrailingSlash(backslashToSlash(($folderInfo['path']))) == removeTrailingSlash(backslashToSlash(($v)))?' selected="selected"':''); ?>><?php echo shortenFileName($k, 30); ?></option>
365
+		                  <option value="<?php echo $v; ?>" <?php echo (removeTrailingSlash(backslashToSlash(($folderInfo['path']))) == removeTrailingSlash(backslashToSlash(($v))) ? ' selected="selected"' : ''); ?>><?php echo shortenFileName($k, 30); ?></option>
366 366
 		                  <?php 
367 367
 										}
368 368
 		            		
@@ -376,16 +376,16 @@  discard block
 block discarded – undo
376 376
         		<tr>
377 377
         			<td>
378 378
         		<b><?php echo LBL_SEARCH_MTIME; ?></b><br />
379
-        		<input type="text" class="input inputMtime" name="search_mtime_from" id="search_mtime_from" value="<?php echo (!empty($_GET['search_mtime_from'])?$_GET['search_mtime_from']:''); ?>" /> 
379
+        		<input type="text" class="input inputMtime" name="search_mtime_from" id="search_mtime_from" value="<?php echo (!empty($_GET['search_mtime_from']) ? $_GET['search_mtime_from'] : ''); ?>" /> 
380 380
         		<span class="leftToRightArrow">&nbsp;</span>
381
-        		<input type="text" class="input inputMtime" name="search_mtime_to" id="search_mtime_to" value="<?php echo (!empty($_GET['search_mtime_to'])?$_GET['search_mtime_to']:''); ?>" />
381
+        		<input type="text" class="input inputMtime" name="search_mtime_to" id="search_mtime_to" value="<?php echo (!empty($_GET['search_mtime_to']) ? $_GET['search_mtime_to'] : ''); ?>" />
382 382
         	</td></tr>
383 383
 
384 384
 			<tr>
385 385
 				<td>
386 386
           	<b><?php echo LBL_SEARCH_RECURSIVELY; ?></b>&nbsp;&nbsp;
387
-          	<input type="radio" name="search_recursively" value="1" id="search_recursively_1" class="radio" <?php echo (!empty($_GET['search_recursively'])?'checked="checked"':''); ?> /> <?php echo LBL_RECURSIVELY_YES; ?>
388
-          	<input type="radio" name="search_recursively" value="0" id="search_recursively_0" class="radio" <?php echo (empty($_GET['search_recursively'])?'checked="checked"':''); ?> /> <?php echo LBL_RECURSIVELY_NO; ?>
387
+          	<input type="radio" name="search_recursively" value="1" id="search_recursively_1" class="radio" <?php echo (!empty($_GET['search_recursively']) ? 'checked="checked"' : ''); ?> /> <?php echo LBL_RECURSIVELY_YES; ?>
388
+          	<input type="radio" name="search_recursively" value="0" id="search_recursively_0" class="radio" <?php echo (empty($_GET['search_recursively']) ? 'checked="checked"' : ''); ?> /> <?php echo LBL_RECURSIVELY_NO; ?>
389 389
           	</td>
390 390
           </tr>	                	
391 391
           	</tbody>
@@ -428,28 +428,28 @@  discard block
 block discarded – undo
428 428
 						</tr>
429 429
 						<tr>
430 430
 							<th><?php echo LBL_FOLDER_CREATED; ?></th>
431
-							<td colspan="3" id="folderCtime"><?php echo (!empty($folderInfo['ctime'])?date(DATE_TIME_FORMAT,$folderInfo['ctime']):'&nbsp;') ; ?></td>
431
+							<td colspan="3" id="folderCtime"><?php echo (!empty($folderInfo['ctime']) ? date(DATE_TIME_FORMAT, $folderInfo['ctime']) : '&nbsp;'); ?></td>
432 432
 
433 433
 						</tr>
434 434
 						<tr>
435 435
 							<th><?php echo LBL_FOLDER_MODIFIED; ?></th>
436
-							<td colspan="3" id="folderMtime"><?php echo (!empty($folderInfo['mtime'])?date(DATE_TIME_FORMAT,$folderInfo['mtime']):'&nbsp;'); ?></td>
436
+							<td colspan="3" id="folderMtime"><?php echo (!empty($folderInfo['mtime']) ? date(DATE_TIME_FORMAT, $folderInfo['mtime']) : '&nbsp;'); ?></td>
437 437
 						</tr>
438 438
 						<tr>
439 439
 							<th><?php echo LBL_FOLDER_SUDDIR; ?></th>
440
-							<td  colspan="3" id="folderSubdir"><?php echo (isset($folderInfo['subdir'])?$folderInfo['subdir']:"&nbsp;"); ?></td>
440
+							<td  colspan="3" id="folderSubdir"><?php echo (isset($folderInfo['subdir']) ? $folderInfo['subdir'] : "&nbsp;"); ?></td>
441 441
 
442 442
 						</tr>
443 443
 						<tr>
444 444
 							<th><?php echo LBL_FOLDER_FIELS; ?></th>
445
-							<td  colspan="3" id="folderFile"><?php echo (isset($folderInfo['file'])?$folderInfo['file']:'&nbsp;'); ?></td>						
445
+							<td  colspan="3" id="folderFile"><?php echo (isset($folderInfo['file']) ? $folderInfo['file'] : '&nbsp;'); ?></td>						
446 446
 						</tr>
447 447
 						
448 448
 						<tr>
449 449
 							<th><?php echo LBL_FOLDER_WRITABLE; ?></th>
450
-							<td id="folderWritable"><span class="<?php echo (isset($folderInfo['is_readable'])?($folderInfo['is_readable']?'flagYes':'flagNo'):'&nbsp;'); ?>">&nbsp;</span></td>
450
+							<td id="folderWritable"><span class="<?php echo (isset($folderInfo['is_readable']) ? ($folderInfo['is_readable'] ? 'flagYes' : 'flagNo') : '&nbsp;'); ?>">&nbsp;</span></td>
451 451
 							<th><?php echo LBL_FOLDER_READABLE; ?></th>
452
-							<td  id="folderReadable"><span class="<?php echo (isset($folderInfo['is_writable'])?($folderInfo['is_writable']?'flagYes':'flagNo'):'&nbsp;'); ?>">&nbsp;</span></td>						
452
+							<td  id="folderReadable"><span class="<?php echo (isset($folderInfo['is_writable']) ? ($folderInfo['is_writable'] ? 'flagYes' : 'flagNo') : '&nbsp;'); ?>">&nbsp;</span></td>						
453 453
 						
454 454
 						</tr>
455 455
 
@@ -537,7 +537,7 @@  discard block
 block discarded – undo
537 537
 		  	<table class="tableForm" cellpadding="0" cellspacing="0">
538 538
 		  		<thead>
539 539
 		  			<tr>
540
-		  				<th colspan="4"><?php echo FILE_FORM_TITLE; ?><a class="action" href="#" title="<?php echo FILE_LBL_MORE;  ?>" onclick="return addMoreFile();"><span class="addMore">&nbsp;</span></a></th>
540
+		  				<th colspan="4"><?php echo FILE_FORM_TITLE; ?><a class="action" href="#" title="<?php echo FILE_LBL_MORE; ?>" onclick="return addMoreFile();"><span class="addMore">&nbsp;</span></a></th>
541 541
 		  			</tr>
542 542
 		  		</thead>
543 543
 		  		<tbody id="fileUploadBody">
Please login to merge, or discard this patch.
Braces   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 	{
15 15
 		$fileList = array();
16 16
 		$folderInfo = array('path'=>getCurrentFolderPath());
17
-	}else 
17
+	} else 
18 18
 	{
19 19
 		require_once(CLASS_MANAGER);
20 20
 
@@ -30,7 +30,7 @@  discard block
 block discarded – undo
30 30
 		'detail'=>LBL_BTN_VIEW_DETAILS,
31 31
 		'thumbnail'=>LBL_BTN_VIEW_THUMBNAIL,
32 32
 	);		
33
-	}else 
33
+	} else 
34 34
 	{
35 35
 	$views = array(
36 36
 		'detail'=>LBL_BTN_VIEW_DETAILS,
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 			default:
49 49
 				$view = CONFIG_DEFAULT_VIEW;
50 50
 		}
51
-	}else 
51
+	} else 
52 52
 	{
53 53
 		$view = CONFIG_DEFAULT_VIEW;
54 54
 	}
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
 					);
310 310
 				</script>
311 311
 				<?php
312
-			}else 
312
+			} else 
313 313
 			{
314 314
 				include_once(CONFIG_URL_LIST_LISTING);
315 315
 			}
@@ -353,7 +353,7 @@  discard block
 block discarded – undo
353 353
 	          				);
354 354
 	          			</script>
355 355
 	          			<?php
356
-	          		}else 
356
+	          		} else 
357 357
 	          		{
358 358
 	          	?>
359 359
 		            <select class="input inputSearch" name="search_folder" id="search_folder">
Please login to merge, or discard this patch.
phpmyfaq/admin/editor/plugins/ajaxfilemanager/ajax_get_file_listing.php 3 patches
Indentation   +116 added lines, -116 removed lines patch added patch discarded remove patch
@@ -1,136 +1,136 @@
 block discarded – undo
1 1
 <?php 
2 2
 
3
-		/**
4
-	 * the php script used to get the list of file or folders under a specific folder
5
-	 * @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
6
-	 * @link www.phpletter.com
7
-	 * @since 22/May/2007
8
-	 *
9
-	 */
3
+        /**
4
+         * the php script used to get the list of file or folders under a specific folder
5
+         * @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
6
+         * @link www.phpletter.com
7
+         * @since 22/May/2007
8
+         *
9
+         */
10 10
 
11
-	if(!isset($manager))
12
-	{
13
-		/**
14
-		 *  this is part of  script for processing file paste 
15
-		 */
16
-		//$_GET = $_POST;
17
-		include_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php");
18
-		include_once(CLASS_PAGINATION);
19
-		$pagination = new pagination(false);
20
-		if(!empty($_GET['search']))
21
-		{
22
-			include_once(CLASS_SEARCH);
11
+    if(!isset($manager))
12
+    {
13
+        /**
14
+         *  this is part of  script for processing file paste 
15
+         */
16
+        //$_GET = $_POST;
17
+        include_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php");
18
+        include_once(CLASS_PAGINATION);
19
+        $pagination = new pagination(false);
20
+        if(!empty($_GET['search']))
21
+        {
22
+            include_once(CLASS_SEARCH);
23 23
 			
24
-			$search  = new Search($_GET['search_folder']);
25
-			$search->addSearchKeyword('recursive', @$_GET['search_recursively']);
26
-			$search->addSearchKeyword('mtime_from', @$_GET['search_mtime_from']);
27
-			$search->addSearchKeyword('mtime_to', @$_GET['search_mtime_to']);
28
-			$search->addSearchKeyword('size_from', @$_GET['search_size_from']);
29
-			$search->addSearchKeyword('size_to', @$_GET['search_size_to']);
30
-			$search->addSearchKeyword('recursive', @$_GET['search_recursively']);
31
-			$search->addSearchKeyword('name', @$_GET['search_name']);
32
-			$search->doSearch();
33
-			$fileList = $search->getFoundFiles();
34
-			$folderInfo = $search->getRootFolderInfo();			
24
+            $search  = new Search($_GET['search_folder']);
25
+            $search->addSearchKeyword('recursive', @$_GET['search_recursively']);
26
+            $search->addSearchKeyword('mtime_from', @$_GET['search_mtime_from']);
27
+            $search->addSearchKeyword('mtime_to', @$_GET['search_mtime_to']);
28
+            $search->addSearchKeyword('size_from', @$_GET['search_size_from']);
29
+            $search->addSearchKeyword('size_to', @$_GET['search_size_to']);
30
+            $search->addSearchKeyword('recursive', @$_GET['search_recursively']);
31
+            $search->addSearchKeyword('name', @$_GET['search_name']);
32
+            $search->doSearch();
33
+            $fileList = $search->getFoundFiles();
34
+            $folderInfo = $search->getRootFolderInfo();			
35 35
 			
36
-		}else 
37
-		{
38
-			include_once(CLASS_MANAGER);
39
-			include_once(CLASS_SESSION_ACTION);
40
-			$sessionAction = new SessionAction();
41
-			include_once(DIR_AJAX_INC . "class.manager.php");
36
+        }else 
37
+        {
38
+            include_once(CLASS_MANAGER);
39
+            include_once(CLASS_SESSION_ACTION);
40
+            $sessionAction = new SessionAction();
41
+            include_once(DIR_AJAX_INC . "class.manager.php");
42 42
 		
43
-			$manager = new manager();
44
-			$manager->setSessionAction($sessionAction);
43
+            $manager = new manager();
44
+            $manager->setSessionAction($sessionAction);
45 45
 		
46
-			$fileList = $manager->getFileList();
47
-			$folderInfo = $manager->getFolderInfo();	
46
+            $fileList = $manager->getFileList();
47
+            $folderInfo = $manager->getFolderInfo();	
48 48
 						
49
-		}
50
-		$pagination->setUrl(CONFIG_URL_FILEnIMAGE_MANAGER);	
49
+        }
50
+        $pagination->setUrl(CONFIG_URL_FILEnIMAGE_MANAGER);	
51 51
 
52
-	}else 
53
-	{
54
-		include_once(CLASS_PAGINATION);
55
-		$pagination = new pagination(false);			
56
-	}
52
+    }else 
53
+    {
54
+        include_once(CLASS_PAGINATION);
55
+        $pagination = new pagination(false);			
56
+    }
57 57
 
58 58
 		
59
-		$pagination->setTotal(sizeof($fileList));
60
-		$pagination->setFirstText(PAGINATION_FIRST);
61
-		$pagination->setPreviousText(PAGINATION_PREVIOUS);
62
-		$pagination->setNextText(PAGINATION_NEXT);
63
-		$pagination->setLastText(PAGINATION_LAST);
64
-		$pagination->setLimit(!empty($_GET['limit'])?intval($_GET['limit']):CONFIG_DEFAULT_PAGINATION_LIMIT);
65
-		echo $pagination->getPaginationHTML();
66
-		echo "<script type=\"text/javascript\">\n";
59
+        $pagination->setTotal(sizeof($fileList));
60
+        $pagination->setFirstText(PAGINATION_FIRST);
61
+        $pagination->setPreviousText(PAGINATION_PREVIOUS);
62
+        $pagination->setNextText(PAGINATION_NEXT);
63
+        $pagination->setLastText(PAGINATION_LAST);
64
+        $pagination->setLimit(!empty($_GET['limit'])?intval($_GET['limit']):CONFIG_DEFAULT_PAGINATION_LIMIT);
65
+        echo $pagination->getPaginationHTML();
66
+        echo "<script type=\"text/javascript\">\n";
67 67
 		
68 68
         echo "parentFolder = {path:'" . getParentFolderPath($folderInfo['path']). "'};\n"; 
69
-		echo 'currentFolder ={'; 
70
-		$count =1;
71
-		foreach($folderInfo as $k=>$v)
72
-		{
73
-			echo ($count++ == 1?'':',') . "'" . $k . "':'" . ($k=='ctime'|| $k=='mtime'?date(DATE_TIME_FORMAT, $v):$v)  . "'";
69
+        echo 'currentFolder ={'; 
70
+        $count =1;
71
+        foreach($folderInfo as $k=>$v)
72
+        {
73
+            echo ($count++ == 1?'':',') . "'" . $k . "':'" . ($k=='ctime'|| $k=='mtime'?date(DATE_TIME_FORMAT, $v):$v)  . "'";
74 74
 
75
-		}
76
-		echo "};\n";
77
-		$fileList = array_slice($fileList, $pagination->getPageOffset(), $pagination->getLimit());
78
-		echo 'numRows = ' . sizeof($fileList) . ";\n";
79
-		echo "files = {\n";
80
-		$count = 1;
75
+        }
76
+        echo "};\n";
77
+        $fileList = array_slice($fileList, $pagination->getPageOffset(), $pagination->getLimit());
78
+        echo 'numRows = ' . sizeof($fileList) . ";\n";
79
+        echo "files = {\n";
80
+        $count = 1;
81 81
 		
82 82
 		
83
-		foreach($fileList as $file)
84
-		{
85
-			echo (($count > 1)?",":'').$count++ . ":{";
86
-			$j = 1;
87
-			foreach($file as $k=>$v)
88
-			{
83
+        foreach($fileList as $file)
84
+        {
85
+            echo (($count > 1)?",":'').$count++ . ":{";
86
+            $j = 1;
87
+            foreach($file as $k=>$v)
88
+            {
89 89
 				
90
-				if($k  == 'ctime' || $k == 'mtime')
91
-				{
92
-					$v = @date(DATE_TIME_FORMAT, $v);
93
-				}	
94
-				if($k == 'size')
95
-				{
96
-					$v = transformFileSize($v);
97
-				}
98
-				echo (($j++ > 1)?",":'') . "'" . $k . "':'" . $v . "'";
99
-			}
100
-			echo (($j++ > 1)?",":'') . "'url':'" . getFileUrl($file['path']) . "'";
101
-			echo "}\n";				
102
-		}
103
-		echo  "};</script>\n";
104
-	if(!empty($_GET['view']))
105
-	{
106
-		switch($_GET['view'])
107
-		{
108
-			case 'detail':
109
-			case 'thumbnail':
110
-			case 'text':	
111
-				$view = $_GET['view'];
112
-				break;
113
-			default:
114
-				$view = CONFIG_DEFAULT_VIEW;
115
-		}
116
-	}else 
117
-	{
118
-		$view = CONFIG_DEFAULT_VIEW;
119
-	}	
120
-	switch($view)
121
-	{
122
-		case 'text':
123
-			//list file name only
124
-			include_once(DIR_AJAX_ROOT . '_ajax_get_text_listing.php');
125
-			break;
126
-		case 'thumbnail':
127
-			//list file with thumbnail
128
-			include_once(DIR_AJAX_ROOT . '_ajax_get_thumbnail_listing.php');
129
-			break;
130
-		case 'detail':
131
-		default:
132
-			include_once(DIR_AJAX_ROOT . '_ajax_get_details_listing.php');
133
-	}
90
+                if($k  == 'ctime' || $k == 'mtime')
91
+                {
92
+                    $v = @date(DATE_TIME_FORMAT, $v);
93
+                }	
94
+                if($k == 'size')
95
+                {
96
+                    $v = transformFileSize($v);
97
+                }
98
+                echo (($j++ > 1)?",":'') . "'" . $k . "':'" . $v . "'";
99
+            }
100
+            echo (($j++ > 1)?",":'') . "'url':'" . getFileUrl($file['path']) . "'";
101
+            echo "}\n";				
102
+        }
103
+        echo  "};</script>\n";
104
+    if(!empty($_GET['view']))
105
+    {
106
+        switch($_GET['view'])
107
+        {
108
+            case 'detail':
109
+            case 'thumbnail':
110
+            case 'text':	
111
+                $view = $_GET['view'];
112
+                break;
113
+            default:
114
+                $view = CONFIG_DEFAULT_VIEW;
115
+        }
116
+    }else 
117
+    {
118
+        $view = CONFIG_DEFAULT_VIEW;
119
+    }	
120
+    switch($view)
121
+    {
122
+        case 'text':
123
+            //list file name only
124
+            include_once(DIR_AJAX_ROOT . '_ajax_get_text_listing.php');
125
+            break;
126
+        case 'thumbnail':
127
+            //list file with thumbnail
128
+            include_once(DIR_AJAX_ROOT . '_ajax_get_thumbnail_listing.php');
129
+            break;
130
+        case 'detail':
131
+        default:
132
+            include_once(DIR_AJAX_ROOT . '_ajax_get_details_listing.php');
133
+    }
134 134
 
135 135
 	
136 136
 
Please login to merge, or discard this patch.
Spacing   +27 added lines, -27 removed lines patch added patch discarded remove patch
@@ -8,20 +8,20 @@  discard block
 block discarded – undo
8 8
 	 *
9 9
 	 */
10 10
 
11
-	if(!isset($manager))
11
+	if (!isset($manager))
12 12
 	{
13 13
 		/**
14 14
 		 *  this is part of  script for processing file paste 
15 15
 		 */
16 16
 		//$_GET = $_POST;
17
-		include_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php");
17
+		include_once(dirname(__FILE__).DIRECTORY_SEPARATOR."inc".DIRECTORY_SEPARATOR."config.php");
18 18
 		include_once(CLASS_PAGINATION);
19 19
 		$pagination = new pagination(false);
20
-		if(!empty($_GET['search']))
20
+		if (!empty($_GET['search']))
21 21
 		{
22 22
 			include_once(CLASS_SEARCH);
23 23
 			
24
-			$search  = new Search($_GET['search_folder']);
24
+			$search = new Search($_GET['search_folder']);
25 25
 			$search->addSearchKeyword('recursive', @$_GET['search_recursively']);
26 26
 			$search->addSearchKeyword('mtime_from', @$_GET['search_mtime_from']);
27 27
 			$search->addSearchKeyword('mtime_to', @$_GET['search_mtime_to']);
@@ -33,12 +33,12 @@  discard block
 block discarded – undo
33 33
 			$fileList = $search->getFoundFiles();
34 34
 			$folderInfo = $search->getRootFolderInfo();			
35 35
 			
36
-		}else 
36
+		} else 
37 37
 		{
38 38
 			include_once(CLASS_MANAGER);
39 39
 			include_once(CLASS_SESSION_ACTION);
40 40
 			$sessionAction = new SessionAction();
41
-			include_once(DIR_AJAX_INC . "class.manager.php");
41
+			include_once(DIR_AJAX_INC."class.manager.php");
42 42
 		
43 43
 			$manager = new manager();
44 44
 			$manager->setSessionAction($sessionAction);
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 		}
50 50
 		$pagination->setUrl(CONFIG_URL_FILEnIMAGE_MANAGER);	
51 51
 
52
-	}else 
52
+	} else 
53 53
 	{
54 54
 		include_once(CLASS_PAGINATION);
55 55
 		$pagination = new pagination(false);			
@@ -61,49 +61,49 @@  discard block
 block discarded – undo
61 61
 		$pagination->setPreviousText(PAGINATION_PREVIOUS);
62 62
 		$pagination->setNextText(PAGINATION_NEXT);
63 63
 		$pagination->setLastText(PAGINATION_LAST);
64
-		$pagination->setLimit(!empty($_GET['limit'])?intval($_GET['limit']):CONFIG_DEFAULT_PAGINATION_LIMIT);
64
+		$pagination->setLimit(!empty($_GET['limit']) ? intval($_GET['limit']) : CONFIG_DEFAULT_PAGINATION_LIMIT);
65 65
 		echo $pagination->getPaginationHTML();
66 66
 		echo "<script type=\"text/javascript\">\n";
67 67
 		
68
-        echo "parentFolder = {path:'" . getParentFolderPath($folderInfo['path']). "'};\n"; 
68
+        echo "parentFolder = {path:'".getParentFolderPath($folderInfo['path'])."'};\n"; 
69 69
 		echo 'currentFolder ={'; 
70
-		$count =1;
71
-		foreach($folderInfo as $k=>$v)
70
+		$count = 1;
71
+		foreach ($folderInfo as $k=>$v)
72 72
 		{
73
-			echo ($count++ == 1?'':',') . "'" . $k . "':'" . ($k=='ctime'|| $k=='mtime'?date(DATE_TIME_FORMAT, $v):$v)  . "'";
73
+			echo ($count++ == 1 ? '' : ',')."'".$k."':'".($k == 'ctime' || $k == 'mtime' ? date(DATE_TIME_FORMAT, $v) : $v)."'";
74 74
 
75 75
 		}
76 76
 		echo "};\n";
77 77
 		$fileList = array_slice($fileList, $pagination->getPageOffset(), $pagination->getLimit());
78
-		echo 'numRows = ' . sizeof($fileList) . ";\n";
78
+		echo 'numRows = '.sizeof($fileList).";\n";
79 79
 		echo "files = {\n";
80 80
 		$count = 1;
81 81
 		
82 82
 		
83
-		foreach($fileList as $file)
83
+		foreach ($fileList as $file)
84 84
 		{
85
-			echo (($count > 1)?",":'').$count++ . ":{";
85
+			echo (($count > 1) ? "," : '').$count++.":{";
86 86
 			$j = 1;
87
-			foreach($file as $k=>$v)
87
+			foreach ($file as $k=>$v)
88 88
 			{
89 89
 				
90
-				if($k  == 'ctime' || $k == 'mtime')
90
+				if ($k == 'ctime' || $k == 'mtime')
91 91
 				{
92 92
 					$v = @date(DATE_TIME_FORMAT, $v);
93 93
 				}	
94
-				if($k == 'size')
94
+				if ($k == 'size')
95 95
 				{
96 96
 					$v = transformFileSize($v);
97 97
 				}
98
-				echo (($j++ > 1)?",":'') . "'" . $k . "':'" . $v . "'";
98
+				echo (($j++ > 1) ? "," : '')."'".$k."':'".$v."'";
99 99
 			}
100
-			echo (($j++ > 1)?",":'') . "'url':'" . getFileUrl($file['path']) . "'";
100
+			echo (($j++ > 1) ? "," : '')."'url':'".getFileUrl($file['path'])."'";
101 101
 			echo "}\n";				
102 102
 		}
103 103
 		echo  "};</script>\n";
104
-	if(!empty($_GET['view']))
104
+	if (!empty($_GET['view']))
105 105
 	{
106
-		switch($_GET['view'])
106
+		switch ($_GET['view'])
107 107
 		{
108 108
 			case 'detail':
109 109
 			case 'thumbnail':
@@ -113,23 +113,23 @@  discard block
 block discarded – undo
113 113
 			default:
114 114
 				$view = CONFIG_DEFAULT_VIEW;
115 115
 		}
116
-	}else 
116
+	} else 
117 117
 	{
118 118
 		$view = CONFIG_DEFAULT_VIEW;
119 119
 	}	
120
-	switch($view)
120
+	switch ($view)
121 121
 	{
122 122
 		case 'text':
123 123
 			//list file name only
124
-			include_once(DIR_AJAX_ROOT . '_ajax_get_text_listing.php');
124
+			include_once(DIR_AJAX_ROOT.'_ajax_get_text_listing.php');
125 125
 			break;
126 126
 		case 'thumbnail':
127 127
 			//list file with thumbnail
128
-			include_once(DIR_AJAX_ROOT . '_ajax_get_thumbnail_listing.php');
128
+			include_once(DIR_AJAX_ROOT.'_ajax_get_thumbnail_listing.php');
129 129
 			break;
130 130
 		case 'detail':
131 131
 		default:
132
-			include_once(DIR_AJAX_ROOT . '_ajax_get_details_listing.php');
132
+			include_once(DIR_AJAX_ROOT.'_ajax_get_details_listing.php');
133 133
 	}
134 134
 
135 135
 	
Please login to merge, or discard this patch.
Braces   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -33,7 +33,7 @@  discard block
 block discarded – undo
33 33
 			$fileList = $search->getFoundFiles();
34 34
 			$folderInfo = $search->getRootFolderInfo();			
35 35
 			
36
-		}else 
36
+		} else 
37 37
 		{
38 38
 			include_once(CLASS_MANAGER);
39 39
 			include_once(CLASS_SESSION_ACTION);
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
 		}
50 50
 		$pagination->setUrl(CONFIG_URL_FILEnIMAGE_MANAGER);	
51 51
 
52
-	}else 
52
+	} else 
53 53
 	{
54 54
 		include_once(CLASS_PAGINATION);
55 55
 		$pagination = new pagination(false);			
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
 			default:
114 114
 				$view = CONFIG_DEFAULT_VIEW;
115 115
 		}
116
-	}else 
116
+	} else 
117 117
 	{
118 118
 		$view = CONFIG_DEFAULT_VIEW;
119 119
 	}	
Please login to merge, or discard this patch.
phpmyfaq/admin/editor/plugins/ajaxfilemanager/ajax_create_folder.php 3 patches
Indentation   +64 added lines, -64 removed lines patch added patch discarded remove patch
@@ -1,72 +1,72 @@
 block discarded – undo
1 1
 <?php
2
-	/**
3
-	 * create a folder
4
-	 * @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
5
-	 * @link www.phpletter.com
6
-	 * @since 22/May/2007
7
-	 *
8
-	 */
2
+    /**
3
+     * create a folder
4
+     * @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
5
+     * @link www.phpletter.com
6
+     * @since 22/May/2007
7
+     *
8
+     */
9 9
 
10
-	require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php");	
10
+    require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php");	
11 11
 
12
-	echo "{";
13
-	$error = "";
14
-	$info = "";	
12
+    echo "{";
13
+    $error = "";
14
+    $info = "";	
15 15
 /*	$_POST['new_folder'] = substr(md5(time()), 1, 5);
16 16
 	$_POST['currentFolderPath'] = "../../uploaded/";*/
17
-	if(CONFIG_SYS_VIEW_ONLY || !CONFIG_OPTIONS_NEWFOLDER)
18
-	{
19
-		$error = SYS_DISABLED;
20
-	}
21
-	elseif(empty($_POST['new_folder']))
22
-	{
23
-		$error  =  ERR_FOLDER_NAME_EMPTY;
24
-	}elseif(!preg_match("/^[a-zA-Z0-9_\- ]+$/", $_POST['new_folder']))
25
-	{
26
-		$error  =  ERR_FOLDER_FORMAT;
27
-	}else if(empty($_POST['currentFolderPath']) || !isUnderRoot($_POST['currentFolderPath']))
28
-	{
29
-		$error = ERR_FOLDER_PATH_NOT_ALLOWED;
30
-	}
31
-	elseif(file_exists(addTrailingSlash($_POST['currentFolderPath']) . $_POST['new_folder']))
32
-	{
33
-		$error = ERR_FOLDER_EXISTS;
34
-	}else
35
-	{
36
-	include_once(CLASS_FILE);
37
-		$file = new file();
38
-		if($file->mkdir(addTrailingSlash($_POST['currentFolderPath']) . $_POST['new_folder'], 0775))
39
-		{
40
-					include_once(CLASS_MANAGER);
41
-					$manager = new manager(addTrailingSlash($_POST['currentFolderPath']) . $_POST['new_folder'], false);
42
-					$pathInfo = $manager->getFolderInfo(addTrailingSlash($_POST['currentFolderPath']) . $_POST['new_folder']);
43
-					foreach($pathInfo as $k=>$v)
44
-					{				
45
-						switch ($k)
46
-						{
17
+    if(CONFIG_SYS_VIEW_ONLY || !CONFIG_OPTIONS_NEWFOLDER)
18
+    {
19
+        $error = SYS_DISABLED;
20
+    }
21
+    elseif(empty($_POST['new_folder']))
22
+    {
23
+        $error  =  ERR_FOLDER_NAME_EMPTY;
24
+    }elseif(!preg_match("/^[a-zA-Z0-9_\- ]+$/", $_POST['new_folder']))
25
+    {
26
+        $error  =  ERR_FOLDER_FORMAT;
27
+    }else if(empty($_POST['currentFolderPath']) || !isUnderRoot($_POST['currentFolderPath']))
28
+    {
29
+        $error = ERR_FOLDER_PATH_NOT_ALLOWED;
30
+    }
31
+    elseif(file_exists(addTrailingSlash($_POST['currentFolderPath']) . $_POST['new_folder']))
32
+    {
33
+        $error = ERR_FOLDER_EXISTS;
34
+    }else
35
+    {
36
+    include_once(CLASS_FILE);
37
+        $file = new file();
38
+        if($file->mkdir(addTrailingSlash($_POST['currentFolderPath']) . $_POST['new_folder'], 0775))
39
+        {
40
+                    include_once(CLASS_MANAGER);
41
+                    $manager = new manager(addTrailingSlash($_POST['currentFolderPath']) . $_POST['new_folder'], false);
42
+                    $pathInfo = $manager->getFolderInfo(addTrailingSlash($_POST['currentFolderPath']) . $_POST['new_folder']);
43
+                    foreach($pathInfo as $k=>$v)
44
+                    {				
45
+                        switch ($k)
46
+                        {
47 47
 
48 48
 
49
-							case "ctime";								
50
-							case "mtime":
51
-							case "atime":
52
-								$v = date(DATE_TIME_FORMAT, $v);
53
-								break;
54
-							case 'name':
55
-								$info .= sprintf(", %s:'%s'", 'short_name', shortenFileName($v));
56
-								break;
57
-							case 'cssClass':
58
-								$v = 'folderEmpty';
59
-								break;
60
-						}							
61
-						$info .= sprintf(", %s:'%s'", $k, $v);
62
-					}
63
-		}else 
64
-		{
65
-			$error = ERR_FOLDER_CREATION_FAILED;
66
-		}
67
-		//$error = "For security reason, folder creation function has been disabled.";
68
-	}
69
-	echo "error:'" . $error . "'";
70
-	echo $info;
71
-	echo "}";
49
+                            case "ctime";								
50
+                            case "mtime":
51
+                            case "atime":
52
+                                $v = date(DATE_TIME_FORMAT, $v);
53
+                                break;
54
+                            case 'name':
55
+                                $info .= sprintf(", %s:'%s'", 'short_name', shortenFileName($v));
56
+                                break;
57
+                            case 'cssClass':
58
+                                $v = 'folderEmpty';
59
+                                break;
60
+                        }							
61
+                        $info .= sprintf(", %s:'%s'", $k, $v);
62
+                    }
63
+        }else 
64
+        {
65
+            $error = ERR_FOLDER_CREATION_FAILED;
66
+        }
67
+        //$error = "For security reason, folder creation function has been disabled.";
68
+    }
69
+    echo "error:'" . $error . "'";
70
+    echo $info;
71
+    echo "}";
72 72
 ?>
73 73
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -7,40 +7,40 @@  discard block
 block discarded – undo
7 7
 	 *
8 8
 	 */
9 9
 
10
-	require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php");	
10
+	require_once(dirname(__FILE__).DIRECTORY_SEPARATOR."inc".DIRECTORY_SEPARATOR."config.php");	
11 11
 
12 12
 	echo "{";
13 13
 	$error = "";
14 14
 	$info = "";	
15 15
 /*	$_POST['new_folder'] = substr(md5(time()), 1, 5);
16 16
 	$_POST['currentFolderPath'] = "../../uploaded/";*/
17
-	if(CONFIG_SYS_VIEW_ONLY || !CONFIG_OPTIONS_NEWFOLDER)
17
+	if (CONFIG_SYS_VIEW_ONLY || !CONFIG_OPTIONS_NEWFOLDER)
18 18
 	{
19 19
 		$error = SYS_DISABLED;
20 20
 	}
21
-	elseif(empty($_POST['new_folder']))
21
+	elseif (empty($_POST['new_folder']))
22 22
 	{
23
-		$error  =  ERR_FOLDER_NAME_EMPTY;
24
-	}elseif(!preg_match("/^[a-zA-Z0-9_\- ]+$/", $_POST['new_folder']))
23
+		$error  = ERR_FOLDER_NAME_EMPTY;
24
+	}elseif (!preg_match("/^[a-zA-Z0-9_\- ]+$/", $_POST['new_folder']))
25 25
 	{
26
-		$error  =  ERR_FOLDER_FORMAT;
27
-	}else if(empty($_POST['currentFolderPath']) || !isUnderRoot($_POST['currentFolderPath']))
26
+		$error  = ERR_FOLDER_FORMAT;
27
+	} else if (empty($_POST['currentFolderPath']) || !isUnderRoot($_POST['currentFolderPath']))
28 28
 	{
29 29
 		$error = ERR_FOLDER_PATH_NOT_ALLOWED;
30 30
 	}
31
-	elseif(file_exists(addTrailingSlash($_POST['currentFolderPath']) . $_POST['new_folder']))
31
+	elseif (file_exists(addTrailingSlash($_POST['currentFolderPath']).$_POST['new_folder']))
32 32
 	{
33 33
 		$error = ERR_FOLDER_EXISTS;
34
-	}else
34
+	} else
35 35
 	{
36 36
 	include_once(CLASS_FILE);
37 37
 		$file = new file();
38
-		if($file->mkdir(addTrailingSlash($_POST['currentFolderPath']) . $_POST['new_folder'], 0775))
38
+		if ($file->mkdir(addTrailingSlash($_POST['currentFolderPath']).$_POST['new_folder'], 0775))
39 39
 		{
40 40
 					include_once(CLASS_MANAGER);
41
-					$manager = new manager(addTrailingSlash($_POST['currentFolderPath']) . $_POST['new_folder'], false);
42
-					$pathInfo = $manager->getFolderInfo(addTrailingSlash($_POST['currentFolderPath']) . $_POST['new_folder']);
43
-					foreach($pathInfo as $k=>$v)
41
+					$manager = new manager(addTrailingSlash($_POST['currentFolderPath']).$_POST['new_folder'], false);
42
+					$pathInfo = $manager->getFolderInfo(addTrailingSlash($_POST['currentFolderPath']).$_POST['new_folder']);
43
+					foreach ($pathInfo as $k=>$v)
44 44
 					{				
45 45
 						switch ($k)
46 46
 						{
@@ -60,13 +60,13 @@  discard block
 block discarded – undo
60 60
 						}							
61 61
 						$info .= sprintf(", %s:'%s'", $k, $v);
62 62
 					}
63
-		}else 
63
+		} else 
64 64
 		{
65 65
 			$error = ERR_FOLDER_CREATION_FAILED;
66 66
 		}
67 67
 		//$error = "For security reason, folder creation function has been disabled.";
68 68
 	}
69
-	echo "error:'" . $error . "'";
69
+	echo "error:'".$error."'";
70 70
 	echo $info;
71 71
 	echo "}";
72 72
 ?>
73 73
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +6 added lines, -8 removed lines patch added patch discarded remove patch
@@ -17,21 +17,19 @@  discard block
 block discarded – undo
17 17
 	if(CONFIG_SYS_VIEW_ONLY || !CONFIG_OPTIONS_NEWFOLDER)
18 18
 	{
19 19
 		$error = SYS_DISABLED;
20
-	}
21
-	elseif(empty($_POST['new_folder']))
20
+	} elseif(empty($_POST['new_folder']))
22 21
 	{
23 22
 		$error  =  ERR_FOLDER_NAME_EMPTY;
24
-	}elseif(!preg_match("/^[a-zA-Z0-9_\- ]+$/", $_POST['new_folder']))
23
+	} elseif(!preg_match("/^[a-zA-Z0-9_\- ]+$/", $_POST['new_folder']))
25 24
 	{
26 25
 		$error  =  ERR_FOLDER_FORMAT;
27
-	}else if(empty($_POST['currentFolderPath']) || !isUnderRoot($_POST['currentFolderPath']))
26
+	} else if(empty($_POST['currentFolderPath']) || !isUnderRoot($_POST['currentFolderPath']))
28 27
 	{
29 28
 		$error = ERR_FOLDER_PATH_NOT_ALLOWED;
30
-	}
31
-	elseif(file_exists(addTrailingSlash($_POST['currentFolderPath']) . $_POST['new_folder']))
29
+	} elseif(file_exists(addTrailingSlash($_POST['currentFolderPath']) . $_POST['new_folder']))
32 30
 	{
33 31
 		$error = ERR_FOLDER_EXISTS;
34
-	}else
32
+	} else
35 33
 	{
36 34
 	include_once(CLASS_FILE);
37 35
 		$file = new file();
@@ -60,7 +58,7 @@  discard block
 block discarded – undo
60 58
 						}							
61 59
 						$info .= sprintf(", %s:'%s'", $k, $v);
62 60
 					}
63
-		}else 
61
+		} else 
64 62
 		{
65 63
 			$error = ERR_FOLDER_CREATION_FAILED;
66 64
 		}
Please login to merge, or discard this patch.
phpmyfaq/admin/editor/plugins/ajaxfilemanager/ajax_preview.php 3 patches
Indentation   +50 added lines, -50 removed lines patch added patch discarded remove patch
@@ -1,58 +1,58 @@
 block discarded – undo
1 1
 <?php
2
-	/**
3
-	 * ajax preview
4
-	 * @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
5
-	 * @link www.phpletter.com
6
-	 * @since 22/April/2007
7
-	 *
8
-	 */
9
-	include_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php");	
10
-	echo getRealPath($_GET['path']);
11
-	if(!empty($_GET['path']) && file_exists($_GET['path']) && is_file($_GET['path']))
12
-	{
2
+    /**
3
+     * ajax preview
4
+     * @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
5
+     * @link www.phpletter.com
6
+     * @since 22/April/2007
7
+     *
8
+     */
9
+    include_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php");	
10
+    echo getRealPath($_GET['path']);
11
+    if(!empty($_GET['path']) && file_exists($_GET['path']) && is_file($_GET['path']))
12
+    {
13 13
 		
14
-		include_once(CLASS_MANAGER);
15
-		$manager = new manager($_GET['path'], false);
16
-		$fileTypes = $manager->getFileType(basename($_GET['path']));
17
-		if($fileTypes['preview'])
18
-		{
19
-			switch($fileTypes['fileType'])
20
-			{
21
-				case "image":
22
-					$imageInfo = @getimagesize($_GET['path']);
23
-					if(!empty($imageInfo[0]) && !empty($imageInfo[1]))
24
-					{
25
-						$thumInfo = getThumbWidthHeight($imageInfo[0], $imageInfo[1], 400, 135);
26
-						printf("<img src=\"%s\" width=\"%s\" height=\"%s\" />", getFileUrl($_GET['path']), $thumInfo['width'], $thumInfo['height']);
14
+        include_once(CLASS_MANAGER);
15
+        $manager = new manager($_GET['path'], false);
16
+        $fileTypes = $manager->getFileType(basename($_GET['path']));
17
+        if($fileTypes['preview'])
18
+        {
19
+            switch($fileTypes['fileType'])
20
+            {
21
+                case "image":
22
+                    $imageInfo = @getimagesize($_GET['path']);
23
+                    if(!empty($imageInfo[0]) && !empty($imageInfo[1]))
24
+                    {
25
+                        $thumInfo = getThumbWidthHeight($imageInfo[0], $imageInfo[1], 400, 135);
26
+                        printf("<img src=\"%s\" width=\"%s\" height=\"%s\" />", getFileUrl($_GET['path']), $thumInfo['width'], $thumInfo['height']);
27 27
 													
28
-					}else 
29
-					{
30
-						echo PREVIEW_IMAGE_LOAD_FAILED;
31
-					}
28
+                    }else 
29
+                    {
30
+                        echo PREVIEW_IMAGE_LOAD_FAILED;
31
+                    }
32 32
 
33
-					break;
34
-				case "txt":
35
-					if(($fp = @fopen($_GET['path'], 'r')))
36
-					{
37
-						echo @fread($fp, @filesize($_GET['path']));
38
-						@fclose($fp);
39
-					}else 
40
-					{
41
-						echo PREVIEW_OPEN_FAILED . ".";
42
-					}
43
-					break;
33
+                    break;
34
+                case "txt":
35
+                    if(($fp = @fopen($_GET['path'], 'r')))
36
+                    {
37
+                        echo @fread($fp, @filesize($_GET['path']));
38
+                        @fclose($fp);
39
+                    }else 
40
+                    {
41
+                        echo PREVIEW_OPEN_FAILED . ".";
42
+                    }
43
+                    break;
44 44
 					
45
-				case "video":
46
-					break;
47
-			}
48
-		}else 
49
-		{
50
-			echo PREVIEW_NOT_PREVIEW . "..";
51
-		}		
45
+                case "video":
46
+                    break;
47
+            }
48
+        }else 
49
+        {
50
+            echo PREVIEW_NOT_PREVIEW . "..";
51
+        }		
52 52
 			
53
-	}else 
54
-	{
55
-		echo PREVIEW_NOT_PREVIEW . "...";
56
-	}
53
+    }else 
54
+    {
55
+        echo PREVIEW_NOT_PREVIEW . "...";
56
+    }
57 57
 
58 58
 ?>
59 59
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -6,53 +6,53 @@
 block discarded – undo
6 6
 	 * @since 22/April/2007
7 7
 	 *
8 8
 	 */
9
-	include_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php");	
9
+	include_once(dirname(__FILE__).DIRECTORY_SEPARATOR."inc".DIRECTORY_SEPARATOR."config.php");	
10 10
 	echo getRealPath($_GET['path']);
11
-	if(!empty($_GET['path']) && file_exists($_GET['path']) && is_file($_GET['path']))
11
+	if (!empty($_GET['path']) && file_exists($_GET['path']) && is_file($_GET['path']))
12 12
 	{
13 13
 		
14 14
 		include_once(CLASS_MANAGER);
15 15
 		$manager = new manager($_GET['path'], false);
16 16
 		$fileTypes = $manager->getFileType(basename($_GET['path']));
17
-		if($fileTypes['preview'])
17
+		if ($fileTypes['preview'])
18 18
 		{
19
-			switch($fileTypes['fileType'])
19
+			switch ($fileTypes['fileType'])
20 20
 			{
21 21
 				case "image":
22 22
 					$imageInfo = @getimagesize($_GET['path']);
23
-					if(!empty($imageInfo[0]) && !empty($imageInfo[1]))
23
+					if (!empty($imageInfo[0]) && !empty($imageInfo[1]))
24 24
 					{
25 25
 						$thumInfo = getThumbWidthHeight($imageInfo[0], $imageInfo[1], 400, 135);
26 26
 						printf("<img src=\"%s\" width=\"%s\" height=\"%s\" />", getFileUrl($_GET['path']), $thumInfo['width'], $thumInfo['height']);
27 27
 													
28
-					}else 
28
+					} else 
29 29
 					{
30 30
 						echo PREVIEW_IMAGE_LOAD_FAILED;
31 31
 					}
32 32
 
33 33
 					break;
34 34
 				case "txt":
35
-					if(($fp = @fopen($_GET['path'], 'r')))
35
+					if (($fp = @fopen($_GET['path'], 'r')))
36 36
 					{
37 37
 						echo @fread($fp, @filesize($_GET['path']));
38 38
 						@fclose($fp);
39
-					}else 
39
+					} else 
40 40
 					{
41
-						echo PREVIEW_OPEN_FAILED . ".";
41
+						echo PREVIEW_OPEN_FAILED.".";
42 42
 					}
43 43
 					break;
44 44
 					
45 45
 				case "video":
46 46
 					break;
47 47
 			}
48
-		}else 
48
+		} else 
49 49
 		{
50
-			echo PREVIEW_NOT_PREVIEW . "..";
50
+			echo PREVIEW_NOT_PREVIEW."..";
51 51
 		}		
52 52
 			
53
-	}else 
53
+	} else 
54 54
 	{
55
-		echo PREVIEW_NOT_PREVIEW . "...";
55
+		echo PREVIEW_NOT_PREVIEW."...";
56 56
 	}
57 57
 
58 58
 ?>
59 59
\ No newline at end of file
Please login to merge, or discard this patch.
Braces   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 						$thumInfo = getThumbWidthHeight($imageInfo[0], $imageInfo[1], 400, 135);
26 26
 						printf("<img src=\"%s\" width=\"%s\" height=\"%s\" />", getFileUrl($_GET['path']), $thumInfo['width'], $thumInfo['height']);
27 27
 													
28
-					}else 
28
+					} else 
29 29
 					{
30 30
 						echo PREVIEW_IMAGE_LOAD_FAILED;
31 31
 					}
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 					{
37 37
 						echo @fread($fp, @filesize($_GET['path']));
38 38
 						@fclose($fp);
39
-					}else 
39
+					} else 
40 40
 					{
41 41
 						echo PREVIEW_OPEN_FAILED . ".";
42 42
 					}
@@ -45,12 +45,12 @@  discard block
 block discarded – undo
45 45
 				case "video":
46 46
 					break;
47 47
 			}
48
-		}else 
48
+		} else 
49 49
 		{
50 50
 			echo PREVIEW_NOT_PREVIEW . "..";
51 51
 		}		
52 52
 			
53
-	}else 
53
+	} else 
54 54
 	{
55 55
 		echo PREVIEW_NOT_PREVIEW . "...";
56 56
 	}
Please login to merge, or discard this patch.
phpmyfaq/admin/editor/plugins/ajaxfilemanager/ajax_file_upload.php 3 patches
Indentation   +71 added lines, -71 removed lines patch added patch discarded remove patch
@@ -1,86 +1,86 @@
 block discarded – undo
1 1
 <?php
2
-	/**
3
-	 * processing the uploaded files
4
-	 * @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
5
-	 * @link www.phpletter.com
6
-	 * @since 22/May/2007
7
-	 *
8
-	 */	
2
+    /**
3
+     * processing the uploaded files
4
+     * @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
5
+     * @link www.phpletter.com
6
+     * @since 22/May/2007
7
+     *
8
+     */	
9 9
 
10
-	require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php");
11
-	echo "{";
12
-	$error = "";
13
-	$info = "";
10
+    require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php");
11
+    echo "{";
12
+    $error = "";
13
+    $info = "";
14 14
 	
15
-	include_once(CLASS_UPLOAD);
16
-	$upload = new Upload();
15
+    include_once(CLASS_UPLOAD);
16
+    $upload = new Upload();
17 17
 								
18
-	$upload->setInvalidFileExt(explode(",", CONFIG_UPLOAD_INVALID_EXTS));
19
-	if(CONFIG_SYS_VIEW_ONLY || !CONFIG_OPTIONS_UPLOAD)
20
-	{
21
-		$error = SYS_DISABLED;
22
-	}
23
-	elseif(empty($_GET['folder']) || !isUnderRoot($_GET['folder']))
24
-	{
25
-		$error = ERR_FOLDER_PATH_NOT_ALLOWED;
26
-	}else	if(!$upload->isFileUploaded('file'))
27
-	{
28
-		$error = ERR_FILE_NOT_UPLOADED;
29
-	}else if(!$upload->moveUploadedFile($_GET['folder']))
30
-	{
31
-		$error = ERR_FILE_MOVE_FAILED;
32
-	}	
33
-	elseif(!$upload->isPermittedFileExt(explode(",", CONFIG_UPLOAD_VALID_EXTS)))
34
-	{		
35
-		$error = ERR_FILE_TYPE_NOT_ALLOWED;
36
-	}elseif(defined('CONFIG_UPLOAD_MAXSIZE') && CONFIG_UPLOAD_MAXSIZE && $upload->isSizeTooBig(CONFIG_UPLOAD_MAXSIZE))
37
-	{		
38
-		 $error = sprintf(ERROR_FILE_TOO_BID, transformFileSize(CONFIG_UPLOAD_MAXSIZE));
39
-	}else
40
-	{
41
-							include_once(CLASS_FILE);
42
-							$path = $upload->getFilePath();
43
-							$obj = new file($path);
44
-							$tem = $obj->getFileInfo();							
45
-							if(sizeof($tem))
46
-							{	
47
-								include_once(CLASS_MANAGER);
18
+    $upload->setInvalidFileExt(explode(",", CONFIG_UPLOAD_INVALID_EXTS));
19
+    if(CONFIG_SYS_VIEW_ONLY || !CONFIG_OPTIONS_UPLOAD)
20
+    {
21
+        $error = SYS_DISABLED;
22
+    }
23
+    elseif(empty($_GET['folder']) || !isUnderRoot($_GET['folder']))
24
+    {
25
+        $error = ERR_FOLDER_PATH_NOT_ALLOWED;
26
+    }else	if(!$upload->isFileUploaded('file'))
27
+    {
28
+        $error = ERR_FILE_NOT_UPLOADED;
29
+    }else if(!$upload->moveUploadedFile($_GET['folder']))
30
+    {
31
+        $error = ERR_FILE_MOVE_FAILED;
32
+    }	
33
+    elseif(!$upload->isPermittedFileExt(explode(",", CONFIG_UPLOAD_VALID_EXTS)))
34
+    {		
35
+        $error = ERR_FILE_TYPE_NOT_ALLOWED;
36
+    }elseif(defined('CONFIG_UPLOAD_MAXSIZE') && CONFIG_UPLOAD_MAXSIZE && $upload->isSizeTooBig(CONFIG_UPLOAD_MAXSIZE))
37
+    {		
38
+            $error = sprintf(ERROR_FILE_TOO_BID, transformFileSize(CONFIG_UPLOAD_MAXSIZE));
39
+    }else
40
+    {
41
+                            include_once(CLASS_FILE);
42
+                            $path = $upload->getFilePath();
43
+                            $obj = new file($path);
44
+                            $tem = $obj->getFileInfo();							
45
+                            if(sizeof($tem))
46
+                            {	
47
+                                include_once(CLASS_MANAGER);
48 48
 							
49
-								$manager = new manager($upload->getFilePath(), false);			
49
+                                $manager = new manager($upload->getFilePath(), false);			
50 50
 															
51
-								$fileType = $manager->getFileType($upload->getFileName());
51
+                                $fileType = $manager->getFileType($upload->getFileName());
52 52
 
53
-								foreach($fileType as $k=>$v)
54
-								{
55
-									$tem[$k] = $v;
56
-								}
53
+                                foreach($fileType as $k=>$v)
54
+                                {
55
+                                    $tem[$k] = $v;
56
+                                }
57 57
 								
58
-								$tem['path'] = backslashToSlash($path);		
59
-								$tem['type'] = "file";
60
-								$tem['size'] = transformFileSize($tem['size']);
61
-								$tem['ctime'] = date(DATE_TIME_FORMAT, $tem['ctime']);
62
-								$tem['mtime'] = date(DATE_TIME_FORMAT, $tem['mtime']);
63
-								$tem['short_name'] = shortenFileName($tem['name']);						
64
-								$tem['flag'] = 'noFlag';
65
-								$obj->close();
66
-								foreach($tem as $k=>$v)
67
-								{
68
-										$info .= sprintf(", %s:'%s'", $k, $v);									
69
-								}
58
+                                $tem['path'] = backslashToSlash($path);		
59
+                                $tem['type'] = "file";
60
+                                $tem['size'] = transformFileSize($tem['size']);
61
+                                $tem['ctime'] = date(DATE_TIME_FORMAT, $tem['ctime']);
62
+                                $tem['mtime'] = date(DATE_TIME_FORMAT, $tem['mtime']);
63
+                                $tem['short_name'] = shortenFileName($tem['name']);						
64
+                                $tem['flag'] = 'noFlag';
65
+                                $obj->close();
66
+                                foreach($tem as $k=>$v)
67
+                                {
68
+                                        $info .= sprintf(", %s:'%s'", $k, $v);									
69
+                                }
70 70
 
71
-								$info .= sprintf(", url:'%s'",  getFileUrl($path));
72
-								$info .= sprintf(", tipedit:'%s'",  TIP_DOC_RENAME);		
71
+                                $info .= sprintf(", url:'%s'",  getFileUrl($path));
72
+                                $info .= sprintf(", tipedit:'%s'",  TIP_DOC_RENAME);		
73 73
 
74 74
 																				
75
-							}else 
76
-							{
77
-								$error = ERR_FILE_NOT_AVAILABLE;
78
-							}
75
+                            }else 
76
+                            {
77
+                                $error = ERR_FILE_NOT_AVAILABLE;
78
+                            }
79 79
 
80 80
 
81
-	}
82
-	echo "error:'" . $error . "'";
83
-	echo $info;
84
-	echo "}";
81
+    }
82
+    echo "error:'" . $error . "'";
83
+    echo $info;
84
+    echo "}";
85 85
 	
86 86
 ?>
87 87
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 	 *
8 8
 	 */	
9 9
 
10
-	require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php");
10
+	require_once(dirname(__FILE__).DIRECTORY_SEPARATOR."inc".DIRECTORY_SEPARATOR."config.php");
11 11
 	echo "{";
12 12
 	$error = "";
13 13
 	$info = "";
@@ -16,33 +16,33 @@  discard block
 block discarded – undo
16 16
 	$upload = new Upload();
17 17
 								
18 18
 	$upload->setInvalidFileExt(explode(",", CONFIG_UPLOAD_INVALID_EXTS));
19
-	if(CONFIG_SYS_VIEW_ONLY || !CONFIG_OPTIONS_UPLOAD)
19
+	if (CONFIG_SYS_VIEW_ONLY || !CONFIG_OPTIONS_UPLOAD)
20 20
 	{
21 21
 		$error = SYS_DISABLED;
22 22
 	}
23
-	elseif(empty($_GET['folder']) || !isUnderRoot($_GET['folder']))
23
+	elseif (empty($_GET['folder']) || !isUnderRoot($_GET['folder']))
24 24
 	{
25 25
 		$error = ERR_FOLDER_PATH_NOT_ALLOWED;
26
-	}else	if(!$upload->isFileUploaded('file'))
26
+	} else	if (!$upload->isFileUploaded('file'))
27 27
 	{
28 28
 		$error = ERR_FILE_NOT_UPLOADED;
29
-	}else if(!$upload->moveUploadedFile($_GET['folder']))
29
+	} else if (!$upload->moveUploadedFile($_GET['folder']))
30 30
 	{
31 31
 		$error = ERR_FILE_MOVE_FAILED;
32 32
 	}	
33
-	elseif(!$upload->isPermittedFileExt(explode(",", CONFIG_UPLOAD_VALID_EXTS)))
33
+	elseif (!$upload->isPermittedFileExt(explode(",", CONFIG_UPLOAD_VALID_EXTS)))
34 34
 	{		
35 35
 		$error = ERR_FILE_TYPE_NOT_ALLOWED;
36
-	}elseif(defined('CONFIG_UPLOAD_MAXSIZE') && CONFIG_UPLOAD_MAXSIZE && $upload->isSizeTooBig(CONFIG_UPLOAD_MAXSIZE))
36
+	}elseif (defined('CONFIG_UPLOAD_MAXSIZE') && CONFIG_UPLOAD_MAXSIZE && $upload->isSizeTooBig(CONFIG_UPLOAD_MAXSIZE))
37 37
 	{		
38 38
 		 $error = sprintf(ERROR_FILE_TOO_BID, transformFileSize(CONFIG_UPLOAD_MAXSIZE));
39
-	}else
39
+	} else
40 40
 	{
41 41
 							include_once(CLASS_FILE);
42 42
 							$path = $upload->getFilePath();
43 43
 							$obj = new file($path);
44 44
 							$tem = $obj->getFileInfo();							
45
-							if(sizeof($tem))
45
+							if (sizeof($tem))
46 46
 							{	
47 47
 								include_once(CLASS_MANAGER);
48 48
 							
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
 															
51 51
 								$fileType = $manager->getFileType($upload->getFileName());
52 52
 
53
-								foreach($fileType as $k=>$v)
53
+								foreach ($fileType as $k=>$v)
54 54
 								{
55 55
 									$tem[$k] = $v;
56 56
 								}
@@ -63,23 +63,23 @@  discard block
 block discarded – undo
63 63
 								$tem['short_name'] = shortenFileName($tem['name']);						
64 64
 								$tem['flag'] = 'noFlag';
65 65
 								$obj->close();
66
-								foreach($tem as $k=>$v)
66
+								foreach ($tem as $k=>$v)
67 67
 								{
68 68
 										$info .= sprintf(", %s:'%s'", $k, $v);									
69 69
 								}
70 70
 
71
-								$info .= sprintf(", url:'%s'",  getFileUrl($path));
72
-								$info .= sprintf(", tipedit:'%s'",  TIP_DOC_RENAME);		
71
+								$info .= sprintf(", url:'%s'", getFileUrl($path));
72
+								$info .= sprintf(", tipedit:'%s'", TIP_DOC_RENAME);		
73 73
 
74 74
 																				
75
-							}else 
75
+							} else 
76 76
 							{
77 77
 								$error = ERR_FILE_NOT_AVAILABLE;
78 78
 							}
79 79
 
80 80
 
81 81
 	}
82
-	echo "error:'" . $error . "'";
82
+	echo "error:'".$error."'";
83 83
 	echo $info;
84 84
 	echo "}";
85 85
 	
Please login to merge, or discard this patch.
Braces   +7 added lines, -9 removed lines patch added patch discarded remove patch
@@ -19,24 +19,22 @@  discard block
 block discarded – undo
19 19
 	if(CONFIG_SYS_VIEW_ONLY || !CONFIG_OPTIONS_UPLOAD)
20 20
 	{
21 21
 		$error = SYS_DISABLED;
22
-	}
23
-	elseif(empty($_GET['folder']) || !isUnderRoot($_GET['folder']))
22
+	} elseif(empty($_GET['folder']) || !isUnderRoot($_GET['folder']))
24 23
 	{
25 24
 		$error = ERR_FOLDER_PATH_NOT_ALLOWED;
26
-	}else	if(!$upload->isFileUploaded('file'))
25
+	} else	if(!$upload->isFileUploaded('file'))
27 26
 	{
28 27
 		$error = ERR_FILE_NOT_UPLOADED;
29
-	}else if(!$upload->moveUploadedFile($_GET['folder']))
28
+	} else if(!$upload->moveUploadedFile($_GET['folder']))
30 29
 	{
31 30
 		$error = ERR_FILE_MOVE_FAILED;
32
-	}	
33
-	elseif(!$upload->isPermittedFileExt(explode(",", CONFIG_UPLOAD_VALID_EXTS)))
31
+	} elseif(!$upload->isPermittedFileExt(explode(",", CONFIG_UPLOAD_VALID_EXTS)))
34 32
 	{		
35 33
 		$error = ERR_FILE_TYPE_NOT_ALLOWED;
36
-	}elseif(defined('CONFIG_UPLOAD_MAXSIZE') && CONFIG_UPLOAD_MAXSIZE && $upload->isSizeTooBig(CONFIG_UPLOAD_MAXSIZE))
34
+	} elseif(defined('CONFIG_UPLOAD_MAXSIZE') && CONFIG_UPLOAD_MAXSIZE && $upload->isSizeTooBig(CONFIG_UPLOAD_MAXSIZE))
37 35
 	{		
38 36
 		 $error = sprintf(ERROR_FILE_TOO_BID, transformFileSize(CONFIG_UPLOAD_MAXSIZE));
39
-	}else
37
+	} else
40 38
 	{
41 39
 							include_once(CLASS_FILE);
42 40
 							$path = $upload->getFilePath();
@@ -72,7 +70,7 @@  discard block
 block discarded – undo
72 70
 								$info .= sprintf(", tipedit:'%s'",  TIP_DOC_RENAME);		
73 71
 
74 72
 																				
75
-							}else 
73
+							} else 
76 74
 							{
77 75
 								$error = ERR_FILE_NOT_AVAILABLE;
78 76
 							}
Please login to merge, or discard this patch.
phpmyfaq/admin/editor/plugins/ajaxfilemanager/ajax_download.php 3 patches
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -1,32 +1,32 @@
 block discarded – undo
1 1
 <?php
2
-	/**
3
-	 * delete selected files
4
-	 * @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
5
-	 * @link www.phpletter.com
6
-	 * @since 22/April/2007
7
-	 *
8
-	 */
2
+    /**
3
+     * delete selected files
4
+     * @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
5
+     * @link www.phpletter.com
6
+     * @since 22/April/2007
7
+     *
8
+     */
9 9
 
10
-	require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php");
11
-	if(!empty($_GET['path']) && file_exists($_GET['path']) && is_file($_GET['path']) && isUnderRoot($_GET['path']))
12
-	{
10
+    require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php");
11
+    if(!empty($_GET['path']) && file_exists($_GET['path']) && is_file($_GET['path']) && isUnderRoot($_GET['path']))
12
+    {
13 13
 			
14
-			$path = $_GET['path'];
15
-			//check if the file size
16
-			$fileSize = @filesize($path);
14
+            $path = $_GET['path'];
15
+            //check if the file size
16
+            $fileSize = @filesize($path);
17 17
 			
18
-			if($fileSize > getMemoryLimit())
19
-			{//larger then the php memory limit, redirect to the file
18
+            if($fileSize > getMemoryLimit())
19
+            {//larger then the php memory limit, redirect to the file
20 20
 				
21
-				header('Location: ' . $path);
22
-				exit;				 
23
-			}else 
24
-			{//open it up and send out with php 
25
-				downloadFile($path);	
21
+                header('Location: ' . $path);
22
+                exit;				 
23
+            }else 
24
+            {//open it up and send out with php 
25
+                downloadFile($path);	
26 26
 				 			
27
-			}
28
-	}else 
29
-	{
30
-		die(ERR_DOWNLOAD_FILE_NOT_FOUND);
31
-	}
27
+            }
28
+    }else 
29
+    {
30
+        die(ERR_DOWNLOAD_FILE_NOT_FOUND);
31
+    }
32 32
 ?>
33 33
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -7,25 +7,25 @@
 block discarded – undo
7 7
 	 *
8 8
 	 */
9 9
 
10
-	require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php");
11
-	if(!empty($_GET['path']) && file_exists($_GET['path']) && is_file($_GET['path']) && isUnderRoot($_GET['path']))
10
+	require_once(dirname(__FILE__).DIRECTORY_SEPARATOR."inc".DIRECTORY_SEPARATOR."config.php");
11
+	if (!empty($_GET['path']) && file_exists($_GET['path']) && is_file($_GET['path']) && isUnderRoot($_GET['path']))
12 12
 	{
13 13
 			
14 14
 			$path = $_GET['path'];
15 15
 			//check if the file size
16 16
 			$fileSize = @filesize($path);
17 17
 			
18
-			if($fileSize > getMemoryLimit())
18
+			if ($fileSize > getMemoryLimit())
19 19
 			{//larger then the php memory limit, redirect to the file
20 20
 				
21
-				header('Location: ' . $path);
21
+				header('Location: '.$path);
22 22
 				exit;				 
23
-			}else 
23
+			} else 
24 24
 			{//open it up and send out with php 
25 25
 				downloadFile($path);	
26 26
 				 			
27 27
 			}
28
-	}else 
28
+	} else 
29 29
 	{
30 30
 		die(ERR_DOWNLOAD_FILE_NOT_FOUND);
31 31
 	}
Please login to merge, or discard this patch.
Braces   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -20,12 +20,12 @@
 block discarded – undo
20 20
 				
21 21
 				header('Location: ' . $path);
22 22
 				exit;				 
23
-			}else 
23
+			} else 
24 24
 			{//open it up and send out with php 
25 25
 				downloadFile($path);	
26 26
 				 			
27 27
 			}
28
-	}else 
28
+	} else 
29 29
 	{
30 30
 		die(ERR_DOWNLOAD_FILE_NOT_FOUND);
31 31
 	}
Please login to merge, or discard this patch.
phpmyfaq/admin/editor/plugins/ajaxfilemanager/ajax_image_editor.php 3 patches
Indentation   +37 added lines, -37 removed lines patch added patch discarded remove patch
@@ -1,42 +1,42 @@  discard block
 block discarded – undo
1 1
 <?php
2
-		/**
3
-	 * Ajax image editor platform
4
-	 * @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
5
-	 * @link www.phpletter.com
6
-	 * @since 22/May/2007
7
-	 *
8
-	 */
9
-	require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php");
10
-	if(CONFIG_SYS_VIEW_ONLY || !CONFIG_OPTIONS_EDITABLE)
11
-	{
12
-		die(SYS_DISABLED);
13
-	}
14
-		$session->gc();
15
-		$_GET['path'] = empty($_GET['path'])?CONFIG_SYS_ROOT_PATH . "ajax_image_editor_demo.jpg":$_GET['path'];
16
-		if(!empty($_GET['path']) && file_exists($_GET['path']) && is_file($_GET['path']) && isUnderRoot($_GET['path']))
17
-		{
18
-				$path = $_GET['path'];
19
-		}else 
20
-		{
21
-			die(IMG_GEN_IMG_NOT_EXISTS);
22
-		}
23
-		require_once(CLASS_HISTORY);
24
-		$history = new History($path, $session);
25
-		if(CONFIG_SYS_DEMO_ENABLE)
26
-		{
27
-			$sessionImageInfo = $history->getLastestRestorable();
28
-			$originalSessionImageInfo = $history->getOriginalImage();
29
-			if(sizeof($originalSessionImageInfo))
30
-			{
31
-				$path = backslashToSlash($session->getSessionDir() . $originalSessionImageInfo['info']['name']);
32
-			}
33
-		}
34
-		require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "class.image.php");
35
-		$image = new Image();
2
+        /**
3
+         * Ajax image editor platform
4
+         * @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn)
5
+         * @link www.phpletter.com
6
+         * @since 22/May/2007
7
+         *
8
+         */
9
+    require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php");
10
+    if(CONFIG_SYS_VIEW_ONLY || !CONFIG_OPTIONS_EDITABLE)
11
+    {
12
+        die(SYS_DISABLED);
13
+    }
14
+        $session->gc();
15
+        $_GET['path'] = empty($_GET['path'])?CONFIG_SYS_ROOT_PATH . "ajax_image_editor_demo.jpg":$_GET['path'];
16
+        if(!empty($_GET['path']) && file_exists($_GET['path']) && is_file($_GET['path']) && isUnderRoot($_GET['path']))
17
+        {
18
+                $path = $_GET['path'];
19
+        }else 
20
+        {
21
+            die(IMG_GEN_IMG_NOT_EXISTS);
22
+        }
23
+        require_once(CLASS_HISTORY);
24
+        $history = new History($path, $session);
25
+        if(CONFIG_SYS_DEMO_ENABLE)
26
+        {
27
+            $sessionImageInfo = $history->getLastestRestorable();
28
+            $originalSessionImageInfo = $history->getOriginalImage();
29
+            if(sizeof($originalSessionImageInfo))
30
+            {
31
+                $path = backslashToSlash($session->getSessionDir() . $originalSessionImageInfo['info']['name']);
32
+            }
33
+        }
34
+        require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "class.image.php");
35
+        $image = new Image();
36 36
 		
37
-		$imageInfo = $image->getImageInfo($path);
37
+        $imageInfo = $image->getImageInfo($path);
38 38
 
39
-	?>
39
+    ?>
40 40
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
41 41
 <html xmlns="http://www.w3.org/1999/xhtml">
42 42
 <head>
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
 </head>
103 103
 <body>
104 104
 <?php
105
-	//displayArray($_SESSION);
105
+    //displayArray($_SESSION);
106 106
 	 
107 107
 ?>
108 108
 <div id="controls">
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -6,32 +6,32 @@
 block discarded – undo
6 6
 	 * @since 22/May/2007
7 7
 	 *
8 8
 	 */
9
-	require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php");
10
-	if(CONFIG_SYS_VIEW_ONLY || !CONFIG_OPTIONS_EDITABLE)
9
+	require_once(dirname(__FILE__).DIRECTORY_SEPARATOR."inc".DIRECTORY_SEPARATOR."config.php");
10
+	if (CONFIG_SYS_VIEW_ONLY || !CONFIG_OPTIONS_EDITABLE)
11 11
 	{
12 12
 		die(SYS_DISABLED);
13 13
 	}
14 14
 		$session->gc();
15
-		$_GET['path'] = empty($_GET['path'])?CONFIG_SYS_ROOT_PATH . "ajax_image_editor_demo.jpg":$_GET['path'];
16
-		if(!empty($_GET['path']) && file_exists($_GET['path']) && is_file($_GET['path']) && isUnderRoot($_GET['path']))
15
+		$_GET['path'] = empty($_GET['path']) ? CONFIG_SYS_ROOT_PATH."ajax_image_editor_demo.jpg" : $_GET['path'];
16
+		if (!empty($_GET['path']) && file_exists($_GET['path']) && is_file($_GET['path']) && isUnderRoot($_GET['path']))
17 17
 		{
18 18
 				$path = $_GET['path'];
19
-		}else 
19
+		} else 
20 20
 		{
21 21
 			die(IMG_GEN_IMG_NOT_EXISTS);
22 22
 		}
23 23
 		require_once(CLASS_HISTORY);
24 24
 		$history = new History($path, $session);
25
-		if(CONFIG_SYS_DEMO_ENABLE)
25
+		if (CONFIG_SYS_DEMO_ENABLE)
26 26
 		{
27 27
 			$sessionImageInfo = $history->getLastestRestorable();
28 28
 			$originalSessionImageInfo = $history->getOriginalImage();
29
-			if(sizeof($originalSessionImageInfo))
29
+			if (sizeof($originalSessionImageInfo))
30 30
 			{
31
-				$path = backslashToSlash($session->getSessionDir() . $originalSessionImageInfo['info']['name']);
31
+				$path = backslashToSlash($session->getSessionDir().$originalSessionImageInfo['info']['name']);
32 32
 			}
33 33
 		}
34
-		require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "class.image.php");
34
+		require_once(dirname(__FILE__).DIRECTORY_SEPARATOR."inc".DIRECTORY_SEPARATOR."class.image.php");
35 35
 		$image = new Image();
36 36
 		
37 37
 		$imageInfo = $image->getImageInfo($path);
Please login to merge, or discard this patch.
Braces   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -16,7 +16,7 @@
 block discarded – undo
16 16
 		if(!empty($_GET['path']) && file_exists($_GET['path']) && is_file($_GET['path']) && isUnderRoot($_GET['path']))
17 17
 		{
18 18
 				$path = $_GET['path'];
19
-		}else 
19
+		} else 
20 20
 		{
21 21
 			die(IMG_GEN_IMG_NOT_EXISTS);
22 22
 		}
Please login to merge, or discard this patch.
phpmyfaq/admin/editor/plugins/ajaxfilemanager/ajax_login.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -6,10 +6,10 @@  discard block
 block discarded – undo
6 6
      * @since 22/April/2007
7 7
      *
8 8
      */
9
-require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php");
9
+require_once(dirname(__FILE__).DIRECTORY_SEPARATOR."inc".DIRECTORY_SEPARATOR."config.php");
10 10
 
11 11
 $user = PMF_User_CurrentUser::getFromCookie($faqConfig);
12
-if (! $user instanceof PMF_User_CurrentUser) {
12
+if (!$user instanceof PMF_User_CurrentUser) {
13 13
     $user = PMF_User_CurrentUser::getFromSession($faqConfig);
14 14
 }
15 15
 
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 
32 32
     if ($permission['addattachment']) {
33 33
         $_SESSION['ajax_user'] = true;
34
-        header('Location: ' . appendQueryString(CONFIG_URL_HOME, makeQueryString()));
34
+        header('Location: '.appendQueryString(CONFIG_URL_HOME, makeQueryString()));
35 35
         exit;
36 36
     }
37 37
 }
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -75,8 +75,9 @@
 block discarded – undo
75 75
     // check user rights, set them TRUE
76 76
     $allUserRights = $user->perm->getAllUserRights($user->getUserId());
77 77
     foreach ($allRights as $right) {
78
-        if (in_array($right['right_id'], $allUserRights))
79
-            $permission[$right['name']] = true;
78
+        if (in_array($right['right_id'], $allUserRights)) {
79
+                    $permission[$right['name']] = true;
80
+        }
80 81
     }
81 82
 }
82 83
 
Please login to merge, or discard this patch.
admin/editor/plugins/ajaxfilemanager/_ajax_get_thumbnail_listing.php 2 patches
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -1,34 +1,34 @@  discard block
 block discarded – undo
1 1
 <?php
2
-	if(!defined('AJAX_INIT_DONE'))
3
-	{
4
-		die('Permission denied');
5
-	}
2
+    if(!defined('AJAX_INIT_DONE'))
3
+    {
4
+        die('Permission denied');
5
+    }
6 6
 ?><div id="content">
7 7
 <?php 
8 8
 
9
-		$count = 1;
10
-		$thumbnailBaseUrl = appendQueryString(CONFIG_URL_IMG_THUMBNAIL, makeQueryString(array('path')));
11
-		foreach($fileList as $file)
9
+        $count = 1;
10
+        $thumbnailBaseUrl = appendQueryString(CONFIG_URL_IMG_THUMBNAIL, makeQueryString(array('path')));
11
+        foreach($fileList as $file)
12 12
 		
13
-		{
14
-			?>
13
+        {
14
+            ?>
15 15
 			<dl class="thumbnailListing" id="dl<?php echo $count; ?>">
16 16
 				<dt id="dt<?php echo $count; ?>" class="<?php echo ($file['type'] == 'folder' && empty($file['file']) && empty($file['subdir'])?'folderEmpty':$file['cssClass']); ?>" class="<?php echo $file['cssClass']; ?>">
17 17
 				<?php
18
-					switch($file['cssClass'])
19
-					{
20
-						case 'filePicture':
21
-								echo '<a id="thumbUrl' . $count . '" rel="thumbPhotos" href="' . $file['path'] . '">';
22
-								echo '<img src="' . appendQueryString($thumbnailBaseUrl, 'path=' . $file['path']) . '" id="thumbImg' . $count . '"></a>' . "\n";
23
-								break;
24
-						case 'fileFlash':
25
-						case 'fileVideo':
26
-						case 'fileMusic':
27
-							break;
28
-						default:
29
-							echo '&nbsp;';
30
-					}
31
-				?>
18
+                    switch($file['cssClass'])
19
+                    {
20
+                        case 'filePicture':
21
+                                echo '<a id="thumbUrl' . $count . '" rel="thumbPhotos" href="' . $file['path'] . '">';
22
+                                echo '<img src="' . appendQueryString($thumbnailBaseUrl, 'path=' . $file['path']) . '" id="thumbImg' . $count . '"></a>' . "\n";
23
+                                break;
24
+                        case 'fileFlash':
25
+                        case 'fileVideo':
26
+                        case 'fileMusic':
27
+                            break;
28
+                        default:
29
+                            echo '&nbsp;';
30
+                    }
31
+                ?>
32 32
 				
33 33
 				</dt>
34 34
 				<dd id="dd<?php echo $count; ?>" class="thumbnailListing_info"><span id="flag<?php echo $count; ?>" class="<?php echo $file['flag']; ?>">&nbsp;</span><input id="cb<?php echo $count; ?>" type="checkbox" name="check[]" <?php echo ($file['is_writable']?'':'disabled'); ?> class="radio" value="<?php echo $file['path']; ?>" />
@@ -36,7 +36,7 @@  discard block
 block discarded – undo
36 36
 				
37 37
 			</dl>
38 38
 			<?php
39
-			$count++;
40
-		}
39
+            $count++;
40
+        }
41 41
 ?>
42 42
 </div>
43 43
\ No newline at end of file
Please login to merge, or discard this patch.
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php
2
-	if(!defined('AJAX_INIT_DONE'))
2
+	if (!defined('AJAX_INIT_DONE'))
3 3
 	{
4 4
 		die('Permission denied');
5 5
 	}
@@ -8,18 +8,18 @@  discard block
 block discarded – undo
8 8
 
9 9
 		$count = 1;
10 10
 		$thumbnailBaseUrl = appendQueryString(CONFIG_URL_IMG_THUMBNAIL, makeQueryString(array('path')));
11
-		foreach($fileList as $file)
11
+		foreach ($fileList as $file)
12 12
 		
13 13
 		{
14 14
 			?>
15 15
 			<dl class="thumbnailListing" id="dl<?php echo $count; ?>">
16
-				<dt id="dt<?php echo $count; ?>" class="<?php echo ($file['type'] == 'folder' && empty($file['file']) && empty($file['subdir'])?'folderEmpty':$file['cssClass']); ?>" class="<?php echo $file['cssClass']; ?>">
16
+				<dt id="dt<?php echo $count; ?>" class="<?php echo ($file['type'] == 'folder' && empty($file['file']) && empty($file['subdir']) ? 'folderEmpty' : $file['cssClass']); ?>" class="<?php echo $file['cssClass']; ?>">
17 17
 				<?php
18
-					switch($file['cssClass'])
18
+					switch ($file['cssClass'])
19 19
 					{
20 20
 						case 'filePicture':
21
-								echo '<a id="thumbUrl' . $count . '" rel="thumbPhotos" href="' . $file['path'] . '">';
22
-								echo '<img src="' . appendQueryString($thumbnailBaseUrl, 'path=' . $file['path']) . '" id="thumbImg' . $count . '"></a>' . "\n";
21
+								echo '<a id="thumbUrl'.$count.'" rel="thumbPhotos" href="'.$file['path'].'">';
22
+								echo '<img src="'.appendQueryString($thumbnailBaseUrl, 'path='.$file['path']).'" id="thumbImg'.$count.'"></a>'."\n";
23 23
 								break;
24 24
 						case 'fileFlash':
25 25
 						case 'fileVideo':
@@ -31,8 +31,8 @@  discard block
 block discarded – undo
31 31
 				?>
32 32
 				
33 33
 				</dt>
34
-				<dd id="dd<?php echo $count; ?>" class="thumbnailListing_info"><span id="flag<?php echo $count; ?>" class="<?php echo $file['flag']; ?>">&nbsp;</span><input id="cb<?php echo $count; ?>" type="checkbox" name="check[]" <?php echo ($file['is_writable']?'':'disabled'); ?> class="radio" value="<?php echo $file['path']; ?>" />
35
-				<a <?php echo ($file['cssClass']== 'filePicture'?'rel="orgImg"':''); ?> href="<?php echo $file['path']; ?>" title="<?php echo $file['name']; ?>" id="a<?php echo $count; ?>"><?php echo shortenFileName($file['name']); ?></a></dd>
34
+				<dd id="dd<?php echo $count; ?>" class="thumbnailListing_info"><span id="flag<?php echo $count; ?>" class="<?php echo $file['flag']; ?>">&nbsp;</span><input id="cb<?php echo $count; ?>" type="checkbox" name="check[]" <?php echo ($file['is_writable'] ? '' : 'disabled'); ?> class="radio" value="<?php echo $file['path']; ?>" />
35
+				<a <?php echo ($file['cssClass'] == 'filePicture' ? 'rel="orgImg"' : ''); ?> href="<?php echo $file['path']; ?>" title="<?php echo $file['name']; ?>" id="a<?php echo $count; ?>"><?php echo shortenFileName($file['name']); ?></a></dd>
36 36
 				
37 37
 			</dl>
38 38
 			<?php
Please login to merge, or discard this patch.