output MDL-19799 Fixed up some set_url calls as well as fixing some regressions caused by recent upgrades

This commit is contained in:
samhemelryk
2009-10-21 04:23:35 +00:00
parent 3b7699cfa5
commit 7f09335135
7 changed files with 73 additions and 8 deletions
+19 -1
View File
@@ -45,7 +45,25 @@ $cancelcopy = optional_param('cancelcopy', 0, PARAM_BOOL);
$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)) {
+14 -1
View File
@@ -33,7 +33,20 @@
$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))) {
+2 -2
View File
@@ -1,4 +1,4 @@
<?php // $Id$
<?php
// Display user activity reports for a course (totals)
@@ -11,7 +11,7 @@
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);
+1 -1
View File
@@ -788,7 +788,7 @@ function quiz_question_edit_button($cmid, $question, $returnurl, $contentbeforei
$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;
}
+29 -1
View File
@@ -23,7 +23,35 @@
// 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
+7 -1
View File
@@ -34,7 +34,13 @@
$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'));
+1 -1
View File
@@ -100,7 +100,7 @@ class question_category_list_item extends list_item {
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;