Changeset 5837
- Timestamp:
- 02/24/2012 10:34:38 PM (13 years ago)
- Location:
- trunk
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-members/bp-members-functions.php
r5829 r5837 1051 1051 $current_field = $usermeta["field_{$field_id}"]; 1052 1052 xprofile_set_field_data( $field_id, $user_id, $current_field ); 1053 1054 // Save the visibility level 1055 $visibility_level = !empty( $usermeta['field_' . $field_id . '_visibility'] ) ? $usermeta['field_' . $field_id . '_visibility'] : 'public'; 1056 xprofile_set_field_visibility_level( $field_id, $user_id, $visibility_level ); 1053 1057 } 1054 1058 } … … 1109 1113 if ( !empty( $current_field ) ) 1110 1114 xprofile_set_field_data( $field_id, $user_id, $current_field ); 1115 1116 // Save the visibility level 1117 $visibility_level = !empty( $user['meta']['field_' . $field_id . '_visibility'] ) ? $user['meta']['field_' . $field_id . '_visibility'] : 'public'; 1118 xprofile_set_field_visibility_level( $field_id, $user_id, $visibility_level ); 1111 1119 } 1112 1120 } -
trunk/bp-members/bp-members-screens.php
r5729 r5837 170 170 if ( !empty( $_POST['field_' . $field_id] ) ) 171 171 $usermeta['field_' . $field_id] = $_POST['field_' . $field_id]; 172 173 if ( !empty( $_POST['field_' . $field_id . '_visibility'] ) ) 174 $usermeta['field_' . $field_id . '_visibility'] = $_POST['field_' . $field_id . '_visibility']; 172 175 } 173 176 -
trunk/bp-themes/bp-default/_inc/css/default.css
r5822 r5837 2399 2399 font-size: .9em; 2400 2400 } 2401 body.register div.page ul { 2402 list-style: none; 2403 } -
trunk/bp-themes/bp-default/registration/register.php
r5737 r5837 154 154 155 155 <?php endif; ?> 156 157 <?php if ( bp_current_user_can( 'bp_xprofile_change_field_visibility' ) ) : ?> 158 <div class="field-visibility-settings-toggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>"> 159 <?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">Change</a> 160 </div> 161 162 <div class="field-visibility-settings" id="field-visibility-settings-<?php bp_the_profile_field_id() ?>"> 163 <label for="field-visibility"><?php _e( 'Who can see this field?', 'buddypress' ) ?></label> 164 165 <?php bp_profile_visibility_radio_buttons() ?> 166 167 <a class="field-visibility-settings-close" href="#"><?php _e( 'Close', 'buddypress' ) ?></a> 168 </div> 169 <?php else : ?> 170 <div class="field-visibility-settings-notoggle" id="field-visibility-settings-toggle-<?php bp_the_profile_field_id() ?>"> 171 <?php printf( __( 'This field can be seen by: <span class="current-visibility-level">%s</span>', 'buddypress' ), bp_get_the_profile_field_visibility_level_label() ) ?> 172 </div> 173 <?php endif ?> 174 156 175 157 176 <?php do_action( 'bp_custom_profile_edit_fields' ); ?> -
trunk/bp-xprofile/bp-xprofile-caps.php
r5799 r5837 29 29 switch ( $cap ) { 30 30 case 'bp_xprofile_change_field_visibility' : 31 $caps = array( ' read' );31 $caps = array( 'exist' ); // Must allow for logged-out users during registration 32 32 33 33 // You may pass args manually: $field_id, $profile_user_id … … 48 48 49 49 // Friends don't let friends edit each other's visibility 50 // @todo - This would be a proper map if we used CPTs?51 50 if ( $profile_user_id != bp_displayed_user_id() && !bp_current_user_can( 'bp_moderate' ) ) { 52 51 $caps[] = 'do_not_allow'; -
trunk/bp-xprofile/bp-xprofile-classes.php
r5797 r5837 229 229 } 230 230 } 231 232 if ( $fetch_visibility_level ) {233 $fields = self::fetch_visibility_level( $user_id, $fields );234 }231 } 232 233 if ( $fetch_visibility_level ) { 234 $fields = self::fetch_visibility_level( $user_id, $fields ); 235 235 } 236 236 } -
trunk/bp-xprofile/bp-xprofile-template.php
r5792 r5837 160 160 161 161 // We only need to fetch visibility levels when viewing your own profile 162 if ( bp_is_my_profile() || bp_current_user_can( 'bp_moderate' ) ) {162 if ( bp_is_my_profile() || bp_current_user_can( 'bp_moderate' ) || bp_is_register_page() ) { 163 163 $fetch_visibility_level_default = true; 164 164 } else {
Note: See TracChangeset
for help on using the changeset viewer.