Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/25/2011 08:58:56 PM (14 years ago)
Author:
johnjamesjacoby
Message:

Rename new 'bp-users' component to 'bp-members' for consistency through-out project.
Core, Messages, and Friends Components now use the BP_Component class.
Split Friends and Messages components into smaller files.
Change references to 'profile' to 'xprofile' through-out project for consistency.
Introduce 'bp_actions' and 'bp_screens' standard hooks to replace the usage of 'wp' through-out project.
Move component loader sequence into bp-core-bootstrap.php,
Move old root_component action into 1.3 deprecated file.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-forums/bp-forums-loader.php

    r3877 r3917  
    1818     */
    1919    function BP_Forums_Component() {
    20         parent::start( 'forums', __( 'Discussion Forums', 'buddypress' ) );
     20        parent::start(
     21            'forums',
     22            __( 'Discussion Forums', 'buddypress' ),
     23            BP_PLUGIN_DIR
     24        );
    2125    }
    2226
     
    4145            define( 'BP_FORUMS_SLUG', $this->id );
    4246
    43         // Do some slug checks
    44         $this->slug      = BP_FORUMS_SLUG;
    45         $this->root_slug = isset( $bp->pages->forums->slug ) ? $bp->pages->forums->slug : $this->slug;
    46 
    4747        // The location of the bbPress stand-alone config file
    4848        if ( isset( $bp->site_options['bb-config-location'] ) )
    4949            $this->bbconfig = $bp->site_options['bb-config-location'];
    5050
    51         // The default text for the blogs directory search box
    52         $this->default_search_string = __( 'Search Forums...', 'buddypress' );
     51        // All globals for messaging component.
     52        // Note that global_tables is included in this array.
     53        $globals = array(
     54            'slug'                  => BP_FORUMS_SLUG,
     55            'root_slug'             => isset( $bp->pages->forums->slug ) ? $bp->pages->forums->slug : BP_FORUMS_SLUG,
     56            'notification_callback' => 'messages_format_notifications',
     57            'search_string'         => __( 'Search Forums...', 'buddypress' ),
     58        );
    5359
    54         // Register this in the active components array
    55         $bp->active_components[$this->id] = $this->id;
     60        parent::_setup_globals( $globals );
    5661    }
    5762
     
    6166    function _includes() {
    6267
    63         // Support for bbPress stand-alone
     68        // Files to include
     69        $includes = array(
     70            'actions',
     71            'screens',
     72            'classes',
     73            'filters',
     74            'template',
     75            'functions',
     76        );
     77
     78        // Admin area
     79        if ( is_admin() )
     80            $includes[] = 'admin';
     81
     82        // bbPress stand-alone
    6483        if ( !defined( 'BB_PATH' ) )
    65             require ( BP_PLUGIN_DIR . '/bp-forums/bp-forums-bbpress-sa.php' );
     84            $includes[] = 'bbpress-sa';
    6685
    67         // Admin
    68         if ( is_admin() )
    69             require ( BP_PLUGIN_DIR . '/bp-forums/bp-forums-admin.php'   );
    70 
    71         require ( BP_PLUGIN_DIR . '/bp-forums/bp-forums-actions.php'   );
    72         require ( BP_PLUGIN_DIR . '/bp-forums/bp-forums-screens.php'   );
    73         require ( BP_PLUGIN_DIR . '/bp-forums/bp-forums-filters.php'   );
    74         require ( BP_PLUGIN_DIR . '/bp-forums/bp-forums-template.php'  );
    75         require ( BP_PLUGIN_DIR . '/bp-forums/bp-forums-functions.php' );
     86        parent::_includes( $includes );
    7687    }
    7788
     
    8596
    8697        // Add 'Forums' to the main navigation
    87         bp_core_new_nav_item( array(
     98        $main_nav = array(
    8899            'name'                => __( 'Forums', 'buddypress' ),
    89100            'slug'                => $this->slug,
     
    91102            'screen_function'     => 'bp_forums_screen_topics',
    92103            'default_subnav_slug' => 'topics',
    93             'item_css_id'         => $this->id )
     104            'item_css_id'         => $this->id
    94105        );
    95106
     
    113124
    114125        // Additional menu if friends is active
    115         bp_core_new_subnav_item( array(
     126        $sub_nav[] = array(
    116127            'name'            => __( 'Topics Started', 'buddypress' ),
    117128            'slug'            => 'topics',
     
    121132            'position'        => 20,
    122133            'item_css_id'     => 'forums-friends'
    123         ) );
     134        );
    124135
    125136        // Additional menu if friends is active
    126         bp_core_new_subnav_item( array(
     137        $sub_nav[] = array(
    127138            'name'            => __( 'Replies', 'buddypress' ),
    128139            'slug'            => 'replies',
     
    132143            'position'        => 40,
    133144            'item_css_id'     => 'forums-friends'
    134         ) );
     145        );
    135146
    136147        // Favorite forums items
    137         bp_core_new_subnav_item( array(
     148        $sub_nav[] = array(
    138149            'name'            => __( 'Favorite Topics', 'buddypress' ),
    139150            'slug'            => 'favorites',
     
    143154            'position'        => 60,
    144155            'item_css_id'     => 'forums-favs'
    145         ) );
     156        );
     157
     158        parent::_setup_nav( $main_nav, $sub_nav );
     159    }
     160
     161    /**
     162     * Sets up the title for pages and <title>
     163     *
     164     * @global obj $bp
     165     */
     166    function _setup_title() {
     167        global $bp;
    146168
    147169        // Adjust title based on view
     
    157179            }
    158180        }
     181
     182        parent::_setup_title();
    159183    }
    160184}
Note: See TracChangeset for help on using the changeset viewer.