Changeset 9828
- Timestamp:
- 05/02/2015 01:01:03 AM (9 years ago)
- Location:
- trunk/src
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-activity/bp-activity-template.php
r9824 r9828 1607 1607 switch ( $activities_template->activity->component ) { 1608 1608 case 'groups' : 1609 if ( bp_disable_group_avatar_uploads() ) { 1610 return false; 1611 } 1612 1609 1613 $object = 'group'; 1610 1614 $item_id = $activities_template->activity->item_id; -
trunk/src/bp-core/admin/bp-core-admin-settings.php
r9819 r9828 180 180 <p class="description"><?php _e( 'Administrators can always create groups, regardless of this setting.', 'buddypress' ); ?></p> 181 181 182 <?php 183 } 184 185 /** 186 * 'Enable group avatars' field markup. 187 * 188 * @since BuddyPress (2.3.0) 189 */ 190 function bp_admin_setting_callback_group_avatar_uploads() { 191 ?> 192 <input id="bp-disable-group-avatar-uploads" name="bp-disable-group-avatar-uploads" type="checkbox" value="1" <?php checked( ! bp_disable_group_avatar_uploads() ); ?> /> 193 <label for="bp-disable-group-avatar-uploads"><?php _e( 'Allow customizable avatars for groups', 'buddypress' ); ?></label> 182 194 <?php 183 195 } … … 281 293 } 282 294 283 // Some legacy options are not registered with the Settings API 295 // Some legacy options are not registered with the Settings API, or are reversed in the UI. 284 296 $legacy_options = array( 285 297 'bp-disable-account-deletion', 286 298 'bp-disable-avatar-uploads', 299 'bp-disable-group-avatar-uploads', 287 300 'bp_disable_blogforum_comments', 288 301 'bp-disable-profile-sync', -
trunk/src/bp-core/bp-core-admin.php
r9819 r9828 338 338 add_settings_section( 'bp_xprofile', _x( 'Profile Settings', 'BuddyPress setting tab', 'buddypress' ), 'bp_admin_setting_callback_xprofile_section', 'buddypress' ); 339 339 340 $avatar_setting = 'bp_xprofile'; 340 add_settings_field( 'bp-disable-avatar-uploads', __( 'Profile Photo Uploads', 'buddypress' ), 'bp_admin_setting_callback_avatar_uploads', 'buddypress', 'bp_xprofile' ); 341 register_setting( 'buddypress', 'bp-disable-avatar-uploads', 'intval' ); 341 342 342 343 // Profile sync setting … … 352 353 add_settings_section( 'bp_groups', __( 'Groups Settings', 'buddypress' ), 'bp_admin_setting_callback_groups_section', 'buddypress' ); 353 354 354 if ( empty( $avatar_setting ) ) {355 $avatar_setting = 'bp_groups';356 }357 358 355 // Allow subscriptions setting 359 356 add_settings_field( 'bp_restrict_group_creation', __( 'Group Creation', 'buddypress' ), 'bp_admin_setting_callback_group_creation', 'buddypress', 'bp_groups' ); 360 357 register_setting ( 'buddypress', 'bp_restrict_group_creation', 'intval' ); 358 359 // Allow group avatars. 360 add_settings_field( 'bp-disable-group-avatar-uploads', __( 'Group Photo Uploads', 'buddypress' ), 'bp_admin_setting_callback_group_avatar_uploads', 'buddypress', 'bp_groups' ); 361 register_setting( 'buddypress', 'bp-disable-group-avatar-uploads', 'intval' ); 361 362 } 362 363 … … 393 394 register_setting ( 'buddypress', '_bp_enable_akismet', 'intval' ); 394 395 } 395 }396 397 /** Avatar upload for users or groups ************************************/398 399 if ( ! empty( $avatar_setting ) ) {400 // Allow avatar uploads401 add_settings_field( 'bp-disable-avatar-uploads', __( 'Profile Photo Uploads', 'buddypress' ), 'bp_admin_setting_callback_avatar_uploads', 'buddypress', $avatar_setting );402 register_setting ( 'buddypress', 'bp-disable-avatar-uploads', 'intval' );403 396 } 404 397 } -
trunk/src/bp-core/bp-core-avatars.php
r9827 r9828 1814 1814 // Group creation 1815 1815 if ( bp_is_group_create() && bp_is_group_creation_step( 'group-avatar' ) && 'crop-image' !== bp_get_avatar_admin_step() ) { 1816 $retval = ! bp_ core_get_root_option( 'bp-disable-avatar-uploads');1816 $retval = ! bp_disable_group_avatar_uploads(); 1817 1817 1818 1818 // Group Manage 1819 1819 } elseif ( bp_is_group_admin_page() && bp_is_group_admin_screen( 'group-avatar' ) && 'crop-image' !== bp_get_avatar_admin_step() ) { 1820 $retval = ! bp_ core_get_root_option( 'bp-disable-avatar-uploads');1820 $retval = ! bp_disable_group_avatar_uploads(); 1821 1821 } 1822 1822 } -
trunk/src/bp-core/bp-core-options.php
r9819 r9828 55 55 // Avatar uploads 56 56 'bp-disable-avatar-uploads' => false, 57 58 // Group Profile Photos 59 'bp-disable-group-avatar-uploads' => false, 57 60 58 61 // Allow users to delete their own accounts … … 582 585 583 586 /** 587 * Are group avatars disabled? 588 * 589 * For backward compatibility, this option falls back on the value of 'bp-disable-avatar-uploads' when no value is 590 * found in the database. 591 * 592 * @since BuddyPress (2.3.0) 593 * 594 * @param bool $default Optional. Fallback value if not found in the database. 595 * Defaults to the value of `bp_disable_avatar_uploads()`. 596 * @return bool True if group avatar uploads are disabled, otherwise false. 597 */ 598 function bp_disable_group_avatar_uploads( $default = null ) { 599 $disabled = bp_get_option( 'bp-disable-group-avatar-uploads', '' ); 600 601 if ( '' === $disabled ) { 602 if ( is_null( $default ) ) { 603 $disabled = bp_disable_avatar_uploads(); 604 } else { 605 $disabled = $default; 606 } 607 } 608 609 /** 610 * Filters whether or not members are able to upload group avatars. 611 * 612 * @since BuddyPress (2.3.0) 613 * 614 * @param bool $disabled Whether or not members are able to upload their groups avatars. 615 * @param bool $default Default value passed to the function. 616 */ 617 return (bool) apply_filters( 'bp_disable_group_avatar_uploads', $disabled, $default ); 618 } 619 620 /** 584 621 * Are members able to delete their own accounts? 585 622 * -
trunk/src/bp-groups/bp-groups-loader.php
r9819 r9828 299 299 300 300 // If avatar uploads are not disabled, add avatar option 301 $disabled_avatar_uploads = (int) bp_ core_get_root_option( 'bp-disable-avatar-uploads');301 $disabled_avatar_uploads = (int) bp_disable_group_avatar_uploads(); 302 302 if ( ! $disabled_avatar_uploads && $bp->avatar->show_avatars ) { 303 303 $this->group_creation_steps['group-avatar'] = array( … … 575 575 ), $default_params ); 576 576 577 if ( ! (int) bp_get_option( 'bp-disable-avatar-uploads') && buddypress()->avatar->show_avatars ) {577 if ( ! bp_disable_group_avatar_uploads() && buddypress()->avatar->show_avatars ) { 578 578 $sub_nav[] = array_merge( array( 579 579 'name' => __( 'Photo', 'buddypress' ), -
trunk/src/bp-groups/bp-groups-screens.php
r9819 r9828 907 907 908 908 // If the logged-in user doesn't have permission or if avatar uploads are disabled, then stop here 909 if ( ! bp_is_item_admin() || (int) bp_get_option( 'bp-disable-avatar-uploads') || ! buddypress()->avatar->show_avatars )909 if ( ! bp_is_item_admin() || bp_disable_group_avatar_uploads() || ! buddypress()->avatar->show_avatars ) 910 910 return false; 911 911 -
trunk/src/bp-groups/bp-groups-template.php
r9819 r9828 710 710 } 711 711 712 // Whether a group avatar will appear. 713 if ( bp_disable_group_avatar_uploads() || ! buddypress()->avatar->show_avatars ) { 714 $classes[] = 'group-no-avatar'; 715 } else { 716 $classes[] = 'group-has-avatar'; 717 } 718 712 719 /** 713 720 * Filters classes that will be applied to row class of the current group in the loop. … … 859 866 global $groups_template; 860 867 861 // Bail if avatars are turned off 862 // @todo Should we maybe still filter this? 863 if ( ! buddypress()->avatar->show_avatars ) { 868 // Bail if avatars are turned off. 869 if ( bp_disable_group_avatar_uploads() || ! buddypress()->avatar->show_avatars ) { 864 870 return false; 865 871 } -
trunk/src/bp-templates/bp-legacy/buddypress/groups/groups-loop.php
r9819 r9828 53 53 54 54 <li <?php bp_group_class(); ?>> 55 <div class="item-avatar"> 56 <a href="<?php bp_group_permalink(); ?>"><?php bp_group_avatar( 'type=thumb&width=50&height=50' ); ?></a> 57 </div> 55 <?php if ( ! bp_disable_group_avatar_uploads() ) : ?> 56 <div class="item-avatar"> 57 <a href="<?php bp_group_permalink(); ?>"><?php bp_group_avatar( 'type=thumb&width=50&height=50' ); ?></a> 58 </div> 59 <?php endif; ?> 58 60 59 61 <div class="item"> -
trunk/src/bp-templates/bp-legacy/buddypress/groups/single/group-header.php
r9819 r9828 51 51 </div><!-- #item-actions --> 52 52 53 <div id="item-header-avatar"> 54 <a href="<?php bp_group_permalink(); ?>" title="<?php bp_group_name(); ?>"> 53 <?php if ( ! bp_disable_group_avatar_uploads() ) : ?> 54 <div id="item-header-avatar"> 55 <a href="<?php bp_group_permalink(); ?>" title="<?php bp_group_name(); ?>"> 55 56 56 <?php bp_group_avatar(); ?>57 <?php bp_group_avatar(); ?> 57 58 58 </a> 59 </div><!-- #item-header-avatar --> 59 </a> 60 </div><!-- #item-header-avatar --> 61 <?php endif; ?> 60 62 61 63 <div id="item-header-content"> -
trunk/src/bp-templates/bp-legacy/buddypress/members/single/groups/invites.php
r9819 r9828 15 15 16 16 <li> 17 <div class="item-avatar"> 18 <a href="<?php bp_group_permalink(); ?>"><?php bp_group_avatar( 'type=thumb&width=50&height=50' ); ?></a> 19 </div> 17 <?php if ( ! bp_disable_group_avatar_uploads() ) : ?> 18 <div class="item-avatar"> 19 <a href="<?php bp_group_permalink(); ?>"><?php bp_group_avatar( 'type=thumb&width=50&height=50' ); ?></a> 20 </div> 21 <?php endif; ?> 20 22 21 23 <h4><a href="<?php bp_group_permalink(); ?>"><?php bp_group_name(); ?></a><span class="small"> - <?php printf( _nx( '%d member', '%d members', bp_get_group_total_members( false ),'Group member count', 'buddypress' ), bp_get_group_total_members( false ) ); ?></span></h4> -
trunk/src/bp-templates/bp-legacy/css/buddypress.css
r9819 r9828 1282 1282 width: 50%; 1283 1283 } 1284 #buddypress ul.item-list li.group-no-avatar div.item-desc { 1285 margin-left: 0; 1286 } 1284 1287 #buddypress ul.item-list li div.action { 1285 1288 position: absolute;
Note: See TracChangeset
for help on using the changeset viewer.