Skip to content

Commit

Permalink
backup MDL-19789 Added set_url calls
Browse files Browse the repository at this point in the history
  • Loading branch information
samhemelryk committed Oct 15, 2009
1 parent 7915161 commit e6a40d2
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 1 deletion.
12 changes: 12 additions & 0 deletions backup/backup.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,18 @@
$cancel = optional_param('cancel', '', PARAM_RAW);
$launch = optional_param('launch', '', PARAM_ACTION);

$url = new moodle_url();
if ($id !== 0) {
$url->param('id', $id);
}
if ($to !== 0) {
$url->param('to', $to);
}
if ($launch !== '') {
$url->param('launch', $launch);
}
$PAGE->set_url($url);

$loginurl = get_login_url();

if (!empty($id)) {
Expand Down
23 changes: 23 additions & 0 deletions backup/restore.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,29 @@
$method = optional_param('method', '', PARAM_ACTION);
$backup_unique_code = optional_param('backup_unique_code',0,PARAM_INT);

$url = new moodle_url($CFG->wwwroot.'/backup/restore.php');
if ($id !== 0) {
$url->param('id', $id);
}
if ($file !== 0) {
$url->param('file', $file);
}
if ($cancel !== '') {
$url->param('cancel', $cancel);
}
if ($launch !== '') {
$url->param('launch', $launch);
}
if ($to !== '') {
$url->param('to', $to);
}
if ($method !== '') {
$url->param('method', $method);
}
if ($backup_unique_code !== 0) {
$url->param('backup_unique_code', $backup_unique_code);
}

//Check login
require_login();

Expand Down
9 changes: 8 additions & 1 deletion course/report/stats/graph.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,14 @@
$userid = optional_param('userid', 0, PARAM_INT);
$roleid = optional_param('roleid',0,PARAM_INT);


$url = new moodle_url($CFG->wwwroot.'/course/report/stats/graph.php', array('course'=>$courseid, 'report'=>$report, 'time'=>$time, 'mode'=>$mode));
if ($userid !== 0) {
$url->param('userid', $userid);
}
if ($roleid !== 0) {
$url->param('roleid', $roleid);
}
$PAGE->set_url($url);

if (!$course = $DB->get_record("course", array("id"=>$courseid))) {
print_error("invalidcourseid");
Expand Down

0 comments on commit e6a40d2

Please sign in to comment.