Home
Documentation
Downloads
Demo
Tracker
Development
Translation
Moodle.net
Search
projects
/
moodle.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3fdc622
)
MDL-28450 prefer member group for default
author
Petr Skoda
<commits@skodak.org>
Sun, 7 Aug 2011 11:04:04 +0000
(13:04 +0200)
committer
Petr Skoda
<commits@skodak.org>
Sun, 7 Aug 2011 11:06:45 +0000
(13:06 +0200)
lib/grouplib.php
patch
|
blob
|
blame
|
history
diff --git
a/lib/grouplib.php
b/lib/grouplib.php
index
120de12
..
708d242
100644
(file)
--- a/
lib/grouplib.php
+++ b/
lib/grouplib.php
@@
-717,7
+717,7
@@
function groups_course_module_visible($cm, $userid=null) {
* @return void
*/
function _group_verify_activegroup($courseid, $groupmode, $groupingid, array $allowedgroups) {
* @return void
*/
function _group_verify_activegroup($courseid, $groupmode, $groupingid, array $allowedgroups) {
- global $SESSION;
+ global $SESSION
, $USER
;
// init activegroup array if necessary
if (!isset($SESSION->activegroup)) {
// init activegroup array if necessary
if (!isset($SESSION->activegroup)) {
@@
-742,7
+742,11
@@
function _group_verify_activegroup($courseid, $groupmode, $groupingid, array $al
$SESSION->activegroup[$courseid][$groupmode][$groupingid] = 0; // all groups by default if user has accessallgroups
} else if ($allowedgroups) {
$SESSION->activegroup[$courseid][$groupmode][$groupingid] = 0; // all groups by default if user has accessallgroups
} else if ($allowedgroups) {
- $firstgroup = reset($allowedgroups);
+ if ($groupmode != SEPARATEGROUPS and $mygroups = groups_get_all_groups($courseid, $USER->id, $groupingid)) {
+ $firstgroup = reset($mygroups);
+ } else {
+ $firstgroup = reset($allowedgroups);
+ }
$SESSION->activegroup[$courseid][$groupmode][$groupingid] = $firstgroup->id;
} else {
$SESSION->activegroup[$courseid][$groupmode][$groupingid] = $firstgroup->id;
} else {