Skip to content

Commit

Permalink
MDL-38369 repository: Remove output before redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
Frederic Massart committed May 2, 2013
1 parent 5e00b9a commit 2d1fd9e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions repository/manage_instances.php
Expand Up @@ -142,7 +142,6 @@
/// Display page header
$PAGE->set_title($title);
$PAGE->set_heading($fullname);
echo $OUTPUT->header();

if ($context->contextlevel == CONTEXT_USER) {
if ( !$course = $DB->get_record('course', array('id'=>$usercourseid))) {
Expand Down Expand Up @@ -196,13 +195,13 @@
}
if ($success) {
$savedstr = get_string('configsaved', 'repository');
echo $OUTPUT->heading($savedstr);
redirect($baseurl);
} else {
print_error('instancenotsaved', 'repository', $baseurl);
}
exit;
} else { // Display the form
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('configplugin', 'repository_'.$plugin));
$OUTPUT->box_start();
$mform->display();
Expand All @@ -224,18 +223,19 @@
}
if ($instance->delete()) {
$deletedstr = get_string('instancedeleted', 'repository');
echo $OUTPUT->heading($deletedstr);
redirect($baseurl, $deletedstr, 3);
} else {
print_error('instancenotdeleted', 'repository', $baseurl);
}
exit;
}
echo $OUTPUT->header();
$formcontinue = new single_button(new moodle_url($baseurl, array('delete' => $delete, 'sure' => 'yes')), get_string('yes'));
$formcancel = new single_button($baseurl, get_string('no'));
echo $OUTPUT->confirm(get_string('confirmdelete', 'repository', $instance->name), $formcontinue, $formcancel);
$return = false;
} else {
echo $OUTPUT->header();
repository::display_instances_list($context);
$return = false;
}
Expand Down

0 comments on commit 2d1fd9e

Please sign in to comment.