Changeset 1142769
- Timestamp:
- 04/23/2015 01:37:57 AM (11 years ago)
- Location:
- image-export/trunk
- Files:
-
- 2 added
- 7 edited
-
download.php (modified) (1 diff)
-
image-export-button.js (added)
-
image-export.js (modified) (3 diffs)
-
image-export.php (modified) (6 diffs)
-
languages/image-export-ko_KR.mo (modified) (previous)
-
languages/image-export-ko_KR.po (modified) (2 diffs)
-
languages/image-export.pot (modified) (2 diffs)
-
readme.txt (modified) (1 diff)
-
screenshot-3.png (added)
Legend:
- Unmodified
- Added
- Removed
-
image-export/trunk/download.php
r1112569 r1142769 4 4 5 5 header( 'Content-Type: application/zip' ); 6 header( 'Content-Disposition: attachment; filename=" images.zip"' );6 header( 'Content-Disposition: attachment; filename="' . $file . '"' ); 7 7 readfile( $file ); 8 8 unlink( $file ); -
image-export/trunk/image-export.js
r1112569 r1142769 1 1 (function($) { 2 2 $(document).ready(function() { 3 $('#post-query-submit').parent('div').append('<button type="button" id="ie-excute" class="button button-primary">' + message.m001 + '</button>');4 5 3 $('#ie-excute').click(function() { 6 4 var checked = $('#the-list input[type=checkbox]:checked'); … … 18 16 var params = { 19 17 action : 'ie_execute', 18 mode : 'upload', 20 19 id : valArr.join(',') 21 20 }; … … 34 33 ); 35 34 }); 35 36 $('.ie-export-post').click(function() { 37 var params = { 38 action : 'ie_execute', 39 mode : 'post', 40 id : $(this).attr("data-id") 41 }; 42 43 $.post( 44 obj.link, 45 params, 46 function(data){ 47 var ret_obj = $.parseJSON(data); 48 $('#wpbody-content .wrap').prepend(ret_obj.msg); 49 50 if (ret_obj.url != '') { 51 window.location = ret_obj.url; 52 } 53 } 54 ); 55 }); 36 56 }); 37 57 })(jQuery); -
image-export/trunk/image-export.php
r1112569 r1142769 4 4 Plugin URI: http://www.1efthander.com/category/wordpress-plugins/image-export 5 5 Description: Image Export 플러그인은 관리자가 업로드한 이미지를 선택적으로 다운로드할 수 있도록 도와줍니다. 6 Version: 1. 0.06 Version: 1.1.0 7 7 Author: 1eftHander 8 8 Author URI: http://www.1efthander.com 9 9 */ 10 10 11 define( 'IMAGE_EXPORT_VERSION', '1. 0.0' );11 define( 'IMAGE_EXPORT_VERSION', '1.1.0' ); 12 12 define( 'DOWNLOAD_PATH', dirname( __FILE__ ) ); 13 define( 'DOWNLOAD_FILE_NAME', 'images.zip' );14 13 15 14 /** 16 15 * 관리자페이지 Javascript 추가 16 * version: 1.0.0 17 * Date: 2015-03-14 17 18 */ 18 19 function ie_enqueue_scripts() { 19 20 global $current_screen; 20 if ( 'upload' != $current_screen->id ) return false;21 21 22 wp_register_script( 'image_export', plugins_url( 'image-export-min.js', __FILE__ ), false, IMAGE_EXPORT_VERSION ); 23 wp_enqueue_script( 'image_export' ); 22 switch ( $current_screen->id ) { 23 case 'upload': 24 wp_register_script( 'image_export_button', plugins_url( 'image-export-button.js', __FILE__ ), false, IMAGE_EXPORT_VERSION ); 25 wp_register_script( 'image_export', plugins_url( 'image-export.js', __FILE__ ), false, IMAGE_EXPORT_VERSION ); 26 27 wp_enqueue_script( 'image_export_button' ); 28 wp_enqueue_script( 'image_export' ); 29 break; 30 default : 31 wp_register_script( 'image_export', plugins_url( 'image-export.js', __FILE__ ), false, IMAGE_EXPORT_VERSION ); 32 wp_enqueue_script( 'image_export' ); 33 break; 34 } 35 24 36 $textdomains = array( 25 37 'm001' => __( 'Image Export', 'image-export' ), … … 34 46 /** 35 47 * 이미지 다운로드 처리 48 * version 1.0.0 49 * Date 2015-03-14 36 50 */ 37 51 function file_size_format( $file_size ) { … … 65 79 66 80 $id = $_POST['id']; 67 $ temps = explode( ',', $id );81 $mode = $_POST['mode']; 68 82 69 foreach ( $temps as $temp ) { 70 $ids[] = intval( $temp ); 83 switch ( $mode ) { 84 case 'upload': 85 $temps = explode( ',', $id ); 86 foreach ( $temps as $temp ) { 87 $ids[] = intval( $temp ); 88 } 89 90 $args = array( 91 'posts_per_page' => -1, 92 'include' => $ids, 93 'post_type' => 'attachment', 94 'post_status' => 'inherit' 95 ); 96 97 $download_file_name = 'images.zip'; 98 break; 99 default : 100 $args = array( 101 'posts_per_page' => -1, 102 'post_parent' => $id, 103 'post_type' => 'attachment', 104 'post_status' => 'inherit' 105 ); 106 $download_file_name = 'images_' . $id . '.zip'; 107 break; 71 108 } 72 73 $args = array(74 'posts_per_page' => -1,75 'include' => $ids,76 'post_type' => 'attachment',77 'post_status' => 'inherit'78 );79 109 80 110 $posts = get_posts( $args ); … … 85 115 86 116 require_once ABSPATH . 'wp-admin/includes/class-pclzip.php'; 87 $zip_file = new PclZip( DOWNLOAD_PATH . '/' . DOWNLOAD_FILE_NAME);117 $zip_file = new PclZip( DOWNLOAD_PATH . '/' . $download_file_name ); 88 118 $archive = $zip_file->create( $lists, PCLZIP_OPT_REMOVE_ALL_PATH ); 89 $file_size = file_size_format( filesize( DOWNLOAD_PATH . '/' . DOWNLOAD_FILE_NAME) );119 $file_size = file_size_format( filesize( DOWNLOAD_PATH . '/' . $download_file_name ) ); 90 120 91 if ( !empty( $archive ) ) { 92 $rets['url'] = plugins_url( 'download.php', __FILE__ ) . '?file=' . DOWNLOAD_FILE_NAME; 93 $rets['msg'] = '<div class="updated"><p><strong>' . sprintf( __( 'Image.zip file has been downloaded. Export file size : %s', 'image-export' ) . '</strong></p></div>', $file_size ); 121 if ( $posts ) { 122 if ( !empty( $archive ) ) { 123 $rets['url'] = plugins_url( 'download.php', __FILE__ ) . '?file=' . $download_file_name; 124 $rets['msg'] = '<div class="updated"><p><strong>' . sprintf( __( 'Images.zip file has been downloaded. Export file size : %s', 'image-export' ) . '</strong></p></div>', $file_size ); 125 } else { 126 $rets['msg'] = '<div class="error"><p><strong>' . __( 'Failed to create images.zip. Please contact the developer.', 'image-export' ) . '</strong></p></div>'; 127 } 94 128 } else { 95 $rets['msg'] = '<div class="error"><p><strong>' . __( ' Failed to create images.zip. Please contact the developer.', 'image-export' ) . '</strong></p></div>';129 $rets['msg'] = '<div class="error"><p><strong>' . __( 'This post, there is no image.', 'image-export' ) . '</strong></p></div>'; 96 130 } 97 131 … … 104 138 /** 105 139 * 다국어 설정 140 * version 1.0.0 141 * Date 2015-03-14 106 142 */ 107 143 function ie_textdomain() { … … 109 145 } 110 146 add_action( 'admin_init', 'ie_textdomain' ); 147 148 149 /** 150 * 포스트별 이미지 다운로드 링크 추가 151 */ 152 function ie_post_row_actions( $actions, $post ) { 153 $actions['export'] = '<a href="#" class="ie-export-post" data-id="' . $post->ID . '">' . __( 'Image Export', 'image-export' ) . '</a>'; 154 155 return $actions; 156 } 157 add_filter('post_row_actions', 'ie_post_row_actions', 10, 2); 111 158 ?> -
image-export/trunk/languages/image-export-ko_KR.po
r1112569 r1142769 4 4 "Report-Msgid-Bugs-To: \n" 5 5 "POT-Creation-Date: Sat Mar 14 2015 01:01:56 GMT+0900 (대한민국 표준시)\n" 6 "PO-Revision-Date: Sat Mar 14 2015 01:10:55GMT+0900 (대한민국 표준시)\n"6 "PO-Revision-Date: Thu Apr 23 2015 10:05:19 GMT+0900 (대한민국 표준시)\n" 7 7 "Last-Translator: mbr <lh.jhkim+mbr@gmail.com>\n" 8 8 "Language-Team: \n" … … 23 23 "X-Loco-Target-Locale: ko_KR" 24 24 25 #: ../image-export.php: 2525 #: ../image-export.php:37 ../image-export.php:153 26 26 msgid "Image Export" 27 27 msgstr "이미지 다운로드" 28 28 29 #: ../image-export.php: 2629 #: ../image-export.php:38 30 30 msgid "Please select the image you want to download." 31 31 msgstr "다운로드할 이미지를 선택하십시오." 32 32 33 #: ../image-export.php: 9333 #: ../image-export.php:124 34 34 #, php-format 35 msgid "Image .zip file has been downloaded. Export file size : %s"36 msgstr "Images.zip 파일 이 다운로드 되었습니다. 다운로드파일 크기 : %s"35 msgid "Images.zip file has been downloaded. Export file size : %s" 36 msgstr "Images.zip 파일 다운로드 완료. 파일 크기 : %s" 37 37 38 #: ../image-export.php: 9538 #: ../image-export.php:126 39 39 msgid "Failed to create images.zip. Please contact the developer." 40 40 msgstr "Images.zip 압축 실패. 개발자에게 문의하십시오." 41 42 #: ../image-export.php:129 43 msgid "This post, there is no image." 44 msgstr "이 글에는 이미지가 없습니다." -
image-export/trunk/languages/image-export.pot
r1112569 r1142769 6 6 "Report-Msgid-Bugs-To: \n" 7 7 "POT-Creation-Date: Sat Mar 14 2015 01:01:56 GMT+0900 (대한민국 표준시)\n" 8 "POT-Revision-Date: Sat Mar 14 2015 01:09:43GMT+0900 (대한민국 표준시)\n"8 "POT-Revision-Date: Thu Apr 23 2015 10:02:39 GMT+0900 (대한민국 표준시)\n" 9 9 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" 10 10 "Last-Translator: \n" … … 25 25 "X-Generator: Loco - https://localise.biz/" 26 26 27 #: ../image-export.php: 2527 #: ../image-export.php:37 ../image-export.php:153 28 28 msgid "Image Export" 29 29 msgstr "" 30 30 31 #: ../image-export.php: 2631 #: ../image-export.php:38 32 32 msgid "Please select the image you want to download." 33 33 msgstr "" 34 34 35 #: ../image-export.php: 9335 #: ../image-export.php:124 36 36 #, php-format 37 msgid "Image .zip file has been downloaded. Export file size : %s"37 msgid "Images.zip file has been downloaded. Export file size : %s" 38 38 msgstr "" 39 39 40 #: ../image-export.php: 9540 #: ../image-export.php:126 41 41 msgid "Failed to create images.zip. Please contact the developer." 42 42 msgstr "" 43 44 #: ../image-export.php:129 45 msgid "This post, there is no image." 46 msgstr "" -
image-export/trunk/readme.txt
r1112569 r1142769 22 22 1. 미디어 메뉴 버튼 추가 23 23 2. 다운로드 24 3. 포스트별 이미지 다운로드 링크 추가 24 25 25 26 == Changelog == 26 27 28 = 1.1.0 = 29 * 포스트별 이미지 다운로드 기능 추가 (Cathy Paik님 아이디어 감사합니다.) 30 27 31 = 1.0.0 = 28 32 * 배포 시작
Note: See TracChangeset
for help on using the changeset viewer.