Ticket #3708: 3708-1.patch
| File 3708-1.patch, 12.2 KB (added by , 14 years ago) |
|---|
-
bp-xprofile/bp-xprofile-admin.php
22 22 if ( !is_super_admin() ) 23 23 return false; 24 24 25 $hook = add_ submenu_page( 'bp-general-settings',__( 'Profile Fields', 'buddypress' ), __( 'Profile Fields', 'buddypress' ), 'manage_options', 'bp-profile-setup', 'xprofile_admin' );25 $hook = add_users_page( __( 'Profile Fields', 'buddypress' ), __( 'Profile Fields', 'buddypress' ), 'manage_options', 'bp-profile-setup', 'xprofile_admin' ); 26 26 27 27 add_action( "admin_print_styles-$hook", 'bp_core_add_admin_menu_styles' ); 28 28 } … … 71 71 72 72 <h2> 73 73 74 <?php _e( ' ExtendedProfile Fields', 'buddypress'); ?>74 <?php _e( 'Profile Fields', 'buddypress'); ?> 75 75 76 76 <a id="add_group" class="button add-new-h2" href="admin.php?page=bp-profile-setup&mode=add_group"><?php _e( 'Add New Group', 'buddypress' ); ?></a> 77 77 </h2> -
bp-core/bp-core-functions.php
230 230 add_action( 'bp_init', 'bp_core_admin_menu_init' ); 231 231 232 232 /** 233 * In BP 1.6, the top-level admin menu was removed. This change could break old 234 * third-party plugins, so this function keeps the top-level menu if a plugin 235 * has registered a menu into the old 'bp-general-settings' menu. 236 * 237 * The old "bp-general-settings" page was renamed "bp-general-config". 238 * 239 * @global array $_parent_pages 240 * @global array $_registered_pages 241 * @global array $submenu 242 * @since 1.6 243 */ 244 function bp_core_admin_backpat_menu() { 245 global $_registered_pages, $_parent_pages, $submenu; 246 247 if ( !is_super_admin() ) 248 return; 249 250 // Don't do anything if a BP upgrade is in progress, or if the bp-wizard is in progress. 251 if ( defined( 'BP_IS_UPGRADE' ) && BP_IS_UPGRADE || empty( $submenu['bp-general-settings'] ) ) 252 return; 253 254 /** 255 * If only the default backpat item is present, then don't show the top-level BuddyPress menu. 256 * This means that no third-party plugins have registered their admin pages into the 257 * 'bp-general-settings' menu. 258 */ 259 if ( 1 == count( $submenu['bp-general-settings'] ) ) { 260 // This removes the top-level menu 261 remove_submenu_page( 'bp-general-settings', 'bp-general-settings' ); 262 remove_menu_page( 'bp-general-settings' ); 263 264 // These stop people accessing the URL directly 265 if ( isset( $_parent_pages['bp-general-settings'] ) ) 266 unset( $_parent_pages['bp-general-settings'] ); 267 268 if ( isset( $_registered_pages['toplevel_page_bp-general-settings'] ) ) 269 unset( $_registered_pages['toplevel_page_bp-general-settings'] ); 270 } 271 } 272 add_action( bp_core_admin_hook(), 'bp_core_admin_backpat_menu', 99999 ); 273 274 /** 233 275 * Adds the "BuddyPress" admin submenu item to the Site Admin tab. 234 276 * 235 277 * @package BuddyPress Core 236 278 * @global object $bp Global BuddyPress settings object 237 279 * @uses is_super_admin() returns true if the current user is a site admin, false if not 238 * @uses add_submenu_page() WP function to add a submenu item239 280 */ 240 281 function bp_core_add_admin_menu() { 241 282 if ( !is_super_admin() ) … … 248 289 249 290 $hooks = array(); 250 291 251 // Add the administration tab under the "Site Admin" tab for site administrators 252 $hooks[] = add_menu_page( __( 'BuddyPress', 'buddypress' ), __( 'BuddyPress', 'buddypress' ), 'manage_options', 'bp-general-settings', 'bp_core_admin_component_setup', '' ); 253 $hooks[] = add_submenu_page( 'bp-general-settings', __( 'Components', 'buddypress' ), __( 'Components', 'buddypress' ), 'manage_options', 'bp-general-settings', 'bp_core_admin_component_setup' ); 254 $hooks[] = add_submenu_page( 'bp-general-settings', __( 'Pages', 'buddypress' ), __( 'Pages', 'buddypress' ), 'manage_options', 'bp-page-settings', 'bp_core_admin_page_setup' ); 255 $hooks[] = add_submenu_page( 'bp-general-settings', __( 'Settings', 'buddypress' ), __( 'Settings', 'buddypress' ), 'manage_options', 'bp-settings', 'bp_core_admin_settings' ); 292 // Changed in BP 1.6 . See bp_core_admin_backpat_menu() 293 $hooks[] = add_menu_page( __( 'BuddyPress', 'buddypress' ), __( 'BuddyPress', 'buddypress' ), 'manage_options', 'bp-general-settings', 'bp_core_admin_backpat_menu', '' ); 294 $hooks[] = add_submenu_page( 'bp-general-settings', __( 'BuddyPress Help', 'buddypress' ), __( 'Help', 'buddypress' ), 'manage_options', 'bp-general-settings', 'bp_core_admin_backpat_page' ); 256 295 296 // Add the option pages 297 $hooks[] = add_options_page( __( 'BP Components', 'buddypress' ), __( 'BP Components', 'buddypress' ), 'manage_options', 'bp-general-config', 'bp_core_admin_component_setup' ); 298 $hooks[] = add_options_page( __( 'BP Pages', 'buddypress' ), __( 'BP Pages', 'buddypress' ), 'manage_options', 'bp-page-settings', 'bp_core_admin_page_setup' ); 299 $hooks[] = add_options_page( __( 'BP Settings', 'buddypress' ), __( 'BP Settings', 'buddypress' ), 'manage_options', 'bp-settings', 'bp_core_admin_settings' ); 300 257 301 // Add a hook for css/js 258 302 foreach( $hooks as $hook ) 259 303 add_action( "admin_print_styles-$hook", 'bp_core_add_admin_menu_styles' ); -
bp-core/admin/bp-core-admin.php
28 28 // Setup core admin tabs 29 29 $tabs = array( 30 30 '0' => array( 31 'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-general- settings' ), 'admin.php' ) ),31 'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-general-config' ), 'admin.php' ) ), 32 32 'name' => __( 'Components', 'buddypress' ) 33 33 ), 34 34 '1' => array( … … 64 64 } 65 65 66 66 /** 67 * Generates markup for a fallback top-level BuddyPress menu page, if the site is running 68 * a legacy plugin which hasn't been updated. If the site is up to date, this page 69 * will never appear. 70 * 71 * @see bp_core_admin_backpat_menu() 72 * @since 1.6 73 * @todo Add convenience links into the markup once new positions are finalised. 74 */ 75 function bp_core_admin_backpat_page() { 76 ?> 77 <div class="wrap"> 78 <h2><?php _e( 'Why have all my BuddyPress menus disappeared?', 'buddypress' ); ?></h2> 79 80 <p><?php _e( "Don't worry! We've moved the BuddyPress options into more appropriate locations in the admin menu. You're seeing this page because you are running a legacy BuddyPress plugin which has not been updated.", 'buddypress' ); ?></p> 81 <p>TODO: Add convenience links into the markup once new positions are finalised.</p> 82 83 <!-- 84 <p><?php printf( __( 'To create or edit user profile fields, go to: <a href="">Components</a>', 'buddypress' ), '#' ); ?></p> 85 <p><?php printf( __( 'To create or edit user profile fields, go to: <a href="">Pages</a>', 'buddypress' ), '#' ); ?></p> 86 <p><?php printf( __( 'To create or edit user profile fields, go to: <a href="">Settings</a>', 'buddypress' ), '#' ); ?></p> 87 <p><?php printf( __( 'To create or edit user profile fields, go to: <a href="">Forums</a>', 'buddypress' ), '#' ); ?></p> 88 <p><?php printf( __( 'To create or edit user profile fields, go to: <a href="">Profile Fields</a>', 'buddypress' ), '#' ); ?></p> 89 --> 90 </div> 91 <?php 92 } 93 94 /** 67 95 * Renders the Settings admin panel. 68 96 * 69 97 * @package BuddyPress Core … … 217 245 bp_update_option( 'bp-active-components', $bp->active_components ); 218 246 } 219 247 220 $base_url = bp_get_admin_url( add_query_arg( array( 'page' => 'bp-general- settings', 'updated' => 'true' ), 'admin.php' ) );248 $base_url = bp_get_admin_url( add_query_arg( array( 'page' => 'bp-general-config', 'updated' => 'true' ), 'admin.php' ) ); 221 249 222 250 wp_redirect( $base_url ); 223 251 } -
bp-core/admin/bp-core-update.php
166 166 do_action( 'bp_admin_notices' ); 167 167 168 168 $step_count = count( $this->steps ) - 1; 169 $wiz_or_set = $this->current_step >= $step_count ? 'bp-general- settings' : 'bp-wizard';169 $wiz_or_set = $this->current_step >= $step_count ? 'bp-general-config' : 'bp-wizard'; 170 170 $form_action = bp_core_update_do_network_admin() ? network_admin_url( add_query_arg( array( 'page' => $wiz_or_set ), 'admin.php' ) ) : admin_url( add_query_arg( array( 'page' => $wiz_or_set ), 'admin.php' ) ); 171 171 ?> 172 172 … … 1104 1104 bp_core_add_admin_menu(); 1105 1105 1106 1106 // Redirect to the BuddyPress dashboard 1107 $redirect = bp_core_update_do_network_admin() ? add_query_arg( array( 'page' => 'bp-general- settings' ), network_admin_url( 'admin.php' ) ) : add_query_arg( array( 'page' => 'bp-general-settings' ), admin_url( 'admin.php' ) );1107 $redirect = bp_core_update_do_network_admin() ? add_query_arg( array( 'page' => 'bp-general-config' ), network_admin_url( 'admin.php' ) ) : add_query_arg( array( 'page' => 'bp-general-config' ), admin_url( 'admin.php' ) ); 1108 1108 1109 1109 wp_redirect( $redirect ); 1110 1110 … … 1325 1325 } 1326 1326 1327 1327 /* Settings Icon */ 1328 ul#adminmenu li.toplevel_page_bp-general- settings.wp-menu-image a img { display: none; }1329 ul#adminmenu li.toplevel_page_bp-general- settings.wp-menu-image a { background-image: url( <?php echo plugins_url( 'buddypress/bp-core/images/admin_menu_icon.png' ) ?> ) !important; background-position: -1px -32px; }1330 ul#adminmenu li.toplevel_page_bp-general- settings:hover .wp-menu-image a,1331 ul#adminmenu li.toplevel_page_bp-general- settings.wp-has-current-submenu .wp-menu-image a {1328 ul#adminmenu li.toplevel_page_bp-general-config .wp-menu-image a img { display: none; } 1329 ul#adminmenu li.toplevel_page_bp-general-config .wp-menu-image a { background-image: url( <?php echo plugins_url( 'buddypress/bp-core/images/admin_menu_icon.png' ) ?> ) !important; background-position: -1px -32px; } 1330 ul#adminmenu li.toplevel_page_bp-general-config:hover .wp-menu-image a, 1331 ul#adminmenu li.toplevel_page_bp-general-config.wp-has-current-submenu .wp-menu-image a { 1332 1332 background-position: -1px 0; 1333 1333 } 1334 1334 </style> -
bp-core/bp-core-cssjs.php
22 22 } 23 23 24 24 /* Settings Icon */ 25 ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image a img { display: none; } 26 ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image a { background-image: url( <?php echo plugins_url( 'buddypress/bp-core/images/admin_menu_icon.png' ) ?> ) !important; background-position: -1px -32px; } 25 ul#adminmenu li.toplevel_page_bp-general-config .wp-menu-image a img, 26 ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image a img { 27 display: none; 28 } 29 30 ul#adminmenu li.toplevel_page_bp-general-config .wp-menu-image a, 31 ul#adminmenu li.toplevel_page_bp-general-settings .wp-menu-image a { 32 background-image: url( <?php echo plugins_url( 'buddypress/bp-core/images/admin_menu_icon.png' ) ?> ) !important; background-position: -1px -32px; 33 } 34 35 ul#adminmenu li.toplevel_page_bp-general-config:hover .wp-menu-image a, 27 36 ul#adminmenu li.toplevel_page_bp-general-settings:hover .wp-menu-image a, 37 ul#adminmenu li.toplevel_page_bp-general-config.wp-has-current-submenu .wp-menu-image a, 28 38 ul#adminmenu li.toplevel_page_bp-general-settings.wp-has-current-submenu .wp-menu-image a { 29 39 background-position: -1px 0; 30 40 } -
bp-forums/bp-forums-admin.php
9 9 return false; 10 10 11 11 // Add the administration tab under the "Site Admin" tab for site administrators 12 $hook = add_ submenu_page( 'bp-general-settings', __( 'Forums', 'buddypress' ), __( 'Forums', 'buddypress' ), 'manage_options', 'bb-forums-setup', "bp_forums_bbpress_admin" );12 $hook = add_options_page( __( 'BP Forums', 'buddypress' ), __( 'BP Forums', 'buddypress' ), 'manage_options', 'bb-forums-setup', "bp_forums_bbpress_admin" ); 13 13 add_action( "admin_print_styles-$hook", 'bp_core_add_admin_menu_styles' ); 14 14 } 15 15 add_action( bp_core_admin_hook(), 'bp_forums_add_admin_menu' );