コード例 #1
0
//check if maxreports is empty if yes then set to
$maxreports = !empty($maxreports) ? $maxreports : ILP_DEFAULT_LIST_REPORTS;
//set the number of report columns to display
//removed as we no longer need the horizonatal scrolling
//$reports	=	$flextable->limitcols($reports,$maxreports);
//we are going to create headers and columns for all enabled reports
foreach ($reports as $r) {
    $headers[] = $r->name;
    $columns[] = $r->id;
    $nosorting[] = $r->id;
}
$flextable->hoz_string = 'displayingreports';
$headers[] = get_string('lastupdated', 'block_ilp');
$columns[] = 'lastupdated';
$nosorting[] = 'lastupdated';
$flextable->define_fragment('studentlist');
$flextable->collapsible(true);
//define the columns and the headers in the flextable
$flextable->define_columns($columns);
$flextable->define_headers($headers);
$flextable->column_nosort = $nosorting;
$flextable->sortable(true, 'lastname', 'DESC');
$flextable->set_attribute('summary', get_string('studentslist', 'block_ilp'));
$flextable->set_attribute('cellspacing', '0');
$flextable->set_attribute('class', 'generaltable fit');
$flextable->set_attribute('id', "student_listcourse_id={$course_id}tutor={$tutor}status_id={$status_id}");
$flextable->initialbars(true);
$flextable->setup();
if (!empty($course_id)) {
    $users = $dbc->get_course_users($course_id, $group_id);
} else {