require_variable($id); //course
optional_variable($sort, "lastaccess"); //how to sort students
optional_variable($dir,"DESC"); //how to sort students
- optional_variable($showall,"0"); //show all of the students?
+ optional_variable($showall,""); //show all of the students?
if (! $course = get_record("course", "id", $id)) {
error("Course ID is incorrect");
$count = 0;
foreach ($students as $student) {
$count++;
- if ($showall == "0" and $count > $USER_LARGE_CLASS) {
+ if (!$showall and $count > $USER_LARGE_CLASS) {
break;
}
if ($student->lastaccess) {
$lastaccess = $string->never;
}
- if ($numstudents > $USER_LARGE_CLASS and $showall == "1") { // Don't show pictures
+ if ($showall and $numstudents > $USER_LARGE_CLASS) { // Don't show pictures
$picture = "";
} else {
$picture = print_user_picture($student->id, $course->id, $student->picture, false, true);
}
print_table($table);
- if ($numstudents > $USER_LARGE_CLASS and $showall == "0") {
+ if ($numstudents > $USER_LARGE_CLASS and !$showall) {
$moreinfo->count = $USER_LARGE_CLASS;
$moreinfo->things = strtolower($course->students);
echo "<center><p>".get_string("displayingfirst", "", $moreinfo);