@@ -1,116 +1,116 @@ |
||
1 | 1 | <?php |
2 | - /** |
|
3 | - * reset the image |
|
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(!isset($_POST['path'])) |
|
11 | - { |
|
12 | - $_POST['path'] = "uploaded/Winter.jpg" . "?" . makeQueryString(array('path')); |
|
13 | - //for crop |
|
14 | - $_POST['mode'] = "crop"; |
|
15 | - $_POST['x'] = 100; |
|
16 | - $_POST['y'] = 100; |
|
17 | - $imageInfo = @GetImageSize($_POST['path']); |
|
18 | - $_POST['width'] = $imageInfo[0]; |
|
19 | - $_POST['height'] = $imageInfo[1]; |
|
2 | + /** |
|
3 | + * reset the image |
|
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(!isset($_POST['path'])) |
|
11 | + { |
|
12 | + $_POST['path'] = "uploaded/Winter.jpg" . "?" . makeQueryString(array('path')); |
|
13 | + //for crop |
|
14 | + $_POST['mode'] = "crop"; |
|
15 | + $_POST['x'] = 100; |
|
16 | + $_POST['y'] = 100; |
|
17 | + $imageInfo = @GetImageSize($_POST['path']); |
|
18 | + $_POST['width'] = $imageInfo[0]; |
|
19 | + $_POST['height'] = $imageInfo[1]; |
|
20 | 20 | |
21 | - } |
|
22 | - initSessionHistory($_POST['path']); |
|
21 | + } |
|
22 | + initSessionHistory($_POST['path']); |
|
23 | 23 | |
24 | - echo "{"; |
|
25 | - $error = ""; |
|
26 | - $info = ""; |
|
24 | + echo "{"; |
|
25 | + $error = ""; |
|
26 | + $info = ""; |
|
27 | 27 | |
28 | - if(empty($_POST['path'])) |
|
29 | - { |
|
30 | - $error = IMG_SAVE_EMPTY_PATH; |
|
31 | - }elseif(!file_exists($_POST['path'])) |
|
32 | - { |
|
33 | - $error = IMG_SAVE_NOT_EXISTS; |
|
34 | - }else if(!isUnderRoot($_POST['path'])) |
|
35 | - { |
|
36 | - $error = IMG_SAVE_PATH_DISALLOWED; |
|
37 | - } |
|
38 | - else |
|
39 | - { |
|
40 | - if(!empty($_POST['mode'])) |
|
41 | - { |
|
28 | + if(empty($_POST['path'])) |
|
29 | + { |
|
30 | + $error = IMG_SAVE_EMPTY_PATH; |
|
31 | + }elseif(!file_exists($_POST['path'])) |
|
32 | + { |
|
33 | + $error = IMG_SAVE_NOT_EXISTS; |
|
34 | + }else if(!isUnderRoot($_POST['path'])) |
|
35 | + { |
|
36 | + $error = IMG_SAVE_PATH_DISALLOWED; |
|
37 | + } |
|
38 | + else |
|
39 | + { |
|
40 | + if(!empty($_POST['mode'])) |
|
41 | + { |
|
42 | 42 | |
43 | - include_once(CLASS_IMAGE); |
|
44 | - $image = new Image(); |
|
45 | - $image->loadImage($_POST['path']); |
|
43 | + include_once(CLASS_IMAGE); |
|
44 | + $image = new Image(); |
|
45 | + $image->loadImage($_POST['path']); |
|
46 | 46 | |
47 | - switch($_POST['mode']) |
|
48 | - { |
|
49 | - case "resize": |
|
50 | - if(!$image->resize($_POST['width'], $_POST['height'], (!empty($_POST['constraint'])?true:false))) |
|
51 | - { |
|
52 | - $error = IMG_SAVE_RESIZE_FAILED; |
|
53 | - } |
|
54 | - break; |
|
55 | - case "crop": |
|
56 | - if(!$image->cropToDimensions($_POST['x'], $_POST['y'], intval($_POST['x']) + intval($_POST['width']), intval($_POST['y']) + intval($_POST['height']))) |
|
57 | - { |
|
58 | - $error = IMG_SAVE_CROP_FAILED; |
|
59 | - } |
|
47 | + switch($_POST['mode']) |
|
48 | + { |
|
49 | + case "resize": |
|
50 | + if(!$image->resize($_POST['width'], $_POST['height'], (!empty($_POST['constraint'])?true:false))) |
|
51 | + { |
|
52 | + $error = IMG_SAVE_RESIZE_FAILED; |
|
53 | + } |
|
54 | + break; |
|
55 | + case "crop": |
|
56 | + if(!$image->cropToDimensions($_POST['x'], $_POST['y'], intval($_POST['x']) + intval($_POST['width']), intval($_POST['y']) + intval($_POST['height']))) |
|
57 | + { |
|
58 | + $error = IMG_SAVE_CROP_FAILED; |
|
59 | + } |
|
60 | 60 | |
61 | - break; |
|
62 | - case "flip": |
|
63 | - if(!$image->flip($_POST['flip_angle'])) |
|
64 | - { |
|
65 | - $error = IMG_SAVE_FLIP_FAILED; |
|
66 | - } |
|
67 | - break; |
|
68 | - case "rotate": |
|
69 | - if(!$image->rotate(intval($_POST['angle']))) |
|
70 | - { |
|
71 | - $error = IMG_SAVE_ROTATE_FAILED; |
|
72 | - } |
|
73 | - break; |
|
74 | - default: |
|
75 | - $error = IMG_SAVE_UNKNOWN_MODE; |
|
76 | - } |
|
77 | - if(empty($error)) |
|
78 | - { |
|
61 | + break; |
|
62 | + case "flip": |
|
63 | + if(!$image->flip($_POST['flip_angle'])) |
|
64 | + { |
|
65 | + $error = IMG_SAVE_FLIP_FAILED; |
|
66 | + } |
|
67 | + break; |
|
68 | + case "rotate": |
|
69 | + if(!$image->rotate(intval($_POST['angle']))) |
|
70 | + { |
|
71 | + $error = IMG_SAVE_ROTATE_FAILED; |
|
72 | + } |
|
73 | + break; |
|
74 | + default: |
|
75 | + $error = IMG_SAVE_UNKNOWN_MODE; |
|
76 | + } |
|
77 | + if(empty($error)) |
|
78 | + { |
|
79 | 79 | |
80 | - $sessionNewPath = $session->getSessionDir() . uniqid(md5(time())) . "." . getFileExt($_POST['path']); |
|
81 | - if(!@copy($_POST['path'], $sessionNewPath)) |
|
82 | - { |
|
83 | - $error = IMG_SAVE_BACKUP_FAILED; |
|
84 | - }else |
|
85 | - { |
|
86 | - addSessionHistory($_POST['path'], $sessionNewPath); |
|
87 | - if($image->saveImage($_POST['path'])) |
|
88 | - { |
|
89 | - $imageInfo = $image->getFinalImageInfo(); |
|
90 | - $info .= ",width:" . $imageInfo['width'] . "\n"; |
|
91 | - $info .= ",height:" . $imageInfo['height'] . "\n"; |
|
92 | - $info .= ",size:'" . transformFileSize($imageInfo['size']) . "'\n"; |
|
93 | - }else |
|
94 | - { |
|
95 | - $error = IMG_SAVE_FAILED; |
|
96 | - } |
|
97 | - } |
|
98 | - }else |
|
99 | - { |
|
100 | - //$image->DestroyImages(); |
|
101 | - } |
|
102 | - }else |
|
103 | - { |
|
104 | - $error = IMG_SAVE_UNKNOWN_MODE; |
|
105 | - } |
|
106 | - } |
|
80 | + $sessionNewPath = $session->getSessionDir() . uniqid(md5(time())) . "." . getFileExt($_POST['path']); |
|
81 | + if(!@copy($_POST['path'], $sessionNewPath)) |
|
82 | + { |
|
83 | + $error = IMG_SAVE_BACKUP_FAILED; |
|
84 | + }else |
|
85 | + { |
|
86 | + addSessionHistory($_POST['path'], $sessionNewPath); |
|
87 | + if($image->saveImage($_POST['path'])) |
|
88 | + { |
|
89 | + $imageInfo = $image->getFinalImageInfo(); |
|
90 | + $info .= ",width:" . $imageInfo['width'] . "\n"; |
|
91 | + $info .= ",height:" . $imageInfo['height'] . "\n"; |
|
92 | + $info .= ",size:'" . transformFileSize($imageInfo['size']) . "'\n"; |
|
93 | + }else |
|
94 | + { |
|
95 | + $error = IMG_SAVE_FAILED; |
|
96 | + } |
|
97 | + } |
|
98 | + }else |
|
99 | + { |
|
100 | + //$image->DestroyImages(); |
|
101 | + } |
|
102 | + }else |
|
103 | + { |
|
104 | + $error = IMG_SAVE_UNKNOWN_MODE; |
|
105 | + } |
|
106 | + } |
|
107 | 107 | |
108 | - echo "error:'" . $error . "'\n"; |
|
109 | - if(isset($image) && is_object($image)) |
|
110 | - { |
|
111 | - $image->DestroyImages(); |
|
112 | - } |
|
113 | - echo $info; |
|
114 | - echo ",history:" . sizeof($_SESSION[$_POST['path']]) . "\n"; |
|
115 | - echo "}"; |
|
108 | + echo "error:'" . $error . "'\n"; |
|
109 | + if(isset($image) && is_object($image)) |
|
110 | + { |
|
111 | + $image->DestroyImages(); |
|
112 | + } |
|
113 | + echo $info; |
|
114 | + echo ",history:" . sizeof($_SESSION[$_POST['path']]) . "\n"; |
|
115 | + echo "}"; |
|
116 | 116 | ?> |
117 | 117 | \ No newline at end of file |
@@ -6,10 +6,10 @@ discard block |
||
6 | 6 | * @since 22/May/2007 |
7 | 7 | * |
8 | 8 | */ |
9 | - require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php"); |
|
10 | - if(!isset($_POST['path'])) |
|
9 | + require_once(dirname(__FILE__).DIRECTORY_SEPARATOR."inc".DIRECTORY_SEPARATOR."config.php"); |
|
10 | + if (!isset($_POST['path'])) |
|
11 | 11 | { |
12 | - $_POST['path'] = "uploaded/Winter.jpg" . "?" . makeQueryString(array('path')); |
|
12 | + $_POST['path'] = "uploaded/Winter.jpg"."?".makeQueryString(array('path')); |
|
13 | 13 | //for crop |
14 | 14 | $_POST['mode'] = "crop"; |
15 | 15 | $_POST['x'] = 100; |
@@ -25,48 +25,48 @@ discard block |
||
25 | 25 | $error = ""; |
26 | 26 | $info = ""; |
27 | 27 | |
28 | - if(empty($_POST['path'])) |
|
28 | + if (empty($_POST['path'])) |
|
29 | 29 | { |
30 | - $error = IMG_SAVE_EMPTY_PATH; |
|
31 | - }elseif(!file_exists($_POST['path'])) |
|
30 | + $error = IMG_SAVE_EMPTY_PATH; |
|
31 | + }elseif (!file_exists($_POST['path'])) |
|
32 | 32 | { |
33 | - $error = IMG_SAVE_NOT_EXISTS; |
|
34 | - }else if(!isUnderRoot($_POST['path'])) |
|
33 | + $error = IMG_SAVE_NOT_EXISTS; |
|
34 | + } else if (!isUnderRoot($_POST['path'])) |
|
35 | 35 | { |
36 | 36 | $error = IMG_SAVE_PATH_DISALLOWED; |
37 | 37 | } |
38 | 38 | else |
39 | 39 | { |
40 | - if(!empty($_POST['mode'])) |
|
40 | + if (!empty($_POST['mode'])) |
|
41 | 41 | { |
42 | 42 | |
43 | 43 | include_once(CLASS_IMAGE); |
44 | 44 | $image = new Image(); |
45 | 45 | $image->loadImage($_POST['path']); |
46 | 46 | |
47 | - switch($_POST['mode']) |
|
47 | + switch ($_POST['mode']) |
|
48 | 48 | { |
49 | 49 | case "resize": |
50 | - if(!$image->resize($_POST['width'], $_POST['height'], (!empty($_POST['constraint'])?true:false))) |
|
50 | + if (!$image->resize($_POST['width'], $_POST['height'], (!empty($_POST['constraint']) ? true : false))) |
|
51 | 51 | { |
52 | 52 | $error = IMG_SAVE_RESIZE_FAILED; |
53 | 53 | } |
54 | 54 | break; |
55 | 55 | case "crop": |
56 | - if(!$image->cropToDimensions($_POST['x'], $_POST['y'], intval($_POST['x']) + intval($_POST['width']), intval($_POST['y']) + intval($_POST['height']))) |
|
56 | + if (!$image->cropToDimensions($_POST['x'], $_POST['y'], intval($_POST['x']) + intval($_POST['width']), intval($_POST['y']) + intval($_POST['height']))) |
|
57 | 57 | { |
58 | 58 | $error = IMG_SAVE_CROP_FAILED; |
59 | 59 | } |
60 | 60 | |
61 | 61 | break; |
62 | 62 | case "flip": |
63 | - if(!$image->flip($_POST['flip_angle'])) |
|
63 | + if (!$image->flip($_POST['flip_angle'])) |
|
64 | 64 | { |
65 | 65 | $error = IMG_SAVE_FLIP_FAILED; |
66 | 66 | } |
67 | 67 | break; |
68 | 68 | case "rotate": |
69 | - if(!$image->rotate(intval($_POST['angle']))) |
|
69 | + if (!$image->rotate(intval($_POST['angle']))) |
|
70 | 70 | { |
71 | 71 | $error = IMG_SAVE_ROTATE_FAILED; |
72 | 72 | } |
@@ -74,43 +74,43 @@ discard block |
||
74 | 74 | default: |
75 | 75 | $error = IMG_SAVE_UNKNOWN_MODE; |
76 | 76 | } |
77 | - if(empty($error)) |
|
77 | + if (empty($error)) |
|
78 | 78 | { |
79 | 79 | |
80 | - $sessionNewPath = $session->getSessionDir() . uniqid(md5(time())) . "." . getFileExt($_POST['path']); |
|
81 | - if(!@copy($_POST['path'], $sessionNewPath)) |
|
80 | + $sessionNewPath = $session->getSessionDir().uniqid(md5(time())).".".getFileExt($_POST['path']); |
|
81 | + if (!@copy($_POST['path'], $sessionNewPath)) |
|
82 | 82 | { |
83 | 83 | $error = IMG_SAVE_BACKUP_FAILED; |
84 | - }else |
|
84 | + } else |
|
85 | 85 | { |
86 | 86 | addSessionHistory($_POST['path'], $sessionNewPath); |
87 | - if($image->saveImage($_POST['path'])) |
|
87 | + if ($image->saveImage($_POST['path'])) |
|
88 | 88 | { |
89 | 89 | $imageInfo = $image->getFinalImageInfo(); |
90 | - $info .= ",width:" . $imageInfo['width'] . "\n"; |
|
91 | - $info .= ",height:" . $imageInfo['height'] . "\n"; |
|
92 | - $info .= ",size:'" . transformFileSize($imageInfo['size']) . "'\n"; |
|
93 | - }else |
|
90 | + $info .= ",width:".$imageInfo['width']."\n"; |
|
91 | + $info .= ",height:".$imageInfo['height']."\n"; |
|
92 | + $info .= ",size:'".transformFileSize($imageInfo['size'])."'\n"; |
|
93 | + } else |
|
94 | 94 | { |
95 | 95 | $error = IMG_SAVE_FAILED; |
96 | 96 | } |
97 | 97 | } |
98 | - }else |
|
98 | + } else |
|
99 | 99 | { |
100 | 100 | //$image->DestroyImages(); |
101 | 101 | } |
102 | - }else |
|
102 | + } else |
|
103 | 103 | { |
104 | 104 | $error = IMG_SAVE_UNKNOWN_MODE; |
105 | 105 | } |
106 | 106 | } |
107 | 107 | |
108 | - echo "error:'" . $error . "'\n"; |
|
109 | - if(isset($image) && is_object($image)) |
|
108 | + echo "error:'".$error."'\n"; |
|
109 | + if (isset($image) && is_object($image)) |
|
110 | 110 | { |
111 | 111 | $image->DestroyImages(); |
112 | 112 | } |
113 | 113 | echo $info; |
114 | - echo ",history:" . sizeof($_SESSION[$_POST['path']]) . "\n"; |
|
114 | + echo ",history:".sizeof($_SESSION[$_POST['path']])."\n"; |
|
115 | 115 | echo "}"; |
116 | 116 | ?> |
117 | 117 | \ No newline at end of file |
@@ -28,14 +28,13 @@ discard block |
||
28 | 28 | if(empty($_POST['path'])) |
29 | 29 | { |
30 | 30 | $error = IMG_SAVE_EMPTY_PATH; |
31 | - }elseif(!file_exists($_POST['path'])) |
|
31 | + } elseif(!file_exists($_POST['path'])) |
|
32 | 32 | { |
33 | 33 | $error = IMG_SAVE_NOT_EXISTS; |
34 | - }else if(!isUnderRoot($_POST['path'])) |
|
34 | + } else if(!isUnderRoot($_POST['path'])) |
|
35 | 35 | { |
36 | 36 | $error = IMG_SAVE_PATH_DISALLOWED; |
37 | - } |
|
38 | - else |
|
37 | + } else |
|
39 | 38 | { |
40 | 39 | if(!empty($_POST['mode'])) |
41 | 40 | { |
@@ -81,7 +80,7 @@ discard block |
||
81 | 80 | if(!@copy($_POST['path'], $sessionNewPath)) |
82 | 81 | { |
83 | 82 | $error = IMG_SAVE_BACKUP_FAILED; |
84 | - }else |
|
83 | + } else |
|
85 | 84 | { |
86 | 85 | addSessionHistory($_POST['path'], $sessionNewPath); |
87 | 86 | if($image->saveImage($_POST['path'])) |
@@ -90,16 +89,16 @@ discard block |
||
90 | 89 | $info .= ",width:" . $imageInfo['width'] . "\n"; |
91 | 90 | $info .= ",height:" . $imageInfo['height'] . "\n"; |
92 | 91 | $info .= ",size:'" . transformFileSize($imageInfo['size']) . "'\n"; |
93 | - }else |
|
92 | + } else |
|
94 | 93 | { |
95 | 94 | $error = IMG_SAVE_FAILED; |
96 | 95 | } |
97 | 96 | } |
98 | - }else |
|
97 | + } else |
|
99 | 98 | { |
100 | 99 | //$image->DestroyImages(); |
101 | 100 | } |
102 | - }else |
|
101 | + } else |
|
103 | 102 | { |
104 | 103 | $error = IMG_SAVE_UNKNOWN_MODE; |
105 | 104 | } |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | - require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php"); |
|
2 | + require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php"); |
|
3 | 3 | |
4 | 4 | ?> |
5 | 5 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | - require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "inc" . DIRECTORY_SEPARATOR . "config.php"); |
|
2 | + require_once(dirname(__FILE__).DIRECTORY_SEPARATOR."inc".DIRECTORY_SEPARATOR."config.php"); |
|
3 | 3 | |
4 | 4 | ?> |
5 | 5 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
@@ -1,8 +1,8 @@ discard block |
||
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 | ?> |
7 | 7 | <div id="content"> |
8 | 8 | <table class="tableList" id="tableList" cellpadding="0" cellspacing="0" border="0"> |
@@ -17,19 +17,19 @@ discard block |
||
17 | 17 | </thead> |
18 | 18 | <tbody id="fileList"> |
19 | 19 | <?php |
20 | - $count = 1; |
|
21 | - $css = ""; |
|
22 | - //list all documents (files and folders) under this current folder, |
|
23 | - //<?php echo appendQueryString(appendQueryString(CONFIG_URL_FILEnIMAGE_MANAGER, "path=" . $file['path']), makeQueryString(array('path'))); |
|
24 | - foreach($fileList as $file) |
|
25 | - { |
|
26 | - $css = ($css == "" || $css == "even"?"odd":"even"); |
|
27 | - $strDisabled = ($file['is_writable']?"":" disabled"); |
|
28 | - $strClass = ($file['is_writable']?"left":" leftDisabled"); |
|
29 | - if($file['type'] == 'file') |
|
30 | - { |
|
20 | + $count = 1; |
|
21 | + $css = ""; |
|
22 | + //list all documents (files and folders) under this current folder, |
|
23 | + //<?php echo appendQueryString(appendQueryString(CONFIG_URL_FILEnIMAGE_MANAGER, "path=" . $file['path']), makeQueryString(array('path'))); |
|
24 | + foreach($fileList as $file) |
|
25 | + { |
|
26 | + $css = ($css == "" || $css == "even"?"odd":"even"); |
|
27 | + $strDisabled = ($file['is_writable']?"":" disabled"); |
|
28 | + $strClass = ($file['is_writable']?"left":" leftDisabled"); |
|
29 | + if($file['type'] == 'file') |
|
30 | + { |
|
31 | 31 | |
32 | - ?> |
|
32 | + ?> |
|
33 | 33 | <tr class="<?php echo $css; ?>" id="row<?php echo $count; ?>" > |
34 | 34 | <td align="center" id="tdz<?php echo $count; ?>"><span id="flag<?php echo $count; ?>" class="<?php echo $file['flag']; ?>"> </span><input type="checkbox" name="check[]" id="cb<?php echo $count; ?>" value="<?php echo $file['path']; ?>" <?php echo $strDisabled; ?> /> |
35 | 35 | </td> |
@@ -39,9 +39,9 @@ discard block |
||
39 | 39 | <td class="docInfo" id="tdth<?php echo $count; ?>"><?php echo @date(DATE_TIME_FORMAT,$file['mtime']); ?></td> |
40 | 40 | </tr> |
41 | 41 | <?php |
42 | - }else |
|
43 | - { |
|
44 | - ?> |
|
42 | + }else |
|
43 | + { |
|
44 | + ?> |
|
45 | 45 | <tr class="<?php echo $css; ?>" id="row<?php echo $count; ?>" > |
46 | 46 | <td align="center" id="tdz<?php echo $count; ?>"><span id="flag<?php echo $count; ?>" class="<?php echo $file['flag']; ?>"> </span><input type="checkbox" name="check[]" id="cb<?php echo $count; ?>" value="<?php echo $file['path']; ?>" <?php echo $strDisabled; ?>/> |
47 | 47 | </td> |
@@ -51,10 +51,10 @@ discard block |
||
51 | 51 | <td class="docInfo" id="tdth<?php echo $count; ?>"><?php echo @date(DATE_TIME_FORMAT,$file['mtime']); ?></td> |
52 | 52 | </tr> |
53 | 53 | <?php |
54 | - } |
|
55 | - $count++; |
|
56 | - } |
|
57 | - ?> |
|
54 | + } |
|
55 | + $count++; |
|
56 | + } |
|
57 | + ?> |
|
58 | 58 | </tbody> |
59 | 59 | </table> |
60 | 60 | </div> |
61 | 61 | \ No newline at end of file |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | - if(!defined('AJAX_INIT_DONE')) |
|
2 | + if (!defined('AJAX_INIT_DONE')) |
|
3 | 3 | { |
4 | 4 | die('Permission denied'); |
5 | 5 | } |
@@ -21,12 +21,12 @@ discard block |
||
21 | 21 | $css = ""; |
22 | 22 | //list all documents (files and folders) under this current folder, |
23 | 23 | //<?php echo appendQueryString(appendQueryString(CONFIG_URL_FILEnIMAGE_MANAGER, "path=" . $file['path']), makeQueryString(array('path'))); |
24 | - foreach($fileList as $file) |
|
24 | + foreach ($fileList as $file) |
|
25 | 25 | { |
26 | - $css = ($css == "" || $css == "even"?"odd":"even"); |
|
27 | - $strDisabled = ($file['is_writable']?"":" disabled"); |
|
28 | - $strClass = ($file['is_writable']?"left":" leftDisabled"); |
|
29 | - if($file['type'] == 'file') |
|
26 | + $css = ($css == "" || $css == "even" ? "odd" : "even"); |
|
27 | + $strDisabled = ($file['is_writable'] ? "" : " disabled"); |
|
28 | + $strClass = ($file['is_writable'] ? "left" : " leftDisabled"); |
|
29 | + if ($file['type'] == 'file') |
|
30 | 30 | { |
31 | 31 | |
32 | 32 | ?> |
@@ -36,19 +36,19 @@ discard block |
||
36 | 36 | <td align="center" class="fileColumns" id="tdst<?php echo $count; ?>"> <a id="a<?php echo $count; ?>" href="<?php echo $file['path']; ?>" target="_blank"><span class="<?php echo $file['cssClass']; ?>"> </span></a></td> |
37 | 37 | <td class="<?php echo $strClass; ?> docName" id="tdnd<?php echo $count; ?>"><a id="a<?php echo $count; ?>" href="<?php echo $file['path']; ?>"><?php echo $file['name']; ?></a></td> |
38 | 38 | <td class="docInfo" id="tdrd<?php echo $count; ?>"><?php echo transformFileSize($file['size']); ?></td> |
39 | - <td class="docInfo" id="tdth<?php echo $count; ?>"><?php echo @date(DATE_TIME_FORMAT,$file['mtime']); ?></td> |
|
39 | + <td class="docInfo" id="tdth<?php echo $count; ?>"><?php echo @date(DATE_TIME_FORMAT, $file['mtime']); ?></td> |
|
40 | 40 | </tr> |
41 | 41 | <?php |
42 | - }else |
|
42 | + } else |
|
43 | 43 | { |
44 | 44 | ?> |
45 | 45 | <tr class="<?php echo $css; ?>" id="row<?php echo $count; ?>" > |
46 | 46 | <td align="center" id="tdz<?php echo $count; ?>"><span id="flag<?php echo $count; ?>" class="<?php echo $file['flag']; ?>"> </span><input type="checkbox" name="check[]" id="cb<?php echo $count; ?>" value="<?php echo $file['path']; ?>" <?php echo $strDisabled; ?>/> |
47 | 47 | </td> |
48 | - <td align="center" class="fileColumns" id="tdst<?php echo $count; ?>"> <a id="a<?php echo $count; ?>" href="<?php echo $file['path']; ?>" <?php echo $file['cssClass'] == 'filePicture'?'rel="ajaxPhotos"':''; ?> ><span class="<?php echo ($file['file']||$file['subdir']?$file['cssClass']:"folderEmpty"); ?>"> </span></a></td> |
|
48 | + <td align="center" class="fileColumns" id="tdst<?php echo $count; ?>"> <a id="a<?php echo $count; ?>" href="<?php echo $file['path']; ?>" <?php echo $file['cssClass'] == 'filePicture' ? 'rel="ajaxPhotos"' : ''; ?> ><span class="<?php echo ($file['file'] || $file['subdir'] ? $file['cssClass'] : "folderEmpty"); ?>"> </span></a></td> |
|
49 | 49 | <td class="<?php echo $strClass; ?> docName" id="tdnd<?php echo $count; ?>"><?php echo $file['name']; ?></td> |
50 | 50 | <td class="docInfo" id="tdrd<?php echo $count; ?>"> </td> |
51 | - <td class="docInfo" id="tdth<?php echo $count; ?>"><?php echo @date(DATE_TIME_FORMAT,$file['mtime']); ?></td> |
|
51 | + <td class="docInfo" id="tdth<?php echo $count; ?>"><?php echo @date(DATE_TIME_FORMAT, $file['mtime']); ?></td> |
|
52 | 52 | </tr> |
53 | 53 | <?php |
54 | 54 | } |
@@ -39,7 +39,7 @@ |
||
39 | 39 | <td class="docInfo" id="tdth<?php echo $count; ?>"><?php echo @date(DATE_TIME_FORMAT,$file['mtime']); ?></td> |
40 | 40 | </tr> |
41 | 41 | <?php |
42 | - }else |
|
42 | + } else |
|
43 | 43 | { |
44 | 44 | ?> |
45 | 45 | <tr class="<?php echo $css; ?>" id="row<?php echo $count; ?>" > |
@@ -1,16 +1,16 @@ discard block |
||
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 | ?><?php |
7 | - /** |
|
8 | - * sysem base config setting |
|
9 | - * @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn) |
|
10 | - * @link www.phpletter.com |
|
11 | - * @since 1/August/2007 |
|
12 | - * |
|
13 | - */ |
|
7 | + /** |
|
8 | + * sysem base config setting |
|
9 | + * @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn) |
|
10 | + * @link www.phpletter.com |
|
11 | + * @since 1/August/2007 |
|
12 | + * |
|
13 | + */ |
|
14 | 14 | |
15 | 15 | |
16 | 16 | error_reporting(E_ALL); |
@@ -18,119 +18,117 @@ discard block |
||
18 | 18 | |
19 | 19 | |
20 | 20 | |
21 | - //Access Control Setting |
|
22 | - /** |
|
23 | - * turn off => false |
|
24 | - * by session => true |
|
25 | - */ |
|
26 | - define('CONFIG_ACCESS_CONTROL_MODE', true); |
|
27 | - define("CONFIG_LOGIN_USERNAME", 'ajax'); |
|
28 | - define('CONFIG_LOGIN_PASSWORD', '123456'); |
|
29 | - define('CONFIG_LOGIN_PAGE', 'ajax_login.php'); //the url to the login page |
|
21 | + //Access Control Setting |
|
22 | + /** |
|
23 | + * turn off => false |
|
24 | + * by session => true |
|
25 | + */ |
|
26 | + define('CONFIG_ACCESS_CONTROL_MODE', true); |
|
27 | + define("CONFIG_LOGIN_USERNAME", 'ajax'); |
|
28 | + define('CONFIG_LOGIN_PASSWORD', '123456'); |
|
29 | + define('CONFIG_LOGIN_PAGE', 'ajax_login.php'); //the url to the login page |
|
30 | 30 | |
31 | - //SYSTEM MODE CONFIG |
|
32 | - /** |
|
33 | - * turn it on when you have this system for demo purpose |
|
34 | - * that means changes made to each image is not physically applied to it |
|
35 | - * and all uploaded files/created folders will be removed automatically |
|
36 | - */ |
|
37 | - define('CONFIG_SYS_DEMO_ENABLE', false); |
|
38 | - define('CONFIG_SYS_VIEW_ONLY', false); //diabled the system, view only |
|
39 | - define('CONFIG_SYS_THUMBNAIL_VIEW_ENABLE', true);//REMOVE THE thumbnail view if false |
|
31 | + //SYSTEM MODE CONFIG |
|
32 | + /** |
|
33 | + * turn it on when you have this system for demo purpose |
|
34 | + * that means changes made to each image is not physically applied to it |
|
35 | + * and all uploaded files/created folders will be removed automatically |
|
36 | + */ |
|
37 | + define('CONFIG_SYS_DEMO_ENABLE', false); |
|
38 | + define('CONFIG_SYS_VIEW_ONLY', false); //diabled the system, view only |
|
39 | + define('CONFIG_SYS_THUMBNAIL_VIEW_ENABLE', true);//REMOVE THE thumbnail view if false |
|
40 | 40 | |
41 | - //User Permissions |
|
42 | - define('CONFIG_OPTIONS_DELETE', true); |
|
43 | - define('CONFIG_OPTIONS_CUT', true); |
|
44 | - define('CONFIG_OPTIONS_COPY', true); |
|
45 | - define('CONFIG_OPTIONS_NEWFOLDER', true); |
|
46 | - define('CONFIG_OPTIONS_RENAME', true); |
|
47 | - define('CONFIG_OPTIONS_UPLOAD', true); // |
|
48 | - define('CONFIG_OPTIONS_EDITABLE', true); //disable image editor and text editor |
|
49 | - //FILESYSTEM CONFIG |
|
50 | - /* |
|
41 | + //User Permissions |
|
42 | + define('CONFIG_OPTIONS_DELETE', true); |
|
43 | + define('CONFIG_OPTIONS_CUT', true); |
|
44 | + define('CONFIG_OPTIONS_COPY', true); |
|
45 | + define('CONFIG_OPTIONS_NEWFOLDER', true); |
|
46 | + define('CONFIG_OPTIONS_RENAME', true); |
|
47 | + define('CONFIG_OPTIONS_UPLOAD', true); // |
|
48 | + define('CONFIG_OPTIONS_EDITABLE', true); //disable image editor and text editor |
|
49 | + //FILESYSTEM CONFIG |
|
50 | + /* |
|
51 | 51 | * CONFIG_SYS_DEFAULT_PATH is the default folder where the files would be uploaded to |
52 | 52 | and it must be a folder under the CONFIG_SYS_ROOT_PATH or the same folder |
53 | 53 | these two paths accept relative path only, don't use absolute path |
54 | 54 | */ |
55 | 55 | |
56 | - define('CONFIG_SYS_DEFAULT_PATH', '../../../../images/'); //accept relative path only |
|
57 | - define('CONFIG_SYS_ROOT_PATH', '../../../../images/'); //accept relative path only |
|
58 | - define('CONFIG_SYS_FOLDER_SHOWN_ON_TOP', true); //show your folders on the top of list if true or order by name |
|
59 | - define("CONFIG_SYS_DIR_SESSION_PATH", '/tmp'); |
|
60 | - define("CONFIG_SYS_PATTERN_FORMAT", 'list'); //three options: reg ,csv, list, this option define the parttern format for the following patterns |
|
61 | - /** |
|
62 | - * reg => regulare expression |
|
63 | - * csv => a list of comma separated file/folder name, (exactly match the specified file/folders) |
|
64 | - * list => a list of comma spearated vague file/folder name (partially match the specified file/folders) |
|
65 | - * |
|
66 | - */ |
|
67 | - //more details about regular expression please visit http://nz.php.net/manual/en/function.eregi.php |
|
68 | - define('CONFIG_SYS_INC_DIR_PATTERN', ''); //force listing of folders with such pattern(s). separated by , if multiple |
|
69 | - define('CONFIG_SYS_EXC_DIR_PATTERN', ''); //will prevent listing of folders with such pattern(s). separated by , if multiple |
|
70 | - define('CONFIG_SYS_INC_FILE_PATTERN', ''); //force listing of fiels with such pattern(s). separated by , if multiple |
|
71 | - define('CONFIG_SYS_EXC_FILE_PATTERN', ''); //will prevent listing of files with such pattern(s). separated by , if multiple |
|
72 | - define('CONFIG_SYS_DELETE_RECURSIVE', 1); //delete all contents within a specific folder if set to be 1 |
|
56 | + define('CONFIG_SYS_DEFAULT_PATH', '../../../../images/'); //accept relative path only |
|
57 | + define('CONFIG_SYS_ROOT_PATH', '../../../../images/'); //accept relative path only |
|
58 | + define('CONFIG_SYS_FOLDER_SHOWN_ON_TOP', true); //show your folders on the top of list if true or order by name |
|
59 | + define("CONFIG_SYS_DIR_SESSION_PATH", '/tmp'); |
|
60 | + define("CONFIG_SYS_PATTERN_FORMAT", 'list'); //three options: reg ,csv, list, this option define the parttern format for the following patterns |
|
61 | + /** |
|
62 | + * reg => regulare expression |
|
63 | + * csv => a list of comma separated file/folder name, (exactly match the specified file/folders) |
|
64 | + * list => a list of comma spearated vague file/folder name (partially match the specified file/folders) |
|
65 | + * |
|
66 | + */ |
|
67 | + //more details about regular expression please visit http://nz.php.net/manual/en/function.eregi.php |
|
68 | + define('CONFIG_SYS_INC_DIR_PATTERN', ''); //force listing of folders with such pattern(s). separated by , if multiple |
|
69 | + define('CONFIG_SYS_EXC_DIR_PATTERN', ''); //will prevent listing of folders with such pattern(s). separated by , if multiple |
|
70 | + define('CONFIG_SYS_INC_FILE_PATTERN', ''); //force listing of fiels with such pattern(s). separated by , if multiple |
|
71 | + define('CONFIG_SYS_EXC_FILE_PATTERN', ''); //will prevent listing of files with such pattern(s). separated by , if multiple |
|
72 | + define('CONFIG_SYS_DELETE_RECURSIVE', 1); //delete all contents within a specific folder if set to be 1 |
|
73 | 73 | |
74 | - //UPLOAD OPTIONS CONFIG |
|
75 | - define('CONFIG_UPLOAD_MAXSIZE', 50 * 1024 ); //by bytes |
|
76 | - //define('CONFIG_UPLOAD_MAXSIZE', 2048); //by bytes |
|
77 | - //define('CONFIG_UPLOAD_VALID_EXTS', 'txt');// |
|
74 | + //UPLOAD OPTIONS CONFIG |
|
75 | + define('CONFIG_UPLOAD_MAXSIZE', 50 * 1024 ); //by bytes |
|
76 | + //define('CONFIG_UPLOAD_MAXSIZE', 2048); //by bytes |
|
77 | + //define('CONFIG_UPLOAD_VALID_EXTS', 'txt');// |
|
78 | 78 | |
79 | - define('CONFIG_EDITABLE_VALID_EXTS', 'txt,htm,html,xml,js,css'); //make you include all these extension in CONFIG_UPLOAD_VALID_EXTS if you want all valid |
|
79 | + define('CONFIG_EDITABLE_VALID_EXTS', 'txt,htm,html,xml,js,css'); //make you include all these extension in CONFIG_UPLOAD_VALID_EXTS if you want all valid |
|
80 | 80 | |
81 | - define('CONFIG_OVERWRITTEN', false); //overwirte when processing paste |
|
82 | - define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,txt'); // |
|
83 | - //define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,bmp,tif,zip,sit,rar,gz,tar,htm,html,mov,mpg,avi,asf,mpeg,wmv,aif,aiff,wav,mp3,swf,ppt,rtf,doc,pdf,xls,txt,xml,xsl,dtd');// |
|
84 | - define("CONFIG_VIEWABLE_VALID_EXTS", 'gif,bmp,txt,jpg,png,tif,html,htm,js,css,xml,xsl,dtd,mp3,wav,wmv,wma,rm,rmvb,mov,swf'); |
|
85 | - //define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,txt'); // |
|
86 | - define('CONFIG_UPLOAD_INVALID_EXTS', ''); |
|
81 | + define('CONFIG_OVERWRITTEN', false); //overwirte when processing paste |
|
82 | + define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,txt'); // |
|
83 | + //define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,bmp,tif,zip,sit,rar,gz,tar,htm,html,mov,mpg,avi,asf,mpeg,wmv,aif,aiff,wav,mp3,swf,ppt,rtf,doc,pdf,xls,txt,xml,xsl,dtd');// |
|
84 | + define("CONFIG_VIEWABLE_VALID_EXTS", 'gif,bmp,txt,jpg,png,tif,html,htm,js,css,xml,xsl,dtd,mp3,wav,wmv,wma,rm,rmvb,mov,swf'); |
|
85 | + //define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,txt'); // |
|
86 | + define('CONFIG_UPLOAD_INVALID_EXTS', ''); |
|
87 | 87 | |
88 | - //Preview |
|
89 | - define('CONFIG_IMG_THUMBNAIL_MAX_X', 100); |
|
90 | - define('CONFIG_IMG_THUMBNAIL_MAX_Y', 100); |
|
91 | - define('CONFIG_THICKBOX_MAX_WIDTH', 700); |
|
92 | - define('CONFIG_THICKBOX_MAX_HEIGHT', 430); |
|
88 | + //Preview |
|
89 | + define('CONFIG_IMG_THUMBNAIL_MAX_X', 100); |
|
90 | + define('CONFIG_IMG_THUMBNAIL_MAX_Y', 100); |
|
91 | + define('CONFIG_THICKBOX_MAX_WIDTH', 700); |
|
92 | + define('CONFIG_THICKBOX_MAX_HEIGHT', 430); |
|
93 | 93 | |
94 | 94 | |
95 | - /** |
|
96 | - * CONFIG_URL_PREVIEW_ROOT was replaced by CONFIG_WEBSITE_DOCUMENT_ROOT since v0.8 |
|
97 | - * Normally, you don't need to bother with CONFIG_WEBSITE_DOCUMENT_ROOT |
|
98 | - * Howerver, some Web Hosts do not have standard php.ini setting |
|
99 | - * which you will find the file manager can not locate your files correctly |
|
100 | - * if you do have such issue, please change it to fit your system. |
|
101 | - * so what should you to do get it |
|
102 | - * 1. create a php script file (let's call it document_root.php) |
|
103 | - * 2. add the following codes in in |
|
104 | - * <?php |
|
105 | - * echo dirname(__FILE__); |
|
106 | - * ?> |
|
107 | - * 3. upload document_root.php to you website root folder which will only be reached when you visit http://www.domain-name.com or http://localhost/ at localhost computer |
|
108 | - * 4. run it via http://www.domain-name.com/document_root.php or http://localhost/docuent_root.php if localhost computer, the url has to be exactly like that |
|
109 | - * 5. the value shown on the screen is CONFIG_WEBSITE_DOCUMENT_ROOT should be |
|
110 | - * 6. enjoy it |
|
111 | - |
|
112 | - |
|
113 | - * |
|
114 | - */ |
|
95 | + /** |
|
96 | + * CONFIG_URL_PREVIEW_ROOT was replaced by CONFIG_WEBSITE_DOCUMENT_ROOT since v0.8 |
|
97 | + * Normally, you don't need to bother with CONFIG_WEBSITE_DOCUMENT_ROOT |
|
98 | + * Howerver, some Web Hosts do not have standard php.ini setting |
|
99 | + * which you will find the file manager can not locate your files correctly |
|
100 | + * if you do have such issue, please change it to fit your system. |
|
101 | + * so what should you to do get it |
|
102 | + * 1. create a php script file (let's call it document_root.php) |
|
103 | + * 2. add the following codes in in |
|
104 | + * <?php |
|
105 | + * echo dirname(__FILE__); |
|
106 | + * ?> |
|
107 | + * 3. upload document_root.php to you website root folder which will only be reached when you visit http://www.domain-name.com or http://localhost/ at localhost computer |
|
108 | + * 4. run it via http://www.domain-name.com/document_root.php or http://localhost/docuent_root.php if localhost computer, the url has to be exactly like that |
|
109 | + * 5. the value shown on the screen is CONFIG_WEBSITE_DOCUMENT_ROOT should be |
|
110 | + * 6. enjoy it |
|
111 | + * |
|
112 | + */ |
|
115 | 113 | |
116 | 114 | |
117 | - define('CONFIG_WEBSITE_DOCUMENT_ROOT', ''); |
|
118 | - //theme related setting |
|
119 | - /* |
|
115 | + define('CONFIG_WEBSITE_DOCUMENT_ROOT', ''); |
|
116 | + //theme related setting |
|
117 | + /* |
|
120 | 118 | * options avaialbe for CONFIG_EDITOR_NAME are: |
121 | 119 | stand_alone |
122 | 120 | tinymce |
123 | 121 | fckeditor |
124 | 122 | */ |
125 | - //CONFIG_EDITOR_NAME replaced CONFIG_THEME_MODE since @version 0.8 |
|
126 | - define('CONFIG_EDITOR_NAME', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['editor'])?secureFileName($_GET['editor']):'stand_alone')); |
|
127 | - define('CONFIG_THEME_NAME', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['theme'])?secureFileName($_GET['theme']):'default')); //change the theme to your custom theme rather than default |
|
128 | - define('CONFIG_DEFAULT_VIEW', (CONFIG_SYS_THUMBNAIL_VIEW_ENABLE?'detail':'detail')); //thumnail or detail |
|
129 | - define('CONFIG_DEFAULT_PAGINATION_LIMIT', 10); |
|
130 | - define('CONFIG_LOAD_DOC_LATTER', false); //all documents will be loaded up after the template has been loaded to the client |
|
123 | + //CONFIG_EDITOR_NAME replaced CONFIG_THEME_MODE since @version 0.8 |
|
124 | + define('CONFIG_EDITOR_NAME', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['editor'])?secureFileName($_GET['editor']):'stand_alone')); |
|
125 | + define('CONFIG_THEME_NAME', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['theme'])?secureFileName($_GET['theme']):'default')); //change the theme to your custom theme rather than default |
|
126 | + define('CONFIG_DEFAULT_VIEW', (CONFIG_SYS_THUMBNAIL_VIEW_ENABLE?'detail':'detail')); //thumnail or detail |
|
127 | + define('CONFIG_DEFAULT_PAGINATION_LIMIT', 10); |
|
128 | + define('CONFIG_LOAD_DOC_LATTER', false); //all documents will be loaded up after the template has been loaded to the client |
|
131 | 129 | |
132 | - //General Option Declarations |
|
133 | - //LANGAUGAE DECLARATIONNS |
|
134 | - define('CONFIG_LANG_INDEX', 'language'); //the index in the session |
|
135 | - define('CONFIG_LANG_DEFAULT', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['language']) && file_exists(DIR_LANG . secureFileName($_GET['language'] . '.php'))?secureFileName($_GET['language']):'en')); //change it to be your language file base name, such en |
|
130 | + //General Option Declarations |
|
131 | + //LANGAUGAE DECLARATIONNS |
|
132 | + define('CONFIG_LANG_INDEX', 'language'); //the index in the session |
|
133 | + define('CONFIG_LANG_DEFAULT', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['language']) && file_exists(DIR_LANG . secureFileName($_GET['language'] . '.php'))?secureFileName($_GET['language']):'en')); //change it to be your language file base name, such en |
|
136 | 134 | ?> |
137 | 135 | \ No newline at end of file |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | - if(!defined('AJAX_INIT_DONE')) |
|
2 | + if (!defined('AJAX_INIT_DONE')) |
|
3 | 3 | { |
4 | 4 | die('Permission denied'); |
5 | 5 | } |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | */ |
37 | 37 | define('CONFIG_SYS_DEMO_ENABLE', false); |
38 | 38 | define('CONFIG_SYS_VIEW_ONLY', false); //diabled the system, view only |
39 | - define('CONFIG_SYS_THUMBNAIL_VIEW_ENABLE', true);//REMOVE THE thumbnail view if false |
|
39 | + define('CONFIG_SYS_THUMBNAIL_VIEW_ENABLE', true); //REMOVE THE thumbnail view if false |
|
40 | 40 | |
41 | 41 | //User Permissions |
42 | 42 | define('CONFIG_OPTIONS_DELETE', true); |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | */ |
55 | 55 | |
56 | 56 | define('CONFIG_SYS_DEFAULT_PATH', '../../../../images/'); //accept relative path only |
57 | - define('CONFIG_SYS_ROOT_PATH', '../../../../images/'); //accept relative path only |
|
57 | + define('CONFIG_SYS_ROOT_PATH', '../../../../images/'); //accept relative path only |
|
58 | 58 | define('CONFIG_SYS_FOLDER_SHOWN_ON_TOP', true); //show your folders on the top of list if true or order by name |
59 | 59 | define("CONFIG_SYS_DIR_SESSION_PATH", '/tmp'); |
60 | 60 | define("CONFIG_SYS_PATTERN_FORMAT", 'list'); //three options: reg ,csv, list, this option define the parttern format for the following patterns |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | define('CONFIG_SYS_DELETE_RECURSIVE', 1); //delete all contents within a specific folder if set to be 1 |
73 | 73 | |
74 | 74 | //UPLOAD OPTIONS CONFIG |
75 | - define('CONFIG_UPLOAD_MAXSIZE', 50 * 1024 ); //by bytes |
|
75 | + define('CONFIG_UPLOAD_MAXSIZE', 50*1024); //by bytes |
|
76 | 76 | //define('CONFIG_UPLOAD_MAXSIZE', 2048); //by bytes |
77 | 77 | //define('CONFIG_UPLOAD_VALID_EXTS', 'txt');// |
78 | 78 | |
@@ -123,14 +123,14 @@ discard block |
||
123 | 123 | fckeditor |
124 | 124 | */ |
125 | 125 | //CONFIG_EDITOR_NAME replaced CONFIG_THEME_MODE since @version 0.8 |
126 | - define('CONFIG_EDITOR_NAME', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['editor'])?secureFileName($_GET['editor']):'stand_alone')); |
|
127 | - define('CONFIG_THEME_NAME', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['theme'])?secureFileName($_GET['theme']):'default')); //change the theme to your custom theme rather than default |
|
128 | - define('CONFIG_DEFAULT_VIEW', (CONFIG_SYS_THUMBNAIL_VIEW_ENABLE?'detail':'detail')); //thumnail or detail |
|
126 | + define('CONFIG_EDITOR_NAME', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['editor']) ? secureFileName($_GET['editor']) : 'stand_alone')); |
|
127 | + define('CONFIG_THEME_NAME', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['theme']) ? secureFileName($_GET['theme']) : 'default')); //change the theme to your custom theme rather than default |
|
128 | + define('CONFIG_DEFAULT_VIEW', (CONFIG_SYS_THUMBNAIL_VIEW_ENABLE ? 'detail' : 'detail')); //thumnail or detail |
|
129 | 129 | define('CONFIG_DEFAULT_PAGINATION_LIMIT', 10); |
130 | 130 | define('CONFIG_LOAD_DOC_LATTER', false); //all documents will be loaded up after the template has been loaded to the client |
131 | 131 | |
132 | 132 | //General Option Declarations |
133 | 133 | //LANGAUGAE DECLARATIONNS |
134 | 134 | define('CONFIG_LANG_INDEX', 'language'); //the index in the session |
135 | - define('CONFIG_LANG_DEFAULT', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['language']) && file_exists(DIR_LANG . secureFileName($_GET['language'] . '.php'))?secureFileName($_GET['language']):'en')); //change it to be your language file base name, such en |
|
135 | + define('CONFIG_LANG_DEFAULT', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['language']) && file_exists(DIR_LANG.secureFileName($_GET['language'].'.php')) ? secureFileName($_GET['language']) : 'en')); //change it to be your language file base name, such en |
|
136 | 136 | ?> |
137 | 137 | \ No newline at end of file |
@@ -1,12 +1,12 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * sysem config setting |
|
4 | - * @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn) |
|
5 | - * @link www.phpletter.com |
|
6 | - * @version 1.0 |
|
7 | - * @since 22/April/2007 |
|
8 | - * |
|
9 | - */ |
|
3 | + * sysem config setting |
|
4 | + * @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn) |
|
5 | + * @link www.phpletter.com |
|
6 | + * @version 1.0 |
|
7 | + * @since 22/April/2007 |
|
8 | + * |
|
9 | + */ |
|
10 | 10 | |
11 | 11 | //FILESYSTEM CONFIG <br> |
12 | 12 | define('AJAX_INIT_DONE', true); |
@@ -10,13 +10,13 @@ discard block |
||
10 | 10 | |
11 | 11 | //FILESYSTEM CONFIG <br> |
12 | 12 | define('AJAX_INIT_DONE', true); |
13 | -require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "class.auth.php"); |
|
13 | +require_once(dirname(__FILE__).DIRECTORY_SEPARATOR."class.auth.php"); |
|
14 | 14 | define('CONFIG_QUERY_STRING_ENABLE', true); //Enable passed query string to setting the system configuration |
15 | 15 | |
16 | 16 | // Added for phpMyFAQ |
17 | 17 | define('PMF_ROOT_DIR', dirname(dirname(dirname(dirname(dirname(__DIR__)))))); |
18 | 18 | define('IS_VALID_PHPMYFAQ', null); |
19 | -require PMF_ROOT_DIR . '/inc/Bootstrap.php'; |
|
19 | +require PMF_ROOT_DIR.'/inc/Bootstrap.php'; |
|
20 | 20 | |
21 | 21 | if (!isset($_SESSION)) { |
22 | 22 | session_start(PMF_Session::PMF_COOKIE_NAME_AUTH); |
@@ -37,48 +37,48 @@ discard block |
||
37 | 37 | } |
38 | 38 | //Directories Declarations |
39 | 39 | |
40 | -define('DIR_AJAX_ROOT', dirname(dirname(__FILE__)) . DIRECTORY_SEPARATOR) ; // the path to ajax file manager |
|
41 | -define('DIR_AJAX_INC', DIR_AJAX_ROOT . "inc" . DIRECTORY_SEPARATOR); |
|
42 | -define('DIR_AJAX_CLASSES', DIR_AJAX_ROOT . "classes" . DIRECTORY_SEPARATOR); |
|
43 | -define("DIR_AJAX_LANGS", DIR_AJAX_ROOT . "langs" . DIRECTORY_SEPARATOR); |
|
44 | -define('DIR_AJAX_JS', DIR_AJAX_ROOT . 'jscripts' . DIRECTORY_SEPARATOR); |
|
45 | -define('DIR_AJAX_EDIT_AREA', DIR_AJAX_JS . 'edit_area' . DIRECTORY_SEPARATOR); |
|
46 | -define('DIR_LANG', DIR_AJAX_ROOT . 'langs' . DIRECTORY_SEPARATOR); |
|
40 | +define('DIR_AJAX_ROOT', dirname(dirname(__FILE__)).DIRECTORY_SEPARATOR); // the path to ajax file manager |
|
41 | +define('DIR_AJAX_INC', DIR_AJAX_ROOT."inc".DIRECTORY_SEPARATOR); |
|
42 | +define('DIR_AJAX_CLASSES', DIR_AJAX_ROOT."classes".DIRECTORY_SEPARATOR); |
|
43 | +define("DIR_AJAX_LANGS", DIR_AJAX_ROOT."langs".DIRECTORY_SEPARATOR); |
|
44 | +define('DIR_AJAX_JS', DIR_AJAX_ROOT.'jscripts'.DIRECTORY_SEPARATOR); |
|
45 | +define('DIR_AJAX_EDIT_AREA', DIR_AJAX_JS.'edit_area'.DIRECTORY_SEPARATOR); |
|
46 | +define('DIR_LANG', DIR_AJAX_ROOT.'langs'.DIRECTORY_SEPARATOR); |
|
47 | 47 | |
48 | 48 | |
49 | 49 | //Class Declarations |
50 | -define('CLASS_FILE', DIR_AJAX_INC .'class.file.php'); |
|
51 | -define("CLASS_UPLOAD", DIR_AJAX_INC . 'class.upload.php'); |
|
52 | -define('CLASS_MANAGER', DIR_AJAX_INC . 'class.manager.php'); |
|
53 | -define('CLASS_IMAGE', DIR_AJAX_INC . "class.image.php"); |
|
54 | -define('CLASS_HISTORY', DIR_AJAX_INC . "class.history.php"); |
|
55 | -define('CLASS_SESSION_ACTION', DIR_AJAX_INC . "class.sessionaction.php"); |
|
56 | -define('CLASS_PAGINATION', DIR_AJAX_INC . 'class.pagination.php'); |
|
57 | -define('CLASS_SEARCH', DIR_AJAX_INC . "class.search.php"); |
|
50 | +define('CLASS_FILE', DIR_AJAX_INC.'class.file.php'); |
|
51 | +define("CLASS_UPLOAD", DIR_AJAX_INC.'class.upload.php'); |
|
52 | +define('CLASS_MANAGER', DIR_AJAX_INC.'class.manager.php'); |
|
53 | +define('CLASS_IMAGE', DIR_AJAX_INC."class.image.php"); |
|
54 | +define('CLASS_HISTORY', DIR_AJAX_INC."class.history.php"); |
|
55 | +define('CLASS_SESSION_ACTION', DIR_AJAX_INC."class.sessionaction.php"); |
|
56 | +define('CLASS_PAGINATION', DIR_AJAX_INC.'class.pagination.php'); |
|
57 | +define('CLASS_SEARCH', DIR_AJAX_INC."class.search.php"); |
|
58 | 58 | //SCRIPT FILES declarations |
59 | -define('SPT_FUNCTION_BASE', DIR_AJAX_INC . 'function.base.php'); |
|
59 | +define('SPT_FUNCTION_BASE', DIR_AJAX_INC.'function.base.php'); |
|
60 | 60 | //include different config base file according to query string "config" |
61 | 61 | $configBaseFileName = 'config.base.php'; |
62 | 62 | |
63 | -if(CONFIG_QUERY_STRING_ENABLE && !empty($_GET['config']) && file_exists(dirname(__FILE__)) . DIRECTORY_SEPARATOR . 'config.' . secureFileName($_GET['config']) . ".php") |
|
63 | +if (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['config']) && file_exists(dirname(__FILE__)).DIRECTORY_SEPARATOR.'config.'.secureFileName($_GET['config']).".php") |
|
64 | 64 | { |
65 | - $configBaseFileName = 'config.' . secureFileName($_GET['config']) . ".php"; |
|
65 | + $configBaseFileName = 'config.'.secureFileName($_GET['config']).".php"; |
|
66 | 66 | } |
67 | -require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . $configBaseFileName); |
|
67 | +require_once(dirname(__FILE__).DIRECTORY_SEPARATOR.$configBaseFileName); |
|
68 | 68 | |
69 | 69 | |
70 | -require_once(DIR_AJAX_LANGS . CONFIG_LANG_DEFAULT . ".php"); |
|
71 | -require_once(DIR_AJAX_INC . "function.base.php"); |
|
70 | +require_once(DIR_AJAX_LANGS.CONFIG_LANG_DEFAULT.".php"); |
|
71 | +require_once(DIR_AJAX_INC."function.base.php"); |
|
72 | 72 | |
73 | -require_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . "class.session.php"); |
|
73 | +require_once(dirname(__FILE__).DIRECTORY_SEPARATOR."class.session.php"); |
|
74 | 74 | $session = new Session(); |
75 | 75 | $auth = new Auth(); |
76 | 76 | |
77 | -if(CONFIG_ACCESS_CONTROL_MODE == 1) |
|
77 | +if (CONFIG_ACCESS_CONTROL_MODE == 1) |
|
78 | 78 | {//access control enabled |
79 | - if(!$auth->isLoggedIn() && strtolower(basename($_SERVER['PHP_SELF']) != strtolower(basename(CONFIG_LOGIN_PAGE)))) |
|
79 | + if (!$auth->isLoggedIn() && strtolower(basename($_SERVER['PHP_SELF']) != strtolower(basename(CONFIG_LOGIN_PAGE)))) |
|
80 | 80 | {// |
81 | - header('Location: ' . appendQueryString(CONFIG_LOGIN_PAGE, makeQueryString())); |
|
81 | + header('Location: '.appendQueryString(CONFIG_LOGIN_PAGE, makeQueryString())); |
|
82 | 82 | exit; |
83 | 83 | } |
84 | 84 | } |
@@ -1,53 +1,53 @@ |
||
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 | ?><?php |
7 | 7 | /** |
8 | - * the purpose I added this class is to make the file system much flexible |
|
9 | - * for customization. |
|
10 | - * Actually, this is a kind of interface and you should modify it to fit your system |
|
11 | - * @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn) |
|
12 | - * @link www.phpletter.com |
|
13 | - * @since 4/August/2007 |
|
14 | - */ |
|
15 | - class Auth |
|
16 | - { |
|
17 | - var $__loginIndexInSession = 'ajax_user'; |
|
18 | - function __construct() |
|
19 | - { |
|
8 | + * the purpose I added this class is to make the file system much flexible |
|
9 | + * for customization. |
|
10 | + * Actually, this is a kind of interface and you should modify it to fit your system |
|
11 | + * @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn) |
|
12 | + * @link www.phpletter.com |
|
13 | + * @since 4/August/2007 |
|
14 | + */ |
|
15 | + class Auth |
|
16 | + { |
|
17 | + var $__loginIndexInSession = 'ajax_user'; |
|
18 | + function __construct() |
|
19 | + { |
|
20 | 20 | |
21 | - } |
|
21 | + } |
|
22 | 22 | |
23 | - function Auth() |
|
24 | - { |
|
25 | - $this->__construct(); |
|
26 | - } |
|
27 | - /** |
|
28 | - * check if the user has logged |
|
29 | - * |
|
30 | - * @return boolean |
|
31 | - */ |
|
32 | - function isLoggedIn() |
|
33 | - { |
|
34 | - return (!empty($_SESSION[$this->__loginIndexInSession])?true:false); |
|
35 | - } |
|
36 | - /** |
|
37 | - * validate the username & password |
|
38 | - * @return boolean |
|
39 | - * |
|
40 | - */ |
|
41 | - function login() |
|
42 | - { |
|
43 | - if($_POST['username'] == CONFIG_LOGIN_USERNAME && $_POST['password'] == CONFIG_LOGIN_PASSWORD) |
|
44 | - { |
|
45 | - $_SESSION[$this->__loginIndexInSession] = true; |
|
46 | - return true; |
|
47 | - }else |
|
48 | - { |
|
49 | - return false; |
|
50 | - } |
|
51 | - } |
|
52 | - } |
|
23 | + function Auth() |
|
24 | + { |
|
25 | + $this->__construct(); |
|
26 | + } |
|
27 | + /** |
|
28 | + * check if the user has logged |
|
29 | + * |
|
30 | + * @return boolean |
|
31 | + */ |
|
32 | + function isLoggedIn() |
|
33 | + { |
|
34 | + return (!empty($_SESSION[$this->__loginIndexInSession])?true:false); |
|
35 | + } |
|
36 | + /** |
|
37 | + * validate the username & password |
|
38 | + * @return boolean |
|
39 | + * |
|
40 | + */ |
|
41 | + function login() |
|
42 | + { |
|
43 | + if($_POST['username'] == CONFIG_LOGIN_USERNAME && $_POST['password'] == CONFIG_LOGIN_PASSWORD) |
|
44 | + { |
|
45 | + $_SESSION[$this->__loginIndexInSession] = true; |
|
46 | + return true; |
|
47 | + }else |
|
48 | + { |
|
49 | + return false; |
|
50 | + } |
|
51 | + } |
|
52 | + } |
|
53 | 53 | ?> |
54 | 54 | \ No newline at end of file |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | - if(!defined('AJAX_INIT_DONE')) |
|
2 | + if (!defined('AJAX_INIT_DONE')) |
|
3 | 3 | { |
4 | 4 | die('Permission denied'); |
5 | 5 | } |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | */ |
32 | 32 | function isLoggedIn() |
33 | 33 | { |
34 | - return (!empty($_SESSION[$this->__loginIndexInSession])?true:false); |
|
34 | + return (!empty($_SESSION[$this->__loginIndexInSession]) ? true : false); |
|
35 | 35 | } |
36 | 36 | /** |
37 | 37 | * validate the username & password |
@@ -40,11 +40,11 @@ discard block |
||
40 | 40 | */ |
41 | 41 | function login() |
42 | 42 | { |
43 | - if($_POST['username'] == CONFIG_LOGIN_USERNAME && $_POST['password'] == CONFIG_LOGIN_PASSWORD) |
|
43 | + if ($_POST['username'] == CONFIG_LOGIN_USERNAME && $_POST['password'] == CONFIG_LOGIN_PASSWORD) |
|
44 | 44 | { |
45 | 45 | $_SESSION[$this->__loginIndexInSession] = true; |
46 | 46 | return true; |
47 | - }else |
|
47 | + } else |
|
48 | 48 | { |
49 | 49 | return false; |
50 | 50 | } |
@@ -44,7 +44,7 @@ |
||
44 | 44 | { |
45 | 45 | $_SESSION[$this->__loginIndexInSession] = true; |
46 | 46 | return true; |
47 | - }else |
|
47 | + } else |
|
48 | 48 | { |
49 | 49 | return false; |
50 | 50 | } |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php |
2 | - die(); |
|
2 | + die(); |
|
3 | 3 | ?><pre>Array |
4 | 4 | ( |
5 | 5 | [currentFolderPath] => ../../../../uploaded/ |
@@ -1,16 +1,16 @@ discard block |
||
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 | ?><?php |
7 | - /** |
|
8 | - * sysem base config setting |
|
9 | - * @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn) |
|
10 | - * @link www.phpletter.com |
|
11 | - * @since 1/August/2007 |
|
12 | - * |
|
13 | - */ |
|
7 | + /** |
|
8 | + * sysem base config setting |
|
9 | + * @author Logan Cai (cailongqun [at] yahoo [dot] com [dot] cn) |
|
10 | + * @link www.phpletter.com |
|
11 | + * @since 1/August/2007 |
|
12 | + * |
|
13 | + */ |
|
14 | 14 | |
15 | 15 | |
16 | 16 | error_reporting(E_ALL); |
@@ -18,121 +18,119 @@ discard block |
||
18 | 18 | |
19 | 19 | |
20 | 20 | |
21 | - //Access Control Setting |
|
22 | - /** |
|
23 | - * turn off => false |
|
24 | - * by session => true |
|
25 | - */ |
|
21 | + //Access Control Setting |
|
22 | + /** |
|
23 | + * turn off => false |
|
24 | + * by session => true |
|
25 | + */ |
|
26 | 26 | define('CONFIG_ACCESS_CONTROL_MODE', true); |
27 | 27 | define("CONFIG_LOGIN_USERNAME", 'sdfgdfgdfgdgfdgsdfsdfg3454dsfb5e'); |
28 | 28 | define('CONFIG_LOGIN_PASSWORD', 'ASDF@#%JHGSDFGasdkjfh3812764ksdjfbhkjxcf'); |
29 | - define('CONFIG_LOGIN_PAGE', 'ajax_login.php'); //the url to the login page |
|
29 | + define('CONFIG_LOGIN_PAGE', 'ajax_login.php'); //the url to the login page |
|
30 | 30 | |
31 | - //SYSTEM MODE CONFIG |
|
32 | - /** |
|
33 | - * turn it on when you have this system for demo purpose |
|
34 | - * that means changes made to each image is not physically applied to it |
|
35 | - * and all uploaded files/created folders will be removed automatically |
|
36 | - */ |
|
37 | - define('CONFIG_SYS_DEMO_ENABLE', false); |
|
38 | - define('CONFIG_SYS_VIEW_ONLY', false); //diabled the system, view only |
|
39 | - define('CONFIG_SYS_THUMBNAIL_VIEW_ENABLE', true);//REMOVE THE thumbnail view if false |
|
31 | + //SYSTEM MODE CONFIG |
|
32 | + /** |
|
33 | + * turn it on when you have this system for demo purpose |
|
34 | + * that means changes made to each image is not physically applied to it |
|
35 | + * and all uploaded files/created folders will be removed automatically |
|
36 | + */ |
|
37 | + define('CONFIG_SYS_DEMO_ENABLE', false); |
|
38 | + define('CONFIG_SYS_VIEW_ONLY', false); //diabled the system, view only |
|
39 | + define('CONFIG_SYS_THUMBNAIL_VIEW_ENABLE', true);//REMOVE THE thumbnail view if false |
|
40 | 40 | |
41 | - //User Permissions |
|
42 | - define('CONFIG_OPTIONS_DELETE', true); //disable to delete folder |
|
43 | - define('CONFIG_OPTIONS_CUT', true); //disalbe to cut a file/folder |
|
44 | - define('CONFIG_OPTIONS_COPY', true); //disable to copy a file/folder |
|
45 | - define('CONFIG_OPTIONS_NEWFOLDER', true); //disable to create new folder |
|
46 | - define('CONFIG_OPTIONS_RENAME', true); //disable to rename the file/folder |
|
47 | - define('CONFIG_OPTIONS_UPLOAD', true); //disable to upload the file |
|
48 | - define('CONFIG_OPTIONS_EDITABLE', true); //disable image editor and text editor |
|
49 | - define('CONFIG_OPTIONS_SEARCH', true); //disable to search documents |
|
50 | - //FILESYSTEM CONFIG |
|
51 | - /* |
|
41 | + //User Permissions |
|
42 | + define('CONFIG_OPTIONS_DELETE', true); //disable to delete folder |
|
43 | + define('CONFIG_OPTIONS_CUT', true); //disalbe to cut a file/folder |
|
44 | + define('CONFIG_OPTIONS_COPY', true); //disable to copy a file/folder |
|
45 | + define('CONFIG_OPTIONS_NEWFOLDER', true); //disable to create new folder |
|
46 | + define('CONFIG_OPTIONS_RENAME', true); //disable to rename the file/folder |
|
47 | + define('CONFIG_OPTIONS_UPLOAD', true); //disable to upload the file |
|
48 | + define('CONFIG_OPTIONS_EDITABLE', true); //disable image editor and text editor |
|
49 | + define('CONFIG_OPTIONS_SEARCH', true); //disable to search documents |
|
50 | + //FILESYSTEM CONFIG |
|
51 | + /* |
|
52 | 52 | * CONFIG_SYS_DEFAULT_PATH is the default folder where the files would be uploaded to |
53 | 53 | and it must be a folder under the CONFIG_SYS_ROOT_PATH or the same folder |
54 | 54 | these two paths accept relative path only, don't use absolute path |
55 | 55 | */ |
56 | 56 | |
57 | - define('CONFIG_SYS_DEFAULT_PATH', '../../../../images/'); //accept relative path only |
|
58 | - define('CONFIG_SYS_ROOT_PATH', '../../../../images/'); //accept relative path only |
|
59 | - define('CONFIG_SYS_FOLDER_SHOWN_ON_TOP', true); //show your folders on the top of list if true or order by name |
|
60 | - define("CONFIG_SYS_DIR_SESSION_PATH", '/tmp'); |
|
61 | - define("CONFIG_SYS_PATTERN_FORMAT", 'list'); //three options: reg ,csv, list, this option define the parttern format for the following patterns |
|
62 | - /** |
|
63 | - * reg => regulare expression |
|
64 | - * csv => a list of comma separated file/folder name, (exactly match the specified file/folders) |
|
65 | - * list => a list of comma spearated vague file/folder name (partially match the specified file/folders) |
|
66 | - * |
|
67 | - */ |
|
68 | - //more details about regular expression please visit http://nz.php.net/manual/en/function.eregi.php |
|
69 | - define('CONFIG_SYS_INC_DIR_PATTERN', ''); //force listing of folders with such pattern(s). separated by , if multiple |
|
70 | - define('CONFIG_SYS_EXC_DIR_PATTERN', ''); //will prevent listing of folders with such pattern(s). separated by , if multiple |
|
71 | - define('CONFIG_SYS_INC_FILE_PATTERN', ''); //force listing of fiels with such pattern(s). separated by , if multiple |
|
72 | - define('CONFIG_SYS_EXC_FILE_PATTERN', ''); //will prevent listing of files with such pattern(s). separated by , if multiple |
|
73 | - define('CONFIG_SYS_DELETE_RECURSIVE', 1); //delete all contents within a specific folder if set to be 1 |
|
57 | + define('CONFIG_SYS_DEFAULT_PATH', '../../../../images/'); //accept relative path only |
|
58 | + define('CONFIG_SYS_ROOT_PATH', '../../../../images/'); //accept relative path only |
|
59 | + define('CONFIG_SYS_FOLDER_SHOWN_ON_TOP', true); //show your folders on the top of list if true or order by name |
|
60 | + define("CONFIG_SYS_DIR_SESSION_PATH", '/tmp'); |
|
61 | + define("CONFIG_SYS_PATTERN_FORMAT", 'list'); //three options: reg ,csv, list, this option define the parttern format for the following patterns |
|
62 | + /** |
|
63 | + * reg => regulare expression |
|
64 | + * csv => a list of comma separated file/folder name, (exactly match the specified file/folders) |
|
65 | + * list => a list of comma spearated vague file/folder name (partially match the specified file/folders) |
|
66 | + * |
|
67 | + */ |
|
68 | + //more details about regular expression please visit http://nz.php.net/manual/en/function.eregi.php |
|
69 | + define('CONFIG_SYS_INC_DIR_PATTERN', ''); //force listing of folders with such pattern(s). separated by , if multiple |
|
70 | + define('CONFIG_SYS_EXC_DIR_PATTERN', ''); //will prevent listing of folders with such pattern(s). separated by , if multiple |
|
71 | + define('CONFIG_SYS_INC_FILE_PATTERN', ''); //force listing of fiels with such pattern(s). separated by , if multiple |
|
72 | + define('CONFIG_SYS_EXC_FILE_PATTERN', ''); //will prevent listing of files with such pattern(s). separated by , if multiple |
|
73 | + define('CONFIG_SYS_DELETE_RECURSIVE', 1); //delete all contents within a specific folder if set to be 1 |
|
74 | 74 | |
75 | - //UPLOAD OPTIONS CONFIG |
|
76 | - define('CONFIG_UPLOAD_MAXSIZE', 50 * 1024 & 1024 ); //by bytes |
|
77 | - //define('CONFIG_UPLOAD_MAXSIZE', 2048); //by bytes |
|
78 | - //define('CONFIG_UPLOAD_VALID_EXTS', 'txt');// |
|
75 | + //UPLOAD OPTIONS CONFIG |
|
76 | + define('CONFIG_UPLOAD_MAXSIZE', 50 * 1024 & 1024 ); //by bytes |
|
77 | + //define('CONFIG_UPLOAD_MAXSIZE', 2048); //by bytes |
|
78 | + //define('CONFIG_UPLOAD_VALID_EXTS', 'txt');// |
|
79 | 79 | |
80 | - define('CONFIG_EDITABLE_VALID_EXTS', 'txt,htm,html,xml,js,css'); //make you include all these extension in CONFIG_UPLOAD_VALID_EXTS if you want all valid |
|
80 | + define('CONFIG_EDITABLE_VALID_EXTS', 'txt,htm,html,xml,js,css'); //make you include all these extension in CONFIG_UPLOAD_VALID_EXTS if you want all valid |
|
81 | 81 | |
82 | - define('CONFIG_OVERWRITTEN', false); //overwirte when processing paste |
|
83 | - define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,txt'); // |
|
84 | - //define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,bmp,tif,zip,sit,rar,gz,tar,htm,html,mov,mpg,avi,asf,mpeg,wmv,aif,aiff,wav,mp3,swf,ppt,rtf,doc,pdf,xls,txt,xml,xsl,dtd');// |
|
85 | - define("CONFIG_VIEWABLE_VALID_EXTS", 'gif,bmp,txt,jpg,png,tif,html,htm,js,css,xml,xsl,dtd,mp3,wav,wmv,wma,rm,rmvb,mov,swf'); |
|
86 | - //define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,txt'); // |
|
87 | - define('CONFIG_UPLOAD_INVALID_EXTS', ''); |
|
82 | + define('CONFIG_OVERWRITTEN', false); //overwirte when processing paste |
|
83 | + define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,txt'); // |
|
84 | + //define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,bmp,tif,zip,sit,rar,gz,tar,htm,html,mov,mpg,avi,asf,mpeg,wmv,aif,aiff,wav,mp3,swf,ppt,rtf,doc,pdf,xls,txt,xml,xsl,dtd');// |
|
85 | + define("CONFIG_VIEWABLE_VALID_EXTS", 'gif,bmp,txt,jpg,png,tif,html,htm,js,css,xml,xsl,dtd,mp3,wav,wmv,wma,rm,rmvb,mov,swf'); |
|
86 | + //define('CONFIG_UPLOAD_VALID_EXTS', 'gif,jpg,png,txt'); // |
|
87 | + define('CONFIG_UPLOAD_INVALID_EXTS', ''); |
|
88 | 88 | |
89 | - //Preview |
|
90 | - define('CONFIG_IMG_THUMBNAIL_MAX_X', 100); |
|
91 | - define('CONFIG_IMG_THUMBNAIL_MAX_Y', 100); |
|
92 | - define('CONFIG_THICKBOX_MAX_WIDTH', 700); |
|
93 | - define('CONFIG_THICKBOX_MAX_HEIGHT', 430); |
|
89 | + //Preview |
|
90 | + define('CONFIG_IMG_THUMBNAIL_MAX_X', 100); |
|
91 | + define('CONFIG_IMG_THUMBNAIL_MAX_Y', 100); |
|
92 | + define('CONFIG_THICKBOX_MAX_WIDTH', 700); |
|
93 | + define('CONFIG_THICKBOX_MAX_HEIGHT', 430); |
|
94 | 94 | |
95 | 95 | |
96 | - /** |
|
97 | - * CONFIG_URL_PREVIEW_ROOT was replaced by CONFIG_WEBSITE_DOCUMENT_ROOT since v0.8 |
|
98 | - * Normally, you don't need to bother with CONFIG_WEBSITE_DOCUMENT_ROOT |
|
99 | - * Howerver, some Web Hosts do not have standard php.ini setting |
|
100 | - * which you will find the file manager can not locate your files correctly |
|
101 | - * if you do have such issue, please change it to fit your system. |
|
102 | - * so what should you to do get it |
|
103 | - * 1. create a php script file (let's call it document_root.php) |
|
104 | - * 2. add the following codes in in |
|
105 | - * <?php |
|
106 | - * echo dirname(__FILE__); |
|
107 | - * ?> |
|
108 | - * 3. upload document_root.php to you website root folder which will only be reached when you visit http://www.domain-name.com or http://localhost/ at localhost computer |
|
109 | - * 4. run it via http://www.domain-name.com/document_root.php or http://localhost/docuent_root.php if localhost computer, the url has to be exactly like that |
|
110 | - * 5. the value shown on the screen is CONFIG_WEBSITE_DOCUMENT_ROOT should be |
|
111 | - * 6. enjoy it |
|
112 | - |
|
113 | - |
|
114 | - * |
|
115 | - */ |
|
96 | + /** |
|
97 | + * CONFIG_URL_PREVIEW_ROOT was replaced by CONFIG_WEBSITE_DOCUMENT_ROOT since v0.8 |
|
98 | + * Normally, you don't need to bother with CONFIG_WEBSITE_DOCUMENT_ROOT |
|
99 | + * Howerver, some Web Hosts do not have standard php.ini setting |
|
100 | + * which you will find the file manager can not locate your files correctly |
|
101 | + * if you do have such issue, please change it to fit your system. |
|
102 | + * so what should you to do get it |
|
103 | + * 1. create a php script file (let's call it document_root.php) |
|
104 | + * 2. add the following codes in in |
|
105 | + * <?php |
|
106 | + * echo dirname(__FILE__); |
|
107 | + * ?> |
|
108 | + * 3. upload document_root.php to you website root folder which will only be reached when you visit http://www.domain-name.com or http://localhost/ at localhost computer |
|
109 | + * 4. run it via http://www.domain-name.com/document_root.php or http://localhost/docuent_root.php if localhost computer, the url has to be exactly like that |
|
110 | + * 5. the value shown on the screen is CONFIG_WEBSITE_DOCUMENT_ROOT should be |
|
111 | + * 6. enjoy it |
|
112 | + * |
|
113 | + */ |
|
116 | 114 | |
117 | 115 | |
118 | - define('CONFIG_WEBSITE_DOCUMENT_ROOT', $_SERVER['DOCUMENT_ROOT']); |
|
119 | - //theme related setting |
|
120 | - /* |
|
116 | + define('CONFIG_WEBSITE_DOCUMENT_ROOT', $_SERVER['DOCUMENT_ROOT']); |
|
117 | + //theme related setting |
|
118 | + /* |
|
121 | 119 | * options avaialbe for CONFIG_EDITOR_NAME are: |
122 | 120 | stand_alone |
123 | 121 | tinymce |
124 | 122 | fckeditor |
125 | 123 | */ |
126 | - //CONFIG_EDITOR_NAME replaced CONFIG_THEME_MODE since @version 0.8 |
|
127 | - define('CONFIG_EDITOR_NAME', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['editor'])?secureFileName($_GET['editor']):'tinymce')); |
|
128 | - define('CONFIG_THEME_NAME', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['theme'])?secureFileName($_GET['theme']):'default')); //change the theme to your custom theme rather than default |
|
129 | - define('CONFIG_DEFAULT_VIEW', (CONFIG_SYS_THUMBNAIL_VIEW_ENABLE?'detail':'detail')); //thumnail or detail |
|
130 | - define('CONFIG_DEFAULT_PAGINATION_LIMIT', 10); |
|
131 | - define('CONFIG_LOAD_DOC_LATTER', false); //all documents will be loaded up after the template has been loaded to the client |
|
124 | + //CONFIG_EDITOR_NAME replaced CONFIG_THEME_MODE since @version 0.8 |
|
125 | + define('CONFIG_EDITOR_NAME', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['editor'])?secureFileName($_GET['editor']):'tinymce')); |
|
126 | + define('CONFIG_THEME_NAME', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['theme'])?secureFileName($_GET['theme']):'default')); //change the theme to your custom theme rather than default |
|
127 | + define('CONFIG_DEFAULT_VIEW', (CONFIG_SYS_THUMBNAIL_VIEW_ENABLE?'detail':'detail')); //thumnail or detail |
|
128 | + define('CONFIG_DEFAULT_PAGINATION_LIMIT', 10); |
|
129 | + define('CONFIG_LOAD_DOC_LATTER', false); //all documents will be loaded up after the template has been loaded to the client |
|
132 | 130 | |
133 | - //General Option Declarations |
|
134 | - //LANGAUGAE DECLARATIONNS |
|
131 | + //General Option Declarations |
|
132 | + //LANGAUGAE DECLARATIONNS |
|
135 | 133 | |
136 | - define('CONFIG_LANG_INDEX', 'language'); //the index in the session |
|
137 | - define('CONFIG_LANG_DEFAULT', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['language']) && file_exists(DIR_LANG . secureFileName($_GET['language']) . '.php')?secureFileName($_GET['language']):'en')); //change it to be your language file base name, such en |
|
134 | + define('CONFIG_LANG_INDEX', 'language'); //the index in the session |
|
135 | + define('CONFIG_LANG_DEFAULT', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['language']) && file_exists(DIR_LANG . secureFileName($_GET['language']) . '.php')?secureFileName($_GET['language']):'en')); //change it to be your language file base name, such en |
|
138 | 136 | ?> |
139 | 137 | \ No newline at end of file |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | - if(!defined('AJAX_INIT_DONE')) |
|
2 | + if (!defined('AJAX_INIT_DONE')) |
|
3 | 3 | { |
4 | 4 | die('Permission denied'); |
5 | 5 | } |
@@ -36,12 +36,12 @@ discard block |
||
36 | 36 | */ |
37 | 37 | define('CONFIG_SYS_DEMO_ENABLE', false); |
38 | 38 | define('CONFIG_SYS_VIEW_ONLY', false); //diabled the system, view only |
39 | - define('CONFIG_SYS_THUMBNAIL_VIEW_ENABLE', true);//REMOVE THE thumbnail view if false |
|
39 | + define('CONFIG_SYS_THUMBNAIL_VIEW_ENABLE', true); //REMOVE THE thumbnail view if false |
|
40 | 40 | |
41 | 41 | //User Permissions |
42 | 42 | define('CONFIG_OPTIONS_DELETE', true); //disable to delete folder |
43 | - define('CONFIG_OPTIONS_CUT', true); //disalbe to cut a file/folder |
|
44 | - define('CONFIG_OPTIONS_COPY', true); //disable to copy a file/folder |
|
43 | + define('CONFIG_OPTIONS_CUT', true); //disalbe to cut a file/folder |
|
44 | + define('CONFIG_OPTIONS_COPY', true); //disable to copy a file/folder |
|
45 | 45 | define('CONFIG_OPTIONS_NEWFOLDER', true); //disable to create new folder |
46 | 46 | define('CONFIG_OPTIONS_RENAME', true); //disable to rename the file/folder |
47 | 47 | define('CONFIG_OPTIONS_UPLOAD', true); //disable to upload the file |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | */ |
56 | 56 | |
57 | 57 | define('CONFIG_SYS_DEFAULT_PATH', '../../../../images/'); //accept relative path only |
58 | - define('CONFIG_SYS_ROOT_PATH', '../../../../images/'); //accept relative path only |
|
58 | + define('CONFIG_SYS_ROOT_PATH', '../../../../images/'); //accept relative path only |
|
59 | 59 | define('CONFIG_SYS_FOLDER_SHOWN_ON_TOP', true); //show your folders on the top of list if true or order by name |
60 | 60 | define("CONFIG_SYS_DIR_SESSION_PATH", '/tmp'); |
61 | 61 | define("CONFIG_SYS_PATTERN_FORMAT", 'list'); //three options: reg ,csv, list, this option define the parttern format for the following patterns |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | define('CONFIG_SYS_DELETE_RECURSIVE', 1); //delete all contents within a specific folder if set to be 1 |
74 | 74 | |
75 | 75 | //UPLOAD OPTIONS CONFIG |
76 | - define('CONFIG_UPLOAD_MAXSIZE', 50 * 1024 & 1024 ); //by bytes |
|
76 | + define('CONFIG_UPLOAD_MAXSIZE', 50*1024 & 1024); //by bytes |
|
77 | 77 | //define('CONFIG_UPLOAD_MAXSIZE', 2048); //by bytes |
78 | 78 | //define('CONFIG_UPLOAD_VALID_EXTS', 'txt');// |
79 | 79 | |
@@ -124,9 +124,9 @@ discard block |
||
124 | 124 | fckeditor |
125 | 125 | */ |
126 | 126 | //CONFIG_EDITOR_NAME replaced CONFIG_THEME_MODE since @version 0.8 |
127 | - define('CONFIG_EDITOR_NAME', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['editor'])?secureFileName($_GET['editor']):'tinymce')); |
|
128 | - define('CONFIG_THEME_NAME', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['theme'])?secureFileName($_GET['theme']):'default')); //change the theme to your custom theme rather than default |
|
129 | - define('CONFIG_DEFAULT_VIEW', (CONFIG_SYS_THUMBNAIL_VIEW_ENABLE?'detail':'detail')); //thumnail or detail |
|
127 | + define('CONFIG_EDITOR_NAME', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['editor']) ? secureFileName($_GET['editor']) : 'tinymce')); |
|
128 | + define('CONFIG_THEME_NAME', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['theme']) ? secureFileName($_GET['theme']) : 'default')); //change the theme to your custom theme rather than default |
|
129 | + define('CONFIG_DEFAULT_VIEW', (CONFIG_SYS_THUMBNAIL_VIEW_ENABLE ? 'detail' : 'detail')); //thumnail or detail |
|
130 | 130 | define('CONFIG_DEFAULT_PAGINATION_LIMIT', 10); |
131 | 131 | define('CONFIG_LOAD_DOC_LATTER', false); //all documents will be loaded up after the template has been loaded to the client |
132 | 132 | |
@@ -134,5 +134,5 @@ discard block |
||
134 | 134 | //LANGAUGAE DECLARATIONNS |
135 | 135 | |
136 | 136 | define('CONFIG_LANG_INDEX', 'language'); //the index in the session |
137 | - define('CONFIG_LANG_DEFAULT', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['language']) && file_exists(DIR_LANG . secureFileName($_GET['language']) . '.php')?secureFileName($_GET['language']):'en')); //change it to be your language file base name, such en |
|
137 | + define('CONFIG_LANG_DEFAULT', (CONFIG_QUERY_STRING_ENABLE && !empty($_GET['language']) && file_exists(DIR_LANG.secureFileName($_GET['language']).'.php') ? secureFileName($_GET['language']) : 'en')); //change it to be your language file base name, such en |
|
138 | 138 | ?> |
139 | 139 | \ No newline at end of file |
@@ -1,189 +1,189 @@ |
||
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 | ?><?php |
7 | - include_once(CLASS_FILE); |
|
8 | - require_once(CLASS_SESSION_ACTION); |
|
9 | - require_once(CLASS_MANAGER); |
|
10 | - class Search |
|
11 | - { |
|
12 | - var $rootFolder = ''; |
|
13 | - var $files = array(); |
|
14 | - var $rootFolderInfo = array(); |
|
15 | - var $searchkeywords = array( |
|
16 | - 'mtime_from'=>'', |
|
17 | - 'mtime_to'=>'', |
|
18 | - 'name'=>'', |
|
19 | - 'size_from'=>'', |
|
20 | - 'size_to'=>'', |
|
21 | - 'recursive'=>'0', |
|
7 | + include_once(CLASS_FILE); |
|
8 | + require_once(CLASS_SESSION_ACTION); |
|
9 | + require_once(CLASS_MANAGER); |
|
10 | + class Search |
|
11 | + { |
|
12 | + var $rootFolder = ''; |
|
13 | + var $files = array(); |
|
14 | + var $rootFolderInfo = array(); |
|
15 | + var $searchkeywords = array( |
|
16 | + 'mtime_from'=>'', |
|
17 | + 'mtime_to'=>'', |
|
18 | + 'name'=>'', |
|
19 | + 'size_from'=>'', |
|
20 | + 'size_to'=>'', |
|
21 | + 'recursive'=>'0', |
|
22 | 22 | |
23 | - ); |
|
24 | - var $sessionAction = null; |
|
25 | - /** |
|
26 | - * constructor |
|
27 | - * |
|
28 | - * @param string $rootFolder |
|
29 | - */ |
|
30 | - function __construct($rootFolder) |
|
31 | - { |
|
32 | - $this->rootFolder = $rootFolder; |
|
33 | - $this->sessionAction = new SessionAction(); |
|
34 | - $objRootFolder = new file($this->rootFolder); |
|
35 | - $tem = $objRootFolder->getFileInfo(); |
|
36 | - $obj = new manager($this->rootFolder, false); |
|
37 | - $obj->setSessionAction($this->sessionAction); |
|
38 | - $selectedDocuments = $this->sessionAction->get(); |
|
39 | - $fileType = $obj->getFolderInfo($this->rootFolder); |
|
23 | + ); |
|
24 | + var $sessionAction = null; |
|
25 | + /** |
|
26 | + * constructor |
|
27 | + * |
|
28 | + * @param string $rootFolder |
|
29 | + */ |
|
30 | + function __construct($rootFolder) |
|
31 | + { |
|
32 | + $this->rootFolder = $rootFolder; |
|
33 | + $this->sessionAction = new SessionAction(); |
|
34 | + $objRootFolder = new file($this->rootFolder); |
|
35 | + $tem = $objRootFolder->getFileInfo(); |
|
36 | + $obj = new manager($this->rootFolder, false); |
|
37 | + $obj->setSessionAction($this->sessionAction); |
|
38 | + $selectedDocuments = $this->sessionAction->get(); |
|
39 | + $fileType = $obj->getFolderInfo($this->rootFolder); |
|
40 | 40 | |
41 | - foreach($fileType as $k=>$v) |
|
42 | - { |
|
43 | - $tem[$k] = $v; |
|
44 | - } |
|
41 | + foreach($fileType as $k=>$v) |
|
42 | + { |
|
43 | + $tem[$k] = $v; |
|
44 | + } |
|
45 | 45 | |
46 | - $tem['path'] = backslashToSlash($this->rootFolder); |
|
47 | - $tem['type'] = (is_dir($this->rootFolder)?'folder':'file'); |
|
48 | - $tem['size'] = (is_dir($this->rootFolder)?'':transformFileSize(@filesize($this->rootFolder))); |
|
49 | - //$tem['ctime'] = date(DATE_TIME_FORMAT, $tem['ctime']); |
|
50 | - //$tem['mtime'] = date(DATE_TIME_FORMAT, $tem['mtime']); |
|
51 | - $tem['flag'] = (array_search($tem['path'], $selectedDocuments) !== false?($this->sessionAction->getAction() == "copy"?'copyFlag':'cutFlag'):'noFlag'); |
|
52 | - $tem['url'] = getFileUrl($this->rootFolder); |
|
53 | - $tem['friendly_path'] = transformFilePath($this->rootFolder); |
|
54 | - $tem['file'] = 0; |
|
55 | - $tem['subdir'] = 0; |
|
56 | - $manager = null; |
|
57 | - $this->rootFolderInfo = $tem; |
|
58 | - $tem = null; |
|
59 | - } |
|
46 | + $tem['path'] = backslashToSlash($this->rootFolder); |
|
47 | + $tem['type'] = (is_dir($this->rootFolder)?'folder':'file'); |
|
48 | + $tem['size'] = (is_dir($this->rootFolder)?'':transformFileSize(@filesize($this->rootFolder))); |
|
49 | + //$tem['ctime'] = date(DATE_TIME_FORMAT, $tem['ctime']); |
|
50 | + //$tem['mtime'] = date(DATE_TIME_FORMAT, $tem['mtime']); |
|
51 | + $tem['flag'] = (array_search($tem['path'], $selectedDocuments) !== false?($this->sessionAction->getAction() == "copy"?'copyFlag':'cutFlag'):'noFlag'); |
|
52 | + $tem['url'] = getFileUrl($this->rootFolder); |
|
53 | + $tem['friendly_path'] = transformFilePath($this->rootFolder); |
|
54 | + $tem['file'] = 0; |
|
55 | + $tem['subdir'] = 0; |
|
56 | + $manager = null; |
|
57 | + $this->rootFolderInfo = $tem; |
|
58 | + $tem = null; |
|
59 | + } |
|
60 | 60 | |
61 | 61 | |
62 | 62 | |
63 | - /** |
|
64 | - * constructor |
|
65 | - * |
|
66 | - * @param string $rootFolder |
|
67 | - */ |
|
68 | - function Search($rootFolder) |
|
69 | - { |
|
70 | - $this->__construct($rootFolder); |
|
71 | - } |
|
63 | + /** |
|
64 | + * constructor |
|
65 | + * |
|
66 | + * @param string $rootFolder |
|
67 | + */ |
|
68 | + function Search($rootFolder) |
|
69 | + { |
|
70 | + $this->__construct($rootFolder); |
|
71 | + } |
|
72 | 72 | |
73 | - /** |
|
74 | - * change the search keyword individually |
|
75 | - * |
|
76 | - * @param string $key |
|
77 | - * @param string $value |
|
78 | - */ |
|
79 | - function addSearchKeyword($key, $value) |
|
80 | - { |
|
81 | - $this->searchkeywords[$key] = $value; |
|
82 | - } |
|
83 | - /** |
|
84 | - * change the search keywords |
|
85 | - * |
|
86 | - * @param array $keywords |
|
87 | - */ |
|
88 | - function addSearchKeywords($keywords) |
|
89 | - { |
|
90 | - foreach($this->searchkeywords as $k=>$v) |
|
91 | - { |
|
92 | - if(array_key_exists($k, $keywords) !== false) |
|
93 | - { |
|
94 | - $this->searchkeywords[$k] = $keywords[$k]; |
|
95 | - } |
|
96 | - } |
|
97 | - } |
|
98 | - /** |
|
99 | - * get the file according to the search keywords |
|
100 | - * |
|
101 | - */ |
|
102 | - function doSearch($baseFolderPath = null) |
|
103 | - { |
|
73 | + /** |
|
74 | + * change the search keyword individually |
|
75 | + * |
|
76 | + * @param string $key |
|
77 | + * @param string $value |
|
78 | + */ |
|
79 | + function addSearchKeyword($key, $value) |
|
80 | + { |
|
81 | + $this->searchkeywords[$key] = $value; |
|
82 | + } |
|
83 | + /** |
|
84 | + * change the search keywords |
|
85 | + * |
|
86 | + * @param array $keywords |
|
87 | + */ |
|
88 | + function addSearchKeywords($keywords) |
|
89 | + { |
|
90 | + foreach($this->searchkeywords as $k=>$v) |
|
91 | + { |
|
92 | + if(array_key_exists($k, $keywords) !== false) |
|
93 | + { |
|
94 | + $this->searchkeywords[$k] = $keywords[$k]; |
|
95 | + } |
|
96 | + } |
|
97 | + } |
|
98 | + /** |
|
99 | + * get the file according to the search keywords |
|
100 | + * |
|
101 | + */ |
|
102 | + function doSearch($baseFolderPath = null) |
|
103 | + { |
|
104 | 104 | |
105 | - $baseFolderPath = addTrailingSlash(backslashToSlash((is_null($baseFolderPath)?$this->rootFolder:$baseFolderPath))); |
|
105 | + $baseFolderPath = addTrailingSlash(backslashToSlash((is_null($baseFolderPath)?$this->rootFolder:$baseFolderPath))); |
|
106 | 106 | |
107 | - $dirHandler = @opendir($baseFolderPath); |
|
108 | - if($dirHandler) |
|
109 | - { |
|
110 | - while(false !== ($file = readdir($dirHandler))) |
|
111 | - { |
|
112 | - if($file != '.' && $file != '..') |
|
113 | - { |
|
114 | - $path = $baseFolderPath . $file; |
|
115 | - if(is_file($path)) |
|
116 | - { |
|
117 | - $isValid = true; |
|
107 | + $dirHandler = @opendir($baseFolderPath); |
|
108 | + if($dirHandler) |
|
109 | + { |
|
110 | + while(false !== ($file = readdir($dirHandler))) |
|
111 | + { |
|
112 | + if($file != '.' && $file != '..') |
|
113 | + { |
|
114 | + $path = $baseFolderPath . $file; |
|
115 | + if(is_file($path)) |
|
116 | + { |
|
117 | + $isValid = true; |
|
118 | 118 | |
119 | - $fileTime = @filemtime($path); |
|
120 | - $fileSize = @filesize($path); |
|
121 | - if($this->searchkeywords['name'] !== '' && @eregi($this->searchkeywords['name'], $file) === false) |
|
122 | - { |
|
123 | - $isValid = false; |
|
124 | - } |
|
125 | - if($this->searchkeywords['mtime_from'] != '' && $fileTime < @strtotime($this->searchkeywords['mtime_from'])) |
|
126 | - { |
|
127 | - $isValid = false; |
|
128 | - } |
|
129 | - if($this->searchkeywords['mtime_to'] != '' && $fileTime > @strtotime($this->searchkeywords['mtime_to'])) |
|
130 | - { |
|
131 | - $isValid = false; |
|
132 | - } |
|
133 | - if($this->searchkeywords['size_from'] != '' && $fileSize < @strtotime($this->searchkeywords['size_from'])) |
|
134 | - { |
|
135 | - $isValid = false; |
|
136 | - } |
|
137 | - if($this->searchkeywords['size_to'] != '' && $fileSize > @strtotime($this->searchkeywords['size_to'])) |
|
138 | - { |
|
139 | - $isValid = false; |
|
140 | - } |
|
141 | - if($isValid && isListingDocument($path)) |
|
142 | - { |
|
143 | - $finalPath = $path; |
|
144 | - $objFile = new file($finalPath); |
|
145 | - $tem = $objFile->getFileInfo(); |
|
146 | - $obj = new manager($finalPath, false); |
|
147 | - $obj->setSessionAction($this->sessionAction); |
|
148 | - $selectedDocuments = $this->sessionAction->get(); |
|
149 | - $fileType = $obj->getFileType($finalPath); |
|
119 | + $fileTime = @filemtime($path); |
|
120 | + $fileSize = @filesize($path); |
|
121 | + if($this->searchkeywords['name'] !== '' && @eregi($this->searchkeywords['name'], $file) === false) |
|
122 | + { |
|
123 | + $isValid = false; |
|
124 | + } |
|
125 | + if($this->searchkeywords['mtime_from'] != '' && $fileTime < @strtotime($this->searchkeywords['mtime_from'])) |
|
126 | + { |
|
127 | + $isValid = false; |
|
128 | + } |
|
129 | + if($this->searchkeywords['mtime_to'] != '' && $fileTime > @strtotime($this->searchkeywords['mtime_to'])) |
|
130 | + { |
|
131 | + $isValid = false; |
|
132 | + } |
|
133 | + if($this->searchkeywords['size_from'] != '' && $fileSize < @strtotime($this->searchkeywords['size_from'])) |
|
134 | + { |
|
135 | + $isValid = false; |
|
136 | + } |
|
137 | + if($this->searchkeywords['size_to'] != '' && $fileSize > @strtotime($this->searchkeywords['size_to'])) |
|
138 | + { |
|
139 | + $isValid = false; |
|
140 | + } |
|
141 | + if($isValid && isListingDocument($path)) |
|
142 | + { |
|
143 | + $finalPath = $path; |
|
144 | + $objFile = new file($finalPath); |
|
145 | + $tem = $objFile->getFileInfo(); |
|
146 | + $obj = new manager($finalPath, false); |
|
147 | + $obj->setSessionAction($this->sessionAction); |
|
148 | + $selectedDocuments = $this->sessionAction->get(); |
|
149 | + $fileType = $obj->getFileType($finalPath); |
|
150 | 150 | |
151 | - foreach($fileType as $k=>$v) |
|
152 | - { |
|
153 | - $tem[$k] = $v; |
|
154 | - } |
|
151 | + foreach($fileType as $k=>$v) |
|
152 | + { |
|
153 | + $tem[$k] = $v; |
|
154 | + } |
|
155 | 155 | |
156 | - $tem['path'] = backslashToSlash($finalPath); |
|
157 | - $tem['type'] = (is_dir($finalPath)?'folder':'file'); |
|
156 | + $tem['path'] = backslashToSlash($finalPath); |
|
157 | + $tem['type'] = (is_dir($finalPath)?'folder':'file'); |
|
158 | 158 | /* $tem['size'] = transformFileSize($tem['size']); |
159 | 159 | $tem['ctime'] = date(DATE_TIME_FORMAT, $tem['ctime']); |
160 | 160 | $tem['mtime'] = date(DATE_TIME_FORMAT, $tem['mtime']);*/ |
161 | - $tem['flag'] = (array_search($tem['path'], $selectedDocuments) !== false?($this->sessionAction->getAction() == "copy"?'copyFlag':'cutFlag'):'noFlag'); |
|
162 | - $tem['url'] = getFileUrl($tem['path']); |
|
163 | - $this->rootFolderInfo['file']++; |
|
164 | - $manager = null; |
|
165 | - $this->files[] = $tem; |
|
166 | - $tem = null; |
|
167 | - } |
|
168 | - }elseif(is_dir($path) && $this->searchkeywords['recursive']) |
|
169 | - { |
|
170 | - $this->Search($baseFolderPath); |
|
171 | - } |
|
172 | - } |
|
173 | - } |
|
174 | - } |
|
161 | + $tem['flag'] = (array_search($tem['path'], $selectedDocuments) !== false?($this->sessionAction->getAction() == "copy"?'copyFlag':'cutFlag'):'noFlag'); |
|
162 | + $tem['url'] = getFileUrl($tem['path']); |
|
163 | + $this->rootFolderInfo['file']++; |
|
164 | + $manager = null; |
|
165 | + $this->files[] = $tem; |
|
166 | + $tem = null; |
|
167 | + } |
|
168 | + }elseif(is_dir($path) && $this->searchkeywords['recursive']) |
|
169 | + { |
|
170 | + $this->Search($baseFolderPath); |
|
171 | + } |
|
172 | + } |
|
173 | + } |
|
174 | + } |
|
175 | 175 | |
176 | - } |
|
176 | + } |
|
177 | 177 | |
178 | - function getFoundFiles() |
|
179 | - { |
|
180 | - return $this->files; |
|
181 | - } |
|
178 | + function getFoundFiles() |
|
179 | + { |
|
180 | + return $this->files; |
|
181 | + } |
|
182 | 182 | |
183 | - function getRootFolderInfo() |
|
184 | - { |
|
183 | + function getRootFolderInfo() |
|
184 | + { |
|
185 | 185 | |
186 | - return $this->rootFolderInfo; |
|
187 | - } |
|
188 | - } |
|
186 | + return $this->rootFolderInfo; |
|
187 | + } |
|
188 | + } |
|
189 | 189 | ?> |
190 | 190 | \ No newline at end of file |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | - if(!defined('AJAX_INIT_DONE')) |
|
2 | + if (!defined('AJAX_INIT_DONE')) |
|
3 | 3 | { |
4 | 4 | die('Permission denied'); |
5 | 5 | } |
@@ -38,17 +38,17 @@ discard block |
||
38 | 38 | $selectedDocuments = $this->sessionAction->get(); |
39 | 39 | $fileType = $obj->getFolderInfo($this->rootFolder); |
40 | 40 | |
41 | - foreach($fileType as $k=>$v) |
|
41 | + foreach ($fileType as $k=>$v) |
|
42 | 42 | { |
43 | 43 | $tem[$k] = $v; |
44 | 44 | } |
45 | 45 | |
46 | 46 | $tem['path'] = backslashToSlash($this->rootFolder); |
47 | - $tem['type'] = (is_dir($this->rootFolder)?'folder':'file'); |
|
48 | - $tem['size'] = (is_dir($this->rootFolder)?'':transformFileSize(@filesize($this->rootFolder))); |
|
47 | + $tem['type'] = (is_dir($this->rootFolder) ? 'folder' : 'file'); |
|
48 | + $tem['size'] = (is_dir($this->rootFolder) ? '' : transformFileSize(@filesize($this->rootFolder))); |
|
49 | 49 | //$tem['ctime'] = date(DATE_TIME_FORMAT, $tem['ctime']); |
50 | 50 | //$tem['mtime'] = date(DATE_TIME_FORMAT, $tem['mtime']); |
51 | - $tem['flag'] = (array_search($tem['path'], $selectedDocuments) !== false?($this->sessionAction->getAction() == "copy"?'copyFlag':'cutFlag'):'noFlag'); |
|
51 | + $tem['flag'] = (array_search($tem['path'], $selectedDocuments) !== false ? ($this->sessionAction->getAction() == "copy" ? 'copyFlag' : 'cutFlag') : 'noFlag'); |
|
52 | 52 | $tem['url'] = getFileUrl($this->rootFolder); |
53 | 53 | $tem['friendly_path'] = transformFilePath($this->rootFolder); |
54 | 54 | $tem['file'] = 0; |
@@ -87,9 +87,9 @@ discard block |
||
87 | 87 | */ |
88 | 88 | function addSearchKeywords($keywords) |
89 | 89 | { |
90 | - foreach($this->searchkeywords as $k=>$v) |
|
90 | + foreach ($this->searchkeywords as $k=>$v) |
|
91 | 91 | { |
92 | - if(array_key_exists($k, $keywords) !== false) |
|
92 | + if (array_key_exists($k, $keywords) !== false) |
|
93 | 93 | { |
94 | 94 | $this->searchkeywords[$k] = $keywords[$k]; |
95 | 95 | } |
@@ -102,43 +102,43 @@ discard block |
||
102 | 102 | function doSearch($baseFolderPath = null) |
103 | 103 | { |
104 | 104 | |
105 | - $baseFolderPath = addTrailingSlash(backslashToSlash((is_null($baseFolderPath)?$this->rootFolder:$baseFolderPath))); |
|
105 | + $baseFolderPath = addTrailingSlash(backslashToSlash((is_null($baseFolderPath) ? $this->rootFolder : $baseFolderPath))); |
|
106 | 106 | |
107 | 107 | $dirHandler = @opendir($baseFolderPath); |
108 | - if($dirHandler) |
|
108 | + if ($dirHandler) |
|
109 | 109 | { |
110 | - while(false !== ($file = readdir($dirHandler))) |
|
110 | + while (false !== ($file = readdir($dirHandler))) |
|
111 | 111 | { |
112 | - if($file != '.' && $file != '..') |
|
112 | + if ($file != '.' && $file != '..') |
|
113 | 113 | { |
114 | - $path = $baseFolderPath . $file; |
|
115 | - if(is_file($path)) |
|
114 | + $path = $baseFolderPath.$file; |
|
115 | + if (is_file($path)) |
|
116 | 116 | { |
117 | 117 | $isValid = true; |
118 | 118 | |
119 | 119 | $fileTime = @filemtime($path); |
120 | 120 | $fileSize = @filesize($path); |
121 | - if($this->searchkeywords['name'] !== '' && @eregi($this->searchkeywords['name'], $file) === false) |
|
121 | + if ($this->searchkeywords['name'] !== '' && @eregi($this->searchkeywords['name'], $file) === false) |
|
122 | 122 | { |
123 | 123 | $isValid = false; |
124 | 124 | } |
125 | - if($this->searchkeywords['mtime_from'] != '' && $fileTime < @strtotime($this->searchkeywords['mtime_from'])) |
|
125 | + if ($this->searchkeywords['mtime_from'] != '' && $fileTime < @strtotime($this->searchkeywords['mtime_from'])) |
|
126 | 126 | { |
127 | 127 | $isValid = false; |
128 | 128 | } |
129 | - if($this->searchkeywords['mtime_to'] != '' && $fileTime > @strtotime($this->searchkeywords['mtime_to'])) |
|
129 | + if ($this->searchkeywords['mtime_to'] != '' && $fileTime > @strtotime($this->searchkeywords['mtime_to'])) |
|
130 | 130 | { |
131 | 131 | $isValid = false; |
132 | 132 | } |
133 | - if($this->searchkeywords['size_from'] != '' && $fileSize < @strtotime($this->searchkeywords['size_from'])) |
|
133 | + if ($this->searchkeywords['size_from'] != '' && $fileSize < @strtotime($this->searchkeywords['size_from'])) |
|
134 | 134 | { |
135 | 135 | $isValid = false; |
136 | 136 | } |
137 | - if($this->searchkeywords['size_to'] != '' && $fileSize > @strtotime($this->searchkeywords['size_to'])) |
|
137 | + if ($this->searchkeywords['size_to'] != '' && $fileSize > @strtotime($this->searchkeywords['size_to'])) |
|
138 | 138 | { |
139 | 139 | $isValid = false; |
140 | 140 | } |
141 | - if($isValid && isListingDocument($path)) |
|
141 | + if ($isValid && isListingDocument($path)) |
|
142 | 142 | { |
143 | 143 | $finalPath = $path; |
144 | 144 | $objFile = new file($finalPath); |
@@ -148,24 +148,24 @@ discard block |
||
148 | 148 | $selectedDocuments = $this->sessionAction->get(); |
149 | 149 | $fileType = $obj->getFileType($finalPath); |
150 | 150 | |
151 | - foreach($fileType as $k=>$v) |
|
151 | + foreach ($fileType as $k=>$v) |
|
152 | 152 | { |
153 | 153 | $tem[$k] = $v; |
154 | 154 | } |
155 | 155 | |
156 | 156 | $tem['path'] = backslashToSlash($finalPath); |
157 | - $tem['type'] = (is_dir($finalPath)?'folder':'file'); |
|
157 | + $tem['type'] = (is_dir($finalPath) ? 'folder' : 'file'); |
|
158 | 158 | /* $tem['size'] = transformFileSize($tem['size']); |
159 | 159 | $tem['ctime'] = date(DATE_TIME_FORMAT, $tem['ctime']); |
160 | 160 | $tem['mtime'] = date(DATE_TIME_FORMAT, $tem['mtime']);*/ |
161 | - $tem['flag'] = (array_search($tem['path'], $selectedDocuments) !== false?($this->sessionAction->getAction() == "copy"?'copyFlag':'cutFlag'):'noFlag'); |
|
161 | + $tem['flag'] = (array_search($tem['path'], $selectedDocuments) !== false ? ($this->sessionAction->getAction() == "copy" ? 'copyFlag' : 'cutFlag') : 'noFlag'); |
|
162 | 162 | $tem['url'] = getFileUrl($tem['path']); |
163 | 163 | $this->rootFolderInfo['file']++; |
164 | 164 | $manager = null; |
165 | 165 | $this->files[] = $tem; |
166 | 166 | $tem = null; |
167 | 167 | } |
168 | - }elseif(is_dir($path) && $this->searchkeywords['recursive']) |
|
168 | + }elseif (is_dir($path) && $this->searchkeywords['recursive']) |
|
169 | 169 | { |
170 | 170 | $this->Search($baseFolderPath); |
171 | 171 | } |
@@ -165,7 +165,7 @@ |
||
165 | 165 | $this->files[] = $tem; |
166 | 166 | $tem = null; |
167 | 167 | } |
168 | - }elseif(is_dir($path) && $this->searchkeywords['recursive']) |
|
168 | + } elseif(is_dir($path) && $this->searchkeywords['recursive']) |
|
169 | 169 | { |
170 | 170 | $this->Search($baseFolderPath); |
171 | 171 | } |