/<?php 
echo $role_id;
?>
" method="post">
<table class="table" width="100%">
<thead>
<tr>
    <th width="1%">ID</th>
    <th><?php 
echo erTranslationClassLhTranslation::getInstance()->getTranslation('permission/roleassigngroup', 'Title');
?>
</th>
</tr>
</thead>
<?php 
foreach (erLhcoreClassGroupRole::getRoleNotAssignedGroups($role_id) as $group) {
    ?>
    <tr>
        <td><input class="mb0" type="checkbox" name="GroupID[]" value="<?php 
    echo $group['id'];
    ?>
"></td>
        <td><?php 
    echo htmlspecialchars($group['name']);
    ?>
</td>
    </tr>
<?php 
}
?>
</table>
<?php 
include erLhcoreClassDesign::designtpl('lhkernel/csfr_token.tpl.php');
?>

<table class="lentele" cellpadding="0" cellspacing="0" width="100%">
<thead>
<tr>
    <th width="1%">ID</th>
    <th><?php 
echo erTranslationClassLhTranslation::getInstance()->getTranslation('permission/groupassignrole', 'Title');
?>
</th>
</tr>
</thead>
<?php 
foreach (erLhcoreClassGroupRole::getGroupNotAssignedRoles($group_id) as $role) {
    ?>
    <tr>
        <td><input type="checkbox" name="RoleID[]" value="<?php 
    echo $role['id'];
    ?>
"></td>
        <td><?php 
    echo htmlspecialchars($role['name']);
    ?>
</td>
    </tr>
<?php 
}
?>
</table>
    if (!isset($_POST['csfr_token']) || !$currentUser->validateCSFRToken($_POST['csfr_token'])) {
        erLhcoreClassModule::redirect('user/userlist');
        exit;
    }
    foreach ($_POST['AssignedID'] as $AssignedID) {
        $group_user = erLhcoreClassModelGroupUser::fetch($AssignedID);
        $group_user->removeThis();
    }
}
if (isset($_POST['Remove_role_from_group']) && isset($_POST['AssignedID']) && count($_POST['AssignedID']) > 0) {
    if (!isset($_POST['csfr_token']) || !$currentUser->validateCSFRToken($_POST['csfr_token'])) {
        erLhcoreClassModule::redirect('user/userlist');
        exit;
    }
    foreach ($_POST['AssignedID'] as $AssignedID) {
        erLhcoreClassGroupRole::deleteGroupRole($AssignedID);
    }
}
$pages = new lhPaginator();
$pages->items_total = erLhcoreClassModelGroupUser::getCount(array('filter' => array('group_id' => $Group->id)));
$pages->setItemsPerPage(20);
$pages->serverURL = erLhcoreClassDesign::baseurl('user/editgroup') . '/' . $Group->id;
$pages->paginate();
$tpl->set('pages', $pages);
if ($pages->items_total > 0) {
    $tpl->set('users', erLhcoreClassModelGroupUser::getList(array('filter' => array('group_id' => $Group->id), 'offset' => $pages->low, 'limit' => $pages->items_per_page)));
} else {
    $tpl->set('users', array());
}
if (isset($_GET['adduser'])) {
    $tpl->set('adduser', 'true');
" method="post">
	<?php 
include erLhcoreClassDesign::designtpl('lhkernel/csfr_token.tpl.php');
?>
	<table class="table">
	<thead>
	<tr>
	     <th width="1%">&nbsp;</th>
	     <th><?php 
echo erTranslationClassLhTranslation::getInstance()->getTranslation('permission/editrole', 'Title');
?>
</th>
	</tr>
	</thead>
	     <?php 
foreach (erLhcoreClassGroupRole::getRoleGroups($role->id) as $Group) {
    ?>
	     <tr>
		     <td><input class="mb0" type="checkbox" name="AssignedID[]" value="<?php 
    echo $Group['assigned_id'];
    ?>
" /></td>
		     <td><?php 
    echo htmlspecialchars($Group['name']);
    ?>
</td>
	     </tr>
	     <?php 
}
?>
	</table>
<?php 
include erLhcoreClassDesign::designtpl('lhkernel/csfr_token.tpl.php');
?>

<table class="lentele" cellpadding="0" cellspacing="0">
<thead>
<tr>
    <th>&nbsp;</th>
    <th><?php 
echo erTranslationClassLhTranslation::getInstance()->getTranslation('user/editgroup', 'Name');
?>
</th>
</tr>
</thead>
<?php 
foreach (erLhcoreClassGroupRole::getGroupRoles($group->id) as $UserAssigned) {
    ?>
<tr>
    <td><input type="checkbox" name="AssignedID[]" value="<?php 
    echo $UserAssigned['assigned_id'];
    ?>
" /></td>
    <td><?php 
    echo htmlspecialchars($UserAssigned['name']);
    ?>
</td>
</tr>
<?php 
}
?>
</table>