Commit a7d04cc4 authored by Francois Marier's avatar Francois Marier Committed by Gerrit Code Review
Browse files

Merge "Don't hardcode new location in print_export_footer()"

parents 85986e6c e666019a
......@@ -227,4 +227,4 @@ $SESSION->set('exportfile', $zipfile);
$wwwroot = get_config('wwwroot');
$strexportgeneratedsuccessfullyjs = get_string('exportgeneratedsuccessfullyjs', 'export', '<a href="' . $wwwroot . '" target="_top">', '</a>');
$strexportgeneratedsuccessfully = get_string('exportgeneratedsuccessfully', 'export', '<a href="bulkdownload.php" target="_top">', '</a>');
print_export_footer($strexportgeneratedsuccessfully, $strexportgeneratedsuccessfullyjs);
print_export_footer($strexportgeneratedsuccessfully, $strexportgeneratedsuccessfullyjs, 'bulkdownload.php');
......@@ -114,4 +114,4 @@ $SESSION->set('exportfile', $exporter->get('exportdir') . $zipfile);
$wwwroot = get_config('wwwroot');
$strexportgeneratedsuccessfullyjs = get_string('exportgeneratedsuccessfullyjs', 'export', '<a href="' . $wwwroot . 'export/" target="_top">', '</a>');
$strexportgeneratedsuccessfully = get_string('exportgeneratedsuccessfully', 'export', '<a href="download.php" target="_top">', '</a>');
print_export_footer($strexportgeneratedsuccessfully, $strexportgeneratedsuccessfullyjs, $exporter->get('messages'));
print_export_footer($strexportgeneratedsuccessfully, $strexportgeneratedsuccessfullyjs, $exporter->get('messages'), 'download.php');
......@@ -63,14 +63,14 @@ function print_iframe_progress_handler($percent, $status) {
echo '<p class="progress-text">' . hsc($status) . "</p>\n";
}
function print_export_footer($strexportgeneratedsuccessfully, $strexportgeneratedsuccessfullyjs, $jsmessages=array()) {
function print_export_footer($strexportgeneratedsuccessfully, $strexportgeneratedsuccessfullyjs, $jsmessages=array(), $newlocation) {
?>
<script type="text/javascript">
document.write('<div class="progress-bar" style="width: 100%;"><p><?php echo $strexportgeneratedsuccessfullyjs; ?></p></div>');
if (!window.opera) {
// Opera can't handle this for some reason - it vomits out the
// download inline in the iframe
document.location = 'download.php';
document.location = '<?php echo $newlocation; ?>';
}
var messages = <?php echo json_encode(join('; ', $jsmessages)); ?>;
if (messages) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment