Media Library Assistant - Version 1.94

Version Description

  • New: An example that shows how to replace the wp_list_categories() item count with an accurate, padded count of the attachments assigned to each term has been added to the /media-library-assistant/examples/twentytwelve-mla directory. The example comprises the "page-tosca30-dropdown.php" and "content-tosca30-dropdown.php" files.
  • New: For the [mla_tag_cloud] shortcode, new current_item and current_item_class parameters allow you to specify the current or selected term in the cloud and add a class attribute to it.
  • New: For the [mla_tag_cloud] shortcode, when item-specific clouds are created with the ids parameter, the term counts reflect only the items in the ids list.
  • Fix: CSS Styles for the Media Manager year/month filter, taxonomy term filter, Search Media button adn Terms Search Button have been improved.
  • Fix: A shortcode-processing defect in WordPress 4.0 is avoided by adding a "no_texturize_shortcodes" filter to the [mla_gallery] and [mla_tag_cloud] shortcodes.
  • Fix: For the [mla_gallery] shortcode, a defect in expanding request: and query: arguments in pagination parameters has been fixed.
  • Fix: A defect in the Media Manager/Media Grid enhancements has been corrected. The defect caused changes to the MIME type, Year/Month and Terms controls on the toolbar to be ignored when the MLA Enhanced Search Box was disabled.
  • Fix: A defect in the Media Manager/Media Grid enhancements has been corrected. The defect caused changes to the Title, Caption, ALT Text and Description fields in the Attachment Details pane to be ignored.
  • Fix: The number of "where-used" SQL queries required to compose the Media/Assistant submenu table has been reduced significantly. For example, a table with 100 items has been reduced from 282 queries to 67, and a table with 621 items has been reduced from 2,722 queries to 241.
  • Fix: An occasional PHP notice in the posts_join filter has been removed.
Download this release

Release Info

Developer dglingren
Plugin Icon 128x128 Media Library Assistant
Version 1.94
Comparing to
See all releases

Code changes from version 1.93 to 1.94

css/mla-media-modal-style.css CHANGED
@@ -11,7 +11,6 @@
11
  overflow: visible;
12
  }
13
 
14
- /* .media-toolbar-primary, */
15
  .media-toolbar-secondary {
16
  width: 50%;
17
  }
@@ -20,7 +19,6 @@
20
  .mla-search-options {
21
  list-style: none;
22
  padding: 0;
23
- margin: 0 0 10px;
24
  }
25
 
26
  .mla-search-options > li {
@@ -34,6 +32,15 @@
34
  /**
35
  * Media Toolbar Controls
36
  */
 
 
 
 
 
 
 
 
 
37
  .mode-grid.media-frame .media-toolbar .select-mode-toggle-button,
38
  .mode-grid.media-frame .media-toolbar input#mla-terms-search {
39
  vertical-align:middle;
@@ -58,10 +65,6 @@
58
  * Checkbox-style taxonomy meta box
59
  */
60
 
61
- /* .media-modal.mla-expanded .media-toolbar { right: 612px; } */
62
- /* .media-modal.mla-expanded .attachments { right: 612px; } */
63
- /* .media-modal.mla-expanded .media-sidebar { 6px; min-width: 600px; } */
64
-
65
  .media-modal .media-toolbar {
66
  right: 312px;
67
  }
11
  overflow: visible;
12
  }
13
 
 
14
  .media-toolbar-secondary {
15
  width: 50%;
16
  }
19
  .mla-search-options {
20
  list-style: none;
21
  padding: 0;
 
22
  }
23
 
24
  .mla-search-options > li {
32
  /**
33
  * Media Toolbar Controls
34
  */
35
+ .media-modal-content #mla-terms-search,
36
+ .media-modal-content #mla-search-submit {
37
+ height: 26px;
38
+ line-height:normal;
39
+ margin-top: 11px;
40
+ position: static;
41
+ width:auto
42
+ }
43
+
44
  .mode-grid.media-frame .media-toolbar .select-mode-toggle-button,
45
  .mode-grid.media-frame .media-toolbar input#mla-terms-search {
46
  vertical-align:middle;
65
  * Checkbox-style taxonomy meta box
66
  */
67
 
 
 
 
 
68
  .media-modal .media-toolbar {
69
  right: 312px;
70
  }
examples/mla-child-term-hooks-example.php.txt CHANGED
@@ -5,7 +5,7 @@
5
  * In this example, a term slug within a hiearchical taxonomy (default "galleries" in
6
  * "attachment_category") is given. Each immediate child term is used to select one image
7
  * assigned to that term, and the selected images are displayed in a gallery. The links
8
- * for each galery item go to a separate page that displays a gallery of all images assigned
9
  * to the term.
10
  *
11
  * This example plugin uses three of the many filters available in the [mla_gallery] shortcode
5
  * In this example, a term slug within a hiearchical taxonomy (default "galleries" in
6
  * "attachment_category") is given. Each immediate child term is used to select one image
7
  * assigned to that term, and the selected images are displayed in a gallery. The links
8
+ * for each gallery item go to a separate page that displays a gallery of all images assigned
9
  * to the term.
10
  *
11
  * This example plugin uses three of the many filters available in the [mla_gallery] shortcode
examples/twentytwelve-mla/content-tosca30-dropdown.php ADDED
@@ -0,0 +1,120 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The template used for displaying "Tosca30 Dropdown" content in page-tosca30-dropdown.php
4
+ *
5
+ * Replaces the wp_list_categories() item count with an accurate, padded count of the
6
+ * attachments assigned to each term.
7
+ *
8
+ * @package Media Library Assistant
9
+ * @subpackage MLA_Child_Theme
10
+ * @version 1.00
11
+ * @since MLA 1.80
12
+ */
13
+
14
+ /**
15
+ * Harmless declaration to suppress phpDocumentor "No page-level DocBlock" error
16
+ *
17
+ * @global $post
18
+ */
19
+ global $post;
20
+ ?>
21
+
22
+ <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
23
+ <header class="entry-header">
24
+ <?php the_post_thumbnail(); ?>
25
+ <h1 class="entry-title">
26
+ <?php the_title(); ?>
27
+ </h1>
28
+ </header>
29
+ <div class="entry-content">
30
+ <?php the_content(); ?>
31
+ <?php
32
+ /**
33
+ * Class MNA_Pad_Counts_Walker adds accurate, padded attachment counts to taxonomy terms.
34
+ *
35
+ * Class Walker is defined in /wp-includes/class-wp-walker.php
36
+ * Class Walker_Category is defined in /wp-includes/category-template.php
37
+ */
38
+ class MNA_Pad_Counts_Walker extends Walker_Category {
39
+ /**
40
+ * MLA Terms
41
+ *
42
+ * @var array
43
+ */
44
+ private $mla_terms = array();
45
+
46
+ /**
47
+ * Constructor - set the MLA Terms.
48
+ *
49
+ * @param string Taxonomy name/slug.
50
+ */
51
+ function __construct( $taxonomy ) {
52
+ $attr = array (
53
+ 'taxonomy' => $taxonomy,
54
+ 'pad_counts' => 'true',
55
+ );
56
+ $terms = MLAShortcodes::mla_get_terms( $attr );
57
+ unset( $terms['found_rows'] );
58
+
59
+ foreach ( $terms as $term ) {
60
+ $this->mla_terms[ $term->term_taxonomy_id ] = $term->count;
61
+ }
62
+ }
63
+
64
+ /**
65
+ * Start the element output.
66
+ *
67
+ * @see Walker::start_el()
68
+ *
69
+ * @param string Passed by reference. Used to append additional content.
70
+ * @param object Taxonomy data object.
71
+ * @param int Depth of category in reference to parents. Default 0.
72
+ * @param array An array of arguments. @see wp_list_categories()
73
+ * @param int ID of the current category.
74
+ */
75
+ function start_el( &$output, $taxonomy_object, $depth = 0, $args = array(), $id = 0 ) {
76
+
77
+ if ( isset( $this->mla_terms[ $taxonomy_object->term_taxonomy_id ] ) ) {
78
+ $taxonomy_object->count = $this->mla_terms[ $taxonomy_object->term_taxonomy_id ];
79
+ }
80
+
81
+ parent::start_el( $output, $taxonomy_object, $depth, $args, $id );
82
+ }
83
+ }// Class MNA_Pad_Counts_Walker
84
+
85
+ $taxonomies = get_object_taxonomies( 'attachment', 'objects' );
86
+
87
+ foreach ( $taxonomies as $taxonomy ) {
88
+ echo '<h3>' . $taxonomy->labels->name . '</h3>';
89
+
90
+ unset( $checklist_walker );
91
+ $checklist_walker = new MNA_Pad_Counts_Walker( $taxonomy->name );
92
+ $args = array(
93
+ 'taxonomy' => $taxonomy->name,
94
+ 'hierarchical' => 1,
95
+ 'hide_empty' => 0,
96
+ 'pad_counts' => 1,
97
+ 'show_count' => 1,
98
+ 'title_li' => '',
99
+ 'walker' => $checklist_walker,
100
+ );
101
+
102
+ echo '<h4>wp_list_categories</h4>';
103
+ wp_list_categories( $args );
104
+
105
+ echo '<h4>mla_tag_cloud</h4>';
106
+ echo '<table><tr><td>pad_counts=false<br>';
107
+ echo do_shortcode( "[mla_tag_cloud taxonomy={$taxonomy->name} mla_output=list pad_counts=false]" );
108
+ echo '</td><td>pad_counts=true<br>';
109
+ echo do_shortcode( "[mla_tag_cloud taxonomy={$taxonomy->name} mla_output=list pad_counts=true]" );
110
+ echo '</td></tr></table>';
111
+ }
112
+
113
+ ?>
114
+ </div><!-- .entry-content -->
115
+ <footer class="entry-meta">
116
+ <?php edit_post_link( __( 'Edit', 'twentytwelve' ), '<span class="edit-link">', '</span>' ); ?>
117
+ </footer>
118
+ <!-- .entry-meta -->
119
+ </article>
120
+ <!-- #post -->
examples/twentytwelve-mla/page-tosca30-dropdown.php ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The template for displaying the "Tosca30 Dropdown" page, which
4
+ * must be defined as a static WordPress "Page" post type.
5
+ *
6
+ * Please note that this is the WordPress construct of pages
7
+ * and that other 'pages' on your WordPress site will use a
8
+ * different template.
9
+ *
10
+ * @package Media Library Assistant
11
+ * @subpackage MLA_Child_Theme
12
+ * @version 1.00
13
+ * @since MLA 1.80
14
+ */
15
+
16
+ get_header(); ?>
17
+
18
+ <div id="primary" class="site-content">
19
+ <div id="content" role="main">
20
+
21
+ <?php while ( have_posts() ) : the_post(); ?>
22
+ <?php get_template_part( 'content', 'tosca30-dropdown' ); ?>
23
+ <?php comments_template( '', true ); ?>
24
+ <?php endwhile; // end of the loop. ?>
25
+
26
+ </div><!-- #content -->
27
+ </div><!-- #primary -->
28
+
29
+ <?php //get_sidebar(); ?>
30
+ <?php get_footer(); ?>
includes/class-mla-data.php CHANGED
@@ -1189,13 +1189,13 @@ class MLAData {
1189
  foreach ( $meta_data as $meta_key => $meta_value ) {
1190
  $attachments[ $index ]->$meta_key = $meta_value;
1191
  }
1192
- /*
1193
- * Add references
1194
- */
1195
- $references = self::mla_fetch_attachment_references( $attachment->ID, $attachment->post_parent );
1196
- $attachments[ $index ]->mla_references = $references;
1197
  }
1198
 
 
 
 
 
 
1199
  return $attachments;
1200
  }
1201
 
@@ -1854,8 +1854,7 @@ class MLAData {
1854
  } else {
1855
  $tax_terms = array();
1856
  $tax_counts = array();
1857
- $wp_4dot0_plus = version_compare( get_bloginfo('version'), '3.10', '>=' ); // during beta
1858
- // $wp_4dot0_plus = version_compare( get_bloginfo('version'), '4.0', '>=' ); // after release
1859
  foreach ( $terms_search as $term ) {
1860
  if ( $wp_4dot0_plus ) {
1861
  $sql_term = $percent . $wpdb->esc_like( $term ) . $percent;
@@ -2735,8 +2734,7 @@ class MLAData {
2735
  $inserted_in_option = MLAOptions::mla_get_option( MLAOptions::MLA_INSERTED_IN_TUNING );
2736
  }
2737
 
2738
- $wp_4dot0_plus = version_compare( get_bloginfo('version'), '3.10', '>=' ); // during beta
2739
- // $wp_4dot0_plus = version_compare( get_bloginfo('version'), '4.0', '>=' ); // after release
2740
  if ( 'base' == $inserted_in_option ) {
2741
  $query_parameters = array();
2742
  $query = array();
@@ -2885,6 +2883,340 @@ class MLAData {
2885
  return $references;
2886
  }
2887
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2888
  /**
2889
  * Objects containing [gallery] shortcodes
2890
  *
@@ -3007,8 +3339,7 @@ class MLAData {
3007
  $exclude_revisions = '';
3008
  }
3009
 
3010
- $wp_4dot0_plus = version_compare( get_bloginfo('version'), '3.10', '>=' ); // during beta
3011
- // $wp_4dot0_plus = version_compare( get_bloginfo('version'), '4.0', '>=' ); // after release
3012
  if ( $wp_4dot0_plus ) {
3013
  $like = $wpdb->esc_like( $shortcode );
3014
  } else {
@@ -3053,7 +3384,7 @@ class MLAData {
3053
  $galleries_array[ $result_id ]['galleries'][ $instance ]['query'] = trim( rtrim( $matches[1][$index], '/' ) );
3054
  $galleries_array[ $result_id ]['galleries'][ $instance ]['results'] = array();
3055
  $post = $result; // set global variable for mla_gallery_shortcode
3056
- $attachments = MLAShortcodes::mla_get_shortcode_attachments( $result_id, $galleries_array[ $result_id ]['galleries'][ $instance ]['query'] . ' where_used_query=this-is-a-where-used-query' );
3057
 
3058
  if ( is_string( $attachments ) ) {
3059
  /* translators: 1: post_type, 2: post_title, 3: post ID, 4: query string, 5: error message */
@@ -5539,7 +5870,7 @@ class MLAData {
5539
  * Uncomment this for debugging.
5540
  */
5541
  // $final_message .= '<br>' . $message;
5542
- // error_log( 'DEBUG: mla_update_single_item message = ' . var_export( $message, true ), 0 );
5543
 
5544
  return array(
5545
  'message' => $final_message,
1189
  foreach ( $meta_data as $meta_key => $meta_value ) {
1190
  $attachments[ $index ]->$meta_key = $meta_value;
1191
  }
 
 
 
 
 
1192
  }
1193
 
1194
+ /*
1195
+ * Add references
1196
+ */
1197
+ self::mla_attachment_array_fetch_references( $attachments );
1198
+
1199
  return $attachments;
1200
  }
1201
 
1854
  } else {
1855
  $tax_terms = array();
1856
  $tax_counts = array();
1857
+ $wp_4dot0_plus = version_compare( get_bloginfo('version'), '4.0', '>=' );
 
1858
  foreach ( $terms_search as $term ) {
1859
  if ( $wp_4dot0_plus ) {
1860
  $sql_term = $percent . $wpdb->esc_like( $term ) . $percent;
2734
  $inserted_in_option = MLAOptions::mla_get_option( MLAOptions::MLA_INSERTED_IN_TUNING );
2735
  }
2736
 
2737
+ $wp_4dot0_plus = version_compare( get_bloginfo('version'), '4.0', '>=' );
 
2738
  if ( 'base' == $inserted_in_option ) {
2739
  $query_parameters = array();
2740
  $query = array();
2883
  return $references;
2884
  }
2885
 
2886
+ /**
2887
+ * Add Featured Image and inserted image/link references to an array of attachments
2888
+ *
2889
+ * Searches all post and page content to see if the attachmenta are used
2890
+ * as a Featured Image or inserted in the post as an image or link.
2891
+ *
2892
+ * @since 1.94
2893
+ *
2894
+ * @param array WP_Post objects, passed by reference
2895
+ *
2896
+ * @return void updates WP_Post objects with new mla_references property
2897
+ */
2898
+ public static function mla_attachment_array_fetch_references( &$attachments ) {
2899
+ global $wpdb;
2900
+
2901
+ /*
2902
+ * See element definitions above
2903
+ */
2904
+ $initial_references = array(
2905
+ 'tested_reference' => false,
2906
+ 'found_reference' => false,
2907
+ 'found_parent' => false,
2908
+ 'is_unattached' => true,
2909
+ 'base_file' => '',
2910
+ 'path' => '',
2911
+ 'file' => '',
2912
+ 'files' => array(),
2913
+ 'features' => array(),
2914
+ 'inserts' => array(),
2915
+ 'mla_galleries' => array(),
2916
+ 'galleries' => array(),
2917
+ 'parent_type' => '',
2918
+ 'parent_title' => '',
2919
+ 'parent_errors' => ''
2920
+ );
2921
+
2922
+ /*
2923
+ * Collect the raw data for where-used analysis
2924
+ */
2925
+ $attachment_ids = array();
2926
+ $files = array();
2927
+ foreach ( $attachments as $index => $attachment ) {
2928
+ $attachment_ids[ $index ] = $attachment->ID;
2929
+ $references = array();
2930
+ if ( isset( $attachment->mla_wp_attached_file ) ) {
2931
+ $references['base_file'] = $attachment->mla_wp_attached_file;
2932
+ $references['files'][ $references['base_file'] ] = array( 'file' => $references['base_file'] );
2933
+ } else {
2934
+ $references['base_file'] = '';
2935
+ }
2936
+
2937
+ $pathinfo = pathinfo($references['base_file']);
2938
+ $references['file'] = $pathinfo['basename'];
2939
+ if ( ( ! isset( $pathinfo['dirname'] ) ) || '.' == $pathinfo['dirname'] ) {
2940
+ $references['path'] = '/';
2941
+ } else {
2942
+ $references['path'] = $pathinfo['dirname'] . '/';
2943
+ }
2944
+
2945
+ if ( isset( $attachment->mla_wp_attachment_metadata ) ) {
2946
+ $attachment_metadata = $attachment->mla_wp_attachment_metadata;
2947
+ } else {
2948
+ $attachment_metadata = '';
2949
+ }
2950
+
2951
+ $sizes = isset( $attachment_metadata['sizes'] ) ? $attachment_metadata['sizes'] : NULL;
2952
+ if ( ! empty( $sizes ) ) {
2953
+ /* Using the path and name as the array key ensures each name is added only once */
2954
+ foreach ( $sizes as $size ) {
2955
+ $references['files'][ $references['path'] . $size['file'] ] = $size;
2956
+ }
2957
+ }
2958
+
2959
+ $files[ $index ] = $references;
2960
+ }
2961
+
2962
+ if ('checked' == MLAOptions::mla_get_option( MLAOptions::MLA_EXCLUDE_REVISIONS ) ) {
2963
+ $exclude_revisions = " AND (p.post_type <> 'revision')";
2964
+ } else {
2965
+ $exclude_revisions = '';
2966
+ }
2967
+
2968
+ $features = array();
2969
+ if ( MLAOptions::$process_featured_in && ! empty( $attachment_ids ) ) {
2970
+ $attachment_ids = implode( ',', $attachment_ids );
2971
+ $results = $wpdb->get_results(
2972
+ "
2973
+ SELECT m.meta_value, p.ID, p.post_type, p.post_title
2974
+ FROM {$wpdb->postmeta} AS m INNER JOIN {$wpdb->posts} AS p ON m.post_id = p.ID
2975
+ WHERE ( m.meta_key = '_thumbnail_id' )
2976
+ AND ( m.meta_value IN ( {$attachment_ids} ) ){$exclude_revisions}
2977
+ "
2978
+ );
2979
+
2980
+ foreach ( $results as $result ) {
2981
+ $features[ $result->meta_value ][ $result->ID ] = (object) array( 'post_title' => $result->post_title, 'post_type' => $result->post_type );
2982
+ }
2983
+ } // $process_featured_in
2984
+
2985
+ if ( ! empty( $exclude_revisions ) ) {
2986
+ $exclude_revisions = " AND (post_type <> 'revision')";
2987
+ }
2988
+
2989
+ $inserted_in_option = MLAOptions::mla_get_option( MLAOptions::MLA_INSERTED_IN_TUNING );
2990
+ if ( MLAOptions::$process_inserted_in ) {
2991
+ $wp_4dot0_plus = version_compare( get_bloginfo('version'), '4.0', '>=' );
2992
+ $query_parameters = array();
2993
+ $query = array();
2994
+ $query[] = "SELECT ID, post_type, post_title, CONVERT(`post_content` USING utf8 ) AS POST_CONTENT FROM {$wpdb->posts} WHERE ( %s=%s";
2995
+ // for empty file name array
2996
+ $query_parameters[] = '1';
2997
+ $query_parameters[] = '0';
2998
+
2999
+ foreach ( $files as $file ) {
3000
+ foreach ( $file['files'] as $base_name => $file_data ) {
3001
+ $query[] = 'OR ( POST_CONTENT LIKE %s)';
3002
+
3003
+ if ( $wp_4dot0_plus ) {
3004
+ $query_parameters[] = '%' . $wpdb->esc_like( $base_name ) . '%';
3005
+ } else {
3006
+ $query_parameters[] = '%' . like_escape( $base_name ) . '%';
3007
+ }
3008
+ }
3009
+ }
3010
+
3011
+ $query[] = "){$exclude_revisions}";
3012
+ $query = join(' ', $query);
3013
+
3014
+ $results = $wpdb->get_results(
3015
+ $wpdb->prepare( $query, $query_parameters )
3016
+ );
3017
+
3018
+ /*
3019
+ * Match each post with inserts back to the attachments
3020
+ */
3021
+ $inserts = array();
3022
+ if ( ! empty( $results ) ) {
3023
+ foreach ( $files as $index => $file ) {
3024
+ foreach ( $file['files'] as $base_name => $file_data ) {
3025
+ foreach ( $results as $result ) {
3026
+ if ( false !== strpos( $result->POST_CONTENT, $base_name ) ) {
3027
+ $insert = clone $result;
3028
+ unset( $insert->POST_CONTENT);
3029
+ $insert->file_name = $file_data['file'];
3030
+ $inserts[ $index ][] = $insert;
3031
+ }
3032
+ } // foreach post with inserts
3033
+ } // foreach base_name
3034
+ } // foreach attachment
3035
+ } // results
3036
+ } // process_inserted_in
3037
+
3038
+ if ( MLAOptions::$process_mla_gallery_in ) {
3039
+ $have_mla_galleries = self::_build_mla_galleries( MLAOptions::MLA_MLA_GALLERY_IN_TUNING, self::$mla_galleries, '[mla_gallery', $exclude_revisions );
3040
+ } else {
3041
+ $have_mla_galleries = false;
3042
+ }
3043
+
3044
+ if ( MLAOptions::$process_gallery_in ) {
3045
+ $have_galleries = self::_build_mla_galleries( MLAOptions::MLA_GALLERY_IN_TUNING, self::$galleries, '[gallery', $exclude_revisions );
3046
+ } else {
3047
+ $have_mla_galleries = false;
3048
+ }
3049
+
3050
+ foreach ( $attachments as $attachment_index => $attachment ) {
3051
+ $references = $initial_references;
3052
+
3053
+ /*
3054
+ * Fill in Parent data
3055
+ */
3056
+ if ( ( (int) $attachment->post_parent ) === 0 ) {
3057
+ $references['is_unattached'] = true;
3058
+ } else {
3059
+ $references['is_unattached'] = false;
3060
+
3061
+ if ( isset( $attachment->parent_type ) ) {
3062
+ $references['parent_type'] = $attachment->parent_type;
3063
+ }
3064
+
3065
+ if ( isset( $attachment->parent_title ) ) {
3066
+ $references['parent_title'] = $attachment->parent_title;
3067
+ }
3068
+ }
3069
+
3070
+ if ( isset( $attachment->mla_wp_attached_file ) ) {
3071
+ $references['base_file'] = $attachment->mla_wp_attached_file;
3072
+ $references['files'][ $references['base_file'] ] = $references['base_file'];
3073
+ } else {
3074
+ $references['base_file'] = '';
3075
+ }
3076
+
3077
+ $pathinfo = pathinfo($references['base_file']);
3078
+ $references['file'] = $pathinfo['basename'];
3079
+ if ( ( ! isset( $pathinfo['dirname'] ) ) || '.' == $pathinfo['dirname'] ) {
3080
+ $references['path'] = '/';
3081
+ } else {
3082
+ $references['path'] = $pathinfo['dirname'] . '/';
3083
+ }
3084
+
3085
+ if ( isset( $attachment->mla_wp_attachment_metadata ) ) {
3086
+ $attachment_metadata = $attachment->mla_wp_attachment_metadata;
3087
+ } else {
3088
+ $attachment_metadata = '';
3089
+ }
3090
+
3091
+ $sizes = isset( $attachment_metadata['sizes'] ) ? $attachment_metadata['sizes'] : NULL;
3092
+ if ( ! empty( $sizes ) ) {
3093
+ /* Using the path and name as the array key ensures each name is added only once */
3094
+ foreach ( $sizes as $size ) {
3095
+ $references['files'][ $references['path'] . $size['file'] ] = $size;
3096
+ }
3097
+ }
3098
+
3099
+ /*
3100
+ * Accumulate reference test types, e.g., 0 = no tests, 4 = all tests
3101
+ */
3102
+ $reference_tests = 0;
3103
+
3104
+ /*
3105
+ * Look for the "Featured Image(s)", if enabled
3106
+ */
3107
+ if ( MLAOptions::$process_featured_in ) {
3108
+ $reference_tests++;
3109
+ if ( isset( $features[ $attachment->ID ] ) ) {
3110
+ foreach ( $features[ $attachment->ID ] as $id => $feature ) {
3111
+ $references['found_reference'] = true;
3112
+ $references['features'][ $id ] = $feature;
3113
+
3114
+ if ( $id == $attachment->post_parent ) {
3115
+ $references['found_parent'] = true;
3116
+ }
3117
+ } // foreach $feature
3118
+ }
3119
+ } // $process_featured_in
3120
+
3121
+ /*
3122
+ * Look for item(s) inserted in post_content
3123
+ */
3124
+ if ( MLAOptions::$process_inserted_in ) {
3125
+ $reference_tests++;
3126
+
3127
+ if ( isset( $inserts[ $attachment_index ] ) ) {
3128
+ foreach( $inserts[ $attachment_index ] as $insert ) {
3129
+ $ref_insert = clone $insert;
3130
+ unset( $ref_insert->file_name );
3131
+
3132
+ if ( 'base' == $inserted_in_option ) {
3133
+ $ref_key = pathinfo( $references['base_file'], PATHINFO_FILENAME );
3134
+ } else {
3135
+ $ref_key = $insert->file_name;
3136
+ }
3137
+
3138
+ $references['inserts'][ $ref_key ][ $insert->ID ] = $ref_insert;
3139
+ } // each insert
3140
+ } else {
3141
+ $references['inserts'] = array();
3142
+ }
3143
+ } // $process_inserted_in
3144
+
3145
+ /*
3146
+ * Look for [mla_gallery] references
3147
+ */
3148
+ if ( MLAOptions::$process_mla_gallery_in ) {
3149
+ $reference_tests++;
3150
+ if ( self::_build_mla_galleries( MLAOptions::MLA_MLA_GALLERY_IN_TUNING, self::$mla_galleries, '[mla_gallery', $exclude_revisions ) ) {
3151
+ $galleries = self::_search_mla_galleries( self::$mla_galleries, $attachment->ID );
3152
+ if ( ! empty( $galleries ) ) {
3153
+ $references['found_reference'] = true;
3154
+ $references['mla_galleries'] = $galleries;
3155
+
3156
+ foreach ( $galleries as $post_id => $gallery ) {
3157
+ if ( $post_id == $attachment->post_parent ) {
3158
+ $references['found_parent'] = true;
3159
+ }
3160
+ } // foreach $gallery
3161
+ } else { // ! empty
3162
+ $references['mla_galleries'] = array();
3163
+ }
3164
+ }
3165
+ } // $process_mla_gallery_in
3166
+
3167
+ /*
3168
+ * Look for [gallery] references
3169
+ */
3170
+ if ( MLAOptions::$process_gallery_in ) {
3171
+ $reference_tests++;
3172
+ if ( self::_build_mla_galleries( MLAOptions::MLA_GALLERY_IN_TUNING, self::$galleries, '[gallery', $exclude_revisions ) ) {
3173
+ $galleries = self::_search_mla_galleries( self::$galleries, $attachment->ID );
3174
+ if ( ! empty( $galleries ) ) {
3175
+ $references['found_reference'] = true;
3176
+ $references['galleries'] = $galleries;
3177
+
3178
+ foreach ( $galleries as $post_id => $gallery ) {
3179
+ if ( $post_id == $attachment->post_parent ) {
3180
+ $references['found_parent'] = true;
3181
+ }
3182
+ } // foreach $gallery
3183
+ } else { // ! empty
3184
+ $references['galleries'] = array();
3185
+ }
3186
+ }
3187
+ } // $process_gallery_in
3188
+
3189
+ /*
3190
+ * Evaluate and summarize reference tests
3191
+ */
3192
+ $errors = '';
3193
+ if ( 0 == $reference_tests ) {
3194
+ $references['tested_reference'] = false;
3195
+ $errors .= '(' . __( 'NO REFERENCE TESTS', 'media-library-assistant' ) . ')';
3196
+ } else {
3197
+ $references['tested_reference'] = true;
3198
+ $suffix = ( 4 == $reference_tests ) ? '' : '?';
3199
+
3200
+ if ( !$references['found_reference'] ) {
3201
+ $errors .= '(' . sprintf( __( 'ORPHAN', 'media-library-assistant' ) . '%1$s) ', $suffix );
3202
+ }
3203
+
3204
+ if ( !$references['found_parent'] && ! empty( $references['parent_title'] ) ) {
3205
+ $errors .= '(' . sprintf( __( 'UNUSED', 'media-library-assistant' ) . '%1$s) ', $suffix );
3206
+ }
3207
+ }
3208
+
3209
+ if ( $references['is_unattached'] ) {
3210
+ $errors .= '(' . __( 'UNATTACHED', 'media-library-assistant' ) . ')';
3211
+ } elseif ( empty( $references['parent_title'] ) ) {
3212
+ $errors .= '(' . __( 'INVALID PARENT', 'media-library-assistant' ) . ')';
3213
+ }
3214
+
3215
+ $references['parent_errors'] = trim( $errors );
3216
+ $attachments[ $attachment_index ]->mla_references = $references;
3217
+ } // foreach $attachment
3218
+ }
3219
+
3220
  /**
3221
  * Objects containing [gallery] shortcodes
3222
  *
3339
  $exclude_revisions = '';
3340
  }
3341
 
3342
+ $wp_4dot0_plus = version_compare( get_bloginfo('version'), '4.0', '>=' );
 
3343
  if ( $wp_4dot0_plus ) {
3344
  $like = $wpdb->esc_like( $shortcode );
3345
  } else {
3384
  $galleries_array[ $result_id ]['galleries'][ $instance ]['query'] = trim( rtrim( $matches[1][$index], '/' ) );
3385
  $galleries_array[ $result_id ]['galleries'][ $instance ]['results'] = array();
3386
  $post = $result; // set global variable for mla_gallery_shortcode
3387
+ $attachments = MLAShortcodes::mla_get_shortcode_attachments( $result_id, $galleries_array[ $result_id ]['galleries'][ $instance ]['query'] . ' cache_results=false update_post_meta_cache=false update_post_term_cache=false where_used_query=this-is-a-where-used-query' );
3388
 
3389
  if ( is_string( $attachments ) ) {
3390
  /* translators: 1: post_type, 2: post_title, 3: post ID, 4: query string, 5: error message */
5870
  * Uncomment this for debugging.
5871
  */
5872
  // $final_message .= '<br>' . $message;
5873
+ //error_log( 'DEBUG: mla_update_single_item message = ' . var_export( $message, true ), 0 );
5874
 
5875
  return array(
5876
  'message' => $final_message,
includes/class-mla-list-table.php CHANGED
@@ -1062,12 +1062,18 @@ class MLA_List_Table extends WP_List_Table {
1062
  */
1063
  function column_alt_text( $item ) {
1064
  if ( isset( $item->mla_wp_attachment_image_alt ) ) {
 
 
 
 
 
 
1065
  return sprintf( '<a href="%1$s" title="' . __( 'Filter by', 'media-library-assistant' ) . ' &#8220;%2$s&#8221;">%3$s</a>', esc_url( add_query_arg( array_merge( self::mla_submenu_arguments( false ), array(
1066
  'page' => MLA::ADMIN_PAGE_SLUG,
1067
  'mla-metakey' => '_wp_attachment_image_alt',
1068
- 'mla-metavalue' => urlencode( $item->mla_wp_attachment_image_alt ),
1069
- 'heading_suffix' => urlencode( __( 'ALT Text', 'media-library-assistant' ) . ': ' . $item->mla_wp_attachment_image_alt )
1070
- ) ), 'upload.php' ) ), esc_html( $item->mla_wp_attachment_image_alt ), esc_html( $item->mla_wp_attachment_image_alt ) );
1071
  }
1072
 
1073
  return '';
1062
  */
1063
  function column_alt_text( $item ) {
1064
  if ( isset( $item->mla_wp_attachment_image_alt ) ) {
1065
+ if ( is_array( $item->mla_wp_attachment_image_alt ) ) {
1066
+ $alt_text = $item->mla_wp_attachment_image_alt[0];
1067
+ } else {
1068
+ $alt_text = $item->mla_wp_attachment_image_alt;
1069
+ }
1070
+
1071
  return sprintf( '<a href="%1$s" title="' . __( 'Filter by', 'media-library-assistant' ) . ' &#8220;%2$s&#8221;">%3$s</a>', esc_url( add_query_arg( array_merge( self::mla_submenu_arguments( false ), array(
1072
  'page' => MLA::ADMIN_PAGE_SLUG,
1073
  'mla-metakey' => '_wp_attachment_image_alt',
1074
+ 'mla-metavalue' => urlencode( $alt_text ),
1075
+ 'heading_suffix' => urlencode( __( 'ALT Text', 'media-library-assistant' ) . ': ' . $alt_text )
1076
+ ) ), 'upload.php' ) ), esc_html( $alt_text ), esc_html( $alt_text ) );
1077
  }
1078
 
1079
  return '';
includes/class-mla-main.php CHANGED
@@ -29,7 +29,7 @@ class MLA {
29
  *
30
  * @var string
31
  */
32
- const CURRENT_MLA_VERSION = '1.93';
33
 
34
  /**
35
  * Slug for registering and enqueueing plugin style sheet
29
  *
30
  * @var string
31
  */
32
+ const CURRENT_MLA_VERSION = '1.94';
33
 
34
  /**
35
  * Slug for registering and enqueueing plugin style sheet
includes/class-mla-shortcodes.php CHANGED
@@ -24,6 +24,33 @@ class MLAShortcodes {
24
  add_shortcode( 'mla_attachment_list', 'MLAShortcodes::mla_attachment_list_shortcode' );
25
  add_shortcode( 'mla_gallery', 'MLAShortcodes::mla_gallery_shortcode' );
26
  add_shortcode( 'mla_tag_cloud', 'MLAShortcodes::mla_tag_cloud_shortcode' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27
  }
28
 
29
  /**
@@ -552,7 +579,8 @@ class MLAShortcodes {
552
  }
553
 
554
  /*
555
- * For "previous_link", "current_link" and "next_link", discard all of the $attachments except the appropriate choice
 
556
  */
557
  if ( ! $is_gallery ) {
558
  $link_type = $output_parameters[0];
@@ -1104,6 +1132,8 @@ class MLAShortcodes {
1104
 
1105
  'echo' => false,
1106
  'link' => 'view',
 
 
1107
 
1108
  'itemtag' => 'ul',
1109
  'termtag' => 'li',
@@ -1176,6 +1206,13 @@ class MLAShortcodes {
1176
  if ( isset( $arguments[ $mla_page_parameter ] ) ) {
1177
  $arguments['offset'] = $arguments['limit'] * ( $arguments[ $mla_page_parameter ] - 1);
1178
  }
 
 
 
 
 
 
 
1179
 
1180
  $arguments = apply_filters( 'mla_tag_cloud_arguments', $arguments );
1181
 
@@ -1419,6 +1456,7 @@ class MLAShortcodes {
1419
  'mla_markup' => $arguments['mla_markup'],
1420
  'instance' => $instance,
1421
  'taxonomy' => implode( '-', $arguments['taxonomy'] ),
 
1422
  'itemtag' => tag_escape( $arguments['itemtag'] ),
1423
  'termtag' => tag_escape( $arguments['termtag'] ),
1424
  'captiontag' => tag_escape( $arguments['captiontag'] ),
@@ -1637,6 +1675,7 @@ class MLAShortcodes {
1637
  $item_values['term_group'] = $tag->term_group;
1638
  $item_values['term_taxonomy_id'] = $tag->term_taxonomy_id;
1639
  $item_values['taxonomy'] = wptexturize( $tag->taxonomy );
 
1640
  $item_values['description'] = wptexturize( $tag->description );
1641
  $item_values['parent'] = $tag->parent;
1642
  $item_values['count'] = isset ( $tag->count ) ? $tag->count : 0;
@@ -1646,8 +1685,20 @@ class MLAShortcodes {
1646
  $item_values['editlink_url'] = $tag->edit_link;
1647
  $item_values['termlink_url'] = $tag->term_link;
1648
  // Added in the code below:
1649
- // 'caption', 'link_attributes', 'rollover_text', 'link_style', 'link_text', 'editlink', 'termlink', 'thelink'
1650
 
 
 
 
 
 
 
 
 
 
 
 
 
1651
  /*
1652
  * Add item_specific field-level substitution parameters
1653
  */
@@ -2171,6 +2222,18 @@ class MLAShortcodes {
2171
  $markup_values['request_uri'] = add_query_arg( array( $mla_page_parameter => $new_page ), $_SERVER['REQUEST_URI'] );
2172
  $markup_values['new_url'] = set_url_scheme( $markup_values['scheme'] . $markup_values['http_host'] . $markup_values['request_uri'] );
2173
 
 
 
 
 
 
 
 
 
 
 
 
 
2174
  /*
2175
  * Build the new link, applying Gallery Display Content parameters
2176
  */
@@ -2271,80 +2334,111 @@ class MLAShortcodes {
2271
  *
2272
  * @since 1.20
2273
  *
2274
- * @param array Validated query parameters
 
 
 
2275
  * @return string|bool Returns the orderby clause if present, false otherwise.
2276
  */
2277
- private static function _validate_sql_orderby( $query_parameters ){
2278
  global $wpdb;
2279
 
2280
  $results = array ();
2281
  $order = isset( $query_parameters['order'] ) ? ' ' . $query_parameters['order'] : '';
2282
  $orderby = isset( $query_parameters['orderby'] ) ? $query_parameters['orderby'] : '';
2283
  $meta_key = isset( $query_parameters['meta_key'] ) ? $query_parameters['meta_key'] : '';
2284
- $post__in = isset( $query_parameters['post__in'] ) ? implode(',', array_map( 'absint', $query_parameters['post__in'] )) : '';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2285
 
2286
  if ( empty( $orderby ) ) {
2287
- $orderby = "$wpdb->posts.post_date " . $order;
 
 
 
 
2288
  } elseif ( 'none' == $orderby ) {
2289
  return '';
2290
- } elseif ( $orderby == 'post__in' && ! empty( $post__in ) ) {
2291
- $orderby = "FIELD( {$wpdb->posts}.ID, {$post__in} )";
2292
- } else {
2293
- $allowed_keys = array('ID', 'author', 'date', 'description', 'content', 'title', 'caption', 'excerpt', 'slug', 'name', 'modified', 'parent', 'menu_order', 'mime_type', 'comment_count', 'rand');
2294
- if ( ! empty( $meta_key ) ) {
2295
- $allowed_keys[] = $meta_key;
2296
- $allowed_keys[] = 'meta_value';
2297
- $allowed_keys[] = 'meta_value_num';
2298
- }
2299
-
2300
- $obmatches = preg_split('/\s*,\s*/', trim($query_parameters['orderby']));
2301
- foreach ( $obmatches as $index => $value ) {
2302
- $count = preg_match('/([a-z0-9_]+)(\s+(ASC|DESC))?/i', $value, $matches);
2303
-
2304
- if ( $count && ( $value == $matches[0] ) && in_array( $matches[1], $allowed_keys ) ) {
2305
- if ( 'rand' == $matches[1] ) {
2306
- $results[] = 'RAND()';
2307
  } else {
2308
- switch ( $matches[1] ) {
2309
- case 'ID':
2310
- $matches[1] = "$wpdb->posts.ID";
2311
- break;
2312
- case 'description':
2313
- $matches[1] = "$wpdb->posts.post_content";
2314
- break;
2315
- case 'caption':
2316
- $matches[1] = "$wpdb->posts.post_excerpt";
2317
- break;
2318
- case 'slug':
2319
- $matches[1] = "$wpdb->posts.post_name";
2320
- break;
2321
- case 'menu_order':
2322
- $matches[1] = "$wpdb->posts.menu_order";
2323
- break;
2324
- case 'comment_count':
2325
- $matches[1] = "$wpdb->posts.comment_count";
2326
- break;
2327
- case $meta_key:
2328
- case 'meta_value':
2329
- $matches[1] = "$wpdb->postmeta.meta_value";
2330
- break;
2331
- case 'meta_value_num':
2332
- $matches[1] = "$wpdb->postmeta.meta_value+0";
2333
- break;
2334
- default:
2335
- $matches[1] = "$wpdb->posts.post_" . $matches[1];
2336
- } // switch $matches[1]
2337
 
2338
- $results[] = isset( $matches[2] ) ? $matches[1] . $matches[2] : $matches[1] . $order;
2339
- } // not 'rand'
2340
- } // valid column specification
2341
- } // foreach $obmatches
2342
 
2343
- $orderby = implode( ', ', $results );
2344
- if ( empty( $orderby ) ) {
2345
- return false;
2346
- }
2347
- } // else filter by allowed keys, etc.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2348
 
2349
  return $orderby;
2350
  }
@@ -2702,13 +2796,17 @@ class MLAShortcodes {
2702
  case 'exclude':
2703
  if ( ! empty( $value ) ) {
2704
  if ( is_array( $value ) ) {
2705
- $query_arguments[ $key ] = array_filter( $value );
2706
  } else {
2707
- $query_arguments[ $key ] = array_filter( array_map( 'intval', explode( ",", $value ) ) );
2708
  }
2709
-
2710
- if ( ! $children_ok ) {
2711
- $use_children = false;
 
 
 
 
2712
  }
2713
  }
2714
  unset( $arguments[ $key ] );
@@ -2826,7 +2924,6 @@ class MLAShortcodes {
2826
  * Decide whether to use a "get_children" style query
2827
  */
2828
  self::$query_parameters['disable_tax_join'] = $is_tax_query && ! $use_children;
2829
-
2830
  if ( $use_children && ! isset( $query_arguments['post_parent'] ) ) {
2831
  if ( ! isset( $query_arguments['id'] ) ) {
2832
  $query_arguments['post_parent'] = $post_parent;
@@ -2951,6 +3048,7 @@ class MLAShortcodes {
2951
  remove_filter( 'relevanssi_admin_search_ok', 'MLAData::mla_query_relevanssi_admin_search_ok_filter' );
2952
  }
2953
 
 
2954
  remove_filter( 'posts_where', 'MLAShortcodes::mla_shortcode_query_posts_where_filter', 0x7FFFFFFF );
2955
  remove_filter( 'posts_orderby', 'MLAShortcodes::mla_shortcode_query_posts_orderby_filter', 0x7FFFFFFF );
2956
 
@@ -2988,7 +3086,7 @@ class MLAShortcodes {
2988
  * We leave the clause in because the WHERE clauses refer to "p2.".
2989
  */
2990
  if ( self::$query_parameters['disable_tax_join'] ) {
2991
- $join_clause = str_replace( " LEFT JOIN $wpdb->posts AS p2 ON ($wpdb->posts.post_parent = p2.ID) ", " LEFT JOIN $wpdb->posts AS p2 ON (p2.ID = p2.ID) ", $join_clause );
2992
  }
2993
 
2994
  return $join_clause;
@@ -3134,7 +3232,7 @@ class MLAShortcodes {
3134
  /**
3135
  * Retrieve the terms in one or more taxonomies.
3136
  *
3137
- * Alternative to WordPress get_terms() function that provides
3138
  * an accurate count of attachments associated with each term.
3139
  *
3140
  * taxonomy - string containing one or more (comma-delimited) taxonomy names
@@ -3142,9 +3240,11 @@ class MLAShortcodes {
3142
  *
3143
  * post_mime_type - MIME type(s) of the items to include in the term-specific counts. Default 'all'.
3144
  *
3145
- * post_type - The post type(s) of the items to include in the term-specific counts. The default is "attachment".
 
3146
  *
3147
- * post_status - The post status value(s) of the items to include in the term-specific counts. The default is "inherit".
 
3148
  *
3149
  * ids - A comma-separated list of attachment ID values for an item-specific cloud.
3150
  *
@@ -3161,7 +3261,7 @@ class MLAShortcodes {
3161
  * no_count - 'true', 'false' (default) to suppress term-specific attachment-counting process.
3162
  *
3163
  * number - maximum number of term objects to return. Terms are ordered by count,
3164
- * descending and then by term_id before this value is applied. Default 45.
3165
  *
3166
  * orderby - 'count', 'id', 'name' (default), 'none', 'random', 'slug'
3167
  *
@@ -3171,7 +3271,7 @@ class MLAShortcodes {
3171
  *
3172
  * preserve_case - 'true', 'false' (default) to make orderby case-sensitive.
3173
  *
3174
- * pad_counts - 'true', 'false' (default) to make orderby case-sensitive.
3175
  *
3176
  * limit - final number of term objects to return, for pagination. Default 0.
3177
  *
@@ -3297,6 +3397,9 @@ class MLAShortcodes {
3297
  */
3298
  if ( ! empty( $arguments['ids'] ) && empty( $arguments['include'] ) ) {
3299
  $ids = wp_parse_id_list( $arguments['ids'] );
 
 
 
3300
  $includes = array();
3301
  foreach ( $ids as $id ) {
3302
  foreach ($taxonomies as $taxonomy) {
@@ -3392,28 +3495,23 @@ class MLAShortcodes {
3392
  * is needed unless a different order is specified
3393
  */
3394
  if ( 'count' != $orderby || 'DESC' != $order ) {
3395
- $binary = ( 'true' == strtolower( $arguments['preserve_case'] ) ) ? 'BINARY ' : '';
3396
-
3397
- switch ($orderby) {
3398
- case 'count':
3399
- $final_parameters[] = 'ORDER BY count ' . $order;
3400
- break;
3401
- case 'id':
3402
- $final_parameters[] = 'ORDER BY term_id ' . $order;
3403
- break;
3404
- case 'name':
3405
- $final_parameters[] = 'ORDER BY ' . $binary . 'name ' . $order;
3406
- break;
3407
- case 'none':
3408
- break;
3409
- case 'random':
3410
- $final_parameters[] = 'ORDER BY RAND() ' . $order;
3411
- break;
3412
- case 'slug':
3413
- $final_parameters[] = 'ORDER BY ' . $binary . 'slug ' . $order;
3414
- break;
3415
- }
3416
- }
3417
 
3418
  /*
3419
  * Add pagination
24
  add_shortcode( 'mla_attachment_list', 'MLAShortcodes::mla_attachment_list_shortcode' );
25
  add_shortcode( 'mla_gallery', 'MLAShortcodes::mla_gallery_shortcode' );
26
  add_shortcode( 'mla_tag_cloud', 'MLAShortcodes::mla_tag_cloud_shortcode' );
27
+
28
+ /*
29
+ * Avoid wptexturize defect
30
+ */
31
+ if ( version_compare( get_bloginfo('version'), '4.0', '>=' ) ) {
32
+ add_filter( 'no_texturize_shortcodes', 'MLAShortcodes::mla_no_texturize_shortcodes_filter', 10, 1 );
33
+ }
34
+ }
35
+
36
+ /**
37
+ * Prevents wptexturizing of the [mla_gallery] shortcode, avoiding a bug in WP 4.0.
38
+ *
39
+ * Defined as public because it's a filter.
40
+ *
41
+ * @since 1.94
42
+ *
43
+ * @param array list of "do not texturize" shortcodes
44
+ *
45
+ * @return array updated list of "do not texturize" shortcodes
46
+ */
47
+ public static function mla_no_texturize_shortcodes_filter( $no_texturize_shortcodes ) {
48
+ if ( ! in_array( 'mla_gallery', $no_texturize_shortcodes ) ) {
49
+ $no_texturize_shortcodes[] = 'mla_gallery';
50
+ $no_texturize_shortcodes[] = 'mla_tag_cloud';
51
+ }
52
+
53
+ return $no_texturize_shortcodes;
54
  }
55
 
56
  /**
579
  }
580
 
581
  /*
582
+ * For "previous_link", "current_link" and "next_link",
583
+ * discard all of the $attachments except the appropriate choice
584
  */
585
  if ( ! $is_gallery ) {
586
  $link_type = $output_parameters[0];
1132
 
1133
  'echo' => false,
1134
  'link' => 'view',
1135
+ 'current_item' => '',
1136
+ 'current_item_class' => 'mla_current_item',
1137
 
1138
  'itemtag' => 'ul',
1139
  'termtag' => 'li',
1206
  if ( isset( $arguments[ $mla_page_parameter ] ) ) {
1207
  $arguments['offset'] = $arguments['limit'] * ( $arguments[ $mla_page_parameter ] - 1);
1208
  }
1209
+
1210
+ /*
1211
+ * Clean up the current_item to separate term_id from slug
1212
+ */
1213
+ if ( ! empty( $arguments['current_item'] ) && ctype_digit( $arguments['current_item'] ) ) {
1214
+ $arguments['current_item'] = absint( $arguments['current_item'] );
1215
+ }
1216
 
1217
  $arguments = apply_filters( 'mla_tag_cloud_arguments', $arguments );
1218
 
1456
  'mla_markup' => $arguments['mla_markup'],
1457
  'instance' => $instance,
1458
  'taxonomy' => implode( '-', $arguments['taxonomy'] ),
1459
+ 'current_item' => $arguments['current_item'],
1460
  'itemtag' => tag_escape( $arguments['itemtag'] ),
1461
  'termtag' => tag_escape( $arguments['termtag'] ),
1462
  'captiontag' => tag_escape( $arguments['captiontag'] ),
1675
  $item_values['term_group'] = $tag->term_group;
1676
  $item_values['term_taxonomy_id'] = $tag->term_taxonomy_id;
1677
  $item_values['taxonomy'] = wptexturize( $tag->taxonomy );
1678
+ $item_values['current_item_class'] = '';
1679
  $item_values['description'] = wptexturize( $tag->description );
1680
  $item_values['parent'] = $tag->parent;
1681
  $item_values['count'] = isset ( $tag->count ) ? $tag->count : 0;
1685
  $item_values['editlink_url'] = $tag->edit_link;
1686
  $item_values['termlink_url'] = $tag->term_link;
1687
  // Added in the code below:
1688
+ // 'caption', 'link_attributes', 'current_item_class', 'rollover_text', 'link_style', 'link_text', 'editlink', 'termlink', 'thelink'
1689
 
1690
+ if ( ! empty( $arguments['current_item'] ) ) {
1691
+ if ( is_integer( $arguments['current_item'] ) ) {
1692
+ if ( $arguments['current_item'] == $tag->term_id ) {
1693
+ $item_values['current_item_class'] = $arguments['current_item_class'];
1694
+ }
1695
+ } else {
1696
+ if ( $arguments['current_item'] == $tag->slug ) {
1697
+ $item_values['current_item_class'] = $arguments['current_item_class'];
1698
+ }
1699
+ }
1700
+ }
1701
+
1702
  /*
1703
  * Add item_specific field-level substitution parameters
1704
  */
2222
  $markup_values['request_uri'] = add_query_arg( array( $mla_page_parameter => $new_page ), $_SERVER['REQUEST_URI'] );
2223
  $markup_values['new_url'] = set_url_scheme( $markup_values['scheme'] . $markup_values['http_host'] . $markup_values['request_uri'] );
2224
 
2225
+ /*
2226
+ * Expand pagination-specific Gallery Display Content parameters,
2227
+ * which can contain request: and query: arguments.
2228
+ */
2229
+ $pagination_arguments = array( 'mla_nolink_text', 'mla_link_class', 'mla_rollover_text', 'mla_link_attributes', 'mla_link_href', 'mla_link_text', 'mla_prev_text', 'mla_next_text' );
2230
+
2231
+ foreach( $pagination_arguments as $value ) {
2232
+ $new_text .= str_replace( '{+', '[+', str_replace( '+}', '+]', $arguments[ $value ] ) );
2233
+ }
2234
+
2235
+ $markup_values = MLAData::mla_expand_field_level_parameters( $new_text, $attr, $markup_values );
2236
+
2237
  /*
2238
  * Build the new link, applying Gallery Display Content parameters
2239
  */
2334
  *
2335
  * @since 1.20
2336
  *
2337
+ * @param array Validated query parameters; 'order', 'orderby', 'meta_key', 'post__in'.
2338
+ * @param string Optional. Database table prefix; can be empty. Default taken from $wpdb->posts.
2339
+ * @param array Optional. Field names (keys) and database column equivalents (values). Defaults from [mla_gallery].
2340
+ * @param array Optional. Field names (values) that require a BINARY prefix to preserve case order. Default array()
2341
  * @return string|bool Returns the orderby clause if present, false otherwise.
2342
  */
2343
+ private static function _validate_sql_orderby( $query_parameters, $table_prefix = NULL, $allowed_keys = NULL, $binary_keys = array() ){
2344
  global $wpdb;
2345
 
2346
  $results = array ();
2347
  $order = isset( $query_parameters['order'] ) ? ' ' . $query_parameters['order'] : '';
2348
  $orderby = isset( $query_parameters['orderby'] ) ? $query_parameters['orderby'] : '';
2349
  $meta_key = isset( $query_parameters['meta_key'] ) ? $query_parameters['meta_key'] : '';
2350
+
2351
+ if ( is_null( $table_prefix ) ) {
2352
+ $table_prefix = $wpdb->posts . '.';
2353
+ }
2354
+
2355
+ if ( is_null( $allowed_keys ) ) {
2356
+ $allowed_keys = array(
2357
+ 'empty_orderby_default' => 'post_date',
2358
+ 'explicit_orderby_field' => 'post__in',
2359
+ 'explicit_orderby_column' => 'ID',
2360
+ 'ID' => 'ID',
2361
+ 'author' => 'post_author',
2362
+ 'date' => 'post_date',
2363
+ 'description' => 'post_content',
2364
+ 'content' => 'post_content',
2365
+ 'title' => 'post_title',
2366
+ 'caption' => 'post_excerpt',
2367
+ 'excerpt' => 'post_excerpt',
2368
+ 'slug' => 'post_name',
2369
+ 'name' => 'post_name',
2370
+ 'modified' => 'post_modified',
2371
+ 'parent' => 'post_parent',
2372
+ 'menu_order' => 'menu_order',
2373
+ 'mime_type' => 'post_mime_type',
2374
+ 'comment_count' => 'post_content',
2375
+ 'rand' => 'RAND()',
2376
+ );
2377
+ }
2378
 
2379
  if ( empty( $orderby ) ) {
2380
+ if ( ! empty( $allowed_keys['empty_orderby_default'] ) ) {
2381
+ return $table_prefix . $allowed_keys['empty_orderby_default'] . " {$order}";
2382
+ } else {
2383
+ return "{$table_prefix}post_date {$order}";
2384
+ }
2385
  } elseif ( 'none' == $orderby ) {
2386
  return '';
2387
+ } elseif ( ! empty( $allowed_keys['explicit_orderby_field'] ) ) {
2388
+ $explicit_field = $allowed_keys['explicit_orderby_field'];
2389
+ if ( $orderby == $explicit_field ) {
2390
+ if ( ! empty( $query_parameters[ $explicit_field ] ) ) {
2391
+ $explicit_order = implode(',', array_map( 'absint', $query_parameters[ $explicit_field ] ) );
2392
+
2393
+ if ( ! empty( $explicit_order ) ) {
2394
+ $explicit_column = $allowed_keys['explicit_orderby_column'];
2395
+ return "FIELD( {$table_prefix}{$explicit_column}, {$explicit_order} )";
 
 
 
 
 
 
 
 
2396
  } else {
2397
+ return '';
2398
+ }
2399
+ }
2400
+ }
2401
+ }
2402
+
2403
+ if ( ! empty( $meta_key ) ) {
2404
+ $allowed_keys[ $meta_key ] = "$wpdb->postmeta.meta_value";
2405
+ $allowed_keys['meta_value'] = "$wpdb->postmeta.meta_value";
2406
+ $allowed_keys['meta_value_num'] = "$wpdb->postmeta.meta_value+0";
2407
+ }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2408
 
2409
+ $obmatches = preg_split('/\s*,\s*/', trim($query_parameters['orderby']));
2410
+ foreach ( $obmatches as $index => $value ) {
2411
+ $count = preg_match('/([a-z0-9_]+)(\s+(ASC|DESC))?/i', $value, $matches);
 
2412
 
2413
+ if ( $count && ( $value == $matches[0] ) && array_key_exists( $matches[1], $allowed_keys ) ) {
2414
+ if ( ( 'rand' == $matches[1] ) || ( 'random' == $matches[1] ) ){
2415
+ $results[] = 'RAND()';
2416
+ } else {
2417
+ switch ( $matches[1] ) {
2418
+ case $meta_key:
2419
+ case 'meta_value':
2420
+ $matches[1] = "$wpdb->postmeta.meta_value";
2421
+ break;
2422
+ case 'meta_value_num':
2423
+ $matches[1] = "$wpdb->postmeta.meta_value+0";
2424
+ break;
2425
+ default:
2426
+ if ( in_array( $matches[1], $binary_keys ) ) {
2427
+ $matches[1] = 'BINARY ' . $table_prefix . $allowed_keys[ $matches[1] ];
2428
+ } else {
2429
+ $matches[1] = $table_prefix . $allowed_keys[ $matches[1] ];
2430
+ }
2431
+ } // switch $matches[1]
2432
+
2433
+ $results[] = isset( $matches[2] ) ? $matches[1] . $matches[2] : $matches[1] . $order;
2434
+ } // not 'rand'
2435
+ } // valid column specification
2436
+ } // foreach $obmatches
2437
+
2438
+ $orderby = implode( ', ', $results );
2439
+ if ( empty( $orderby ) ) {
2440
+ return false;
2441
+ }
2442
 
2443
  return $orderby;
2444
  }
2796
  case 'exclude':
2797
  if ( ! empty( $value ) ) {
2798
  if ( is_array( $value ) ) {
2799
+ $value = array_filter( $value );
2800
  } else {
2801
+ $value = array_filter( array_map( 'intval', explode( ",", $value ) ) );
2802
  }
2803
+
2804
+ if ( ! empty( $value ) ) {
2805
+ $query_arguments[ $key ] = $value;
2806
+
2807
+ if ( ! $children_ok ) {
2808
+ $use_children = false;
2809
+ }
2810
  }
2811
  }
2812
  unset( $arguments[ $key ] );
2924
  * Decide whether to use a "get_children" style query
2925
  */
2926
  self::$query_parameters['disable_tax_join'] = $is_tax_query && ! $use_children;
 
2927
  if ( $use_children && ! isset( $query_arguments['post_parent'] ) ) {
2928
  if ( ! isset( $query_arguments['id'] ) ) {
2929
  $query_arguments['post_parent'] = $post_parent;
3048
  remove_filter( 'relevanssi_admin_search_ok', 'MLAData::mla_query_relevanssi_admin_search_ok_filter' );
3049
  }
3050
 
3051
+ remove_filter( 'posts_join', 'MLAShortcodes::mla_shortcode_query_posts_join_filter', 0x7FFFFFFF );
3052
  remove_filter( 'posts_where', 'MLAShortcodes::mla_shortcode_query_posts_where_filter', 0x7FFFFFFF );
3053
  remove_filter( 'posts_orderby', 'MLAShortcodes::mla_shortcode_query_posts_orderby_filter', 0x7FFFFFFF );
3054
 
3086
  * We leave the clause in because the WHERE clauses refer to "p2.".
3087
  */
3088
  if ( self::$query_parameters['disable_tax_join'] ) {
3089
+ $join_clause = str_replace( " LEFT JOIN {$wpdb->posts} AS p2 ON ({$wpdb->posts}.post_parent = p2.ID) ", " LEFT JOIN {$wpdb->posts} AS p2 ON (p2.ID = p2.ID) ", $join_clause );
3090
  }
3091
 
3092
  return $join_clause;
3232
  /**
3233
  * Retrieve the terms in one or more taxonomies.
3234
  *
3235
+ * Alternative to WordPress /wp-includes/taxonomy.php function get_terms() that provides
3236
  * an accurate count of attachments associated with each term.
3237
  *
3238
  * taxonomy - string containing one or more (comma-delimited) taxonomy names
3240
  *
3241
  * post_mime_type - MIME type(s) of the items to include in the term-specific counts. Default 'all'.
3242
  *
3243
+ * post_type - The post type(s) of the items to include in the term-specific counts.
3244
+ * The default is "attachment".
3245
  *
3246
+ * post_status - The post status value(s) of the items to include in the term-specific counts.
3247
+ * The default is "inherit".
3248
  *
3249
  * ids - A comma-separated list of attachment ID values for an item-specific cloud.
3250
  *
3261
  * no_count - 'true', 'false' (default) to suppress term-specific attachment-counting process.
3262
  *
3263
  * number - maximum number of term objects to return. Terms are ordered by count,
3264
+ * descending and then by term_id before this value is applied. Default 0.
3265
  *
3266
  * orderby - 'count', 'id', 'name' (default), 'none', 'random', 'slug'
3267
  *
3271
  *
3272
  * preserve_case - 'true', 'false' (default) to make orderby case-sensitive.
3273
  *
3274
+ * pad_counts - 'true', 'false' (default) to to include the count of all children in their parents' count.
3275
  *
3276
  * limit - final number of term objects to return, for pagination. Default 0.
3277
  *
3397
  */
3398
  if ( ! empty( $arguments['ids'] ) && empty( $arguments['include'] ) ) {
3399
  $ids = wp_parse_id_list( $arguments['ids'] );
3400
+ $placeholders = implode( "','", $ids );
3401
+ $query[] = "AND p.ID IN ( '{$placeholders}' )";
3402
+
3403
  $includes = array();
3404
  foreach ( $ids as $id ) {
3405
  foreach ($taxonomies as $taxonomy) {
3495
  * is needed unless a different order is specified
3496
  */
3497
  if ( 'count' != $orderby || 'DESC' != $order ) {
3498
+ if ( 'true' == strtolower( $arguments['preserve_case'] ) ) {
3499
+ $binary_keys = array( 'name', 'slug', );
3500
+ } else {
3501
+ $binary_keys = array();
3502
+ }
3503
+
3504
+ $allowed_keys = array(
3505
+ 'empty_orderby_default' => 'name',
3506
+ 'count' => 'count',
3507
+ 'id' => 'term_id',
3508
+ 'name' => 'name',
3509
+ 'random' => 'RAND()',
3510
+ 'slug' => 'slug',
3511
+ );
3512
+
3513
+ $final_parameters[] = 'ORDER BY ' . self::_validate_sql_orderby( $arguments, '', $allowed_keys, $binary_keys );
3514
+ } // add ORDER BY
 
 
 
 
 
3515
 
3516
  /*
3517
  * Add pagination
includes/mla-media-modal-js-template.php CHANGED
@@ -17,7 +17,7 @@ global $post;
17
  <label class="screen-reader-text" for="media-search-input"><?php _e( 'Search Media', 'media-library-assistant' ); ?>:</label>
18
 
19
  <input type="search" id="media-search-input" name="s[mla_search_value]" class="search" value="{{ data.searchValue }}" placeholder="{{ data.searchBoxPlaceholder }}" size="22" />
20
- <input type="submit" name="mla_search_submit" id="mla-search-submit" class="button search" value="<?php _e( 'Search', 'media-library-assistant' ); ?>" /><br>
21
  <ul class="mla-search-options" style="{{ data.searchBoxControlsStyle }}">
22
  <li>
23
  <input type="radio" name="s[mla_search_connector]" value="AND" <# if ( 'OR' !== data.searchConnector ) { #>checked="checked"<# } #> />
17
  <label class="screen-reader-text" for="media-search-input"><?php _e( 'Search Media', 'media-library-assistant' ); ?>:</label>
18
 
19
  <input type="search" id="media-search-input" name="s[mla_search_value]" class="search" value="{{ data.searchValue }}" placeholder="{{ data.searchBoxPlaceholder }}" size="22" />
20
+ <input type="submit" name="mla_search_submit" id="mla-search-submit" class="button media-button mla-search-submit-button" value="<?php _e( 'Search', 'media-library-assistant' ); ?>" /><br>
21
  <ul class="mla-search-options" style="{{ data.searchBoxControlsStyle }}">
22
  <li>
23
  <input type="radio" name="s[mla_search_connector]" value="AND" <# if ( 'OR' !== data.searchConnector ) { #>checked="checked"<# } #> />
includes/mla-plugin-loader.php CHANGED
@@ -9,6 +9,8 @@
9
  * @since 0.20
10
  */
11
 
 
 
12
  if (!defined('MLA_OPTION_PREFIX')) {
13
  /**
14
  * Gives a unique prefix for plugin options; can be set in wp-config.php
9
  * @since 0.20
10
  */
11
 
12
+ defined( 'ABSPATH' ) or die();
13
+
14
  if (!defined('MLA_OPTION_PREFIX')) {
15
  /**
16
  * Gives a unique prefix for plugin options; can be set in wp-config.php
index.php CHANGED
@@ -6,17 +6,17 @@
6
  * will the rest of the plugin be loaded and run.
7
  *
8
  * @package Media Library Assistant
9
- * @version 1.93
10
  */
11
 
12
  /*
13
  Plugin Name: Media Library Assistant
14
  Plugin URI: http://fairtradejudaica.org/media-library-assistant-a-wordpress-plugin/
15
- Description: Enhances the Media Library; powerful[mla_gallery], taxonomy support, IPTC/EXIF processing, bulk & quick edit actions and where-used reporting.
16
- Author: David Lingren
17
  Text Domain: media-library-assistant
18
  Domain Path: /languages
19
- Version: 1.93
20
  Author URI: http://fairtradejudaica.org/our-story/staff/
21
 
22
  Copyright 2011-2014 David Lingren
@@ -35,6 +35,8 @@ Copyright 2011-2014 David Lingren
35
  Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
36
  */
37
 
 
 
38
  /**
39
  * Accumulates error messages from name conflict tests
40
  *
6
  * will the rest of the plugin be loaded and run.
7
  *
8
  * @package Media Library Assistant
9
+ * @version 1.94
10
  */
11
 
12
  /*
13
  Plugin Name: Media Library Assistant
14
  Plugin URI: http://fairtradejudaica.org/media-library-assistant-a-wordpress-plugin/
15
+ Description: Enhances the Media Library; powerful [mla_gallery], taxonomy support, IPTC/EXIF processing, bulk & quick edit actions and where-used reporting.
16
+ Author: David Lingren, Fair Trade Judaica
17
  Text Domain: media-library-assistant
18
  Domain Path: /languages
19
+ Version: 1.94
20
  Author URI: http://fairtradejudaica.org/our-story/staff/
21
 
22
  Copyright 2011-2014 David Lingren
35
  Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
36
  */
37
 
38
+ defined( 'ABSPATH' ) or die();
39
+
40
  /**
41
  * Accumulates error messages from name conflict tests
42
  *
js/mla-media-modal-scripts.js CHANGED
@@ -145,7 +145,7 @@ var wp, wpAjax, ajaxurl, jQuery, _,
145
  // Media Grid native dateFilter
146
  mlaModal.settings.query[state].filterMonth = ( 100 * query.year ) + ( 1 * query.monthnum ) ;
147
  } else {
148
- mlaModal.settings.query[state].filterMonth = 0;
149
  }
150
  }
151
 
@@ -237,8 +237,13 @@ var wp, wpAjax, ajaxurl, jQuery, _,
237
  value = mlaModal.settings.query[state].filterMime,
238
  props = model.toJSON();
239
 
240
- if ( 'string' == typeof props.search )
241
- mlaModal.settings.query[state].searchValue = props.search;
 
 
 
 
 
242
 
243
  _.find( this.filters, function( filter, id ) {
244
  var equal = _.all( filter.props, function( prop, key ) {
@@ -271,7 +276,8 @@ var wp, wpAjax, ajaxurl, jQuery, _,
271
  */
272
  if ( mlaModal.settings.enableMonthsDropdown ) {
273
  wp.media.view.AttachmentFilters.MlaMonths = wp.media.view.AttachmentFilters.extend({
274
- className: 'attachment-months',
 
275
 
276
  createFilters: function() {
277
  var state = this.controller._state,
@@ -302,8 +308,13 @@ var wp, wpAjax, ajaxurl, jQuery, _,
302
  if ( _.isUndefined( props.s ) )
303
  props.s = {};
304
 
305
- if ( 'string' == typeof props.search )
306
- mlaModal.settings.query[state].searchValue = props.search;
 
 
 
 
 
307
 
308
  if (_.isUndefined( props.s.mla_filter_month ) )
309
  props.s.mla_filter_month = mlaModal.settings.query[state].filterMonth;
@@ -340,7 +351,8 @@ var wp, wpAjax, ajaxurl, jQuery, _,
340
  */
341
  if ( mlaModal.settings.enableTermsDropdown ) {
342
  wp.media.view.AttachmentFilters.MlaTerms = wp.media.view.AttachmentFilters.extend({
343
- className: 'attachment-terms',
 
344
 
345
  createFilters: function() {
346
  var state = this.controller._state, index,
@@ -369,8 +381,13 @@ var wp, wpAjax, ajaxurl, jQuery, _,
369
  if ( _.isUndefined( props.s ) )
370
  props.s = {};
371
 
372
- if ( 'string' == typeof props.search )
373
- mlaModal.settings.query[state].searchValue = props.search;
 
 
 
 
 
374
 
375
  if (_.isUndefined( props.s.mla_filter_term ) )
376
  props.s.mla_filter_term = mlaModal.settings.query[state].filterTerm;
@@ -604,14 +621,14 @@ var wp, wpAjax, ajaxurl, jQuery, _,
604
  },
605
 
606
  simulateSearch: function() {
607
- var searchValues = {
608
- 'mla_filter_month': mlaModal.settings.query.initial.filterMonth,
609
- 'mla_filter_term': mlaModal.settings.query.initial.filterTerm,
610
- 'mla_terms_search': mlaModal.settings.termsSearch,
611
- 'mla_search_clicks': mlaModal.settings.searchClicks++,
612
- 'mla_search_value': mlaModal.settings.query.initial.searchValue,
613
- 'mla_search_fields': mlaModal.settings.query.initial.searchFields,
614
- 'mla_search_connector': mlaModal.settings.query.initial.searchConnector };
615
  this.model.set({ 's': searchValues });
616
  }
617
  }); // Simulated search
@@ -1108,10 +1125,36 @@ wp.media.frame.on( 'all', mediaFrameOn );
1108
  */
1109
  if ( mlaModal.settings.enableDetailsCategory || mlaModal.settings.enableDetailsTag ) {
1110
  wp.media.model.Selection = wp.media.model.Selection.extend({
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1111
  initialize: function() {
1112
  // Call the base method in the super class
1113
  wp.media.model.Selection.__super__.initialize.apply( this, arguments );
1114
 
 
 
 
 
 
1115
  // Hook the 'selection:reset' event so we can add our enhancements when it's done
1116
  this.on( 'selection:reset', function( /* model */ ) {
1117
  mlaModal.cid = null;
@@ -1140,22 +1183,23 @@ wp.media.frame.on( 'all', mediaFrameOn );
1140
  mlaModal.uploading = false;
1141
  hookCompat = true;
1142
  } else {
1143
- // filter out trivial changes
1144
- changed = model.changed;
1145
- delete changed.title;
1146
- delete changed.caption;
1147
- delete changed.alt;
1148
- delete changed.description;
1149
-
1150
- if ( ! _.isEmpty( changed ) ) {
1151
- hookCompat = true;
 
 
 
1152
  }
1153
  }
1154
 
1155
  if ( true === hookCompat ) {
1156
- mediaFrame = wp.media.editor.get('content');
1157
- compat = mediaFrame.content.get('compat');
1158
- mlaModal.utility.hookCompatTaxonomies( model.get('id'), compat.sidebar.$el );
1159
  }
1160
  });
1161
  }
145
  // Media Grid native dateFilter
146
  mlaModal.settings.query[state].filterMonth = ( 100 * query.year ) + ( 1 * query.monthnum ) ;
147
  } else {
148
+ // mlaModal.settings.query[state].filterMonth = 0;
149
  }
150
  }
151
 
237
  value = mlaModal.settings.query[state].filterMime,
238
  props = model.toJSON();
239
 
240
+ if ( false === mlaModal.settings.enableSearchBox ) {
241
+ if ( 'string' == typeof props.search ) {
242
+ mlaModal.settings.query[state].searchValue = props.search;
243
+ } else {
244
+ mlaModal.settings.query[state].searchValue = '';
245
+ }
246
+ }
247
 
248
  _.find( this.filters, function( filter, id ) {
249
  var equal = _.all( filter.props, function( prop, key ) {
276
  */
277
  if ( mlaModal.settings.enableMonthsDropdown ) {
278
  wp.media.view.AttachmentFilters.MlaMonths = wp.media.view.AttachmentFilters.extend({
279
+ className: 'attachment-filters',
280
+ id: 'media-attachment-date-filters',
281
 
282
  createFilters: function() {
283
  var state = this.controller._state,
308
  if ( _.isUndefined( props.s ) )
309
  props.s = {};
310
 
311
+ if ( false === mlaModal.settings.enableSearchBox ) {
312
+ if ( 'string' == typeof props.search ) {
313
+ mlaModal.settings.query[state].searchValue = props.search;
314
+ } else {
315
+ mlaModal.settings.query[state].searchValue = '';
316
+ }
317
+ }
318
 
319
  if (_.isUndefined( props.s.mla_filter_month ) )
320
  props.s.mla_filter_month = mlaModal.settings.query[state].filterMonth;
351
  */
352
  if ( mlaModal.settings.enableTermsDropdown ) {
353
  wp.media.view.AttachmentFilters.MlaTerms = wp.media.view.AttachmentFilters.extend({
354
+ className: 'attachment-filters',
355
+ id: 'media-attachment-term-filters',
356
 
357
  createFilters: function() {
358
  var state = this.controller._state, index,
381
  if ( _.isUndefined( props.s ) )
382
  props.s = {};
383
 
384
+ if ( false === mlaModal.settings.enableSearchBox ) {
385
+ if ( 'string' == typeof props.search ) {
386
+ mlaModal.settings.query[state].searchValue = props.search;
387
+ } else {
388
+ mlaModal.settings.query[state].searchValue = '';
389
+ }
390
+ }
391
 
392
  if (_.isUndefined( props.s.mla_filter_term ) )
393
  props.s.mla_filter_term = mlaModal.settings.query[state].filterTerm;
621
  },
622
 
623
  simulateSearch: function() {
624
+ var state = this.controller._state, searchValues = {
625
+ 'mla_filter_month': mlaModal.settings.query[ state ].filterMonth,
626
+ 'mla_filter_term': mlaModal.settings.query[ state ].filterTerm,
627
+ 'mla_terms_search': mlaModal.settings.query[ state ].termsSearch,
628
+ 'mla_search_clicks': mlaModal.settings.query[ state ].searchClicks++,
629
+ 'mla_search_value': mlaModal.settings.query[ state ].searchValue,
630
+ 'mla_search_fields': mlaModal.settings.query[ state ].searchFields,
631
+ 'mla_search_connector': mlaModal.settings.query[ state ].searchConnector };
632
  this.model.set({ 's': searchValues });
633
  }
634
  }); // Simulated search
1125
  */
1126
  if ( mlaModal.settings.enableDetailsCategory || mlaModal.settings.enableDetailsTag ) {
1127
  wp.media.model.Selection = wp.media.model.Selection.extend({
1128
+ /* for debug : trace every event triggered in the wp.media.model.Selection * /
1129
+ selectionEvent: function( eventName, eventModel, eventContext, eventFlags ) {
1130
+ var attributes = null, id = 0, cid = 'none';
1131
+
1132
+ if ( 'undefined' != typeof eventModel.cid ) {
1133
+ cid = eventModel.cid;
1134
+ }
1135
+
1136
+ if ( 'undefined' != typeof eventModel.id ) {
1137
+ id = eventModel.id;
1138
+ }
1139
+
1140
+ if ( 'undefined' != typeof eventModel.attributes ) {
1141
+ attributes = _.clone( eventModel.attributes );
1142
+ delete( attributes.file );
1143
+ console.log('selectionEvent ', eventName, '( ', cid, ', ', id, ' ) eventModel.attributes: ', JSON.stringify( attributes ) );
1144
+ } else {
1145
+ console.log('selectionEvent ', eventName, '( ', cid, ', ', id, ' )' );
1146
+ }
1147
+ }, // */
1148
+
1149
  initialize: function() {
1150
  // Call the base method in the super class
1151
  wp.media.model.Selection.__super__.initialize.apply( this, arguments );
1152
 
1153
+ /* for debug : trace every event triggered in the wp.media.model.Selection * /
1154
+ this.stopListening( this );
1155
+ this.listenTo( this, 'all', this.selectionEvent );
1156
+ // */
1157
+
1158
  // Hook the 'selection:reset' event so we can add our enhancements when it's done
1159
  this.on( 'selection:reset', function( /* model */ ) {
1160
  mlaModal.cid = null;
1183
  mlaModal.uploading = false;
1184
  hookCompat = true;
1185
  } else {
1186
+ // ignore changes during upload
1187
+ if ( false === model.attributes.uploading ) {
1188
+ // filter out trivial changes
1189
+ changed = _.clone( model.changed );
1190
+ delete changed.title;
1191
+ delete changed.caption;
1192
+ delete changed.alt;
1193
+ delete changed.description;
1194
+
1195
+ if ( ! _.isEmpty( changed ) ) {
1196
+ hookCompat = true;
1197
+ }
1198
  }
1199
  }
1200
 
1201
  if ( true === hookCompat ) {
1202
+ mlaModal.utility.hookCompatTaxonomies( model.get('id'), wp.media.frame.$el );
 
 
1203
  }
1204
  });
1205
  }
js/mla-media-modal-scripts.min.js CHANGED
@@ -1 +1 @@
1
- var wp,wpAjax,ajaxurl,jQuery,_,getUserSetting,setUserSetting,deleteUserSetting,mlaTaxonomy,mlaModal={strings:{},settings:{},initialHTML:{},uploading:false,cid:null,utility:{originalMediaAjax:null,mlaAttachmentsBrowser:null,parseTermsOptions:null,arrayCleanup:null,parseTaxonomyId:null,hookCompatTaxonomies:null,fillCompatTaxonomies:null,supportCompatTaxonomies:null},tagBox:null};(function(a){mlaModal.strings=typeof wp.media.view.l10n.mla_strings==="undefined"?{}:wp.media.view.l10n.mla_strings;delete wp.media.view.l10n.mla_strings;mlaModal.settings=typeof wp.media.view.settings.mla_settings==="undefined"?{screen:"unknown",enableMediaGrid:false,enableMediaModal:false}:wp.media.view.settings.mla_settings;delete wp.media.view.settings.mla_settings;if(!(mlaModal.settings.enableMediaGrid||mlaModal.settings.enableMediaModal)){return}if(("grid"===mlaModal.settings.screen)&&false===mlaModal.settings.enableMediaGrid){return}if(("modal"===mlaModal.settings.screen)&&false===mlaModal.settings.enableMediaModal){return}mlaModal.utility.originalMediaAjax=wp.media.ajax;wp.media.ajax=function(h,d){var g=mlaModal.settings.state,f,c,e,b;if(_.isObject(h)){d=h}else{d=d||{};d.data=_.extend(d.data||{},{action:h})}if("query-attachments"==d.data.action){f=d.data.query;c=typeof f.s;if("object"==c){e=f.s}else{if("string"==c){e={mla_search_value:f.s}}else{e={mla_search_value:""}}}if("undefined"!=typeof f.post_mime_type){mlaModal.settings.query[g].filterMime=f.post_mime_type}else{mlaModal.settings.query[g].filterMime="all"}if("undefined"!=typeof e.mla_filter_month){mlaModal.settings.query[g].filterMonth=e.mla_filter_month}else{if("undefined"!=typeof f.year){mlaModal.settings.query[g].filterMonth=(100*f.year)+(1*f.monthnum)}else{mlaModal.settings.query[g].filterMonth=0}}if("undefined"!=typeof e.mla_filter_term){mlaModal.settings.query[g].filterTerm=e.mla_filter_term}if("undefined"!=typeof e.mla_search_value){mlaModal.settings.query[g].searchValue=e.mla_search_value}b={mla_filter_month:mlaModal.settings.query[g].filterMonth,mla_filter_term:mlaModal.settings.query[g].filterTerm,mla_terms_search:mlaModal.settings.query[g].termsSearch,mla_search_clicks:mlaModal.settings.query[g].searchClicks,mla_search_value:mlaModal.settings.query[g].searchValue,mla_search_fields:mlaModal.settings.query[g].searchFields,mla_search_connector:mlaModal.settings.query[g].searchConnector};mlaModal.settings.query[g].termsSearch="";a("#mla-terms-search-input").html("").val("");d.data.query.s=b}return mlaModal.utility.originalMediaAjax.call(this,d)};if(mlaModal.settings.enableMimeTypes){wp.media.view.AttachmentFilters.Mla=wp.media.view.AttachmentFilters.extend({createFilters:function(){var c=this.controller._state,b={};_.each(mlaModal.settings.mimeTypes||{},function(e,d){if(("grid"===mlaModal.settings.screen)||("trash"!==d)){b[d]={text:e,props:{type:d,uploadedTo:null,orderby:"date",order:"DESC"}}}});b.all={text:wp.media.view.l10n.allMediaItems,props:{type:null,uploadedTo:null,orderby:"date",order:"DESC"},priority:10};if(wp.media.view.settings.post.id){b.uploaded={text:wp.media.view.l10n.uploadedToThisPost,props:{type:null,uploadedTo:wp.media.view.settings.post.id,orderby:"menuOrder",order:"ASC"},priority:20}}this.filters=b;if("undefined"===typeof b[mlaModal.settings.query[c].filterMime]){mlaModal.settings.query[c].filterMime="all"}if(mlaModal.settings.query[c].filterMime!="all"){this.model.set(b[mlaModal.settings.query[c].filterMime].props,{silent:false})}},select:function(){var e=this.controller._state,b=this.model,d=mlaModal.settings.query[e].filterMime,c=b.toJSON();if("string"==typeof c.search){mlaModal.settings.query[e].searchValue=c.search}_.find(this.filters,function(g,h){var f=_.all(g.props,function(j,i){return j===(_.isUndefined(c[i])?null:c[i])});if(f){return d=h}});this.$el.val(d)},change:function(){var b=this.filters[this.el.value];if(b){this.model.set(b.props,{silent:true});a("#mla-search-submit").click()}}})}if(mlaModal.settings.enableMonthsDropdown){wp.media.view.AttachmentFilters.MlaMonths=wp.media.view.AttachmentFilters.extend({className:"attachment-months",createFilters:function(){var c=this.controller._state,b={};_.each(mlaModal.settings.months||{},function(e,d){b[d]={text:e,props:{s:{mla_filter_month:d}}}});this.filters=b;if("undefined"===typeof b[mlaModal.settings.query[c].filterMonth]){mlaModal.settings.query[c].filterMonth=0}if(mlaModal.settings.query[c].filterMonth>0){this.model.set(b[mlaModal.settings.query[c].filterMonth].props,{silent:false})}},select:function(){var e=this.controller._state,b=this.model,d=mlaModal.settings.query[e].filterMonth,c=b.toJSON();if(_.isUndefined(c.s)){c.s={}}if("string"==typeof c.search){mlaModal.settings.query[e].searchValue=c.search}if(_.isUndefined(c.s.mla_filter_month)){c.s.mla_filter_month=mlaModal.settings.query[e].filterMonth}else{mlaModal.settings.query[e].filterMonth=c.s.mla_filter_month}_.find(this.filters,function(g,h){var f=_.all(g.props,function(i){return i.mla_filter_month==mlaModal.settings.query[e].filterMonth});if(f){return d=h}});this.$el.val(d)},change:function(){var b=this.filters[this.el.value],c;if(b){c={s:{mla_filter_month:b.props.s.mla_filter_month}};this.model.set(c);a("#mla-search-submit").click()}}})}if(mlaModal.settings.enableTermsDropdown){wp.media.view.AttachmentFilters.MlaTerms=wp.media.view.AttachmentFilters.extend({className:"attachment-terms",createFilters:function(){var d=this.controller._state,b,c={};_.each(mlaModal.settings.termsText||{},function(f,e){c[e]={text:f,props:{s:{mla_filter_term:parseInt(mlaModal.settings.termsValue[e])}}}});this.filters=c;b=_.indexOf(mlaModal.settings.termsValue,mlaModal.settings.query[d].filterTerm);if(b>0){this.model.set(c[b].props,{silent:false})}},select:function(){var e=this.controller._state,b=this.model,d=mlaModal.settings.query[e].filterTerm,c=b.toJSON();if(_.isUndefined(c.s)){c.s={}}if("string"==typeof c.search){mlaModal.settings.query[e].searchValue=c.search}if(_.isUndefined(c.s.mla_filter_term)){c.s.mla_filter_term=mlaModal.settings.query[e].filterTerm}else{mlaModal.settings.query[e].filterTerm=c.s.mla_filter_term}_.find(this.filters,function(g,h){var f=_.all(g.props,function(i){return i.mla_filter_term==mlaModal.settings.query[e].filterTerm});if(f){return d=h}});this.$el.val(d)},change:function(){var b=this.filters[this.el.value],c;if(b){c={s:{mla_filter_term:b.props.s.mla_filter_term}};this.model.set(c);a("#mla-search-submit").click()}}})}if(mlaModal.settings.enableTermsSearch){wp.media.view.MlaTermsSearch=wp.media.View.extend({tagName:"span",className:"mla-terms-search",template:wp.media.template("mla-terms-search-button"),attributes:{type:"mla-terms-search-button"},events:{change:"termsSearchOpen",click:"termsSearchOpen",},render:function(){this.$el.html(this.template(mlaModal.strings));return this},termsSearchOpen:function(b){if(("click"==b.type)&&("mla_terms_search"===b.target.name)){mlaTaxonomy.termsSearch.open();a("#mla-terms-search-form").off("submit");a("#mla-terms-search-form").submit(function(g){var c,f,d={phrases:"",taxonomies:[]};g.preventDefault();c=a("#mla-terms-search-form").serializeArray();for(f=0;f<c.length;f++){switch(c[f].name){case"mla_terms_search[phrases]":d.phrases=c[f].value;break;case"mla_terms_search[radio_phrases]":d.radio_phrases=c[f].value;break;case"mla_terms_search[radio_terms]":d.radio_terms=c[f].value;break;case"mla_terms_search[taxonomies][]":d.taxonomies[d.taxonomies.length]=c[f].value;break}}mlaModal.settings.query[mlaModal.settings.state].termsSearch=d;a("#mla-search-submit").click();return false});a("#mla-terms-search-input").keypress(function(c){if(13==c.which){c.preventDefault();a("#mla-terms-search-submit").click()}})}}})}if(mlaModal.settings.enableSearchBox){wp.media.view.MlaSearch=wp.media.View.extend({tagName:"div",className:"mla-search-box",template:wp.media.template("mla-search-box"),attributes:{type:"mla-search-box"},events:{input:"search",change:"search",click:"search",search:"search",MlaSearch:"search"},initialize:function(){var b=this.controller._state;if("undefined"===typeof mlaModal.settings.query[b]){mlaModal.settings.query[b]=_.clone(mlaModal.settings.query.initial);mlaModal.settings.query[b].searchFields=_.clone(mlaModal.settings.query.initial.searchFields)}},render:function(){var c=this.controller._state,b=_.extend(mlaModal.strings,mlaModal.settings.query[c]);this.$el.html(this.template(b));return this},search:function(d){var e=this.controller._state,b,f,c;if(("input"==d.type)&&("s[mla_search_value]"==d.target.name)){mlaModal.settings.query[e].searchValue=d.target.value;return}if(("click"==d.type)&&("mla_search_submit"!=d.target.name)){return}switch(d.target.name){case"s[mla_search_value]":mlaModal.settings.query[e].searchValue=d.target.value;break;case"mla_search_submit":b={mla_filter_month:mlaModal.settings.query[e].filterMonth,mla_filter_term:mlaModal.settings.query[e].filterTerm,mla_terms_search:mlaModal.settings.query[e].termsSearch,mla_search_clicks:mlaModal.settings.query[e].searchClicks++,mla_search_value:mlaModal.settings.query[e].searchValue,mla_search_fields:mlaModal.settings.query[e].searchFields,mla_search_connector:mlaModal.settings.query[e].searchConnector};this.model.set({s:b});break;case"s[mla_search_connector]":mlaModal.settings.query[e].searchConnector=d.target.value;break;case"s[mla_search_title]":f=mlaModal.settings.query[e].searchFields;c=f.indexOf("title");if(-1==c){f.push("title")}else{f.splice(c,1)}mlaModal.settings.query[e].searchFields=f;break;case"s[mla_search_name]":c=mlaModal.settings.query[e].searchFields.indexOf("name");if(-1==c){mlaModal.settings.query[e].searchFields.push("name")}else{mlaModal.settings.query[e].searchFields.splice(c,1)}break;case"s[mla_search_alt_text]":c=mlaModal.settings.query[e].searchFields.indexOf("alt-text");if(-1==c){mlaModal.settings.query[e].searchFields.push("alt-text")}else{mlaModal.settings.query[e].searchFields.splice(c,1)}break;case"s[mla_search_excerpt]":c=mlaModal.settings.query[e].searchFields.indexOf("excerpt");if(-1==c){mlaModal.settings.query[e].searchFields.push("excerpt")}else{mlaModal.settings.query[e].searchFields.splice(c,1)}break;case"s[mla_search_content]":c=mlaModal.settings.query[e].searchFields.indexOf("content");if(-1==c){mlaModal.settings.query[e].searchFields.push("content")}else{mlaModal.settings.query[e].searchFields.splice(c,1)}break;case"s[mla_search_terms]":c=mlaModal.settings.query[e].searchFields.indexOf("terms");if(-1==c){mlaModal.settings.query[e].searchFields.push("terms")}else{mlaModal.settings.query[e].searchFields.splice(c,1)}break}}})}else{wp.media.view.MlaSearch=wp.media.View.extend({tagName:"span",className:"mla-simulate-search-button",template:wp.media.template("mla-simulate-search-button"),attributes:{type:"mla-simulate-search-button"},events:{click:"simulateSearch",},render:function(){this.$el.html(this.template(mlaModal.strings));return this},simulateSearch:function(){var b={mla_filter_month:mlaModal.settings.query.initial.filterMonth,mla_filter_term:mlaModal.settings.query.initial.filterTerm,mla_terms_search:mlaModal.settings.termsSearch,mla_search_clicks:mlaModal.settings.searchClicks++,mla_search_value:mlaModal.settings.query.initial.searchValue,mla_search_fields:mlaModal.settings.query.initial.searchFields,mla_search_connector:mlaModal.settings.query.initial.searchConnector};this.model.set({s:b})}})}if(mlaModal.settings.enableMimeTypes||mlaModal.settings.enableMonthsDropdown||mlaModal.settings.enableTermsDropdown||mlaModal.settings.enableTermsSearch||mlaModal.settings.enableSearchBox){wp.media.view.AttachmentsBrowser=wp.media.view.AttachmentsBrowser.extend({createToolbar:function(){var b,c=this.controller._state;mlaModal.settings.state=c;if("undefined"===typeof mlaModal.settings.query[c]){mlaModal.settings.query[c]=_.clone(mlaModal.settings.query.initial);mlaModal.settings.query[c].searchFields=_.clone(mlaModal.settings.query.initial.searchFields)}wp.media.view.AttachmentsBrowser.__super__.createToolbar.apply(this,arguments);mlaModal.utility.mlaAttachmentsBrowser=this;b=this.options.filters;if(("all"===b)&&mlaModal.settings.enableMimeTypes){this.toolbar.unset("filters",{silent:true});this.toolbar.set("filters",new wp.media.view.AttachmentFilters.Mla({controller:this.controller,model:this.collection.props,priority:-80}).render())}if(this.options.search&&mlaModal.settings.enableMonthsDropdown){this.toolbar.unset("dateFilter",{silent:true});this.toolbar.set("dateFilter",new wp.media.view.AttachmentFilters.MlaMonths({controller:this.controller,model:this.collection.props,priority:-75}).render())}if(this.options.search&&mlaModal.settings.enableTermsDropdown){this.toolbar.set("terms",new wp.media.view.AttachmentFilters.MlaTerms({controller:this.controller,model:this.collection.props,priority:-50}).render())}if(this.options.search&&mlaModal.settings.enableTermsSearch){this.toolbar.set("termsSearch",new wp.media.view.MlaTermsSearch({controller:this.controller,model:this.collection.props,priority:-50}).render())}if(this.options.search){if(mlaModal.settings.enableSearchBox){this.toolbar.unset("search",{silent:true});this.toolbar.set("MlaSearch",new wp.media.view.MlaSearch({controller:this.controller,model:this.collection.props,priority:60}).render())}else{this.toolbar.set("MlaSearch",new wp.media.view.MlaSearch({controller:this.controller,model:this.collection.props,priority:70}).render())}}},updateFilters:function(b,c){var d={};if(this.options.search&&mlaModal.settings.enableTermsDropdown&&mlaModal.settings.termsTaxonomy==b){d=mlaModal.utility.parseTermsOptions(c);mlaModal.settings.termsClass=d.termsClass;mlaModal.settings.termsText=d.termsText;mlaModal.settings.termsValue=d.termsValue;this.toolbar.unset("terms",{silent:true});this.toolbar.set("terms",new wp.media.view.AttachmentFilters.MlaTerms({controller:this.controller,model:this.collection.props,priority:-80}).render())}}})}mlaModal.utility.parseTermsOptions=function(h){var g={termsClass:[mlaModal.settings.termsClass[0],mlaModal.settings.termsClass[1]],termsText:[mlaModal.settings.termsText[0],mlaModal.settings.termsText[1]],termsValue:[mlaModal.settings.termsValue[0],mlaModal.settings.termsValue[1]]},d=2,b,c,f=/\<option(( class=\"([^\"]+)\" )|( ))value=((\'([^\']+)\')|(\"([^\"]+)\"))([^\>]*)\>([^\<]*)\<.*/g,e=[];if("object"===typeof h){d=mlaModal.settings.termsValue.length;for(b=2;b<d;b++){e[b]={termsClass:mlaModal.settings.termsClass[b],termsText:mlaModal.settings.termsText[b],termsValue:mlaModal.settings.termsValue[b]};if("undefined"!==typeof h[mlaModal.settings.termsValue[b]]){delete h[mlaModal.settings.termsValue[b]]}}for(c in h){e[b++]={termsClass:"level-0",termsText:h[c],termsValue:c.toString()}}if(d===b){return{termsClass:mlaModal.settings.termsClass,termsText:mlaModal.settings.termsText,termsValue:mlaModal.settings.termsValue}}e.sort(function(j,i){if(j.termsText>i.termsText){return 1}else{if(j.termsText<i.termsText){return -1}else{return 0}}});b=2;for(c in e){g.termsClass[b]=e[c].termsClass;g.termsText[b]=e[c].termsText;g.termsValue[b++]=e[c].termsValue}return g}e=f.exec(h);while(null!==(e=f.exec(h))){g.termsClass[d]=e[3];g.termsValue[d]=("undefined"===typeof e[6])?e[9]:e[7];g.termsText[d++]=e[11].replace("&nbsp;",mlaModal.settings.termsIndent)}return g};mlaModal.utility.arrayCleanup=function(d){var c=[],b=("string"===typeof d);if(b){d=d.split(mlaModal.settings.comma)}jQuery.each(d,function(e,f){f=jQuery.trim(f);if(f&&jQuery.inArray(f,c)==-1){c.push(f)}});c.sort();if(b){c=c.join(mlaModal.settings.comma)}return c};mlaModal.utility.parseTaxonomyId=function(c){var b=c.split("-");b.shift();b.shift();return b.join("-")};mlaModal.tagBox={cleanTags:function(c){var b=mlaModal.settings.comma;if(","!==b){c=c.replace(new RegExp(b,"g"),",")}c=c.replace(/\s*,\s*/g,",").replace(/,+/g,",").replace(/[,\s]+$/,"").replace(/^[,\s]+/,"");if(","!==b){c=c.replace(/,/g,b)}return c},parseTags:function(e){var i=e.id,c=i.split("-check-num-")[1],f=a(e).closest(".tagsdiv"),h=f.find(".the-tags"),b=mlaModal.settings.comma,d=h.val().split(b),g=[];delete d[c];a.each(d,function(j,k){k=a.trim(k);if(k){g.push(k)}});h.val(this.cleanTags(g.join(b)));this.quickClicks(f);return false},quickClicks:function(d){var g=a(".the-tags",d),e=a(".tagchecklist",d),f=a(d).attr("id"),b,c;if(!g.length){return}c=g.prop("disabled");b=g.val().split(mlaModal.settings.comma);e.empty();a.each(b,function(i,k){var j,h;k=a.trim(k);if(!k){return}j=a("<span />").text(k);if(!c){h=a('<a id="'+f+"-check-num-"+i+'" class="ntdelbutton">X</a>');h.click(function(){mlaModal.tagBox.parseTags(this)});j.prepend("&nbsp;").prepend(h)}e.append(j)})},flushTags:function(h,d,c){var j,b,e,k=a(".the-tags",h),g=a("input.newtag",h),i=mlaModal.settings.comma;d=d||false;e=d?a(d).text():g.val();j=k.val();b=j?j+i+e:e;b=mlaModal.utility.arrayCleanup(this.cleanTags(b));k.val(b);this.quickClicks(h);if(!d){g.val("")}if("undefined"==typeof(c)){g.focus()}return false},getCloud:function(c,b){a.post(ajaxurl,{action:"get-tagcloud",tax:b},function(e,d){if(0===e||"success"!=d){e=wpAjax.broken}e=a('<p id="tagcloud-'+b+'" class="the-tagcloud">'+e+"</p>");a("a",e).click(function(){mlaModal.tagBox.flushTags(a(this).closest(".mla-taxonomy-field").children(".tagsdiv"),this);return false});a("#"+c).after(e)})},init:function(f,b,d){var e,c;e=a("#mla-taxonomy-"+b,d);c=a("div.ajaxtag",e);mlaModal.tagBox.quickClicks(e);a("input.tagadd",c).click(function(){mlaModal.tagBox.flushTags(a(this).closest(".tagsdiv"))});a("input.newtag",c).keyup(function(g){if(13==g.which){mlaModal.tagBox.flushTags(e);return false}}).keypress(function(g){if(13==g.which){g.preventDefault();return false}}).each(function(){a(this).suggest(ajaxurl+"?action=ajax-tag-search&tax="+b,{delay:500,resultsClass:"mla_ac_results",selectClass:"mla_ac_over",matchClass:"mla_ac_match",minchars:2,multiple:true,multipleSep:mlaModal.settings.comma+" "})});e.siblings(":first").click(function(){mlaModal.tagBox.getCloud(a("a",this).attr("id"),b);a("a",this).unbind().click(function(){a(this).siblings(".the-tagcloud").toggle();return false});return false});a(".compat-field-"+b+" td",d).on("mouseleave",function(){var j,h=this,g=mlaModal.utility.arrayCleanup(a(".server-tags",h).val()),i=mlaModal.utility.arrayCleanup(a(".the-tags",h).val());if(g===i){return}a(h).css("opacity","0.5");j={id:f,};j[b]=i;wp.media.post(mlaModal.settings.ajaxUpdateCompatAction,j).done(function(l){var k,m;for(k in l){if("object"===typeof(l[k]["object-terms"])){if(null!==mlaModal.utility.mlaAttachmentsBrowser){mlaModal.utility.mlaAttachmentsBrowser.updateFilters(k,l[k]["object-terms"])}delete l[k]["object-terms"]}for(m in l[k]){a("#"+m,h).replaceWith(l[k][m])}}a(h).css("opacity","1.0")})});e.on("change",function(g){g.stopPropagation();return false});a(".the-tags, .server-tags .newtag",e).on("change",function(g){g.stopPropagation();return false})}};if(mlaModal.settings.enableDetailsCategory||mlaModal.settings.enableDetailsTag){wp.media.view.AttachmentCompat=wp.media.view.AttachmentCompat.extend({initialize:function(){wp.media.view.AttachmentCompat.__super__.initialize.apply(this,arguments);this.on("ready",function(){mlaModal.utility.hookCompatTaxonomies(this.model.get("id"),this.el)})}})}if(mlaModal.settings.enableDetailsCategory||mlaModal.settings.enableDetailsTag){wp.media.model.Selection=wp.media.model.Selection.extend({initialize:function(){wp.media.model.Selection.__super__.initialize.apply(this,arguments);this.on("selection:reset",function(){mlaModal.cid=null});this.on("selection:unsingle",function(){mlaModal.cid=null});this.on("selection:single",function(b){mlaModal.cid=b.cid});this.on("change:uploading",function(){mlaModal.uploading=true});this.on("change",function(d){var e=false,b,c,f;if(mlaModal.uploading&&mlaModal.cid===d.cid){mlaModal.uploading=false;e=true}else{f=d.changed;delete f.title;delete f.caption;delete f.alt;delete f.description;if(!_.isEmpty(f)){e=true}}if(true===e){b=wp.media.editor.get("content");c=b.content.get("compat");mlaModal.utility.hookCompatTaxonomies(d.get("id"),c.sidebar.$el)}})}})}mlaModal.utility.hookCompatTaxonomies=function(e,c){var b,d=null;a(".mla-taxonomy-field .categorydiv",c).each(function(){b=mlaModal.utility.parseTaxonomyId(a(this).attr("id"));if(-1!=mlaModal.settings.enhancedTaxonomies.indexOf(b)){a(".compat-field-"+b+" th",c).click({id:e,currentTaxonomy:b,el:c},function(f){mlaModal.utility.fillCompatTaxonomies(f.data)});a("tr.compat-field-"+b,c).each(function(){if(a(this).hasClass("mla-taxonomy-row")){a(this).show()}else{a(this).remove()}});if(null===d){d=b}}else{a("tr.compat-field-"+b,c).each(function(){if(a(this).hasClass("mla-taxonomy-row")){a(this).remove()}})}});a(".mla-taxonomy-field .tagsdiv",c).each(function(){b=mlaModal.utility.parseTaxonomyId(a(this).attr("id"));if(-1!=mlaModal.settings.enhancedTaxonomies.indexOf(b)){a(".compat-field-"+b+" th",c).click({id:e,currentTaxonomy:b,el:c},function(f){mlaModal.utility.fillCompatTaxonomies(f.data)});a("tr.compat-field-"+b,c).each(function(){if(a(this).hasClass("mla-taxonomy-row")){a(this).show()}else{a(this).remove()}});if(null===d){d=b}}else{a("tr.compat-field-"+b,c).each(function(){if(a(this).hasClass("mla-taxonomy-row")){a(this).remove()}})}});if(mlaModal.settings.enableTermsAutofill&&null!==d){a(".compat-field-"+d+" th",c).click()}};mlaModal.utility.fillCompatTaxonomies=function(f){var c=f.el,e=[],b,d;a(".mla-taxonomy-field .categorydiv",c).each(function(){b=mlaModal.utility.parseTaxonomyId(a(this).attr("id"));e[e.length]=b;d=".compat-field-"+b;if("undefined"===typeof(mlaModal.initialHTML[b])){mlaModal.initialHTML[b]=a(d,c).html()}else{a(d,c).html(mlaModal.initialHTML[b])}a(d+" .categorydiv",c).html(mlaModal.strings.loadingText)});a(".mla-taxonomy-field .tagsdiv",c).each(function(){b=mlaModal.utility.parseTaxonomyId(a(this).attr("id"));e[e.length]=b;d=".compat-field-"+b;if("undefined"===typeof(mlaModal.initialHTML[b])){mlaModal.initialHTML[b]=a(d,c).html()}else{a(d,c).html(mlaModal.initialHTML[b])}a(d+" .tagsdiv",c).html(mlaModal.strings.loadingText)});if(e.length){wp.media.post(mlaModal.settings.ajaxFillCompatAction,{id:f.id,query:e,}).done(function(h){var g,i;for(g in h){i=".compat-field-"+g;a(i,c).html(h[g])}mlaModal.utility.supportCompatTaxonomies(f);a(".compat-field-"+f.currentTaxonomy+" td",c).show()})}};mlaModal.utility.supportCompatTaxonomies=function(d){var c=d.id,b=d.el;if(mlaModal.settings.enableDetailsCategory){a(".mla-taxonomy-field .categorydiv",b).each(function(){var g=a(this),e,h,f,k,i,m,l,j;f=mlaModal.utility.parseTaxonomyId(a(this).attr("id"));k=f+"_tab";i="#mla-"+f;m="#mla-new-"+f;l="#mla-search-"+f;j="#mla-attachments-"+c+"-"+f;if(f=="category"){k="cats"}g.find(".category-tabs").show();a(".compat-field-"+f+" th",b).click(function(){a(this).siblings("td").slideToggle()});g.on("mouseleave",function(){var q,n,p=[],o=g.find(i+"-checklist input:checked");o.each(function(){p[p.length]=a(this).val()});p.sort(function(s,r){return s-r});p=p.join(",");n=g.siblings(j).val();if(n===p){return}g.siblings(j).val(p);g.prop("disabled",true);q={id:c,};q[f]=p;wp.media.post(mlaModal.settings.ajaxUpdateCompatAction,q).done(function(s){var r,t;for(r in s){for(t in s[r]){g.find("#"+t).html(s[r][t])}}g.find(l).val("");g.find(i+"-searcher").addClass("mla-hidden-children");g.prop("disabled",false)})});g.on('change input[type="checkbox"]',function(n){n.stopPropagation();return false});g.find(i+"-tabs a").click(function(){var n=a(this).attr("href");a(this).parent().addClass("tabs").siblings("li").removeClass("tabs");g.find(i+"-tabs").siblings(".tabs-panel").hide();g.find(n).show();a(this).focus();if("#mla-"+f+"-all"==n){deleteUserSetting(k)}else{setUserSetting(k,"pop")}return false});if(getUserSetting(k)){g.find(i+'-tabs a[href="#mla-'+f+'-pop"]').click()}g.find(i+"-add-toggle").click(function(){g.find(i+"-searcher").addClass("mla-hidden-children");g.find(i+"-adder").toggleClass("mla-hidden-children");g.find(i+'-tabs a[href="#mla-'+f+'-all"]').click();g.find(i+"-checklist li").show();g.find(i+"-checklist-pop li").show();if(false===g.find(i+"-adder").hasClass("mla-hidden-children")){g.find(m).val("").removeClass("form-input-tip");g.find(m).focus()}return false});g.find(m).keypress(function(n){if(13===n.keyCode){n.preventDefault();g.find(i+"-add-submit").click()}});g.find(i+"-add-submit").click(function(){g.find(m).focus()});e=function(n){if(!g.find(m).val()){return false}n.data+="&"+g.find(i+"-checklist :checked").serialize();g.prop("disabled",true);return n};h=function(q,p){var o,n=g.find("#new"+f+"_parent");g.prop("disabled",false);if("undefined"!=p.parsed.responses[0]&&(o=p.parsed.responses[0].supplemental.newcat_parent)){n.before(o);n.remove();if(null!==mlaModal.utility.mlaAttachmentsBrowser){mlaModal.utility.mlaAttachmentsBrowser.updateFilters(f,o)}}};g.find(i+"-checklist").wpList({alt:"",response:"mla-"+f+"-ajax-response",addBefore:e,addAfter:h});g.find(i+"-checklist, "+i+"-checklist-pop").on("click",'li.popular-category > label input[type="checkbox"]',function(){var n=a(this),p=n.is(":checked"),o=n.val();if(o&&n.parents("#mla-taxonomy-"+f).length){a("#in-"+f+"-"+o+", #in-popular-"+f+"-"+o).prop("checked",p)}});a.extend(a.expr[":"],{matchTerms:function(p,o,n,q){return(p.textContent||p.innerText||"").toLowerCase().indexOf((n[3]||"").toLowerCase())>=0}});g.find(l).keypress(function(n){if(13===n.keyCode){n.preventDefault();g.find(l).val("");g.find(i+"-searcher").addClass("mla-hidden-children");g.find(i+"-checklist li").show();g.find(i+"-checklist-pop li").show();return}});g.find(l).keyup(function(p){var r,q,s,o,n;if(13===p.keyCode){p.preventDefault();g.find(i+"-search-toggle").focus();return}r=g.find(l).val();q=g.find(i+"-checklist li");s=g.find(i+"-checklist-pop li");if(0<r.length){q.hide();s.hide()}else{q.show();s.show()}o=g.find(i+"-checklist label:matchTerms('"+r+"')");o.closest("li").find("li").andSelf().show();o.parents(i+"-checklist li").show();n=g.find(i+"-checklist-pop label:matchTerms('"+r+"')");n.closest("li").find("li").andSelf().show();n.parents(i+"-checklist li").show()});g.find(i+"-search-toggle").click(function(){g.find(i+"-adder ").addClass("mla-hidden-children");g.find(i+"-searcher").toggleClass("mla-hidden-children");g.find(i+'-tabs a[href="#mla-'+f+'-all"]').click();g.find(i+"-checklist li").show();g.find(i+"-checklist-pop li").show();if(false===g.find(i+"-searcher").hasClass("mla-hidden-children")){g.find(l).val("").removeClass("form-input-tip");g.find(l).focus()}return false})})}if(mlaModal.settings.enableDetailsTag){a(".mla-taxonomy-field .tagsdiv",b).each(function(){var e=mlaModal.utility.parseTaxonomyId(a(this).attr("id"));a(".compat-field-"+e+" th",b).click(function(){a(this).siblings("td").slideToggle()});mlaModal.tagBox.init(c,e,b)})}}}(jQuery));
1
+ var wp,wpAjax,ajaxurl,jQuery,_,getUserSetting,setUserSetting,deleteUserSetting,mlaTaxonomy,mlaModal={strings:{},settings:{},initialHTML:{},uploading:false,cid:null,utility:{originalMediaAjax:null,mlaAttachmentsBrowser:null,parseTermsOptions:null,arrayCleanup:null,parseTaxonomyId:null,hookCompatTaxonomies:null,fillCompatTaxonomies:null,supportCompatTaxonomies:null},tagBox:null};(function(a){mlaModal.strings=typeof wp.media.view.l10n.mla_strings==="undefined"?{}:wp.media.view.l10n.mla_strings;delete wp.media.view.l10n.mla_strings;mlaModal.settings=typeof wp.media.view.settings.mla_settings==="undefined"?{screen:"unknown",enableMediaGrid:false,enableMediaModal:false}:wp.media.view.settings.mla_settings;delete wp.media.view.settings.mla_settings;if(!(mlaModal.settings.enableMediaGrid||mlaModal.settings.enableMediaModal)){return}if(("grid"===mlaModal.settings.screen)&&false===mlaModal.settings.enableMediaGrid){return}if(("modal"===mlaModal.settings.screen)&&false===mlaModal.settings.enableMediaModal){return}mlaModal.utility.originalMediaAjax=wp.media.ajax;wp.media.ajax=function(h,d){var g=mlaModal.settings.state,f,c,e,b;if(_.isObject(h)){d=h}else{d=d||{};d.data=_.extend(d.data||{},{action:h})}if("query-attachments"==d.data.action){f=d.data.query;c=typeof f.s;if("object"==c){e=f.s}else{if("string"==c){e={mla_search_value:f.s}}else{e={mla_search_value:""}}}if("undefined"!=typeof f.post_mime_type){mlaModal.settings.query[g].filterMime=f.post_mime_type}else{mlaModal.settings.query[g].filterMime="all"}if("undefined"!=typeof e.mla_filter_month){mlaModal.settings.query[g].filterMonth=e.mla_filter_month}else{if("undefined"!=typeof f.year){mlaModal.settings.query[g].filterMonth=(100*f.year)+(1*f.monthnum)}else{}}if("undefined"!=typeof e.mla_filter_term){mlaModal.settings.query[g].filterTerm=e.mla_filter_term}if("undefined"!=typeof e.mla_search_value){mlaModal.settings.query[g].searchValue=e.mla_search_value}b={mla_filter_month:mlaModal.settings.query[g].filterMonth,mla_filter_term:mlaModal.settings.query[g].filterTerm,mla_terms_search:mlaModal.settings.query[g].termsSearch,mla_search_clicks:mlaModal.settings.query[g].searchClicks,mla_search_value:mlaModal.settings.query[g].searchValue,mla_search_fields:mlaModal.settings.query[g].searchFields,mla_search_connector:mlaModal.settings.query[g].searchConnector};mlaModal.settings.query[g].termsSearch="";a("#mla-terms-search-input").html("").val("");d.data.query.s=b}return mlaModal.utility.originalMediaAjax.call(this,d)};if(mlaModal.settings.enableMimeTypes){wp.media.view.AttachmentFilters.Mla=wp.media.view.AttachmentFilters.extend({createFilters:function(){var c=this.controller._state,b={};_.each(mlaModal.settings.mimeTypes||{},function(e,d){if(("grid"===mlaModal.settings.screen)||("trash"!==d)){b[d]={text:e,props:{type:d,uploadedTo:null,orderby:"date",order:"DESC"}}}});b.all={text:wp.media.view.l10n.allMediaItems,props:{type:null,uploadedTo:null,orderby:"date",order:"DESC"},priority:10};if(wp.media.view.settings.post.id){b.uploaded={text:wp.media.view.l10n.uploadedToThisPost,props:{type:null,uploadedTo:wp.media.view.settings.post.id,orderby:"menuOrder",order:"ASC"},priority:20}}this.filters=b;if("undefined"===typeof b[mlaModal.settings.query[c].filterMime]){mlaModal.settings.query[c].filterMime="all"}if(mlaModal.settings.query[c].filterMime!="all"){this.model.set(b[mlaModal.settings.query[c].filterMime].props,{silent:false})}},select:function(){var e=this.controller._state,b=this.model,d=mlaModal.settings.query[e].filterMime,c=b.toJSON();if(false===mlaModal.settings.enableSearchBox){if("string"==typeof c.search){mlaModal.settings.query[e].searchValue=c.search}else{mlaModal.settings.query[e].searchValue=""}}_.find(this.filters,function(g,h){var f=_.all(g.props,function(j,i){return j===(_.isUndefined(c[i])?null:c[i])});if(f){return d=h}});this.$el.val(d)},change:function(){var b=this.filters[this.el.value];if(b){this.model.set(b.props,{silent:true});a("#mla-search-submit").click()}}})}if(mlaModal.settings.enableMonthsDropdown){wp.media.view.AttachmentFilters.MlaMonths=wp.media.view.AttachmentFilters.extend({className:"attachment-filters",id:"media-attachment-date-filters",createFilters:function(){var c=this.controller._state,b={};_.each(mlaModal.settings.months||{},function(e,d){b[d]={text:e,props:{s:{mla_filter_month:d}}}});this.filters=b;if("undefined"===typeof b[mlaModal.settings.query[c].filterMonth]){mlaModal.settings.query[c].filterMonth=0}if(mlaModal.settings.query[c].filterMonth>0){this.model.set(b[mlaModal.settings.query[c].filterMonth].props,{silent:false})}},select:function(){var e=this.controller._state,b=this.model,d=mlaModal.settings.query[e].filterMonth,c=b.toJSON();if(_.isUndefined(c.s)){c.s={}}if(false===mlaModal.settings.enableSearchBox){if("string"==typeof c.search){mlaModal.settings.query[e].searchValue=c.search}else{mlaModal.settings.query[e].searchValue=""}}if(_.isUndefined(c.s.mla_filter_month)){c.s.mla_filter_month=mlaModal.settings.query[e].filterMonth}else{mlaModal.settings.query[e].filterMonth=c.s.mla_filter_month}_.find(this.filters,function(g,h){var f=_.all(g.props,function(i){return i.mla_filter_month==mlaModal.settings.query[e].filterMonth});if(f){return d=h}});this.$el.val(d)},change:function(){var b=this.filters[this.el.value],c;if(b){c={s:{mla_filter_month:b.props.s.mla_filter_month}};this.model.set(c);a("#mla-search-submit").click()}}})}if(mlaModal.settings.enableTermsDropdown){wp.media.view.AttachmentFilters.MlaTerms=wp.media.view.AttachmentFilters.extend({className:"attachment-filters",id:"media-attachment-term-filters",createFilters:function(){var d=this.controller._state,b,c={};_.each(mlaModal.settings.termsText||{},function(f,e){c[e]={text:f,props:{s:{mla_filter_term:parseInt(mlaModal.settings.termsValue[e])}}}});this.filters=c;b=_.indexOf(mlaModal.settings.termsValue,mlaModal.settings.query[d].filterTerm);if(b>0){this.model.set(c[b].props,{silent:false})}},select:function(){var e=this.controller._state,b=this.model,d=mlaModal.settings.query[e].filterTerm,c=b.toJSON();if(_.isUndefined(c.s)){c.s={}}if(false===mlaModal.settings.enableSearchBox){if("string"==typeof c.search){mlaModal.settings.query[e].searchValue=c.search}else{mlaModal.settings.query[e].searchValue=""}}if(_.isUndefined(c.s.mla_filter_term)){c.s.mla_filter_term=mlaModal.settings.query[e].filterTerm}else{mlaModal.settings.query[e].filterTerm=c.s.mla_filter_term}_.find(this.filters,function(g,h){var f=_.all(g.props,function(i){return i.mla_filter_term==mlaModal.settings.query[e].filterTerm});if(f){return d=h}});this.$el.val(d)},change:function(){var b=this.filters[this.el.value],c;if(b){c={s:{mla_filter_term:b.props.s.mla_filter_term}};this.model.set(c);a("#mla-search-submit").click()}}})}if(mlaModal.settings.enableTermsSearch){wp.media.view.MlaTermsSearch=wp.media.View.extend({tagName:"span",className:"mla-terms-search",template:wp.media.template("mla-terms-search-button"),attributes:{type:"mla-terms-search-button"},events:{change:"termsSearchOpen",click:"termsSearchOpen",},render:function(){this.$el.html(this.template(mlaModal.strings));return this},termsSearchOpen:function(b){if(("click"==b.type)&&("mla_terms_search"===b.target.name)){mlaTaxonomy.termsSearch.open();a("#mla-terms-search-form").off("submit");a("#mla-terms-search-form").submit(function(g){var c,f,d={phrases:"",taxonomies:[]};g.preventDefault();c=a("#mla-terms-search-form").serializeArray();for(f=0;f<c.length;f++){switch(c[f].name){case"mla_terms_search[phrases]":d.phrases=c[f].value;break;case"mla_terms_search[radio_phrases]":d.radio_phrases=c[f].value;break;case"mla_terms_search[radio_terms]":d.radio_terms=c[f].value;break;case"mla_terms_search[taxonomies][]":d.taxonomies[d.taxonomies.length]=c[f].value;break}}mlaModal.settings.query[mlaModal.settings.state].termsSearch=d;a("#mla-search-submit").click();return false});a("#mla-terms-search-input").keypress(function(c){if(13==c.which){c.preventDefault();a("#mla-terms-search-submit").click()}})}}})}if(mlaModal.settings.enableSearchBox){wp.media.view.MlaSearch=wp.media.View.extend({tagName:"div",className:"mla-search-box",template:wp.media.template("mla-search-box"),attributes:{type:"mla-search-box"},events:{input:"search",change:"search",click:"search",search:"search",MlaSearch:"search"},initialize:function(){var b=this.controller._state;if("undefined"===typeof mlaModal.settings.query[b]){mlaModal.settings.query[b]=_.clone(mlaModal.settings.query.initial);mlaModal.settings.query[b].searchFields=_.clone(mlaModal.settings.query.initial.searchFields)}},render:function(){var c=this.controller._state,b=_.extend(mlaModal.strings,mlaModal.settings.query[c]);this.$el.html(this.template(b));return this},search:function(d){var e=this.controller._state,b,f,c;if(("input"==d.type)&&("s[mla_search_value]"==d.target.name)){mlaModal.settings.query[e].searchValue=d.target.value;return}if(("click"==d.type)&&("mla_search_submit"!=d.target.name)){return}switch(d.target.name){case"s[mla_search_value]":mlaModal.settings.query[e].searchValue=d.target.value;break;case"mla_search_submit":b={mla_filter_month:mlaModal.settings.query[e].filterMonth,mla_filter_term:mlaModal.settings.query[e].filterTerm,mla_terms_search:mlaModal.settings.query[e].termsSearch,mla_search_clicks:mlaModal.settings.query[e].searchClicks++,mla_search_value:mlaModal.settings.query[e].searchValue,mla_search_fields:mlaModal.settings.query[e].searchFields,mla_search_connector:mlaModal.settings.query[e].searchConnector};this.model.set({s:b});break;case"s[mla_search_connector]":mlaModal.settings.query[e].searchConnector=d.target.value;break;case"s[mla_search_title]":f=mlaModal.settings.query[e].searchFields;c=f.indexOf("title");if(-1==c){f.push("title")}else{f.splice(c,1)}mlaModal.settings.query[e].searchFields=f;break;case"s[mla_search_name]":c=mlaModal.settings.query[e].searchFields.indexOf("name");if(-1==c){mlaModal.settings.query[e].searchFields.push("name")}else{mlaModal.settings.query[e].searchFields.splice(c,1)}break;case"s[mla_search_alt_text]":c=mlaModal.settings.query[e].searchFields.indexOf("alt-text");if(-1==c){mlaModal.settings.query[e].searchFields.push("alt-text")}else{mlaModal.settings.query[e].searchFields.splice(c,1)}break;case"s[mla_search_excerpt]":c=mlaModal.settings.query[e].searchFields.indexOf("excerpt");if(-1==c){mlaModal.settings.query[e].searchFields.push("excerpt")}else{mlaModal.settings.query[e].searchFields.splice(c,1)}break;case"s[mla_search_content]":c=mlaModal.settings.query[e].searchFields.indexOf("content");if(-1==c){mlaModal.settings.query[e].searchFields.push("content")}else{mlaModal.settings.query[e].searchFields.splice(c,1)}break;case"s[mla_search_terms]":c=mlaModal.settings.query[e].searchFields.indexOf("terms");if(-1==c){mlaModal.settings.query[e].searchFields.push("terms")}else{mlaModal.settings.query[e].searchFields.splice(c,1)}break}}})}else{wp.media.view.MlaSearch=wp.media.View.extend({tagName:"span",className:"mla-simulate-search-button",template:wp.media.template("mla-simulate-search-button"),attributes:{type:"mla-simulate-search-button"},events:{click:"simulateSearch",},render:function(){this.$el.html(this.template(mlaModal.strings));return this},simulateSearch:function(){var c=this.controller._state,b={mla_filter_month:mlaModal.settings.query[c].filterMonth,mla_filter_term:mlaModal.settings.query[c].filterTerm,mla_terms_search:mlaModal.settings.query[c].termsSearch,mla_search_clicks:mlaModal.settings.query[c].searchClicks++,mla_search_value:mlaModal.settings.query[c].searchValue,mla_search_fields:mlaModal.settings.query[c].searchFields,mla_search_connector:mlaModal.settings.query[c].searchConnector};this.model.set({s:b})}})}if(mlaModal.settings.enableMimeTypes||mlaModal.settings.enableMonthsDropdown||mlaModal.settings.enableTermsDropdown||mlaModal.settings.enableTermsSearch||mlaModal.settings.enableSearchBox){wp.media.view.AttachmentsBrowser=wp.media.view.AttachmentsBrowser.extend({createToolbar:function(){var b,c=this.controller._state;mlaModal.settings.state=c;if("undefined"===typeof mlaModal.settings.query[c]){mlaModal.settings.query[c]=_.clone(mlaModal.settings.query.initial);mlaModal.settings.query[c].searchFields=_.clone(mlaModal.settings.query.initial.searchFields)}wp.media.view.AttachmentsBrowser.__super__.createToolbar.apply(this,arguments);mlaModal.utility.mlaAttachmentsBrowser=this;b=this.options.filters;if(("all"===b)&&mlaModal.settings.enableMimeTypes){this.toolbar.unset("filters",{silent:true});this.toolbar.set("filters",new wp.media.view.AttachmentFilters.Mla({controller:this.controller,model:this.collection.props,priority:-80}).render())}if(this.options.search&&mlaModal.settings.enableMonthsDropdown){this.toolbar.unset("dateFilter",{silent:true});this.toolbar.set("dateFilter",new wp.media.view.AttachmentFilters.MlaMonths({controller:this.controller,model:this.collection.props,priority:-75}).render())}if(this.options.search&&mlaModal.settings.enableTermsDropdown){this.toolbar.set("terms",new wp.media.view.AttachmentFilters.MlaTerms({controller:this.controller,model:this.collection.props,priority:-50}).render())}if(this.options.search&&mlaModal.settings.enableTermsSearch){this.toolbar.set("termsSearch",new wp.media.view.MlaTermsSearch({controller:this.controller,model:this.collection.props,priority:-50}).render())}if(this.options.search){if(mlaModal.settings.enableSearchBox){this.toolbar.unset("search",{silent:true});this.toolbar.set("MlaSearch",new wp.media.view.MlaSearch({controller:this.controller,model:this.collection.props,priority:60}).render())}else{this.toolbar.set("MlaSearch",new wp.media.view.MlaSearch({controller:this.controller,model:this.collection.props,priority:70}).render())}}},updateFilters:function(b,c){var d={};if(this.options.search&&mlaModal.settings.enableTermsDropdown&&mlaModal.settings.termsTaxonomy==b){d=mlaModal.utility.parseTermsOptions(c);mlaModal.settings.termsClass=d.termsClass;mlaModal.settings.termsText=d.termsText;mlaModal.settings.termsValue=d.termsValue;this.toolbar.unset("terms",{silent:true});this.toolbar.set("terms",new wp.media.view.AttachmentFilters.MlaTerms({controller:this.controller,model:this.collection.props,priority:-80}).render())}}})}mlaModal.utility.parseTermsOptions=function(h){var g={termsClass:[mlaModal.settings.termsClass[0],mlaModal.settings.termsClass[1]],termsText:[mlaModal.settings.termsText[0],mlaModal.settings.termsText[1]],termsValue:[mlaModal.settings.termsValue[0],mlaModal.settings.termsValue[1]]},d=2,b,c,f=/\<option(( class=\"([^\"]+)\" )|( ))value=((\'([^\']+)\')|(\"([^\"]+)\"))([^\>]*)\>([^\<]*)\<.*/g,e=[];if("object"===typeof h){d=mlaModal.settings.termsValue.length;for(b=2;b<d;b++){e[b]={termsClass:mlaModal.settings.termsClass[b],termsText:mlaModal.settings.termsText[b],termsValue:mlaModal.settings.termsValue[b]};if("undefined"!==typeof h[mlaModal.settings.termsValue[b]]){delete h[mlaModal.settings.termsValue[b]]}}for(c in h){e[b++]={termsClass:"level-0",termsText:h[c],termsValue:c.toString()}}if(d===b){return{termsClass:mlaModal.settings.termsClass,termsText:mlaModal.settings.termsText,termsValue:mlaModal.settings.termsValue}}e.sort(function(j,i){if(j.termsText>i.termsText){return 1}else{if(j.termsText<i.termsText){return -1}else{return 0}}});b=2;for(c in e){g.termsClass[b]=e[c].termsClass;g.termsText[b]=e[c].termsText;g.termsValue[b++]=e[c].termsValue}return g}e=f.exec(h);while(null!==(e=f.exec(h))){g.termsClass[d]=e[3];g.termsValue[d]=("undefined"===typeof e[6])?e[9]:e[7];g.termsText[d++]=e[11].replace("&nbsp;",mlaModal.settings.termsIndent)}return g};mlaModal.utility.arrayCleanup=function(d){var c=[],b=("string"===typeof d);if(b){d=d.split(mlaModal.settings.comma)}jQuery.each(d,function(e,f){f=jQuery.trim(f);if(f&&jQuery.inArray(f,c)==-1){c.push(f)}});c.sort();if(b){c=c.join(mlaModal.settings.comma)}return c};mlaModal.utility.parseTaxonomyId=function(c){var b=c.split("-");b.shift();b.shift();return b.join("-")};mlaModal.tagBox={cleanTags:function(c){var b=mlaModal.settings.comma;if(","!==b){c=c.replace(new RegExp(b,"g"),",")}c=c.replace(/\s*,\s*/g,",").replace(/,+/g,",").replace(/[,\s]+$/,"").replace(/^[,\s]+/,"");if(","!==b){c=c.replace(/,/g,b)}return c},parseTags:function(e){var i=e.id,c=i.split("-check-num-")[1],f=a(e).closest(".tagsdiv"),h=f.find(".the-tags"),b=mlaModal.settings.comma,d=h.val().split(b),g=[];delete d[c];a.each(d,function(j,k){k=a.trim(k);if(k){g.push(k)}});h.val(this.cleanTags(g.join(b)));this.quickClicks(f);return false},quickClicks:function(d){var g=a(".the-tags",d),e=a(".tagchecklist",d),f=a(d).attr("id"),b,c;if(!g.length){return}c=g.prop("disabled");b=g.val().split(mlaModal.settings.comma);e.empty();a.each(b,function(i,k){var j,h;k=a.trim(k);if(!k){return}j=a("<span />").text(k);if(!c){h=a('<a id="'+f+"-check-num-"+i+'" class="ntdelbutton">X</a>');h.click(function(){mlaModal.tagBox.parseTags(this)});j.prepend("&nbsp;").prepend(h)}e.append(j)})},flushTags:function(h,d,c){var j,b,e,k=a(".the-tags",h),g=a("input.newtag",h),i=mlaModal.settings.comma;d=d||false;e=d?a(d).text():g.val();j=k.val();b=j?j+i+e:e;b=mlaModal.utility.arrayCleanup(this.cleanTags(b));k.val(b);this.quickClicks(h);if(!d){g.val("")}if("undefined"==typeof(c)){g.focus()}return false},getCloud:function(c,b){a.post(ajaxurl,{action:"get-tagcloud",tax:b},function(e,d){if(0===e||"success"!=d){e=wpAjax.broken}e=a('<p id="tagcloud-'+b+'" class="the-tagcloud">'+e+"</p>");a("a",e).click(function(){mlaModal.tagBox.flushTags(a(this).closest(".mla-taxonomy-field").children(".tagsdiv"),this);return false});a("#"+c).after(e)})},init:function(f,b,d){var e,c;e=a("#mla-taxonomy-"+b,d);c=a("div.ajaxtag",e);mlaModal.tagBox.quickClicks(e);a("input.tagadd",c).click(function(){mlaModal.tagBox.flushTags(a(this).closest(".tagsdiv"))});a("input.newtag",c).keyup(function(g){if(13==g.which){mlaModal.tagBox.flushTags(e);return false}}).keypress(function(g){if(13==g.which){g.preventDefault();return false}}).each(function(){a(this).suggest(ajaxurl+"?action=ajax-tag-search&tax="+b,{delay:500,resultsClass:"mla_ac_results",selectClass:"mla_ac_over",matchClass:"mla_ac_match",minchars:2,multiple:true,multipleSep:mlaModal.settings.comma+" "})});e.siblings(":first").click(function(){mlaModal.tagBox.getCloud(a("a",this).attr("id"),b);a("a",this).unbind().click(function(){a(this).siblings(".the-tagcloud").toggle();return false});return false});a(".compat-field-"+b+" td",d).on("mouseleave",function(){var j,h=this,g=mlaModal.utility.arrayCleanup(a(".server-tags",h).val()),i=mlaModal.utility.arrayCleanup(a(".the-tags",h).val());if(g===i){return}a(h).css("opacity","0.5");j={id:f,};j[b]=i;wp.media.post(mlaModal.settings.ajaxUpdateCompatAction,j).done(function(l){var k,m;for(k in l){if("object"===typeof(l[k]["object-terms"])){if(null!==mlaModal.utility.mlaAttachmentsBrowser){mlaModal.utility.mlaAttachmentsBrowser.updateFilters(k,l[k]["object-terms"])}delete l[k]["object-terms"]}for(m in l[k]){a("#"+m,h).replaceWith(l[k][m])}}a(h).css("opacity","1.0")})});e.on("change",function(g){g.stopPropagation();return false});a(".the-tags, .server-tags .newtag",e).on("change",function(g){g.stopPropagation();return false})}};if(mlaModal.settings.enableDetailsCategory||mlaModal.settings.enableDetailsTag){wp.media.view.AttachmentCompat=wp.media.view.AttachmentCompat.extend({initialize:function(){wp.media.view.AttachmentCompat.__super__.initialize.apply(this,arguments);this.on("ready",function(){mlaModal.utility.hookCompatTaxonomies(this.model.get("id"),this.el)})}})}if(mlaModal.settings.enableDetailsCategory||mlaModal.settings.enableDetailsTag){wp.media.model.Selection=wp.media.model.Selection.extend({initialize:function(){wp.media.model.Selection.__super__.initialize.apply(this,arguments);this.on("selection:reset",function(){mlaModal.cid=null});this.on("selection:unsingle",function(){mlaModal.cid=null});this.on("selection:single",function(b){mlaModal.cid=b.cid});this.on("change:uploading",function(){mlaModal.uploading=true});this.on("change",function(d){var e=false,b,c,f;if(mlaModal.uploading&&mlaModal.cid===d.cid){mlaModal.uploading=false;e=true}else{if(false===d.attributes.uploading){f=_.clone(d.changed);delete f.title;delete f.caption;delete f.alt;delete f.description;if(!_.isEmpty(f)){e=true}}}if(true===e){mlaModal.utility.hookCompatTaxonomies(d.get("id"),wp.media.frame.$el)}})}})}mlaModal.utility.hookCompatTaxonomies=function(e,c){var b,d=null;a(".mla-taxonomy-field .categorydiv",c).each(function(){b=mlaModal.utility.parseTaxonomyId(a(this).attr("id"));if(-1!=mlaModal.settings.enhancedTaxonomies.indexOf(b)){a(".compat-field-"+b+" th",c).click({id:e,currentTaxonomy:b,el:c},function(f){mlaModal.utility.fillCompatTaxonomies(f.data)});a("tr.compat-field-"+b,c).each(function(){if(a(this).hasClass("mla-taxonomy-row")){a(this).show()}else{a(this).remove()}});if(null===d){d=b}}else{a("tr.compat-field-"+b,c).each(function(){if(a(this).hasClass("mla-taxonomy-row")){a(this).remove()}})}});a(".mla-taxonomy-field .tagsdiv",c).each(function(){b=mlaModal.utility.parseTaxonomyId(a(this).attr("id"));if(-1!=mlaModal.settings.enhancedTaxonomies.indexOf(b)){a(".compat-field-"+b+" th",c).click({id:e,currentTaxonomy:b,el:c},function(f){mlaModal.utility.fillCompatTaxonomies(f.data)});a("tr.compat-field-"+b,c).each(function(){if(a(this).hasClass("mla-taxonomy-row")){a(this).show()}else{a(this).remove()}});if(null===d){d=b}}else{a("tr.compat-field-"+b,c).each(function(){if(a(this).hasClass("mla-taxonomy-row")){a(this).remove()}})}});if(mlaModal.settings.enableTermsAutofill&&null!==d){a(".compat-field-"+d+" th",c).click()}};mlaModal.utility.fillCompatTaxonomies=function(f){var c=f.el,e=[],b,d;a(".mla-taxonomy-field .categorydiv",c).each(function(){b=mlaModal.utility.parseTaxonomyId(a(this).attr("id"));e[e.length]=b;d=".compat-field-"+b;if("undefined"===typeof(mlaModal.initialHTML[b])){mlaModal.initialHTML[b]=a(d,c).html()}else{a(d,c).html(mlaModal.initialHTML[b])}a(d+" .categorydiv",c).html(mlaModal.strings.loadingText)});a(".mla-taxonomy-field .tagsdiv",c).each(function(){b=mlaModal.utility.parseTaxonomyId(a(this).attr("id"));e[e.length]=b;d=".compat-field-"+b;if("undefined"===typeof(mlaModal.initialHTML[b])){mlaModal.initialHTML[b]=a(d,c).html()}else{a(d,c).html(mlaModal.initialHTML[b])}a(d+" .tagsdiv",c).html(mlaModal.strings.loadingText)});if(e.length){wp.media.post(mlaModal.settings.ajaxFillCompatAction,{id:f.id,query:e,}).done(function(h){var g,i;for(g in h){i=".compat-field-"+g;a(i,c).html(h[g])}mlaModal.utility.supportCompatTaxonomies(f);a(".compat-field-"+f.currentTaxonomy+" td",c).show()})}};mlaModal.utility.supportCompatTaxonomies=function(d){var c=d.id,b=d.el;if(mlaModal.settings.enableDetailsCategory){a(".mla-taxonomy-field .categorydiv",b).each(function(){var g=a(this),e,h,f,k,i,m,l,j;f=mlaModal.utility.parseTaxonomyId(a(this).attr("id"));k=f+"_tab";i="#mla-"+f;m="#mla-new-"+f;l="#mla-search-"+f;j="#mla-attachments-"+c+"-"+f;if(f=="category"){k="cats"}g.find(".category-tabs").show();a(".compat-field-"+f+" th",b).click(function(){a(this).siblings("td").slideToggle()});g.on("mouseleave",function(){var q,n,p=[],o=g.find(i+"-checklist input:checked");o.each(function(){p[p.length]=a(this).val()});p.sort(function(s,r){return s-r});p=p.join(",");n=g.siblings(j).val();if(n===p){return}g.siblings(j).val(p);g.prop("disabled",true);q={id:c,};q[f]=p;wp.media.post(mlaModal.settings.ajaxUpdateCompatAction,q).done(function(s){var r,t;for(r in s){for(t in s[r]){g.find("#"+t).html(s[r][t])}}g.find(l).val("");g.find(i+"-searcher").addClass("mla-hidden-children");g.prop("disabled",false)})});g.on('change input[type="checkbox"]',function(n){n.stopPropagation();return false});g.find(i+"-tabs a").click(function(){var n=a(this).attr("href");a(this).parent().addClass("tabs").siblings("li").removeClass("tabs");g.find(i+"-tabs").siblings(".tabs-panel").hide();g.find(n).show();a(this).focus();if("#mla-"+f+"-all"==n){deleteUserSetting(k)}else{setUserSetting(k,"pop")}return false});if(getUserSetting(k)){g.find(i+'-tabs a[href="#mla-'+f+'-pop"]').click()}g.find(i+"-add-toggle").click(function(){g.find(i+"-searcher").addClass("mla-hidden-children");g.find(i+"-adder").toggleClass("mla-hidden-children");g.find(i+'-tabs a[href="#mla-'+f+'-all"]').click();g.find(i+"-checklist li").show();g.find(i+"-checklist-pop li").show();if(false===g.find(i+"-adder").hasClass("mla-hidden-children")){g.find(m).val("").removeClass("form-input-tip");g.find(m).focus()}return false});g.find(m).keypress(function(n){if(13===n.keyCode){n.preventDefault();g.find(i+"-add-submit").click()}});g.find(i+"-add-submit").click(function(){g.find(m).focus()});e=function(n){if(!g.find(m).val()){return false}n.data+="&"+g.find(i+"-checklist :checked").serialize();g.prop("disabled",true);return n};h=function(q,p){var o,n=g.find("#new"+f+"_parent");g.prop("disabled",false);if("undefined"!=p.parsed.responses[0]&&(o=p.parsed.responses[0].supplemental.newcat_parent)){n.before(o);n.remove();if(null!==mlaModal.utility.mlaAttachmentsBrowser){mlaModal.utility.mlaAttachmentsBrowser.updateFilters(f,o)}}};g.find(i+"-checklist").wpList({alt:"",response:"mla-"+f+"-ajax-response",addBefore:e,addAfter:h});g.find(i+"-checklist, "+i+"-checklist-pop").on("click",'li.popular-category > label input[type="checkbox"]',function(){var n=a(this),p=n.is(":checked"),o=n.val();if(o&&n.parents("#mla-taxonomy-"+f).length){a("#in-"+f+"-"+o+", #in-popular-"+f+"-"+o).prop("checked",p)}});a.extend(a.expr[":"],{matchTerms:function(p,o,n,q){return(p.textContent||p.innerText||"").toLowerCase().indexOf((n[3]||"").toLowerCase())>=0}});g.find(l).keypress(function(n){if(13===n.keyCode){n.preventDefault();g.find(l).val("");g.find(i+"-searcher").addClass("mla-hidden-children");g.find(i+"-checklist li").show();g.find(i+"-checklist-pop li").show();return}});g.find(l).keyup(function(p){var r,q,s,o,n;if(13===p.keyCode){p.preventDefault();g.find(i+"-search-toggle").focus();return}r=g.find(l).val();q=g.find(i+"-checklist li");s=g.find(i+"-checklist-pop li");if(0<r.length){q.hide();s.hide()}else{q.show();s.show()}o=g.find(i+"-checklist label:matchTerms('"+r+"')");o.closest("li").find("li").andSelf().show();o.parents(i+"-checklist li").show();n=g.find(i+"-checklist-pop label:matchTerms('"+r+"')");n.closest("li").find("li").andSelf().show();n.parents(i+"-checklist li").show()});g.find(i+"-search-toggle").click(function(){g.find(i+"-adder ").addClass("mla-hidden-children");g.find(i+"-searcher").toggleClass("mla-hidden-children");g.find(i+'-tabs a[href="#mla-'+f+'-all"]').click();g.find(i+"-checklist li").show();g.find(i+"-checklist-pop li").show();if(false===g.find(i+"-searcher").hasClass("mla-hidden-children")){g.find(l).val("").removeClass("form-input-tip");g.find(l).focus()}return false})})}if(mlaModal.settings.enableDetailsTag){a(".mla-taxonomy-field .tagsdiv",b).each(function(){var e=mlaModal.utility.parseTaxonomyId(a(this).attr("id"));a(".compat-field-"+e+" th",b).click(function(){a(this).siblings("td").slideToggle()});mlaModal.tagBox.init(c,e,b)})}}}(jQuery));
languages/media-library-assistant-en_US.pot CHANGED
@@ -1,8 +1,8 @@
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Media Library Assistant\n"
4
- "POT-Creation-Date: 2014-08-25 16:35-0800\n"
5
- "PO-Revision-Date: 2014-08-25 16:35-0800\n"
6
  "Last-Translator: David Lingren <david@fairtradejudaica.org>\n"
7
  "Language-Team: David Lingren <david@fairtradejudaica.org>\n"
8
  "Language: en_US\n"
@@ -140,206 +140,207 @@ msgid "DEBUG: _execute_list_table_query SQL_request = \"%1$s\"."
140
  msgstr ""
141
 
142
  #. translators: 1: search filter details
143
- #: includes/class-mla-data.php:1984
144
  #, php-format
145
  msgid "mla_query_posts_search_filter not numeric, = \"%1$s\"."
146
  msgstr ""
147
 
148
  #. translators: 1: search filter details
149
- #: includes/class-mla-data.php:1987
150
  #, php-format
151
  msgctxt "error_log"
152
  msgid "DEBUG: mla_query_posts_search_filter not numeric, = \"%1$s\"."
153
  msgstr ""
154
 
155
  #. translators: 1: where filter details
156
- #: includes/class-mla-data.php:2049
157
  #, php-format
158
  msgid "mla_query_posts_where_filter = \"%1$s\"."
159
  msgstr ""
160
 
161
  #. translators: 1: where filter details
162
- #: includes/class-mla-data.php:2052
163
  #, php-format
164
  msgctxt "error_log"
165
  msgid "DEBUG: mla_query_posts_where_filter = \"%1$s\"."
166
  msgstr ""
167
 
168
  #. translators: 1: join filter details
169
- #: includes/class-mla-data.php:2103
170
  #, php-format
171
  msgid "mla_query_posts_join_filter = \"%1$s\"."
172
  msgstr ""
173
 
174
  #. translators: 1: join filter details
175
- #: includes/class-mla-data.php:2106
176
  #, php-format
177
  msgctxt "error_log"
178
  msgid "DEBUG: mla_query_posts_join_filter = \"%1$s\"."
179
  msgstr ""
180
 
181
  #. translators: 1: orderby details details
182
- #: includes/class-mla-data.php:2205
183
  #, php-format
184
  msgid "mla_query_posts_orderby_filter = \"%1$s\"."
185
  msgstr ""
186
 
187
  #. translators: 1: orderby details details
188
- #: includes/class-mla-data.php:2208
189
  #, php-format
190
  msgctxt "error_log"
191
  msgid "DEBUG: mla_query_posts_orderby_filter = \"%1$s\"."
192
  msgstr ""
193
 
194
  #. translators: 1: SQL clauses
195
- #: includes/class-mla-data.php:2244
196
  #, php-format
197
  msgid "mla_query_posts_clauses_filter = \"%1$s\"."
198
  msgstr ""
199
 
200
  #. translators: 1: SQL clauses
201
- #: includes/class-mla-data.php:2247
202
  #, php-format
203
  msgctxt "error_log"
204
  msgid "DEBUG: mla_query_posts_clauses_filter = \"%1$s\"."
205
  msgstr ""
206
 
207
  #. translators: 1: SQL clauses
208
- #: includes/class-mla-data.php:2268
209
  #, php-format
210
  msgid "mla_query_posts_clauses_request_filter = \"%1$s\"."
211
  msgstr ""
212
 
213
  #. translators: 1: SQL clauses
214
- #: includes/class-mla-data.php:2271
215
  #, php-format
216
  msgctxt "error_log"
217
  msgid "DEBUG: mla_query_posts_clauses_request_filter = \"%1$s\"."
218
  msgstr ""
219
 
220
  #. translators: 1: post ID
221
- #: includes/class-mla-data.php:2303
222
  #, php-format
223
  msgctxt "error_log"
224
  msgid "ERROR: mla_get_attachment_by_id(%1$d) not found."
225
  msgstr ""
226
 
227
  #. translators: 1: post ID 2: post_type
228
- #: includes/class-mla-data.php:2309
229
  #, php-format
230
  msgctxt "error_log"
231
  msgid "ERROR: mla_get_attachment_by_id(%1$d) wrong post_type \"%2$s\"."
232
  msgstr ""
233
 
234
- #: includes/class-mla-data.php:2862 includes/class-mla-list-table.php:830
 
235
  msgid "NO REFERENCE TESTS"
236
  msgstr ""
237
 
238
- #: includes/class-mla-data.php:2868 includes/class-mla-options.php:2641
239
- #: includes/class-mla-options.php:2642
240
  msgid "ORPHAN"
241
  msgstr ""
242
 
243
- #: includes/class-mla-data.php:2872
244
  msgid "UNUSED"
245
  msgstr ""
246
 
247
- #: includes/class-mla-data.php:2877
248
  msgid "UNATTACHED"
249
  msgstr ""
250
 
251
- #: includes/class-mla-data.php:2879
252
  msgid "INVALID PARENT"
253
  msgstr ""
254
 
255
  #. translators: 1: post_type, 2: post_title, 3: post ID, 4: query string, 5: error message
256
- #: includes/class-mla-data.php:3060
257
  #, php-format
258
  msgid "(%1$s) %2$s (ID %3$d) query \"%4$s\" failed, returning \"%5$s\""
259
  msgstr ""
260
 
261
  #. translators: 1: index
262
- #: includes/class-mla-data.php:3306
263
  #, php-format
264
  msgctxt "error_log"
265
  msgid "ERROR: _build_pdf_indirect_objects bad value at $index = \"%1$d\"."
266
  msgstr ""
267
 
268
  #. translators: 1: source offset 2: nest level
269
- #: includes/class-mla-data.php:3631
270
  #, php-format
271
  msgctxt "error_log"
272
  msgid "ERROR: _parse_pdf_dictionary offset = %1$d, nest = %2$d."
273
  msgstr ""
274
 
275
  #. translators: 1: dictionary excerpt
276
- #: includes/class-mla-data.php:3633
277
  #, php-format
278
  msgctxt "error_log"
279
  msgid "ERROR: _parse_pdf_dictionary no end delimiter dump = %1$s."
280
  msgstr ""
281
 
282
  #. translators: 1: entry name 2: value excerpt
283
- #: includes/class-mla-data.php:3679
284
  #, php-format
285
  msgctxt "error_log"
286
  msgid "ERROR: _parse_pdf_dictionary bad value [ %1$s ] dump = %2$s"
287
  msgstr ""
288
 
289
- #: includes/class-mla-data.php:3793
290
  msgctxt "error_log"
291
  msgid "ERROR: _parse_xmp_metadata xml_parse_into_struct failed."
292
  msgstr ""
293
 
294
- #: includes/class-mla-data.php:3796
295
  msgctxt "error_log"
296
  msgid "ERROR: _parse_xmp_metadata set option failed."
297
  msgstr ""
298
 
299
  #. translators: 1: path and file
300
- #: includes/class-mla-data.php:4153
301
  #, php-format
302
  msgctxt "error_log"
303
  msgid "ERROR: File \"%1$s\", startxref not found."
304
  msgstr ""
305
 
306
  #. translators: 1: meta_key
307
- #: includes/class-mla-data.php:5070
308
  #, php-format
309
  msgid "Deleting meta:%1$s"
310
  msgstr ""
311
 
312
  #. translators: 1: meta_key
313
- #: includes/class-mla-data.php:5073
314
  #, php-format
315
  msgid "ERROR: meta:%1$s not found"
316
  msgstr ""
317
 
318
  #. translators: 1: meta_key 2: meta_value
319
- #: includes/class-mla-data.php:5082
320
  #, php-format
321
  msgid "Adding meta:%1$s = %2$s"
322
  msgstr ""
323
 
324
  #. translators: 1: meta_key
325
- #: includes/class-mla-data.php:5086
326
  #, php-format
327
  msgid "ERROR: Adding meta:%1$s; not found"
328
  msgstr ""
329
 
330
  #. translators: 1: meta_key
331
- #: includes/class-mla-data.php:5093
332
  #, php-format
333
  msgid "Deleting Null meta:%1$s"
334
  msgstr ""
335
 
336
  #. translators: 1: element name 2: old_value 3: new_value
337
- #: includes/class-mla-data.php:5103 includes/class-mla-data.php:5254
338
- #: includes/class-mla-data.php:5315 includes/class-mla-data.php:5341
339
- #: includes/class-mla-data.php:5375 includes/class-mla-data.php:5388
340
- #: includes/class-mla-data.php:5397 includes/class-mla-data.php:5408
341
- #: includes/class-mla-data.php:5419 includes/class-mla-data.php:5432
342
- #: includes/class-mla-data.php:5441 includes/class-mla-data.php:5450
343
  #: includes/class-mla-mime-types.php:1052
344
  #: includes/class-mla-mime-types.php:2125
345
  #, php-format
@@ -347,46 +348,46 @@ msgid "Changing %1$s from \"%2$s\" to \"%3$s\""
347
  msgstr ""
348
 
349
  #. translators: 1: meta_key
350
- #: includes/class-mla-data.php:5108
351
  #, php-format
352
  msgid "ERROR: Changing meta:%1$s; not found"
353
  msgstr ""
354
 
355
  #. translators: 1: meta_key
356
- #: includes/class-mla-data.php:5168
357
  #, php-format
358
  msgid "Deleting %1$s"
359
  msgstr ""
360
 
361
  #. translators: 1: meta_key 2: new_value
362
- #: includes/class-mla-data.php:5179
363
  #, php-format
364
  msgid "Adding %1$s = [%2$s]"
365
  msgstr ""
366
 
367
  #. translators: 1: meta_key 2: meta_value
368
- #: includes/class-mla-data.php:5185
369
  #, php-format
370
  msgid "Adding %1$s = %2$s"
371
  msgstr ""
372
 
373
  #. translators: 1: meta_key
374
- #: includes/class-mla-data.php:5209
375
  #, php-format
376
  msgid "Deleting old %1$s values"
377
  msgstr ""
378
 
379
  #. translators: 1: meta_key 2: old_value 3: new_value 4: update count
380
- #: includes/class-mla-data.php:5239
381
  #, php-format
382
  msgid "Changing %1$s from \"%2$s\" to \"%3$s\"; %4$d updates"
383
  msgstr ""
384
 
385
- #: includes/class-mla-data.php:5297 includes/class-mla-main.php:1892
386
  msgid "ERROR: Could not retrieve Attachment."
387
  msgstr ""
388
 
389
- #: includes/class-mla-data.php:5315 includes/class-mla-main.php:1305
390
  #: includes/class-mla-main.php:1549 includes/class-mla-main.php:1739
391
  #: includes/class-mla-main.php:2110 includes/class-mla-objects.php:275
392
  #: includes/class-mla-options.php:1017 includes/class-mla-options.php:1777
@@ -396,29 +397,29 @@ msgid "Title"
396
  msgstr ""
397
 
398
  #. translators: 1: old_value
399
- #: includes/class-mla-data.php:5338
400
  #, php-format
401
  msgid "ERROR: Could not change Name/Slug \"%1$s\"; name already exists"
402
  msgstr ""
403
 
404
- #: includes/class-mla-data.php:5341 includes/class-mla-main.php:1740
405
  #: includes/class-mla-main.php:2113 includes/class-mla-options.php:1024
406
  msgid "Name/Slug"
407
  msgstr ""
408
 
409
  #. translators: 1: old_value
410
- #: includes/class-mla-data.php:5367
411
  #, php-format
412
  msgid "Deleting ALT Text, was \"%1$s\""
413
  msgstr ""
414
 
415
  #. translators: 1: old_value
416
- #: includes/class-mla-data.php:5370
417
  #, php-format
418
  msgid "ERROR: Could not delete ALT Text, remains \"%1$s\""
419
  msgstr ""
420
 
421
- #: includes/class-mla-data.php:5375 includes/class-mla-list-table.php:1069
422
  #: includes/class-mla-main.php:1743 includes/class-mla-main.php:2116
423
  #: includes/class-mla-options.php:1031 includes/class-mla-options.php:1783
424
  #: includes/mla-main-search-box-template.php:44
@@ -427,12 +428,12 @@ msgid "ALT Text"
427
  msgstr ""
428
 
429
  #. translators: 1: old_value 2: new_value
430
- #: includes/class-mla-data.php:5378
431
  #, php-format
432
  msgid "ERROR: Could not change ALT Text from \"%1$s\" to \"%2$s\""
433
  msgstr ""
434
 
435
- #: includes/class-mla-data.php:5388 includes/class-mla-main.php:1741
436
  #: includes/class-mla-main.php:2119 includes/class-mla-options.php:1038
437
  #: includes/class-mla-options.php:1786
438
  #: includes/mla-main-search-box-template.php:45
@@ -440,7 +441,7 @@ msgstr ""
440
  msgid "Caption"
441
  msgstr ""
442
 
443
- #: includes/class-mla-data.php:5397 includes/class-mla-main.php:1742
444
  #: includes/class-mla-main.php:2121 includes/class-mla-options.php:1045
445
  #: includes/class-mla-options.php:1789 includes/class-mla-settings.php:1158
446
  #: includes/class-mla-settings.php:1415 includes/class-mla-settings.php:1514
@@ -450,80 +451,80 @@ msgstr ""
450
  msgid "Description"
451
  msgstr ""
452
 
453
- #: includes/class-mla-data.php:5408 includes/class-mla-list-table.php:804
454
  #: includes/class-mla-list-table.php:896 includes/class-mla-options.php:4099
455
  #: includes/class-mla-options.php:4439
456
  msgid "Parent"
457
  msgstr ""
458
 
459
- #: includes/class-mla-data.php:5419 includes/class-mla-edit-media.php:307
460
  #: includes/class-mla-edit-media.php:447 includes/class-mla-main.php:1746
461
  #: includes/class-mla-main.php:2127 includes/class-mla-settings.php:1156
462
  #: includes/class-mla-settings.php:1413
463
  msgid "Menu Order"
464
  msgstr ""
465
 
466
- #: includes/class-mla-data.php:5432 includes/class-mla-list-table.php:1218
467
  #: includes/class-mla-main.php:1616 includes/class-mla-main.php:1718
468
  #: includes/class-mla-main.php:1941
469
  msgid "Author"
470
  msgstr ""
471
 
472
- #: includes/class-mla-data.php:5441 includes/class-mla-main.php:1757
473
  msgid "Comments"
474
  msgstr ""
475
 
476
- #: includes/class-mla-data.php:5450 includes/class-mla-main.php:1758
477
  msgid "Pings"
478
  msgstr ""
479
 
480
- #: includes/class-mla-data.php:5484
481
  msgid "Adding"
482
  msgstr ""
483
 
484
- #: includes/class-mla-data.php:5488
485
  msgid "Removing"
486
  msgstr ""
487
 
488
- #: includes/class-mla-data.php:5493
489
  msgid "Replacing"
490
  msgstr ""
491
 
492
- #: includes/class-mla-data.php:5497
493
  msgid "Ignoring"
494
  msgstr ""
495
 
496
  #. translators: 1: action_name, 2: taxonomy
497
- #: includes/class-mla-data.php:5509
498
  #, php-format
499
  msgid "%1$s \"%2$s\" terms"
500
  msgstr ""
501
 
502
  #. translators: 1: taxonomy
503
- #: includes/class-mla-data.php:5513
504
  #, php-format
505
  msgid "You cannot assign \"%1$s\" terms"
506
  msgstr ""
507
 
508
  #. translators: 1: post ID
509
- #: includes/class-mla-data.php:5525
510
  #, php-format
511
  msgid "Item %1$d, no changes detected."
512
  msgstr ""
513
 
514
  #. translators: 1: post ID
515
- #: includes/class-mla-data.php:5537
516
  #, php-format
517
  msgid "Item %1$d updated."
518
  msgstr ""
519
 
520
  #. translators: 1: post ID
521
- #: includes/class-mla-data.php:5551
522
  #, php-format
523
  msgid "ERROR: Item %1$d update failed."
524
  msgstr ""
525
 
526
- #: includes/class-mla-data.php:5574 includes/class-mla-edit-media.php:125
527
  #: includes/class-mla-edit-media.php:170 includes/class-mla-main.php:330
528
  #: includes/class-mla-main.php:358 includes/class-mla-main.php:1444
529
  #: includes/class-mla-settings.php:311 includes/class-mla-settings.php:329
@@ -1007,8 +1008,8 @@ msgstr ""
1007
  #: includes/class-mla-settings.php:1224 includes/class-mla-settings.php:1301
1008
  #: includes/class-mla-settings.php:1690 includes/class-mla-settings.php:1769
1009
  #: includes/class-mla-settings.php:2320 includes/class-mla-settings.php:2443
1010
- #: includes/class-mla-settings.php:2578 includes/class-mla-shortcodes.php:1261
1011
- #: includes/class-mla-shortcodes.php:1335
1012
  msgid "ERROR:"
1013
  msgstr ""
1014
 
@@ -3889,116 +3890,116 @@ msgstr ""
3889
  msgid "Settings imported; %1$s updated, %2$s unchanged."
3890
  msgstr ""
3891
 
3892
- #: includes/class-mla-shortcodes.php:163
3893
- #: includes/class-mla-shortcodes.php:1086
3894
- #: includes/class-mla-shortcodes.php:1955
3895
- #: includes/class-mla-shortcodes.php:2220
3896
  msgid "Previous"
3897
  msgstr ""
3898
 
3899
- #: includes/class-mla-shortcodes.php:164
3900
- #: includes/class-mla-shortcodes.php:1087
3901
- #: includes/class-mla-shortcodes.php:2002
3902
- #: includes/class-mla-shortcodes.php:2226
3903
  msgid "Next"
3904
  msgstr ""
3905
 
3906
- #: includes/class-mla-shortcodes.php:245
3907
  msgid "mla_debug empty gallery"
3908
  msgstr ""
3909
 
3910
- #: includes/class-mla-shortcodes.php:309
3911
  msgid ""
3912
  "<strong>Photonic-enhanced [mla_gallery]</strong> type must be "
3913
  "<strong>default</strong>, query = "
3914
  msgstr ""
3915
 
3916
- #: includes/class-mla-shortcodes.php:625
3917
  msgid "unattached"
3918
  msgstr ""
3919
 
3920
- #: includes/class-mla-shortcodes.php:646
3921
  msgid "unknown"
3922
  msgstr ""
3923
 
3924
- #: includes/class-mla-shortcodes.php:1184
3925
  msgid "mla_debug attributes"
3926
  msgstr ""
3927
 
3928
- #: includes/class-mla-shortcodes.php:1185
3929
  msgid "mla_debug arguments"
3930
  msgstr ""
3931
 
3932
- #: includes/class-mla-shortcodes.php:1277
3933
  msgid "mla_debug empty cloud"
3934
  msgstr ""
3935
 
3936
- #: includes/class-mla-shortcodes.php:2551
3937
- #: includes/class-mla-shortcodes.php:2802
3938
  msgid "ERROR: Invalid mla_gallery"
3939
  msgstr ""
3940
 
3941
- #: includes/class-mla-shortcodes.php:2961
3942
  msgid "mla_debug query"
3943
  msgstr ""
3944
 
3945
- #: includes/class-mla-shortcodes.php:2962
3946
  msgid "mla_debug request"
3947
  msgstr ""
3948
 
3949
- #: includes/class-mla-shortcodes.php:2963
3950
  msgid "mla_debug query_vars"
3951
  msgstr ""
3952
 
3953
- #: includes/class-mla-shortcodes.php:2964
3954
  msgid "mla_debug post_count"
3955
  msgstr ""
3956
 
3957
- #: includes/class-mla-shortcodes.php:3016
3958
  msgid "mla_debug WHERE filter"
3959
  msgstr ""
3960
 
3961
- #: includes/class-mla-shortcodes.php:3035
3962
  msgid "mla_debug modified WHERE filter"
3963
  msgstr ""
3964
 
3965
- #: includes/class-mla-shortcodes.php:3058
3966
  msgid "mla_debug ORDER BY filter, incoming"
3967
  msgstr ""
3968
 
3969
- #: includes/class-mla-shortcodes.php:3058
3970
  msgid "Replacement ORDER BY clause"
3971
  msgstr ""
3972
 
3973
- #: includes/class-mla-shortcodes.php:3081
3974
  msgid "mla_debug posts_clauses filter"
3975
  msgstr ""
3976
 
3977
- #: includes/class-mla-shortcodes.php:3099
3978
  msgid "mla_debug posts_clauses_request filter"
3979
  msgstr ""
3980
 
3981
- #: includes/class-mla-shortcodes.php:3281
3982
  msgid "Invalid taxonomy"
3983
  msgstr ""
3984
 
3985
- #: includes/class-mla-shortcodes.php:3462
3986
  msgid "mla_debug query arguments"
3987
  msgstr ""
3988
 
3989
- #: includes/class-mla-shortcodes.php:3463
3990
  msgid "mla_debug last_query"
3991
  msgstr ""
3992
 
3993
- #: includes/class-mla-shortcodes.php:3464
3994
  msgid "mla_debug last_error"
3995
  msgstr ""
3996
 
3997
- #: includes/class-mla-shortcodes.php:3465
3998
  msgid "mla_debug num_rows"
3999
  msgstr ""
4000
 
4001
- #: includes/class-mla-shortcodes.php:3466
4002
  msgid "mla_debug found_rows"
4003
  msgstr ""
4004
 
@@ -4111,10 +4112,10 @@ msgstr ""
4111
  msgid "Search Media"
4112
  msgstr ""
4113
 
4114
- #: includes/mla-plugin-loader.php:34
4115
  msgid "The Media Library Assistant cannot load."
4116
  msgstr ""
4117
 
4118
- #: includes/mla-plugin-loader.php:36
4119
  msgid "You must resolve these conflicts before this plugin can safely load."
4120
  msgstr ""
1
  msgid ""
2
  msgstr ""
3
  "Project-Id-Version: Media Library Assistant\n"
4
+ "POT-Creation-Date: 2014-09-16 16:47-0800\n"
5
+ "PO-Revision-Date: 2014-09-16 16:47-0800\n"
6
  "Last-Translator: David Lingren <david@fairtradejudaica.org>\n"
7
  "Language-Team: David Lingren <david@fairtradejudaica.org>\n"
8
  "Language: en_US\n"
140
  msgstr ""
141
 
142
  #. translators: 1: search filter details
143
+ #: includes/class-mla-data.php:1983
144
  #, php-format
145
  msgid "mla_query_posts_search_filter not numeric, = \"%1$s\"."
146
  msgstr ""
147
 
148
  #. translators: 1: search filter details
149
+ #: includes/class-mla-data.php:1986
150
  #, php-format
151
  msgctxt "error_log"
152
  msgid "DEBUG: mla_query_posts_search_filter not numeric, = \"%1$s\"."
153
  msgstr ""
154
 
155
  #. translators: 1: where filter details
156
+ #: includes/class-mla-data.php:2048
157
  #, php-format
158
  msgid "mla_query_posts_where_filter = \"%1$s\"."
159
  msgstr ""
160
 
161
  #. translators: 1: where filter details
162
+ #: includes/class-mla-data.php:2051
163
  #, php-format
164
  msgctxt "error_log"
165
  msgid "DEBUG: mla_query_posts_where_filter = \"%1$s\"."
166
  msgstr ""
167
 
168
  #. translators: 1: join filter details
169
+ #: includes/class-mla-data.php:2102
170
  #, php-format
171
  msgid "mla_query_posts_join_filter = \"%1$s\"."
172
  msgstr ""
173
 
174
  #. translators: 1: join filter details
175
+ #: includes/class-mla-data.php:2105
176
  #, php-format
177
  msgctxt "error_log"
178
  msgid "DEBUG: mla_query_posts_join_filter = \"%1$s\"."
179
  msgstr ""
180
 
181
  #. translators: 1: orderby details details
182
+ #: includes/class-mla-data.php:2204
183
  #, php-format
184
  msgid "mla_query_posts_orderby_filter = \"%1$s\"."
185
  msgstr ""
186
 
187
  #. translators: 1: orderby details details
188
+ #: includes/class-mla-data.php:2207
189
  #, php-format
190
  msgctxt "error_log"
191
  msgid "DEBUG: mla_query_posts_orderby_filter = \"%1$s\"."
192
  msgstr ""
193
 
194
  #. translators: 1: SQL clauses
195
+ #: includes/class-mla-data.php:2243
196
  #, php-format
197
  msgid "mla_query_posts_clauses_filter = \"%1$s\"."
198
  msgstr ""
199
 
200
  #. translators: 1: SQL clauses
201
+ #: includes/class-mla-data.php:2246
202
  #, php-format
203
  msgctxt "error_log"
204
  msgid "DEBUG: mla_query_posts_clauses_filter = \"%1$s\"."
205
  msgstr ""
206
 
207
  #. translators: 1: SQL clauses
208
+ #: includes/class-mla-data.php:2267
209
  #, php-format
210
  msgid "mla_query_posts_clauses_request_filter = \"%1$s\"."
211
  msgstr ""
212
 
213
  #. translators: 1: SQL clauses
214
+ #: includes/class-mla-data.php:2270
215
  #, php-format
216
  msgctxt "error_log"
217
  msgid "DEBUG: mla_query_posts_clauses_request_filter = \"%1$s\"."
218
  msgstr ""
219
 
220
  #. translators: 1: post ID
221
+ #: includes/class-mla-data.php:2302
222
  #, php-format
223
  msgctxt "error_log"
224
  msgid "ERROR: mla_get_attachment_by_id(%1$d) not found."
225
  msgstr ""
226
 
227
  #. translators: 1: post ID 2: post_type
228
+ #: includes/class-mla-data.php:2308
229
  #, php-format
230
  msgctxt "error_log"
231
  msgid "ERROR: mla_get_attachment_by_id(%1$d) wrong post_type \"%2$s\"."
232
  msgstr ""
233
 
234
+ #: includes/class-mla-data.php:2860 includes/class-mla-data.php:3199
235
+ #: includes/class-mla-list-table.php:830
236
  msgid "NO REFERENCE TESTS"
237
  msgstr ""
238
 
239
+ #: includes/class-mla-data.php:2866 includes/class-mla-data.php:3205
240
+ #: includes/class-mla-options.php:2641 includes/class-mla-options.php:2642
241
  msgid "ORPHAN"
242
  msgstr ""
243
 
244
+ #: includes/class-mla-data.php:2870 includes/class-mla-data.php:3209
245
  msgid "UNUSED"
246
  msgstr ""
247
 
248
+ #: includes/class-mla-data.php:2875 includes/class-mla-data.php:3214
249
  msgid "UNATTACHED"
250
  msgstr ""
251
 
252
+ #: includes/class-mla-data.php:2877 includes/class-mla-data.php:3216
253
  msgid "INVALID PARENT"
254
  msgstr ""
255
 
256
  #. translators: 1: post_type, 2: post_title, 3: post ID, 4: query string, 5: error message
257
+ #: includes/class-mla-data.php:3398
258
  #, php-format
259
  msgid "(%1$s) %2$s (ID %3$d) query \"%4$s\" failed, returning \"%5$s\""
260
  msgstr ""
261
 
262
  #. translators: 1: index
263
+ #: includes/class-mla-data.php:3644
264
  #, php-format
265
  msgctxt "error_log"
266
  msgid "ERROR: _build_pdf_indirect_objects bad value at $index = \"%1$d\"."
267
  msgstr ""
268
 
269
  #. translators: 1: source offset 2: nest level
270
+ #: includes/class-mla-data.php:3969
271
  #, php-format
272
  msgctxt "error_log"
273
  msgid "ERROR: _parse_pdf_dictionary offset = %1$d, nest = %2$d."
274
  msgstr ""
275
 
276
  #. translators: 1: dictionary excerpt
277
+ #: includes/class-mla-data.php:3971
278
  #, php-format
279
  msgctxt "error_log"
280
  msgid "ERROR: _parse_pdf_dictionary no end delimiter dump = %1$s."
281
  msgstr ""
282
 
283
  #. translators: 1: entry name 2: value excerpt
284
+ #: includes/class-mla-data.php:4017
285
  #, php-format
286
  msgctxt "error_log"
287
  msgid "ERROR: _parse_pdf_dictionary bad value [ %1$s ] dump = %2$s"
288
  msgstr ""
289
 
290
+ #: includes/class-mla-data.php:4131
291
  msgctxt "error_log"
292
  msgid "ERROR: _parse_xmp_metadata xml_parse_into_struct failed."
293
  msgstr ""
294
 
295
+ #: includes/class-mla-data.php:4134
296
  msgctxt "error_log"
297
  msgid "ERROR: _parse_xmp_metadata set option failed."
298
  msgstr ""
299
 
300
  #. translators: 1: path and file
301
+ #: includes/class-mla-data.php:4491
302
  #, php-format
303
  msgctxt "error_log"
304
  msgid "ERROR: File \"%1$s\", startxref not found."
305
  msgstr ""
306
 
307
  #. translators: 1: meta_key
308
+ #: includes/class-mla-data.php:5408
309
  #, php-format
310
  msgid "Deleting meta:%1$s"
311
  msgstr ""
312
 
313
  #. translators: 1: meta_key
314
+ #: includes/class-mla-data.php:5411
315
  #, php-format
316
  msgid "ERROR: meta:%1$s not found"
317
  msgstr ""
318
 
319
  #. translators: 1: meta_key 2: meta_value
320
+ #: includes/class-mla-data.php:5420
321
  #, php-format
322
  msgid "Adding meta:%1$s = %2$s"
323
  msgstr ""
324
 
325
  #. translators: 1: meta_key
326
+ #: includes/class-mla-data.php:5424
327
  #, php-format
328
  msgid "ERROR: Adding meta:%1$s; not found"
329
  msgstr ""
330
 
331
  #. translators: 1: meta_key
332
+ #: includes/class-mla-data.php:5431
333
  #, php-format
334
  msgid "Deleting Null meta:%1$s"
335
  msgstr ""
336
 
337
  #. translators: 1: element name 2: old_value 3: new_value
338
+ #: includes/class-mla-data.php:5441 includes/class-mla-data.php:5592
339
+ #: includes/class-mla-data.php:5653 includes/class-mla-data.php:5679
340
+ #: includes/class-mla-data.php:5713 includes/class-mla-data.php:5726
341
+ #: includes/class-mla-data.php:5735 includes/class-mla-data.php:5746
342
+ #: includes/class-mla-data.php:5757 includes/class-mla-data.php:5770
343
+ #: includes/class-mla-data.php:5779 includes/class-mla-data.php:5788
344
  #: includes/class-mla-mime-types.php:1052
345
  #: includes/class-mla-mime-types.php:2125
346
  #, php-format
348
  msgstr ""
349
 
350
  #. translators: 1: meta_key
351
+ #: includes/class-mla-data.php:5446
352
  #, php-format
353
  msgid "ERROR: Changing meta:%1$s; not found"
354
  msgstr ""
355
 
356
  #. translators: 1: meta_key
357
+ #: includes/class-mla-data.php:5506
358
  #, php-format
359
  msgid "Deleting %1$s"
360
  msgstr ""
361
 
362
  #. translators: 1: meta_key 2: new_value
363
+ #: includes/class-mla-data.php:5517
364
  #, php-format
365
  msgid "Adding %1$s = [%2$s]"
366
  msgstr ""
367
 
368
  #. translators: 1: meta_key 2: meta_value
369
+ #: includes/class-mla-data.php:5523
370
  #, php-format
371
  msgid "Adding %1$s = %2$s"
372
  msgstr ""
373
 
374
  #. translators: 1: meta_key
375
+ #: includes/class-mla-data.php:5547
376
  #, php-format
377
  msgid "Deleting old %1$s values"
378
  msgstr ""
379
 
380
  #. translators: 1: meta_key 2: old_value 3: new_value 4: update count
381
+ #: includes/class-mla-data.php:5577
382
  #, php-format
383
  msgid "Changing %1$s from \"%2$s\" to \"%3$s\"; %4$d updates"
384
  msgstr ""
385
 
386
+ #: includes/class-mla-data.php:5635 includes/class-mla-main.php:1892
387
  msgid "ERROR: Could not retrieve Attachment."
388
  msgstr ""
389
 
390
+ #: includes/class-mla-data.php:5653 includes/class-mla-main.php:1305
391
  #: includes/class-mla-main.php:1549 includes/class-mla-main.php:1739
392
  #: includes/class-mla-main.php:2110 includes/class-mla-objects.php:275
393
  #: includes/class-mla-options.php:1017 includes/class-mla-options.php:1777
397
  msgstr ""
398
 
399
  #. translators: 1: old_value
400
+ #: includes/class-mla-data.php:5676
401
  #, php-format
402
  msgid "ERROR: Could not change Name/Slug \"%1$s\"; name already exists"
403
  msgstr ""
404
 
405
+ #: includes/class-mla-data.php:5679 includes/class-mla-main.php:1740
406
  #: includes/class-mla-main.php:2113 includes/class-mla-options.php:1024
407
  msgid "Name/Slug"
408
  msgstr ""
409
 
410
  #. translators: 1: old_value
411
+ #: includes/class-mla-data.php:5705
412
  #, php-format
413
  msgid "Deleting ALT Text, was \"%1$s\""
414
  msgstr ""
415
 
416
  #. translators: 1: old_value
417
+ #: includes/class-mla-data.php:5708
418
  #, php-format
419
  msgid "ERROR: Could not delete ALT Text, remains \"%1$s\""
420
  msgstr ""
421
 
422
+ #: includes/class-mla-data.php:5713 includes/class-mla-list-table.php:1069
423
  #: includes/class-mla-main.php:1743 includes/class-mla-main.php:2116
424
  #: includes/class-mla-options.php:1031 includes/class-mla-options.php:1783
425
  #: includes/mla-main-search-box-template.php:44
428
  msgstr ""
429
 
430
  #. translators: 1: old_value 2: new_value
431
+ #: includes/class-mla-data.php:5716
432
  #, php-format
433
  msgid "ERROR: Could not change ALT Text from \"%1$s\" to \"%2$s\""
434
  msgstr ""
435
 
436
+ #: includes/class-mla-data.php:5726 includes/class-mla-main.php:1741
437
  #: includes/class-mla-main.php:2119 includes/class-mla-options.php:1038
438
  #: includes/class-mla-options.php:1786
439
  #: includes/mla-main-search-box-template.php:45
441
  msgid "Caption"
442
  msgstr ""
443
 
444
+ #: includes/class-mla-data.php:5735 includes/class-mla-main.php:1742
445
  #: includes/class-mla-main.php:2121 includes/class-mla-options.php:1045
446
  #: includes/class-mla-options.php:1789 includes/class-mla-settings.php:1158
447
  #: includes/class-mla-settings.php:1415 includes/class-mla-settings.php:1514
451
  msgid "Description"
452
  msgstr ""
453
 
454
+ #: includes/class-mla-data.php:5746 includes/class-mla-list-table.php:804
455
  #: includes/class-mla-list-table.php:896 includes/class-mla-options.php:4099
456
  #: includes/class-mla-options.php:4439
457
  msgid "Parent"
458
  msgstr ""
459
 
460
+ #: includes/class-mla-data.php:5757 includes/class-mla-edit-media.php:307
461
  #: includes/class-mla-edit-media.php:447 includes/class-mla-main.php:1746
462
  #: includes/class-mla-main.php:2127 includes/class-mla-settings.php:1156
463
  #: includes/class-mla-settings.php:1413
464
  msgid "Menu Order"
465
  msgstr ""
466
 
467
+ #: includes/class-mla-data.php:5770 includes/class-mla-list-table.php:1218
468
  #: includes/class-mla-main.php:1616 includes/class-mla-main.php:1718
469
  #: includes/class-mla-main.php:1941
470
  msgid "Author"
471
  msgstr ""
472
 
473
+ #: includes/class-mla-data.php:5779 includes/class-mla-main.php:1757
474
  msgid "Comments"
475
  msgstr ""
476
 
477
+ #: includes/class-mla-data.php:5788 includes/class-mla-main.php:1758
478
  msgid "Pings"
479
  msgstr ""
480
 
481
+ #: includes/class-mla-data.php:5822
482
  msgid "Adding"
483
  msgstr ""
484
 
485
+ #: includes/class-mla-data.php:5826
486
  msgid "Removing"
487
  msgstr ""
488
 
489
+ #: includes/class-mla-data.php:5831
490
  msgid "Replacing"
491
  msgstr ""
492
 
493
+ #: includes/class-mla-data.php:5835
494
  msgid "Ignoring"
495
  msgstr ""
496
 
497
  #. translators: 1: action_name, 2: taxonomy
498
+ #: includes/class-mla-data.php:5847
499
  #, php-format
500
  msgid "%1$s \"%2$s\" terms"
501
  msgstr ""
502
 
503
  #. translators: 1: taxonomy
504
+ #: includes/class-mla-data.php:5851
505
  #, php-format
506
  msgid "You cannot assign \"%1$s\" terms"
507
  msgstr ""
508
 
509
  #. translators: 1: post ID
510
+ #: includes/class-mla-data.php:5863
511
  #, php-format
512
  msgid "Item %1$d, no changes detected."
513
  msgstr ""
514
 
515
  #. translators: 1: post ID
516
+ #: includes/class-mla-data.php:5875
517
  #, php-format
518
  msgid "Item %1$d updated."
519
  msgstr ""
520
 
521
  #. translators: 1: post ID
522
+ #: includes/class-mla-data.php:5889
523
  #, php-format
524
  msgid "ERROR: Item %1$d update failed."
525
  msgstr ""
526
 
527
+ #: includes/class-mla-data.php:5912 includes/class-mla-edit-media.php:125
528
  #: includes/class-mla-edit-media.php:170 includes/class-mla-main.php:330
529
  #: includes/class-mla-main.php:358 includes/class-mla-main.php:1444
530
  #: includes/class-mla-settings.php:311 includes/class-mla-settings.php:329
1008
  #: includes/class-mla-settings.php:1224 includes/class-mla-settings.php:1301
1009
  #: includes/class-mla-settings.php:1690 includes/class-mla-settings.php:1769
1010
  #: includes/class-mla-settings.php:2320 includes/class-mla-settings.php:2443
1011
+ #: includes/class-mla-settings.php:2578 includes/class-mla-shortcodes.php:1288
1012
+ #: includes/class-mla-shortcodes.php:1362
1013
  msgid "ERROR:"
1014
  msgstr ""
1015
 
3890
  msgid "Settings imported; %1$s updated, %2$s unchanged."
3891
  msgstr ""
3892
 
3893
+ #: includes/class-mla-shortcodes.php:190
3894
+ #: includes/class-mla-shortcodes.php:1113
3895
+ #: includes/class-mla-shortcodes.php:1982
3896
+ #: includes/class-mla-shortcodes.php:2247
3897
  msgid "Previous"
3898
  msgstr ""
3899
 
3900
+ #: includes/class-mla-shortcodes.php:191
3901
+ #: includes/class-mla-shortcodes.php:1114
3902
+ #: includes/class-mla-shortcodes.php:2029
3903
+ #: includes/class-mla-shortcodes.php:2253
3904
  msgid "Next"
3905
  msgstr ""
3906
 
3907
+ #: includes/class-mla-shortcodes.php:272
3908
  msgid "mla_debug empty gallery"
3909
  msgstr ""
3910
 
3911
+ #: includes/class-mla-shortcodes.php:336
3912
  msgid ""
3913
  "<strong>Photonic-enhanced [mla_gallery]</strong> type must be "
3914
  "<strong>default</strong>, query = "
3915
  msgstr ""
3916
 
3917
+ #: includes/class-mla-shortcodes.php:652
3918
  msgid "unattached"
3919
  msgstr ""
3920
 
3921
+ #: includes/class-mla-shortcodes.php:673
3922
  msgid "unknown"
3923
  msgstr ""
3924
 
3925
+ #: includes/class-mla-shortcodes.php:1211
3926
  msgid "mla_debug attributes"
3927
  msgstr ""
3928
 
3929
+ #: includes/class-mla-shortcodes.php:1212
3930
  msgid "mla_debug arguments"
3931
  msgstr ""
3932
 
3933
+ #: includes/class-mla-shortcodes.php:1304
3934
  msgid "mla_debug empty cloud"
3935
  msgstr ""
3936
 
3937
+ #: includes/class-mla-shortcodes.php:2578
3938
+ #: includes/class-mla-shortcodes.php:2829
3939
  msgid "ERROR: Invalid mla_gallery"
3940
  msgstr ""
3941
 
3942
+ #: includes/class-mla-shortcodes.php:2988
3943
  msgid "mla_debug query"
3944
  msgstr ""
3945
 
3946
+ #: includes/class-mla-shortcodes.php:2989
3947
  msgid "mla_debug request"
3948
  msgstr ""
3949
 
3950
+ #: includes/class-mla-shortcodes.php:2990
3951
  msgid "mla_debug query_vars"
3952
  msgstr ""
3953
 
3954
+ #: includes/class-mla-shortcodes.php:2991
3955
  msgid "mla_debug post_count"
3956
  msgstr ""
3957
 
3958
+ #: includes/class-mla-shortcodes.php:3043
3959
  msgid "mla_debug WHERE filter"
3960
  msgstr ""
3961
 
3962
+ #: includes/class-mla-shortcodes.php:3062
3963
  msgid "mla_debug modified WHERE filter"
3964
  msgstr ""
3965
 
3966
+ #: includes/class-mla-shortcodes.php:3085
3967
  msgid "mla_debug ORDER BY filter, incoming"
3968
  msgstr ""
3969
 
3970
+ #: includes/class-mla-shortcodes.php:3085
3971
  msgid "Replacement ORDER BY clause"
3972
  msgstr ""
3973
 
3974
+ #: includes/class-mla-shortcodes.php:3108
3975
  msgid "mla_debug posts_clauses filter"
3976
  msgstr ""
3977
 
3978
+ #: includes/class-mla-shortcodes.php:3126
3979
  msgid "mla_debug posts_clauses_request filter"
3980
  msgstr ""
3981
 
3982
+ #: includes/class-mla-shortcodes.php:3310
3983
  msgid "Invalid taxonomy"
3984
  msgstr ""
3985
 
3986
+ #: includes/class-mla-shortcodes.php:3491
3987
  msgid "mla_debug query arguments"
3988
  msgstr ""
3989
 
3990
+ #: includes/class-mla-shortcodes.php:3492
3991
  msgid "mla_debug last_query"
3992
  msgstr ""
3993
 
3994
+ #: includes/class-mla-shortcodes.php:3493
3995
  msgid "mla_debug last_error"
3996
  msgstr ""
3997
 
3998
+ #: includes/class-mla-shortcodes.php:3494
3999
  msgid "mla_debug num_rows"
4000
  msgstr ""
4001
 
4002
+ #: includes/class-mla-shortcodes.php:3495
4003
  msgid "mla_debug found_rows"
4004
  msgstr ""
4005
 
4112
  msgid "Search Media"
4113
  msgstr ""
4114
 
4115
+ #: includes/mla-plugin-loader.php:36
4116
  msgid "The Media Library Assistant cannot load."
4117
  msgstr ""
4118
 
4119
+ #: includes/mla-plugin-loader.php:38
4120
  msgid "You must resolve these conflicts before this plugin can safely load."
4121
  msgstr ""
license.txt ADDED
@@ -0,0 +1,339 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ GNU GENERAL PUBLIC LICENSE
2
+ Version 2, June 1991
3
+
4
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6
+ Everyone is permitted to copy and distribute verbatim copies
7
+ of this license document, but changing it is not allowed.
8
+
9
+ Preamble
10
+
11
+ The licenses for most software are designed to take away your
12
+ freedom to share and change it. By contrast, the GNU General Public
13
+ License is intended to guarantee your freedom to share and change free
14
+ software--to make sure the software is free for all its users. This
15
+ General Public License applies to most of the Free Software
16
+ Foundation's software and to any other program whose authors commit to
17
+ using it. (Some other Free Software Foundation software is covered by
18
+ the GNU Lesser General Public License instead.) You can apply it to
19
+ your programs, too.
20
+
21
+ When we speak of free software, we are referring to freedom, not
22
+ price. Our General Public Licenses are designed to make sure that you
23
+ have the freedom to distribute copies of free software (and charge for
24
+ this service if you wish), that you receive source code or can get it
25
+ if you want it, that you can change the software or use pieces of it
26
+ in new free programs; and that you know you can do these things.
27
+
28
+ To protect your rights, we need to make restrictions that forbid
29
+ anyone to deny you these rights or to ask you to surrender the rights.
30
+ These restrictions translate to certain responsibilities for you if you
31
+ distribute copies of the software, or if you modify it.
32
+
33
+ For example, if you distribute copies of such a program, whether
34
+ gratis or for a fee, you must give the recipients all the rights that
35
+ you have. You must make sure that they, too, receive or can get the
36
+ source code. And you must show them these terms so they know their
37
+ rights.
38
+
39
+ We protect your rights with two steps: (1) copyright the software, and
40
+ (2) offer you this license which gives you legal permission to copy,
41
+ distribute and/or modify the software.
42
+
43
+ Also, for each author's protection and ours, we want to make certain
44
+ that everyone understands that there is no warranty for this free
45
+ software. If the software is modified by someone else and passed on, we
46
+ want its recipients to know that what they have is not the original, so
47
+ that any problems introduced by others will not reflect on the original
48
+ authors' reputations.
49
+
50
+ Finally, any free program is threatened constantly by software
51
+ patents. We wish to avoid the danger that redistributors of a free
52
+ program will individually obtain patent licenses, in effect making the
53
+ program proprietary. To prevent this, we have made it clear that any
54
+ patent must be licensed for everyone's free use or not licensed at all.
55
+
56
+ The precise terms and conditions for copying, distribution and
57
+ modification follow.
58
+
59
+ GNU GENERAL PUBLIC LICENSE
60
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61
+
62
+ 0. This License applies to any program or other work which contains
63
+ a notice placed by the copyright holder saying it may be distributed
64
+ under the terms of this General Public License. The "Program", below,
65
+ refers to any such program or work, and a "work based on the Program"
66
+ means either the Program or any derivative work under copyright law:
67
+ that is to say, a work containing the Program or a portion of it,
68
+ either verbatim or with modifications and/or translated into another
69
+ language. (Hereinafter, translation is included without limitation in
70
+ the term "modification".) Each licensee is addressed as "you".
71
+
72
+ Activities other than copying, distribution and modification are not
73
+ covered by this License; they are outside its scope. The act of
74
+ running the Program is not restricted, and the output from the Program
75
+ is covered only if its contents constitute a work based on the
76
+ Program (independent of having been made by running the Program).
77
+ Whether that is true depends on what the Program does.
78
+
79
+ 1. You may copy and distribute verbatim copies of the Program's
80
+ source code as you receive it, in any medium, provided that you
81
+ conspicuously and appropriately publish on each copy an appropriate
82
+ copyright notice and disclaimer of warranty; keep intact all the
83
+ notices that refer to this License and to the absence of any warranty;
84
+ and give any other recipients of the Program a copy of this License
85
+ along with the Program.
86
+
87
+ You may charge a fee for the physical act of transferring a copy, and
88
+ you may at your option offer warranty protection in exchange for a fee.
89
+
90
+ 2. You may modify your copy or copies of the Program or any portion
91
+ of it, thus forming a work based on the Program, and copy and
92
+ distribute such modifications or work under the terms of Section 1
93
+ above, provided that you also meet all of these conditions:
94
+
95
+ a) You must cause the modified files to carry prominent notices
96
+ stating that you changed the files and the date of any change.
97
+
98
+ b) You must cause any work that you distribute or publish, that in
99
+ whole or in part contains or is derived from the Program or any
100
+ part thereof, to be licensed as a whole at no charge to all third
101
+ parties under the terms of this License.
102
+
103
+ c) If the modified program normally reads commands interactively
104
+ when run, you must cause it, when started running for such
105
+ interactive use in the most ordinary way, to print or display an
106
+ announcement including an appropriate copyright notice and a
107
+ notice that there is no warranty (or else, saying that you provide
108
+ a warranty) and that users may redistribute the program under
109
+ these conditions, and telling the user how to view a copy of this
110
+ License. (Exception: if the Program itself is interactive but
111
+ does not normally print such an announcement, your work based on
112
+ the Program is not required to print an announcement.)
113
+
114
+ These requirements apply to the modified work as a whole. If
115
+ identifiable sections of that work are not derived from the Program,
116
+ and can be reasonably considered independent and separate works in
117
+ themselves, then this License, and its terms, do not apply to those
118
+ sections when you distribute them as separate works. But when you
119
+ distribute the same sections as part of a whole which is a work based
120
+ on the Program, the distribution of the whole must be on the terms of
121
+ this License, whose permissions for other licensees extend to the
122
+ entire whole, and thus to each and every part regardless of who wrote it.
123
+
124
+ Thus, it is not the intent of this section to claim rights or contest
125
+ your rights to work written entirely by you; rather, the intent is to
126
+ exercise the right to control the distribution of derivative or
127
+ collective works based on the Program.
128
+
129
+ In addition, mere aggregation of another work not based on the Program
130
+ with the Program (or with a work based on the Program) on a volume of
131
+ a storage or distribution medium does not bring the other work under
132
+ the scope of this License.
133
+
134
+ 3. You may copy and distribute the Program (or a work based on it,
135
+ under Section 2) in object code or executable form under the terms of
136
+ Sections 1 and 2 above provided that you also do one of the following:
137
+
138
+ a) Accompany it with the complete corresponding machine-readable
139
+ source code, which must be distributed under the terms of Sections
140
+ 1 and 2 above on a medium customarily used for software interchange; or,
141
+
142
+ b) Accompany it with a written offer, valid for at least three
143
+ years, to give any third party, for a charge no more than your
144
+ cost of physically performing source distribution, a complete
145
+ machine-readable copy of the corresponding source code, to be
146
+ distributed under the terms of Sections 1 and 2 above on a medium
147
+ customarily used for software interchange; or,
148
+
149
+ c) Accompany it with the information you received as to the offer
150
+ to distribute corresponding source code. (This alternative is
151
+ allowed only for noncommercial distribution and only if you
152
+ received the program in object code or executable form with such
153
+ an offer, in accord with Subsection b above.)
154
+
155
+ The source code for a work means the preferred form of the work for
156
+ making modifications to it. For an executable work, complete source
157
+ code means all the source code for all modules it contains, plus any
158
+ associated interface definition files, plus the scripts used to
159
+ control compilation and installation of the executable. However, as a
160
+ special exception, the source code distributed need not include
161
+ anything that is normally distributed (in either source or binary
162
+ form) with the major components (compiler, kernel, and so on) of the
163
+ operating system on which the executable runs, unless that component
164
+ itself accompanies the executable.
165
+
166
+ If distribution of executable or object code is made by offering
167
+ access to copy from a designated place, then offering equivalent
168
+ access to copy the source code from the same place counts as
169
+ distribution of the source code, even though third parties are not
170
+ compelled to copy the source along with the object code.
171
+
172
+ 4. You may not copy, modify, sublicense, or distribute the Program
173
+ except as expressly provided under this License. Any attempt
174
+ otherwise to copy, modify, sublicense or distribute the Program is
175
+ void, and will automatically terminate your rights under this License.
176
+ However, parties who have received copies, or rights, from you under
177
+ this License will not have their licenses terminated so long as such
178
+ parties remain in full compliance.
179
+
180
+ 5. You are not required to accept this License, since you have not
181
+ signed it. However, nothing else grants you permission to modify or
182
+ distribute the Program or its derivative works. These actions are
183
+ prohibited by law if you do not accept this License. Therefore, by
184
+ modifying or distributing the Program (or any work based on the
185
+ Program), you indicate your acceptance of this License to do so, and
186
+ all its terms and conditions for copying, distributing or modifying
187
+ the Program or works based on it.
188
+
189
+ 6. Each time you redistribute the Program (or any work based on the
190
+ Program), the recipient automatically receives a license from the
191
+ original licensor to copy, distribute or modify the Program subject to
192
+ these terms and conditions. You may not impose any further
193
+ restrictions on the recipients' exercise of the rights granted herein.
194
+ You are not responsible for enforcing compliance by third parties to
195
+ this License.
196
+
197
+ 7. If, as a consequence of a court judgment or allegation of patent
198
+ infringement or for any other reason (not limited to patent issues),
199
+ conditions are imposed on you (whether by court order, agreement or
200
+ otherwise) that contradict the conditions of this License, they do not
201
+ excuse you from the conditions of this License. If you cannot
202
+ distribute so as to satisfy simultaneously your obligations under this
203
+ License and any other pertinent obligations, then as a consequence you
204
+ may not distribute the Program at all. For example, if a patent
205
+ license would not permit royalty-free redistribution of the Program by
206
+ all those who receive copies directly or indirectly through you, then
207
+ the only way you could satisfy both it and this License would be to
208
+ refrain entirely from distribution of the Program.
209
+
210
+ If any portion of this section is held invalid or unenforceable under
211
+ any particular circumstance, the balance of the section is intended to
212
+ apply and the section as a whole is intended to apply in other
213
+ circumstances.
214
+
215
+ It is not the purpose of this section to induce you to infringe any
216
+ patents or other property right claims or to contest validity of any
217
+ such claims; this section has the sole purpose of protecting the
218
+ integrity of the free software distribution system, which is
219
+ implemented by public license practices. Many people have made
220
+ generous contributions to the wide range of software distributed
221
+ through that system in reliance on consistent application of that
222
+ system; it is up to the author/donor to decide if he or she is willing
223
+ to distribute software through any other system and a licensee cannot
224
+ impose that choice.
225
+
226
+ This section is intended to make thoroughly clear what is believed to
227
+ be a consequence of the rest of this License.
228
+
229
+ 8. If the distribution and/or use of the Program is restricted in
230
+ certain countries either by patents or by copyrighted interfaces, the
231
+ original copyright holder who places the Program under this License
232
+ may add an explicit geographical distribution limitation excluding
233
+ those countries, so that distribution is permitted only in or among
234
+ countries not thus excluded. In such case, this License incorporates
235
+ the limitation as if written in the body of this License.
236
+
237
+ 9. The Free Software Foundation may publish revised and/or new versions
238
+ of the General Public License from time to time. Such new versions will
239
+ be similar in spirit to the present version, but may differ in detail to
240
+ address new problems or concerns.
241
+
242
+ Each version is given a distinguishing version number. If the Program
243
+ specifies a version number of this License which applies to it and "any
244
+ later version", you have the option of following the terms and conditions
245
+ either of that version or of any later version published by the Free
246
+ Software Foundation. If the Program does not specify a version number of
247
+ this License, you may choose any version ever published by the Free Software
248
+ Foundation.
249
+
250
+ 10. If you wish to incorporate parts of the Program into other free
251
+ programs whose distribution conditions are different, write to the author
252
+ to ask for permission. For software which is copyrighted by the Free
253
+ Software Foundation, write to the Free Software Foundation; we sometimes
254
+ make exceptions for this. Our decision will be guided by the two goals
255
+ of preserving the free status of all derivatives of our free software and
256
+ of promoting the sharing and reuse of software generally.
257
+
258
+ NO WARRANTY
259
+
260
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261
+ FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262
+ OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263
+ PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264
+ OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266
+ TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267
+ PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268
+ REPAIR OR CORRECTION.
269
+
270
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271
+ WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272
+ REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273
+ INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274
+ OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275
+ TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276
+ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277
+ PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278
+ POSSIBILITY OF SUCH DAMAGES.
279
+
280
+ END OF TERMS AND CONDITIONS
281
+
282
+ How to Apply These Terms to Your New Programs
283
+
284
+ If you develop a new program, and you want it to be of the greatest
285
+ possible use to the public, the best way to achieve this is to make it
286
+ free software which everyone can redistribute and change under these terms.
287
+
288
+ To do so, attach the following notices to the program. It is safest
289
+ to attach them to the start of each source file to most effectively
290
+ convey the exclusion of warranty; and each file should have at least
291
+ the "copyright" line and a pointer to where the full notice is found.
292
+
293
+ <one line to give the program's name and a brief idea of what it does.>
294
+ Copyright (C) <year> <name of author>
295
+
296
+ This program is free software; you can redistribute it and/or modify
297
+ it under the terms of the GNU General Public License as published by
298
+ the Free Software Foundation; either version 2 of the License, or
299
+ (at your option) any later version.
300
+
301
+ This program is distributed in the hope that it will be useful,
302
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
303
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304
+ GNU General Public License for more details.
305
+
306
+ You should have received a copy of the GNU General Public License along
307
+ with this program; if not, write to the Free Software Foundation, Inc.,
308
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309
+
310
+ Also add information on how to contact you by electronic and paper mail.
311
+
312
+ If the program is interactive, make it output a short notice like this
313
+ when it starts in an interactive mode:
314
+
315
+ Gnomovision version 69, Copyright (C) year name of author
316
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317
+ This is free software, and you are welcome to redistribute it
318
+ under certain conditions; type `show c' for details.
319
+
320
+ The hypothetical commands `show w' and `show c' should show the appropriate
321
+ parts of the General Public License. Of course, the commands you use may
322
+ be called something other than `show w' and `show c'; they could even be
323
+ mouse-clicks or menu items--whatever suits your program.
324
+
325
+ You should also get your employer (if you work as a programmer) or your
326
+ school, if any, to sign a "copyright disclaimer" for the program, if
327
+ necessary. Here is a sample; alter the names:
328
+
329
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
331
+
332
+ <signature of Ty Coon>, 1 April 1989
333
+ Ty Coon, President of Vice
334
+
335
+ This General Public License does not permit incorporating your program into
336
+ proprietary programs. If your program is a subroutine library, you may
337
+ consider it more useful to permit linking proprietary applications with the
338
+ library. If this is what you want to do, use the GNU Lesser General
339
+ Public License instead of this License.
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
- === Plugin Name ===
2
  Contributors: dglingren
3
  Donate link: http://fairtradejudaica.org/make-a-difference/donate/
4
  Tags: attachment, attachments, documents, gallery, image, images, media, library, media library, tag cloud, media-tags, media tags, tags, media categories, categories, IPTC, EXIF, GPS, PDF, meta, metadata, photo, photos, photograph, photographs, photoblog, photo albums, lightroom, photoshop, MIME, mime-type, icon, upload, file extensions
5
  Requires at least: 3.3
6
  Tested up to: 4.0
7
- Stable tag: 1.93
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -152,6 +152,19 @@ All of the MLA source code has been annotated with "DocBlocks", a special type o
152
 
153
  == Changelog ==
154
 
 
 
 
 
 
 
 
 
 
 
 
 
 
155
  = 1.93 =
156
 
157
  * New: MLA enhancements have been added to the new WordPress 4.0 Media/Library Media Grid submenu. An option has been added to the Settings/Media Library Assistant General tab to disable them if they are not wanted.
@@ -258,8 +271,8 @@ All of the MLA source code has been annotated with "DocBlocks", a special type o
258
 
259
  == Upgrade Notice ==
260
 
261
- = 1.93 =
262
- WordPress 4.0 Media Grid enhancements (optional) and compatibility fixes. New auto-fill option for Media Manager taxonomy meta boxes. One other enhancement, three other fixes.
263
 
264
  == Other Notes ==
265
 
1
+ === Media Library Assistant ===
2
  Contributors: dglingren
3
  Donate link: http://fairtradejudaica.org/make-a-difference/donate/
4
  Tags: attachment, attachments, documents, gallery, image, images, media, library, media library, tag cloud, media-tags, media tags, tags, media categories, categories, IPTC, EXIF, GPS, PDF, meta, metadata, photo, photos, photograph, photographs, photoblog, photo albums, lightroom, photoshop, MIME, mime-type, icon, upload, file extensions
5
  Requires at least: 3.3
6
  Tested up to: 4.0
7
+ Stable tag: 1.94
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
152
 
153
  == Changelog ==
154
 
155
+ = 1.94 =
156
+
157
+ * New: An example that shows how to replace the wp_list_categories() item count with an accurate, padded count of the attachments assigned to each term has been added to the /media-library-assistant/examples/twentytwelve-mla directory. The example comprises the "page-tosca30-dropdown.php" and "content-tosca30-dropdown.php" files.
158
+ * New: For the `[mla_tag_cloud]` shortcode, new `current_item` and `current_item_class` parameters allow you to specify the current or selected term in the cloud and add a `class` attribute to it.
159
+ * New: For the `[mla_tag_cloud]` shortcode, when item-specific clouds are created with the `ids` parameter, the term counts reflect only the items in the `ids` list.
160
+ * Fix: CSS Styles for the Media Manager year/month filter, taxonomy term filter, Search Media button adn Terms Search Button have been improved.
161
+ * Fix: A shortcode-processing defect in WordPress 4.0 is avoided by adding a "no_texturize_shortcodes" filter to the `[mla_gallery]` and `[mla_tag_cloud]` shortcodes.
162
+ * Fix: For the `[mla_gallery]` shortcode, a defect in expanding `request:` and `query:` arguments in pagination parameters has been fixed.
163
+ * Fix: A defect in the Media Manager/Media Grid enhancements has been corrected. The defect caused changes to the MIME type, Year/Month and Terms controls on the toolbar to be ignored when the MLA Enhanced Search Box was disabled.
164
+ * Fix: A defect in the Media Manager/Media Grid enhancements has been corrected. The defect caused changes to the Title, Caption, ALT Text and Description fields in the Attachment Details pane to be ignored.
165
+ * Fix: The number of "where-used" SQL queries required to compose the Media/Assistant submenu table has been reduced significantly. For example, a table with 100 items has been reduced from 282 queries to 67, and a table with 621 items has been reduced from 2,722 queries to 241.
166
+ * Fix: An occasional PHP notice in the `posts_join` filter has been removed.
167
+
168
  = 1.93 =
169
 
170
  * New: MLA enhancements have been added to the new WordPress 4.0 Media/Library Media Grid submenu. An option has been added to the Settings/Media Library Assistant General tab to disable them if they are not wanted.
271
 
272
  == Upgrade Notice ==
273
 
274
+ = 1.94 =
275
+ Media Manager fixes and new "current-item" parameters for [mla_tag_cloud]. Two other enhancements, seven fixes.
276
 
277
  == Other Notes ==
278
 
tpls/documentation-settings-tab.tpl CHANGED
@@ -747,6 +747,14 @@ Each item in the tag cloud comprises a term name of varying size, a hyperlink su
747
  <td style="padding-right: 10px; vertical-align: top; font-weight:bold">link</td>
748
  <td>Chooses the destination of the item hyperlink; details in the next section below.</td>
749
  </tr>
 
 
 
 
 
 
 
 
750
  </table>
751
  <p>
752
  The Item parameters are an easy way to customize the content and markup for each cloud item. For the list and grid formats you can also use the <a href="#tag_cloud_display_content">Tag Cloud Display Content parameters</a> and/or Style and Markup Templates for even greater flexibility.
@@ -897,7 +905,7 @@ The data selection parameters specify which taxonomy (or taxonomies) the terms a
897
  </tr>
898
  <tr>
899
  <td style="padding-right: 10px; vertical-align: top; font-weight:bold">ids</td>
900
- <td>A comma-separated list of attachment ID values for an item-specific cloud. Only those terms assigned to the attachment(s) in the list will be included. You can have one or more IDs, and you can include assigned terms from one or more taxonomies. Do not use the "include" parameter if you use the "ids" parameter.</td>
901
  </tr>
902
  <tr>
903
  <td style="padding-right: 10px; vertical-align: top; font-weight:bold">no_count</td>
@@ -916,7 +924,7 @@ You can code "true" to omit the attachment-counting process. If you do that, the
916
  </tr>
917
  <tr>
918
  <td style="padding-right: 10px; vertical-align: top; font-weight:bold">parent</td>
919
- <td>Get direct children of this term (only terms whose explicit parent is this value). If 0 is passed, only top-level terms are returned.</td>
920
  </tr>
921
  <tr>
922
  <td style="padding-right: 10px; vertical-align: top; font-weight:bold">minimum</td>
@@ -955,7 +963,10 @@ The "pad_counts" parameter is only applied to the first (or only) taxonomy you s
955
  </tr>
956
  </table>
957
  <p>
958
- You can sort on more than one value, e.g., <code>orderby="author, date DESC"</code> and you can specify ASC/DESC on a value by value basis. <strong>NOTE: multiple orderby values are separated by commas, not spaces.</strong> This is a change from WP_Query.
 
 
 
959
  <a name="tag_cloud_debugging_output"></a>
960
  </p>
961
  <h4>Debugging Output</h4>
@@ -1009,6 +1020,10 @@ Tag cloud substitution parameters for the <strong>Style template</strong> are:
1009
  <td>the slug of the taxonomy on which the cloud is based. Multiple taxonomy slugs are joined with a dash to form a single value.</td>
1010
  </tr>
1011
  <tr>
 
 
 
 
1012
  <td style="padding-right: 10px; vertical-align: top; font-weight:bold">itemtag</td>
1013
  <td>shortcode parameter, default = 'ul', or 'dl' if the "captiontag" parameter is present.</td>
1014
  </tr>
@@ -1202,6 +1217,10 @@ Tag cloud <strong>item-specific substitution parameters</strong> for the Markup
1202
  <td>link attributes, if any, drawn from the mla_target, mla_link_attributes and mla_link_class parameters</td>
1203
  </tr>
1204
  <tr>
 
 
 
 
1205
  <td style="padding-right: 10px; vertical-align: top; font-weight:bold">rollover_text</td>
1206
  <td>the "title" attribute value, drawn from single_text/multiple_text or the mla_rollover_text parameters</td>
1207
  </tr>
747
  <td style="padding-right: 10px; vertical-align: top; font-weight:bold">link</td>
748
  <td>Chooses the destination of the item hyperlink; details in the next section below.</td>
749
  </tr>
750
+ <tr>
751
+ <td style="padding-right: 10px; vertical-align: top; font-weight:bold">current_item</td>
752
+ <td>Identifies the current/selected item in the cloud. An integer value will be interpreted as a term id and anything else as a term slug. It will be ignored if it does not match an item in the cloud.</td>
753
+ </tr>
754
+ <tr>
755
+ <td style="padding-right: 10px; vertical-align: top; font-weight:bold">current_item_class</td>
756
+ <td>The class attribute for the current item in the cloud as determined by the "current_item" parameter (if specified), Defaults to "mla_current_item".</td>
757
+ </tr>
758
  </table>
759
  <p>
760
  The Item parameters are an easy way to customize the content and markup for each cloud item. For the list and grid formats you can also use the <a href="#tag_cloud_display_content">Tag Cloud Display Content parameters</a> and/or Style and Markup Templates for even greater flexibility.
905
  </tr>
906
  <tr>
907
  <td style="padding-right: 10px; vertical-align: top; font-weight:bold">ids</td>
908
+ <td>A comma-separated list of <strong>attachment ID</strong> values for an item-specific cloud. Only those terms assigned to the attachment(s) in the list will be included. You can have one or more IDs, and you can include assigned terms from one or more taxonomies. Do not use the "include" parameter if you use the "ids" parameter.</td>
909
  </tr>
910
  <tr>
911
  <td style="padding-right: 10px; vertical-align: top; font-weight:bold">no_count</td>
924
  </tr>
925
  <tr>
926
  <td style="padding-right: 10px; vertical-align: top; font-weight:bold">parent</td>
927
+ <td>Get direct children of this term id (only terms whose explicit parent is this value). If 0 is passed, only top-level terms are returned.</td>
928
  </tr>
929
  <tr>
930
  <td style="padding-right: 10px; vertical-align: top; font-weight:bold">minimum</td>
963
  </tr>
964
  </table>
965
  <p>
966
+ You can sort on more than one value, e.g., <code>orderby="count DESC, name"</code> and you can specify ASC/DESC on a value by value basis. <strong>NOTE: multiple orderby values are separated by commas, not spaces.</strong> This is a change from WP_Query.
967
+ </p>
968
+ <p>
969
+ The order parameter (default ASC) can give an ASC/DESC default for any value that doesn't have a specific choice. For example, <code>orderby="count DESC, name" order=ASC</code> is the same as <code>orderby="count DESC, name ASC"</code>.
970
  <a name="tag_cloud_debugging_output"></a>
971
  </p>
972
  <h4>Debugging Output</h4>
1020
  <td>the slug of the taxonomy on which the cloud is based. Multiple taxonomy slugs are joined with a dash to form a single value.</td>
1021
  </tr>
1022
  <tr>
1023
+ <td style="padding-right: 10px; vertical-align: top; font-weight:bold">current_item</td>
1024
+ <td>the current/selected item in the cloud, as entered in the shortcode parameters.</td>
1025
+ </tr>
1026
+ <tr>
1027
  <td style="padding-right: 10px; vertical-align: top; font-weight:bold">itemtag</td>
1028
  <td>shortcode parameter, default = 'ul', or 'dl' if the "captiontag" parameter is present.</td>
1029
  </tr>
1217
  <td>link attributes, if any, drawn from the mla_target, mla_link_attributes and mla_link_class parameters</td>
1218
  </tr>
1219
  <tr>
1220
+ <td style="padding-right: 10px; vertical-align: top; font-weight:bold">current_item_class</td>
1221
+ <td>set to "mla_current_item" for the current item in the cloud as determined by the "current_item" parameter, and to an empty string for all other items in the cloud.</td>
1222
+ </tr>
1223
+ <tr>
1224
  <td style="padding-right: 10px; vertical-align: top; font-weight:bold">rollover_text</td>
1225
  <td>the "title" attribute value, drawn from single_text/multiple_text or the mla_rollover_text parameters</td>
1226
  </tr>