@@ -1149,18 +1149,18 @@ discard block |
||
| 1149 | 1149 | } |
| 1150 | 1150 | |
| 1151 | 1151 | /** |
| 1152 | - * Get remote contents |
|
| 1153 | - * |
|
| 1154 | - * @param string $url target url |
|
| 1155 | - * @param int $timeout timeout (sec) |
|
| 1156 | - * @param int $redirect_max redirect max count |
|
| 1157 | - * @param string $ua |
|
| 1158 | - * @param resource $fp |
|
| 1159 | - * @return string or bool(false) |
|
| 1160 | - * @retval string contents |
|
| 1161 | - * @retval false error |
|
| 1162 | - * @author Naoki Sawada |
|
| 1163 | - **/ |
|
| 1152 | + * Get remote contents |
|
| 1153 | + * |
|
| 1154 | + * @param string $url target url |
|
| 1155 | + * @param int $timeout timeout (sec) |
|
| 1156 | + * @param int $redirect_max redirect max count |
|
| 1157 | + * @param string $ua |
|
| 1158 | + * @param resource $fp |
|
| 1159 | + * @return string or bool(false) |
|
| 1160 | + * @retval string contents |
|
| 1161 | + * @retval false error |
|
| 1162 | + * @author Naoki Sawada |
|
| 1163 | + **/ |
|
| 1164 | 1164 | protected function get_remote_contents( &$url, $timeout = 30, $redirect_max = 5, $ua = 'Mozilla/5.0', $fp = null ) { |
| 1165 | 1165 | $method = (function_exists('curl_exec') && !ini_get('safe_mode'))? 'curl_get_contents' : 'fsock_get_contents'; |
| 1166 | 1166 | return $this->$method( $url, $timeout, $redirect_max, $ua, $fp ); |
@@ -2090,12 +2090,12 @@ discard block |
||
| 2090 | 2090 | } |
| 2091 | 2091 | |
| 2092 | 2092 | /** |
| 2093 | - * Return content URL |
|
| 2094 | - * |
|
| 2095 | - * @param array $args command arguments |
|
| 2096 | - * @return array |
|
| 2097 | - * @author Naoki Sawada |
|
| 2098 | - **/ |
|
| 2093 | + * Return content URL |
|
| 2094 | + * |
|
| 2095 | + * @param array $args command arguments |
|
| 2096 | + * @return array |
|
| 2097 | + * @author Naoki Sawada |
|
| 2098 | + **/ |
|
| 2099 | 2099 | protected function url($args) { |
| 2100 | 2100 | $target = $args['target']; |
| 2101 | 2101 | $options = isset($args['options'])? $args['options'] : array(); |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | $options['url'] = $this->getConnectorUrl(); |
| 193 | 193 | } |
| 194 | 194 | $callback = $options['url'] |
| 195 | - . '?cmd=netmount&protocol=dropbox&host=dropbox.com&user=init&pass=return&node='.$options['id'].$cdata; |
|
| 195 | + . '?cmd=netmount&protocol=dropbox&host=dropbox.com&user=init&pass=return&node='.$options['id'].$cdata; |
|
| 196 | 196 | |
| 197 | 197 | try { |
| 198 | 198 | $tokens = $this->oauth->getRequestToken(); |
@@ -265,9 +265,9 @@ discard block |
||
| 265 | 265 | */ |
| 266 | 266 | private function getConnectorUrl() { |
| 267 | 267 | $url = ((isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off')? 'https://' : 'http://') |
| 268 | - . $_SERVER['SERVER_NAME'] // host |
|
| 269 | - . ($_SERVER['SERVER_PORT'] == 80 ? '' : ':' . $_SERVER['SERVER_PORT']) // port |
|
| 270 | - . $_SERVER['REQUEST_URI']; // path & query |
|
| 268 | + . $_SERVER['SERVER_NAME'] // host |
|
| 269 | + . ($_SERVER['SERVER_PORT'] == 80 ? '' : ':' . $_SERVER['SERVER_PORT']) // port |
|
| 270 | + . $_SERVER['REQUEST_URI']; // path & query |
|
| 271 | 271 | list($url) = explode('?', $url); |
| 272 | 272 | return $url; |
| 273 | 273 | } |
@@ -605,7 +605,7 @@ discard block |
||
| 605 | 605 | $stat['mime'] = $raw['is_dir']? 'directory' : $raw['mime_type']; |
| 606 | 606 | $stat['size'] = $stat['mime'] == 'directory' ? 0 : $raw['bytes']; |
| 607 | 607 | $stat['ts'] = isset($raw['client_mtime'])? strtotime($raw['client_mtime']) : |
| 608 | - (isset($raw['modified'])? strtotime($raw['modified']) : $_SERVER['REQUEST_TIME']); |
|
| 608 | + (isset($raw['modified'])? strtotime($raw['modified']) : $_SERVER['REQUEST_TIME']); |
|
| 609 | 609 | $stat['dirs'] = 0; |
| 610 | 610 | if ($raw['is_dir']) { |
| 611 | 611 | $stat['dirs'] = (int)(bool)$this->query('select path from '.$this->DB_TableName.' where isdir=1 and path='.$this->DB->quote(strtolower($raw['path']))); |
@@ -648,14 +648,14 @@ discard block |
||
| 648 | 648 | } |
| 649 | 649 | |
| 650 | 650 | /** |
| 651 | - * Recursive files search |
|
| 652 | - * |
|
| 653 | - * @param string $path dir path |
|
| 654 | - * @param string $q search string |
|
| 655 | - * @param array $mimes |
|
| 656 | - * @return array |
|
| 657 | - * @author Naoki Sawada |
|
| 658 | - **/ |
|
| 651 | + * Recursive files search |
|
| 652 | + * |
|
| 653 | + * @param string $path dir path |
|
| 654 | + * @param string $q search string |
|
| 655 | + * @param array $mimes |
|
| 656 | + * @return array |
|
| 657 | + * @author Naoki Sawada |
|
| 658 | + **/ |
|
| 659 | 659 | protected function doSearch($path, $q, $mimes) { |
| 660 | 660 | $result = array(); |
| 661 | 661 | $sth = $this->DB->prepare('select dat from '.$this->DB_TableName.' WHERE path LIKE ? AND fname LIKE ?'); |
@@ -679,16 +679,16 @@ discard block |
||
| 679 | 679 | } |
| 680 | 680 | |
| 681 | 681 | /** |
| 682 | - * Copy file/recursive copy dir only in current volume. |
|
| 683 | - * Return new file path or false. |
|
| 684 | - * |
|
| 685 | - * @param string $src source path |
|
| 686 | - * @param string $dst destination dir path |
|
| 687 | - * @param string $name new file name (optionaly) |
|
| 688 | - * @return string|false |
|
| 689 | - * @author Dmitry (dio) Levashov |
|
| 690 | - * @author Naoki Sawada |
|
| 691 | - **/ |
|
| 682 | + * Copy file/recursive copy dir only in current volume. |
|
| 683 | + * Return new file path or false. |
|
| 684 | + * |
|
| 685 | + * @param string $src source path |
|
| 686 | + * @param string $dst destination dir path |
|
| 687 | + * @param string $name new file name (optionaly) |
|
| 688 | + * @return string|false |
|
| 689 | + * @author Dmitry (dio) Levashov |
|
| 690 | + * @author Naoki Sawada |
|
| 691 | + **/ |
|
| 692 | 692 | protected function copy($src, $dst, $name) { |
| 693 | 693 | |
| 694 | 694 | $this->clearcache(); |
@@ -699,14 +699,14 @@ discard block |
||
| 699 | 699 | } |
| 700 | 700 | |
| 701 | 701 | /** |
| 702 | - * Remove file/ recursive remove dir |
|
| 703 | - * |
|
| 704 | - * @param string $path file path |
|
| 705 | - * @param bool $force try to remove even if file locked |
|
| 706 | - * @return bool |
|
| 707 | - * @author Dmitry (dio) Levashov |
|
| 708 | - * @author Naoki Sawada |
|
| 709 | - **/ |
|
| 702 | + * Remove file/ recursive remove dir |
|
| 703 | + * |
|
| 704 | + * @param string $path file path |
|
| 705 | + * @param bool $force try to remove even if file locked |
|
| 706 | + * @return bool |
|
| 707 | + * @author Dmitry (dio) Levashov |
|
| 708 | + * @author Naoki Sawada |
|
| 709 | + **/ |
|
| 710 | 710 | protected function remove($path, $force = false, $recursive = false) { |
| 711 | 711 | $stat = $this->stat($path); |
| 712 | 712 | $stat['realpath'] = $path; |
@@ -736,14 +736,14 @@ discard block |
||
| 736 | 736 | } |
| 737 | 737 | |
| 738 | 738 | /** |
| 739 | - * Create thumnbnail and return it's URL on success |
|
| 740 | - * |
|
| 741 | - * @param string $path file path |
|
| 742 | - * @param string $mime file mime type |
|
| 743 | - * @return string|false |
|
| 744 | - * @author Dmitry (dio) Levashov |
|
| 745 | - * @author Naoki Sawada |
|
| 746 | - **/ |
|
| 739 | + * Create thumnbnail and return it's URL on success |
|
| 740 | + * |
|
| 741 | + * @param string $path file path |
|
| 742 | + * @param string $mime file mime type |
|
| 743 | + * @return string|false |
|
| 744 | + * @author Dmitry (dio) Levashov |
|
| 745 | + * @author Naoki Sawada |
|
| 746 | + **/ |
|
| 747 | 747 | protected function createTmb($path, $stat) { |
| 748 | 748 | if (!$stat || !$this->canCreateTmb($path, $stat)) { |
| 749 | 749 | return false; |
@@ -828,13 +828,13 @@ discard block |
||
| 828 | 828 | } |
| 829 | 829 | |
| 830 | 830 | /** |
| 831 | - * Return content URL |
|
| 832 | - * |
|
| 833 | - * @param string $hash file hash |
|
| 834 | - * @param array $options options |
|
| 835 | - * @return array |
|
| 836 | - * @author Naoki Sawada |
|
| 837 | - **/ |
|
| 831 | + * Return content URL |
|
| 832 | + * |
|
| 833 | + * @param string $hash file hash |
|
| 834 | + * @param array $options options |
|
| 835 | + * @return array |
|
| 836 | + * @author Naoki Sawada |
|
| 837 | + **/ |
|
| 838 | 838 | public function getContentUrl($hash, $options = array()) { |
| 839 | 839 | if (($file = $this->file($hash)) == false || !$file['url'] || $file['url'] == 1) { |
| 840 | 840 | $path = $this->decode($hash); |
@@ -897,9 +897,9 @@ discard block |
||
| 897 | 897 | try { |
| 898 | 898 | $request2 = new HTTP_Request2(); |
| 899 | 899 | $request2->setConfig(array( |
| 900 | - 'ssl_verify_peer' => false, |
|
| 901 | - 'ssl_verify_host' => false |
|
| 902 | - )); |
|
| 900 | + 'ssl_verify_peer' => false, |
|
| 901 | + 'ssl_verify_host' => false |
|
| 902 | + )); |
|
| 903 | 903 | $request2->setUrl($url); |
| 904 | 904 | $request2->setMethod(HTTP_Request2::METHOD_HEAD); |
| 905 | 905 | $result = $request2->send(); |
@@ -1,48 +1,48 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * elFinder Plugin Sanitizer |
|
| 4 | - * |
|
| 5 | - * Sanitizer of file-name and file-path etc. |
|
| 6 | - * |
|
| 7 | - * ex. binding, configure on connector options |
|
| 8 | - * $opts = array( |
|
| 9 | - * 'bind' => array( |
|
| 10 | - * 'upload.pre mkdir.pre mkfile.pre rename.pre archive.pre' => array( |
|
| 11 | - * 'Plugin.Sanitizer.cmdPreprocess' |
|
| 12 | - * ), |
|
| 13 | - * 'upload.presave' => array( |
|
| 14 | - * 'Plugin.Sanitizer.onUpLoadPreSave' |
|
| 15 | - * ) |
|
| 16 | - * ), |
|
| 17 | - * // global configure (optional) |
|
| 18 | - * 'plugin' => array( |
|
| 19 | - * 'Sanitizer' => array( |
|
| 20 | - * 'enable' => true, |
|
| 21 | - * 'targets' => array('\\','/',':','*','?','"','<','>','|'), // target chars |
|
| 22 | - * 'replace' => '_' // replace to this |
|
| 23 | - * ) |
|
| 24 | - * ), |
|
| 25 | - * // each volume configure (optional) |
|
| 26 | - * 'roots' => array( |
|
| 27 | - * array( |
|
| 28 | - * 'driver' => 'LocalFileSystem', |
|
| 29 | - * 'path' => '/path/to/files/', |
|
| 30 | - * 'URL' => 'http://localhost/to/files/' |
|
| 31 | - * 'plugin' => array( |
|
| 32 | - * 'Sanitizer' => array( |
|
| 33 | - * 'enable' => true, |
|
| 34 | - * 'targets' => array('\\','/',':','*','?','"','<','>','|'), // target chars |
|
| 35 | - * 'replace' => '_' // replace to this |
|
| 36 | - * ) |
|
| 37 | - * ) |
|
| 38 | - * ) |
|
| 39 | - * ) |
|
| 40 | - * ); |
|
| 41 | - * |
|
| 42 | - * @package elfinder |
|
| 43 | - * @author Naoki Sawada |
|
| 44 | - * @license New BSD |
|
| 45 | - */ |
|
| 3 | + * elFinder Plugin Sanitizer |
|
| 4 | + * |
|
| 5 | + * Sanitizer of file-name and file-path etc. |
|
| 6 | + * |
|
| 7 | + * ex. binding, configure on connector options |
|
| 8 | + * $opts = array( |
|
| 9 | + * 'bind' => array( |
|
| 10 | + * 'upload.pre mkdir.pre mkfile.pre rename.pre archive.pre' => array( |
|
| 11 | + * 'Plugin.Sanitizer.cmdPreprocess' |
|
| 12 | + * ), |
|
| 13 | + * 'upload.presave' => array( |
|
| 14 | + * 'Plugin.Sanitizer.onUpLoadPreSave' |
|
| 15 | + * ) |
|
| 16 | + * ), |
|
| 17 | + * // global configure (optional) |
|
| 18 | + * 'plugin' => array( |
|
| 19 | + * 'Sanitizer' => array( |
|
| 20 | + * 'enable' => true, |
|
| 21 | + * 'targets' => array('\\','/',':','*','?','"','<','>','|'), // target chars |
|
| 22 | + * 'replace' => '_' // replace to this |
|
| 23 | + * ) |
|
| 24 | + * ), |
|
| 25 | + * // each volume configure (optional) |
|
| 26 | + * 'roots' => array( |
|
| 27 | + * array( |
|
| 28 | + * 'driver' => 'LocalFileSystem', |
|
| 29 | + * 'path' => '/path/to/files/', |
|
| 30 | + * 'URL' => 'http://localhost/to/files/' |
|
| 31 | + * 'plugin' => array( |
|
| 32 | + * 'Sanitizer' => array( |
|
| 33 | + * 'enable' => true, |
|
| 34 | + * 'targets' => array('\\','/',':','*','?','"','<','>','|'), // target chars |
|
| 35 | + * 'replace' => '_' // replace to this |
|
| 36 | + * ) |
|
| 37 | + * ) |
|
| 38 | + * ) |
|
| 39 | + * ) |
|
| 40 | + * ); |
|
| 41 | + * |
|
| 42 | + * @package elfinder |
|
| 43 | + * @author Naoki Sawada |
|
| 44 | + * @license New BSD |
|
| 45 | + */ |
|
| 46 | 46 | class elFinderPluginSanitizer |
| 47 | 47 | { |
| 48 | 48 | private $opts = array(); |
@@ -200,11 +200,11 @@ discard block |
||
| 200 | 200 | 'mimefile' => '', |
| 201 | 201 | // mime type normalize map : Array '[ext]:[detected mime type]' => '[normalized mime]' |
| 202 | 202 | 'mimeMap' => array( |
| 203 | - 'md:application/x-genesis-rom' => 'text/x-markdown', |
|
| 204 | - 'md:text/plain' => 'text/x-markdown', |
|
| 205 | - 'markdown:text/plain' => 'text/x-markdown', |
|
| 206 | - 'css:text/x-asm' => 'text/css' |
|
| 207 | - ), |
|
| 203 | + 'md:application/x-genesis-rom' => 'text/x-markdown', |
|
| 204 | + 'md:text/plain' => 'text/x-markdown', |
|
| 205 | + 'markdown:text/plain' => 'text/x-markdown', |
|
| 206 | + 'css:text/x-asm' => 'text/css' |
|
| 207 | + ), |
|
| 208 | 208 | // directory for thumbnails |
| 209 | 209 | 'tmbPath' => '.tmb', |
| 210 | 210 | // mode to create thumbnails dir |
@@ -4070,14 +4070,14 @@ discard block |
||
| 4070 | 4070 | // } |
| 4071 | 4071 | |
| 4072 | 4072 | /** |
| 4073 | - * Find position of first occurrence of string in a string with multibyte support |
|
| 4074 | - * |
|
| 4075 | - * @param string $haystack The string being checked. |
|
| 4076 | - * @param string $needle The string to find in haystack. |
|
| 4077 | - * @param int $offset The search offset. If it is not specified, 0 is used. |
|
| 4078 | - * @return int|bool |
|
| 4079 | - * @author Alexey Sukhotin |
|
| 4080 | - **/ |
|
| 4073 | + * Find position of first occurrence of string in a string with multibyte support |
|
| 4074 | + * |
|
| 4075 | + * @param string $haystack The string being checked. |
|
| 4076 | + * @param string $needle The string to find in haystack. |
|
| 4077 | + * @param int $offset The search offset. If it is not specified, 0 is used. |
|
| 4078 | + * @return int|bool |
|
| 4079 | + * @author Alexey Sukhotin |
|
| 4080 | + **/ |
|
| 4081 | 4081 | protected function stripos($haystack , $needle , $offset = 0) { |
| 4082 | 4082 | if (function_exists('mb_stripos')) { |
| 4083 | 4083 | return mb_stripos($haystack , $needle , $offset); |
@@ -1,57 +1,57 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * elFinder Plugin Normalizer |
|
| 4 | - * |
|
| 5 | - * UTF-8 Normalizer of file-name and file-path etc. |
|
| 6 | - * nfc(NFC): Canonical Decomposition followed by Canonical Composition |
|
| 7 | - * nfkc(NFKC): Compatibility Decomposition followed by Canonical |
|
| 8 | - * |
|
| 9 | - * This plugin require Class "Normalizer" (PHP 5 >= 5.3.0, PECL intl >= 1.0.0) |
|
| 10 | - * or PEAR package "I18N_UnicodeNormalizer" |
|
| 11 | - * |
|
| 12 | - * ex. binding, configure on connector options |
|
| 13 | - * $opts = array( |
|
| 14 | - * 'bind' => array( |
|
| 15 | - * 'upload.pre mkdir.pre mkfile.pre rename.pre archive.pre' => array( |
|
| 16 | - * 'Plugin.Normalizer.cmdPreprocess' |
|
| 17 | - * ), |
|
| 18 | - * 'upload.presave' => array( |
|
| 19 | - * 'Plugin.Normalizer.onUpLoadPreSave' |
|
| 20 | - * ) |
|
| 21 | - * ), |
|
| 22 | - * // global configure (optional) |
|
| 23 | - * 'plugin' => array( |
|
| 24 | - * 'Normalizer' => array( |
|
| 25 | - * 'enable' => true, |
|
| 26 | - * 'nfc' => true, |
|
| 27 | - * 'nfkc' => true, |
|
| 28 | - * 'lowercase' => false, |
|
| 29 | - * 'convmap' => array() |
|
| 30 | - * ) |
|
| 31 | - * ), |
|
| 32 | - * // each volume configure (optional) |
|
| 33 | - * 'roots' => array( |
|
| 34 | - * array( |
|
| 35 | - * 'driver' => 'LocalFileSystem', |
|
| 36 | - * 'path' => '/path/to/files/', |
|
| 37 | - * 'URL' => 'http://localhost/to/files/' |
|
| 38 | - * 'plugin' => array( |
|
| 39 | - * 'Normalizer' => array( |
|
| 40 | - * 'enable' => true, |
|
| 41 | - * 'nfc' => true, |
|
| 42 | - * 'nfkc' => true, |
|
| 43 | - * 'lowercase' => false, |
|
| 44 | - * 'convmap' => array() |
|
| 45 | - * ) |
|
| 46 | - * ) |
|
| 47 | - * ) |
|
| 48 | - * ) |
|
| 49 | - * ); |
|
| 50 | - * |
|
| 51 | - * @package elfinder |
|
| 52 | - * @author Naoki Sawada |
|
| 53 | - * @license New BSD |
|
| 54 | - */ |
|
| 3 | + * elFinder Plugin Normalizer |
|
| 4 | + * |
|
| 5 | + * UTF-8 Normalizer of file-name and file-path etc. |
|
| 6 | + * nfc(NFC): Canonical Decomposition followed by Canonical Composition |
|
| 7 | + * nfkc(NFKC): Compatibility Decomposition followed by Canonical |
|
| 8 | + * |
|
| 9 | + * This plugin require Class "Normalizer" (PHP 5 >= 5.3.0, PECL intl >= 1.0.0) |
|
| 10 | + * or PEAR package "I18N_UnicodeNormalizer" |
|
| 11 | + * |
|
| 12 | + * ex. binding, configure on connector options |
|
| 13 | + * $opts = array( |
|
| 14 | + * 'bind' => array( |
|
| 15 | + * 'upload.pre mkdir.pre mkfile.pre rename.pre archive.pre' => array( |
|
| 16 | + * 'Plugin.Normalizer.cmdPreprocess' |
|
| 17 | + * ), |
|
| 18 | + * 'upload.presave' => array( |
|
| 19 | + * 'Plugin.Normalizer.onUpLoadPreSave' |
|
| 20 | + * ) |
|
| 21 | + * ), |
|
| 22 | + * // global configure (optional) |
|
| 23 | + * 'plugin' => array( |
|
| 24 | + * 'Normalizer' => array( |
|
| 25 | + * 'enable' => true, |
|
| 26 | + * 'nfc' => true, |
|
| 27 | + * 'nfkc' => true, |
|
| 28 | + * 'lowercase' => false, |
|
| 29 | + * 'convmap' => array() |
|
| 30 | + * ) |
|
| 31 | + * ), |
|
| 32 | + * // each volume configure (optional) |
|
| 33 | + * 'roots' => array( |
|
| 34 | + * array( |
|
| 35 | + * 'driver' => 'LocalFileSystem', |
|
| 36 | + * 'path' => '/path/to/files/', |
|
| 37 | + * 'URL' => 'http://localhost/to/files/' |
|
| 38 | + * 'plugin' => array( |
|
| 39 | + * 'Normalizer' => array( |
|
| 40 | + * 'enable' => true, |
|
| 41 | + * 'nfc' => true, |
|
| 42 | + * 'nfkc' => true, |
|
| 43 | + * 'lowercase' => false, |
|
| 44 | + * 'convmap' => array() |
|
| 45 | + * ) |
|
| 46 | + * ) |
|
| 47 | + * ) |
|
| 48 | + * ) |
|
| 49 | + * ); |
|
| 50 | + * |
|
| 51 | + * @package elfinder |
|
| 52 | + * @author Naoki Sawada |
|
| 53 | + * @license New BSD |
|
| 54 | + */ |
|
| 55 | 55 | class elFinderPluginNormalizer |
| 56 | 56 | { |
| 57 | 57 | private $opts = array(); |
@@ -1,51 +1,51 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * elFinder Plugin AutoResize |
|
| 4 | - * |
|
| 5 | - * Auto resize on file upload. |
|
| 6 | - * |
|
| 7 | - * ex. binding, configure on connector options |
|
| 8 | - * $opts = array( |
|
| 9 | - * 'bind' => array( |
|
| 10 | - * 'upload.presave' => array( |
|
| 11 | - * 'Plugin.AutoResize.onUpLoadPreSave' |
|
| 12 | - * ) |
|
| 13 | - * ), |
|
| 14 | - * // global configure (optional) |
|
| 15 | - * 'plugin' => array( |
|
| 16 | - * 'AutoResize' => array( |
|
| 17 | - * 'enable' => true, // For control by volume driver |
|
| 18 | - * 'maxWidth' => 1024, // Path to Water mark image |
|
| 19 | - * 'maxHeight' => 1024, // Margin right pixel |
|
| 20 | - * 'quality' => 95, // JPEG image save quality |
|
| 21 | - * 'preserveExif' => false, // Preserve EXIF data (Imagick only) |
|
| 22 | - * 'targetType' => IMG_GIF|IMG_JPG|IMG_PNG|IMG_WBMP // Target image formats ( bit-field ) |
|
| 23 | - * ) |
|
| 24 | - * ), |
|
| 25 | - * // each volume configure (optional) |
|
| 26 | - * 'roots' => array( |
|
| 27 | - * array( |
|
| 28 | - * 'driver' => 'LocalFileSystem', |
|
| 29 | - * 'path' => '/path/to/files/', |
|
| 30 | - * 'URL' => 'http://localhost/to/files/' |
|
| 31 | - * 'plugin' => array( |
|
| 32 | - * 'AutoResize' => array( |
|
| 33 | - * 'enable' => true, // For control by volume driver |
|
| 34 | - * 'maxWidth' => 1024, // Path to Water mark image |
|
| 35 | - * 'maxHeight' => 1024, // Margin right pixel |
|
| 36 | - * 'quality' => 95, // JPEG image save quality |
|
| 37 | - * 'preserveExif' => false, // Preserve EXIF data (Imagick only) |
|
| 38 | - * 'targetType' => IMG_GIF|IMG_JPG|IMG_PNG|IMG_WBMP // Target image formats ( bit-field ) |
|
| 39 | - * ) |
|
| 40 | - * ) |
|
| 41 | - * ) |
|
| 42 | - * ) |
|
| 43 | - * ); |
|
| 44 | - * |
|
| 45 | - * @package elfinder |
|
| 46 | - * @author Naoki Sawada |
|
| 47 | - * @license New BSD |
|
| 48 | - */ |
|
| 3 | + * elFinder Plugin AutoResize |
|
| 4 | + * |
|
| 5 | + * Auto resize on file upload. |
|
| 6 | + * |
|
| 7 | + * ex. binding, configure on connector options |
|
| 8 | + * $opts = array( |
|
| 9 | + * 'bind' => array( |
|
| 10 | + * 'upload.presave' => array( |
|
| 11 | + * 'Plugin.AutoResize.onUpLoadPreSave' |
|
| 12 | + * ) |
|
| 13 | + * ), |
|
| 14 | + * // global configure (optional) |
|
| 15 | + * 'plugin' => array( |
|
| 16 | + * 'AutoResize' => array( |
|
| 17 | + * 'enable' => true, // For control by volume driver |
|
| 18 | + * 'maxWidth' => 1024, // Path to Water mark image |
|
| 19 | + * 'maxHeight' => 1024, // Margin right pixel |
|
| 20 | + * 'quality' => 95, // JPEG image save quality |
|
| 21 | + * 'preserveExif' => false, // Preserve EXIF data (Imagick only) |
|
| 22 | + * 'targetType' => IMG_GIF|IMG_JPG|IMG_PNG|IMG_WBMP // Target image formats ( bit-field ) |
|
| 23 | + * ) |
|
| 24 | + * ), |
|
| 25 | + * // each volume configure (optional) |
|
| 26 | + * 'roots' => array( |
|
| 27 | + * array( |
|
| 28 | + * 'driver' => 'LocalFileSystem', |
|
| 29 | + * 'path' => '/path/to/files/', |
|
| 30 | + * 'URL' => 'http://localhost/to/files/' |
|
| 31 | + * 'plugin' => array( |
|
| 32 | + * 'AutoResize' => array( |
|
| 33 | + * 'enable' => true, // For control by volume driver |
|
| 34 | + * 'maxWidth' => 1024, // Path to Water mark image |
|
| 35 | + * 'maxHeight' => 1024, // Margin right pixel |
|
| 36 | + * 'quality' => 95, // JPEG image save quality |
|
| 37 | + * 'preserveExif' => false, // Preserve EXIF data (Imagick only) |
|
| 38 | + * 'targetType' => IMG_GIF|IMG_JPG|IMG_PNG|IMG_WBMP // Target image formats ( bit-field ) |
|
| 39 | + * ) |
|
| 40 | + * ) |
|
| 41 | + * ) |
|
| 42 | + * ) |
|
| 43 | + * ); |
|
| 44 | + * |
|
| 45 | + * @package elfinder |
|
| 46 | + * @author Naoki Sawada |
|
| 47 | + * @license New BSD |
|
| 48 | + */ |
|
| 49 | 49 | class elFinderPluginAutoResize { |
| 50 | 50 | |
| 51 | 51 | private $opts = array(); |
@@ -5,19 +5,19 @@ |
||
| 5 | 5 | if (! class_exists('RecursiveCallbackFilterIterator', false)) { |
| 6 | 6 | class RecursiveCallbackFilterIterator extends RecursiveFilterIterator { |
| 7 | 7 | |
| 8 | - public function __construct ( RecursiveIterator $iterator, $callback ) { |
|
| 9 | - $this->callback = $callback; |
|
| 10 | - parent::__construct($iterator); |
|
| 11 | - } |
|
| 8 | + public function __construct ( RecursiveIterator $iterator, $callback ) { |
|
| 9 | + $this->callback = $callback; |
|
| 10 | + parent::__construct($iterator); |
|
| 11 | + } |
|
| 12 | 12 | |
| 13 | - public function accept () { |
|
| 14 | - $callback = $this->callback; |
|
| 15 | - return $callback(parent::current(), parent::key(), parent::getInnerIterator()); |
|
| 16 | - } |
|
| 13 | + public function accept () { |
|
| 14 | + $callback = $this->callback; |
|
| 15 | + return $callback(parent::current(), parent::key(), parent::getInnerIterator()); |
|
| 16 | + } |
|
| 17 | 17 | |
| 18 | - public function getChildren () { |
|
| 19 | - return new self($this->getInnerIterator()->getChildren(), $this->callback); |
|
| 20 | - } |
|
| 18 | + public function getChildren () { |
|
| 19 | + return new self($this->getInnerIterator()->getChildren(), $this->callback); |
|
| 20 | + } |
|
| 21 | 21 | } |
| 22 | 22 | } |
| 23 | 23 | |