* This File loads the Groups -> Members Tab
 * It allows to manage the groups members (users) 
 ****************************************************/
require_once dirname(__FILE__) . '/groups-support.php';
$mode = $_REQUEST['mode'];
if ($mode == "update") {
    $group_temp = ScoperAdminLib::get_group($_REQUEST['id']);
    UserGroups_tp::write(sprintf(__('<strong>%s</strong> group membership updated.', 'scoper'), $group_temp->display_name));
}
if ($_REQUEST['id'] == "" && ($mode == "edit" || $mode == "update")) {
    UserGroups_tp::write(__('Invalid group.', 'scoper'));
}
$cancel = $_REQUEST['cancel'];
switch ($cancel) {
    case 1:
        UserGroups_tp::write(__('Group members edit canceled.', 'scoper'));
        break;
    default:
        break;
}
?>

<div class="wrap agp-width97">
<?php 
function printGroupMembers()
{
    $results = ScoperAdminLib::get_all_groups(FILTERED_RS);
    $alt = false;
    if (isset($results) && count($results) > 0) {
        echo "\n<table class='rs-member_table' width=\"100%\" border=\"0\" cellspacing=\"3\" cellpadding=\"3\">";
        echo "\n\t<tr class=\"thead\">";
        ?>
	</table>
	<?php 
    } else {
        echo "<p><strong>" . __('No groups available.', 'scoper') . "</strong></p>";
    }
    ?>
	</div>
<?php 
}
/* endif showing groups list */
?>

<?php 
if ($errorMessage) {
    UserGroups_tp::write($errorMessage, false, "msg");
}
if ($mode != "edit" && ('editSubmit' == $mode || empty($_POST['prevName']))) {
    ?>
	<?php 
    if ($can_manage_all_groups) {
        ?>
		<br /><br />
		<div class="agp-width97 rs-newgroup" id="new">
		<h2><?php 
        _e('Create New Group', 'scoper');
        ?>
</h2>
		<form action="admin.php?page=rs-groups&amp;mode=add#msg" method="post">
		<?php 
        $group_id = 0;