// NOTE: DIT MOET NOG VERDER UITGEWERKT WORDEN
    foreach ($groups_of_user as $group) {
        $this_current_group_role_permissions_of_user = get_roles_permissions('user', $user_id);
        //$inherited_permissions[$tool][]=$permission;
    }
}
echo "<form method=\"post\" action=\"" . str_replace('&', '&amp;', $_SERVER['REQUEST_URI']) . "\">";
// ---------------------------------------------------
// 		DISPLAYING THE ROLES LIST
// ---------------------------------------------------
if (api_get_setting('user_roles') == 'true') {
    // the list of the roles for the user
    echo '<strong>' . get_lang('UserRoles') . '</strong><br />';
    $current_user_course_roles = get_roles('user', $user_id);
    $current_user_platform_roles = get_roles('user', $user_id, 'platform');
    display_role_list($current_user_course_roles, $current_user_platform_roles);
    echo '<br />';
}
// ---------------------------------------------------
// 			DISPLAYING THE MATRIX (user permissions)
// ---------------------------------------------------
echo "<table class=\"data_table\">\n";
// the header
echo "\t<tr>\n";
echo "\t\t<th rowspan=\"2\">" . get_lang('Module') . "</th>\n";
echo "\t\t<th colspan=\"4\">" . get_lang('ArticleManager') . "</th>\n";
echo "\t\t<th colspan=\"3\">" . get_lang('CommentManager') . "</th>\n";
echo "\t\t<th colspan=\"3\">" . get_lang('BlogManager') . "</th>\n";
echo "\t</tr>\n";
// Subheader
echo "\t<tr>\n";
if (api_get_setting('permissions') == 'limited') {
    $header_array = $rights_limited;
}
if (api_get_setting('permissions') == 'full') {
    $header_array = $rights_full;
}
echo "<form method=\"post\" action=\"" . str_replace('&', '&amp;', $_SERVER['REQUEST_URI']) . "\">";
// ---------------------------------------------------
// 		DISPLAYING THE ROLES LIST
// ---------------------------------------------------
if (api_get_setting('group_roles') == 'true') {
    // the list of the roles for the user
    echo '<strong>' . get_lang('GroupRoles') . '</strong><br />';
    $current_group_course_roles = get_roles('group', $group_id);
    $current_group_platform_roles = get_roles('group', $group_id, 'platform');
    display_role_list($current_group_course_roles, $current_group_platform_roles);
    echo '<br />';
}
// ---------------------------------------------------
// 		DISPLAYING THE MATRIX (group permissions)
// ---------------------------------------------------
echo "<table class=\"data_table\">\n";
// the header
echo "\t<tr>\n";
echo "\t\t<th>" . get_lang('Module') . "</th>\n";
foreach ($header_array as $header_key => $header_value) {
    echo "\t\t<th>" . get_lang($header_value) . "</th>\n";
}
echo "\t</tr>\n";
// the main area with the checkboxes or images
foreach ($tool_rights as $tool => $rights) {