Skip to content

Instantly share code, notes, and snippets.

@ankitagarwal
Created August 23, 2013 08:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ankitagarwal/6316890 to your computer and use it in GitHub Desktop.
Save ankitagarwal/6316890 to your computer and use it in GitHub Desktop.
print_object($cm);
$context = context_module::instance($cm->id);
$aag = has_capability('moodle/site:accessallgroups', $context);
if ($groupmode == VISIBLEGROUPS or $aag) {
$allowedgroups = groups_get_all_groups($cm->course, 0, $cm->groupingid); // any group in grouping
} else {
$allowedgroups = groups_get_all_groups($cm->course, $USER->id, $cm->groupingid); // only assigned groups
}
print_object($allowedgroups);
$activegroup = groups_get_activity_group($cm, true, $allowedgroups);
$groupsmenu = array();
if ((!$allowedgroups or $groupmode == VISIBLEGROUPS or $aag) and !$hideallparticipants and !$cm->groupmembersonly) {
$groupsmenu[0] = get_string('allparticipants');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment