Changeset 6026 for trunk/bp-core/bp-core-admin.php
- Timestamp:
- 05/13/2012 04:52:16 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-core/bp-core-admin.php
r6022 r6026 49 49 50 50 /** 51 * @var string URL to the BuddyPress admin styles directory52 */53 public $styles_url = '';54 55 /**56 51 * @var string URL to the BuddyPress admin CSS directory 57 52 */ … … 63 58 public $js_url = ''; 64 59 65 /** Recounts **************************************************************/66 67 /**68 * @var bool Enable recounts in Tools area69 */70 public $enable_recounts = false;71 72 /** Admin Scheme **********************************************************/73 74 /**75 * @var int Depth of custom WP_CONTENT_DIR difference76 */77 public $content_depth = 0;78 60 79 61 /** Methods ***************************************************************/ … … 117 99 // Admin css URL 118 100 $this->js_url = trailingslashit( $this->admin_url . 'js' ); 119 120 // Admin images URL121 $this->styles_url = trailingslashit( $this->admin_url . 'styles' );122 101 } 123 102 … … 178 157 add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); 179 158 180 // Forums 'Right now' Dashboard widget181 //add_action( 'wp_dashboard_setup', array( $this, 'dashboard_widget_right_now' ) );182 183 159 /** BuddyPress Actions ************************************************/ 184 185 // Add importers186 //add_action( 'bp_admin_init', array( $this, 'register_importers' ) );187 188 // Add red admin style189 //add_action( 'bp_admin_init', array( $this, 'register_admin_style' ) );190 160 191 161 // Add settings … … 196 166 // Add link to settings page 197 167 add_filter( 'plugin_action_links', array( $this, 'add_settings_link' ), 10, 2 ); 198 199 // Add sample permalink filter200 //add_filter( 'post_type_link', 'bp_filter_sample_permalink', 10, 4 );201 168 } 202 169 … … 380 347 381 348 /** 382 * Register the importers383 *384 * @since BuddyPress (1.6)385 *386 * @uses do_action() Calls 'bp_register_importers'387 * @uses apply_filters() Calls 'bp_importer_path' filter to allow plugins388 * to customize the importer script locations.389 */390 public function register_importers() {391 392 // Leave if we're not in the import section393 if ( !defined( 'WP_LOAD_IMPORTERS' ) )394 return;395 396 // Load Importer API397 require_once( ABSPATH . 'wp-admin/includes/import.php' );398 399 // Load our importers400 $importers = apply_filters( 'bp_importers', array( 'buddypress' ) );401 402 // Loop through included importers403 foreach ( $importers as $importer ) {404 405 // Allow custom importer directory406 $import_dir = apply_filters( 'bp_importer_path', $this->admin_dir . 'importers', $importer );407 408 // Compile the importer path409 $import_file = trailingslashit( $import_dir ) . $importer . '.php';410 411 // If the file exists, include it412 if ( file_exists( $import_file ) ) {413 require( $import_file );414 }415 }416 417 // Don't do anything we wouldn't do418 do_action( 'bp_register_importers' );419 }420 421 /**422 349 * Add Settings link to plugins area 423 350 * … … 452 379 453 380 /** 454 * Add the 'Right now in Forums' dashboard widget455 *456 * @since BuddyPress (1.6)457 *458 * @uses wp_add_dashboard_widget() To add the dashboard widget459 */460 public function dashboard_widget_right_now() {461 //wp_add_dashboard_widget( 'bp-dashboard-right-now', __( 'Right Now in Forums', 'buddypress' ), 'bp_dashboard_widget_right_now' );462 }463 464 /**465 381 * Add some general styling to the admin area 466 382 * … … 503 419 504 420 do_action( 'bp_admin_head' ); 505 }506 507 /**508 * Registers the BuddyPress admin color scheme509 *510 * Because wp-content can exist outside of the WordPress root there is no511 * way to be certain what the relative path of the admin images is.512 * We are including the two most common configurations here, just in case.513 *514 * @since BuddyPress (1.6)515 *516 * @uses wp_admin_css_color() To register the color scheme517 */518 public function register_admin_style () {519 520 // Normal wp-content dir521 if ( 0 === $this->content_depth )522 $css_file = $this->styles_url . 'admin.css';523 524 // Custom wp-content dir is 1 level away525 elseif ( 1 === $this->content_depth )526 $css_file = $this->styles_url . 'admin-1.css';527 528 // Custom wp-content dir is 1 level away529 elseif ( 2 === $this->content_depth )530 $css_file = $this->styles_url . 'admin-2.css';531 532 // Load the admin CSS styling533 //wp_admin_css_color( 'buddypress', __( 'Green', 'buddypress' ), $css_file, array( '#222222', '#006600', '#deece1', '#6eb469' ) );534 421 } 535 422
Note: See TracChangeset
for help on using the changeset viewer.