MDL-21009 Group selector must use absolute links in order to work with javascript off
This commit is contained in:
+9
-1
@@ -418,7 +418,7 @@ function groups_print_course_menu($course, $urlroot, $return=false) {
|
||||
* Print group menu selector for activity.
|
||||
* @param object $cm course module object
|
||||
* @param string $urlroot return address that users get to if they choose an option;
|
||||
* should include any parameters needed, e.g. 'view.php?id=34'
|
||||
* should include any parameters needed, e.g. "$CFG->wwwroot/mod/forum/view.php?id=34"
|
||||
* @param boolean $return return as string instead of printing
|
||||
* @param boolean $hideallparticipants If true, this prevents the 'All participants'
|
||||
* option from appearing in cases where it normally would. This is intended for
|
||||
@@ -431,6 +431,14 @@ function groups_print_course_menu($course, $urlroot, $return=false) {
|
||||
function groups_print_activity_menu($cm, $urlroot, $return=false, $hideallparticipants=false) {
|
||||
global $CFG, $USER, $SESSION;
|
||||
|
||||
// Display error if urlroot is not absolute (this causes the non-JS version
|
||||
// to break)
|
||||
if (strpos($urlroot, 'htxtp') !== 0) { // Will also work for https
|
||||
debugging('groups_print_activity_menu requires absolute URL for ' .
|
||||
'$urlroot, not <tt>' . s($urlroot) . '</tt>. Example: ' .
|
||||
'groups_print_activity_menu($cm, $CFG->wwwroot . \'/mod/mymodule/view.php?id=13\');',
|
||||
DEBUG_DEVELOPER);
|
||||
}
|
||||
// groupings are ignored when not enabled
|
||||
if (empty($CFG->enablegroupings)) {
|
||||
$cm->groupingid = 0;
|
||||
|
||||
@@ -140,7 +140,7 @@ class assignment_base {
|
||||
true, update_module_button($this->cm->id, $this->course->id, $this->strassignment),
|
||||
navmenu($this->course, $this->cm));
|
||||
|
||||
groups_print_activity_menu($this->cm, 'view.php?id=' . $this->cm->id);
|
||||
groups_print_activity_menu($this->cm, $CFG->wwwroot . '/mod/assignment/view.php?id=' . $this->cm->id);
|
||||
|
||||
echo '<div class="reportlink">'.$this->submittedlink().'</div>';
|
||||
echo '<div class="clearer"></div>';
|
||||
@@ -1065,7 +1065,7 @@ class assignment_base {
|
||||
/// find out current groups mode
|
||||
$groupmode = groups_get_activity_groupmode($cm);
|
||||
$currentgroup = groups_get_activity_group($cm, true);
|
||||
groups_print_activity_menu($cm, 'submissions.php?id=' . $this->cm->id);
|
||||
groups_print_activity_menu($cm, $CFG->wwwroot . '/mod/assignment/submissions.php?id=' . $this->cm->id);
|
||||
|
||||
/// Get all ppl that are allowed to submit assignments
|
||||
if ($users = get_users_by_capability($context, 'mod/assignment:submit', 'u.id', '', '', '', $currentgroup, '', false)) {
|
||||
|
||||
+2
-2
@@ -46,7 +46,7 @@
|
||||
/// Check to see if groups are being used here
|
||||
$groupmode = groups_get_activity_groupmode($cm);
|
||||
$currentgroup = groups_get_activity_group($cm, true);
|
||||
groups_print_activity_menu($cm, "report.php?id=$cm->id");
|
||||
groups_print_activity_menu($cm, $CFG->wwwroot . "/mod/chat/report.php?id=$cm->id");
|
||||
|
||||
|
||||
if ($currentgroup) {
|
||||
@@ -99,7 +99,7 @@
|
||||
/// Check to see if groups are being used here
|
||||
if ($groupmode = groups_get_activity_groupmode($cm)) { // Groups are being used
|
||||
$currentgroup = groups_get_activity_group($cm, true);
|
||||
groups_print_activity_menu($cm, "report.php?id=$cm->id");
|
||||
groups_print_activity_menu($cm, $CFG->wwwroot . "/mod/chat/report.php?id=$cm->id");
|
||||
} else {
|
||||
$currentgroup = false;
|
||||
}
|
||||
|
||||
+1
-1
@@ -108,7 +108,7 @@
|
||||
/// Check to see if groups are being used here
|
||||
$groupmode = groups_get_activity_groupmode($cm);
|
||||
$currentgroup = groups_get_activity_group($cm, true);
|
||||
groups_print_activity_menu($cm, "view.php?id=$cm->id");
|
||||
groups_print_activity_menu($cm, $CFG->wwwroot . "/mod/chat/view.php?id=$cm->id");
|
||||
|
||||
if ($currentgroup) {
|
||||
$groupselect = " AND groupid = '$currentgroup'";
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
$groupmode = groups_get_activity_groupmode($cm);
|
||||
if ($groupmode) {
|
||||
groups_get_activity_group($cm, true);
|
||||
groups_print_activity_menu($cm, 'report.php?id='.$id);
|
||||
groups_print_activity_menu($cm, $CFG->wwwroot . '/mod/choice/report.php?id='.$id);
|
||||
}
|
||||
} else {
|
||||
$groupmode = groups_get_activity_groupmode($cm);
|
||||
|
||||
+1
-1
@@ -66,7 +66,7 @@
|
||||
|
||||
if ($groupmode) {
|
||||
groups_get_activity_group($cm, true);
|
||||
groups_print_activity_menu($cm, 'view.php?id='.$id);
|
||||
groups_print_activity_menu($cm, $CFG->wwwroot . '/mod/choice/view.php?id='.$id);
|
||||
}
|
||||
$allresponses = choice_get_response_data($choice, $cm, $groupmode); // Big function, approx 6 SQL calls per user
|
||||
|
||||
|
||||
+1
-1
@@ -115,7 +115,7 @@
|
||||
navmenu($course, $cm), '', '');
|
||||
|
||||
/// Check to see if groups are being used here
|
||||
groups_print_activity_menu($cm, 'edit.php?d='.$data->id);
|
||||
groups_print_activity_menu($cm, $CFG->wwwroot . '/mod/data/edit.php?d='.$data->id);
|
||||
$currentgroup = groups_get_activity_group($cm);
|
||||
$groupmode = groups_get_activity_groupmode($cm);
|
||||
|
||||
|
||||
+1
-1
@@ -296,7 +296,7 @@
|
||||
}
|
||||
|
||||
/// Check to see if groups are being used here
|
||||
$returnurl = 'view.php?d='.$data->id.'&search='.s($search).'&sort='.s($sort).'&order='.s($order).'&';
|
||||
$returnurl = $CFG->wwwroot . '/mod/data/view.php?d='.$data->id.'&search='.s($search).'&sort='.s($sort).'&order='.s($order).'&';
|
||||
groups_print_activity_menu($cm, $returnurl);
|
||||
$currentgroup = groups_get_activity_group($cm);
|
||||
$groupmode = groups_get_activity_groupmode($cm);
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
}
|
||||
|
||||
/// Check to see if groups are being used in this forum
|
||||
groups_print_activity_menu($cm, "subscribers.php?id=$forum->id");
|
||||
groups_print_activity_menu($cm, $CFG->wwwroot . "/mod/forum/subscribers.php?id=$forum->id");
|
||||
$currentgroup = groups_get_activity_group($cm);
|
||||
$groupmode = groups_get_activity_groupmode($cm);
|
||||
|
||||
|
||||
+1
-1
@@ -84,7 +84,7 @@
|
||||
}
|
||||
|
||||
/// find out current groups mode
|
||||
groups_print_activity_menu($cm, 'view.php?id=' . $cm->id);
|
||||
groups_print_activity_menu($cm, $CFG->wwwroot . '/mod/forum/view.php?id=' . $cm->id);
|
||||
$currentgroup = groups_get_activity_group($cm);
|
||||
$groupmode = groups_get_activity_groupmode($cm);
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ class quiz_report extends quiz_default_report {
|
||||
|
||||
if ($groupmode = groups_get_activity_groupmode($cm)) { // Groups are being used
|
||||
if (!$download) {
|
||||
groups_print_activity_menu($cm, "report.php?id=$cm->id&mode=analysis");
|
||||
groups_print_activity_menu($cm, $CFG->wwwroot . "/mod/quiz/report.php?id=$cm->id&mode=analysis");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
if ($groupmode = groups_get_activity_groupmode($cm)) { // Groups are being used
|
||||
$menuaction = $action == "student" ? "students" : $action;
|
||||
$currentgroup = groups_get_activity_group($cm, true);
|
||||
groups_print_activity_menu($cm, "report.php?id=$cm->id&action=$menuaction&qid=$qid");
|
||||
groups_print_activity_menu($cm, $CFG->wwwroot . "/mod/survey/report.php?id=$cm->id&action=$menuaction&qid=$qid");
|
||||
} else {
|
||||
$currentgroup = 0;
|
||||
}
|
||||
|
||||
@@ -308,7 +308,7 @@
|
||||
/// find out current groups mode
|
||||
$groupmode = groups_get_activity_groupmode($cm);
|
||||
$currentgroup = groups_get_activity_group($cm, true);
|
||||
groups_print_activity_menu($cm, "view.php?id=$cm->id");
|
||||
groups_print_activity_menu($cm, $CFG->wwwroot . "/mod/workshop/view.php?id=$cm->id");
|
||||
|
||||
/// Print admin links
|
||||
echo "<table width=\"100%\"><tr><td>";
|
||||
|
||||
Reference in New Issue
Block a user