* fix the bug #207

This commit is contained in:
shiyangyangwork@yahoo.cn
2011-06-09 01:46:49 +00:00
parent 4db2075574
commit 4c9d23ad84
2 changed files with 26 additions and 1 deletions
+3
View File
@@ -170,6 +170,9 @@ class file extends control
*/
public function sendDownHeader($fileName, $fileType, $content)
{
/* Set the downloading cookie, thus the export form page can use it to judge whether to close the window or not. */
setcookie('downloading', 1);
/* Append the extension name auto. */
$extension = '.' . $fileType;
if(strpos($fileName, $extension) === false) $fileName .= $extension;
+23 -1
View File
@@ -11,7 +11,29 @@
*/
?>
<?php include '../../common/view/header.lite.html.php';?>
<form method='post' target='hiddenwin'>
<?php include '../../common/view/colorbox.html.php';?>
<script>
function setDownloading()
{
$.cookie('downloading', 0);
time = setInterval("closeWindow()", 300);
return true;
}
function closeWindow()
{
if($.cookie('downloading') == 1 || i >= 30)
{
parent.$.fn.colorbox.close();
$.cookie('downloading', null);
clearInterval(time);
}
i ++;
}
</script>
<form method='post' target='hiddenwin' onsubmit='setDownloading();'>
<table class='table-1'>
<caption><?php echo $lang->export;?></caption>
<tr>