Changeset 3438
- Timestamp:
- 08/23/2011 01:39:45 AM (15 years ago)
- File:
-
- 1 edited
-
branches/plugin/bbp-admin/bbp-admin.php (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/plugin/bbp-admin/bbp-admin.php
r3436 r3438 21 21 class BBP_Admin { 22 22 23 /** Directory *************************************************************/ 24 25 /** 26 * @var string Path to the bbPress admin directory 27 */ 28 public $admin_dir = ''; 29 23 30 /** URLs ******************************************************************/ 24 31 25 32 /** 33 * @var string URL to the bbPress admin directory 34 */ 35 public $admin_url = ''; 36 37 /** 26 38 * @var string URL to the bbPress images directory 27 39 */ … … 33 45 public $styles_url = ''; 34 46 35 /** URLs ******************************************************************/47 /** Recounts **************************************************************/ 36 48 37 49 /** … … 70 82 /** General Actions ***************************************************/ 71 83 72 // Attach the bbPress admin init action to the WordPress admininit action.73 add_action( 'admin_init', array( $this, 'init') );84 // Attach the bbPress admin_init action to the WordPress admin_init action. 85 add_action( 'admin_init', array( $this, 'admin_init' ) ); 74 86 75 87 // Add some general styling to the admin area 76 add_action( 'admin_head', array( $this, 'admin_head') );88 add_action( 'admin_head', array( $this, 'admin_head' ) ); 77 89 78 90 // Add menu item to settings menu 79 add_action( 'admin_menu', array( $this, 'admin_menus') );91 add_action( 'admin_menu', array( $this, 'admin_menus' ) ); 80 92 81 93 // Add notice if not using a bbPress theme 82 add_action( 'admin_notices', array( $this, 'activation_notice') );83 84 // Register bbPress admin style85 add_action( 'bbp_admin_init', array( $this, 'register_ admin_style') );86 87 // Add the importers88 add_action( 'bbp_admin_init', array( $this, 'register_ importers') );89 90 // Add thesettings91 add_action( 'bbp_admin_init', array( $this, 'register_admin_settings' ) );94 add_action( 'admin_notices', array( $this, 'activation_notice' ) ); 95 96 // Add importers 97 add_action( 'bbp_admin_init', array( $this, 'register_importers' ) ); 98 99 // Add green admin style 100 add_action( 'bbp_admin_init', array( $this, 'register_admin_style' ) ); 101 102 // Add settings 103 add_action( 'bbp_admin_init', array( $this, 'register_admin_settings' ) ); 92 104 93 105 // Forums 'Right now' Dashboard widget … … 110 122 */ 111 123 private function includes() { 112 global $bbp;113 114 // Files to include115 $files = array( 'tools', 'settings', 'functions', 'metaboxes', 'forums', 'topics', 'replies' );116 117 // Buzz buzz118 //if ( get_option( '_bbp_first_run' ) ) $files[] = 'first-run';119 124 120 125 // Include the files 121 foreach ( $files as $file ) 122 require( $bbp->plugin_dir . 'bbp-admin/bbp-' . $file . '.php' ); 126 require( $this->admin_dir . 'bbp-tools.php' ); 127 require( $this->admin_dir . 'bbp-settings.php' ); 128 require( $this->admin_dir . 'bbp-functions.php' ); 129 require( $this->admin_dir . 'bbp-metaboxes.php' ); 130 require( $this->admin_dir . 'bbp-forums.php' ); 131 require( $this->admin_dir . 'bbp-topics.php' ); 132 require( $this->admin_dir . 'bbp-replies.php' ); 123 133 } 124 134 … … 131 141 private function setup_globals() { 132 142 global $bbp; 143 144 // Admin url 145 $this->admin_dir = trailingslashit( $bbp->plugin_dir . 'bbp-admin' ); 133 146 134 147 // Admin url … … 291 304 * 292 305 * @uses do_action() Calls 'bbp_register_importers' 306 * @uses apply_filters() Calls 'bbp_importer_path' filter to allow plugins 307 * to customize the importer script locations. 293 308 */ 294 309 public function register_importers() { … … 298 313 return; 299 314 300 global $bbp;301 302 315 // Load Importer API 303 316 require_once( ABSPATH . 'wp-admin/includes/import.php' ); … … 309 322 foreach ( $importers as $importer ) { 310 323 324 // Allow custom importer directory 325 $import_dir = apply_filters( 'bbp_importer_path', $this->admin_dir . 'importers', $importer ); 326 311 327 // Compile the importer path 312 $import_file = $bbp->plugin_dir . 'bbp-admin/importers/'. $importer . '.php';328 $import_file = trailingslashit( $import_dir ) . $importer . '.php'; 313 329 314 330 // If the file exists, include it … … 382 398 * @uses do_action() Calls 'bbp_admin_init' 383 399 */ 384 public function init() {400 public function admin_init() { 385 401 do_action( 'bbp_admin_init' ); 386 402 }
Note: See TracChangeset
for help on using the changeset viewer.