$confirm = optional_param('confirm', 0, PARAM_BOOL);
// This page should always redirect
-$PAGE->set_url($FULLME);
+$url = new moodle_url($CFG->wwwroot.'/course/mod.php');
+foreach (compact('indent','update','hide','show','copy','moveto','movetosection','delete','course','cancelcopy','confirm') as $key=>$value) {
+ if ($value !== 0) {
+ $url->param($key, $value);
+ }
+}
+if ($sectionreturn !== '') {
+ $url->param('sr', $sectionreturn);
+}
+if ($add !== '') {
+ $url->param('add', $add);
+}
+if ($type !== '') {
+ $url->param('type', $type);
+}
+if ($groupmode !== '') {
+ $url->param('groupmode', $groupmode);
+}
+$PAGE->set_url($url);
//check if we are adding / editing a module that has new forms using formslib
if (!empty($add)) {
$chooselog = optional_param('chooselog', 0, PARAM_INT);
$logformat = optional_param('logformat', 'showashtml', PARAM_ALPHA);
- $PAGE->set_url(new moodle_url($FULLME));
+ $params = array();
+ if ($group !== 0) $params['group'] = $group;
+ if ($user !== 0) $params['user'] = $user;
+ if ($date !== 0) $params['date'] = $date;
+ if ($modname !== 0) $params['modname'] = $modname;
+ if ($modid !== 0) $params['modid'] = $modid;
+ if ($modaction !== '') $params['modaction'] = $modaction;
+ if ($page !== '0') $params['page'] = $page;
+ if ($perpage !== '100') $params['perpage'] = $perpage;
+ if ($showcourses !== 0) $params['showcourses'] = $showcourses;
+ if ($showusers !== 0) $params['showusers'] = $showusers;
+ if ($chooselog !== 0) $params['chooselog'] = $chooselog;
+ if ($logformat !== 'showashtml') $params['logformat'] = $logformat;
+ $PAGE->set_url(new moodle_url($CFG->wwwroot.'/course/report/log/index.php', $params));
if ($hostid == $CFG->mnet_localhost_id) {
if (!$course = $DB->get_record('course', array('id'=>$id))) {
-<?php // $Id$
+<?php
// Display user activity reports for a course (totals)
print_error('invalidcourseid');
}
- $PAGE->set_url(new moodle_url($FULLME));
+ $PAGE->set_url(new moodle_url($CFg->wwwroot.'/course/report/outline/index.php', array('id'=>$id)));
require_login($course);
$context = get_context_instance(CONTEXT_COURSE, $course->id);
$questionparams = array('returnurl' => $returnurl, 'cmid' => $cmid, 'id' => $question->id);
$questionurl = new moodle_url("$CFG->wwwroot/question/question.php", $questionparams);
return '<a title="' . $action . '" href="' . $questionurl->out() . '">' . $contentbeforeicon .
- '<img src="' . $OUTPUT->old_icon_url($icon) . '.gif" alt="' . $action . '" /></a>';
+ '<img src="' . $OUTPUT->old_icon_url($icon) . '" alt="' . $action . '" /></a>';
} else {
return $contentbeforeicon;
}
// Only want to add edit log entries if we have made some changes ie submitted a form
$editsave = optional_param('thankyou', '', PARAM_RAW);
- $PAGE->set_url(new moodle_url($FULLME));
+ $url = new moodle_url($CFG->wwwroot.'/mod/wiki/view.php');
+ if ($ewiki_action !== '') {
+ $url->param('ewiki_action', $ewiki_action);
+ }
+ if ($id !== 0) {
+ $url->param('id', $id);
+ }
+ if ($wid !== 0) {
+ $url->param('wid', $wid);
+ }
+ if ($page !== false) {
+ $url->param('page', $page);
+ }
+ if ($q !== '') {
+ $url->param('q', $q);
+ }
+ if ($userid !== 0) {
+ $url->param('userid', $userid);
+ }
+ if ($groupid !== 0) {
+ $url->param('groupid', $groupid);
+ }
+ if ($canceledit !== '') {
+ $url->param('canceledit', $canceledit);
+ }
+ if ($cacheme !== 1) {
+ $url->param('allowcache', $cacheme);
+ }
+ $PAGE->set_url($url);
if($page) {
// Split page command into action and page
$param->moveto = optional_param('moveto', 0, PARAM_INT);
$param->edit = optional_param('edit', 0, PARAM_INT);
- $PAGE->set_url(new moodle_url($FULLME));
+ $url = new moodle_url($thispageurl);
+ foreach ((array)$param as $key=>$value) {
+ if (($key !== 'cancel' && $value !== 0) || ($key === 'cancel' && $value !== '')) {
+ $url->param($key, $value);
+ }
+ }
+ $PAGE->set_url($url);
$qcobject = new question_category_object($pagevars['cpage'], $thispageurl, $contexts->having_one_edit_tab_cap('categories'), $param->edit, $pagevars['cat'], $param->delete,
$contexts->having_cap('moodle/question:add'));
if (count($this->parentlist->records)!=1){ // don't allow delete if this is the last category in this context.
$item .= '<a title="' . $str->delete . '" href="'.$this->parentlist->pageurl->out_action(array('delete'=>$this->id)).'">
- <img src="' . $OUTPUT->old_icon_url('t/delete.gif') . '" class="iconsmall" alt="' .$str->delete. '" /></a>';
+ <img src="' . $OUTPUT->old_icon_url('t/delete') . '" class="iconsmall" alt="' .$str->delete. '" /></a>';
}
return $item;