| 1 |
<?php |
| 2 |
// Exit if accessed directly |
| 3 |
if( ! defined( 'ABSPATH' ) ) exit; |
| 4 |
if( ! WPF()->usergroup->can( 'vm' ) ) exit; |
| 5 |
?> |
| 6 |
|
| 7 |
<div id="wpf-admin-wrap" class="wrap"> |
| 8 |
<?php wpforo_screen_option() ?> |
| 9 |
<div id="icon-users" class="icon32"><br></div> |
| 10 |
<h2 style="padding:30px 0px 0px 0px;line-height: 20px; margin-bottom:15px;"><?php _e( 'Members', 'wpforo' ); ?></h2> |
| 11 |
<?php WPF()->notice->show() ?> |
| 12 |
|
| 13 |
<form method="get"> |
| 14 |
<input type="hidden" name="page" value="<?php echo wpforo_prefix_slug( 'members' ) ?>"> |
| 15 |
<?php WPF()->member->list_table->groups_dropdown() ?> |
| 16 |
<?php WPF()->member->list_table->status_dropdown() ?> |
| 17 |
<input type="submit" value="<?php _e( 'Filter', 'wpforo' ) ?>" class="button button-large"> |
| 18 |
|
| 19 |
<?php WPF()->member->list_table->search_box( 'Search Members', 'wpf-member-search' ) ?> |
| 20 |
</form> |
| 21 |
<br> |
| 22 |
<hr> |
| 23 |
<?php |
| 24 |
$all_count = WPF()->member->get_count(); |
| 25 |
$active_count = WPF()->member->get_count( [ 'p.status' => 'active' ] ); |
| 26 |
$inactive_count = WPF()->member->get_count( [ 'p.status' => 'inactive' ] ); |
| 27 |
$banned_count = WPF()->member->get_count( [ 'p.status' => 'banned' ] ); |
| 28 |
$all_href = admin_url( 'admin.php?page=' . wpforo_prefix_slug( 'members' ) ); |
| 29 |
$active_href = admin_url( 'admin.php?page=' . wpforo_prefix_slug( 'members' ) . '&filter_by_status=active' ); |
| 30 |
$inactive_href = admin_url( 'admin.php?page=' . wpforo_prefix_slug( 'members' ) . '&filter_by_status=inactive' ); |
| 31 |
$banned_href = admin_url( 'admin.php?page=' . wpforo_prefix_slug( 'members' ) . '&filter_by_status=banned' ); |
| 32 |
$all_attr = ''; |
| 33 |
$active_attr = ''; |
| 34 |
$inactive_attr = ''; |
| 35 |
$banned_attr = ''; |
| 36 |
$filter_by_status = WPF()->member->list_table->get_filter_by_status_var(); |
| 37 |
if( $filter_by_status === 'active' ) { |
| 38 |
$active_attr = ' class="current"'; |
| 39 |
} elseif( $filter_by_status === 'inactive' ) { |
| 40 |
$inactive_attr = ' class="current"'; |
| 41 |
} elseif( $filter_by_status === 'banned' ) { |
| 42 |
$banned_attr = ' class="current"'; |
| 43 |
} else { |
| 44 |
$all_attr = ' class="current"'; |
| 45 |
} |
| 46 |
|
| 47 |
?> |
| 48 |
<ul class="subsubsub"> |
| 49 |
<li> |
| 50 |
<a href="<?php echo $all_href ?>" <?php echo $all_attr ?>> |
| 51 |
<?php _e( 'All', 'wpforo' ); ?> |
| 52 |
<span class="count">(<?php echo $all_count; ?>)</span> |
| 53 |
</a> | |
| 54 |
</li> |
| 55 |
<li> |
| 56 |
<a href="<?php echo $active_href ?>" <?php echo $active_attr ?>> |
| 57 |
<?php _e( 'Active', 'wpforo' ); ?> |
| 58 |
<span class="count">(<?php echo $active_count; ?>)</span> |
| 59 |
</a> | |
| 60 |
</li> |
| 61 |
<li> |
| 62 |
<a href="<?php echo $inactive_href ?>" <?php echo $inactive_attr ?>> |
| 63 |
<?php _e( 'Inactive', 'wpforo' ); ?> |
| 64 |
<span class="count">(<?php echo $inactive_count; ?>)</span> |
| 65 |
</a> | |
| 66 |
</li> |
| 67 |
<li> |
| 68 |
<a href="<?php echo $banned_href ?>" <?php echo $banned_attr ?>> |
| 69 |
<?php _e( 'Banned', 'wpforo' ); ?> |
| 70 |
<span class="count">(<?php echo $banned_count; ?>)</span> |
| 71 |
</a> |
| 72 |
</li> |
| 73 |
</ul> |
| 74 |
<!-- Forms are NOT created automatically, so you need to wrap the table in one to use features like bulk actions --> |
| 75 |
<form id="wpf-dashboard-members-page" method="GET"> |
| 76 |
<!-- For plugins, we also need to ensure that the form posts back to our current page --> |
| 77 |
<input type="hidden" name="page" value="<?php echo wpforo_prefix_slug( 'members' ) ?>"> |
| 78 |
<input type="hidden" name="wpfaction" value="bulk_members"> |
| 79 |
|
| 80 |
<!-- Now we can render the completed list table --> |
| 81 |
<?php WPF()->member->list_table->display() ?> |
| 82 |
</form> |
| 83 |
</div> |
| 84 |
|