Plugin Directory

Changeset 756540


Ignore:
Timestamp:
08/15/2013 07:01:39 AM (12 years ago)
Author:
WordPressThemesShop
Message:

Removed checkbox and added button to pages

Location:
page-management/trunk
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • page-management/trunk/page-management.js

    r755795 r756540  
    22 * Plugin Name: Page Management
    33 * Plugin URI: http://www.wpshowcase.net/plugins/page-management-plugin/
    4  * Description: Page Management is a very useful tool for large sites. It adds a checkbox on the wp-admin "All Pages" page that enables you to view the main pages of your site without the child pages.
     4 * Description: Page Management adds a button to pages which allows their subpages to be hidden in the All Pages view.
    55 * Version: 0.0
    66 * Author: WPShowCase
    77 * Author URI: http://www.wpshowcase.net
    88 *
    9  * Page Management is a very useful for large sites simple by allowing you to skip viewing the child pages by checking
    10  * checkbox.
     9 * Page Management is a useful tool for large sites which adds a button to pages which allows their subpages
     10 * to be hidden in the All Pages view - so the author can see the pages more easily.
    1111 *
    1212 * @package PageManagement
     
    1919 
    2020jQuery(document).ready(function ($) {
    21     $('.edit-php #posts-filter #post-query-submit').before('<label>Hide child pages <input type="checkbox" id="hidechildpages" name="hidechildpages" /></label> ');
    22     if(window.location.href.indexOf('hidechildpages')>0)
    23         $('#hidechildpages').attr('checked','checked');
     21    $('.edit-php #the-list .column-title').prepend('<div class="showhidetreecontainer">&nbsp;</div>');
     22    $('.edit-php #the-list tr.parent .showhidetreecontainer').html('<button class="showhidetree">-</button>');
     23   
     24    $('.showhidetree').click(function() {
     25        var id = $(this).parent().parent().parent().attr('id');
     26        id = id.slice(id.indexOf('-') + 1);
     27        if($(this).html()=='-') {
     28            $(this).html('+');
     29            $('.descendent-'+id ).toggle( 1000 );
     30        }
     31        else {
     32            $(this).html('-');
     33            $('.descendent-'+id ).toggle( 1000 );
     34        }
     35        return false;
    2436    });
     37});
  • page-management/trunk/page-management.php

    r755795 r756540  
    33 * Plugin Name: Page Management
    44 * Plugin URI: http://www.wpshowcase.net/plugins/page-management-plugin/
    5  * Description: Page Management is a very useful tool for large sites. It adds a checkbox on the wp-admin "All Pages" page that enables you to view the main pages of your site without the child pages.
     5 * Description: Page Management adds a button to pages which allows their subpages to be hidden in the All Pages view.
    66 * Version: 0.0
    77 * Author: WPShowCase
    88 * Author URI: http://www.wpshowcase.net
    99 *
    10  * Page Management is a very useful for large sites simple by allowing you to skip viewing the child pages by checking
    11  * checkbox.
     10 * Page Management is a useful tool for large sites which adds a button to pages which allows their subpages
     11 * to be hidden in the All Pages view - so the author can see the pages more easily.
    1212 *
    1313 * @package PageManagement
     
    1818 * @license http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
    1919 */
    20  
    21 /*Adds the checkbox*/
    22 add_action('admin_init', 'page_management_js');
     20if ( !defined('ABSPATH')) exit;
    2321
    24 if (!function_exists('page_management_js')) {
    25     function page_management_js() {
    26         wp_enqueue_script('pagemanagementscript', plugins_url( '/page-management.js' , __FILE__ ), array('jquery'));
     22/*Add CSS and Javascript*/
     23add_action('admin_init', 'page_management_scripts');
     24
     25function page_management_scripts() {
     26    wp_enqueue_script('jquery');
     27    wp_enqueue_script('jquery-ui-core');
     28    wp_enqueue_script('pagemanagementscript', plugins_url( '/page-management.js' , __FILE__ ), array('jquery','jquery-ui-core'));
     29    wp_register_style( 'pagemanagementcss', WP_PLUGIN_URL . '/page-management/page-management.css' );
     30    wp_enqueue_style( 'pagemanagementcss');
     31}
     32
     33/**
     34* Adds relationships in css between the posts.
     35*/
     36function page_management_post_classes($classes) {
     37        global $post;
     38        $ancestor = $post->post_parent;
     39        while($ancestor>0) {
     40            $classes[] = 'descendent-'.$ancestor;
     41            $ancestor = get_post($ancestor)->post_parent;
     42        }
     43        $a_wp_query = new WP_Query();
     44        $all_wp_pages = $a_wp_query->query(array('post_type' => 'page'));
     45        if(count(get_page_children( $post->ID, $all_wp_pages ))>0)
     46            $classes[]='parent';       
     47        return $classes;
     48}
     49add_filter('post_class', 'page_management_post_classes');
     50
     51class options_page {
     52    function __construct() {
     53        add_action('Pages', array(&$this, 'admin_menu'));
     54    }
     55    function admin_menu () {
     56        add_options_page('Page Title','Circle Tree Login','manage_options','options_page_slug',array($this, 'settings_page'));
     57    }
     58    function  settings_page () {
     59        echo 'This is the page content';
    2760    }
    2861}
    29 
     62new options_page;
    3063   
    3164/*Filters the pages*/
  • page-management/trunk/readme.txt

    r755795 r756540  
    22Contributors: WPShowCase
    33Donate link: http://www.wpshowcase.net/
    4 Tags: page management, page filter
     4Tags: page management, page filter, all pages, page tree, admin pages, page manager, hierarchy
    55Requires at least: 2.7
    66Tested up to: 3.6
    7 Stable tag: trunk
     7Stable tag: tags/1.0
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
    1010
    11 Page Management adds a checkbox on the wp-admin "All Pages" page so that you can view the main pages of your site without the child pages.
     11Page Management adds a button to pages which allows their subpages to be hidden in the All Pages view.
    1212
    1313== Description ==
    1414
    15 Page Management is a very useful tool for large sites. It adds a checkbox on the wp-admin "All Pages" page
    16 that enables you to view the main pages of your site without the child pages. So you can keep the main
    17 pages up-to-date easily.
     15Page Management is a useful tool for large sites which adds a button to pages which allows their subpages
     16to be hidden in the All Pages view - so the author can see the pages more easily.
    1817
    1918== Installation ==
     
    2726== Changelog ==
    2827
     28= 1.0 =
     29* Checkbox removed and buttons to expand pages added.
     30
    2931= 0.0 =
    3032* Created
Note: See TracChangeset for help on using the changeset viewer.