Changeset 637987
- Timestamp:
- 12/12/2012 07:20:29 PM (13 years ago)
- Location:
- file-gallery
- Files:
-
- 135 added
- 7 edited
-
tags/1.7.6 (added)
-
tags/1.7.6/css (added)
-
tags/1.7.6/css/file-gallery-rtl.css (added)
-
tags/1.7.6/css/file-gallery.css (added)
-
tags/1.7.6/file-gallery.php (added)
-
tags/1.7.6/help (added)
-
tags/1.7.6/help/images (added)
-
tags/1.7.6/help/images/01.png (added)
-
tags/1.7.6/help/images/02.png (added)
-
tags/1.7.6/help/images/03.png (added)
-
tags/1.7.6/help/images/04.png (added)
-
tags/1.7.6/help/images/05.png (added)
-
tags/1.7.6/help/images/06.png (added)
-
tags/1.7.6/help/images/07.png (added)
-
tags/1.7.6/help/images/08.png (added)
-
tags/1.7.6/help/images/09.png (added)
-
tags/1.7.6/help/images/10.png (added)
-
tags/1.7.6/help/images/11.png (added)
-
tags/1.7.6/help/images/12.png (added)
-
tags/1.7.6/help/images/13.png (added)
-
tags/1.7.6/help/images/14.png (added)
-
tags/1.7.6/help/images/15.png (added)
-
tags/1.7.6/help/images/16.png (added)
-
tags/1.7.6/help/images/17.png (added)
-
tags/1.7.6/help/images/18.png (added)
-
tags/1.7.6/help/images/19.png (added)
-
tags/1.7.6/help/index.html (added)
-
tags/1.7.6/images (added)
-
tags/1.7.6/images/ajax-loader.gif (added)
-
tags/1.7.6/images/button-grad.png (added)
-
tags/1.7.6/images/check_all.png (added)
-
tags/1.7.6/images/check_all_gs75.png (added)
-
tags/1.7.6/images/famfamfam_silk (added)
-
tags/1.7.6/images/famfamfam_silk/arrow_refresh.png (added)
-
tags/1.7.6/images/famfamfam_silk/arrow_refresh_gs75.png (added)
-
tags/1.7.6/images/famfamfam_silk/arrow_refresh_small.png (added)
-
tags/1.7.6/images/famfamfam_silk/arrow_turn_up.png (added)
-
tags/1.7.6/images/famfamfam_silk/bullet_arrow_down.png (added)
-
tags/1.7.6/images/famfamfam_silk/bullet_arrow_up.png (added)
-
tags/1.7.6/images/famfamfam_silk/cog_edit.png (added)
-
tags/1.7.6/images/famfamfam_silk/cog_edit_gs75.png (added)
-
tags/1.7.6/images/famfamfam_silk/delete.png (added)
-
tags/1.7.6/images/famfamfam_silk/help.png (added)
-
tags/1.7.6/images/famfamfam_silk/help_gs75.png (added)
-
tags/1.7.6/images/famfamfam_silk/image_add.png (added)
-
tags/1.7.6/images/famfamfam_silk/image_delete.png (added)
-
tags/1.7.6/images/famfamfam_silk/image_delete_gs75.png (added)
-
tags/1.7.6/images/famfamfam_silk/image_edit.png (added)
-
tags/1.7.6/images/famfamfam_silk/images.png (added)
-
tags/1.7.6/images/famfamfam_silk/images_gs75.png (added)
-
tags/1.7.6/images/famfamfam_silk/link_break.png (added)
-
tags/1.7.6/images/famfamfam_silk/link_break_gs75.png (added)
-
tags/1.7.6/images/famfamfam_silk/lock_open.png (added)
-
tags/1.7.6/images/famfamfam_silk/lock_open_gs75.png (added)
-
tags/1.7.6/images/famfamfam_silk/magnifier.png (added)
-
tags/1.7.6/images/famfamfam_silk/magnifier_zoom_in.png (added)
-
tags/1.7.6/images/famfamfam_silk/pencil.png (added)
-
tags/1.7.6/images/famfamfam_silk/picture_save.png (added)
-
tags/1.7.6/images/famfamfam_silk/picture_save_gs75.png (added)
-
tags/1.7.6/images/famfamfam_silk/star_set.png (added)
-
tags/1.7.6/images/famfamfam_silk/star_unset.png (added)
-
tags/1.7.6/images/famfamfam_silk/tag_blue.png (added)
-
tags/1.7.6/images/file-gallery-logo.png (added)
-
tags/1.7.6/images/loading-big.gif (added)
-
tags/1.7.6/images/loading.gif (added)
-
tags/1.7.6/images/media-button-image.gif (added)
-
tags/1.7.6/images/media-button.png (added)
-
tags/1.7.6/images/overlay-featured.png (added)
-
tags/1.7.6/images/uncheck_all.png (added)
-
tags/1.7.6/images/uncheck_all_gs75.png (added)
-
tags/1.7.6/images/white-grad.png (added)
-
tags/1.7.6/includes (added)
-
tags/1.7.6/includes/attachments-custom-fields.php (added)
-
tags/1.7.6/includes/attachments.php (added)
-
tags/1.7.6/includes/cache.php (added)
-
tags/1.7.6/includes/functions.php (added)
-
tags/1.7.6/includes/lightboxes-support.php (added)
-
tags/1.7.6/includes/main-form.php (added)
-
tags/1.7.6/includes/main.php (added)
-
tags/1.7.6/includes/media-settings.php (added)
-
tags/1.7.6/includes/media-tags-list-table.class.php (added)
-
tags/1.7.6/includes/media-tags.php (added)
-
tags/1.7.6/includes/media-upload.php (added)
-
tags/1.7.6/includes/mime-types.php (added)
-
tags/1.7.6/includes/miscellaneous.php (added)
-
tags/1.7.6/includes/regenerate-images.php (added)
-
tags/1.7.6/includes/templating.php (added)
-
tags/1.7.6/includes/tinymce.php (added)
-
tags/1.7.6/js (added)
-
tags/1.7.6/js/file-gallery-attach.js (added)
-
tags/1.7.6/js/file-gallery-attachment_custom_fields.js (added)
-
tags/1.7.6/js/file-gallery-clear_cache.js (added)
-
tags/1.7.6/js/file-gallery-tinymce.js (added)
-
tags/1.7.6/js/file-gallery.js (added)
-
tags/1.7.6/languages (added)
-
tags/1.7.6/languages/file-gallery-ar.mo (added)
-
tags/1.7.6/languages/file-gallery-ar.po (added)
-
tags/1.7.6/languages/file-gallery-fr_FR.mo (added)
-
tags/1.7.6/languages/file-gallery-fr_FR.po (added)
-
tags/1.7.6/languages/file-gallery-he_IL.mo (added)
-
tags/1.7.6/languages/file-gallery-he_IL.po (added)
-
tags/1.7.6/languages/file-gallery-hr.mo (added)
-
tags/1.7.6/languages/file-gallery-hr.po (added)
-
tags/1.7.6/languages/file-gallery-it_IT.mo (added)
-
tags/1.7.6/languages/file-gallery-it_IT.po (added)
-
tags/1.7.6/languages/file-gallery-lt_LT.mo (added)
-
tags/1.7.6/languages/file-gallery-lt_LT.po (added)
-
tags/1.7.6/languages/file-gallery.pot (added)
-
tags/1.7.6/license.txt (added)
-
tags/1.7.6/readme.txt (added)
-
tags/1.7.6/screenshot-1.png (added)
-
tags/1.7.6/screenshot-10.png (added)
-
tags/1.7.6/screenshot-2.png (added)
-
tags/1.7.6/screenshot-3.png (added)
-
tags/1.7.6/screenshot-4.png (added)
-
tags/1.7.6/screenshot-5.png (added)
-
tags/1.7.6/screenshot-6.png (added)
-
tags/1.7.6/screenshot-7.png (added)
-
tags/1.7.6/screenshot-8.png (added)
-
tags/1.7.6/screenshot-9.png (added)
-
tags/1.7.6/templates (added)
-
tags/1.7.6/templates/columns.css (added)
-
tags/1.7.6/templates/default (added)
-
tags/1.7.6/templates/default/gallery.css (added)
-
tags/1.7.6/templates/default/gallery.php (added)
-
tags/1.7.6/templates/file-gallery (added)
-
tags/1.7.6/templates/file-gallery/gallery.css (added)
-
tags/1.7.6/templates/file-gallery/gallery.php (added)
-
tags/1.7.6/templates/list (added)
-
tags/1.7.6/templates/list/gallery.css (added)
-
tags/1.7.6/templates/list/gallery.php (added)
-
tags/1.7.6/templates/simple (added)
-
tags/1.7.6/templates/simple/gallery.css (added)
-
tags/1.7.6/templates/simple/gallery.js (added)
-
tags/1.7.6/templates/simple/gallery.php (added)
-
trunk/file-gallery.php (modified) (4 diffs)
-
trunk/includes/attachments-custom-fields.php (modified) (3 diffs)
-
trunk/includes/attachments.php (modified) (2 diffs)
-
trunk/includes/main-form.php (modified) (1 diff)
-
trunk/includes/templating.php (modified) (6 diffs)
-
trunk/js/file-gallery.js (modified) (6 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
file-gallery/trunk/file-gallery.php
r581828 r637987 3 3 Plugin Name: File Gallery 4 4 Plugin URI: http://skyphe.org/code/wordpress/file-gallery/ 5 Version: 1.7. 5.35 Version: 1.7.6 6 6 Description: "File Gallery" extends WordPress' media (attachments) capabilities by adding a new gallery shortcode handler with templating support, a new interface for attachment handling when editing posts, and much more. 7 7 Author: Bruno "Aesqe" Babic … … 32 32 */ 33 33 34 define('FILE_GALLERY_VERSION', '1.7. 5.3');34 define('FILE_GALLERY_VERSION', '1.7.6'); 35 35 define('FILE_GALLERY_DEFAULT_TEMPLATES', serialize( array('default', 'file-gallery', 'list', 'simple') ) ); 36 36 … … 999 999 "tags_from" => true, 1000 1000 "clear_cache_nonce" => wp_create_nonce('file-gallery-clear_cache'), 1001 "post_thumb_nonce" => wp_create_nonce( "set_post_thumbnail-" . $post_ID ) 1001 "post_thumb_nonce" => wp_create_nonce( "set_post_thumbnail-" . $post_ID ), 1002 "wp_version" => floatval(get_bloginfo('version')) 1002 1003 ); 1003 1004 … … 1232 1233 add_meta_box('file_gallery', __( 'File Gallery', 'file-gallery' ), 'file_gallery_content', 'page', 'normal'); 1233 1234 } 1235 1236 if( function_exists('get_taxonomies_for_attachments') ) // WP 3.5 1237 { 1238 add_meta_box( 'file_gallery_attachment_custom_fields', __('File Gallery: Attachment Custom Fields'), 'file_gallery_attachment_custom_fields_metabox', 'attachment', 'normal' ); 1239 } 1234 1240 } 1235 1241 add_action('admin_menu', 'file_gallery'); -
file-gallery/trunk/includes/attachments-custom-fields.php
r559463 r637987 7 7 function file_gallery_attachment_custom_fields_table( $attachment_id ) 8 8 { 9 if( function_exists('get_taxonomies_for_attachments') ) // WP 3.5 10 { 11 $attachment = get_post($attachment_id); 12 require_once(ABSPATH . '/wp-admin/includes/meta-boxes.php'); 13 post_custom_meta_box($attachment); 14 return; 15 } 16 9 17 $form_fields = array(); 10 18 $custom = get_post_custom($attachment_id); … … 131 139 132 140 /** 133 * Displays attachment custom fields on media editing page .141 * Displays attachment custom fields on media editing page (pre 3.5) 134 142 * 135 143 * @since 1.6.5 … … 222 230 add_filter('attachment_fields_to_save', 'file_gallery_attachment_fields_to_save', 10, 2); 223 231 232 /** 233 * Attachment meta box for WordPress >= 3.5 234 * @since 1.7.6 235 */ 236 function file_gallery_attachment_custom_fields_metabox() 237 { 238 global $post; 239 post_custom_meta_box($post); 240 } -
file-gallery/trunk/includes/attachments.php
r581828 r637987 1 1 <?php 2 3 function add_media_tag( $meta, $file, $sourceImageType ) 4 { 5 $image_file_types = apply_filters( 'wp_read_image_metadata_types', array( IMAGETYPE_JPEG, IMAGETYPE_TIFF_II, IMAGETYPE_TIFF_MM ) ); 6 7 // Check that it's an image type 8 if ( in_array( $sourceImageType, $image_file_types ) && function_exists('iptcparse') ) 9 { 10 getimagesize($file, $info); 11 12 if( isset($info['APP13']) ) 13 { 14 $iptc = iptcparse($info['APP13']); 15 16 if( isset($iptc['2#103']) && isset($iptc['2#103'][0]) ) { 17 $meta['mediatag'] = $iptc['2#103'][0]; 18 } 19 } 20 } 21 22 return $meta; 23 } 24 add_filter('wp_read_image_metadata', 'add_media_tag', 10, 3); 25 26 function add_media_tags_to_uploaded_file( $metadata, $attachment_id ) 27 { 28 if( defined('FILE_GALLERY_MEDIA_TAG_NAME') ) 29 { 30 if( isset($metadata['image_meta']['mediatag']) ) { 31 wp_set_object_terms($attachment_id, $metadata['image_meta']['mediatag'] , FILE_GALLERY_MEDIA_TAG_NAME); 32 } 33 } 34 35 return $metadata; 36 } 37 add_filter( 'wp_generate_attachment_metadata', 'add_media_tags_to_uploaded_file', 10, 2 ); 2 38 3 39 function file_gallery_check_attachment_originality() … … 321 357 <div id="attachment_data_edit_form"> 322 358 359 <?php 360 361 $imagemeta = get_post_meta( $attachment->ID, '_wp_attachment_metadata', true ); 362 363 print_r($imagemeta['image_meta']); 364 365 ?> 366 323 367 <input type="hidden" name="post_id" id="fgae_post_id" value="<?php echo $_POST['post_id']; ?>" /> 324 368 <input type="hidden" name="attachment_id" id="fgae_attachment_id" value="<?php echo $_POST['attachment_id']; ?>" /> -
file-gallery/trunk/includes/main-form.php
r559463 r637987 87 87 <option value="none"<?php if( "none" == $file_gallery_options["default_linkto"]){ ?> selected="selected"<?php } ?>><?php _e("nothing (do not link)", "file-gallery"); ?></option> 88 88 <option value="file"<?php if( "file" == $file_gallery_options["default_linkto"]){ ?> selected="selected"<?php } ?>><?php _e("file", "file-gallery"); ?></option> 89 <option value="attachment"<?php if( "attachment" == $file_gallery_options["default_linkto"]){ ?> selected="selected"<?php } ?>><?php _e("attachment page", "file-gallery"); ?></option> 89 <?php if( floatval(get_bloginfo('version')) >= 3.5 ) : ?> 90 <option value="post"<?php if( "attachment" == $file_gallery_options["default_linkto"]){ ?> selected="selected"<?php } ?>><?php _e("attachment page", "file-gallery"); ?></option> 91 <?php else: ?> 92 <option value="attachment"<?php if( "attachment" == $file_gallery_options["default_linkto"]){ ?> selected="selected"<?php } ?>><?php _e("attachment page", "file-gallery"); ?></option> 93 <?php endif; ?> 94 90 95 <option value="parent_post"<?php if( "parent_post" == $file_gallery_options["default_linkto"]){ ?> selected="selected"<?php } ?>><?php _e("parent post", "file-gallery"); ?></option> 91 96 <option value="external_url"<?php if( "external_url" == $file_gallery_options["default_external_url"]){ ?> selected="selected"<?php } ?>><?php _e("external url", "file-gallery"); ?></option> -
file-gallery/trunk/includes/templating.php
r581828 r637987 407 407 } 408 408 409 $defaults = array( 410 /* default values: */ 411 'order' => 'ASC', 412 'orderby' => '', 413 'id' => $post->ID, 414 'columns' => 3, 415 'size' => 'thumbnail', 416 'link' => 'attachment', 417 'include' => '', 418 'ids' => '', 419 'exclude' => '', 420 421 /* added by file gallery: */ 422 'template' => 'default', 423 'linkclass' => '', 424 'imageclass' => '', 425 'galleryclass' => '', 426 'rel' => 1, 427 'tags' => '', 428 'tags_from' => 'current', 429 'output_type' => 'html', 430 'output_params' => 1, // needed when outputting html 431 'attachment_ids' => '', // old alias of 'include' and 'ids' 432 'mimetype' => '', 433 'limit' => -1, 434 'offset' => -1, 435 'paginate' => 0, 436 'link_size' => 'full', 437 'include_meta' => false 438 ); 439 440 if( floatval(get_bloginfo('version')) >= 3.5 ) { 441 $defaults['link'] = 'post'; 442 } 443 409 444 // extract the defaults... 410 extract( 411 shortcode_atts( 412 array( 413 /* default values: */ 414 'order' => 'ASC', 415 'orderby' => '', 416 'id' => $post->ID, 417 'columns' => 3, 418 'size' => 'thumbnail', 419 'link' => 'attachment', 420 'include' => '', 421 'exclude' => '', 422 423 /* added by file gallery: */ 424 'template' => 'default', 425 'linkclass' => '', 426 'imageclass' => '', 427 'galleryclass' => '', 428 'rel' => 1, 429 'tags' => '', 430 'tags_from' => 'current', 431 'output_type' => 'html', 432 'output_params' => 1, // needed when outputting html 433 'attachment_ids' => '', // alias of 'include' 434 'mimetype' => '', 435 'limit' => -1, 436 'offset' => -1, 437 'paginate' => 0, 438 'link_size' => 'full', 439 'include_meta' => false 440 ) 441 , $attr) 442 ); 445 extract( shortcode_atts($defaults, $attr) ); 443 446 444 447 if( ! in_array($template, $default_templates) ) … … 517 520 $file_gallery->debug_add('pagination', compact('paginate', 'page')); 518 521 519 if( '' != $include && '' == $attachment_ids ) 520 $attachment_ids = $include; 521 522 /**/ 523 $_attachment_ids = explode(',', trim($attachment_ids, ',')); 524 $_include = explode(',', trim($include, ',')); 525 $_ids = explode(',', trim($ids, ',')); 526 527 $attachment_ids = array_merge($_attachment_ids, $_include, $_ids); 528 $attachment_ids = array_unique($attachment_ids); 529 $attachment_ids = implode(',', $attachment_ids); 530 $attachment_ids = trim($attachment_ids, ','); 531 $attachment_ids = trim($attachment_ids); 532 /**/ 533 522 534 if( ! isset( $linkto ) ) 523 535 $linkto = $link; … … 531 543 } 532 544 533 $approved_attachment_post_statuses = apply_filters('file_gallery_approved_attachment_post_statuses', array('inherit' , 'draft'));545 $approved_attachment_post_statuses = apply_filters('file_gallery_approved_attachment_post_statuses', array('inherit')); 534 546 $ignored_attachment_post_statuses = apply_filters('file_gallery_ignored_attachment_post_statuses', array('trash', 'private', 'pending', 'future')); 535 547 … … 575 587 elseif( '' != $attachment_ids ) 576 588 { 577 $attachment_ids = trim($attachment_ids, ',');578 589 $attachment_ids = explode(',', $attachment_ids); 579 $sql_limit = count($attachment_ids);590 $sql_limit = count($attachment_ids); 580 591 581 592 if( 'rand' == $orderby ) … … 584 595 $attachment_ids = implode(',', $attachment_ids); 585 596 586 if( '' == $orderby || 'rand' == $orderby )597 if( '' == $orderby || 'rand' == $orderby || $orderby == 'post__in' ) 587 598 { 588 599 $orderby = sprintf("FIELD(ID, %s)", $attachment_ids); … … 603 614 $query .= $sql_mimetype; 604 615 $query .= sprintf(" ORDER BY %s %s ", $orderby, $order); 605 616 606 617 if( true !== $paginate ) 607 618 $limit = $sql_limit; -
file-gallery/trunk/js/file-gallery.js
r559463 r637987 140 140 tinymce_gallery : function( title ) 141 141 { 142 var opt = title.replace("gallery", "") , // gets gallery options from image title143 attachment_ids = opt.match(/ attachment_ids=['"]([0-9,]+)['"]/),142 var opt = title.replace("gallery", "").replace("attachment_ids", "ids"), // gets gallery options from image title 143 attachment_ids = opt.match(/ids=['"]([0-9,]+)['"]/), 144 144 attachment_includes = opt.match(/include=['"]([0-9,]+)['"]/), 145 145 post_id = opt.match(/id=['"](\d+)['"]/), 146 size = opt.match(/ \ssize=['"]([^'"]+)['"]/i),146 size = opt.match(/(^|[\s]+)size=['"]([^'"]+)['"]/i), 147 147 linkto = opt.match(/link=['"]([^'"]+)['"]/i), 148 148 thelink = linkto ? linkto[1] : "attachment", … … 164 164 tags_from = opt.match(/tags_from=['"]([^'"]+)['"]/i); 165 165 166 if( linkto && "none" != thelink && "file" != thelink && "parent_post" != thelink ) 166 if( thelink === "attachment" && file_gallery_options.wp_version >= 3.5 ) { 167 thelink = "post"; 168 } 169 170 if( linkto && thelink !== "none" && thelink !== "file" && thelink !== "parent_post" && thelink !== "post" ) 167 171 { 168 172 external_url = decodeURIComponent(thelink); 169 173 thelink = "external_url"; 170 174 } 171 175 172 176 $("#file_gallery_postid").val( post_id ? post_id[1] : "" ); 173 177 $("#file_gallery_size").val(size ? size[1] : "thumbnail" ); … … 464 468 originals = "", 465 469 file_gallery_order = "", 466 file_gallery_orderby = ""; 470 file_gallery_orderby = "", 471 include_attribute_name = file_gallery_options.wp_version >= 3.5 ? "ids" : "include"; 467 472 468 473 if( "undefined" == typeof(internal_event) ) … … 609 614 else 610 615 tags_from = ' tags_from="all"'; 611 616 612 617 if( "" != tags ) 613 618 serial = '[gallery tags="' + tags + '"' + tags_from; 614 619 else if( "" != serial && false === file_gallery.is_all_checked() ) 615 serial = '[gallery include="' + serial + '"';620 serial = '[gallery ' + include_attribute_name + '="' + serial + '"'; 616 621 else 617 622 serial = '[gallery'; … … 2067 2072 }); 2068 2073 2069 2070 // thickbox window closed 2071 // WP >= 3.3 2072 if( "function" === typeof(jQuery.fn.on) ) 2073 { 2074 jQuery(document.body).on("tb_unload", "#TB_window", function(e) 2074 if( file_gallery_options.wp_version >= 3.5 ) 2075 { 2076 jQuery('.media-modal-close').live("click", function(e) 2075 2077 { 2076 2078 file_gallery.tinymce_deselect( true ); … … 2078 2080 }); 2079 2081 } 2080 else // WP < 3.3 2081 { 2082 jQuery('#TB_window').live("unload", function(e) 2083 { 2084 file_gallery.tinymce_deselect( true ); 2085 file_gallery.init(); 2086 }); 2082 else 2083 { 2084 // thickbox window closed 2085 // WP >= 3.3 2086 if( "function" === typeof(jQuery.fn.on) ) 2087 { 2088 jQuery(document.body).on("tb_unload", "#TB_window", function(e) 2089 { 2090 file_gallery.tinymce_deselect( true ); 2091 file_gallery.init(); 2092 }); 2093 } 2094 else // WP < 3.3 2095 { 2096 jQuery('#TB_window').live("unload", function(e) 2097 { 2098 file_gallery.tinymce_deselect( true ); 2099 file_gallery.init(); 2100 }); 2101 } 2087 2102 } 2088 2103 } -
file-gallery/trunk/readme.txt
r581828 r637987 4 4 Tags: attachment, attachments, gallery, galleries, template, templates, shortcode, file, files, attach, detach, unattach, copy, media, tags, library, custom, custom fields, custom fields for attachments, attachment custom fields, drag drop upload 5 5 Requires at least: 3.1 6 Tested up to: 3.5 -alpha-214197 Stable tag: 1.7. 5.36 Tested up to: 3.5 7 Stable tag: 1.7.6 8 8 9 9 File Gallery extends WordPress media (attachments) capabilities … … 159 159 160 160 == Changelog == 161 162 = 1.7.6 = 163 * December 12th, 2012 164 * support for WordPress 3.5: 165 - "ids" instead of "includes" in gallery shortcode; 166 - attachment custom fields on single media item page; 167 - some minor compatibility corrections and adjustments 161 168 162 169 = 1.7.5.3 =
Note: See TracChangeset
for help on using the changeset viewer.