mirror of
https://github.com/moodle/moodle.git
synced 2025-04-19 07:25:30 +02:00
MDL-21009 Group selector must use absolute links in order to work with javascript off
This commit is contained in:
parent
41ff27d0cc
commit
f1035deb97
@ -500,7 +500,7 @@ function groups_print_course_menu($course, $urlroot, $return=false) {
|
||||
* @global object
|
||||
* @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
|
||||
@ -513,6 +513,15 @@ function groups_print_course_menu($course, $urlroot, $return=false) {
|
||||
function groups_print_activity_menu($cm, $urlroot, $return=false, $hideallparticipants=false) {
|
||||
global $CFG, $USER, $SESSION, $OUTPUT;
|
||||
|
||||
// Display error if urlroot is not absolute (this causes the non-JS version
|
||||
// to break)
|
||||
if (strpos($urlroot, 'http') !== 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;
|
||||
|
@ -192,7 +192,7 @@ class assignment_base {
|
||||
|
||||
echo $OUTPUT->header();
|
||||
|
||||
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>';
|
||||
@ -1148,7 +1148,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)) {
|
||||
|
@ -61,7 +61,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");
|
||||
|
||||
$params = array('currentgroup'=>$currentgroup, 'chatid'=>$chat->id, 'start'=>$start, 'end'=>$end);
|
||||
|
||||
@ -128,7 +128,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;
|
||||
}
|
||||
|
@ -89,7 +89,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'";
|
||||
|
@ -59,7 +59,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);
|
||||
|
@ -74,7 +74,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
|
||||
|
||||
|
@ -135,7 +135,7 @@ $PAGE->set_button($OUTPUT->update_module_button($cm->id, 'data'));
|
||||
echo $OUTPUT->header();
|
||||
|
||||
/// 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);
|
||||
|
||||
|
@ -301,7 +301,7 @@
|
||||
echo $OUTPUT->header();
|
||||
|
||||
/// 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);
|
||||
|
@ -76,7 +76,7 @@ include('tabs.php');
|
||||
echo $OUTPUT->box_start('generalbox boxaligncenter boxwidthwide');
|
||||
|
||||
//get the groupid
|
||||
$groupselect = groups_print_activity_menu($cm, 'analysis.php?id=' . $cm->id.'&do_show=analysis', true);
|
||||
$groupselect = groups_print_activity_menu($cm, $CFG->wwwroot . '/mod/feedback/analysis.php?id=' . $cm->id.'&do_show=analysis', true);
|
||||
$mygroupid = groups_get_activity_group($cm);
|
||||
|
||||
if( $capabilities->viewreports ) {
|
||||
|
@ -94,7 +94,7 @@ if($do_show == 'showentries'){
|
||||
$groupmode = $course->groupmode;
|
||||
}
|
||||
|
||||
$groupselect = groups_print_activity_menu($cm, 'show_entries.php?id=' . $cm->id.'&do_show=showentries', true);
|
||||
$groupselect = groups_print_activity_menu($cm, $CFG->wwwroot . '/mod/feedback/show_entries.php?id=' . $cm->id.'&do_show=showentries', true);
|
||||
$mygroupid = groups_get_activity_group($cm);
|
||||
|
||||
//get students in conjunction with groupmode
|
||||
|
@ -58,7 +58,7 @@ if (has_capability('mod/forum:managesubscriptions', $context)) {
|
||||
echo $OUTPUT->header();
|
||||
|
||||
/// 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);
|
||||
|
||||
|
@ -92,7 +92,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);
|
||||
|
||||
|
@ -126,7 +126,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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user