MDL-50781 user: do not print useless table cell
authorDan Poltawski <dan@moodle.com>
Tue, 3 Nov 2015 10:51:49 +0000 (10:51 +0000)
committerDan Poltawski <dan@moodle.com>
Tue, 3 Nov 2015 10:51:49 +0000 (10:51 +0000)
Thanks to MaurĂ­cio Severo da Silva for the patch

user/index.php

index 65f6b45..bb6e795 100644 (file)
@@ -224,7 +224,9 @@ if ($mycourses = enrol_get_my_courses()) {
     $controlstable->data[0]->cells[] = $OUTPUT->render($select);
 }
 
-$controlstable->data[0]->cells[] = groups_print_course_menu($course, $baseurl->out(), true);
+if ($groupmenu = groups_print_course_menu($course, $baseurl->out(), true)) {
+    $controlstable->data[0]->cells[] = $groupmenu;
+}
 
 if (!isset($hiddenfields['lastaccess'])) {
     // Get minimum lastaccess for this course and display a dropbox to filter by lastaccess going back this far.