Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
09/19/2012 06:52:23 AM (12 years ago)
Author:
johnjamesjacoby
Message:

Wizard:

  • Remove theme selection; theme compat negates this.
  • Fix $bp_pages issues with wizard when using existing pages.
  • Bail early if not correct $_POST conditions rather than huge wrapping if () statements.
  • Remove find.png theme image.
  • Use buddypress() function in place of global $bp in changed files.
  • Bump DB version.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/bp-core-admin.php

    r6342 r6343  
    8383     */
    8484    private function setup_globals() {
    85         global $bp;
    86 
    87         // Admin url
    88         $this->admin_dir  = trailingslashit( $bp->plugin_dir . 'bp-core/admin' );
    89 
    90         // Admin url
    91         $this->admin_url  = trailingslashit( $bp->plugin_url . 'bp-core/admin' );
    92 
    93         // Admin images URL
    94         $this->images_url = trailingslashit( $this->admin_url . 'images' );
    95 
    96         // Admin css URL
    97         $this->css_url    = trailingslashit( $this->admin_url . 'css'    );
    98 
    99         // Admin css URL
    100         $this->js_url     = trailingslashit( $this->admin_url . 'js'     );
     85        $bp               = buddypress();
     86        $this->admin_dir  = trailingslashit( $bp->plugin_dir  . 'bp-core/admin' ); // Admin path
     87        $this->admin_url  = trailingslashit( $bp->plugin_url  . 'bp-core/admin' ); // Admin url
     88        $this->images_url = trailingslashit( $this->admin_url . 'images'        ); // Admin images URL
     89        $this->css_url    = trailingslashit( $this->admin_url . 'css'           ); // Admin css URL
     90        $this->js_url     = trailingslashit( $this->admin_url . 'js'            ); // Admin css URL
    10191    }
    10292
     
    150140        add_action( bp_core_admin_hook(),    array( $this, 'admin_menus' ), 5 );
    151141
    152         // Add notice if not using a BuddyPress theme
     142        // Add notice if an update is needed
    153143        add_action( 'admin_notices',         array( $this, 'admin_notices' ) );
    154144        add_action( 'network_admin_notices', array( $this, 'admin_notices' ) );
     
    186176        if ( bp_get_maintenance_mode() ) {
    187177
    188             if ( !current_user_can( 'manage_options' ) )
     178            if ( !current_user_can( 'manage_options' ) ) {
    189179                return;
    190 
    191             if ( bp_get_maintenance_mode() == 'install' )
     180            }
     181
     182            if ( bp_get_maintenance_mode() == 'install' ) {
    192183                $status = __( 'BuddyPress Setup', 'buddypress' );
    193             else
     184            } else {
    194185                $status = __( 'Update BuddyPress',  'buddypress' );
     186            }
    195187
    196188            if ( bp_get_wizard() ) {
     
    206198
    207199            // Bail if user cannot moderate
    208             if ( ! bp_current_user_can( 'manage_options' ) )
     200            if ( ! bp_current_user_can( 'manage_options' ) ) {
    209201                return;
     202            }
    210203
    211204            $hooks = array();
     
    477470            // Update text
    478471            case 'update' :
    479                 $msg = sprintf( __( 'BuddyPress has been updated! Please run the <a href="%s">update wizard</a>.', 'buddypress' ), $url );
     472                $msg = sprintf( __( 'BuddyPress has been updated! Please run the <a href="%s">update wizard</a>.', 'buddypress' ), esc_url( $url ) );
    480473                break;
    481474
    482475            // First install text
    483476            case 'install' : default :
    484                 $msg = sprintf( __( 'BuddyPress was successfully activated! Please run the <a href="%s">installation wizard</a>.', 'buddypress' ), $url );
     477                $msg = sprintf( __( 'BuddyPress was successfully activated! Please run the <a href="%s">installation wizard</a>.', 'buddypress' ), esc_url( $url ) );
    485478                break;
    486479        } ?>
     
    501494 */
    502495function bp_admin() {
    503     global $bp;
    504 
    505     $bp->admin = new BP_Admin();
     496    buddypress()->admin = new BP_Admin();
    506497}
Note: See TracChangeset for help on using the changeset viewer.