<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[BuddyPress][9828] trunk/src: Allow group avatars to be disabled.</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="http://buddypress.trac.wordpress.org/changeset/9828">9828</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"http://buddypress.trac.wordpress.org/changeset/9828","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>boonebgorges</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2015-05-02 01:01:03 +0000 (Sat, 02 May 2015)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>Allow group avatars to be disabled.
Props xgz, boonebgorges, imath, hnla.
Fixes <a href="http://buddypress.trac.wordpress.org/ticket/4677">#4677</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcbpactivitybpactivitytemplatephp">trunk/src/bp-activity/bp-activity-template.php</a></li>
<li><a href="#trunksrcbpcoreadminbpcoreadminsettingsphp">trunk/src/bp-core/admin/bp-core-admin-settings.php</a></li>
<li><a href="#trunksrcbpcorebpcoreadminphp">trunk/src/bp-core/bp-core-admin.php</a></li>
<li><a href="#trunksrcbpcorebpcoreavatarsphp">trunk/src/bp-core/bp-core-avatars.php</a></li>
<li><a href="#trunksrcbpcorebpcoreoptionsphp">trunk/src/bp-core/bp-core-options.php</a></li>
<li><a href="#trunksrcbpgroupsbpgroupsloaderphp">trunk/src/bp-groups/bp-groups-loader.php</a></li>
<li><a href="#trunksrcbpgroupsbpgroupsscreensphp">trunk/src/bp-groups/bp-groups-screens.php</a></li>
<li><a href="#trunksrcbpgroupsbpgroupstemplatephp">trunk/src/bp-groups/bp-groups-template.php</a></li>
<li><a href="#trunksrcbptemplatesbplegacybuddypressgroupsgroupsloopphp">trunk/src/bp-templates/bp-legacy/buddypress/groups/groups-loop.php</a></li>
<li><a href="#trunksrcbptemplatesbplegacybuddypressgroupssinglegroupheaderphp">trunk/src/bp-templates/bp-legacy/buddypress/groups/single/group-header.php</a></li>
<li><a href="#trunksrcbptemplatesbplegacybuddypressmemberssinglegroupsinvitesphp">trunk/src/bp-templates/bp-legacy/buddypress/members/single/groups/invites.php</a></li>
<li><a href="#trunksrcbptemplatesbplegacycssbuddypresscss">trunk/src/bp-templates/bp-legacy/css/buddypress.css</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcbpactivitybpactivitytemplatephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-activity/bp-activity-template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-activity/bp-activity-template.php 2015-04-30 20:21:26 UTC (rev 9827)
+++ trunk/src/bp-activity/bp-activity-template.php 2015-05-02 01:01:03 UTC (rev 9828)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1606,6 +1606,10 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Set item_id and object (default to user)
</span><span class="cx" style="display: block; padding: 0 10px"> switch ( $activities_template->activity->component ) {
</span><span class="cx" style="display: block; padding: 0 10px"> case 'groups' :
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( bp_disable_group_avatar_uploads() ) {
+ return false;
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> $object = 'group';
</span><span class="cx" style="display: block; padding: 0 10px"> $item_id = $activities_template->activity->item_id;
</span><span class="cx" style="display: block; padding: 0 10px"> $link = '';
</span></span></pre></div>
<a id="trunksrcbpcoreadminbpcoreadminsettingsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-core/admin/bp-core-admin-settings.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-core/admin/bp-core-admin-settings.php 2015-04-30 20:21:26 UTC (rev 9827)
+++ trunk/src/bp-core/admin/bp-core-admin-settings.php 2015-05-02 01:01:03 UTC (rev 9828)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -182,6 +182,18 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+/**
+ * 'Enable group avatars' field markup.
+ *
+ * @since BuddyPress (2.3.0)
+ */
+function bp_admin_setting_callback_group_avatar_uploads() {
+?>
+ <input id="bp-disable-group-avatar-uploads" name="bp-disable-group-avatar-uploads" type="checkbox" value="1" <?php checked( ! bp_disable_group_avatar_uploads() ); ?> />
+ <label for="bp-disable-group-avatar-uploads"><?php _e( 'Allow customizable avatars for groups', 'buddypress' ); ?></label>
+<?php
+}
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /** Forums Section ************************************************************/
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -280,10 +292,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Some legacy options are not registered with the Settings API
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Some legacy options are not registered with the Settings API, or are reversed in the UI.
</ins><span class="cx" style="display: block; padding: 0 10px"> $legacy_options = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'bp-disable-account-deletion',
</span><span class="cx" style="display: block; padding: 0 10px"> 'bp-disable-avatar-uploads',
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'bp-disable-group-avatar-uploads',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'bp_disable_blogforum_comments',
</span><span class="cx" style="display: block; padding: 0 10px"> 'bp-disable-profile-sync',
</span><span class="cx" style="display: block; padding: 0 10px"> 'bp_restrict_group_creation',
</span></span></pre></div>
<a id="trunksrcbpcorebpcoreadminphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-core/bp-core-admin.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-core/bp-core-admin.php 2015-04-30 20:21:26 UTC (rev 9827)
+++ trunk/src/bp-core/bp-core-admin.php 2015-05-02 01:01:03 UTC (rev 9828)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -337,7 +337,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Add the main section
</span><span class="cx" style="display: block; padding: 0 10px"> add_settings_section( 'bp_xprofile', _x( 'Profile Settings', 'BuddyPress setting tab', 'buddypress' ), 'bp_admin_setting_callback_xprofile_section', 'buddypress' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $avatar_setting = 'bp_xprofile';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ add_settings_field( 'bp-disable-avatar-uploads', __( 'Profile Photo Uploads', 'buddypress' ), 'bp_admin_setting_callback_avatar_uploads', 'buddypress', 'bp_xprofile' );
+ register_setting( 'buddypress', 'bp-disable-avatar-uploads', 'intval' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Profile sync setting
</span><span class="cx" style="display: block; padding: 0 10px"> add_settings_field( 'bp-disable-profile-sync', __( 'Profile Syncing', 'buddypress' ), 'bp_admin_setting_callback_profile_sync', 'buddypress', 'bp_xprofile' );
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -351,13 +352,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Add the main section
</span><span class="cx" style="display: block; padding: 0 10px"> add_settings_section( 'bp_groups', __( 'Groups Settings', 'buddypress' ), 'bp_admin_setting_callback_groups_section', 'buddypress' );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( empty( $avatar_setting ) ) {
- $avatar_setting = 'bp_groups';
- }
-
</del><span class="cx" style="display: block; padding: 0 10px"> // Allow subscriptions setting
</span><span class="cx" style="display: block; padding: 0 10px"> add_settings_field( 'bp_restrict_group_creation', __( 'Group Creation', 'buddypress' ), 'bp_admin_setting_callback_group_creation', 'buddypress', 'bp_groups' );
</span><span class="cx" style="display: block; padding: 0 10px"> register_setting ( 'buddypress', 'bp_restrict_group_creation', 'intval' );
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+
+ // Allow group avatars.
+ add_settings_field( 'bp-disable-group-avatar-uploads', __( 'Group Photo Uploads', 'buddypress' ), 'bp_admin_setting_callback_group_avatar_uploads', 'buddypress', 'bp_groups' );
+ register_setting( 'buddypress', 'bp-disable-group-avatar-uploads', 'intval' );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /** Forums ************************************************************/
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -393,14 +394,6 @@
</span><span class="cx" style="display: block; padding: 0 10px"> register_setting ( 'buddypress', '_bp_enable_akismet', 'intval' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-
- /** Avatar upload for users or groups ************************************/
-
- if ( ! empty( $avatar_setting ) ) {
- // Allow avatar uploads
- add_settings_field( 'bp-disable-avatar-uploads', __( 'Profile Photo Uploads', 'buddypress' ), 'bp_admin_setting_callback_avatar_uploads', 'buddypress', $avatar_setting );
- register_setting ( 'buddypress', 'bp-disable-avatar-uploads', 'intval' );
- }
</del><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunksrcbpcorebpcoreavatarsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-core/bp-core-avatars.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-core/bp-core-avatars.php 2015-04-30 20:21:26 UTC (rev 9827)
+++ trunk/src/bp-core/bp-core-avatars.php 2015-05-02 01:01:03 UTC (rev 9828)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1813,11 +1813,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> if ( bp_is_active( 'groups' ) ) {
</span><span class="cx" style="display: block; padding: 0 10px"> // Group creation
</span><span class="cx" style="display: block; padding: 0 10px"> if ( bp_is_group_create() && bp_is_group_creation_step( 'group-avatar' ) && 'crop-image' !== bp_get_avatar_admin_step() ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $retval = ! bp_core_get_root_option( 'bp-disable-avatar-uploads' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $retval = ! bp_disable_group_avatar_uploads();
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Group Manage
</span><span class="cx" style="display: block; padding: 0 10px"> } elseif ( bp_is_group_admin_page() && bp_is_group_admin_screen( 'group-avatar' ) && 'crop-image' !== bp_get_avatar_admin_step() ) {
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $retval = ! bp_core_get_root_option( 'bp-disable-avatar-uploads' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $retval = ! bp_disable_group_avatar_uploads();
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcbpcorebpcoreoptionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-core/bp-core-options.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-core/bp-core-options.php 2015-04-30 20:21:26 UTC (rev 9827)
+++ trunk/src/bp-core/bp-core-options.php 2015-05-02 01:01:03 UTC (rev 9828)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -55,6 +55,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> // Avatar uploads
</span><span class="cx" style="display: block; padding: 0 10px"> 'bp-disable-avatar-uploads' => false,
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Group Profile Photos
+ 'bp-disable-group-avatar-uploads' => false,
+
</ins><span class="cx" style="display: block; padding: 0 10px"> // Allow users to delete their own accounts
</span><span class="cx" style="display: block; padding: 0 10px"> 'bp-disable-account-deletion' => false,
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -581,6 +584,40 @@
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * Are group avatars disabled?
+ *
+ * For backward compatibility, this option falls back on the value of 'bp-disable-avatar-uploads' when no value is
+ * found in the database.
+ *
+ * @since BuddyPress (2.3.0)
+ *
+ * @param bool $default Optional. Fallback value if not found in the database.
+ * Defaults to the value of `bp_disable_avatar_uploads()`.
+ * @return bool True if group avatar uploads are disabled, otherwise false.
+ */
+function bp_disable_group_avatar_uploads( $default = null ) {
+ $disabled = bp_get_option( 'bp-disable-group-avatar-uploads', '' );
+
+ if ( '' === $disabled ) {
+ if ( is_null( $default ) ) {
+ $disabled = bp_disable_avatar_uploads();
+ } else {
+ $disabled = $default;
+ }
+ }
+
+ /**
+ * Filters whether or not members are able to upload group avatars.
+ *
+ * @since BuddyPress (2.3.0)
+ *
+ * @param bool $disabled Whether or not members are able to upload their groups avatars.
+ * @param bool $default Default value passed to the function.
+ */
+ return (bool) apply_filters( 'bp_disable_group_avatar_uploads', $disabled, $default );
+}
+
+/**
</ins><span class="cx" style="display: block; padding: 0 10px"> * Are members able to delete their own accounts?
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since BuddyPress (1.6.0)
</span></span></pre></div>
<a id="trunksrcbpgroupsbpgroupsloaderphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-groups/bp-groups-loader.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-groups/bp-groups-loader.php 2015-04-30 20:21:26 UTC (rev 9827)
+++ trunk/src/bp-groups/bp-groups-loader.php 2015-05-02 01:01:03 UTC (rev 9828)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -298,7 +298,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> ) );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // If avatar uploads are not disabled, add avatar option
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $disabled_avatar_uploads = (int) bp_core_get_root_option( 'bp-disable-avatar-uploads' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $disabled_avatar_uploads = (int) bp_disable_group_avatar_uploads();
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( ! $disabled_avatar_uploads && $bp->avatar->show_avatars ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->group_creation_steps['group-avatar'] = array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'name' => _x( 'Photo', 'Group screen nav', 'buddypress' ),
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -574,7 +574,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'position' => 10,
</span><span class="cx" style="display: block; padding: 0 10px"> ), $default_params );
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! (int) bp_get_option( 'bp-disable-avatar-uploads' ) && buddypress()->avatar->show_avatars ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! bp_disable_group_avatar_uploads() && buddypress()->avatar->show_avatars ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> $sub_nav[] = array_merge( array(
</span><span class="cx" style="display: block; padding: 0 10px"> 'name' => __( 'Photo', 'buddypress' ),
</span><span class="cx" style="display: block; padding: 0 10px"> 'slug' => 'group-avatar',
</span></span></pre></div>
<a id="trunksrcbpgroupsbpgroupsscreensphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-groups/bp-groups-screens.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-groups/bp-groups-screens.php 2015-04-30 20:21:26 UTC (rev 9827)
+++ trunk/src/bp-groups/bp-groups-screens.php 2015-05-02 01:01:03 UTC (rev 9828)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -906,7 +906,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // If the logged-in user doesn't have permission or if avatar uploads are disabled, then stop here
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- if ( ! bp_is_item_admin() || (int) bp_get_option( 'bp-disable-avatar-uploads' ) || ! buddypress()->avatar->show_avatars )
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( ! bp_is_item_admin() || bp_disable_group_avatar_uploads() || ! buddypress()->avatar->show_avatars )
</ins><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $bp = buddypress();
</span></span></pre></div>
<a id="trunksrcbpgroupsbpgroupstemplatephp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-groups/bp-groups-template.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-groups/bp-groups-template.php 2015-04-30 20:21:26 UTC (rev 9827)
+++ trunk/src/bp-groups/bp-groups-template.php 2015-05-02 01:01:03 UTC (rev 9828)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -709,6 +709,13 @@
</span><span class="cx" style="display: block; padding: 0 10px"> $classes[] = 'is-mod';
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Whether a group avatar will appear.
+ if ( bp_disable_group_avatar_uploads() || ! buddypress()->avatar->show_avatars ) {
+ $classes[] = 'group-no-avatar';
+ } else {
+ $classes[] = 'group-has-avatar';
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Filters classes that will be applied to row class of the current group in the loop.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -858,9 +865,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> function bp_get_group_avatar( $args = '' ) {
</span><span class="cx" style="display: block; padding: 0 10px"> global $groups_template;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- // Bail if avatars are turned off
- // @todo Should we maybe still filter this?
- if ( ! buddypress()->avatar->show_avatars ) {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Bail if avatars are turned off.
+ if ( bp_disable_group_avatar_uploads() || ! buddypress()->avatar->show_avatars ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> return false;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcbptemplatesbplegacybuddypressgroupsgroupsloopphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-templates/bp-legacy/buddypress/groups/groups-loop.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-templates/bp-legacy/buddypress/groups/groups-loop.php 2015-04-30 20:21:26 UTC (rev 9827)
+++ trunk/src/bp-templates/bp-legacy/buddypress/groups/groups-loop.php 2015-05-02 01:01:03 UTC (rev 9828)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -52,9 +52,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php while ( bp_groups() ) : bp_the_group(); ?>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <li <?php bp_group_class(); ?>>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <div class="item-avatar">
- <a href="<?php bp_group_permalink(); ?>"><?php bp_group_avatar( 'type=thumb&width=50&height=50' ); ?></a>
- </div>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <?php if ( ! bp_disable_group_avatar_uploads() ) : ?>
+ <div class="item-avatar">
+ <a href="<?php bp_group_permalink(); ?>"><?php bp_group_avatar( 'type=thumb&width=50&height=50' ); ?></a>
+ </div>
+ <?php endif; ?>
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="item">
</span><span class="cx" style="display: block; padding: 0 10px"> <div class="item-title"><a href="<?php bp_group_permalink(); ?>"><?php bp_group_name(); ?></a></div>
</span></span></pre></div>
<a id="trunksrcbptemplatesbplegacybuddypressgroupssinglegroupheaderphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-templates/bp-legacy/buddypress/groups/single/group-header.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-templates/bp-legacy/buddypress/groups/single/group-header.php 2015-04-30 20:21:26 UTC (rev 9827)
+++ trunk/src/bp-templates/bp-legacy/buddypress/groups/single/group-header.php 2015-05-02 01:01:03 UTC (rev 9828)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -50,13 +50,15 @@
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> </div><!-- #item-actions -->
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-<div id="item-header-avatar">
- <a href="<?php bp_group_permalink(); ?>" title="<?php bp_group_name(); ?>">
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+<?php if ( ! bp_disable_group_avatar_uploads() ) : ?>
+ <div id="item-header-avatar">
+ <a href="<?php bp_group_permalink(); ?>" title="<?php bp_group_name(); ?>">
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <?php bp_group_avatar(); ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <?php bp_group_avatar(); ?>
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- </a>
-</div><!-- #item-header-avatar -->
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ </a>
+ </div><!-- #item-header-avatar -->
+<?php endif; ?>
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <div id="item-header-content">
</span><span class="cx" style="display: block; padding: 0 10px"> <span class="highlight"><?php bp_group_type(); ?></span>
</span></span></pre></div>
<a id="trunksrcbptemplatesbplegacybuddypressmemberssinglegroupsinvitesphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-templates/bp-legacy/buddypress/members/single/groups/invites.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-templates/bp-legacy/buddypress/members/single/groups/invites.php 2015-04-30 20:21:26 UTC (rev 9827)
+++ trunk/src/bp-templates/bp-legacy/buddypress/members/single/groups/invites.php 2015-05-02 01:01:03 UTC (rev 9828)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -14,9 +14,11 @@
</span><span class="cx" style="display: block; padding: 0 10px"> <?php while ( bp_groups() ) : bp_the_group(); ?>
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <li>
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <div class="item-avatar">
- <a href="<?php bp_group_permalink(); ?>"><?php bp_group_avatar( 'type=thumb&width=50&height=50' ); ?></a>
- </div>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ <?php if ( ! bp_disable_group_avatar_uploads() ) : ?>
+ <div class="item-avatar">
+ <a href="<?php bp_group_permalink(); ?>"><?php bp_group_avatar( 'type=thumb&width=50&height=50' ); ?></a>
+ </div>
+ <?php endif; ?>
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> <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>
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcbptemplatesbplegacycssbuddypresscss"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-templates/bp-legacy/css/buddypress.css</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-templates/bp-legacy/css/buddypress.css 2015-04-30 20:21:26 UTC (rev 9827)
+++ trunk/src/bp-templates/bp-legacy/css/buddypress.css 2015-05-02 01:01:03 UTC (rev 9828)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -1281,6 +1281,9 @@
</span><span class="cx" style="display: block; padding: 0 10px"> margin: 10px 0 0 60px;
</span><span class="cx" style="display: block; padding: 0 10px"> width: 50%;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+#buddypress ul.item-list li.group-no-avatar div.item-desc {
+ margin-left: 0;
+}
</ins><span class="cx" style="display: block; padding: 0 10px"> #buddypress ul.item-list li div.action {
</span><span class="cx" style="display: block; padding: 0 10px"> position: absolute;
</span><span class="cx" style="display: block; padding: 0 10px"> top: 15px;
</span></span></pre>
</div>
</div>
</body>
</html>