$user = array();
        $user[] = $obj->official_code;
        if ($is_western_name_order) {
            $user[] = $obj->firstname;
            $user[] = $obj->lastname;
        } else {
            $user[] = $obj->lastname;
            $user[] = $obj->firstname;
        }
        $user[] = Display::encrypted_mailto_link($obj->email, $obj->email);
        $user[] = $obj->course_status == 5 ? get_lang('Student') : get_lang('Teacher');
        $user[] = '<a href="user_information.php?user_id=' . $obj->user_id . '">' . Display::return_icon('synthese_view.gif', get_lang('UserInfo')) . '</a>';
        $users[] = $user;
    }
    $table = new SortableTableFromArray($users, 0, 20, 'user_table');
    $table->set_additional_parameters(array('code' => $code));
    $table->set_other_tables(array('usage_table', 'class_table'));
    $table->set_header(0, get_lang('OfficialCode'), true);
    if ($is_western_name_order) {
        $table->set_header(1, get_lang('FirstName'), true);
        $table->set_header(2, get_lang('LastName'), true);
    } else {
        $table->set_header(1, get_lang('LastName'), true);
        $table->set_header(2, get_lang('FirstName'), true);
    }
    $table->set_header(3, get_lang('Email'), true);
    $table->set_header(4, get_lang('Status'), true);
    $table->set_header(5, '', false);
    $table->display();
} else {
    echo get_lang('NoUsersInCourse');
        $row[] = '<span style="display:none;">' . $size . '</span>' . $invisibility_span_open . $display_size . $invisibility_span_close;
        //last edit date
        $display_date = format_date(strtotime($id['lastedit_date']));
        $row[] = '<span style="display:none;">' . $id['lastedit_date'] . '</span>' . $invisibility_span_open . $display_date . $invisibility_span_close;
        $sortable_data[] = $row;
    }
} else {
    $sortable_data = array();
    //$table_footer='<div style="text-align:center;"><strong>'.get_lang('NoDocsInFolder').'</strong></div>';
}
$table = new SortableTableFromArray($sortable_data, 4, 10);
$query_vars['curdirpath'] = $curdirpath;
if (isset($_SESSION['_gid'])) {
    $query_vars['gidReq'] = $_SESSION['_gid'];
}
$table->set_additional_parameters($query_vars);
$column = 0;
/*
if ($is_allowed_to_edit AND count($docs_and_folders) > 1) {
	$table->set_header($column++, '', false);
}
*/
$table->set_header($column++, api_htmlentities(get_lang('Type'), ENT_QUOTES));
$table->set_header($column++, api_htmlentities(get_lang('Title'), ENT_QUOTES));
//$column_header[] = array(get_lang('Comment'),true);  => display comment under the document name
$table->set_header($column++, api_htmlentities(get_lang('Size'), ENT_QUOTES));
$table->set_header($column++, api_htmlentities(get_lang('Date'), ENT_QUOTES));
//currently only delete action -> take only DELETE right into account
/*
if (count($docs_and_folders) > 1) {
	if ($is_allowed_to_edit) {
 /**
  * Gets a nice grid in html string
  * @param string grid name (important to create css)
  * @param array header content
  * @param array array with the information to show
  * @param array $paging_options Keys are:
  * 					'per_page_default' = items per page when switching from
  * 										 full-	list to per-page-view
  * 					'per_page' = number of items to show per page
  * 					'page_nr' = The page to display
  * 					'hide_navigation' =  true to hide the navigation
  * @param array $query_vars Additional variables to add in the query-string
  * @param array $form actions Additional variables to add in the query-string
  * @param mixed An array with bool values to know which columns show. i.e:
  *  $visibility_options= array(true, false) we will only show the first column
  * 	Can be also only a bool value. TRUE: show all columns, FALSE: show nothing
  * @param bool  true for sorting data or false otherwise
  * @param array grid classes
  * @return 	string   html grid
  */
 public static function return_sortable_grid($name, $header, $content, $paging_options = array(), $query_vars = null, $form_actions = array(), $visibility_options = true, $sort_data = true, $grid_class = array(), $elementCount = 0)
 {
     $column = 0;
     $default_items_per_page = isset($paging_options['per_page']) ? $paging_options['per_page'] : 20;
     $table = new SortableTableFromArray($content, $column, $default_items_per_page, $name);
     $table->total_number_of_items = intval($elementCount);
     if (is_array($query_vars)) {
         $table->set_additional_parameters($query_vars);
     }
     return $table->display_simple_grid($visibility_options, $paging_options['hide_navigation'], $default_items_per_page, $sort_data, $grid_class);
 }
        $user = array();
        $user[] = $obj->official_code;
        if ($is_western_name_order) {
            $user[] = $obj->firstname;
            $user[] = $obj->lastname;
        } else {
            $user[] = $obj->lastname;
            $user[] = $obj->firstname;
        }
        $user[] = Display::encrypted_mailto_link($obj->email, $obj->email);
        $user[] = $obj->course_status == 5 ? get_lang('Student') : get_lang('Teacher');
        $user[] = '<a href="user_information.php?user_id=' . $obj->user_id . '">' . Display::return_icon('synthese_view.gif', get_lang('UserInfo')) . '</a>';
        $users[] = $user;
    }
    $table = new SortableTableFromArray($users, 0, 20, 'user_table');
    $table->set_additional_parameters(array('code' => $course_info['code']));
    $table->set_other_tables(array('usage_table', 'class_table'));
    $table->set_header(0, get_lang('OfficialCode'), true);
    if ($is_western_name_order) {
        $table->set_header(1, get_lang('FirstName'), true);
        $table->set_header(2, get_lang('LastName'), true);
    } else {
        $table->set_header(1, get_lang('LastName'), true);
        $table->set_header(2, get_lang('FirstName'), true);
    }
    $table->set_header(3, get_lang('Email'), true);
    $table->set_header(4, get_lang('Status'), true);
    $table->set_header(5, '', false);
    $table->display();
} else {
    echo Display::display_warning_message(get_lang('NoUsersInCourse'));