Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/20/2011 03:56:04 AM (15 years ago)
Author:
johnjamesjacoby
Message:

First pass at BP_Component class. Refactor Activity component to use BP_Component. Introduce page templates for root directories. Rename bp-activity-templatetags to bp-activity-template per WP coding standards. Split bp-activity up into smaller parts. Introduce get_slug functions for activity component. More refactoring to do on other components. This will temporarily break trunk while refactoring happens, so be sure to pin to the previous revision if needed.

File:
1 edited

Legend:

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

    r3745 r3751  
    323323
    324324    function step_pages() {
     325        global $bp;
     326
    325327        if ( !current_user_can( 'activate_plugins' ) )
    326328            return false;
    327329
     330        // Determine where to get the pages from
    328331        if ( !defined( 'BP_ENABLE_MULTIBLOG' ) && is_multisite() )
    329332            $existing_pages = get_blog_option( BP_ROOT_BLOG, 'bp-pages' );
     
    331334            $existing_pages = get_option( 'bp-pages' );
    332335
     336        // Get disabled components
    333337        $disabled_components = apply_filters( 'bp_deactivated_components', get_site_option( 'bp-deactivated-components' ) );
    334338
    335339        // Check for defined slugs
    336         if ( defined( 'BP_MEMBERS_SLUG' ) && BP_MEMBERS_SLUG )
    337             $members_slug = constant( 'BP_MEMBERS_SLUG' );
     340        if ( isset( $bp->members->slug ) )
     341            $members_slug = $bp->members->slug;
    338342        else
    339             $members_slug = __( 'members', 'buddypress' );
    340 
    341         if ( defined( 'BP_GROUPS_SLUG' ) && BP_GROUPS_SLUG )
     343            $members_slug = __( 'Members', 'buddypress' );
     344
     345        // Groups
     346        if ( isset( $bp->groups->slug ) )
    342347            $groups_slug = constant( 'BP_GROUPS_SLUG' );
    343348        else
    344             $groups_slug = __( 'groups', 'buddypress' );
    345 
    346         if ( defined( 'BP_ACTIVITY_SLUG' ) && BP_ACTIVITY_SLUG )
    347             $activity_slug = constant( 'BP_ACTIVITY_SLUG' );
     349            $groups_slug = __( 'Groups', 'buddypress' );
     350
     351        // Activity
     352        if ( isset( $bp->activity->slug ) )
     353            $activity_slug = $bp->activity->slug;
    348354        else
    349355            $activity_slug = __( 'activity', 'buddypress' );
    350356
    351         if ( defined( 'BP_FORUMS_SLUG' ) && BP_FORUMS_SLUG )
    352             $forums_slug = constant( 'BP_FORUMS_SLUG' );
     357        // Forums
     358        if ( isset( $bp->forums->slug ) )
     359            $forums_slug = $bp->forums->slug;
    353360        else
    354361            $forums_slug = __( 'forums', 'buddypress' );
    355362
    356         if ( defined( 'BP_BLOGS_SLUG' ) && BP_BLOGS_SLUG )
    357             $blogs_slug = constant( 'BP_BLOGS_SLUG' );
     363        // Blogs
     364        if ( isset( $bp->blogs->slug ) )
     365            $blogs_slug = $bp->blogs->slug;
    358366        else
    359367            $blogs_slug = __( 'blogs', 'buddypress' );
    360368
    361         if ( defined( 'BP_REGISTER_SLUG' ) && BP_REGISTER_SLUG )
    362             $register_slug = constant( 'BP_REGISTER_SLUG' );
     369        // Register
     370        if ( isset( $bp->register->slug ) )
     371            $register_slug = $bp->register->slug;
    363372        else
    364373            $register_slug = __( 'register', 'buddypress' );
    365374
    366         if ( defined( 'BP_ACTIVATION_SLUG' ) && BP_ACTIVATION_SLUG )
    367             $activation_slug = constant( 'BP_ACTIVATION_SLUG' );
     375        if ( isset( $bp->activation->slug ) )
     376            $activation_slug = $bp->activation->slug;
    368377        else
    369378            $activation_slug = __( 'activate', 'buddypress' );
    370379
     380        // What kind of setup is taking place
    371381        if ( 'new' == $this->setup_type ) : ?>
    372382
Note: See TracChangeset for help on using the changeset viewer.