Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
repository MDL-19821 Added set_url call
  • Loading branch information
samhemelryk committed Oct 16, 2009
1 parent 5c0daaf commit f3a6cd6
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions repository/manage_instances.php
Expand Up @@ -11,16 +11,33 @@
$contextid = optional_param('contextid', 0, PARAM_INT);
$usercourseid = optional_param('usercourseid', SITEID, PARAM_INT); // Extra: used for user context only

$url = new moodle_url($CFG->wwwroot.'/repository/manage_instances.php');

if ($edit){
$url->param('edit', $edit);
$pagename = 'repositoryinstanceedit';
} else if ($delete) {
$url->param('delete', $delete);
$pagename = 'repositorydelete';
} else if ($new) {
$url->param('new', $new);
$pagename = 'repositoryinstancenew';
} else {
$pagename = 'repositorylist';
}

if ($sure !== '') {
$url->param('sure', $sure);
}
if ($contextid !== 0) {
$url->param('contextid', $contextid);
}
if ($usercourseid !== SITEID) {
$url->param('usercourseid', $usercourseid);
}

$PAGE->set_url($url);

require_login(SITEID, false);

$context = get_context_instance_by_id($contextid);
Expand Down

0 comments on commit f3a6cd6

Please sign in to comment.