Changeset 3917 for trunk/bp-forums/bp-forums-loader.php
- Timestamp:
- 01/25/2011 08:58:56 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-forums/bp-forums-loader.php
r3877 r3917 18 18 */ 19 19 function BP_Forums_Component() { 20 parent::start( 'forums', __( 'Discussion Forums', 'buddypress' ) ); 20 parent::start( 21 'forums', 22 __( 'Discussion Forums', 'buddypress' ), 23 BP_PLUGIN_DIR 24 ); 21 25 } 22 26 … … 41 45 define( 'BP_FORUMS_SLUG', $this->id ); 42 46 43 // Do some slug checks44 $this->slug = BP_FORUMS_SLUG;45 $this->root_slug = isset( $bp->pages->forums->slug ) ? $bp->pages->forums->slug : $this->slug;46 47 47 // The location of the bbPress stand-alone config file 48 48 if ( isset( $bp->site_options['bb-config-location'] ) ) 49 49 $this->bbconfig = $bp->site_options['bb-config-location']; 50 50 51 // The default text for the blogs directory search box 52 $this->default_search_string = __( 'Search Forums...', 'buddypress' ); 51 // All globals for messaging component. 52 // Note that global_tables is included in this array. 53 $globals = array( 54 'slug' => BP_FORUMS_SLUG, 55 'root_slug' => isset( $bp->pages->forums->slug ) ? $bp->pages->forums->slug : BP_FORUMS_SLUG, 56 'notification_callback' => 'messages_format_notifications', 57 'search_string' => __( 'Search Forums...', 'buddypress' ), 58 ); 53 59 54 // Register this in the active components array 55 $bp->active_components[$this->id] = $this->id; 60 parent::_setup_globals( $globals ); 56 61 } 57 62 … … 61 66 function _includes() { 62 67 63 // Support for bbPress stand-alone 68 // Files to include 69 $includes = array( 70 'actions', 71 'screens', 72 'classes', 73 'filters', 74 'template', 75 'functions', 76 ); 77 78 // Admin area 79 if ( is_admin() ) 80 $includes[] = 'admin'; 81 82 // bbPress stand-alone 64 83 if ( !defined( 'BB_PATH' ) ) 65 require ( BP_PLUGIN_DIR . '/bp-forums/bp-forums-bbpress-sa.php' );84 $includes[] = 'bbpress-sa'; 66 85 67 // Admin 68 if ( is_admin() ) 69 require ( BP_PLUGIN_DIR . '/bp-forums/bp-forums-admin.php' ); 70 71 require ( BP_PLUGIN_DIR . '/bp-forums/bp-forums-actions.php' ); 72 require ( BP_PLUGIN_DIR . '/bp-forums/bp-forums-screens.php' ); 73 require ( BP_PLUGIN_DIR . '/bp-forums/bp-forums-filters.php' ); 74 require ( BP_PLUGIN_DIR . '/bp-forums/bp-forums-template.php' ); 75 require ( BP_PLUGIN_DIR . '/bp-forums/bp-forums-functions.php' ); 86 parent::_includes( $includes ); 76 87 } 77 88 … … 85 96 86 97 // Add 'Forums' to the main navigation 87 bp_core_new_nav_item(array(98 $main_nav = array( 88 99 'name' => __( 'Forums', 'buddypress' ), 89 100 'slug' => $this->slug, … … 91 102 'screen_function' => 'bp_forums_screen_topics', 92 103 'default_subnav_slug' => 'topics', 93 'item_css_id' => $this->id )104 'item_css_id' => $this->id 94 105 ); 95 106 … … 113 124 114 125 // Additional menu if friends is active 115 bp_core_new_subnav_item(array(126 $sub_nav[] = array( 116 127 'name' => __( 'Topics Started', 'buddypress' ), 117 128 'slug' => 'topics', … … 121 132 'position' => 20, 122 133 'item_css_id' => 'forums-friends' 123 ) );134 ); 124 135 125 136 // Additional menu if friends is active 126 bp_core_new_subnav_item(array(137 $sub_nav[] = array( 127 138 'name' => __( 'Replies', 'buddypress' ), 128 139 'slug' => 'replies', … … 132 143 'position' => 40, 133 144 'item_css_id' => 'forums-friends' 134 ) );145 ); 135 146 136 147 // Favorite forums items 137 bp_core_new_subnav_item(array(148 $sub_nav[] = array( 138 149 'name' => __( 'Favorite Topics', 'buddypress' ), 139 150 'slug' => 'favorites', … … 143 154 'position' => 60, 144 155 'item_css_id' => 'forums-favs' 145 ) ); 156 ); 157 158 parent::_setup_nav( $main_nav, $sub_nav ); 159 } 160 161 /** 162 * Sets up the title for pages and <title> 163 * 164 * @global obj $bp 165 */ 166 function _setup_title() { 167 global $bp; 146 168 147 169 // Adjust title based on view … … 157 179 } 158 180 } 181 182 parent::_setup_title(); 159 183 } 160 184 }
Note: See TracChangeset
for help on using the changeset viewer.