Changeset 11876
- Timestamp:
- 03/04/2018 01:59:40 PM (7 years ago)
- Location:
- trunk/src/bp-templates/bp-nouveau
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/bp-templates/bp-nouveau/includes/ajax.php
r11858 r11876 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 93 switch ( $template ) { 94 case 'group_members' : 95 case 'groups/single/members' : 96 $template_part = 'groups/single/members-loop.php'; 97 break; 98 99 case 'group_requests' : 100 $template_part = 'groups/single/requests-loop.php'; 101 break; 102 103 case 'member_notifications' : 104 $template_part = 'members/single/notifications/notifications-loop.php'; 105 break; 106 107 default : 108 $template_part = $object . '/' . $object . '-loop.php'; 109 break; 95 110 } 96 111 -
trunk/src/bp-templates/bp-nouveau/js/buddypress-notifications.js
r11686 r11876 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 }, -
trunk/src/bp-templates/bp-nouveau/js/buddypress-nouveau.js
r11686 r11876 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 … … 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 ); … … 616 613 if ( $( '#buddypress [data-bp-search="' + object + '"] input[type=search]' ).length ) { 617 614 search_terms = $( '#buddypress [data-bp-search="' + object + '"] input[type=search]' ).val(); 618 }619 620 // On the Groups Members page, we specify a template621 if ( 'group_members' === object ) {622 template = 'groups/single/members-loop';623 }624 625 // On the Members notifications page, we specify a template626 if ( 'notifications' === object ) {627 template = 'members/single/notifications/notifications-loop';628 615 } 629 616 … … 663 650 if ( $( self.objectNavParent + ' [data-bp-object]' ).length ) { 664 651 scope = $( self.objectNavParent + ' [data-bp-object="' + object + '"].selected' ).data( 'bp-scope' ); 665 }666 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 652 } 674 653 … … 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 );
Note: See TracChangeset
for help on using the changeset viewer.