@@ -6,8 +6,8 @@ |
||
6 | 6 | |
7 | 7 | $lang = array( |
8 | 8 | |
9 | - '_locale' => "id_ID.UTF-8", // UNIX localization code |
|
10 | - '_charset' => "utf-8", // Browser charset |
|
9 | + '_locale' => "id_ID.UTF-8", // UNIX localization code |
|
10 | + '_charset' => "utf-8", // Browser charset |
|
11 | 11 | |
12 | 12 | // Date time formats. See http://www.php.net/manual/en/function.strftime.php |
13 | 13 | '_dateTimeFull' => "%A, %e %B, %Y %H:%M", |
@@ -6,8 +6,8 @@ |
||
6 | 6 | |
7 | 7 | $lang = array( |
8 | 8 | |
9 | - '_locale' => "nl_NL.UTF-8", // UNIX localization code |
|
10 | - '_charset' => "utf-8", // Browser charset |
|
9 | + '_locale' => "nl_NL.UTF-8", // UNIX localization code |
|
10 | + '_charset' => "utf-8", // Browser charset |
|
11 | 11 | |
12 | 12 | // Date time formats. See http://www.php.net/manual/en/function.strftime.php |
13 | 13 | '_dateTimeFull' => "%A, %e.%B.%Y %H:%M", |
@@ -6,8 +6,8 @@ |
||
6 | 6 | |
7 | 7 | $lang = array( |
8 | 8 | |
9 | - '_locale' => "vi_VN.UTF-8", // UNIX localization code |
|
10 | - '_charset' => "utf-8", // Browser charset |
|
9 | + '_locale' => "vi_VN.UTF-8", // UNIX localization code |
|
10 | + '_charset' => "utf-8", // Browser charset |
|
11 | 11 | |
12 | 12 | // Date time formats. See http://www.php.net/manual/en/function.strftime.php |
13 | 13 | '_dateTimeFull' => "%A, %e %B, %Y %H:%M", |
@@ -10,13 +10,13 @@ |
||
10 | 10 | } |
11 | 11 | }; |
12 | 12 | <?php |
13 | - if(isset($_GET['type'])) $type = htmlspecialchars(trim($_GET['type']), ENT_QUOTES); |
|
14 | - elseif(isset($_GET['Type'])) $type = htmlspecialchars(trim($_GET['Type']), ENT_QUOTES); |
|
13 | + if (isset($_GET['type'])) $type = htmlspecialchars(trim($_GET['type']), ENT_QUOTES); |
|
14 | + elseif (isset($_GET['Type'])) $type = htmlspecialchars(trim($_GET['Type']), ENT_QUOTES); |
|
15 | 15 | else $type = 'images'; |
16 | 16 | |
17 | - if($type==='image') $type = 'images'; |
|
17 | + if ($type === 'image') $type = 'images'; |
|
18 | 18 | |
19 | - $opener = (isset($_GET['editor'])) ? 'opener=' . htmlspecialchars(trim($_GET['editor']), ENT_QUOTES) : ''; |
|
19 | + $opener = (isset($_GET['editor'])) ? 'opener='.htmlspecialchars(trim($_GET['editor']), ENT_QUOTES) : ''; |
|
20 | 20 | $request_uri = "{$opener}&type={$type}"; |
21 | 21 | ?> |
22 | 22 | window.location.href = "browse.php?<?php echo $request_uri; ?>"; |
@@ -12,20 +12,20 @@ discard block |
||
12 | 12 | * @link http://kcfinder.sunhater.com |
13 | 13 | */ |
14 | 14 | |
15 | -class dir { |
|
15 | +class dir{ |
|
16 | 16 | |
17 | 17 | /** Checks if the given directory is really writable. The standard PHP |
18 | 18 | * function is_writable() does not work properly on Windows servers |
19 | 19 | * @param string $dir |
20 | 20 | * @return bool */ |
21 | 21 | |
22 | - static function isWritable($dir) { |
|
22 | + static function isWritable($dir){ |
|
23 | 23 | $dir = path::normalize($dir); |
24 | 24 | if (!is_dir($dir)) |
25 | 25 | return false; |
26 | 26 | $i = 0; |
27 | 27 | do { |
28 | - $file = "$dir/is_writable_" . md5($i++); |
|
28 | + $file = "$dir/is_writable_".md5($i++); |
|
29 | 29 | } while (file_exists($file)); |
30 | 30 | if (!@touch($file)) |
31 | 31 | return false; |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | * @param array $failed |
45 | 45 | * @return mixed */ |
46 | 46 | |
47 | - static function prune($dir, $firstFailExit=true, array $failed=null) { |
|
47 | + static function prune($dir, $firstFailExit = true, array $failed = null){ |
|
48 | 48 | if ($failed === null) $failed = array(); |
49 | 49 | $files = self::content($dir); |
50 | 50 | if ($files === false) { |
@@ -87,12 +87,12 @@ discard block |
||
87 | 87 | * @param array $options |
88 | 88 | * @return mixed */ |
89 | 89 | |
90 | - static function content($dir, array $options=null) { |
|
90 | + static function content($dir, array $options = null){ |
|
91 | 91 | |
92 | 92 | $defaultOptions = array( |
93 | - 'types' => "all", // Allowed: "all" or possible return values |
|
93 | + 'types' => "all", // Allowed: "all" or possible return values |
|
94 | 94 | // of filetype(), or an array with them |
95 | - 'addPath' => true, // Whether to add directory path to filenames |
|
95 | + 'addPath' => true, // Whether to add directory path to filenames |
|
96 | 96 | 'pattern' => '/./', // Regular expression pattern for filename |
97 | 97 | 'followLinks' => true |
98 | 98 | ); |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | return $files; |
146 | 146 | } |
147 | 147 | |
148 | - static function fileSort($a, $b) { |
|
148 | + static function fileSort($a, $b){ |
|
149 | 149 | if (function_exists("mb_strtolower")) { |
150 | 150 | $a = mb_strtolower($a); |
151 | 151 | $b = mb_strtolower($b); |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | * @link http://kcfinder.sunhater.com |
13 | 13 | */ |
14 | 14 | |
15 | -class image_imagick extends image { |
|
15 | +class image_imagick extends image{ |
|
16 | 16 | |
17 | 17 | static $MIMES = array( |
18 | 18 | //'tif' => "image/tiff" |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | |
22 | 22 | // ABSTRACT PUBLIC METHODS |
23 | 23 | |
24 | - public function resize($width, $height) {// |
|
24 | + public function resize($width, $height){// |
|
25 | 25 | if (!$width) $width = 1; |
26 | 26 | if (!$height) $height = 1; |
27 | 27 | try { |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | return true; |
35 | 35 | } |
36 | 36 | |
37 | - public function resizeFit($width, $height, $background=false) {// |
|
37 | + public function resizeFit($width, $height, $background = false){// |
|
38 | 38 | if (!$width) $width = 1; |
39 | 39 | if (!$height) $height = 1; |
40 | 40 | |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | } |
66 | 66 | } |
67 | 67 | |
68 | - public function resizeCrop($width, $height, $offset=false) { |
|
68 | + public function resizeCrop($width, $height, $offset = false){ |
|
69 | 69 | if (!$width) $width = 1; |
70 | 70 | if (!$height) $height = 1; |
71 | 71 | |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | return true; |
116 | 116 | } |
117 | 117 | |
118 | - public function rotate($angle, $background="#000000") { |
|
118 | + public function rotate($angle, $background = "#000000"){ |
|
119 | 119 | try { |
120 | 120 | $this->image->rotateImage(new ImagickPixel($background), $angle); |
121 | 121 | $size = $this->image->getImageGeometry(); |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | return true; |
128 | 128 | } |
129 | 129 | |
130 | - public function flipHorizontal() { |
|
130 | + public function flipHorizontal(){ |
|
131 | 131 | try { |
132 | 132 | $this->image->flopImage(); |
133 | 133 | } catch (Exception $e) { |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | return true; |
137 | 137 | } |
138 | 138 | |
139 | - public function flipVertical() { |
|
139 | + public function flipVertical(){ |
|
140 | 140 | try { |
141 | 141 | $this->image->flipImage(); |
142 | 142 | } catch (Exception $e) { |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | return true; |
146 | 146 | } |
147 | 147 | |
148 | - public function watermark($file, $left=false, $top=false) { |
|
148 | + public function watermark($file, $left = false, $top = false){ |
|
149 | 149 | try { |
150 | 150 | $wm = new Imagick($file); |
151 | 151 | $size = $wm->getImageGeometry(); |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | |
182 | 182 | // ABSTRACT PROTECTED METHODS |
183 | 183 | |
184 | - protected function getBlankImage($width, $height) { |
|
184 | + protected function getBlankImage($width, $height){ |
|
185 | 185 | try { |
186 | 186 | $img = new Imagick(); |
187 | 187 | $img->newImage($width, $height, "none"); |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | return $img; |
193 | 193 | } |
194 | 194 | |
195 | - protected function getImage($image, &$width, &$height) { |
|
195 | + protected function getImage($image, &$width, &$height){ |
|
196 | 196 | |
197 | 197 | if (is_object($image) && ($image instanceof image_imagick)) { |
198 | 198 | try { |
@@ -234,11 +234,11 @@ discard block |
||
234 | 234 | |
235 | 235 | // PSEUDO-ABSTRACT STATIC METHODS |
236 | 236 | |
237 | - static function available() { |
|
237 | + static function available(){ |
|
238 | 238 | return class_exists("Imagick"); |
239 | 239 | } |
240 | 240 | |
241 | - static function checkImage($file) { |
|
241 | + static function checkImage($file){ |
|
242 | 242 | try { |
243 | 243 | $img = new Imagic($file); |
244 | 244 | } catch (Exception $e) { |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | |
251 | 251 | // INHERIT METHODS |
252 | 252 | |
253 | - public function output($type="jpeg", array $options=array()) { |
|
253 | + public function output($type = "jpeg", array $options = array()){ |
|
254 | 254 | $type = strtolower($type); |
255 | 255 | try { |
256 | 256 | $this->image->setImageFormat($type); |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | echo $this->image; |
270 | 270 | |
271 | 271 | } else { |
272 | - $file = $options['file'] . ".$type"; |
|
272 | + $file = $options['file'].".$type"; |
|
273 | 273 | try { |
274 | 274 | $this->image->writeImage($file); |
275 | 275 | } catch (Exception $e) { |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | |
290 | 290 | // OWN METHODS |
291 | 291 | |
292 | - protected function optimize_jpeg(array $options=array()) { |
|
292 | + protected function optimize_jpeg(array $options = array()){ |
|
293 | 293 | $quality = isset($options['quality']) ? $options['quality'] : self::DEFAULT_JPEG_QUALITY; |
294 | 294 | try { |
295 | 295 | $this->image->setImageCompression(Imagick::COMPRESSION_JPEG); |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | * @link http://kcfinder.sunhater.com |
13 | 13 | */ |
14 | 14 | |
15 | -class input { |
|
15 | +class input{ |
|
16 | 16 | |
17 | 17 | /** Filtered $_GET array |
18 | 18 | * @var array */ |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | * @var array */ |
27 | 27 | public $cookie; |
28 | 28 | |
29 | - public function __construct() { |
|
29 | + public function __construct(){ |
|
30 | 30 | $this->get = &$_GET; |
31 | 31 | $this->post = &$_POST; |
32 | 32 | $this->cookie = &$_COOKIE; |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | * @param string $property |
37 | 37 | * @return mixed */ |
38 | 38 | |
39 | - public function __get($property) { |
|
39 | + public function __get($property){ |
|
40 | 40 | return property_exists($this, $property) ? $this->$property : null; |
41 | 41 | } |
42 | 42 | } |
@@ -12,14 +12,14 @@ discard block |
||
12 | 12 | * @link http://kcfinder.sunhater.com |
13 | 13 | */ |
14 | 14 | |
15 | -class path { |
|
15 | +class path{ |
|
16 | 16 | |
17 | 17 | /** Get the absolute URL path of the given one. Returns FALSE if the URL |
18 | 18 | * is not valid or the current directory cannot be resolved (getcwd()) |
19 | 19 | * @param string $path |
20 | 20 | * @return string */ |
21 | 21 | |
22 | - static function rel2abs_url($path) { |
|
22 | + static function rel2abs_url($path){ |
|
23 | 23 | if (substr($path, 0, 1) == "/") return $path; |
24 | 24 | $dir = @getcwd(); |
25 | 25 | |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | if (substr($dir, 0, strlen($doc_root)) != $doc_root) |
33 | 33 | return false; |
34 | 34 | |
35 | - $return = self::normalize(substr($dir, strlen($doc_root)) . "/$path"); |
|
35 | + $return = self::normalize(substr($dir, strlen($doc_root))."/$path"); |
|
36 | 36 | if (substr($return, 0, 1) !== "/") |
37 | 37 | $return = "/$return"; |
38 | 38 | |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | * @param string $url |
45 | 45 | * @return string */ |
46 | 46 | |
47 | - static function url2fullPath($url) { |
|
47 | + static function url2fullPath($url){ |
|
48 | 48 | $url = self::normalize($url); |
49 | 49 | |
50 | 50 | $uri = isset($_SERVER['SCRIPT_NAME']) |
@@ -56,18 +56,18 @@ discard block |
||
56 | 56 | |
57 | 57 | if (substr($url, 0, 1) !== "/") { |
58 | 58 | if ($uri === false) return false; |
59 | - $url = dirname($uri) . "/$url"; |
|
59 | + $url = dirname($uri)."/$url"; |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | if (isset($_SERVER['DOCUMENT_ROOT'])) { |
63 | - return self::normalize($_SERVER['DOCUMENT_ROOT'] . "/$url"); |
|
63 | + return self::normalize($_SERVER['DOCUMENT_ROOT']."/$url"); |
|
64 | 64 | |
65 | 65 | } else { |
66 | 66 | if ($uri === false) return false; |
67 | 67 | |
68 | 68 | if (isset($_SERVER['SCRIPT_FILENAME'])) { |
69 | 69 | $scr_filename = self::normalize($_SERVER['SCRIPT_FILENAME']); |
70 | - return self::normalize(substr($scr_filename, 0, -strlen($uri)) . "/$url"); |
|
70 | + return self::normalize(substr($scr_filename, 0, -strlen($uri))."/$url"); |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | $count = count(explode('/', $uri)) - 1; |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | return false; |
81 | 81 | $rdir = getcwd(); |
82 | 82 | chdir($dir); |
83 | - return ($rdir !== false) ? self::normalize($rdir . "/$url") : false; |
|
83 | + return ($rdir !== false) ? self::normalize($rdir."/$url") : false; |
|
84 | 84 | } |
85 | 85 | } |
86 | 86 | |
@@ -92,11 +92,11 @@ discard block |
||
92 | 92 | * @param string $path |
93 | 93 | * @return string */ |
94 | 94 | |
95 | - static function normalize($path) { |
|
95 | + static function normalize($path){ |
|
96 | 96 | if (strtoupper(substr(PHP_OS, 0, 3)) == "WIN") { |
97 | 97 | $path = preg_replace('/([^\\\])\\\([^\\\])/', "$1/$2", $path); |
98 | 98 | if (substr($path, -1) == "\\") $path = substr($path, 0, -1); |
99 | - if (substr($path, 0, 1) == "\\") $path = "/" . substr($path, 1); |
|
99 | + if (substr($path, 0, 1) == "\\") $path = "/".substr($path, 1); |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | $path = preg_replace('/\/+/s', "/", $path); |
@@ -118,11 +118,11 @@ discard block |
||
118 | 118 | * @param string $path |
119 | 119 | * @return string */ |
120 | 120 | |
121 | - static function urlPathEncode($path) { |
|
121 | + static function urlPathEncode($path){ |
|
122 | 122 | $path = self::normalize($path); |
123 | 123 | $encoded = ""; |
124 | 124 | foreach (explode("/", $path) as $dir) |
125 | - $encoded .= rawurlencode($dir) . "/"; |
|
125 | + $encoded .= rawurlencode($dir)."/"; |
|
126 | 126 | $encoded = substr($encoded, 0, -1); |
127 | 127 | return $encoded; |
128 | 128 | } |
@@ -131,11 +131,11 @@ discard block |
||
131 | 131 | * @param string $path |
132 | 132 | * @return string */ |
133 | 133 | |
134 | - static function urlPathDecode($path) { |
|
134 | + static function urlPathDecode($path){ |
|
135 | 135 | $path = self::normalize($path); |
136 | 136 | $decoded = ""; |
137 | 137 | foreach (explode("/", $path) as $dir) |
138 | - $decoded .= rawurldecode($dir) . "/"; |
|
138 | + $decoded .= rawurldecode($dir)."/"; |
|
139 | 139 | $decoded = substr($decoded, 0, -1); |
140 | 140 | return $decoded; |
141 | 141 | } |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | * @link http://kcfinder.sunhater.com |
13 | 13 | */ |
14 | 14 | |
15 | -class file { |
|
15 | +class file{ |
|
16 | 16 | |
17 | 17 | static $MIME = array( |
18 | 18 | 'ai' => 'application/postscript', |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | * @param string $dir |
106 | 106 | * @return bool */ |
107 | 107 | |
108 | - static function isWritable($filename) { |
|
108 | + static function isWritable($filename){ |
|
109 | 109 | $filename = path::normalize($filename); |
110 | 110 | if (!is_file($filename) || (false === ($fp = @fopen($filename, 'a+')))) |
111 | 111 | return false; |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | * @param bool $toLower |
119 | 119 | * @return string */ |
120 | 120 | |
121 | - static function getExtension($filename, $toLower=true) { |
|
121 | + static function getExtension($filename, $toLower = true){ |
|
122 | 122 | return preg_match('/^.*\.([^\.]*)$/s', $filename, $patt) |
123 | 123 | ? ($toLower ? strtolower($patt[1]) : $patt[1]) : ""; |
124 | 124 | } |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | * @param string $magic |
135 | 135 | * @return string */ |
136 | 136 | |
137 | - static function getMimeType($filename, $magic=null) { |
|
137 | + static function getMimeType($filename, $magic = null){ |
|
138 | 138 | if (class_exists("finfo")) { |
139 | 139 | $finfo = ($magic === null) |
140 | 140 | ? new finfo(FILEINFO_MIME) |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | * @param string $tpl |
171 | 171 | * @return string */ |
172 | 172 | |
173 | - static function getInexistantFilename($filename, $dir=null, $tpl=null) { |
|
173 | + static function getInexistantFilename($filename, $dir = null, $tpl = null){ |
|
174 | 174 | if ($tpl === null) $tpl = "{name}({sufix}){ext}"; |
175 | 175 | $fullPath = ($dir === null); |
176 | 176 | if ($fullPath) |
@@ -188,12 +188,12 @@ discard block |
||
188 | 188 | $tpl = str_replace('{ext}', (strlen($ext) ? ".$ext" : ""), $tpl); |
189 | 189 | $i = 1; $file = "$dir/$filename"; |
190 | 190 | while (file_exists($file)) |
191 | - $file = "$dir/" . str_replace('{sufix}', $i++, $tpl); |
|
191 | + $file = "$dir/".str_replace('{sufix}', $i++, $tpl); |
|
192 | 192 | |
193 | 193 | return $fullPath |
194 | 194 | ? $file |
195 | 195 | : (strlen($fdir) |
196 | - ? "$fdir/" . basename($file) |
|
196 | + ? "$fdir/".basename($file) |
|
197 | 197 | : basename($file)); |
198 | 198 | } |
199 | 199 |