Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
02/15/2012 08:44:52 PM (13 years ago)
Author:
boonebgorges
Message:

Changes 'privacy' to 'visibility' throughout, when referencing xprofile fields. See #3695. Props DJPaul.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-xprofile/bp-xprofile-template.php

    r5789 r5792  
    2525    var $user_id;
    2626
    27     function __construct( $user_id, $profile_group_id, $hide_empty_groups = false, $fetch_fields = false, $fetch_field_data = false, $exclude_groups = false, $exclude_fields = false, $hide_empty_fields = false, $fetch_privacy_level = false ) {
     27    function __construct( $user_id, $profile_group_id, $hide_empty_groups = false, $fetch_fields = false, $fetch_field_data = false, $exclude_groups = false, $exclude_fields = false, $hide_empty_fields = false, $fetch_visibility_level = false ) {
    2828        $this->groups = BP_XProfile_Group::get( array(
    2929            'profile_group_id'    => $profile_group_id,
     
    3333            'fetch_fields'        => $fetch_fields,
    3434            'fetch_field_data'    => $fetch_field_data,
    35             'fetch_privacy_level' => $fetch_privacy_level,
     35            'fetch_visibility_level' => $fetch_visibility_level,
    3636            'exclude_groups'      => $exclude_groups,
    3737            'exclude_fields'      => $exclude_fields
     
    159159    $hide_empty_fields_default = ( !is_network_admin() && !is_admin() && !bp_is_user_profile_edit() && !bp_is_register_page() );
    160160   
    161     // We only need to fetch privacy levels when viewing your own profile
     161    // We only need to fetch visibility levels when viewing your own profile
    162162    if ( bp_is_my_profile() || bp_current_user_can( 'bp_moderate' ) ) {
    163         $fetch_privacy_level_default = true;
     163        $fetch_visibility_level_default = true;
    164164    } else {
    165         $fetch_privacy_level_default = false;
     165        $fetch_visibility_level_default = false;
    166166    }
    167167   
     
    173173        'fetch_fields'        => true,
    174174        'fetch_field_data'    => true,
    175         'fetch_privacy_level' => $fetch_privacy_level_default,
     175        'fetch_visibility_level' => $fetch_visibility_level_default,
    176176        'exclude_groups'      => false, // Comma-separated list of profile field group IDs to exclude
    177177        'exclude_fields'      => false  // Comma-separated list of profile field IDs to exclude
     
    181181    extract( $r, EXTR_SKIP );
    182182
    183     $profile_template = new BP_XProfile_Data_Template( $user_id, $profile_group_id, $hide_empty_groups, $fetch_fields, $fetch_field_data, $exclude_groups, $exclude_fields, $hide_empty_fields, $fetch_privacy_level );
     183    $profile_template = new BP_XProfile_Data_Template( $user_id, $profile_group_id, $hide_empty_groups, $fetch_fields, $fetch_field_data, $exclude_groups, $exclude_fields, $hide_empty_fields, $fetch_visibility_level );
    184184    return apply_filters( 'bp_has_profile', $profile_template->has_groups(), $profile_template );
    185185}
     
    708708
    709709/**
    710  * Echo the privacy level of this field
     710 * Echo the visibility level of this field
    711711 */
    712 function bp_the_profile_field_privacy_level() {
    713     echo bp_get_the_profile_field_privacy_level();
     712function bp_the_profile_field_visibility_level() {
     713    echo bp_get_the_profile_field_visibility_level();
    714714}
    715715    /**
    716      * Return the privacy level of this field
     716     * Return the visibility level of this field
    717717     */
    718     function bp_get_the_profile_field_privacy_level() {
     718    function bp_get_the_profile_field_visibility_level() {
    719719        global $field;
    720720       
    721         $retval = !empty( $field->privacy_level ) ? $field->privacy_level : 'public';
     721        $retval = !empty( $field->visibility_level ) ? $field->visibility_level : 'public';
    722722       
    723         return apply_filters( 'bp_get_the_profile_field_privacy_level', $retval );
     723        return apply_filters( 'bp_get_the_profile_field_visibility_level', $retval );
    724724    }
    725725
    726726/**
    727  * Echo the privacy level label of this field
     727 * Echo the visibility level label of this field
    728728 */
    729 function bp_the_profile_field_privacy_level_label() {
    730     echo bp_get_the_profile_field_privacy_level_label();
     729function bp_the_profile_field_visibility_level_label() {
     730    echo bp_get_the_profile_field_visibility_level_label();
    731731}
    732732    /**
    733      * Return the privacy level label of this field
     733     * Return the visibility level label of this field
    734734     */
    735     function bp_get_the_profile_field_privacy_level_label() {
     735    function bp_get_the_profile_field_visibility_level_label() {
    736736        global $field;
    737737       
    738         $level  = !empty( $field->privacy_level ) ? $field->privacy_level : 'public';
    739         $fields = bp_xprofile_get_privacy_levels();
     738        $level  = !empty( $field->visibility_level ) ? $field->visibility_level : 'public';
     739        $fields = bp_xprofile_get_visibility_levels();
    740740       
    741         return apply_filters( 'bp_get_the_profile_field_privacy_level_label', $fields[$level]['label'] );
     741        return apply_filters( 'bp_get_the_profile_field_visibility_level_label', $fields[$level]['label'] );
    742742    }
    743743
     
    886886
    887887/**
    888  * Echo the field privacy radio buttons
     888 * Echo the field visibility radio buttons
    889889 */
    890 function bp_profile_privacy_radio_buttons() {
    891     echo bp_profile_get_privacy_radio_buttons();
     890function bp_profile_visibility_radio_buttons() {
     891    echo bp_profile_get_visibility_radio_buttons();
    892892}
    893893    /**
    894      * Return the field privacy radio buttons
     894     * Return the field visibility radio buttons
    895895     */
    896     function bp_profile_get_privacy_radio_buttons() {       
     896    function bp_profile_get_visibility_radio_buttons() {       
    897897        $html = '<ul class="radio">';
    898898       
    899         foreach( bp_xprofile_get_privacy_levels() as $level ) {
    900             $checked = $level['id'] == bp_get_the_profile_field_privacy_level() ? ' checked="checked" ' : '';
     899        foreach( bp_xprofile_get_visibility_levels() as $level ) {
     900            $checked = $level['id'] == bp_get_the_profile_field_visibility_level() ? ' checked="checked" ' : '';
    901901           
    902             $html .= '<li><input type="radio" name="field_' . bp_get_the_profile_field_id() . '_privacy" value="' . esc_attr( $level['id'] ) . '"' . $checked . '> ' . esc_html( $level['label'] ) . '</li>';
     902            $html .= '<li><input type="radio" name="field_' . bp_get_the_profile_field_id() . '_visibility" value="' . esc_attr( $level['id'] ) . '"' . $checked . '> ' . esc_html( $level['label'] ) . '</li>';
    903903        }
    904904       
    905905        $html .= '</ul>';
    906906       
    907         return apply_filters( 'bp_profile_get_privacy_radio_buttons', $html );
     907        return apply_filters( 'bp_profile_get_visibility_radio_buttons', $html );
    908908    }
    909909?>
Note: See TracChangeset for help on using the changeset viewer.