?> </div> <div class="main-column"> <div class="inner-tube"> <div id="group-name"> <h1><a href="<?php bp_group_permalink(); ?> "><?php bp_group_name(); ?> </a></h1> <p class="status"><?php bp_group_type(); ?> </p> </div> <div class="info-group"> <?php if (function_exists('bp_wire_get_post_list')) { ?> <?php bp_wire_get_post_list(bp_get_group_id(), __('Group Wire', 'buddypress'), sprintf(__('The are no wire posts for %s', 'buddypress'), bp_get_group_name()), bp_group_is_member(), true); ?> <?php } ?> </div>
<?php do_action( 'bp_after_group_menu_mods' ) ?> <?php endif; ?> <?php endif; ?> </div><!-- #item-actions --> <div id="item-header-avatar"> <a href="<?php bp_group_permalink() ?>" title="<?php bp_group_name() ?>"> <?php bp_group_avatar() ?> </a> </div><!-- #item-header-avatar --> <div id="item-header-content"> <h2><a href="<?php bp_group_permalink() ?>" title="<?php bp_group_name() ?>"><?php bp_group_name() ?></a></h2> <span class="highlight"><?php bp_group_type() ?></span> <span class="activity"><?php printf( __( 'active %s ago', 'buddypress' ), bp_get_group_last_active() ) ?></span> <?php do_action( 'bp_before_group_header_meta' ) ?> <div id="item-meta"> <?php bp_group_description() ?> <div id="item-buttons"> <?php do_action( 'bp_group_header_actions' ); ?> </div><!-- #item-buttons --> <?php do_action( 'bp_group_header_meta' ) ?> </div> </div><!-- #item-header-content -->
function bp_group_management_admin_main() { /* Group delete requests are sent back to the main page. This handles group deletions */ if (isset($_GET['group_action']) && $_GET['group_action'] == 'delete') { if (!check_admin_referer('bp-group-management-action_group_delete')) { return false; } if (!bp_group_management_delete_group($_GET['id'])) { ?> <div id="message" class="updated fade"><p><?php _e('Sorry, there was an error.', 'bp-group-management'); ?> </p></div> <?php } else { ?> <div id="message" class="updated fade"><p><?php _e('Group deleted.', 'bp-group-management'); ?> </p></div> <?php do_action('groups_group_deleted', $bp->groups->current_group->id); } } ?> <div class="wrap bp-gm-wrap"> <h2><?php _e('Group Management', 'bp-group-management'); ?> </h2> <br /> <?php if (!($options = get_option('bp_gm_settings'))) { $per_page = 10; } else { $per_page = $options['groups_per_page']; } $args = array('type' => 'alphabetical', 'per_page' => $per_page); $order = isset($_GET['order']) ? $_GET['order'] : false; if ($order == 'name') { $args['type'] = 'alphabetical'; } else { if ($order == 'group_id') { $args['type'] = 'newest'; } else { if ($order == 'popular') { $args['type'] = 'popular'; } } } $args['page'] = isset($_GET['grpage']) ? $_GET['grpage'] : 1; if (bp_has_groups($args)) { global $groups_template; ?> <div class="tablenav"> <div class="tablenav-pages"> <span class="displaying-num" id="group-dir-count"> <?php bp_groups_pagination_count(); ?> </span> <span class="page-numbers" id="group-dir-pag"> <?php bp_group_management_pagination_links(); ?> </span> </div> </div> <table width="100%" cellpadding="3" cellspacing="3" class="widefat"> <thead> <tr> <th scope="col" class="check-column"></th> <th scope="col" class="bp-gm-group-id-header"><a href="admin.php?page=bp-group-management&order=group_id"><?php _e('Group ID', 'bp-group-management'); ?> </a></th> <th scope="col"><?php _e('Group avatar', 'bp-group-management'); ?> </th> <th scope="col"><a href="admin.php?page=bp-group-management&order=name"><?php _e('Group Name', 'bp-group-management'); ?> </a></th> <th scope="col"><?php _e('Group type', 'bp-group-management'); ?> </th> <th scope="col"><a href="admin.php?page=bp-group-management&order=group_id"><?php _e('Date Created', 'bp-group-management'); ?> </a></th> <th scope="col"><a href="admin.php?page=bp-group-management&order=popular"><?php _e('Number of Members', 'bp-group-management'); ?> </a></th> <?php do_action('bp_gm_group_column_header'); ?> </tr> </thead> <tbody id="the-list"> <?php while (bp_groups()) { bp_the_group(); ?> <?php $group = $groups_template->group; ?> <tr> <th scope="row" class="check-column"> </th> <th scope="row" class="bp-gm-group-id"> <?php bp_group_id(); ?> </th> <td scope="row" class="bp-gm-avatar"> <a href="admin.php?page=bp-group-management&action=edit&id=<?php bp_group_id(); ?> " class="edit"><?php bp_group_avatar('width=35&height=35'); ?> </a> </td> <td scope="row"> <?php bp_group_name(); ?> <br/> <?php $controlActions = array(); $controlActions[] = '<a href="admin.php?page=bp-group-management&action=edit&id=' . bp_get_group_id() . '" class="edit">' . __('Members', 'bp-group-management') . '</a>'; $controlActions[] = '<a class="delete" href="admin.php?page=bp-group-management&action=delete&id=' . bp_get_group_id() . '">' . __("Delete") . '</a>'; $controlActions[] = '<a href="' . bp_get_group_permalink() . 'admin">' . __('Admin', 'bp-group-management') . '</a>'; $controlActions[] = "<a href='" . bp_get_group_permalink() . "' rel='permalink'>" . __('Visit', 'bp-group-management') . '</a>'; $controlActions = apply_filters('bp_gm_group_action_links', $controlActions); ?> <?php if (count($controlActions)) { ?> <div class="row-actions"> <?php echo implode(' | ', $controlActions); ?> </div> <?php } ?> </td> <td scope="row"> <?php bp_group_type(); ?> </td> <td scope="row"> <?php echo $group->date_created; ?> </td> <td scope="row"> <?php bp_group_total_members(); ?> </td> <?php do_action('bp_gm_group_column_data'); ?> </tr> <?php } ?> </tbody> </table> <div class="tablenav"> <div class="tablenav-pages"> <span class="displaying-num" id="group-dir-count"> <?php bp_groups_pagination_count(); ?> </span> <span class="page-numbers" id="group-dir-pag"> <?php bp_group_management_pagination_links(); ?> </span> </div> </div> <?php } else { ?> You don't have any groups to manage. <?php } ?> <a class="button" id="bp-gm-settings-link" href="admin.php?page=bp-group-management&action=settings"><?php _e('Plugin settings', 'bp-group-management'); ?> </a> </div> <?php }
</div> <div class="item-quote"> <div class="item-desc"><?php bp_group_description_excerpt(); ?></div> <?php do_action( 'bp_directory_groups_item' ); ?> </div> <div class="action"> <?php //do_action( 'bp_directory_groups_actions' ); ?> <div class="meta"> <?php bp_group_type(); ?> / <?php bp_group_member_count(); ?> </div> <?php do_action( 'bp_directory_groups_actions' ); ?> </div> <div class="clear"></div> </div> </li> <?php endwhile; ?> </ul>
function display($page = 1) { global $bp, $groups_template; $parent_template = $groups_template; $hide_button = false; if (isset($_REQUEST['grpage'])) { $page = (int) $_REQUEST['grpage']; } else { if (!is_numeric($page)) { $page = 1; } else { $page = (int) $page; } } /** Respect BuddyPress group creation restriction */ if (function_exists('bp_user_can_create_groups')) { $hide_button = !bp_user_can_create_groups(); } bp_has_groups_hierarchy(array('type' => 'alphabetical', 'parent_id' => $bp->groups->current_group->id, 'page' => $page)); ?> <div class="group"> <?php if (($bp->is_item_admin || $bp->groups->current_group->can_create_subitems) && !$hide_button) { ?> <div class="generic-button group-button"> <a title="<?php printf(__('Create a %s', 'bp-group-hierarchy'), __('Member Group', 'bp-group-hierarchy')); ?> " href="<?php echo $bp->root_domain . '/' . bp_get_groups_root_slug() . '/' . 'create' . '/?parent_id=' . $bp->groups->current_group->id; ?> "><?php printf(__('Create a %s', 'bp-group-hierarchy'), __('Member Group', 'bp-group-hierarchy')); ?> </a> </div><br /><br /> <?php } ?> <?php if ($groups_template && count($groups_template->groups) > 0) { ?> <div id="pag-top" class="pagination"> <div class="pag-count" id="group-dir-count-top"> <?php bp_groups_pagination_count(); ?> </div> <div class="pagination-links" id="group-dir-pag-top"> <?php bp_groups_pagination_links(); ?> </div> </div> <ul id="groups-list" class="item-list"> <?php while (bp_groups()) { bp_the_group(); ?> <?php $subgroup = $groups_template->group; ?> <?php if ($subgroup->status == 'hidden' && !(groups_is_user_member($bp->loggedin_user->id, $subgroup->id) || groups_is_user_admin($bp->loggedin_user->id, $bp->groups->current_group->id))) { continue; } ?> <li id="tree-childof_<?php bp_group_id(); ?> "> <div class="item-avatar"> <a href="<?php bp_group_permalink(); ?> "><?php bp_group_avatar('type=thumb&width=50&height=50'); ?> </a> </div> <div class="item"> <div class="item-title"><a href="<?php bp_group_permalink(); ?> "><?php bp_group_name(); ?> </a></div> <div class="item-meta"><span class="activity"><?php printf(__('active %s', 'buddypress'), bp_get_group_last_active()); ?> </span></div> <div class="item-desc"><?php bp_group_description_excerpt(); ?> </div> <?php do_action('bp_directory_groups_item'); ?> </div> <div class="action"> <?php do_action('bp_directory_groups_actions'); ?> <div class="meta"> <?php bp_group_type(); ?> / <?php bp_group_member_count(); ?> </div> </div> <div class="clear"></div> </li> <?php } ?> </ul> <div id="pag-bottom" class="pagination"> <div class="pag-count" id="group-dir-count-bottom"> <?php bp_groups_pagination_count(); ?> </div> <div class="pagination-links" id="group-dir-pag-bottom"> <?php bp_groups_pagination_links(); ?> </div> </div> <script type="text/javascript"> jQuery('#nav-hierarchy-personal-li').attr('id','group-hierarchy-personal-li'); jQuery('#nav-hierarchy-groups-li').attr('id','group-hierarchy-group-li'); </script> <?php } else { ?> <p><?php _e('No member groups were found.', 'bp-group-hierarchy'); ?> </p> <?php } ?> </div> <?php // reset the $groups_template global and continue with the page $groups_template = $parent_template; }