Commit 509b8949 authored by lucha's avatar lucha
Browse files

[auto] plugin: buddypress 3.2.0

parent 23745cb8
......@@ -3,7 +3,7 @@
* BP Nouveau Group's edit settings template.
*
* @since 3.0.0
* @version 3.1.0
* @version 3.2.0
*/
?>
......@@ -71,7 +71,7 @@ if ( $group_types ) : ?>
<?php foreach ( $group_types as $type ) : ?>
<div class="checkbox">
<label for="<?php printf( 'group-type-%s', $type->name ); ?>">
<input type="checkbox" name="group-types[]" id="<?php printf( 'group-type-%s', $type->name ); ?>" value="<?php echo esc_attr( $type->name ); ?>" <?php checked( bp_groups_has_group_type( bp_get_current_group_id(), $type->name ) ); ?>/> <?php echo esc_html( $type->labels['name'] ); ?>
<input type="checkbox" name="group-types[]" id="<?php printf( 'group-type-%s', $type->name ); ?>" value="<?php echo esc_attr( $type->name ); ?>" <?php bp_nouveau_group_type_checked( $type ); ?>/> <?php echo esc_html( $type->labels['name'] ); ?>
<?php
if ( ! empty( $type->description ) ) {
printf( '&ndash; %s', '<span class="bp-group-type-desc">' . esc_html( $type->description ) . '</span>' );
......
......@@ -3,7 +3,7 @@
* BuddyPress - Groups Cover Image Header.
*
* @since 3.0.0
* @version 3.1.0
* @version 3.2.0
*/
?>
......@@ -55,12 +55,10 @@
</div><!-- #cover-image-container -->
<?php if ( ! bp_nouveau_groups_front_page_description() ) : ?>
<?php if ( ! empty( bp_nouveau_group_meta()->description ) ) : ?>
<div class="desc-wrap">
<div class="group-description">
<?php echo esc_html( bp_nouveau_group_meta()->description ); ?>
<?php if ( ! bp_nouveau_groups_front_page_description() && bp_nouveau_group_has_meta( 'description' ) ) : ?>
<div class="desc-wrap">
<div class="group-description">
<?php bp_group_description(); ?>
</div><!-- //.group_description -->
</div>
<?php endif; ?>
<?php endif; ?>
......@@ -3,7 +3,7 @@
* BP Nouveau Default group's front template.
*
* @since 3.0.0
* @version 3.0.0
* @version 3.2.0
*/
?>
......@@ -30,7 +30,7 @@
<?php endif; ?>
<?php endif; ?>
<?php if ( bp_nouveau_groups_front_page_description() ) : ?>
<?php if ( bp_nouveau_groups_front_page_description() && bp_nouveau_group_has_meta( 'description' ) ) : ?>
<div class="group-description">
<?php bp_group_description(); ?>
......
......@@ -3,7 +3,7 @@
* BuddyPress - Groups Header
*
* @since 3.0.0
* @version 3.1.0
* @version 3.2.0
*/
?>
......@@ -46,13 +46,11 @@
<?php endif; ?>
<?php if ( ! bp_nouveau_groups_front_page_description() ) { ?>
<?php if ( bp_nouveau_group_meta()->description ) { ?>
<div class="group-description">
<?php echo bp_nouveau_group_meta()->description; ?>
</div><!-- //.group_description -->
<?php } ?>
<?php } ?>
<?php if ( ! bp_nouveau_groups_front_page_description() && bp_nouveau_group_has_meta( 'description' ) ) : ?>
<div class="group-description">
<?php bp_group_description(); ?>
</div><!-- //.group_description -->
<?php endif; ?>
</div><!-- #item-header-content -->
......
......@@ -3,7 +3,7 @@
* Group Members Loop template
*
* @since 3.0.0
* @version 3.0.0
* @version 3.2.0
*/
?>
......@@ -62,9 +62,8 @@
<?php bp_nouveau_group_hook( 'after', 'members_content' ); ?>
<?php else : ?>
<?php else :
bp_nouveau_user_feedback( 'group-members-none' );
bp_nouveau_user_feedback( 'group-members-none' );
<?php
endif;
......@@ -3,7 +3,7 @@
* BuddyPress - Members Activate
*
* @since 3.0.0
* @version 3.1.0
* @version 3.2.0
*/
?>
......@@ -20,18 +20,17 @@
<?php if ( isset( $_GET['e'] ) ) : ?>
<p><?php esc_html_e( 'Your account was activated successfully! Your account details have been sent to you in a separate email.', 'buddypress' ); ?></p>
<?php else : ?>
<p>
<?php
echo esc_html(
sprintf(
__( 'Your account was activated successfully! You can now <a href="%s">log in</a> with the username and password you provided when you signed up.', 'buddypress' ),
wp_login_url( bp_get_root_domain() )
)
);
?>
</p>
<p><?php esc_html_e( 'Your account was activated successfully! You can now log in with the username and password you provided when you signed up.', 'buddypress' ); ?></p>
<?php endif; ?>
<?php
printf(
'<p><a href="%1$s">%2$s</a></p>',
esc_url( wp_login_url( bp_get_root_domain() ) ),
esc_html__( 'Log In', 'buddypress' )
);
?>
<?php else : ?>
<p><?php esc_html_e( 'Please provide a valid activation key.', 'buddypress' ); ?></p>
......
......@@ -3,7 +3,7 @@
* BuddyPress - Members Profile Change Avatar
*
* @since 3.0.0
* @version 3.1.0
* @version 3.2.0
*/
?>
......@@ -15,7 +15,14 @@
<p class="bp-feedback info">
<span class="bp-icon" aria-hidden="true"></span>
<span class="bp-help-text"><?php esc_html_e( 'Your profile photo will be used on your profile and throughout the site. If there is a <a href="https://gravatar.com">Gravatar</a> associated with your account email we will use that, or you can upload an image from your computer.', 'buddypress' ); ?></span>
<span class="bp-help-text">
<?php
/* Translators: %s is used to output the link to the Gravatar site */
printf( esc_html__( 'Your profile photo will be used on your profile and throughout the site. If there is a %s associated with your account email we will use that, or you can upload an image from your computer.', 'buddypress' ),
/* Translators: Url to the Gravatar site, you can use the one for your country eg: https://fr.gravatar.com for French translation */
'<a href="' . esc_url( __( 'https://gravatar.com', 'buddypress' ) ) . '">Gravatar</a>'
); ?>
</span>
</p>
<form action="" method="post" id="avatar-upload-form" class="standard-form" enctype="multipart/form-data">
......@@ -74,7 +81,14 @@
<?php else : ?>
<p class="bp-help-text"><?php esc_html_e( 'Your profile photo will be used on your profile and throughout the site. To change your profile photo, create an account with <a href="https://gravatar.com">Gravatar</a> using the same email address as you used to register with this site.', 'buddypress' ); ?></p>
<p class="bp-help-text">
<?php
/* Translators: %s is used to output the link to the Gravatar site */
printf( esc_html__( 'Your profile photo will be used on your profile and throughout the site. To change your profile photo, create an account with %s using the same email address as you used to register with this site.', 'buddypress' ),
/* Translators: Url to the Gravatar site, you can use the one for your country eg: https://fr.gravatar.com for French translation */
'<a href="' . esc_url( __( 'https://gravatar.com', 'buddypress' ) ) . '">Gravatar</a>'
); ?>
</p>
<?php endif; ?>
......
......@@ -94,6 +94,11 @@
@include box-shadow(inset 0 0 9px $primary-grey);
padding: $pad-med;
text-align: left;
p {
margin: 0;
padding: 0;
}
}
}
} // close groups-header
......
......@@ -2338,6 +2338,11 @@ body.no-js .single-item-header .js-self-profile-button {
text-align: right;
}
.groups-header .desc-wrap .group-description p {
margin: 0;
padding: 0;
}
/**
*-----------------------------------------------------
* @subsection 5.1.2 - Item Header User Accounts
......
......@@ -2338,6 +2338,11 @@ body.no-js .single-item-header .js-self-profile-button {
text-align: left;
}
.groups-header .desc-wrap .group-description p {
margin: 0;
padding: 0;
}
/**
*-----------------------------------------------------
* @subsection 5.1.2 - Item Header User Accounts
......
......@@ -452,7 +452,7 @@ function bp_nouveau_ajax_get_activity_objects() {
}
if ( empty( $response ) ) {
wp_send_json_error( array( 'error' => __( 'No activites were found.', 'buddypress' ) ) );
wp_send_json_error( array( 'error' => __( 'No activities were found.', 'buddypress' ) ) );
} else {
wp_send_json_success( $response );
}
......
......@@ -206,7 +206,7 @@ function bp_nouveau_ajax_joinleave_group() {
break;
case 'groups_leave_group' :
if ( groups_leave_group( $group->id ) ) {
if ( ! groups_leave_group( $group->id ) ) {
$response = array(
'feedback' => sprintf(
'<div class="bp-feedback error"><span class="bp-icon" aria-hidden="true"></span><p>%s</p></div>',
......
......@@ -3,7 +3,7 @@
* Groups Template tags
*
* @since 3.0.0
* @version 3.0.0
* @version 3.2.0
*/
// Exit if accessed directly.
......@@ -1048,14 +1048,22 @@ function bp_nouveau_groups_manage_members_buttons( $args = array() ) {
}
/**
* Does the group has meta.
* Does the group has metas or a specific meta value.
*
* @since 3.0.0
* @since 3.2.0 Adds the $meta_key argument.
*
* @return bool True if the group has meta. False otherwise.
* @param string $meta_key The key of the meta to check the value for.
* @return bool True if the group has meta. False otherwise.
*/
function bp_nouveau_group_has_meta() {
return (bool) bp_nouveau_get_group_meta();
function bp_nouveau_group_has_meta( $meta_key = '' ) {
$group_meta = bp_nouveau_get_group_meta();
if ( ! $meta_key ) {
return (bool) $group_meta;
}
return ! empty( $group_meta[ $meta_key ] );
}
/**
......@@ -1360,3 +1368,23 @@ function bp_nouveau_get_group_description_excerpt( $group = null, $length = null
*/
return apply_filters( 'bp_nouveau_get_group_description_excerpt', bp_create_excerpt( $group->description, $length ), $group );
}
/**
* Output "checked" attribute to determine if the group type should be checked.
*
* @since 3.2.0
*
* @param object $type Group type object. See bp_groups_get_group_type_object().
*/
function bp_nouveau_group_type_checked( $type = null ) {
if ( ! is_object( $type ) ) {
return;
}
// Group creation screen requires a different check.
if ( bp_is_group_create() ) {
checked( true, ! empty( $type->create_screen_checked ) );
} elseif ( bp_is_group() ) {
checked( bp_groups_has_group_type( bp_get_current_group_id(), $type->name ) );
}
}
......@@ -551,7 +551,7 @@ function bp_nouveau_ajax_star_thread_messages() {
if ( 'star' === $action ) {
$error_message = __( 'There was a problem starring your messages. Please try again.', 'buddypress' );
} else {
$error_message = __( 'There was a problem unstarring your messages. Please try agian.', 'buddypress' );
$error_message = __( 'There was a problem unstarring your messages. Please try again.', 'buddypress' );
}
$response = array(
......
......@@ -137,29 +137,6 @@ function bp_nouveau_messages_localize_scripts( $params = array() ) {
return $params;
}
/**
* @since 3.0.0
*/
function bp_nouveau_message_search_form() {
$query_arg = bp_core_get_component_search_query_arg( 'messages' );
$placeholder = bp_get_search_default_text( 'messages' );
$search_form_html = '<form action="" method="get" id="search-messages-form">
<label for="messages_search"><input type="text" name="' . esc_attr( $query_arg ) . '" id="messages_search" placeholder="' . esc_attr( $placeholder ) . '" /></label>
<input type="submit" id="messages_search_submit" name="messages_search_submit" value="' . esc_attr_x( 'Search', 'button', 'buddypress' ) . '" />
</form>';
/**
* Filters the private message component search form.
*
* @since 3.0.0
*
* @param string $search_form_html HTML markup for the message search form.
*/
echo apply_filters( 'bp_nouveau_message_search_form', $search_form_html );
}
add_filter( 'bp_message_search_form', 'bp_nouveau_message_search_form', 10, 1 );
/**
* @since 3.0.0
*/
......
......@@ -61,3 +61,22 @@ function bp_nouveau_messages_member_interface() {
*/
do_action( 'bp_after_member_messages_content' );
}
/**
* Output the Member's messages search form.
*
* @since 3.0.0
* @since 3.2.0 Move the function into Template Tags and use a template part.
*/
function bp_nouveau_message_search_form() {
$search_form_html = bp_buffer_template_part( 'common/js-templates/messages/search-form', null, false );
/**
* Filters the private message component search form.
*
* @since 2.2.0
*
* @param string $search_form_html HTML markup for the message search form.
*/
echo apply_filters( 'bp_message_search_form', $search_form_html );
}
......@@ -3,7 +3,7 @@
* Common template tags
*
* @since 3.0.0
* @version 3.1.0
* @version 3.2.0
*/
// Exit if accessed directly.
......@@ -573,6 +573,10 @@ function bp_nouveau_loop_classes() {
) );
}
if ( ! isset( $bp_nouveau->{$component} ) ) {
$bp_nouveau->{$component} = new stdClass;
}
// Set the global for a later use.
$bp_nouveau->{$component}->loop_layout = $layout_prefs;
}
......@@ -903,8 +907,14 @@ function bp_nouveau_nav_classes() {
$nav_item = $bp_nouveau->current_nav_item;
$classes = array();
if ( 'directory' === $bp_nouveau->displayed_nav && ! empty( $nav_item->li_class ) ) {
$classes = (array) $nav_item->li_class;
if ( 'directory' === $bp_nouveau->displayed_nav ) {
if ( ! empty( $nav_item->li_class ) ) {
$classes = (array) $nav_item->li_class;
}
if ( bp_get_current_member_type() || ( bp_is_groups_directory() && bp_get_current_group_directory_type() ) ) {
$classes[] = 'no-ajax';
}
} elseif ( 'groups' === $bp_nouveau->displayed_nav || 'personal' === $bp_nouveau->displayed_nav ) {
$classes = array( 'bp-' . $bp_nouveau->displayed_nav . '-tab' );
$selected = bp_current_action();
......@@ -1845,14 +1855,29 @@ function bp_nouveau_search_default_text( $text = '', $is_attr = true ) {
* @since 3.0.0
*/
function bp_nouveau_search_form() {
bp_get_template_part( 'common/search/search-form' );
$search_form_html = bp_buffer_template_part( 'common/search/search-form', null, false );
$objects = bp_nouveau_get_search_objects();
if ( empty( $objects['primary'] ) || empty( $objects['secondary'] ) ) {
echo $search_form_html;
return;
}
if ( 'dir' === $objects['primary'] ) {
/**
* Filter here to edit the HTML output of the directory search form.
*
* NB: This will take in charge the following BP Core Components filters
* - bp_directory_members_search_form
* - bp_directory_blogs_search_form
* - bp_directory_groups_search_form
*
* @since 1.9.0
*
* @param string $search_form_html The HTML output for the directory search form.
*/
echo apply_filters( "bp_directory_{$objects['secondary']}_search_form", $search_form_html );
if ( 'activity' === $objects['secondary'] ) {
/**
* Fires before the display of the activity syndication options.
......@@ -1885,13 +1910,46 @@ function bp_nouveau_search_form() {
*/
do_action( 'bp_members_directory_member_sub_types' );
}
} elseif ( 'group' === $objects['primary'] && 'activity' === $objects['secondary'] ) {
/**
* Fires inside the syndication options list, after the RSS option.
*
* @since 1.2.0
*/
do_action( 'bp_group_activity_syndication_options' );
} elseif ( 'group' === $objects['primary'] ) {
if ( 'members' !== $objects['secondary'] ) {
/**
* Filter here to edit the HTML output of the displayed group search form.
*
* @since 3.2.0
*
* @param string $search_form_html The HTML output for the directory search form.
*/
echo apply_filters( "bp_group_{$objects['secondary']}_search_form", $search_form_html );
} else {
/**
* Filters the Members component search form.
*
* @since 1.9.0
*
* @param string $search_form_html HTML markup for the member search form.
*/
echo apply_filters( 'bp_directory_members_search_form', $search_form_html );
}
if ( 'members' === $objects['secondary'] ) {
/**
* Fires at the end of the group members search unordered list.
*
* Part of bp_groups_members_template_part().
*
* @since 1.5.0
*/
do_action( 'bp_members_directory_member_sub_types' );
} elseif ( 'activity' === $objects['secondary'] ) {
/**
* Fires inside the syndication options list, after the RSS option.
*
* @since 1.2.0
*/
do_action( 'bp_group_activity_syndication_options' );
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment