Changeset 603355 for menu-rules/trunk/admin/admin.php
- Timestamp:
- 09/24/2012 11:11:56 PM (14 years ago)
- File:
-
- 1 edited
-
menu-rules/trunk/admin/admin.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
menu-rules/trunk/admin/admin.php
r521950 r603355 4 4 class Menu_Rules_Admin { 5 5 6 static $meta_box; 6 static $meta_box_conditions; 7 static $meta_box_reactions; 7 8 8 9 // On plugins loaded … … 17 18 18 19 add_action( 'admin_print_styles-post.php', __CLASS__ . '::styles' ); 20 add_action( 'admin_print_styles-post-new.php', __CLASS__ . '::styles' ); 21 19 22 add_action( 'admin_print_scripts-post.php', __CLASS__ . '::scripts' ); 23 add_action( 'admin_print_scripts-post-new.php', __CLASS__ . '::scripts' ); 20 24 } 21 25 … … 24 28 25 29 // 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(); 28 35 } 29 36 30 // When stylesheets are outputted on post.php37 // When Stylesheets are outputted on post.php 31 38 static function styles() { 32 39 … … 34 41 if ( ! isset( $GLOBALS['post_type_object'] ) || $GLOBALS['post_type_object']->name != Menu_Rules::get_var( 'post_type' ) ) return; 35 42 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(); 38 44 } 39 45 … … 48 54 } 49 55 56 // When the post type is registered 57 // TODO: decouple this from Menu_Rules::init 50 58 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' ); 52 63 } 53 64 }
Note: See TracChangeset
for help on using the changeset viewer.