Ticket #1150: 1150.001.diff
File 1150.001.diff, 3.9 KB (added by , 14 years ago) |
---|
-
bp-themes/bp-default/groups/index.php
18 18 19 19 <form action="" method="post" id="groups-directory-form" class="dir-form"> 20 20 21 <h3><?php _e( 'Groups Directory', 'buddypress' ); ?><?php if ( is_user_logged_in() ) : ?> <a class="button" href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create' ); ?>"><?php _e( 'Create a Group', 'buddypress' ); ?></a><?php endif; ?></h3>21 <h3><?php _e( 'Groups Directory', 'buddypress' ); ?><?php if ( is_user_logged_in() && bp_user_can_create_groups() ) : ?> <a class="button" href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() . '/create' ); ?>"><?php _e( 'Create a Group', 'buddypress' ); ?></a><?php endif; ?></h3> 22 22 23 23 <div id="group-dir-search" class="dir-search" role="search"> 24 24 … … 26 26 27 27 </div><!-- #group-dir-search --> 28 28 29 <?php do_action( 'template_notices' ); ?> 30 29 31 <div class="item-list-tabs" role="navigation"> 30 32 <ul> 31 33 <li class="selected" id="groups-all"><a href="<?php echo trailingslashit( bp_get_root_domain() . '/' . bp_get_groups_root_slug() ); ?>"><?php printf( __( 'All Groups (%s)', 'buddypress' ), bp_get_total_group_count() ); ?></a></li> -
bp-core/admin/bp-core-admin.php
183 183 184 184 <?php endif; ?> 185 185 186 <?php if ( bp_is_active( 'groups' ) ) : ?> 187 188 <tr> 189 <th scope="row"><?php _e( 'Restrict group creation to Site Admins?', 'buddypress' ) ?>:</th> 190 <td> 191 <input type="radio" name="bp-admin[bp_restrict_group_creation]"<?php checked( '1', (int)get_site_option( 'bp_restrict_group_creation', '0' ) ); ?>id="bp-restrict-group-creation" value="1" /> <?php _e( 'Yes', 'buddypress' ) ?> 192 <input type="radio" name="bp-admin[bp_restrict_group_creation]"<?php checked( '0', (int)get_site_option( 'bp_restrict_group_creation', '0' ) ); ?>id="bp-restrict-group-creation" value="0" /> <?php _e( 'No', 'buddypress' ) ?> 193 </td> 194 </tr> 195 196 <?php endif; ?> 197 186 198 <?php do_action( 'bp_core_admin_screen_fields' ) ?> 187 199 188 200 </tbody> -
bp-groups/bp-groups-actions.php
19 19 if ( !is_user_logged_in() ) 20 20 return false; 21 21 22 if ( !bp_user_can_create_groups() ) { 23 bp_core_add_message( __( 'Sorry, you are not allowed to create groups.', 'buddypress' ), 'error' ); 24 bp_core_redirect( trailingslashit( bp_get_root_domain() . '/' . $bp->groups->root_slug ) ); 25 } 26 22 27 // Make sure creation steps are in the right order 23 28 groups_action_sort_creation_steps(); 24 29 -
bp-groups/bp-groups-template.php
1724 1724 * Group Creation Process Template Tags 1725 1725 **/ 1726 1726 1727 /** 1728 * Determine if the current logged in user can create groups. 1729 * 1730 * @since BuddyPress {unknown} 1731 * 1732 * @uses apply_filters() To call 'bp_user_can_create_groups'. 1733 * @uses get_site_option() To retrieve value of 'bp_restrict_group_creation'. Defaults to 0. 1734 * @uses is_super_admin() To determine if current user if super admin. 1735 * 1736 * @return bool True if user can create groups. False otherwise. 1737 */ 1738 function bp_user_can_create_groups() { 1739 return apply_filters( 'bp_user_can_create_groups', ( ! (int) get_site_option( 'bp_restrict_group_creation', 0 ) || is_super_admin() ) ); 1740 } 1741 1727 1742 function bp_group_creation_tabs() { 1728 1743 global $bp; 1729 1744