Changeset 4955 for trunk/bp-groups/bp-groups-template.php
- Timestamp:
- 08/09/2011 06:40:20 PM (15 years ago)
- File:
-
- 1 edited
-
trunk/bp-groups/bp-groups-template.php (modified) (17 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/bp-groups/bp-groups-template.php
r4907 r4955 169 169 'total' => ceil( (int)$this->total_group_count / (int)$this->pag_num ), 170 170 'current' => $this->pag_page, 171 'prev_text' => '←',172 'next_text' => '→',171 'prev_text' => _x( '←', 'Group pagination previous text', 'buddypress' ), 172 'next_text' => _x( '→', 'Group pagination next text', 'buddypress' ), 173 173 'mid_size' => 1 174 174 ) ); … … 626 626 $admin_ids = array(); 627 627 628 if ( $group->admins ) { 628 if ( $group->admins ) { 629 629 foreach( $group->admins as $admin ) { 630 630 $admin_ids[] = $admin->user_id; 631 631 } 632 632 } 633 634 if ( 'string' == $format ) 633 634 if ( 'string' == $format ) 635 635 $admin_ids = implode( ',', $admin_ids ); 636 636 637 637 return apply_filters( 'bp_group_admin_ids', $admin_ids ); 638 638 } … … 656 656 $mod_ids = array(); 657 657 658 if ( $group->mods ) { 658 if ( $group->mods ) { 659 659 foreach( $group->mods as $mod ) { 660 660 $mod_ids[] = $mod->user_id; 661 661 } 662 662 } 663 664 if ( 'string' == $format ) 663 664 if ( 'string' == $format ) 665 665 $mod_ids = implode( ',', $mod_ids ); 666 666 667 667 return apply_filters( 'bp_group_mod_ids', $mod_ids ); 668 668 } … … 897 897 * @param obj $group (optional) The group whose status you want to check 898 898 */ 899 function bp_group_show_invite_status_setting( $setting, $group = false ) { 899 function bp_group_show_invite_status_setting( $setting, $group = false ) { 900 900 $group_id = isset( $group->id ) ? $group->id : false; 901 901 902 902 $invite_status = bp_group_get_invite_status( $group_id ); 903 903 904 904 if ( $setting == $invite_status ) 905 905 echo ' checked="checked"'; … … 925 925 function bp_group_get_invite_status( $group_id = false ) { 926 926 global $bp, $groups_template; 927 927 928 928 if ( !$group_id ) { 929 929 if ( isset( $bp->groups->current_group->id ) ) { … … 937 937 } 938 938 } 939 939 940 940 $invite_status = groups_get_groupmeta( $group_id, 'invite_status' ); 941 941 … … 958 958 * @return bool $can_send_invites 959 959 */ 960 function bp_groups_user_can_send_invites( $group_id = false ) { 961 global $bp; 960 function bp_groups_user_can_send_invites( $group_id = false ) { 961 global $bp; 962 962 963 963 $can_send_invites = false; 964 964 $invite_status = false; 965 965 966 966 if ( is_user_logged_in() ) { 967 if ( is_super_admin() ) { 968 // Super admins can always send invitations 967 if ( is_super_admin() ) { 968 // Super admins can always send invitations 969 969 $can_send_invites = true; 970 970 … … 983 983 984 984 switch ( $invite_status ) { 985 case 'admins' : 986 if ( groups_is_user_admin( bp_loggedin_user_id(), $group_id ) ) 985 case 'admins' : 986 if ( groups_is_user_admin( bp_loggedin_user_id(), $group_id ) ) 987 987 $can_send_invites = true; 988 988 break; … … 1002 1002 1003 1003 return apply_filters( 'bp_groups_user_can_send_invites', $can_send_invites, $group_id, $invite_status ); 1004 } 1004 } 1005 1005 1006 1006 /** … … 1669 1669 1670 1670 function bp_groups_group_members_template( $group_id, $per_page, $max, $exclude_admins_mods, $exclude_banned, $exclude ) { 1671 $this->__construct( $group_id, $per_page, $max, $exclude_admins_mods, $exclude_banned, $exclude ); 1672 } 1673 1671 $this->__construct( $group_id, $per_page, $max, $exclude_admins_mods, $exclude_banned, $exclude ); 1672 } 1673 1674 1674 function __construct( $group_id, $per_page, $max, $exclude_admins_mods, $exclude_banned, $exclude ) { 1675 1675 global $bp; … … 2399 2399 $this->__construct( $group_id, $per_page, $max ); 2400 2400 } 2401 2402 2401 2402 2403 2403 function __construct( $group_id, $per_page, $max ) { 2404 2404 2405 2405 global $bp; 2406 2406 … … 2573 2573 2574 2574 function bp_groups_invite_template( $user_id, $group_id ) { 2575 $this->__construct( $user_id, $group_id ); 2576 } 2577 2575 $this->__construct( $user_id, $group_id ); 2576 } 2577 2578 2578 function __construct( $user_id, $group_id ) { 2579 2579 2580 2580 global $bp; 2581 2581 2582 2582 $this->invites = groups_get_invites_for_group( $user_id, $group_id ); 2583 2583 $this->invite_count = count( $this->invites ); … … 2753 2753 function bp_current_group_id() { 2754 2754 echo bp_get_current_group_id(); 2755 } 2755 } 2756 2756 /** 2757 2757 * Returns the ID of the current group … … 2761 2761 * @uses apply_filters() Filter bp_get_current_group_id to modify this output 2762 2762 * 2763 * @return int $current_group_id The id of the current group, if there is one 2763 * @return int $current_group_id The id of the current group, if there is one 2764 2764 */ 2765 2765 function bp_get_current_group_id() { 2766 2766 $current_group = groups_get_current_group(); 2767 2767 2768 2768 $current_group_id = isset( $current_group->id ) ? (int)$current_group->id : 0; 2769 2769 2770 2770 return apply_filters( 'bp_get_current_group_id', $current_group_id, $current_group ); 2771 2771 } … … 2779 2779 function bp_current_group_slug() { 2780 2780 echo bp_get_current_group_slug(); 2781 } 2781 } 2782 2782 /** 2783 2783 * Returns the slug of the current group … … 2787 2787 * @uses apply_filters() Filter bp_get_current_group_slug to modify this output 2788 2788 * 2789 * @return str $current_group_slug The slug of the current group, if there is one 2789 * @return str $current_group_slug The slug of the current group, if there is one 2790 2790 */ 2791 2791 function bp_get_current_group_slug() { 2792 2792 $current_group = groups_get_current_group(); 2793 2793 2794 2794 $current_group_slug = isset( $current_group->slug ) ? $current_group->slug : ''; 2795 2795 2796 2796 return apply_filters( 'bp_get_current_group_slug', $current_group_slug, $current_group ); 2797 2797 } … … 2812 2812 * @uses apply_filters() Filter bp_get_current_group_name to modify this output 2813 2813 * 2814 * @return str The name of the current group, if there is one 2814 * @return str The name of the current group, if there is one 2815 2815 */ 2816 2816 function bp_get_current_group_name() {
Note: See TracChangeset
for help on using the changeset viewer.