Skip to:
Content

BuddyPress.org

Changeset 5052


Ignore:
Timestamp:
08/29/2011 11:07:41 PM (9 years ago)
Author:
boonebgorges
Message:

Respect 'disable avatar upload' option within the Groups component. Fixes #3520. Props r-a-y

Location:
trunk/bp-groups
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-groups/bp-groups-adminbar.php

    r4961 r5052  
    6868
    6969    // Group Admin > Group avatar
    70     $wp_admin_bar->add_menu( array(
    71         'parent' => $bp->group_admin_menu_id,
    72         'id'     => 'group-avatar',
    73         'title'  => __( 'Edit Avatar', 'buddypress' ),
    74         'href'   =>  bp_get_groups_action_link( 'admin/group-avatar' )
    75     ) );
     70    if ( !(int)bp_get_option( 'bp-disable-avatar-uploads' ) ) {
     71        $wp_admin_bar->add_menu( array(
     72            'parent' => $bp->group_admin_menu_id,
     73            'id'     => 'group-avatar',
     74            'title'  => __( 'Edit Avatar', 'buddypress' ),
     75            'href'   =>  bp_get_groups_action_link( 'admin/group-avatar' )
     76        ) );
     77    }
    7678
    7779    // Group Admin > Manage invitations
  • trunk/bp-groups/bp-groups-buddybar.php

    r4961 r5052  
    2121            <li><a href="<?php bp_groups_action_link( 'admin/group-settings' );  ?>"><?php _e( 'Group Settings', 'buddypress' ); ?></a></li>
    2222
    23             <li><a href="<?php bp_groups_action_link( 'admin/group-avatar' ); ?>"><?php _e( 'Group Avatar', 'buddypress' ); ?></a></li>
     23            <?php if ( !(int)bp_get_option( 'bp-disable-avatar-uploads' ) ) : ?>
     24
     25                <li><a href="<?php bp_groups_action_link( 'admin/group-avatar' ); ?>"><?php _e( 'Group Avatar', 'buddypress' ); ?></a></li>
     26
     27            <?php endif; ?>
    2428
    2529            <?php if ( bp_is_active( 'friends' ) ) : ?>
  • trunk/bp-groups/bp-groups-loader.php

    r4961 r5052  
    189189                'name'       => __( 'Settings', 'buddypress' ),
    190190                'position'   => 10
    191             ),
    192             'group-avatar'   => array(
    193                 'name'       => __( 'Avatar',   'buddypress' ),
    194                 'position'   => 20 ),
     191            )
    195192        ) );
     193
     194        // If avatar uploads are not disabled, add avatar option
     195        if ( !(int)bp_get_option( 'bp-disable-avatar-uploads' ) ) {
     196            $this->group_creation_steps['group-avatar'] = array(
     197                'name'     => __( 'Avatar',   'buddypress' ),
     198                'position' => 20
     199            );
     200        }
    196201
    197202        // If friends component is active, add invitations
  • trunk/bp-groups/bp-groups-screens.php

    r4961 r5052  
    545545    if ( bp_is_groups_component() && bp_is_action_variable( 'group-avatar', 0 ) ) {
    546546
    547         if ( !$bp->is_item_admin )
     547        // If the logged-in user doesn't have permission or if avatar uploads are disabled, then stop here
     548        if ( !$bp->is_item_admin || (int)bp_get_option( 'bp-disable-avatar-uploads' ) )
    548549            return false;
    549550
  • trunk/bp-groups/bp-groups-template.php

    r5030 r5052  
    12781278    ?>
    12791279    <li<?php if ( 'group-settings' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug ?>/admin/group-settings"><?php _e( 'Settings', 'buddypress' ); ?></a></li>
    1280     <li<?php if ( 'group-avatar'   == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug ?>/admin/group-avatar"><?php _e( 'Avatar', 'buddypress' ); ?></a></li>
     1280
     1281    <?php if ( !(int)bp_get_option( 'bp-disable-avatar-uploads' ) ) : ?>
     1282        <li<?php if ( 'group-avatar'   == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug ?>/admin/group-avatar"><?php _e( 'Avatar', 'buddypress' ); ?></a></li>
     1283    <?php endif; ?>
     1284
    12811285    <li<?php if ( 'manage-members' == $current_tab ) : ?> class="current"<?php endif; ?>><a href="<?php echo bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/' . $group->slug ?>/admin/manage-members"><?php _e( 'Members', 'buddypress' ); ?></a></li>
    12821286
Note: See TracChangeset for help on using the changeset viewer.