--- C:/Users/jmlsteele/AppData/Local/Temp/overv-rev651.svn000.tmp.php Wed Dec 21 18:38:07 2011 +++ C:/Users/jmlsteele/AppData/Local/Temp/overv-rev652.svn000.tmp.php Tue Apr 17 12:35:18 2012 @@ -12,0 +13 @@ +require_once($CFG->dirroot . '/group/lib.php'); @@ -49,0 +51,3 @@ +// Get all the users in this course that can join groups +$allMembers = groups_get_potential_members($courseid); + @@ -62 +66 @@ -if ($groupid) { +if ($groupid && $groupid != -1) { @@ -84,0 +89,3 @@ + unset($allMembers[$row->userid]); + if ($groupid && $groupid != $row->groupid) continue; + if ($groupingid && $groupingid != $row->groupingid) continue; @@ -102 +109 @@ - +$members[-1][-1]=$allMembers; @@ -133,0 +141 @@ +$options[-1] = get_string('none'); @@ -161,6 +169,12 @@ - $name = print_group_picture($groups[$gpid], $course->id, false, true, false) . format_string($groups[$gpid]->name); - $description = file_rewrite_pluginfile_urls($groups[$gpid]->description, 'pluginfile.php', $context->id, 'group', 'description', $gpid); - $options = new stdClass; - $options->noclean = true; - $options->overflowdiv = true; - $jsdescription = trim(format_text($description, $groups[$gpid]->descriptionformat, $options)); + if ($gpid == -1) { + $name = get_string('nogroupsassigned','group'); + $description = ""; + $jsdescription = ""; + } else { + $name = print_group_picture($groups[$gpid], $course->id, false, true, false) . format_string($groups[$gpid]->name); + $description = file_rewrite_pluginfile_urls($groups[$gpid]->description, 'pluginfile.php', $context->id, 'group', 'description', $gpid); + $options = new stdClass; + $options->noclean = true; + $options->overflowdiv = true; + $jsdescription = trim(format_text($description, $groups[$gpid]->descriptionformat, $options)); + }