WordPress.org

Plugin Directory

Changeset 594709


Ignore:
Timestamp:
09/05/12 03:08:17 (20 months ago)
Author:
batmoo
Message:

v0.4: sync from github

https://github.com/Automattic/zoninator/commit/000cb76f0cf53812bc81bb28f25d08861a8aae65

Location:
zoninator/trunk
Files:
1 deleted
14 edited

Legend:

Unmodified
Added
Removed
  • zoninator/trunk/css/zoninator.css

    r567485 r594709  
    220220        } 
    221221    .zone-search-wrapper { 
    222         padding-bottom: 5px; 
     222        padding: 7px 0; 
    223223        border-bottom: 1px dotted #999; 
    224224    } 
    225225        #zone-post-search { 
    226226            width: 99%; 
     227        } 
     228        #zone-post-latest { 
     229            width: 98%; 
    227230        } 
    228231 
  • zoninator/trunk/js/zoninator.js

    r567485 r594709  
    99        zoninator.$zonePostsWrap = $('.zone-posts-wrapper'); 
    1010        zoninator.$zonePostSearch = $("#zone-post-search"); 
     11        zoninator.$zonePostLatest = $("#zone-post-latest"); 
    1112        zoninator.updatePostOrder(); 
    1213         
     
    4748            } 
    4849        }); 
    49          
     50 
     51        zoninator.$zonePostLatest.change(function() { 
     52            var $this = $(this), 
     53                post_id = $this.val(); 
     54            if ( post_id ) { 
     55                zoninator.addPost( post_id ); 
     56                $this.find( '[value="' + post_id + '"]' ).remove(); 
     57            } 
     58        }); 
     59 
    5060        // Initialize autocomplete 
    5161        if(zoninator.$zonePostSearch.length) { 
  • zoninator/trunk/readme.txt

    r567485 r594709  
    22Contributors: batmoo, automattic 
    33Tags: zones, post order, post list, posts, order, zonination, content curation, curation, content management 
    4 Requires at least: 3.3 
     4Requires at least: 3.4 
    55Tested up to: 3.4.1 
    6 Stable tag: 0.3 
     6Stable tag: 0.4 
    77License: GPLv2 
    88 
     
    5555 
    5656== Changelog == 
     57 
     58= 0.4 = 
     59 
     60* New dropdown that recent posts which can be adding to zones, props metromatic and Metro UK 
     61* New filter: zoninator_posts_per_page -- to override the default posts_per_page setting 
     62* Use core bundled versions of jQuery UI 
    5763 
    5864= 0.3 = 
  • zoninator/trunk/zoninator.php

    r567485 r594709  
    33Plugin Name: Zone Manager (Zoninator) 
    44Description: Curation made easy! Create "zones" then add and order your content! 
    5 Author: Mohammad Jangda 
    6 Version: 0.2 
    7 Author URI: http://digitalize.ca 
    8  
    9 Copyright 2010-2011 Mohammad Jangda / Bangor Daily News 
     5Author: Mohammad Jangda, Automattic 
     6Version: 0.4 
     7Author URI: http://vip.wordpress.com 
     8 
     9Copyright 2010-2012 Mohammad Jangda, Automattic 
    1010 
    1111This plugin was built by Mohammad Jangda in conjunction with William Davis and the Bangor Daily News. 
     
    3131if( ! class_exists( 'Zoninator' ) ) : 
    3232 
    33 define( 'ZONINATOR_VERSION', '0.2' ); 
     33define( 'ZONINATOR_VERSION', '0.4' ); 
    3434define( 'ZONINATOR_PATH', dirname( __FILE__ ) ); 
    3535define( 'ZONINATOR_URL', trailingslashit( plugins_url( '', __FILE__ ) ) ); 
     
    7474        $this->zone_lock_period = apply_filters( 'zoninator_zone_lock_period', $this->zone_lock_period ); 
    7575        $this->zone_max_lock_period = apply_filters( 'zoninator_zone_max_lock_period', $this->zone_max_lock_period ); 
     76        $this->posts_per_page = apply_filters( 'zoninator_posts_per_page', $this->posts_per_page ); 
    7677    } 
    7778     
     
    9293                'rewrite' => false, 
    9394                'public' => false, 
     95 
    9496            ) ); 
    9597        } 
     
    132134    function admin_enqueue_scripts() { 
    133135        if( $this->is_zoninator_page() ) { 
    134             wp_enqueue_script( 'zoninator-jquery-ui', ZONINATOR_URL . 'js/jquery-ui/jquery-ui-zoninator.min.js', array( 'jquery' ), ZONINATOR_VERSION, true ); 
    135             wp_enqueue_script( 'zoninator-js', ZONINATOR_URL . 'js/zoninator.js', array( 'jquery', 'zoninator-jquery-ui' ), ZONINATOR_VERSION, true ); 
     136            wp_enqueue_script( 'zoninator-js', ZONINATOR_URL . 'js/zoninator.js', array( 'jquery', 'jquery-ui-core', 'jquery-ui-widget', 'jquery-ui-mouse', 'jquery-ui-position', 'jquery-ui-sortable', 'jquery-ui-autocomplete' ), ZONINATOR_VERSION, true ); 
    136137             
    137138            $options = array( 
     
    414415                        <?php if( $zone_id ) : ?> 
    415416                            <h3><?php _e( 'Zone Content', 'zoninator' ); ?></h3> 
     417                         
     418                            <?php $this->zone_admin_recent_posts_dropdown( $zone_id ); ?> 
    416419                             
    417420                            <?php $this->zone_admin_search_form(); ?> 
     
    481484        <?php 
    482485    } 
     486 
     487    function zone_admin_recent_posts_dropdown( $zone_id ) { 
     488 
     489        $limit = $this->posts_per_page; 
     490        $post_types = $this->get_supported_post_types(); 
     491        $zone_posts = $this->get_zone_posts( $zone_id ); 
     492        $zone_post_ids = wp_list_pluck( $zone_posts, 'ID' ); 
     493 
     494        $args = apply_filters( 'zoninator_recent_posts_args', array( 
     495            'posts_per_page' => $limit, 
     496            'order' => 'DESC', 
     497            'orderby' => 'post_date', 
     498            'post_type' => $post_types, 
     499            'ignore_sticky_posts' => true, 
     500            'post_status' => array( 'publish', 'future' ), 
     501            'post__not_in' => $zone_post_ids, 
     502        ) ); 
     503 
     504        $latest_query = new WP_Query( $args ); 
     505        ?> 
     506        <div class="zone-search-wrapper"> 
     507            <label for="zone-post-search-latest"><?php _e( 'Add Recent Content', 'zoninator' );?></label><br /> 
     508            <select name="search-posts" id="zone-post-latest"> 
     509                <option value="">Choose latest post</option> 
     510                <?php            
     511                while ( $latest_query->have_posts() ) : $latest_query->the_post(); 
     512                    echo sprintf( '<option value="%d">%s</option>', get_the_ID(), get_the_title() ); 
     513                endwhile; 
     514                wp_reset_postdata(); 
     515                ?> 
     516            </select> 
     517        </div> 
     518        <?php 
     519    } 
    483520     
    484521    function zone_admin_search_form() { 
     
    631668                'post__not_in' => $exclude, 
    632669                'posts_per_page' => $limit, 
    633                 'showposts' => $limit, 
    634670                'post_type' => $post_types, 
    635671                'post_status' => array( 'publish', 'future' ), 
Note: See TracChangeset for help on using the changeset viewer.