Plugin Directory

Changeset 876405


Ignore:
Timestamp:
03/17/2014 02:45:34 AM (12 years ago)
Author:
ddean
Message:

Merge changes from Github

Location:
bp-group-hierarchy/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • bp-group-hierarchy/trunk/bp-group-hierarchy-classes.php

    r830940 r876405  
    1919
    2020    var $vars = null;
    21    
    22     function bp_groups_hierarchy( $id, $parent_id = 0 ) {
    23         return $this->__construct( $id, $parent_id );
    24     }
    25 
    26     function __construct( $id, $parent_id = 0 ) {
     21
     22    function __construct( $id, $parent_id = 0, $args = array() ) {
    2723       
    2824        global $bp, $wpdb;
     
    3834        }
    3935       
     36        $this->args = wp_parse_args( $args, array(
     37            'populate_extras' => false,
     38        ) );
     39
    4040        if( ! is_numeric( $id ) ) {
    4141            $id = $this->group_exists( $id, $parent_id );
     
    147147    }
    148148   
    149     function get_total_subgroup_count( $group_id = null ) {
     149    public static function get_total_subgroup_count( $group_id = null ) {
    150150        global $wpdb, $bp;
    151151
     
    247247     * Get the full path for a group
    248248     */
    249     function get_path( $group_id ) {
     249    public static function get_path( $group_id ) {
    250250        $group = new BP_Groups_Hierarchy( $group_id );
    251251        if($group) {
     
    340340     * Declared static since BP 1.9
    341341     */
    342     public static function get_group_extras( $paged_groups, $group_ids, $type = false ) {
     342    public static function get_group_extras( &$paged_groups, &$group_ids, $type = false ) {
    343343
    344344        foreach($paged_groups as $key => $group) {
  • bp-group-hierarchy/trunk/bp-group-hierarchy-filters.php

    r817011 r876405  
    110110    foreach($groups_hierarchy_template->groups as $key => $group) {
    111111        if(isset($group->id)) {
    112             $groups_hierarchy_template->groups[$key] = new BP_Groups_Hierarchy($group->id);
     112            $groups_hierarchy_template->groups[$key] = new BP_Groups_Hierarchy($group->id, 0, array( 'populate_extras' => true ) );
    113113        }
    114114    }
  • bp-group-hierarchy/trunk/bp-group-hierarchy-loader.php

    r721886 r876405  
    1818     * In BP 1.6, call it since we've suppressed the parent invocation
    1919     */
    20     function includes() {
     20    function includes( $includes = array() ) {
    2121       
    2222        if( floatval( bp_get_version() ) >= 1.6 ) {
     
    4545     * A hierarchy-aware copy of the setup_globals function from BP_Groups_Component
    4646     */
    47     function setup_globals() {
     47    function setup_globals( $args = array() ) {
    4848        global $bp;
    4949
     
    5757            'table_name_members'   => $bp->table_prefix . 'bp_groups_members',
    5858            'table_name_groupmeta' => $bp->table_prefix . 'bp_groups_groupmeta'
     59        );
     60
     61        // Metadata tables for groups component
     62        $meta_tables = array(
     63            'group' => $bp->table_prefix . 'bp_groups_groupmeta',
    5964        );
    6065
     
    6873            'notification_callback' => 'groups_format_notifications',
    6974            'search_string'         => __( 'Search Groups...', 'buddypress' ),
    70             'global_tables'         => $global_tables
     75            'global_tables'         => $global_tables,
     76            'meta_tables'           => $meta_tables,
    7177        );
    7278       
     
    8086            $bp->is_single_item  = true;
    8187            $current_group_class = apply_filters( 'bp_groups_current_group_class', 'BP_Groups_Hierarchy' );
    82             $this->current_group = apply_filters( 'bp_groups_current_group_object', new $current_group_class( $group_id ) );
     88
     89            if ( 'BP_Groups_Hierarchy' == $current_group_class ) {
     90                $this->current_group = new BP_Groups_Hierarchy( $group_id, 0, array( 'populate_extras' => true ) );
     91            } else {
     92                $this->current_group = apply_filters( 'bp_groups_current_group_object', new $current_group_class( $group_id ) );
     93            }
    8394
    8495            // When in a single group, the first action is bumped down one because of the
  • bp-group-hierarchy/trunk/bp-group-hierarchy-template.php

    r830940 r876405  
    109109
    110110        if ( $this->single_group )
    111             $this->group = new BP_Groups_Hierarchy( $this->group->group_id );
     111            $this->group = groups_get_current_group();
    112112        else {
    113113            if ( $this->group )
  • bp-group-hierarchy/trunk/extension.php

    r772757 r876405  
    132132    }
    133133   
    134     function create_screen() {
     134    function create_screen( $group_id = null ) {
    135135       
    136136        global $bp;
     
    195195    }
    196196   
    197     function create_screen_save() {
     197    function create_screen_save( $group_id = null ) {
    198198        global $bp;
    199199       
     
    224224    }
    225225   
    226     function edit_screen() {
     226    function edit_screen( $group_id = null ) {
    227227
    228228        global $bp;
     
    306306    }
    307307   
    308     function edit_screen_save() {
     308    function edit_screen_save( $group_id = null ) {
    309309        global $bp;
    310310       
  • bp-group-hierarchy/trunk/readme.txt

    r830940 r876405  
    6060
    6161== Changelog ==
     62
     63= 1.4.3 =
     64* Added: preliminary support for BP 2.0 - contributed by r-a-y
     65* Fixed: strict standards warnings - contributed by r-a-y
    6266
    6367= 1.4.2 =
Note: See TracChangeset for help on using the changeset viewer.