diff --git src/bp-templates/bp-nouveau/includes/ajax.php src/bp-templates/bp-nouveau/includes/ajax.php
index aa5281cdb..9b3919fbb 100644
|
|
function bp_nouveau_ajax_object_template_loader() { |
87 | 87 | bp_update_is_directory( true, bp_current_component() ); |
88 | 88 | } |
89 | 89 | |
90 | | // The template part can be overridden by the calling JS function. |
91 | | if ( ! empty( $_POST['template'] ) && 'groups/single/members' === $_POST['template'] && 'group_members' === $object ) { |
92 | | $template_part = 'groups/single/members.php'; |
93 | | } else { |
94 | | $template_part = $object . '/' . $object . '-loop.php'; |
| 90 | // Get the template path based on the 'template' variable via the AJAX request. |
| 91 | $template = isset( $_POST['template'] ) ? wp_unslash( $_POST['template'] ) : ''; |
| 92 | switch ( $template ) { |
| 93 | case 'group_members' : |
| 94 | case 'groups/single/members' : |
| 95 | $template_part = 'groups/single/members-loop.php'; |
| 96 | break; |
| 97 | |
| 98 | case 'group_requests' : |
| 99 | $template_part = 'groups/single/requests-loop.php'; |
| 100 | break; |
| 101 | |
| 102 | case 'member_notifications' : |
| 103 | $template_part = 'members/single/notifications/notifications-loop.php'; |
| 104 | break; |
| 105 | |
| 106 | default : |
| 107 | $template_part = $object . '/' . $object . '-loop.php'; |
| 108 | break; |
95 | 109 | } |
96 | 110 | |
97 | 111 | ob_start(); |
diff --git src/bp-templates/bp-nouveau/js/buddypress-notifications.js src/bp-templates/bp-nouveau/js/buddypress-notifications.js
index a7be8a894..a590eff3e 100644
|
|
window.bp = window.bp || {}; |
100 | 100 | filter : filter, |
101 | 101 | search_terms : search_terms, |
102 | 102 | extras : sort, |
103 | | page : 1, |
104 | | template : 'members/single/notifications/notifications-loop' |
| 103 | page : 1 |
105 | 104 | } ); |
106 | 105 | }, |
107 | 106 | |
diff --git src/bp-templates/bp-nouveau/js/buddypress-nouveau.js src/bp-templates/bp-nouveau/js/buddypress-nouveau.js
index 58b8e2228..3a18bf33c 100644
|
|
window.bp = window.bp || {}; |
326 | 326 | |
327 | 327 | if ( 'friends' === data.object || 'group_members' === data.object ) { |
328 | 328 | data.object = 'members'; |
| 329 | data.template = data.object; |
329 | 330 | } else if ( 'group_requests' === data.object ) { |
330 | 331 | data.object = 'groups'; |
| 332 | data.template = 'group_requests'; |
| 333 | } else if ( 'notifications' === data.object ) { |
| 334 | data.object = 'members'; |
| 335 | data.template = 'member_notifications'; |
331 | 336 | } |
332 | 337 | |
333 | 338 | postdata = $.extend( { |
… |
… |
window.bp = window.bp || {}; |
430 | 435 | extras : extras |
431 | 436 | }; |
432 | 437 | |
433 | | if ( 'group_members' === object ) { |
434 | | $.extend( queryData, { template: 'groups/single/members-loop' } ); |
435 | | } else if ( 'group_requests' === object ) { |
436 | | $.extend( queryData, { template: 'groups/single/requests-loop' } ); |
437 | | } else if ( 'notifications' === object ) { |
438 | | $.extend( queryData, { template: 'members/single/notifications/notifications-loop' } ); |
439 | | } |
440 | | |
441 | 438 | // Populate the object list |
442 | 439 | self.objectRequest( queryData ); |
443 | 440 | } |
… |
… |
window.bp = window.bp || {}; |
617 | 614 | search_terms = $( '#buddypress [data-bp-search="' + object + '"] input[type=search]' ).val(); |
618 | 615 | } |
619 | 616 | |
620 | | // On the Groups Members page, we specify a template |
621 | | if ( 'group_members' === object ) { |
622 | | template = 'groups/single/members-loop'; |
623 | | } |
624 | | |
625 | | // On the Members notifications page, we specify a template |
626 | | if ( 'notifications' === object ) { |
627 | | template = 'members/single/notifications/notifications-loop'; |
628 | | } |
629 | | |
630 | 617 | if ( 'friends' === object ) { |
631 | 618 | object = 'members'; |
632 | 619 | } |
… |
… |
window.bp = window.bp || {}; |
664 | 651 | scope = $( self.objectNavParent + ' [data-bp-object="' + object + '"].selected' ).data( 'bp-scope' ); |
665 | 652 | } |
666 | 653 | |
667 | | if ( 'group_members' === object ) { |
668 | | template = 'groups/single/members-loop'; |
669 | | } |
670 | | |
671 | | if ( 'notifications' === object ) { |
672 | | template = 'members/single/notifications/notifications-loop'; |
673 | | } |
674 | | |
675 | 654 | self.objectRequest( { |
676 | 655 | object : object, |
677 | 656 | scope : scope, |
… |
… |
window.bp = window.bp || {}; |
895 | 874 | page : self.getLinkParams( navLink.prop( 'href' ), pagArg ) || 1 |
896 | 875 | }; |
897 | 876 | |
898 | | if ( 'group_members' === object ) { |
899 | | $.extend( queryData, { template: 'groups/single/members-loop' } ); |
900 | | } else if ( 'group_requests' === object ) { |
901 | | $.extend( queryData, { template: 'groups/single/requests-loop' } ); |
902 | | } else if ( 'notifications' === object ) { |
903 | | $.extend( queryData, { template: 'members/single/notifications/notifications-loop' } ); |
904 | | } |
905 | | |
906 | 877 | // Request the page |
907 | 878 | self.objectRequest( queryData ); |
908 | 879 | } |