Changeset 3917 for trunk/bp-settings/bp-settings-loader.php
- Timestamp:
- 01/25/2011 08:58:56 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-settings/bp-settings-loader.php
r3778 r3917 9 9 */ 10 10 function BP_Settings_Component() { 11 parent::start( 'settings', __( 'Settings', 'buddypress' ) ); 11 parent::start( 12 'settings', 13 __( 'Settings', 'buddypress' ), 14 BP_PLUGIN_DIR 15 ); 16 } 17 18 /** 19 * Include files 20 * 21 * @global obj $bp 22 */ 23 function _includes() { 24 // Files to include 25 $includes = array( 26 'actions', 27 'screens', 28 'template', 29 'functions', 30 ); 31 32 parent::_includes( $includes ); 12 33 } 13 34 … … 28 49 define( 'BP_SETTINGS_SLUG', $this->id ); 29 50 30 // Do some slug checks 31 $this->slug = BP_SETTINGS_SLUG; 32 $this->root_slug = isset( $bp->pages->settings->slug ) ? $bp->pages->settings->slug : $this->slug; 33 34 // Register this in the active components array 35 $bp->active_components[$this->id] = $this->id; 36 } 51 // All globals for messaging component. 52 // Note that global_tables is included in this array. 53 $globals = array( 54 'slug' => BP_SETTINGS_SLUG, 55 'root_slug' => isset( $bp->pages->settings->slug ) ? $bp->pages->settings->slug : BP_SETTINGS_SLUG, 56 ); 37 57 38 /** 39 * Include files 40 * 41 * @global obj $bp 42 */ 43 function _includes() { 44 require_once( BP_PLUGIN_DIR . '/bp-settings/bp-settings-actions.php' ); 45 require_once( BP_PLUGIN_DIR . '/bp-settings/bp-settings-screens.php' ); 46 require_once( BP_PLUGIN_DIR . '/bp-settings/bp-settings-template.php' ); 47 require_once( BP_PLUGIN_DIR . '/bp-settings/bp-settings-functions.php' ); 58 parent::_setup_globals( $globals ); 48 59 } 49 60 … … 57 68 58 69 // Add the settings navigation item 59 bp_core_new_nav_item(array(70 $main_nav = array( 60 71 'name' => __( 'Settings', 'buddypress' ), 61 72 'slug' => $this->slug, 62 73 'position' => 100, 63 'show_for_displayed_user' => bp_ users_can_edit_settings(),74 'show_for_displayed_user' => bp_members_can_edit_settings(), 64 75 'screen_function' => 'bp_settings_screen_general_settings', 65 76 'default_subnav_slug' => 'general' 66 ) );77 ); 67 78 68 $settings_link = trailingslashit( $bp->displayed_user->domain . $ bp->settings->slug );79 $settings_link = trailingslashit( $bp->displayed_user->domain . $this->slug ); 69 80 70 81 // Add General Settings nav item 71 bp_core_new_subnav_item(array(82 $sub_nav[] = array( 72 83 'name' => __( 'General', 'buddypress' ), 73 84 'slug' => 'general', … … 76 87 'screen_function' => 'bp_settings_screen_general_settings', 77 88 'position' => 10, 78 'user_has_access' => bp_ users_can_edit_settings()79 ) );89 'user_has_access' => bp_members_can_edit_settings() 90 ); 80 91 81 92 // Add Notifications nav item 82 bp_core_new_subnav_item(array(93 $sub_nav[] = array( 83 94 'name' => __( 'Notifications', 'buddypress' ), 84 95 'slug' => 'notifications', … … 87 98 'screen_function' => 'bp_settings_screen_notification_settings', 88 99 'position' => 20, 89 'user_has_access' => bp_ users_can_edit_settings()90 ) );100 'user_has_access' => bp_members_can_edit_settings() 101 ); 91 102 92 103 // Add Delete Account nav item 93 104 if ( !is_super_admin() && empty( $bp->site_options['bp-disable-account-deletion'] ) ) { 94 bp_core_new_subnav_item(array(105 $sub_nav[] = array( 95 106 'name' => __( 'Delete Account', 'buddypress' ), 96 107 'slug' => 'delete-account', … … 100 111 'position' => 90, 101 112 'user_has_access' => bp_is_my_profile() 102 ) );113 ); 103 114 } 115 116 parent::_setup_nav( $main_nav, $sub_nav ); 104 117 } 105 118 }
Note: See TracChangeset
for help on using the changeset viewer.