echo "\t</tr>\n";
// the main area with the checkboxes or images
foreach ($blog_users as $user_id => $user_name) {
    // ---------------------------------------------------
    // 			RETRIEVING THE PERMISSIONS OF THE USER
    // ---------------------------------------------------
    $current_user_permissions = array();
    $current_user_permissions = get_permissions('user', $user_id);
    echo "\t<tr>\n";
    echo "\t\t<td>\n";
    echo $user_name;
    echo "\t\t</td>\n";
    foreach ($rights_full as $key => $value) {
        echo "\t\t<td align='center'>\n";
        if (in_array($value, $rights_blog)) {
            display_image_matrix_for_blogs($current_user_permissions, $user_id, 'BLOG_' . $blog_id, $value, $inherited_permissions, $course_admin);
        }
        // note: in a later stage this part will be replaced by a function
        // so that we can easily switch between a checkbox approach or an image approach
        // where every click is in fact a change of status. In the checkbox approach you first have to
        // do the changes and then store them by clicking the submit button.
        echo "\t\t</td>\n";
    }
    echo "\t</tr>\n";
}
echo "</table>\n";
echo "</form><br />";
// 			LEGEND
echo '<strong>' . get_lang('Legend') . '</strong><br />';
echo Display::return_icon('wrong.gif') . ' ' . get_lang('UserHasPermissionNot') . '<br />';
echo Display::return_icon('checkbox_on2.gif') . ' ' . get_lang('UserHasPermission') . '<br />';
// the main area with the checkboxes or images
foreach ($blog_users as $user_id => $user_name) {
    // $blog_users contains all the users in this blog
    // ---------------------------------------------------
    // 			RETRIEVING THE PERMISSIONS OF THE USER
    // ---------------------------------------------------
    $current_user_permissions = array();
    $current_user_permissions = get_permissions('user', $user_id);
    echo "\t<tr>\n";
    echo "\t\t<td>\n";
    echo $user_name;
    echo "\t\t</td>\n";
    foreach ($rights_full as $key => $value) {
        echo "\t\t<td align='center'>\n";
        if (in_array($value, $rights_blog)) {
            display_image_matrix_for_blogs($current_user_permissions, $user_id, 'BLOG_' . $blog_id, $value, isset($inherited_permissions) ? $inherited_permissions : null, isset($course_admin) ? $course_admin : null);
        }
        // note: in a later stage this part will be replaced by a function
        // so that we can easily switch between a checkbox approach or an image approach
        // where every click is in fact a change of status. In the checkbox approach you first have to
        // do the changes and then store them by clicking the submit button.
        echo "\t\t</td>\n";
    }
    echo "\t</tr>\n";
}
echo "</table>\n";
echo "</form><br />";
// 			LEGEND
echo '<strong>' . get_lang('Legend') . '</strong><br />';
echo '<img src="../img/wrong.gif" /> ' . get_lang('UserHasPermissionNot') . '<br />';
echo '<img src="../img/checkbox_on2.gif" /> ' . get_lang('UserHasPermission') . '<br />';