|
@@ -828,11 +828,8 @@ try
|
|
if ($oMenu instanceof DashboardMenuNode)
|
|
if ($oMenu instanceof DashboardMenuNode)
|
|
{
|
|
{
|
|
$oDashboard = $oMenu->GetDashboard();
|
|
$oDashboard = $oMenu->GetDashboard();
|
|
- $sPreviousContent = ob_get_clean();
|
|
|
|
- if (trim($sPreviousContent) != '')
|
|
|
|
- {
|
|
|
|
- IssueLog::Error("Output already started before downloading file:\nContent was:'$sPreviousContent'\n");
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
|
|
+ $oPage->TrashUnexpectedOutput();
|
|
$oPage->SetContentType('text/xml');
|
|
$oPage->SetContentType('text/xml');
|
|
$oPage->SetContentDisposition('attachment', $oMenu->GetLabel().'.xml');
|
|
$oPage->SetContentDisposition('attachment', $oMenu->GetLabel().'.xml');
|
|
$oPage->add($oDashboard->ToXml());
|
|
$oPage->add($oDashboard->ToXml());
|
|
@@ -907,12 +904,7 @@ function DownloadDocument(WebPage $oPage, $sClass, $id, $sAttCode, $sContentDisp
|
|
$oDocument = $oObj->Get($sAttCode);
|
|
$oDocument = $oObj->Get($sAttCode);
|
|
if (is_object($oDocument))
|
|
if (is_object($oDocument))
|
|
{
|
|
{
|
|
- // Make sure there is NO output at all before our content, otherwise the document will be corrupted
|
|
|
|
- $sPreviousContent = ob_get_clean();
|
|
|
|
- if (trim($sPreviousContent) != '')
|
|
|
|
- {
|
|
|
|
- IssueLog::Error("Output already started before downloading file:\nContent was:'$sPreviousContent'\n");
|
|
|
|
- }
|
|
|
|
|
|
+ $oPage->TrashUnexpectedOutput();
|
|
$oPage->SetContentType($oDocument->GetMimeType());
|
|
$oPage->SetContentType($oDocument->GetMimeType());
|
|
$oPage->SetContentDisposition($sContentDisposition,$oDocument->GetFileName());
|
|
$oPage->SetContentDisposition($sContentDisposition,$oDocument->GetFileName());
|
|
$oPage->add($oDocument->GetData());
|
|
$oPage->add($oDocument->GetData());
|
|
@@ -923,4 +915,4 @@ function DownloadDocument(WebPage $oPage, $sClass, $id, $sAttCode, $sContentDisp
|
|
$oPage->p($e->getMessage());
|
|
$oPage->p($e->getMessage());
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-?>
|
|
|
|
|
|
+?>
|