Plugin Directory


Ignore:
Timestamp:
09/24/2012 11:11:56 PM (14 years ago)
Author:
phill_brown
Message:

1.2 code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • menu-rules/trunk/admin/admin.php

    r521950 r603355  
    44class Menu_Rules_Admin {
    55
    6     static $meta_box;
     6    static $meta_box_conditions;
     7    static $meta_box_reactions;
    78
    89    // On plugins loaded
     
    1718
    1819        add_action( 'admin_print_styles-post.php', __CLASS__ . '::styles' );
     20        add_action( 'admin_print_styles-post-new.php', __CLASS__ . '::styles' );
     21
    1922        add_action( 'admin_print_scripts-post.php', __CLASS__ . '::scripts' );
     23        add_action( 'admin_print_scripts-post-new.php', __CLASS__ . '::scripts' );
    2024    }
    2125
     
    2428
    2529        // Load meta box object here so the save handler is added earlier in the request but after plugins_loaded so menu items are loaded
    26         require dirname( __FILE__ ) . '/meta-box.php';
    27         self::$meta_box = new Menu_Rules_Meta_Box();
     30        require dirname( __FILE__ ) . '/meta-box-conditions.php';
     31        self::$meta_box_conditions = new Menu_Rules_Meta_Box_Conditions();
     32
     33        require dirname( __FILE__ ) . '/meta-box-reactions.php';
     34        self::$meta_box_reactions = new Menu_Rules_Meta_Box_Reactions();
    2835    }
    2936
    30     // When stylesheets are outputted on post.php
     37    // When Stylesheets are outputted on post.php
    3138    static function styles() {
    3239
     
    3441        if ( ! isset( $GLOBALS['post_type_object'] ) || $GLOBALS['post_type_object']->name != Menu_Rules::get_var( 'post_type' ) ) return;
    3542
    36         // Queue admin stylesheet#
    37         wp_enqueue_style( 'menu_rules_admin', plugins_url( '/assets/css/admin.css', dirname( __FILE__ ) ) );
     43        self::$meta_box_reactions->styles();
    3844    }
    3945
     
    4854    }
    4955
     56    // When the post type is registered
     57    // TODO: decouple this from Menu_Rules::init
    5058    static function register_meta_boxes() {
    51         add_meta_box( 'menu-rules', __('Menu Rules'), array( &Menu_Rules_Admin::$meta_box, 'display' ), Menu_Rules::get_var( 'post_type' ), 'normal' );
     59
     60        add_meta_box( 'menu-rules-conditions', __('Conditions'), array( &Menu_Rules_Admin::$meta_box_conditions, 'display' ), Menu_Rules::get_var( 'post_type' ), 'normal' );
     61
     62        add_meta_box( 'menu-rules-reactions', __('Reactions'), array( &Menu_Rules_Admin::$meta_box_reactions, 'display' ), Menu_Rules::get_var( 'post_type' ), 'normal' );
    5263    }
    5364}
Note: See TracChangeset for help on using the changeset viewer.