Skip to content

Commit

Permalink
tag-manage MDL-19823 Added set_url call
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Hemelryk committed Feb 1, 2010
1 parent 52dd27b commit e4ca0c8
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions filter/manage.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,20 @@
print_error('wrongcontextid', 'error');
}

$args = array('contextid'=>$contextid);
$baseurl = new moodle_url('/filter/manage.php', $args);
if (!empty($forfilter)) {
$args['filter'] = $forfilter;
}
$PAGE->set_url($baseurl, $args);

// This is a policy decision, rather than something that would be impossible to implement.
if (!in_array($context->contextlevel, array(CONTEXT_COURSECAT, CONTEXT_COURSE, CONTEXT_MODULE))) {
print_error('cannotcustomisefiltersblockuser', 'error');
}

$isfrontpage = $context->contextlevel == CONTEXT_COURSE && $context->instanceid == SITEID;
$contextname = print_context_name($context);
$baseurl = $CFG->wwwroot . '/filter/manage.php?contextid=' . $context->id;

if ($context->contextlevel == CONTEXT_COURSECAT) {
$course = clone($SITE);
Expand Down Expand Up @@ -152,7 +158,7 @@
TEXTFILTER_ON => $stron,
);

echo '<form action="' . $baseurl . '" method="post">';
echo '<form action="'.$baseurl->out().'" method="post">';
echo "\n<div>\n";
echo '<input type="hidden" name="sesskey" value="' . sesskey() . '" />';

Expand Down Expand Up @@ -185,7 +191,7 @@
if ($settingscol) {
$settings = '';
if ($filterinfo->hassettings) {
$settings = '<a href="' . $baseurl . '&amp;filter=' . $filter . '">' . $strsettings . '</a>';
$settings = '<a href="' . $baseurl->out(true, array('filter'=>$filter)). '">' . $strsettings . '</a>';
}
$row[] = $settings;
}
Expand Down

0 comments on commit e4ca0c8

Please sign in to comment.