Changeset 3917 for trunk/bp-blogs/bp-blogs-loader.php
- Timestamp:
- 01/25/2011 08:58:56 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-blogs/bp-blogs-loader.php
r3855 r3917 18 18 */ 19 19 function BP_Blogs_Component() { 20 parent::start( 'blogs', __( 'Blogs Streams', 'buddypress' ) ); 20 parent::start( 21 'blogs', 22 __( 'Blogs Streams', 'buddypress' ), 23 BP_PLUGIN_DIR 24 ); 21 25 } 22 26 … … 36 40 define ( 'BP_BLOGS_SLUG', $this->id ); 37 41 38 // Do some slug checks 39 $this->slug = BP_BLOGS_SLUG; 40 $this->root_slug = isset( $bp->pages->blogs->slug ) ? $bp->pages->blogs->slug : $this->slug; 42 // Global tables for messaging component 43 $global_tables = array( 44 'table_name' => $bp->table_prefix . 'bp_user_blogs', 45 'table_name_blogmeta' => $bp->table_prefix . 'bp_user_blogs_blogmeta', 46 ); 41 47 42 // Tables 43 $this->table_name = $bp->table_prefix . 'bp_user_blogs'; 44 $this->table_name_blogmeta = $bp->table_prefix . 'bp_user_blogs_blogmeta'; 48 // All globals for messaging component. 49 // Note that global_tables is included in this array. 50 $globals = array( 51 'path' => BP_PLUGIN_DIR, 52 'slug' => BP_BLOGS_SLUG, 53 'root_slug' => isset( $bp->pages->blogs->slug ) ? $bp->pages->blogs->slug : BP_BLOGS_SLUG, 54 'notification_callback' => 'bp_blogs_format_notifications', 55 'search_string' => __( 'Search Blogs...', 'buddypress' ), 56 'autocomplete_all' => defined( 'BP_MESSAGES_AUTOCOMPLETE_ALL' ), 57 'global_tables' => $global_tables, 58 ); 45 59 46 // Notifications 47 $this->notification_callback = 'bp_blogs_format_notifications'; 48 49 // Register this in the active components array 50 $bp->active_components[$this->id] = $this->id; 51 52 // The default text for the blogs directory search box 53 $bp->default_search_strings[$this->id] = __( 'Search Blogs...', 'buddypress' ); 60 // Setup the globals 61 parent::_setup_globals( $globals ); 54 62 } 55 63 … … 58 66 */ 59 67 function _includes() { 60 require_once( BP_PLUGIN_DIR . '/bp-blogs/bp-blogs-cache.php' ); 61 require_once( BP_PLUGIN_DIR . '/bp-blogs/bp-blogs-classes.php' ); 62 require_once( BP_PLUGIN_DIR . '/bp-blogs/bp-blogs-screens.php' ); 63 require_once( BP_PLUGIN_DIR . '/bp-blogs/bp-blogs-actions.php' ); 64 require_once( BP_PLUGIN_DIR . '/bp-blogs/bp-blogs-activity.php' ); 65 require_once( BP_PLUGIN_DIR . '/bp-blogs/bp-blogs-template.php' ); 66 require_once( BP_PLUGIN_DIR . '/bp-blogs/bp-blogs-functions.php' ); 68 // Files to include 69 $includes = array( 70 'cache', 71 'actions', 72 'screens', 73 'classes', 74 'template', 75 'activity', 76 'functions', 77 ); 67 78 68 79 if ( is_multisite() ) 69 require_once( BP_PLUGIN_DIR . '/bp-blogs/bp-blogs-widgets.php' ); 80 $includes[] = 'widgets'; 81 82 // Include the files 83 parent::_includes( $includes ); 70 84 } 71 85 … … 87 101 88 102 // Add 'Blogs' to the main navigation 89 bp_core_new_nav_item(array(103 $main_nav = array( 90 104 'name' => sprintf( __( 'Blogs <span>(%d)</span>', 'buddypress' ), bp_blogs_total_blogs_for_user() ), 91 105 'slug' => $this->slug, … … 94 108 'default_subnav_slug' => 'my-blogs', 95 109 'item_css_id' => $this->id 96 ) ); 110 ); 111 112 // Setup navigation 113 parent::_setup_nav( $main_nav, $sub_nav ); 114 } 115 116 /** 117 * Sets up the title for pages and <title> 118 * 119 * @global obj $bp 120 */ 121 function _setup_title() { 122 global $bp; 97 123 98 124 // Set up the component options navigation for Blog 99 if ( $bp->blogs->slug == $bp->current_component) {125 if ( bp_is_blogs_component() ) { 100 126 if ( bp_is_my_profile() ) { 101 127 if ( function_exists('xprofile_setup_nav') ) { … … 113 139 } 114 140 } 141 142 parent::_setup_title(); 115 143 } 116 144 }
Note: See TracChangeset
for help on using the changeset viewer.