Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
09/07/2012 02:50:43 PM (13 years ago)
Author:
johnjamesjacoby
Message:

Settings:

  • General code clean-up.
  • php5ize the loader.
  • Remove closing php tags.
  • Limit creation of one-time-use variables.
  • Bail early instead of wrap in big if statements.
File:
1 edited

Legend:

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

    r6182 r6317  
    1818     * @since BuddyPress (1.5)
    1919     */
    20     function __construct() {
     20    public function __construct() {
    2121        parent::start(
    2222            'settings',
     
    3131     * @global BuddyPress $bp The one true BuddyPress instance
    3232     */
    33     function includes() {
    34         // Files to include
    35         $includes = array(
     33    public function includes() {
     34        parent::includes( array(
    3635            'actions',
    3736            'screens',
    3837            'template',
    3938            'functions',
    40         );
    41 
    42         parent::includes( $includes );
     39        ) );
    4340    }
    4441
     
    5148     * @since BuddyPress (1.5)
    5249     */
    53     function setup_globals() {
     50    public function setup_globals() {
    5451
    5552        // Define a slug, if necessary
     
    5855
    5956        // All globals for settings component.
    60         $globals = array(
     57        parent::setup_globals( array(
    6158            'slug'          => BP_SETTINGS_SLUG,
    6259            'has_directory' => false,
    63         );
    64 
    65         parent::setup_globals( $globals );
     60        ) );
    6661    }
    6762
     
    6964     * Setup BuddyBar navigation
    7065     */
    71     function setup_nav() {
     66    public function setup_nav() {
    7267
    7368        // Define local variable
     
    147142    /**
    148143     * Set up the Toolbar
    149      *
    150      * @global BuddyPress $bp The one true BuddyPress instance
    151      */
    152     function setup_admin_bar() {
    153         global $bp;
     144     */
     145    public function setup_admin_bar() {
     146
     147        // The instance
     148        $bp = buddypress();
    154149
    155150        // Prevent debug notices
     
    203198
    204199function bp_setup_settings() {
    205     global $bp;
    206     $bp->settings = new BP_Settings_Component();
     200    buddypress()->settings = new BP_Settings_Component();
    207201}
    208202add_action( 'bp_setup_components', 'bp_setup_settings', 6 );
    209 
    210 ?>
Note: See TracChangeset for help on using the changeset viewer.