mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-06-15 17:49:19 +00:00
readd [post|pre]PreviewDocument hooks
This commit is contained in:
parent
8b1b9fdb2a
commit
b5f8e9efcc
|
@ -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())) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user