diff --git src/bp-templates/bp-nouveau/buddypress/common/search-and-filters-bar.php src/bp-templates/bp-nouveau/buddypress/common/search-and-filters-bar.php
index 20441b2f3..82b825575 100644
|
|
|
|
| 8 | 8 | ?> |
| 9 | 9 | <div class="subnav-filters filters no-ajax" id="subnav-filters"> |
| 10 | 10 | |
| 11 | | <?php if ( 'friends' !== bp_current_component() ) : ?> |
| | 11 | <?php if ( bp_nouveau_get_component_slug( 'friends' ) !== bp_current_component() ) : ?> |
| 12 | 12 | <div class="subnav-search clearfix"> |
| 13 | 13 | |
| 14 | | <?php if ( 'activity' === bp_current_component() ) : ?> |
| | 14 | <?php if ( bp_nouveau_get_component_slug( 'activity' ) === bp_current_component() ) : ?> |
| 15 | 15 | <div class="feed"><a href="<?php bp_sitewide_activity_feed_link(); ?>" class="bp-tooltip" data-bp-tooltip="<?php esc_attr_e( 'RSS Feed', 'buddypress' ); ?>"><span class="bp-screen-reader-text"><?php esc_html_e( 'RSS', 'buddypress' ); ?></span></a></div> |
| 16 | 16 | <?php endif; ?> |
| 17 | 17 | |
| … |
… |
|
| 22 | 22 | |
| 23 | 23 | <?php if ( bp_is_user() && ! bp_is_current_action( 'requests' ) ) : ?> |
| 24 | 24 | <?php bp_get_template_part( 'common/filters/user-screens-filters' ); ?> |
| 25 | | <?php elseif ( 'groups' === bp_current_component() ) : ?> |
| | 25 | <?php elseif ( bp_nouveau_get_component_slug( 'groups' ) === bp_current_component() ) : ?> |
| 26 | 26 | <?php bp_get_template_part( 'common/filters/groups-screens-filters' ); ?> |
| 27 | 27 | <?php else : ?> |
| 28 | 28 | <?php bp_get_template_part( 'common/filters/directory-filters' ); ?> |
diff --git src/bp-templates/bp-nouveau/includes/functions.php src/bp-templates/bp-nouveau/includes/functions.php
index a4cd20aa8..305b3d664 100644
|
|
|
function bp_nouveau_get_component_filters( $context = '', $component = '' ) {
|
| 535 | 535 | if ( 'directory' === $context || 'user' === $context ) { |
| 536 | 536 | $component = bp_current_component(); |
| 537 | 537 | |
| 538 | | if ( 'friends' === $component ) { |
| | 538 | if ( bp_nouveau_get_component_slug( 'friends' ) === $component ) { |
| 539 | 539 | $context = 'friends'; |
| 540 | 540 | $component = 'members'; |
| 541 | 541 | } |
| … |
… |
function bp_nouveau_get_component_filters( $context = '', $component = '' ) {
|
| 550 | 550 | return $filters; |
| 551 | 551 | } |
| 552 | 552 | |
| 553 | | if ( 'members' === $component ) { |
| | 553 | if ( bp_nouveau_get_component_slug( 'members' ) === $component ) { |
| 554 | 554 | $filters = bp_nouveau_get_members_filters( $context ); |
| 555 | | } elseif ( 'activity' === $component ) { |
| | 555 | } elseif ( bp_nouveau_get_component_slug( 'activity' ) === $component ) { |
| 556 | 556 | $filters = bp_nouveau_get_activity_filters(); |
| 557 | 557 | |
| 558 | 558 | // Specific case for the activity dropdown |
| 559 | 559 | $filters = array_merge( array( '-1' => __( '— Everything —', 'buddypress' ) ), $filters ); |
| 560 | | } elseif ( 'groups' === $component ) { |
| | 560 | } elseif ( bp_nouveau_get_component_slug( 'groups' ) === $component ) { |
| 561 | 561 | $filters = bp_nouveau_get_groups_filters( $context ); |
| 562 | | } elseif ( 'blogs' === $component ) { |
| | 562 | } elseif ( bp_nouveau_get_component_slug( 'blogs' ) === $component ) { |
| 563 | 563 | $filters = bp_nouveau_get_blogs_filters( $context ); |
| 564 | 564 | } |
| 565 | 565 | |
| … |
… |
function bp_nouveau_set_nav_item_order( $nav = null, $order = array(), $parent_s
|
| 1377 | 1377 | |
| 1378 | 1378 | return true; |
| 1379 | 1379 | } |
| | 1380 | |
| | 1381 | function bp_nouveau_get_component_slug( $component_id = '' ) { |
| | 1382 | $slug = ''; |
| | 1383 | |
| | 1384 | if ( ! $component_id ) { |
| | 1385 | return $slug; |
| | 1386 | } |
| | 1387 | |
| | 1388 | $component_id = sanitize_key( $component_id ); |
| | 1389 | |
| | 1390 | if ( bp_is_active( $component_id ) ) { |
| | 1391 | $slug = call_user_func( 'bp_get_' . $component_id . '_slug' ); |
| | 1392 | } elseif ( defined( 'BP_' . strtoupper( $component_id ) . '_SLUG' ) ) { |
| | 1393 | $slug = constant( 'BP_' . strtoupper( $component_id ) . '_SLUG' ); |
| | 1394 | } else { |
| | 1395 | $slug = $component_id; |
| | 1396 | } |
| | 1397 | |
| | 1398 | return $slug; |
| | 1399 | } |
diff --git src/bp-templates/bp-nouveau/includes/template-tags.php src/bp-templates/bp-nouveau/includes/template-tags.php
index 8662aa552..bd5d6524f 100644
|
|
|
function bp_nouveau_current_object() {
|
| 1989 | 1989 | |
| 1990 | 1990 | } else { |
| 1991 | 1991 | $data_filter = bp_current_component(); |
| 1992 | | if ( 'friends' === $data_filter && bp_is_user_friend_requests() ) { |
| 1993 | | $data_filter = 'friend_requests'; |
| | 1992 | if ( bp_nouveau_get_component_slug( 'friends' ) === $data_filter ) { |
| | 1993 | $data_filter = 'friends'; |
| | 1994 | |
| | 1995 | if ( bp_is_user_friend_requests() ) { |
| | 1996 | $data_filter = 'friend_requests'; |
| | 1997 | } |
| 1994 | 1998 | } |
| 1995 | 1999 | |
| 1996 | 2000 | $component['members_select'] = 'members-order-select'; |
| … |
… |
function bp_nouveau_filter_container_id() {
|
| 2022 | 2026 | $component = bp_nouveau_current_object(); |
| 2023 | 2027 | |
| 2024 | 2028 | $ids = array( |
| 2025 | | 'members' => $component['members_select'], |
| 2026 | | 'friends' => 'members-friends-select', |
| 2027 | | 'notifications' => 'notifications-filter-select', |
| 2028 | | 'activity' => 'activity-filter-select', |
| 2029 | | 'groups' => 'groups-order-select', |
| 2030 | | 'blogs' => 'blogs-order-select', |
| | 2029 | bp_nouveau_get_component_slug( 'members' ) => $component['members_select'], |
| | 2030 | bp_nouveau_get_component_slug( 'friends' ) => 'members-friends-select', |
| | 2031 | bp_nouveau_get_component_slug( 'notifications' ) => 'notifications-filter-select', |
| | 2032 | bp_nouveau_get_component_slug( 'activity' ) => 'activity-filter-select', |
| | 2033 | bp_nouveau_get_component_slug( 'groups' ) => 'groups-order-select', |
| | 2034 | bp_nouveau_get_component_slug( 'blogs' ) => 'blogs-order-select', |
| 2031 | 2035 | ); |
| 2032 | 2036 | |
| 2033 | 2037 | if ( isset( $ids[ $component['object'] ] ) ) { |
| … |
… |
function bp_nouveau_filter_id() {
|
| 2065 | 2069 | $component = bp_nouveau_current_object(); |
| 2066 | 2070 | |
| 2067 | 2071 | $ids = array( |
| 2068 | | 'members' => $component['members_order_by'], |
| 2069 | | 'friends' => 'members-friends', |
| 2070 | | 'notifications' => 'notifications-filter-by', |
| 2071 | | 'activity' => 'activity-filter-by', |
| 2072 | | 'groups' => 'groups-order-by', |
| 2073 | | 'blogs' => 'blogs-order-by', |
| | 2072 | bp_nouveau_get_component_slug( 'members' ) => $component['members_order_by'], |
| | 2073 | bp_nouveau_get_component_slug( 'friends' ) => 'members-friends', |
| | 2074 | bp_nouveau_get_component_slug( 'notifications' ) => 'notifications-filter-by', |
| | 2075 | bp_nouveau_get_component_slug( 'activity' ) => 'activity-filter-by', |
| | 2076 | bp_nouveau_get_component_slug( 'groups' ) => 'groups-order-by', |
| | 2077 | bp_nouveau_get_component_slug( 'blogs' ) => 'blogs-order-by', |
| 2074 | 2078 | ); |
| 2075 | 2079 | |
| 2076 | 2080 | if ( isset( $ids[ $component['object'] ] ) ) { |
| … |
… |
function bp_nouveau_filter_label() {
|
| 2108 | 2112 | $component = bp_nouveau_current_object(); |
| 2109 | 2113 | $label = __( 'Order By:', 'buddypress' ); |
| 2110 | 2114 | |
| 2111 | | if ( 'activity' === $component['object'] || 'friends' === $component['object'] ) { |
| | 2115 | if ( bp_nouveau_get_component_slug( 'activity' ) === $component['object'] || bp_nouveau_get_component_slug( 'friends' ) === $component['object'] ) { |
| 2112 | 2116 | $label = __( 'Show:', 'buddypress' ); |
| 2113 | 2117 | } |
| 2114 | 2118 | |
| … |
… |
function bp_nouveau_filter_options() {
|
| 2152 | 2156 | function bp_nouveau_get_filter_options() { |
| 2153 | 2157 | $output = ''; |
| 2154 | 2158 | |
| 2155 | | if ( 'notifications' === bp_current_component() ) { |
| | 2159 | if ( bp_nouveau_get_component_slug( 'notifications' ) === bp_current_component() ) { |
| 2156 | 2160 | $output = bp_nouveau_get_notifications_filters(); |
| 2157 | 2161 | |
| 2158 | 2162 | } else { |