<!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">                                         &lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx">                                 &lt;?php endif; ?&gt;
</span><del>-                                
</del><ins>+
</ins><span class="cx">                                 &lt;?php if ( bp_current_user_can( 'bp_xprofile_change_field_visibility' ) ) : ?&gt;
</span><span class="cx">                                         &lt;p class=&quot;field-visibility-settings-toggle&quot; id=&quot;field-visibility-settings-toggle-&lt;?php bp_the_profile_field_id() ?&gt;&quot;&gt;
</span><span class="cx">                                                 &lt;?php printf( __( 'This field can be seen by: &lt;span class=&quot;current-visibility-level&quot;&gt;%s&lt;/span&gt;', 'buddypress' ), bp_get_the_profile_field_visibility_level_label() ) ?&gt; &lt;a href=&quot;#&quot; class=&quot;visibility-toggle-link&quot;&gt;&lt;?php _e( 'Change', 'buddypress' ); ?&gt;&lt;/a&gt;
</span><span class="cx">                                         &lt;/p&gt;
</span><del>-                                        
</del><ins>+
</ins><span class="cx">                                         &lt;div class=&quot;field-visibility-settings&quot; id=&quot;field-visibility-settings-&lt;?php bp_the_profile_field_id() ?&gt;&quot;&gt;
</span><span class="cx">                                                 &lt;fieldset&gt;
</span><span class="cx">                                                         &lt;legend&gt;&lt;?php _e( 'Who can see this field?', 'buddypress' ) ?&gt;&lt;/legend&gt;
</span><del>-                                                
</del><ins>+
</ins><span class="cx">                                                         &lt;?php bp_profile_visibility_radio_buttons() ?&gt;
</span><del>-                                                
</del><ins>+
</ins><span class="cx">                                                 &lt;/fieldset&gt;
</span><span class="cx">                                                 &lt;a class=&quot;field-visibility-settings-close&quot; href=&quot;#&quot;&gt;&lt;?php _e( 'Close', 'buddypress' ) ?&gt;&lt;/a&gt;
</span><span class="cx">                                         &lt;/div&gt;
</span><span class="cx">                                 &lt;?php else : ?&gt;
</span><span class="cx">                                         &lt;div class=&quot;field-visibility-settings-notoggle&quot; id=&quot;field-visibility-settings-toggle-&lt;?php bp_the_profile_field_id() ?&gt;&quot;&gt;
</span><span class="cx">                                                 &lt;?php printf( __( 'This field can be seen by: &lt;span class=&quot;current-visibility-level&quot;&gt;%s&lt;/span&gt;', 'buddypress' ), bp_get_the_profile_field_visibility_level_label() ) ?&gt;
</span><del>-                                        &lt;/div&gt;                        
</del><ins>+                                        &lt;/div&gt;
</ins><span class="cx">                                 &lt;?php endif ?&gt;
</span><span class="cx"> 
</span><span class="cx">                                 &lt;?php do_action( 'bp_custom_profile_edit_fields' ); ?&gt;
</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-&gt;prepare( &quot;AND id NOT IN ({$exclude_fields_cs})&quot; ); 
</del><ins>+                        $exclude_fields_sql = $wpdb-&gt;prepare( &quot;AND id NOT IN ({$exclude_fields_cs})&quot; );
</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-&gt;query( $wpdb-&gt;prepare( &quot;UPDATE {$bp-&gt;profile-&gt;table_name_groups} SET group_order = %d WHERE id = %d&quot;, $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 =&gt; $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-&gt;id]['allow_custom'] ) &amp;&amp; 'disabled' != $admin_set_levels[$field-&gt;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 &amp;&amp; isset( $visibility_levels[$field-&gt;id] ) ) {
</span><span class="cx">                                 $field_visibility = $visibility_levels[$field-&gt;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-&gt;id]['default'] ) ? $admin_set_levels[$field-&gt;id]['default'] : apply_filters( 'bp_xprofile_default_visibility_level', 'public' );
</span><span class="cx">                         }
</span><del>-                        
</del><ins>+
</ins><span class="cx">                         $fields[$key]-&gt;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-&gt;get_results( $wpdb-&gt;prepare( &quot;SELECT object_id, meta_key, meta_value FROM {$bp-&gt;profile-&gt;table_name_meta} WHERE object_type = 'field' AND ( meta_key = 'default_visibility' OR meta_key = 'allow_custom_visibility' )&quot; ) );
</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-&gt;meta_key ) {
</span><del>-                                $default_visibility_levels[$level-&gt;object_id]['default'] = $level-&gt;meta_value;                
</del><ins>+                                $default_visibility_levels[$level-&gt;object_id]['default'] = $level-&gt;meta_value;
</ins><span class="cx">                         } else if ( 'allow_custom_visibility' == $level-&gt;meta_key ) {
</span><del>-                                $default_visibility_levels[$level-&gt;object_id]['allow_custom'] = $level-&gt;meta_value;                
</del><ins>+                                $default_visibility_levels[$level-&gt;object_id]['allow_custom'] = $level-&gt;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 &amp;&amp; $user_id ) {
</span><span class="cx">                                 $this-&gt;data          = $this-&gt;get_field_data( $user_id );
</span><span class="cx">                         }
</span><del>-                        
</del><ins>+
</ins><span class="cx">                         $this-&gt;default_visibility = bp_xprofile_get_meta( $id, 'field', 'default_visibility' );
</span><del>-                        
</del><ins>+
</ins><span class="cx">                         if ( empty( $this-&gt;default_visibility ) ) {
</span><span class="cx">                                 $this-&gt;default_visibility = 'public';
</span><span class="cx">                         }
</span><del>-                        
</del><ins>+
</ins><span class="cx">                         $this-&gt;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-&gt;type != $type ) { 
</del><ins>+                        if ( $this-&gt;type != $type ) {
</ins><span class="cx">                                 $class = 'display: none;';
</span><span class="cx">                         }
</span><del>-                        
</del><ins>+
</ins><span class="cx">                         if ( empty( $this-&gt;default_visibility ) ) {
</span><span class="cx">                                 $this-&gt;default_visibility = 'public';
</span><span class="cx">                         }
</span><span class="lines">@@ -886,26 +886,26 @@
</span><span class="cx">                                         &lt;?php if ( 1 != $this-&gt;id ) : ?&gt;
</span><span class="cx"> 
</span><span class="cx">                                                 &lt;div id=&quot;titlediv&quot;&gt;
</span><del>-                                                        
</del><ins>+
</ins><span class="cx">                                                         &lt;div id=&quot;titlewrap&quot;&gt;
</span><span class="cx">                                                                 &lt;h3&gt;&lt;label for=&quot;default-visibility&quot;&gt;&lt;?php _e( &quot;Default Visibility&quot;, 'buddypress' ); ?&gt;&lt;/label&gt;&lt;/h3&gt;
</span><span class="cx">                                                                 &lt;ul&gt;
</span><span class="cx">                                                                 &lt;?php foreach( bp_xprofile_get_visibility_levels() as $level ) : ?&gt;
</span><del>-                                                                        &lt;li&gt;&lt;input type=&quot;radio&quot; name=&quot;default-visibility&quot; value=&quot;&lt;?php echo esc_attr( $level['id'] ) ?&gt;&quot; &lt;?php checked( $this-&gt;default_visibility, $level['id'] ) ?&gt;&gt; &lt;?php echo esc_html( $level['label'] ) ?&gt;&lt;/li&gt; 
</del><ins>+                                                                        &lt;li&gt;&lt;input type=&quot;radio&quot; name=&quot;default-visibility&quot; value=&quot;&lt;?php echo esc_attr( $level['id'] ) ?&gt;&quot; &lt;?php checked( $this-&gt;default_visibility, $level['id'] ) ?&gt;&gt; &lt;?php echo esc_html( $level['label'] ) ?&gt;&lt;/li&gt;
</ins><span class="cx">                                                                 &lt;?php endforeach ?&gt;
</span><span class="cx">                                                                 &lt;/ul&gt;
</span><span class="cx">                                                         &lt;/div&gt;
</span><del>-                                                        
</del><ins>+
</ins><span class="cx">                                                         &lt;div id=&quot;titlewrap&quot;&gt;
</span><span class="cx">                                                                 &lt;h3&gt;&lt;label for=&quot;allow-custom-visibility&quot;&gt;&lt;?php _e( &quot;Per-Member Visibility&quot;, 'buddypress' ); ?&gt;&lt;/label&gt;&lt;/h3&gt;
</span><span class="cx">                                                                 &lt;ul&gt;
</span><span class="cx">                                                                         &lt;li&gt;&lt;input type=&quot;radio&quot; name=&quot;allow-custom-visibility&quot; value=&quot;allowed&quot; &lt;?php checked( $this-&gt;allow_custom_visibility, 'allowed' ) ?&gt;&gt; &lt;?php _e( &quot;Let members change the this field's visibility&quot;, 'buddypress' ) ?&gt;&lt;/li&gt;
</span><del>-                                                                        
</del><ins>+
</ins><span class="cx">                                                                         &lt;li&gt;&lt;input type=&quot;radio&quot; name=&quot;allow-custom-visibility&quot; value=&quot;disabled&quot; &lt;?php checked( $this-&gt;allow_custom_visibility, 'disabled' ) ?&gt;&gt; &lt;?php _e( 'Enforce the default visibility for all members', 'buddypress' ) ?&gt;&lt;/li&gt;
</span><span class="cx">                                                                 &lt;/ul&gt;
</span><span class="cx">                                                         &lt;/div&gt;
</span><span class="cx">                                                 &lt;/div&gt;
</span><del>-                                        
</del><ins>+
</ins><span class="cx">                                         &lt;?php endif ?&gt;
</span><span class="cx"> 
</span><span class="cx">                                         &lt;p class=&quot;submit&quot;&gt;
</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-&gt;get_var( $wpdb-&gt;prepare( &quot;SELECT id FROM {$bp-&gt;profile-&gt;table_name_data} WHERE field_id = %d AND user_id = %d&quot;, $field_id, $user_id ) );        
</del><ins>+                        $fielddata_id = $wpdb-&gt;get_var( $wpdb-&gt;prepare( &quot;SELECT id FROM {$bp-&gt;profile-&gt;table_name_data} WHERE field_id = %d AND user_id = %d&quot;, $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-&gt;profile-&gt;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' ) &amp;&amp; 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() &amp;&amp; !is_admin() &amp;&amp; !bp_is_user_profile_edit() &amp;&amp; !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'             =&gt; bp_displayed_user_id(),
</span><span class="cx">                 'profile_group_id'    =&gt; 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'                        =&gt; false,
</span><del>-                        'null_on_required' =&gt; false 
</del><ins>+                        'null_on_required' =&gt; 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-&gt;visibility_level ) ? $field-&gt;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-&gt;visibility_level ) ? $field-&gt;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 = '&lt;ul class=&quot;radio&quot;&gt;';
</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=&quot;checked&quot; ' : '';
</span><del>-                        
</del><ins>+
</ins><span class="cx">                         $html .= '&lt;li&gt;&lt;label for=&quot;see-field_' . esc_attr( $level['id'] ) . '&quot;&gt;&lt;input type=&quot;radio&quot; id=&quot;see-field_' . esc_attr( $level['id'] ) . '&quot; name=&quot;field_' . bp_get_the_profile_field_id() . '_visibility&quot; value=&quot;' . esc_attr( $level['id'] ) . '&quot;' . $checked . ' /&gt; ' . esc_html( $level['label'] ) . '&lt;/label&gt;&lt;/li&gt;';
</span><span class="cx">                 }
</span><del>-                
</del><ins>+
</ins><span class="cx">                 $html .= '&lt;/ul&gt;';
</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"> ?&gt;
</span></span></pre>
</div>
</div>

</body>
</html>