mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-06-18 02:59:27 +00:00
pass content instead of document to preview hooks
This commit is contained in:
parent
259c7ffc3c
commit
db0021d65b
|
@ -174,11 +174,11 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
||||||
if(!$showfullpreview)
|
if(!$showfullpreview)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
$txt = $this->callHook('preDocumentPreview', $document);
|
$latestContent = $document->getLatestContent();
|
||||||
|
$txt = $this->callHook('preDocumentPreview', $latestContent);
|
||||||
if(is_string($txt))
|
if(is_string($txt))
|
||||||
echo $txt;
|
echo $txt;
|
||||||
else {
|
else {
|
||||||
$latestContent = $document->getLatestContent();
|
|
||||||
switch($latestContent->getMimeType()) {
|
switch($latestContent->getMimeType()) {
|
||||||
case 'audio/mpeg':
|
case 'audio/mpeg':
|
||||||
case 'audio/mp3':
|
case 'audio/mp3':
|
||||||
|
@ -204,13 +204,13 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
||||||
<?php
|
<?php
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$txt = $this->callHook('additionalDocumentPreview', $document);
|
$txt = $this->callHook('additionalDocumentPreview', $latestContent);
|
||||||
if(is_string($txt))
|
if(is_string($txt))
|
||||||
echo $txt;
|
echo $txt;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$txt = $this->callHook('postDocumentPreview', $document);
|
$txt = $this->callHook('postDocumentPreview', $latestContent);
|
||||||
if(is_string($txt))
|
if(is_string($txt))
|
||||||
echo $txt;
|
echo $txt;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user