Cloud computing platform
Révision | 655df8f29712471cd3a0ce248a1e09516946de98 (tree) |
---|---|
l'heure | 2017-02-15 17:21:22 |
Auteur | naoki hirata <naoki@magi...> |
Commiter | naoki hirata |
elFinderの画像回転で、exiftran,jpegtranコマンドがない場合のバグを修正。
@@ -34,8 +34,8 @@ class ScriptLibInfo | ||
34 | 34 | private static $ckeditorVer = 0; // 使用するCKEditorのバージョン(0=デフォルト, 1=最新) |
35 | 35 | |
36 | 36 | // ##### 選択中のライブラリ ##### |
37 | -// const SELECTED_LIB_ELFINDER = 'elfinder112'; // 選択中のelFinder、「elfinder」または「elfinder112」「elfinder115」が設定可能。(PHP v5.3対応) | |
38 | - const SELECTED_LIB_ELFINDER = 'elfinder115'; // 選択中のelFinder、「elfinder」または「elfinder112」「elfinder115」が設定可能。(PHP v5.3対応) | |
37 | +// const SELECTED_LIB_ELFINDER = 'elfinder112'; // 選択中のelFinder、「elfinder」または「elfinder112」「elfinder115」「elfinder121」が設定可能。(PHP v5.3対応) | |
38 | + const SELECTED_LIB_ELFINDER = 'elfinder115'; // 選択中のelFinder、「elfinder」または「elfinder112」「elfinder115」「elfinder121」が設定可能。(PHP v5.3対応) | |
39 | 39 | |
40 | 40 | // ##### Javascriptライブラリ(DBでの設定値) ##### |
41 | 41 | // ライブラリセット(複数ライブラリの構成) |
@@ -50,6 +50,7 @@ class ScriptLibInfo | ||
50 | 50 | const LIB_ELFINDER = 'elfinder'; |
51 | 51 | const LIB_ELFINDER112 = 'elfinder112'; // v2.1.12 |
52 | 52 | const LIB_ELFINDER115 = 'elfinder115'; // v2.1.15 |
53 | + const LIB_ELFINDER121 = 'elfinder121'; // v2.1.21 | |
53 | 54 | const LIB_MD5 = 'md5'; |
54 | 55 | const LIB_MOMENT = 'moment'; |
55 | 56 | const LIB_SWFOBJECT = 'swfobject'; |
@@ -340,6 +341,15 @@ const JQUERY_TABLEDND_FILENAME = 'jquery/tablednd/jquery.tablednd-0.9.2.js'; | ||
340 | 341 | // const ELFINDER115_THEME_CSS = 'elfinder-2.1.15/theme/smoothness/jquery-ui.min.css'; // テーマファイル |
341 | 342 | const ELFINDER115_THEME_CSS = 'elfinder-2.1.15/theme/smoothness/jquery-ui.css'; // テーマファイル |
342 | 343 | |
344 | + // elFinder v2.1.21版 | |
345 | + const ELFINDER121_VER = '2.1.21'; // elFinderバージョン | |
346 | +// const ELFINDER121_FILENAME = 'elfinder-2.1.21/js/elfinder.full.js'; // elFinder | |
347 | + const ELFINDER121_FILENAME = 'elfinder-2.1.21/js/elfinder.min.js'; // elFinder | |
348 | + const ELFINDER121_LANG_FILENAME = 'elfinder-2.1.21/js/i18n/elfinder.ja.js'; // elFinder言語ファイル | |
349 | + const ELFINDER121_CSS = 'elfinder-2.1.21/css/elfinder.full.css'; // elFinder CSS | |
350 | + const ELFINDER121_OPTION_CSS = 'elfinder-2.1.21/css/theme.css'; // elFinder CSS | |
351 | +// const ELFINDER121_THEME_CSS = 'elfinder-2.1.21/theme/smoothness/jquery-ui.min.css'; // テーマファイル | |
352 | + const ELFINDER121_THEME_CSS = 'elfinder-2.1.21/theme/smoothness/jquery-ui.css'; // テーマファイル | |
343 | 353 | |
344 | 354 | const MD5_FILENAME = 'md5.js'; // MD5 |
345 | 355 | const SOCKETIO_FILENAME = 'socket.io/socket.io.js'; // socket.io |
@@ -675,6 +685,11 @@ const JQUERY_TABLEDND_FILENAME = 'jquery/tablednd/jquery.tablednd-0.9.2.js'; | ||
675 | 685 | 'css' => array(self::ELFINDER115_THEME_CSS, self::ELFINDER115_CSS, self::ELFINDER115_OPTION_CSS), // テーマは最初に読み込む |
676 | 686 | 'version' => self::ELFINDER115_VER // elFinderバージョン |
677 | 687 | ); |
688 | + } else if (self::SELECTED_LIB_ELFINDER == self::LIB_ELFINDER121){ | |
689 | + self::$libs[self::LIB_ELFINDER] = array( 'script' => array(self::ELFINDER121_FILENAME, self::ELFINDER121_LANG_FILENAME), // elFinder v2.1.15 | |
690 | + 'css' => array(self::ELFINDER121_THEME_CSS, self::ELFINDER121_CSS, self::ELFINDER121_OPTION_CSS), // テーマは最初に読み込む | |
691 | + 'version' => self::ELFINDER121_VER // elFinderバージョン | |
692 | + ); | |
678 | 693 | } |
679 | 694 | |
680 | 695 | // WYSIWYGエディターに合わせてライブラリを設定 |
@@ -755,6 +770,7 @@ const JQUERY_TABLEDND_FILENAME = 'jquery/tablednd/jquery.tablednd-0.9.2.js'; | ||
755 | 770 | self::LIB_ELFINDER => array(self::LIB_BOOTSTRAP, self::LIB_JQUERY_UI, self::LIB_JQUERY_UI_WIDGETS_DIALOG, self::LIB_JQUERY_UI_WIDGETS_SLIDER), // 画像リサイズが実行できないバグの対応。jQuery UIよりも前にBootstrapを読ませる必要がある。(2015/1/25) |
756 | 771 | self::LIB_ELFINDER112 => array(self::LIB_BOOTSTRAP, self::LIB_JQUERY_UI, self::LIB_JQUERY_UI_WIDGETS_DIALOG, self::LIB_JQUERY_UI_WIDGETS_SLIDER), // 画像リサイズが実行できないバグの対応。jQuery UIよりも前にBootstrapを読ませる必要がある。(2015/1/25) |
757 | 772 | self::LIB_ELFINDER115 => array(self::LIB_BOOTSTRAP, self::LIB_JQUERY_UI, self::LIB_JQUERY_UI_WIDGETS_DIALOG, self::LIB_JQUERY_UI_WIDGETS_SLIDER), // 画像リサイズが実行できないバグの対応。jQuery UIよりも前にBootstrapを読ませる必要がある。(2015/1/25) |
773 | + self::LIB_ELFINDER121 => array(self::LIB_BOOTSTRAP, self::LIB_JQUERY_UI, self::LIB_JQUERY_UI_WIDGETS_DIALOG, self::LIB_JQUERY_UI_WIDGETS_SLIDER), // 画像リサイズが実行できないバグの対応。jQuery UIよりも前にBootstrapを読ませる必要がある。(2015/1/25) | |
758 | 774 | self::LIB_JQUERY_TIMEPICKER => array(self::LIB_JQUERY_UI), // JQUERY_TIMEPICKERはJQUERY_UIを使用する |
759 | 775 | self::LIB_JQUERY_UPLOADFILE => array(self::LIB_JQUERY_FORM), |
760 | 776 | // self::LIB_JQUERY_UPLOADFILE4 => array(self::LIB_JQUERY_FORM), |
@@ -4872,32 +4872,35 @@ abstract class elFinderVolumeDriver { | ||
4872 | 4872 | |
4873 | 4873 | $result = false; |
4874 | 4874 | |
4875 | - // try lossless rotate | |
4876 | - if ($degree % 90 === 0 && in_array($s[2], array(IMAGETYPE_JPEG, IMAGETYPE_JPEG2000))) { | |
4877 | - $count = ($degree / 90) % 4; | |
4878 | - $exiftran = array( | |
4879 | - 1 => '-9', | |
4880 | - 2 => '-1', | |
4881 | - 3 => '-2' | |
4882 | - ); | |
4883 | - $jpegtran = array( | |
4884 | - 1 => '90', | |
4885 | - 2 => '180', | |
4886 | - 3 => '270' | |
4887 | - ); | |
4888 | - $quotedPath = escapeshellarg($path); | |
4889 | - $cmds = array( | |
4890 | - 'exiftran -i '.$exiftran[$count].' '.$path, | |
4891 | - 'jpegtran -rotate '.$jpegtran[$count].' -copy all -outfile '.$quotedPath.' '.$quotedPath | |
4892 | - ); | |
4893 | - foreach($cmds as $cmd) { | |
4894 | - if ($this->procExec($cmd) === 0) { | |
4895 | - $result = true; | |
4896 | - break; | |
4875 | + // bug fixed for magic3 by naoki. if exiftran and jpegtran command are not installed, the image is broken. | |
4876 | + if ($this->procExec('wich exiftran') === 0 && $this->procExec('wich jpegtran') === 0){ | |
4877 | + // try lossless rotate | |
4878 | + if ($degree % 90 === 0 && in_array($s[2], array(IMAGETYPE_JPEG, IMAGETYPE_JPEG2000))) { | |
4879 | + $count = ($degree / 90) % 4; | |
4880 | + $exiftran = array( | |
4881 | + 1 => '-9', | |
4882 | + 2 => '-1', | |
4883 | + 3 => '-2' | |
4884 | + ); | |
4885 | + $jpegtran = array( | |
4886 | + 1 => '90', | |
4887 | + 2 => '180', | |
4888 | + 3 => '270' | |
4889 | + ); | |
4890 | + $quotedPath = escapeshellarg($path); | |
4891 | + $cmds = array( | |
4892 | + 'exiftran -i '.$exiftran[$count].' '.$path, | |
4893 | + 'jpegtran -rotate '.$jpegtran[$count].' -copy all -outfile '.$quotedPath.' '.$quotedPath | |
4894 | + ); | |
4895 | + foreach($cmds as $cmd) { | |
4896 | + if ($this->procExec($cmd) === 0) { | |
4897 | + $result = true; | |
4898 | + break; | |
4899 | + } | |
4900 | + } | |
4901 | + if ($result) { | |
4902 | + return $path; | |
4897 | 4903 | } |
4898 | - } | |
4899 | - if ($result) { | |
4900 | - return $path; | |
4901 | 4904 | } |
4902 | 4905 | } |
4903 | 4906 |
@@ -1,12 +0,0 @@ | ||
1 | -*~ | |
2 | -._* | |
3 | -_* | |
4 | -.DS_Store | |
5 | -php-old | |
6 | -extensions | |
7 | -build | |
8 | -files2 | |
9 | -elFinderVolumeSVN.class.php | |
10 | -connector-svn.php | |
11 | -node_modules | |
12 | -connector.php |
@@ -1,28 +0,0 @@ | ||
1 | -{ | |
2 | - "name": "elfinder", | |
3 | - "authors": [ | |
4 | - "Dmitry \"dio\" Levashov <dio@std42.ru>", | |
5 | - "Troex Nevelin <troex@fury.scancode.ru>", | |
6 | - "Alexey Sukhotin <strogg@yandex.ru>", | |
7 | - "Naoki Sawada <hypweb@gmail.com>" | |
8 | - ], | |
9 | - "description": "Open-source file manager for web, written in JavaScript using jQuery and jQuery UI.", | |
10 | - "dependencies": { | |
11 | - "jquery": "1.8.0 - 3", | |
12 | - "jquery-ui": "^1.9.x" | |
13 | - }, | |
14 | - "keywords": [ | |
15 | - "filemanager", | |
16 | - "jquery", | |
17 | - "jquery-ui", | |
18 | - "javascript", | |
19 | - "php" | |
20 | - ], | |
21 | - "license": "BSD-3-Clause", | |
22 | - "homepage": "https://github.com/Studio-42/elFinder", | |
23 | - "ignore": [ | |
24 | - "**/.*", | |
25 | - "jquery", | |
26 | - "php" | |
27 | - ] | |
28 | -} |
@@ -1,39 +0,0 @@ | ||
1 | -{ | |
2 | - "name": "studio-42/elfinder", | |
3 | - "description": "File manager for web", | |
4 | - "license": "BSD-3-Clause", | |
5 | - "homepage": "http://elfinder.org", | |
6 | - "authors": [ | |
7 | - { | |
8 | - "name": "Dmitry Levashov", | |
9 | - "homepage": "http://std42.ru", | |
10 | - "email": "dio@std42.ru" | |
11 | - }, | |
12 | - { | |
13 | - "name": "Troex Nevelin", | |
14 | - "homepage": "http://std42.ru", | |
15 | - "email": "troex@fury.scancode.ru" | |
16 | - }, | |
17 | - { | |
18 | - "name": "Naoki Sawada", | |
19 | - "homepage": "http://xoops.hypweb.net", | |
20 | - "email": "hypweb@gmail.com" | |
21 | - }, | |
22 | - { | |
23 | - "name": "Community contributions", | |
24 | - "homepage": "https://github.com/Studio-42/elFinder/contributors" | |
25 | - } | |
26 | - ], | |
27 | - "require": { | |
28 | - "php": ">=5.2" | |
29 | - }, | |
30 | - "suggest": { | |
31 | - "dropbox-php/dropbox-php": "elFinder Volume driver `Dropbox` require `dropbox-php/dropbox-php`.", | |
32 | - "pear/http_oauth": "dropbox-php require `pear/http_oauth` or `PHP OAuth extension`.", | |
33 | - "barryvdh/elfinder-flysystem-driver": "VolumeDriver for elFinder to use Flysystem as a root.", | |
34 | - "nao-pon/flysystem-google-drive": "require in GoogleDrive network volume mounting." | |
35 | - }, | |
36 | - "autoload": { | |
37 | - "classmap": ["php"] | |
38 | - } | |
39 | -} |
@@ -3032,3 +3032,30 @@ embed.elfinder-quicklook-preview-audio { | ||
3032 | 3032 | rgba(0,0,0,0) 100%); |
3033 | 3033 | } |
3034 | 3034 | |
3035 | +/******************************************************************/ | |
3036 | +/* Magic3 optional configure */ | |
3037 | +/******************************************************************/ | |
3038 | +.ui-dialog { z-index: 99999 !important ;} | |
3039 | +.ui-widget { | |
3040 | +/* font-family: Verdana,Arial,sans-serif; | |
3041 | + font-size: 1.1em;*/ | |
3042 | + font-family: "Lucida Grande","Hiragino Kaku Gothic ProN",Meiryo,sans-serif; | |
3043 | + font-size: 1em; | |
3044 | +} | |
3045 | +.ui-widget input, | |
3046 | +.ui-widget select, | |
3047 | +.ui-widget textarea, | |
3048 | +.ui-widget button { | |
3049 | +/* font-family: Verdana,Arial,sans-serif; | |
3050 | + font-size: 1em;*/ | |
3051 | + font-family: "Lucida Grande","Hiragino Kaku Gothic ProN",Meiryo,sans-serif; | |
3052 | + font-size: 1em; | |
3053 | +} | |
3054 | +.ui-button:focus { outline:none !important } /* remove highlight at the dialog close box in chrome. */ | |
3055 | + | |
3056 | +/* fix input text field size with Bootstrap */ | |
3057 | +#elfinder .elfinder-button-search input { | |
3058 | + width: 202px; | |
3059 | + height: 24px; | |
3060 | +} | |
3061 | +/******************************************************************/ |