]> git.mjollnir.org Git - moodle.git/commitdiff
user/index: More consistent handling of groups column - MDL-12311
authormartinlanghoff <martinlanghoff>
Fri, 23 Nov 2007 00:23:24 +0000 (00:23 +0000)
committermartinlanghoff <martinlanghoff>
Fri, 23 Nov 2007 00:23:24 +0000 (00:23 +0000)
user/index.php

index 43f2aeda2ab1276c422fbbd23202817eb0942651..58b1a3fe44216d3a446b4620b99abaff2c39d6ec 100644 (file)
     if ($showenroldata) {
         $tablecolumns[] = 'roles';
         $tableheaders[] = get_string('roles');
-        $tablecolumns[] = 'groups';
-        $tableheaders[] = get_string('groups');
-        if (!empty($CFG->enablegroupings)) {
-            $tablecolumns[] = 'groupings';
-            $tableheaders[] = get_string('groupings', 'group');
+        if ($groupmode != 0) {
+            $tablecolumns[] = 'groups';
+            $tableheaders[] = get_string('groups');
+            if (!empty($CFG->enablegroupings)) {
+                $tablecolumns[] = 'groupings';
+                $tableheaders[] = get_string('groupings', 'group');
+            }
         }
     }
 
                         }
                     }
                     $data[] = $rastring; 
-                    if ($course->groupmode != 0) {
+                    if ($groupmode != 0) {
                         // htmlescape with s() and implode the array
                         $data[] = implode(', ', array_map('s',$userlist_extra[$user->id]['group']));
+                        if (!empty($CFG->enablegroupings)) {
+                            $data[] = implode(', ', array_map('s', $userlist_extra[$user->id]['gping']));
+                        }
                     }
-                    if (!empty($CFG->enablegroupings)) {
-                        $data[] = implode(', ', array_map('s', $userlist_extra[$user->id]['gping']));
-                    }
-
                 }
 
                 if ($bulkoperations) {