added inline disposition for PDF previews (#3486)

This commit is contained in:
Alexander Pankow
2022-09-04 12:15:47 +02:00
committed by GitHub
parent 1d1f5835da
commit 2fbbbe7260
9 changed files with 107 additions and 10 deletions

View File

@@ -9,6 +9,7 @@
namespace App\Controller;
use App\Export\Base\DispositionInlineInterface;
use App\Export\ExportItemInterface;
use App\Export\ServiceExport;
use App\Export\TooManyItemsExportException;
@@ -117,6 +118,11 @@ class ExportController extends AbstractController
throw $this->createNotFoundException('Unknown export renderer');
}
// display file inline if supported and `markAsExported` is not set
if ($renderer instanceof DispositionInlineInterface && !$query->isMarkAsExported()) {
$renderer->setDispositionInline(true);
}
$entries = $this->getEntries($query);
$response = $renderer->render($entries, $query);