Changeset 10183 for trunk/src/bp-forums/bp-forums-loader.php
- Timestamp:
- 10/04/2015 07:29:24 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-forums/bp-forums-loader.php
r10096 r10183 1 1 <?php 2 2 /** 3 * BuddyPress Forums Loader 3 * BuddyPress Forums Loader. 4 4 * 5 5 * A discussion forums component. Comes bundled with bbPress stand-alone. … … 48 48 $bp = buddypress(); 49 49 50 // Define the parent forum ID 50 // Define the parent forum ID. 51 51 if ( ! defined( 'BP_FORUMS_PARENT_FORUM_ID' ) ) { 52 52 define( 'BP_FORUMS_PARENT_FORUM_ID', 1 ); 53 53 } 54 54 55 // Define a slug, if necessary 55 // Define a slug, if necessary. 56 56 if ( ! defined( 'BP_FORUMS_SLUG' ) ) { 57 57 define( 'BP_FORUMS_SLUG', $this->id ); 58 58 } 59 59 60 // The location of the bbPress stand-alone config file 60 // The location of the bbPress stand-alone config file. 61 61 $bbconfig = bp_core_get_root_option( 'bb-config-location' ); 62 62 if ( '' !== $bbconfig ) { … … 86 86 public function includes( $includes = array() ) { 87 87 88 // Files to include 88 // Files to include. 89 89 $includes = array( 90 90 'actions', … … 96 96 ); 97 97 98 // bbPress stand-alone 98 // bbPress stand-alone. 99 99 if ( ! defined( 'BB_PATH' ) ) { 100 100 $includes[] = 'bbpress-sa'; 101 101 } 102 102 103 // Admin-specific code 103 // Admin-specific code. 104 104 if ( is_admin() ) { 105 105 $includes[] = 'deprecated/1.6'; … … 118 118 * 119 119 * @param array $main_nav Optional. See BP_Component::setup_nav() for 120 * description.121 * @param array $sub_nav Optional. See BP_Component::setup_nav() for122 * description.120 * description. 121 * @param array $sub_nav Optional. See BP_Component::setup_nav() for 122 * description. 123 123 */ 124 124 public function setup_nav( $main_nav = array(), $sub_nav = array() ) { 125 125 126 // Stop if forums haven't been set up yet 126 // Stop if forums haven't been set up yet. 127 127 if ( ! bp_forums_is_installed_correctly() ) { 128 128 return; 129 129 } 130 130 131 // Stop if there is no user displayed or logged in 131 // Stop if there is no user displayed or logged in. 132 132 if ( ! is_user_logged_in() && ! bp_displayed_user_id() ) { 133 133 return; 134 134 } 135 135 136 // Determine user to use 136 // Determine user to use. 137 137 if ( bp_displayed_user_domain() ) { 138 138 $user_domain = bp_displayed_user_domain(); … … 143 143 } 144 144 145 // User link 145 // User link. 146 146 $slug = bp_get_forums_slug(); 147 147 $forums_link = trailingslashit( $user_domain . $slug ); 148 148 149 // Add 'Forums' to the main navigation 149 // Add 'Forums' to the main navigation. 150 150 $main_nav = array( 151 151 'name' => __( 'Forums', 'buddypress' ), … … 157 157 ); 158 158 159 // Topics started 159 // Topics started. 160 160 $sub_nav[] = array( 161 161 'name' => __( 'Topics Started', 'buddypress' ), … … 168 168 ); 169 169 170 // Topics replied to 170 // Topics replied to. 171 171 $sub_nav[] = array( 172 172 'name' => __( 'Replied To', 'buddypress' ), … … 190 190 * 191 191 * @param array $wp_admin_nav See BP_Component::setup_admin_bar() 192 * for description.192 * for description. 193 193 */ 194 194 public function setup_admin_bar( $wp_admin_nav = array() ) { 195 195 196 // Menus for logged in user 196 // Menus for logged in user. 197 197 if ( is_user_logged_in() ) { 198 198 199 // Setup the logged in user variables 199 // Setup the logged in user variables. 200 200 $forums_link = trailingslashit( bp_loggedin_user_domain() . bp_get_forums_slug() ); 201 201 202 // Add the "My Account" sub menus 202 // Add the "My Account" sub menus. 203 203 $wp_admin_nav[] = array( 204 204 'parent' => buddypress()->my_account_menu_id, … … 208 208 ); 209 209 210 // Topics 210 // Topics. 211 211 $wp_admin_nav[] = array( 212 212 'parent' => 'my-account-' . $this->id, … … 216 216 ); 217 217 218 // Replies 218 // Replies. 219 219 $wp_admin_nav[] = array( 220 220 'parent' => 'my-account-' . $this->id, … … 224 224 ); 225 225 226 // Favorites 226 // Favorites. 227 227 $wp_admin_nav[] = array( 228 228 'parent' => 'my-account-' . $this->id, … … 241 241 public function setup_title() { 242 242 243 // Adjust title based on view 243 // Adjust title based on view. 244 244 if ( bp_is_forums_component() ) { 245 245 $bp = buddypress();
Note: See TracChangeset
for help on using the changeset viewer.