Skip to:
Content

BuddyPress.org

Changeset 4211


Ignore:
Timestamp:
04/16/2011 04:47:36 PM (14 years ago)
Author:
djpaul
Message:

Add PHP5-style constructors to classes. Fixes #3148, props Backie

Location:
trunk
Files:
26 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity/bp-activity-classes.php

    r4044 r4211  
    1717
    1818    function bp_activity_activity( $id = false ) {
     19        $this->__construct( $id );
     20    }
     21
     22    function __construct( $id = false ) {
    1923        global $bp;
    2024
  • trunk/bp-activity/bp-activity-loader.php

    r4154 r4211  
    1818     */
    1919    function BP_Activity_Component() {
     20        $this->__construct();
     21    }
     22
     23    function __construct() {
    2024        parent::start(
    2125            'activity',
  • trunk/bp-blogs/bp-blogs-classes.php

    r3903 r4211  
    77
    88    function bp_blogs_blog( $id = null ) {
     9        $this->__construct( $id );
     10    }
     11
     12    function __construct( $id = null ) {
    913        global $bp, $wpdb;
    1014
  • trunk/bp-blogs/bp-blogs-loader.php

    r4154 r4211  
    1818     */
    1919    function BP_Blogs_Component() {
     20        $this->__construct();
     21    }
     22
     23    function __construct() {
    2024        parent::start(
    2125            'blogs',
  • trunk/bp-blogs/bp-blogs-template.php

    r4100 r4211  
    6767
    6868    function bp_blogs_template( $type, $page, $per_page, $max, $user_id, $search_terms ) {
     69        $this->__construct( $type, $page, $per_page, $max, $user_id, $search_terms );
     70    }
     71
     72    function __construct( $type, $page, $per_page, $max, $user_id, $search_terms ) {
    6973        global $bp;
    7074
  • trunk/bp-blogs/bp-blogs-widgets.php

    r4107 r4211  
    1515
    1616class BP_Blogs_Recent_Posts_Widget extends WP_Widget {
     17
    1718    function bp_blogs_recent_posts_widget() {
    18         parent::WP_Widget( false, $name = __( 'Recent Site Wide Posts', 'buddypress' ) );
     19        $this->__construct();
     20    }
     21
     22    function __construct() {
     23        parent::__construct( false, $name = __( 'Recent Site Wide Posts', 'buddypress' ) );
    1924    }
    2025
  • trunk/bp-core/admin/bp-core-update.php

    r4203 r4211  
    1111
    1212    function bp_core_setup_wizard() {
     13        $this->__construct();
     14    }
     15
     16    function __construct() {
    1317        // Look for current DB version
    1418        if ( !$this->database_version = get_site_option( 'bp-db-version' ) ) {
  • trunk/bp-core/bp-core-classes.php

    r3917 r4211  
    3232
    3333    function bp_core_user( $user_id, $populate_extras = false ) {
     34        $this->__construct( $user_id, $populate_extras );
     35    }
     36
     37        function __construct( $user_id, $populate_extras = false ) {
    3438        if ( $user_id ) {
    3539            $this->id = $user_id;
     
    447451
    448452    function bp_core_notification( $id = false ) {
     453        $this->__construct($id);
     454    }
     455       
     456    function __construct( $id = false ) {
    449457        if ( $id ) {
    450458            $this->id = $id;
     
    590598     */
    591599    function bp_button( $args = '' ) {
     600        $this->__construct($args);
     601    }
     602   
     603    function __construct( $args = '' ) {
    592604
    593605        // Default arguments
  • trunk/bp-core/bp-core-loader.php

    r4165 r4211  
    2727
    2828    function BP_Core() {
     29        $this->__construct();
     30    }
     31
     32    function __construct() {
    2933        parent::start(
    3034            '_core',
  • trunk/bp-core/bp-core-widgets.php

    r4088 r4211  
    1212
    1313class BP_Core_Members_Widget extends WP_Widget {
     14
    1415    function bp_core_members_widget() {
     16        $this->__construct();
     17    }
     18
     19    function __construct() {
    1520        $widget_ops = array( 'description' => __( 'A dynamic list of recently active, popular, and newest members', 'buddypress' ) );
    16         parent::WP_Widget( false, $name = __( 'Members', 'buddypress' ), $widget_ops );
     21        parent::__construct( false, $name = __( 'Members', 'buddypress' ), $widget_ops );
    1722
    1823        if ( is_active_widget( false, false, $this->id_base ) ) {
     
    135140
    136141class BP_Core_Whos_Online_Widget extends WP_Widget {
     142
    137143    function bp_core_whos_online_widget() {
     144        $this->__construct();
     145    }
     146
     147    function __construct() {
    138148        $widget_ops = array( 'description' => __( 'Avatars of users who are currently online', 'buddypress' ) );
    139         parent::WP_Widget( false, $name = __( "Who's Online Avatars", 'buddypress' ), $widget_ops );
     149        parent::__construct( false, $name = __( "Who's Online Avatars", 'buddypress' ), $widget_ops );
    140150    }
    141151
     
    199209
    200210class BP_Core_Recently_Active_Widget extends WP_Widget {
     211
    201212    function bp_core_recently_active_widget() {
     213        $this->__construct();
     214    }
     215
     216    function __construct() {
    202217        $widget_ops = array( 'description' => __( 'Avatars of recently active members', 'buddypress' ) );
    203         parent::WP_Widget( false, $name = __( 'Recently Active Member Avatars', 'buddypress' ), $widget_ops );
     218        parent::__construct( false, $name = __( 'Recently Active Member Avatars', 'buddypress' ), $widget_ops );
    204219    }
    205220
  • trunk/bp-forums/bp-forums-bbpress-sa.php

    r3880 r4211  
    138138
    139139    function BPDB( $dbuser, $dbpassword, $dbname, $dbhost ) {
    140         parent::WPDB( $dbuser, $dbpassword, $dbname, $dbhost );
     140        $this->__construct( $dbuser, $dbpassword, $dbname, $dbhost );
     141    }
     142
     143    function __construct( $dbuser, $dbpassword, $dbname, $dbhost ) {
     144        parent::__construct( $dbuser, $dbpassword, $dbname, $dbhost );
    141145
    142146        $args = func_get_args();
  • trunk/bp-forums/bp-forums-loader.php

    r4195 r4211  
    1818     */
    1919    function BP_Forums_Component() {
     20        $this->__construct();
     21    }
     22
     23    function __construct() {
    2024        parent::start(
    2125            'forums',
  • trunk/bp-forums/bp-forums-template.php

    r4149 r4211  
    7070
    7171    function BP_Forums_Template_Forum( $type, $forum_id, $user_id, $page, $per_page, $max, $no_stickies, $search_terms ) {
     72        $this->__construct( $type, $forum_id, $user_id, $page, $per_page, $max, $no_stickies, $search_terms );
     73    }
     74
     75    function __construct( $type, $forum_id, $user_id, $page, $per_page, $max, $no_stickies, $search_terms ) {   
    7276        global $bp;
    7377
     
    790794
    791795    function BP_Forums_Template_Topic( $topic_id, $per_page, $max, $order ) {
     796        $this->__construct( $topic_id, $per_page, $max, $order );
     797    }
     798       
     799    function __construct( $topic_id, $per_page, $max, $order ) {
    792800        global $bp, $current_user, $forum_template;
    793801
  • trunk/bp-friends/bp-friends-classes.php

    r3917 r4211  
    1515
    1616    function bp_friends_friendship( $id = null, $is_request = false, $populate_friend_details = true ) {
     17        $this->__construct( $id, $is_request, $populate_friend_details );
     18    }
     19
     20    function __construct( $id = null, $is_request = false, $populate_friend_details = true ) {
    1721        $this->is_request = $is_request;
    1822
  • trunk/bp-friends/bp-friends-loader.php

    r4183 r4211  
    1818     */
    1919    function BP_Friends_Component() {
     20        $this->__construct();
     21    }
     22
     23    function __construct() {
    2024        parent::start(
    2125            'friends',
  • trunk/bp-groups/bp-groups-classes.php

    r4168 r4211  
    1616
    1717    function bp_groups_group( $id = null ) {
     18        $this->__construct($id);
     19    }
     20
     21    function __construct( $id = null ) {
    1822        if ( $id ) {
    1923            $this->id = $id;
     
    605609
    606610    function bp_groups_member( $user_id = 0, $group_id = 0, $id = false, $populate = true ) {
     611        $this->__construct($user_id,$group_id,$id,$populate);
     612    }
     613   
     614    function __construct( $user_id = 0, $group_id = 0, $id = false, $populate = true ) {
    607615        if ( $user_id && $group_id && !$id ) {
    608616            $this->user_id = $user_id;
  • trunk/bp-groups/bp-groups-loader.php

    r4201 r4211  
    2121     */
    2222    function BP_Groups_Component() {
     23        $this->__construct();
     24    }
     25
     26    function __construct() {
    2327        parent::start(
    2428            'groups',
  • trunk/bp-groups/bp-groups-widgets.php

    r3961 r4211  
    1111class BP_Groups_Widget extends WP_Widget {
    1212    function bp_groups_widget() {
     13        $this->_construct();
     14    }
     15
     16    function __construct() {
    1317        $widget_ops = array( 'description' => __( 'A dynamic list of recently active, popular, and newest groups', 'buddypress' ) );
    14         parent::WP_Widget( false, __( 'Groups', 'buddypress' ), $widget_ops );
     18        parent::__construct( false, __( 'Groups', 'buddypress' ), $widget_ops );
    1519
    1620        if ( is_active_widget( false, false, $this->id_base ) ) {
  • trunk/bp-members/bp-members-loader.php

    r4151 r4211  
    1818     */
    1919    function BP_Members_Component() {
     20        $this->__construct();
     21    }
     22
     23    function __construct() {
    2024        parent::start(
    2125            'members',
  • trunk/bp-members/bp-members-template.php

    r4137 r4211  
    141141
    142142    function bp_core_members_template( $type, $page_number, $per_page, $max, $user_id, $search_terms, $include, $populate_extras, $exclude ) {
     143        $this->__construct( $type, $page_number, $per_page, $max, $user_id, $search_terms, $include, $populate_extras, $exclude );
     144    }
     145
     146    function __construct( $type, $page_number, $per_page, $max, $user_id, $search_terms, $include, $populate_extras, $exclude ) {
    143147        global $bp;
    144148
  • trunk/bp-messages/bp-messages-classes.php

    r3903 r4211  
    1010
    1111    function bp_messages_thread ( $thread_id = false, $order = 'ASC' ) {
     12        $this->__construct( $thread_id, $order);
     13    }
     14
     15    function __construct( $thread_id = false, $order = 'ASC' ) {
    1216        if ( $thread_id )
    1317            $this->populate( $thread_id, $order );
     
    246250
    247251    function bp_messages_message( $id = null ) {
     252        $this->__construct( $id );
     253    }
     254   
     255    function __construct( $id = null ) {
    248256        global $bp;
    249257
     
    363371
    364372    function bp_messages_notice( $id = null ) {
     373        $this->__construct($id);
     374    }
     375   
     376    function __construct( $id = null ) {
    365377        if ( $id ) {
    366378            $this->id = $id;
  • trunk/bp-messages/bp-messages-loader.php

    r4183 r4211  
    1818     */
    1919    function BP_Messages_Component() {
     20        $this->__construct();
     21    }
     22
     23    function __construct() {
    2024        parent::start(
    2125            'messages',
  • trunk/bp-messages/bp-messages-template.php

    r3966 r4211  
    2121
    2222    function bp_messages_box_template( $user_id, $box, $per_page, $max, $type ) {
     23        $this->__construct( $user_id, $box, $per_page, $max, $type );
     24    }
     25
     26    function __construct( $user_id, $box, $per_page, $max, $type ) {
    2327        $this->pag_page = isset( $_GET['mpage'] ) ? intval( $_GET['mpage'] ) : 1;
    2428        $this->pag_num  = isset( $_GET['num'] ) ? intval( $_GET['num'] ) : $per_page;
     
    612616
    613617    function bp_messages_thread_template( $thread_id, $order ) {
     618        $this->__construct( $thread_id, $order );
     619    }
     620
     621    function __construct( $thread_id, $order ) {
    614622        global $bp;
    615623
  • trunk/bp-settings/bp-settings-loader.php

    r4183 r4211  
    99     */
    1010    function BP_Settings_Component() {
     11        $this->__construct();
     12    }
     13
     14    function __construct() {
    1115        parent::start(
    1216            'settings',
  • trunk/bp-xprofile/bp-xprofile-loader.php

    r4154 r4211  
    1919     */
    2020    function BP_XProfile_Component() {
     21        $this->__construct();
     22    }
     23
     24    function __construct() {
    2125        parent::start(
    2226            'xprofile',
  • trunk/bp-xprofile/bp-xprofile-template.php

    r4083 r4211  
    1919
    2020    function bp_xprofile_data_template( $user_id, $profile_group_id, $hide_empty_groups = false, $fetch_fields = false, $fetch_field_data = false, $exclude_groups = false, $exclude_fields = false ) {
     21        $this->__construct( $user_id, $profile_group_id, $hide_empty_groups, $fetch_fields, $fetch_field_data, $exclude_groups, $exclude_fields );
     22    }
     23
     24    function __construct( $user_id, $profile_group_id, $hide_empty_groups = false, $fetch_fields = false, $fetch_field_data = false, $exclude_groups = false, $exclude_fields = false ) {
    2125        $this->groups = BP_XProfile_Group::get( array(
    2226            'profile_group_id'  => $profile_group_id,
Note: See TracChangeset for help on using the changeset viewer.