add hooks for showing preview of document

This commit is contained in:
Uwe Steinmann 2016-12-22 09:11:40 +01:00
parent 7bf6ec003c
commit 259c7ffc3c

View File

@ -174,6 +174,10 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
if(!$showfullpreview)
return;
$txt = $this->callHook('preDocumentPreview', $document);
if(is_string($txt))
echo $txt;
else {
$latestContent = $document->getLatestContent();
switch($latestContent->getMimeType()) {
case 'audio/mpeg':
@ -200,8 +204,16 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
<?php
break;
default:
$txt = $this->callHook('additionalDocumentPreview', $document);
if(is_string($txt))
echo $txt;
break;
}
}
$txt = $this->callHook('postDocumentPreview', $document);
if(is_string($txt))
echo $txt;
if($converttopdf) {
$pdfpreviewer = new SeedDMS_Preview_PdfPreviewer($cachedir, $timeout);
if($pdfpreviewer->hasConverter($latestContent->getMimeType())) {