@@ -1,24 +1,24 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | /** This file is part of KCFinder project |
| 4 | - * |
|
| 5 | - * @desc This file is included first, before each other |
|
| 6 | - * @package KCFinder |
|
| 7 | - * @version 2.54 |
|
| 8 | - * @author Pavel Tzonkov <[email protected]> |
|
| 9 | - * @copyright 2010-2014 KCFinder Project |
|
| 10 | - * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
| 11 | - * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
| 12 | - * @link http://kcfinder.sunhater.com |
|
| 13 | - * |
|
| 14 | - * This file is the place you can put any code (at the end of the file), |
|
| 15 | - * which will be executed before any other. Suitable for: |
|
| 16 | - * 1. Set PHP ini settings using ini_set() |
|
| 17 | - * 2. Custom session save handler with session_set_save_handler() |
|
| 18 | - * 3. Any custom integration code. If you use any global variables |
|
| 19 | - * here, they can be accessed in config.php via $GLOBALS array. |
|
| 20 | - * It's recommended to use constants instead. |
|
| 21 | - */ |
|
| 4 | + * |
|
| 5 | + * @desc This file is included first, before each other |
|
| 6 | + * @package KCFinder |
|
| 7 | + * @version 2.54 |
|
| 8 | + * @author Pavel Tzonkov <[email protected]> |
|
| 9 | + * @copyright 2010-2014 KCFinder Project |
|
| 10 | + * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
| 11 | + * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
| 12 | + * @link http://kcfinder.sunhater.com |
|
| 13 | + * |
|
| 14 | + * This file is the place you can put any code (at the end of the file), |
|
| 15 | + * which will be executed before any other. Suitable for: |
|
| 16 | + * 1. Set PHP ini settings using ini_set() |
|
| 17 | + * 2. Custom session save handler with session_set_save_handler() |
|
| 18 | + * 3. Any custom integration code. If you use any global variables |
|
| 19 | + * here, they can be accessed in config.php via $GLOBALS array. |
|
| 20 | + * It's recommended to use constants instead. |
|
| 21 | + */ |
|
| 22 | 22 | include_once(dirname(__FILE__) . "/../../../../../assets/cache/siteManager.php"); |
| 23 | 23 | require_once('../../../includes/protect.inc.php'); |
| 24 | 24 | include_once('../../../includes/config.inc.php'); |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | * here, they can be accessed in config.php via $GLOBALS array. |
| 20 | 20 | * It's recommended to use constants instead. |
| 21 | 21 | */ |
| 22 | -include_once(dirname(__FILE__) . "/../../../../../assets/cache/siteManager.php"); |
|
| 22 | +include_once(dirname(__FILE__)."/../../../../../assets/cache/siteManager.php"); |
|
| 23 | 23 | require_once('../../../includes/protect.inc.php'); |
| 24 | 24 | include_once('../../../includes/config.inc.php'); |
| 25 | 25 | include_once('../../../includes/document.parser.class.inc.php'); |
@@ -34,15 +34,15 @@ discard block |
||
| 34 | 34 | |
| 35 | 35 | $manager_language = $modx->config['manager_language']; |
| 36 | 36 | // Pass language code from MODX to KCFinder |
| 37 | -if (!file_exists("../../../includes/lang/" . $manager_language . ".inc.php")) { |
|
| 37 | +if (!file_exists("../../../includes/lang/".$manager_language.".inc.php")) { |
|
| 38 | 38 | $manager_language = "english"; // if not set, get the english language file. |
| 39 | 39 | } |
| 40 | -include_once "../../../includes/lang/" . $manager_language . ".inc.php"; |
|
| 40 | +include_once "../../../includes/lang/".$manager_language.".inc.php"; |
|
| 41 | 41 | $_GET['langCode'] = $modx_lang_attribute; |
| 42 | 42 | |
| 43 | 43 | // PHP VERSION CHECK |
| 44 | 44 | if (substr(PHP_VERSION, 0, strpos(PHP_VERSION, '.')) < 5) { |
| 45 | - die("You are using PHP " . PHP_VERSION . " when KCFinder require at least version 5! Some systems has an option to change the active PHP version. Please refer to your hosting provider or upgrade your PHP distribution."); |
|
| 45 | + die("You are using PHP ".PHP_VERSION." when KCFinder require at least version 5! Some systems has an option to change the active PHP version. Please refer to your hosting provider or upgrade your PHP distribution."); |
|
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | ); |
| 79 | 79 | } |
| 80 | 80 | if (isset($classes[$class])) { |
| 81 | - require dirname(__FILE__) . $classes[$class]; |
|
| 81 | + require dirname(__FILE__).$classes[$class]; |
|
| 82 | 82 | } |
| 83 | 83 | } |
| 84 | 84 | spl_autoload_register('autoloadda9d06472ccb71b84928677ce2a6ca89', true); |
@@ -88,14 +88,14 @@ discard block |
||
| 88 | 88 | if (!function_exists("json_encode")) { |
| 89 | 89 | function kcfinder_json_string_encode($string) |
| 90 | 90 | { |
| 91 | - return '"' . |
|
| 91 | + return '"'. |
|
| 92 | 92 | str_replace('/', "\\/", |
| 93 | 93 | str_replace("\t", "\\t", |
| 94 | 94 | str_replace("\r", "\\r", |
| 95 | 95 | str_replace("\n", "\\n", |
| 96 | 96 | str_replace('"', "\\\"", |
| 97 | 97 | str_replace("\\", "\\\\", |
| 98 | - $string)))))) . '"'; |
|
| 98 | + $string)))))).'"'; |
|
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | function json_encode($data) |
@@ -106,16 +106,16 @@ discard block |
||
| 106 | 106 | // OBJECT |
| 107 | 107 | if (array_keys($data) !== range(0, count($data) - 1)) { |
| 108 | 108 | foreach ($data as $key => $val) { |
| 109 | - $ret[] = kcfinder_json_string_encode($key) . ':' . json_encode($val); |
|
| 109 | + $ret[] = kcfinder_json_string_encode($key).':'.json_encode($val); |
|
| 110 | 110 | } |
| 111 | - return "{" . implode(",", $ret) . "}"; |
|
| 111 | + return "{".implode(",", $ret)."}"; |
|
| 112 | 112 | |
| 113 | 113 | // ARRAY |
| 114 | 114 | } else { |
| 115 | 115 | foreach ($data as $val) { |
| 116 | 116 | $ret[] = json_encode($val); |
| 117 | 117 | } |
| 118 | - return "[" . implode(",", $ret) . "]"; |
|
| 118 | + return "[".implode(",", $ret)."]"; |
|
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | // BOOLEAN OR NULL |
@@ -1,16 +1,16 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | /** This file is part of KCFinder project |
| 4 | - * |
|
| 5 | - * @desc MIME type detection class |
|
| 6 | - * @package KCFinder |
|
| 7 | - * @version 2.54 |
|
| 8 | - * @author Pavel Tzonkov <[email protected]> |
|
| 9 | - * @copyright 2010-2014 KCFinder Project |
|
| 10 | - * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
| 11 | - * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
| 12 | - * @link http://kcfinder.sunhater.com |
|
| 13 | - */ |
|
| 4 | + * |
|
| 5 | + * @desc MIME type detection class |
|
| 6 | + * @package KCFinder |
|
| 7 | + * @version 2.54 |
|
| 8 | + * @author Pavel Tzonkov <[email protected]> |
|
| 9 | + * @copyright 2010-2014 KCFinder Project |
|
| 10 | + * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
| 11 | + * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
| 12 | + * @link http://kcfinder.sunhater.com |
|
| 13 | + */ |
|
| 14 | 14 | |
| 15 | 15 | class type_mime |
| 16 | 16 | { |
@@ -1,16 +1,16 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | /** This file is part of KCFinder project |
| 4 | - * |
|
| 5 | - * @desc Image detection class |
|
| 6 | - * @package KCFinder |
|
| 7 | - * @version 2.54 |
|
| 8 | - * @author Pavel Tzonkov <[email protected]> |
|
| 9 | - * @copyright 2010-2014 KCFinder Project |
|
| 10 | - * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
| 11 | - * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
| 12 | - * @link http://kcfinder.sunhater.com |
|
| 13 | - */ |
|
| 4 | + * |
|
| 5 | + * @desc Image detection class |
|
| 6 | + * @package KCFinder |
|
| 7 | + * @version 2.54 |
|
| 8 | + * @author Pavel Tzonkov <[email protected]> |
|
| 9 | + * @copyright 2010-2014 KCFinder Project |
|
| 10 | + * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
| 11 | + * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
| 12 | + * @link http://kcfinder.sunhater.com |
|
| 13 | + */ |
|
| 14 | 14 | |
| 15 | 15 | class type_img |
| 16 | 16 | { |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | header("Content-Type: text/javascript"); |
| 19 | 19 | die; |
| 20 | 20 | } |
| 21 | -$file = "lang/" . $input->get['lng'] . ".php"; |
|
| 21 | +$file = "lang/".$input->get['lng'].".php"; |
|
| 22 | 22 | $files = dir::content("lang", array( |
| 23 | 23 | 'types' => "file", |
| 24 | 24 | 'pattern' => '/^.*\.php$/' |
@@ -35,6 +35,6 @@ discard block |
||
| 35 | 35 | header("Content-Type: text/javascript; charset={$lang['_charset']}"); |
| 36 | 36 | foreach ($lang as $english => $native) { |
| 37 | 37 | if (substr($english, 0, 1) != "_") { |
| 38 | - echo "browser.labels['" . text::jsValue($english) . "']=\"" . text::jsValue($native) . "\";"; |
|
| 38 | + echo "browser.labels['".text::jsValue($english)."']=\"".text::jsValue($native)."\";"; |
|
| 39 | 39 | } |
| 40 | 40 | } |
@@ -89,7 +89,7 @@ |
||
| 89 | 89 | |
| 90 | 90 | // THE FOLLOWING SETTINGS CANNOT BE OVERRIDED WITH SESSION CONFIGURATION |
| 91 | 91 | '_check4htaccess' => false, |
| 92 | - '_tinyMCEPath' => MODX_BASE_URL . "assets/plugins/tinymce/tiny_mce", |
|
| 92 | + '_tinyMCEPath' => MODX_BASE_URL."assets/plugins/tinymce/tiny_mce", |
|
| 93 | 93 | |
| 94 | 94 | '_sessionVar' => &$_SESSION['KCFINDER'], |
| 95 | 95 | //'_sessionLifetime' => 30, |
@@ -1,16 +1,16 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | /** This file is part of KCFinder project |
| 4 | - * |
|
| 5 | - * @desc HTTP cache helper class |
|
| 6 | - * @package KCFinder |
|
| 7 | - * @version 2.54 |
|
| 8 | - * @author Pavel Tzonkov <[email protected]> |
|
| 9 | - * @copyright 2010-2014 KCFinder Project |
|
| 10 | - * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
| 11 | - * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
| 12 | - * @link http://kcfinder.sunhater.com |
|
| 13 | - */ |
|
| 4 | + * |
|
| 5 | + * @desc HTTP cache helper class |
|
| 6 | + * @package KCFinder |
|
| 7 | + * @version 2.54 |
|
| 8 | + * @author Pavel Tzonkov <[email protected]> |
|
| 9 | + * @copyright 2010-2014 KCFinder Project |
|
| 10 | + * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
| 11 | + * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
| 12 | + * @link http://kcfinder.sunhater.com |
|
| 13 | + */ |
|
| 14 | 14 | |
| 15 | 15 | class httpCache |
| 16 | 16 | { |
@@ -18,13 +18,13 @@ discard block |
||
| 18 | 18 | const DEFAULT_EXPIRE = 604800; // in seconds |
| 19 | 19 | |
| 20 | 20 | /** Cache a file. The $type parameter might define the MIME type of the file |
| 21 | - * or path to magic file to autodetect the MIME type. If you skip $type |
|
| 22 | - * parameter the method will try with the default magic file. Autodetection |
|
| 23 | - * of MIME type requires Fileinfo PHP extension used in file::getMimeType() |
|
| 24 | - * @param string $file |
|
| 25 | - * @param string $type |
|
| 26 | - * @param integer $expire |
|
| 27 | - * @param array $headers */ |
|
| 21 | + * or path to magic file to autodetect the MIME type. If you skip $type |
|
| 22 | + * parameter the method will try with the default magic file. Autodetection |
|
| 23 | + * of MIME type requires Fileinfo PHP extension used in file::getMimeType() |
|
| 24 | + * @param string $file |
|
| 25 | + * @param string $type |
|
| 26 | + * @param integer $expire |
|
| 27 | + * @param array $headers */ |
|
| 28 | 28 | |
| 29 | 29 | public static function file($file, $type=null, $expire=null, array $headers=null) |
| 30 | 30 | { |
@@ -46,12 +46,12 @@ discard block |
||
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | /** Cache the given $content with $mtime modification time. |
| 49 | - * @param binary $content |
|
| 50 | - * @param integer $mtime |
|
| 51 | - * @param string $type |
|
| 52 | - * @param integer $expire |
|
| 53 | - * @param array $headers |
|
| 54 | - * @param bool $checkMTime */ |
|
| 49 | + * @param binary $content |
|
| 50 | + * @param integer $mtime |
|
| 51 | + * @param string $type |
|
| 52 | + * @param integer $expire |
|
| 53 | + * @param array $headers |
|
| 54 | + * @param bool $checkMTime */ |
|
| 55 | 55 | |
| 56 | 56 | public static function content($content, $mtime, $type=null, $expire=null, array $headers=null, $checkMTime=true) |
| 57 | 57 | { |
@@ -80,10 +80,10 @@ discard block |
||
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | /** Check if given modification time is newer than client-side one. If not, |
| 83 | - * the method will tell the client to get the content from its own cache. |
|
| 84 | - * Afterwards the script process will be terminated. This feature requires |
|
| 85 | - * the PHP to be configured as Apache module. |
|
| 86 | - * @param integer $mtime */ |
|
| 83 | + * the method will tell the client to get the content from its own cache. |
|
| 84 | + * Afterwards the script process will be terminated. This feature requires |
|
| 85 | + * the PHP to be configured as Apache module. |
|
| 86 | + * @param integer $mtime */ |
|
| 87 | 87 | |
| 88 | 88 | public static function checkMTime($mtime, $sendHeaders=null) |
| 89 | 89 | { |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | * @param integer $expire |
| 27 | 27 | * @param array $headers */ |
| 28 | 28 | |
| 29 | - public static function file($file, $type=null, $expire=null, array $headers=null) |
|
| 29 | + public static function file($file, $type = null, $expire = null, array $headers = null) |
|
| 30 | 30 | { |
| 31 | 31 | $mtime = @filemtime($file); |
| 32 | 32 | if ($mtime !== false) { |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | * @param array $headers |
| 54 | 54 | * @param bool $checkMTime */ |
| 55 | 55 | |
| 56 | - public static function content($content, $mtime, $type=null, $expire=null, array $headers=null, $checkMTime=true) |
|
| 56 | + public static function content($content, $mtime, $type = null, $expire = null, array $headers = null, $checkMTime = true) |
|
| 57 | 57 | { |
| 58 | 58 | if ($checkMTime) { |
| 59 | 59 | self::checkMTime($mtime); |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | $expire = self::DEFAULT_EXPIRE; |
| 66 | 66 | } |
| 67 | 67 | $size = strlen($content); |
| 68 | - $expires = gmdate("D, d M Y H:i:s", time() + $expire) . " GMT"; |
|
| 68 | + $expires = gmdate("D, d M Y H:i:s", time() + $expire)." GMT"; |
|
| 69 | 69 | header("Content-Type: $type"); |
| 70 | 70 | header("Expires: $expires"); |
| 71 | 71 | header("Cache-Control: max-age=$expire"); |
@@ -85,9 +85,9 @@ discard block |
||
| 85 | 85 | * the PHP to be configured as Apache module. |
| 86 | 86 | * @param integer $mtime */ |
| 87 | 87 | |
| 88 | - public static function checkMTime($mtime, $sendHeaders=null) |
|
| 88 | + public static function checkMTime($mtime, $sendHeaders = null) |
|
| 89 | 89 | { |
| 90 | - header("Last-Modified: " . gmdate("D, d M Y H:i:s", $mtime) . " GMT"); |
|
| 90 | + header("Last-Modified: ".gmdate("D, d M Y H:i:s", $mtime)." GMT"); |
|
| 91 | 91 | |
| 92 | 92 | $headers = function_exists("getallheaders") |
| 93 | 93 | ? getallheaders() |
@@ -1,23 +1,23 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | /** This file is part of KCFinder project |
| 4 | - * |
|
| 5 | - * @desc Text processing helper class |
|
| 6 | - * @package KCFinder |
|
| 7 | - * @version 2.54 |
|
| 8 | - * @author Pavel Tzonkov <[email protected]> |
|
| 9 | - * @copyright 2010-2014 KCFinder Project |
|
| 10 | - * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
| 11 | - * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
| 12 | - * @link http://kcfinder.sunhater.com |
|
| 13 | - */ |
|
| 4 | + * |
|
| 5 | + * @desc Text processing helper class |
|
| 6 | + * @package KCFinder |
|
| 7 | + * @version 2.54 |
|
| 8 | + * @author Pavel Tzonkov <[email protected]> |
|
| 9 | + * @copyright 2010-2014 KCFinder Project |
|
| 10 | + * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
| 11 | + * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
| 12 | + * @link http://kcfinder.sunhater.com |
|
| 13 | + */ |
|
| 14 | 14 | |
| 15 | 15 | class text |
| 16 | 16 | { |
| 17 | 17 | |
| 18 | - /** Replace repeated white spaces to single space |
|
| 19 | - * @param string $string |
|
| 20 | - * @return string */ |
|
| 18 | + /** Replace repeated white spaces to single space |
|
| 19 | + * @param string $string |
|
| 20 | + * @return string */ |
|
| 21 | 21 | |
| 22 | 22 | public static function clearWhitespaces($string) |
| 23 | 23 | { |
@@ -25,8 +25,8 @@ discard block |
||
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | /** Normalize the string for HTML attribute value |
| 28 | - * @param string $string |
|
| 29 | - * @return string */ |
|
| 28 | + * @param string $string |
|
| 29 | + * @return string */ |
|
| 30 | 30 | |
| 31 | 31 | public static function htmlValue($string) |
| 32 | 32 | { |
@@ -39,8 +39,8 @@ discard block |
||
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | /** Normalize the string for JavaScript string value |
| 42 | - * @param string $string |
|
| 43 | - * @return string */ |
|
| 42 | + * @param string $string |
|
| 43 | + * @return string */ |
|
| 44 | 44 | |
| 45 | 45 | public static function jsValue($string) |
| 46 | 46 | { |
@@ -53,8 +53,8 @@ discard block |
||
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | /** Normalize the string for XML tag content data |
| 56 | - * @param string $string |
|
| 57 | - * @param bool $cdata */ |
|
| 56 | + * @param string $string |
|
| 57 | + * @param bool $cdata */ |
|
| 58 | 58 | |
| 59 | 59 | public static function xmlData($string, $cdata=false) |
| 60 | 60 | { |
@@ -66,8 +66,8 @@ discard block |
||
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | /** Returns compressed content of given CSS code |
| 69 | - * @param string $code |
|
| 70 | - * @return string */ |
|
| 69 | + * @param string $code |
|
| 70 | + * @return string */ |
|
| 71 | 71 | |
| 72 | 72 | public static function compressCSS($code) |
| 73 | 73 | { |
@@ -56,7 +56,7 @@ |
||
| 56 | 56 | * @param string $string |
| 57 | 57 | * @param bool $cdata */ |
| 58 | 58 | |
| 59 | - public static function xmlData($string, $cdata=false) |
|
| 59 | + public static function xmlData($string, $cdata = false) |
|
| 60 | 60 | { |
| 61 | 61 | $string = str_replace("]]>", "]]]]><![CDATA[>", $string); |
| 62 | 62 | if (!$cdata) { |
@@ -1,24 +1,24 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | /** This file is part of KCFinder project |
| 4 | - * |
|
| 5 | - * @desc Path helper class |
|
| 6 | - * @package KCFinder |
|
| 7 | - * @version 2.54 |
|
| 8 | - * @author Pavel Tzonkov <[email protected]> |
|
| 9 | - * @copyright 2010-2014 KCFinder Project |
|
| 10 | - * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
| 11 | - * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
| 12 | - * @link http://kcfinder.sunhater.com |
|
| 13 | - */ |
|
| 4 | + * |
|
| 5 | + * @desc Path helper class |
|
| 6 | + * @package KCFinder |
|
| 7 | + * @version 2.54 |
|
| 8 | + * @author Pavel Tzonkov <[email protected]> |
|
| 9 | + * @copyright 2010-2014 KCFinder Project |
|
| 10 | + * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
| 11 | + * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
| 12 | + * @link http://kcfinder.sunhater.com |
|
| 13 | + */ |
|
| 14 | 14 | |
| 15 | 15 | class path |
| 16 | 16 | { |
| 17 | 17 | |
| 18 | - /** Get the absolute URL path of the given one. Returns FALSE if the URL |
|
| 19 | - * is not valid or the current directory cannot be resolved (getcwd()) |
|
| 20 | - * @param string $path |
|
| 21 | - * @return string */ |
|
| 18 | + /** Get the absolute URL path of the given one. Returns FALSE if the URL |
|
| 19 | + * is not valid or the current directory cannot be resolved (getcwd()) |
|
| 20 | + * @param string $path |
|
| 21 | + * @return string */ |
|
| 22 | 22 | |
| 23 | 23 | public static function rel2abs_url($path) |
| 24 | 24 | { |
@@ -47,9 +47,9 @@ discard block |
||
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | /** Resolve full filesystem path of given URL. Returns FALSE if the URL |
| 50 | - * cannot be resolved |
|
| 51 | - * @param string $url |
|
| 52 | - * @return string */ |
|
| 50 | + * cannot be resolved |
|
| 51 | + * @param string $url |
|
| 52 | + * @return string */ |
|
| 53 | 53 | |
| 54 | 54 | public static function url2fullPath($url) |
| 55 | 55 | { |
@@ -98,12 +98,12 @@ discard block |
||
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | /** Normalize the given path. On Windows servers backslash will be replaced |
| 101 | - * with slash. Remobes unnecessary doble slashes and double dots. Removes |
|
| 102 | - * last slash if it exists. Examples: |
|
| 103 | - * path::normalize("C:\\any\\path\\") returns "C:/any/path" |
|
| 104 | - * path::normalize("/your/path/..//home/") returns "/your/home" |
|
| 105 | - * @param string $path |
|
| 106 | - * @return string */ |
|
| 101 | + * with slash. Remobes unnecessary doble slashes and double dots. Removes |
|
| 102 | + * last slash if it exists. Examples: |
|
| 103 | + * path::normalize("C:\\any\\path\\") returns "C:/any/path" |
|
| 104 | + * path::normalize("/your/path/..//home/") returns "/your/home" |
|
| 105 | + * @param string $path |
|
| 106 | + * @return string */ |
|
| 107 | 107 | |
| 108 | 108 | public static function normalize($path) |
| 109 | 109 | { |
@@ -135,8 +135,8 @@ discard block |
||
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | /** Encode URL Path |
| 138 | - * @param string $path |
|
| 139 | - * @return string */ |
|
| 138 | + * @param string $path |
|
| 139 | + * @return string */ |
|
| 140 | 140 | |
| 141 | 141 | public static function urlPathEncode($path) |
| 142 | 142 | { |
@@ -150,8 +150,8 @@ discard block |
||
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | /** Decode URL Path |
| 153 | - * @param string $path |
|
| 154 | - * @return string */ |
|
| 153 | + * @param string $path |
|
| 154 | + * @return string */ |
|
| 155 | 155 | |
| 156 | 156 | public static function urlPathDecode($path) |
| 157 | 157 | { |
@@ -38,7 +38,7 @@ discard block |
||
| 38 | 38 | return false; |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | - $return = self::normalize(substr($dir, strlen($doc_root)) . "/$path"); |
|
| 41 | + $return = self::normalize(substr($dir, strlen($doc_root))."/$path"); |
|
| 42 | 42 | if (substr($return, 0, 1) !== "/") { |
| 43 | 43 | $return = "/$return"; |
| 44 | 44 | } |
@@ -66,11 +66,11 @@ discard block |
||
| 66 | 66 | if ($uri === false) { |
| 67 | 67 | return false; |
| 68 | 68 | } |
| 69 | - $url = dirname($uri) . "/$url"; |
|
| 69 | + $url = dirname($uri)."/$url"; |
|
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | if (isset($_SERVER['DOCUMENT_ROOT'])) { |
| 73 | - return self::normalize($_SERVER['DOCUMENT_ROOT'] . "/$url"); |
|
| 73 | + return self::normalize($_SERVER['DOCUMENT_ROOT']."/$url"); |
|
| 74 | 74 | } else { |
| 75 | 75 | if ($uri === false) { |
| 76 | 76 | return false; |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | |
| 79 | 79 | if (isset($_SERVER['SCRIPT_FILENAME'])) { |
| 80 | 80 | $scr_filename = self::normalize($_SERVER['SCRIPT_FILENAME']); |
| 81 | - return self::normalize(substr($scr_filename, 0, -strlen($uri)) . "/$url"); |
|
| 81 | + return self::normalize(substr($scr_filename, 0, -strlen($uri))."/$url"); |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | $count = count(explode('/', $uri)) - 1; |
@@ -93,7 +93,7 @@ discard block |
||
| 93 | 93 | } |
| 94 | 94 | $rdir = getcwd(); |
| 95 | 95 | chdir($dir); |
| 96 | - return ($rdir !== false) ? self::normalize($rdir . "/$url") : false; |
|
| 96 | + return ($rdir !== false) ? self::normalize($rdir."/$url") : false; |
|
| 97 | 97 | } |
| 98 | 98 | } |
| 99 | 99 | |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | $path = substr($path, 0, -1); |
| 114 | 114 | } |
| 115 | 115 | if (substr($path, 0, 1) == "\\") { |
| 116 | - $path = "/" . substr($path, 1); |
|
| 116 | + $path = "/".substr($path, 1); |
|
| 117 | 117 | } |
| 118 | 118 | } |
| 119 | 119 | |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | $path = self::normalize($path); |
| 144 | 144 | $encoded = ""; |
| 145 | 145 | foreach (explode("/", $path) as $dir) { |
| 146 | - $encoded .= rawurlencode($dir) . "/"; |
|
| 146 | + $encoded .= rawurlencode($dir)."/"; |
|
| 147 | 147 | } |
| 148 | 148 | $encoded = substr($encoded, 0, -1); |
| 149 | 149 | return $encoded; |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | $path = self::normalize($path); |
| 159 | 159 | $decoded = ""; |
| 160 | 160 | foreach (explode("/", $path) as $dir) { |
| 161 | - $decoded .= rawurldecode($dir) . "/"; |
|
| 161 | + $decoded .= rawurldecode($dir)."/"; |
|
| 162 | 162 | } |
| 163 | 163 | $decoded = substr($decoded, 0, -1); |
| 164 | 164 | return $decoded; |
@@ -1,16 +1,16 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | /** This file is part of KCFinder project |
| 4 | - * |
|
| 5 | - * @desc GraphicsMagick image driver class |
|
| 6 | - * @package KCFinder |
|
| 7 | - * @version 2.54 |
|
| 8 | - * @author Pavel Tzonkov <[email protected]> |
|
| 9 | - * @copyright 2010-2014 KCFinder Project |
|
| 10 | - * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
| 11 | - * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
| 12 | - * @link http://kcfinder.sunhater.com |
|
| 13 | - */ |
|
| 4 | + * |
|
| 5 | + * @desc GraphicsMagick image driver class |
|
| 6 | + * @package KCFinder |
|
| 7 | + * @version 2.54 |
|
| 8 | + * @author Pavel Tzonkov <[email protected]> |
|
| 9 | + * @copyright 2010-2014 KCFinder Project |
|
| 10 | + * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
| 11 | + * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
| 12 | + * @link http://kcfinder.sunhater.com |
|
| 13 | + */ |
|
| 14 | 14 | |
| 15 | 15 | class image_gmagick extends image |
| 16 | 16 | { |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | return true; |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | - public function resizeFit($width, $height, $background=false) |
|
| 42 | + public function resizeFit($width, $height, $background = false) |
|
| 43 | 43 | {// |
| 44 | 44 | if (!$width) { |
| 45 | 45 | $width = 1; |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | } |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | - public function resizeCrop($width, $height, $offset=false) |
|
| 81 | + public function resizeCrop($width, $height, $offset = false) |
|
| 82 | 82 | { |
| 83 | 83 | if (!$width) { |
| 84 | 84 | $width = 1; |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | return true; |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | - public function rotate($angle, $background="#000000") |
|
| 145 | + public function rotate($angle, $background = "#000000") |
|
| 146 | 146 | { |
| 147 | 147 | try { |
| 148 | 148 | $this->image->rotateImage($background, $angle); |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | return true; |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | - public function watermark($file, $left=false, $top=false) |
|
| 179 | + public function watermark($file, $left = false, $top = false) |
|
| 180 | 180 | { |
| 181 | 181 | try { |
| 182 | 182 | $wm = new Gmagick($file); |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | |
| 278 | 278 | // INHERIT METHODS |
| 279 | 279 | |
| 280 | - public function output($type="jpeg", array $options=array()) |
|
| 280 | + public function output($type = "jpeg", array $options = array()) |
|
| 281 | 281 | { |
| 282 | 282 | $type = strtolower($type); |
| 283 | 283 | try { |
@@ -297,7 +297,7 @@ discard block |
||
| 297 | 297 | } |
| 298 | 298 | echo $this->image; |
| 299 | 299 | } else { |
| 300 | - $file = $options['file'] . ".$type"; |
|
| 300 | + $file = $options['file'].".$type"; |
|
| 301 | 301 | try { |
| 302 | 302 | $this->image->writeImage($file); |
| 303 | 303 | } catch (Exception $e) { |
@@ -317,7 +317,7 @@ discard block |
||
| 317 | 317 | |
| 318 | 318 | // OWN METHODS |
| 319 | 319 | |
| 320 | - protected function optimize_jpeg(array $options=array()) |
|
| 320 | + protected function optimize_jpeg(array $options = array()) |
|
| 321 | 321 | { |
| 322 | 322 | $quality = isset($options['quality']) ? $options['quality'] : self::DEFAULT_JPEG_QUALITY; |
| 323 | 323 | try { |
@@ -22,7 +22,8 @@ discard block |
||
| 22 | 22 | // ABSTRACT PUBLIC METHODS |
| 23 | 23 | |
| 24 | 24 | public function resize($width, $height) |
| 25 | - {// |
|
| 25 | + { |
|
| 26 | +// |
|
| 26 | 27 | if (!$width) { |
| 27 | 28 | $width = 1; |
| 28 | 29 | } |
@@ -40,7 +41,8 @@ discard block |
||
| 40 | 41 | } |
| 41 | 42 | |
| 42 | 43 | public function resizeFit($width, $height, $background=false) |
| 43 | - {// |
|
| 44 | + { |
|
| 45 | +// |
|
| 44 | 46 | if (!$width) { |
| 45 | 47 | $width = 1; |
| 46 | 48 | } |