readd [post|pre]PreviewDocument hooks

This commit is contained in:
Uwe Steinmann 2017-01-04 17:23:59 +01:00
parent 8b1b9fdb2a
commit b5f8e9efcc

View File

@ -323,9 +323,12 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
return;
$accessop = $this->params['accessobject'];
if($accessop->check_controller_access('Download', array('action'=>'version'))) {
$latestContent = $document->getLatestContent();
$txt = $this->callHook('preDocumentPreview', $latestContent);
if(is_string($txt))
echo $txt;
else {
switch($latestContent->getMimeType()) {
case 'audio/mpeg':
case 'audio/mp3':
@ -351,8 +354,16 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
<?php
break;
default:
$txt = $this->callHook('additionalDocumentPreview', $latestContent);
if(is_string($txt))
echo $txt;
break;
}
}
$txt = $this->callHook('postDocumentPreview', $latestContent);
if(is_string($txt))
echo $txt;
if($converttopdf) {
$pdfpreviewer = new SeedDMS_Preview_PdfPreviewer($cachedir, $timeout);
if($pdfpreviewer->hasConverter($latestContent->getMimeType())) {