<!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][6070] trunk: Whitespace cleanup in xprofile component and templates</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, #logmsg > ol { margin-left: 0; 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">
<dt>Revision</dt> <dd><a href="http://buddypress.trac.wordpress.org/changeset/6070">6070</a></dd>
<dt>Author</dt> <dd>boonebgorges</dd>
<dt>Date</dt> <dd>2012-06-09 14:40:37 +0000 (Sat, 09 Jun 2012)</dd>
</dl>
<h3>Log Message</h3>
<pre>Whitespace cleanup in xprofile component and templates</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkbpthemesbpdefaultmemberssingleprofileeditphp">trunk/bp-themes/bp-default/members/single/profile/edit.php</a></li>
<li><a href="#trunkbpxprofilebpxprofileclassesphp">trunk/bp-xprofile/bp-xprofile-classes.php</a></li>
<li><a href="#trunkbpxprofilebpxprofilefunctionsphp">trunk/bp-xprofile/bp-xprofile-functions.php</a></li>
<li><a href="#trunkbpxprofilebpxprofilescreensphp">trunk/bp-xprofile/bp-xprofile-screens.php</a></li>
<li><a href="#trunkbpxprofilebpxprofiletemplatephp">trunk/bp-xprofile/bp-xprofile-template.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkbpthemesbpdefaultmemberssingleprofileeditphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-themes/bp-default/members/single/profile/edit.php (6069 => 6070)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-themes/bp-default/members/single/profile/edit.php        2012-06-09 14:40:26 UTC (rev 6069)
+++ trunk/bp-themes/bp-default/members/single/profile/edit.php        2012-06-09 14:40:37 UTC (rev 6070)
</span><span class="lines">@@ -112,25 +112,25 @@
</span><span class="cx">                                         </div>
</span><span class="cx">
</span><span class="cx">                                 <?php endif; ?>
</span><del>-                                
</del><ins>+
</ins><span class="cx">                                 <?php if ( bp_current_user_can( 'bp_xprofile_change_field_visibility' ) ) : ?>
</span><span class="cx">                                         <p class="field-visibility-settings-toggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>">
</span><span class="cx">                                                 <?php printf( __( 'This field can be seen by: <span class="current-visibility-level">%s</span>', 'buddypress' ), bp_get_the_profile_field_visibility_level_label() ) ?> <a href="#" class="visibility-toggle-link"><?php _e( 'Change', 'buddypress' ); ?></a>
</span><span class="cx">                                         </p>
</span><del>-                                        
</del><ins>+
</ins><span class="cx">                                         <div class="field-visibility-settings" id="field-visibility-settings-<?php bp_the_profile_field_id() ?>">
</span><span class="cx">                                                 <fieldset>
</span><span class="cx">                                                         <legend><?php _e( 'Who can see this field?', 'buddypress' ) ?></legend>
</span><del>-                                                
</del><ins>+
</ins><span class="cx">                                                         <?php bp_profile_visibility_radio_buttons() ?>
</span><del>-                                                
</del><ins>+
</ins><span class="cx">                                                 </fieldset>
</span><span class="cx">                                                 <a class="field-visibility-settings-close" href="#"><?php _e( 'Close', 'buddypress' ) ?></a>
</span><span class="cx">                                         </div>
</span><span class="cx">                                 <?php else : ?>
</span><span class="cx">                                         <div class="field-visibility-settings-notoggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>">
</span><span class="cx">                                                 <?php printf( __( 'This field can be seen by: <span class="current-visibility-level">%s</span>', 'buddypress' ), bp_get_the_profile_field_visibility_level_label() ) ?>
</span><del>-                                        </div>                        
</del><ins>+                                        </div>
</ins><span class="cx">                                 <?php endif ?>
</span><span class="cx">
</span><span class="cx">                                 <?php do_action( 'bp_custom_profile_edit_fields' ); ?>
</span></span></pre></div>
<a id="trunkbpxprofilebpxprofileclassesphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-xprofile/bp-xprofile-classes.php (6069 => 6070)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-xprofile/bp-xprofile-classes.php        2012-06-09 14:40:26 UTC (rev 6069)
+++ trunk/bp-xprofile/bp-xprofile-classes.php        2012-06-09 14:40:37 UTC (rev 6070)
</span><span class="lines">@@ -153,18 +153,18 @@
</span><span class="cx">
</span><span class="cx">                 if ( empty( $group_ids ) )
</span><span class="cx">                         return $groups;
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // Support arrays and comma-separated strings
</span><span class="cx">                 $exclude_fields_cs = wp_parse_id_list( $exclude_fields );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // Visibility - Handled here so as not to be overridden by sloppy use of the
</span><span class="cx">                 // exclude_fields parameter. See bp_xprofile_get_hidden_fields_for_user()
</span><span class="cx">                 $exclude_fields_cs = array_merge( $exclude_fields_cs, bp_xprofile_get_hidden_fields_for_user( $user_id ) );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $exclude_fields_cs = implode( ',', $exclude_fields_cs );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 if ( !empty( $exclude_fields_cs ) ) {
</span><del>-                        $exclude_fields_sql = $wpdb->prepare( "AND id NOT IN ({$exclude_fields_cs})" );
</del><ins>+                        $exclude_fields_sql = $wpdb->prepare( "AND id NOT IN ({$exclude_fields_cs})" );
</ins><span class="cx">                 } else {
</span><span class="cx">                         $exclude_fields_sql = '';
</span><span class="cx">                 }
</span><span class="lines">@@ -230,7 +230,7 @@
</span><span class="cx">                                         }
</span><span class="cx">                                 }
</span><span class="cx">                         }
</span><del>-                                                                
</del><ins>+
</ins><span class="cx">                         if ( $fetch_visibility_level ) {
</span><span class="cx">                                 $fields = self::fetch_visibility_level( $user_id, $fields );
</span><span class="cx">                         }
</span><span class="lines">@@ -282,7 +282,7 @@
</span><span class="cx">
</span><span class="cx">                 return $wpdb->query( $wpdb->prepare( "UPDATE {$bp->profile->table_name_groups} SET group_order = %d WHERE id = %d", $position, $field_group_id ) );
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         /**
</span><span class="cx">          * Fetch the field visibility level for the fields returned by the query
</span><span class="cx">          *
</span><span class="lines">@@ -294,31 +294,31 @@
</span><span class="cx">          */
</span><span class="cx">         function fetch_visibility_level( $user_id, $fields ) {
</span><span class="cx">                 global $wpdb, $bp;
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // Get the user's visibility level preferences
</span><span class="cx">                 $visibility_levels = bp_get_user_meta( $user_id, 'bp_xprofile_visibility_levels', true );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // Get the admin-set preferences
</span><span class="cx">                 $admin_set_levels = self::fetch_default_visibility_levels();
</span><del>-                
</del><ins>+
</ins><span class="cx">                 foreach( (array)$fields as $key => $field ) {
</span><span class="cx">                         // Does the admin allow this field to be customized?
</span><span class="cx">                         $allow_custom = !empty( $admin_set_levels[$field->id]['allow_custom'] ) && 'disabled' != $admin_set_levels[$field->id]['allow_custom'];
</span><del>-                        
</del><ins>+
</ins><span class="cx">                         // Look to see if the user has set the visibility for this field
</span><span class="cx">                         if ( $allow_custom && isset( $visibility_levels[$field->id] ) ) {
</span><span class="cx">                                 $field_visibility = $visibility_levels[$field->id];
</span><del>-                        } else {                                
</del><ins>+                        } else {
</ins><span class="cx">                                 // If no admin-set default is saved, fall back on a global default
</span><span class="cx">                                 $field_visibility = !empty( $admin_set_levels[$field->id]['default'] ) ? $admin_set_levels[$field->id]['default'] : apply_filters( 'bp_xprofile_default_visibility_level', 'public' );
</span><span class="cx">                         }
</span><del>-                        
</del><ins>+
</ins><span class="cx">                         $fields[$key]->visibility_level = $field_visibility;
</span><span class="cx">                 }
</span><del>-                
</del><ins>+
</ins><span class="cx">                 return $fields;
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         /**
</span><span class="cx">          * Fetch the admin-set preferences for all fields
</span><span class="cx">          *
</span><span class="lines">@@ -329,22 +329,22 @@
</span><span class="cx">          */
</span><span class="cx">         function fetch_default_visibility_levels() {
</span><span class="cx">                 global $wpdb, $bp;
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $levels = $wpdb->get_results( $wpdb->prepare( "SELECT object_id, meta_key, meta_value FROM {$bp->profile->table_name_meta} WHERE object_type = 'field' AND ( meta_key = 'default_visibility' OR meta_key = 'allow_custom_visibility' )" ) );
</span><del>-                
</del><ins>+
</ins><span class="cx">                 // Arrange so that the field id is the key and the visibility level the value
</span><span class="cx">                 $default_visibility_levels = array();
</span><span class="cx">                 foreach( $levels as $level ) {
</span><span class="cx">                         if ( 'default_visibility' == $level->meta_key ) {
</span><del>-                                $default_visibility_levels[$level->object_id]['default'] = $level->meta_value;                
</del><ins>+                                $default_visibility_levels[$level->object_id]['default'] = $level->meta_value;
</ins><span class="cx">                         } else if ( 'allow_custom_visibility' == $level->meta_key ) {
</span><del>-                                $default_visibility_levels[$level->object_id]['allow_custom'] = $level->meta_value;                
</del><ins>+                                $default_visibility_levels[$level->object_id]['allow_custom'] = $level->meta_value;
</ins><span class="cx">                         }
</span><span class="cx">                 }
</span><del>-                
</del><ins>+
</ins><span class="cx">                 return $default_visibility_levels;
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         /* ADMIN AREA HTML.
</span><span class="cx">         * TODO: Get this out of here and replace with standard loops
</span><span class="cx">         */
</span><span class="lines">@@ -463,13 +463,13 @@
</span><span class="cx">                         if ( $get_data && $user_id ) {
</span><span class="cx">                                 $this->data = $this->get_field_data( $user_id );
</span><span class="cx">                         }
</span><del>-                        
</del><ins>+
</ins><span class="cx">                         $this->default_visibility = bp_xprofile_get_meta( $id, 'field', 'default_visibility' );
</span><del>-                        
</del><ins>+
</ins><span class="cx">                         if ( empty( $this->default_visibility ) ) {
</span><span class="cx">                                 $this->default_visibility = 'public';
</span><span class="cx">                         }
</span><del>-                        
</del><ins>+
</ins><span class="cx">                         $this->allow_custom_visibility = 'disabled' == bp_xprofile_get_meta( $id, 'field', 'allow_custom_visibility' ) ? 'disabled' : 'allowed';
</span><span class="cx">                 }
</span><span class="cx">         }
</span><span class="lines">@@ -727,10 +727,10 @@
</span><span class="cx">                                 $default_input = 'radio';
</span><span class="cx">                         }
</span><span class="cx">
</span><del>-                        if ( $this->type != $type ) {
</del><ins>+                        if ( $this->type != $type ) {
</ins><span class="cx">                                 $class = 'display: none;';
</span><span class="cx">                         }
</span><del>-                        
</del><ins>+
</ins><span class="cx">                         if ( empty( $this->default_visibility ) ) {
</span><span class="cx">                                 $this->default_visibility = 'public';
</span><span class="cx">                         }
</span><span class="lines">@@ -886,26 +886,26 @@
</span><span class="cx">                                         <?php if ( 1 != $this->id ) : ?>
</span><span class="cx">
</span><span class="cx">                                                 <div id="titlediv">
</span><del>-                                                        
</del><ins>+
</ins><span class="cx">                                                         <div id="titlewrap">
</span><span class="cx">                                                                 <h3><label for="default-visibility"><?php _e( "Default Visibility", 'buddypress' ); ?></label></h3>
</span><span class="cx">                                                                 <ul>
</span><span class="cx">                                                                 <?php foreach( bp_xprofile_get_visibility_levels() as $level ) : ?>
</span><del>-                                                                        <li><input type="radio" name="default-visibility" value="<?php echo esc_attr( $level['id'] ) ?>" <?php checked( $this->default_visibility, $level['id'] ) ?>> <?php echo esc_html( $level['label'] ) ?></li>
</del><ins>+                                                                        <li><input type="radio" name="default-visibility" value="<?php echo esc_attr( $level['id'] ) ?>" <?php checked( $this->default_visibility, $level['id'] ) ?>> <?php echo esc_html( $level['label'] ) ?></li>
</ins><span class="cx">                                                                 <?php endforeach ?>
</span><span class="cx">                                                                 </ul>
</span><span class="cx">                                                         </div>
</span><del>-                                                        
</del><ins>+
</ins><span class="cx">                                                         <div id="titlewrap">
</span><span class="cx">                                                                 <h3><label for="allow-custom-visibility"><?php _e( "Per-Member Visibility", 'buddypress' ); ?></label></h3>
</span><span class="cx">                                                                 <ul>
</span><span class="cx">                                                                         <li><input type="radio" name="allow-custom-visibility" value="allowed" <?php checked( $this->allow_custom_visibility, 'allowed' ) ?>> <?php _e( "Let members change the this field's visibility", 'buddypress' ) ?></li>
</span><del>-                                                                        
</del><ins>+
</ins><span class="cx">                                                                         <li><input type="radio" name="allow-custom-visibility" value="disabled" <?php checked( $this->allow_custom_visibility, 'disabled' ) ?>> <?php _e( 'Enforce the default visibility for all members', 'buddypress' ) ?></li>
</span><span class="cx">                                                                 </ul>
</span><span class="cx">                                                         </div>
</span><span class="cx">                                                 </div>
</span><del>-                                        
</del><ins>+
</ins><span class="cx">                                         <?php endif ?>
</span><span class="cx">
</span><span class="cx">                                         <p class="submit">
</span><span class="lines">@@ -1088,7 +1088,7 @@
</span><span class="cx">
</span><span class="cx">                 return $profile_data;
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         /**
</span><span class="cx">          * Get the user's field data id by the id of the xprofile field
</span><span class="cx">          *
</span><span class="lines">@@ -1098,13 +1098,13 @@
</span><span class="cx">          */
</span><span class="cx">         function get_fielddataid_byid( $field_id, $user_id ) {
</span><span class="cx">                 global $wpdb, $bp;
</span><del>-                
</del><ins>+
</ins><span class="cx">                 if ( empty( $field_id ) || empty( $user_id ) ) {
</span><span class="cx">                         $fielddata_id = 0;
</span><span class="cx">                 } else {
</span><del>-                        $fielddata_id = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->profile->table_name_data} WHERE field_id = %d AND user_id = %d", $field_id, $user_id ) );        
</del><ins>+                        $fielddata_id = $wpdb->get_var( $wpdb->prepare( "SELECT id FROM {$bp->profile->table_name_data} WHERE field_id = %d AND user_id = %d", $field_id, $user_id ) );
</ins><span class="cx">                 }
</span><del>-                
</del><ins>+
</ins><span class="cx">                 return $fielddata_id;
</span><span class="cx">         }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkbpxprofilebpxprofilefunctionsphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-xprofile/bp-xprofile-functions.php (6069 => 6070)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-xprofile/bp-xprofile-functions.php        2012-06-09 14:40:26 UTC (rev 6069)
+++ trunk/bp-xprofile/bp-xprofile-functions.php        2012-06-09 14:40:37 UTC (rev 6070)
</span><span class="lines">@@ -151,7 +151,7 @@
</span><span class="cx"> * @package BuddyPress Core
</span><span class="cx"> * @param mixed $field The ID of the field, or the $name of the field.
</span><span class="cx"> * @param int $user_id The ID of the user
</span><del>- * @param string $multi_format How should array data be returned? 'comma' if you want a
</del><ins>+ * @param string $multi_format How should array data be returned? 'comma' if you want a
</ins><span class="cx"> * comma-separated string; 'array' if you want an array
</span><span class="cx"> * @uses BP_XProfile_ProfileData::get_value_byid() Fetches the value based on the params passed.
</span><span class="cx"> * @return mixed The profile field data.
</span><span class="lines">@@ -179,7 +179,7 @@
</span><span class="cx">                 foreach( (array) $values as $value ) {
</span><span class="cx">                         $data[] = apply_filters( 'xprofile_get_field_data', $value, $field_id, $user_id );
</span><span class="cx">                 }
</span><del>-                
</del><ins>+
</ins><span class="cx">                 if ( 'comma' == $multi_format ) {
</span><span class="cx">                         $data = implode( ', ', $data );
</span><span class="cx">                 }
</span><span class="lines">@@ -268,22 +268,22 @@
</span><span class="cx">         if ( empty( $field_id ) || empty( $user_id ) || empty( $visibility_level ) ) {
</span><span class="cx">                 return false;
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         // Check against a whitelist
</span><span class="cx">         $allowed_values = bp_xprofile_get_visibility_levels();
</span><span class="cx">         if ( !array_key_exists( $visibility_level, $allowed_values ) ) {
</span><span class="cx">                 return false;
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         // Stored in an array in usermeta
</span><span class="cx">         $current_visibility_levels = bp_get_user_meta( $user_id, 'bp_xprofile_visibility_levels', true );
</span><del>-        
</del><ins>+
</ins><span class="cx">         if ( !$current_visibility_levels ) {
</span><span class="cx">                 $current_visibility_levels = array();
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         $current_visibility_levels[$field_id] = $visibility_level;
</span><del>-        
</del><ins>+
</ins><span class="cx">         return bp_update_user_meta( $user_id, 'bp_xprofile_visibility_levels', $current_visibility_levels );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -636,7 +636,7 @@
</span><span class="cx"> */
</span><span class="cx"> function bp_xprofile_get_visibility_levels() {
</span><span class="cx">         global $bp;
</span><del>-        
</del><ins>+
</ins><span class="cx">         return apply_filters( 'bp_xprofile_get_visibility_levels', $bp->profile->visibility_levels );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -661,39 +661,39 @@
</span><span class="cx">         if ( !$displayed_user_id ) {
</span><span class="cx">                 $displayed_user_id = bp_displayed_user_id();
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         if ( !$displayed_user_id ) {
</span><span class="cx">                 return array();
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         if ( !$current_user_id ) {
</span><span class="cx">                 $current_user_id = bp_loggedin_user_id();
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         // @todo - This is where you'd swap out for current_user_can() checks
</span><del>-        
</del><ins>+
</ins><span class="cx">         if ( $current_user_id ) {
</span><span class="cx">                 // Current user is logged in
</span><span class="cx">                 if ( $displayed_user_id == $current_user_id ) {
</span><span class="cx">                         // If you're viewing your own profile, nothing's private
</span><del>-                        $hidden_fields = array();        
-                        
</del><ins>+                        $hidden_fields = array();
+
</ins><span class="cx">                 } else if ( bp_is_active( 'friends' ) && friends_check_friendship( $displayed_user_id, $current_user_id ) ) {
</span><span class="cx">                         // If the current user and displayed user are friends, show all
</span><span class="cx">                         $hidden_fields = array();
</span><del>-                        
</del><ins>+
</ins><span class="cx">                 } else {
</span><del>-                        // current user is logged-in but not friends, so exclude friends-only        
-                        $hidden_levels = array( 'friends' );                        
</del><ins>+                        // current user is logged-in but not friends, so exclude friends-only
+                        $hidden_levels = array( 'friends' );
</ins><span class="cx">                         $hidden_fields = bp_xprofile_get_fields_by_visibility_levels( $displayed_user_id, $hidden_levels );
</span><span class="cx">                 }
</span><del>-                
</del><ins>+
</ins><span class="cx">         } else {
</span><span class="cx">                 // Current user is not logged in, so exclude friends-only and loggedin
</span><span class="cx">                 $hidden_levels = array( 'friends', 'loggedin' );
</span><span class="cx">                 $hidden_fields = bp_xprofile_get_fields_by_visibility_levels( $displayed_user_id, $hidden_levels );
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         return apply_filters( 'bp_xprofile_get_hidden_fields_for_user', $hidden_fields, $displayed_user_id, $current_user_id );
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -712,7 +712,7 @@
</span><span class="cx">         if ( !is_array( $levels ) ) {
</span><span class="cx">                 $levels = (array)$levels;
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         $user_visibility_levels = bp_get_user_meta( $user_id, 'bp_xprofile_visibility_levels', true );
</span><span class="cx">
</span><span class="cx">         // Parse the user-provided visibility levels with the default levels, which may take
</span><span class="lines">@@ -733,13 +733,13 @@
</span><span class="cx">                         $field_ids[] = $field_id;
</span><span class="cx">                 }
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         // Never allow the fullname field to be excluded
</span><span class="cx">         if ( in_array( 1, $field_ids ) ) {
</span><span class="cx">                 $key = array_search( 1, $field_ids );
</span><span class="cx">                 unset( $field_ids[$key] );
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         return $field_ids;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkbpxprofilebpxprofilescreensphp"></a>
<div class="modfile"><h4>Modified: trunk/bp-xprofile/bp-xprofile-screens.php (6069 => 6070)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-xprofile/bp-xprofile-screens.php        2012-06-09 14:40:26 UTC (rev 6069)
+++ trunk/bp-xprofile/bp-xprofile-screens.php        2012-06-09 14:40:37 UTC (rev 6070)
</span><span class="lines">@@ -113,7 +113,7 @@
</span><span class="cx">                                         $errors = true;
</span><span class="cx">                                 else
</span><span class="cx">                                         do_action( 'xprofile_profile_field_data_updated', $field_id, $value );
</span><del>-                                
</del><ins>+
</ins><span class="cx">                                 // Save the visibility level
</span><span class="cx">                                 $visibility_level = !empty( $_POST['field_' . $field_id . '_visibility'] ) ? $_POST['field_' . $field_id . '_visibility'] : 'public';
</span><span class="cx">                                 xprofile_set_field_visibility_level( $field_id, bp_displayed_user_id(), $visibility_level );
</span></span></pre></div>
<a id="trunkbpxprofilebpxprofiletemplatephp"></a>
<div class="modfile"><h4>Modified: trunk/bp-xprofile/bp-xprofile-template.php (6069 => 6070)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/bp-xprofile/bp-xprofile-template.php        2012-06-09 14:40:26 UTC (rev 6069)
+++ trunk/bp-xprofile/bp-xprofile-template.php        2012-06-09 14:40:37 UTC (rev 6070)
</span><span class="lines">@@ -157,14 +157,14 @@
</span><span class="cx">         // Only show empty fields if we're on the Dashboard, or we're on a user's profile edit page,
</span><span class="cx">         // or this is a registration page
</span><span class="cx">         $hide_empty_fields_default = ( !is_network_admin() && !is_admin() && !bp_is_user_profile_edit() && !bp_is_register_page() );
</span><del>-        
</del><ins>+
</ins><span class="cx">         // We only need to fetch visibility levels when viewing your own profile
</span><span class="cx">         if ( bp_is_my_profile() || bp_current_user_can( 'bp_moderate' ) || bp_is_register_page() ) {
</span><span class="cx">                 $fetch_visibility_level_default = true;
</span><span class="cx">         } else {
</span><span class="cx">                 $fetch_visibility_level_default = false;
</span><span class="cx">         }
</span><del>-        
</del><ins>+
</ins><span class="cx">         $defaults = array(
</span><span class="cx">                 'user_id' => bp_displayed_user_id(),
</span><span class="cx">                 'profile_group_id' => false,
</span><span class="lines">@@ -424,7 +424,7 @@
</span><span class="cx">                 // even on required fields.
</span><span class="cx">                 $defaults = array(
</span><span class="cx">                         'type'                  => false,
</span><del>-                        'null_on_required' => false
</del><ins>+                        'null_on_required' => false
</ins><span class="cx">                 );
</span><span class="cx">
</span><span class="cx">                 $r = wp_parse_args( $args, $defaults );
</span><span class="lines">@@ -729,9 +729,9 @@
</span><span class="cx">          */
</span><span class="cx">         function bp_get_the_profile_field_visibility_level() {
</span><span class="cx">                 global $field;
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $retval = !empty( $field->visibility_level ) ? $field->visibility_level : 'public';
</span><del>-                
</del><ins>+
</ins><span class="cx">                 return apply_filters( 'bp_get_the_profile_field_visibility_level', $retval );
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -746,10 +746,10 @@
</span><span class="cx">          */
</span><span class="cx">         function bp_get_the_profile_field_visibility_level_label() {
</span><span class="cx">                 global $field;
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $level = !empty( $field->visibility_level ) ? $field->visibility_level : 'public';
</span><span class="cx">                 $fields = bp_xprofile_get_visibility_levels();
</span><del>-                
</del><ins>+
</ins><span class="cx">                 return apply_filters( 'bp_get_the_profile_field_visibility_level_label', $fields[$level]['label'] );
</span><span class="cx">         }
</span><span class="cx">
</span><span class="lines">@@ -905,17 +905,17 @@
</span><span class="cx">         /**
</span><span class="cx">          * Return the field visibility radio buttons
</span><span class="cx">          */
</span><del>-        function bp_profile_get_visibility_radio_buttons() {                
</del><ins>+        function bp_profile_get_visibility_radio_buttons() {
</ins><span class="cx">                 $html = '<ul class="radio">';
</span><del>-                
</del><ins>+
</ins><span class="cx">                 foreach( bp_xprofile_get_visibility_levels() as $level ) {
</span><span class="cx">                         $checked = $level['id'] == bp_get_the_profile_field_visibility_level() ? ' checked="checked" ' : '';
</span><del>-                        
</del><ins>+
</ins><span class="cx">                         $html .= '<li><label for="see-field_' . esc_attr( $level['id'] ) . '"><input type="radio" id="see-field_' . esc_attr( $level['id'] ) . '" name="field_' . bp_get_the_profile_field_id() . '_visibility" value="' . esc_attr( $level['id'] ) . '"' . $checked . ' /> ' . esc_html( $level['label'] ) . '</label></li>';
</span><span class="cx">                 }
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $html .= '</ul>';
</span><del>-                
</del><ins>+
</ins><span class="cx">                 return apply_filters( 'bp_profile_get_visibility_radio_buttons', $html );
</span><span class="cx">         }
</span><span class="cx"> ?>
</span></span></pre>
</div>
</div>
</body>
</html>