mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-11 09:35:00 +00:00
add hook documentListPreview
This commit is contained in:
parent
ad2ea73031
commit
52a9a41d5c
|
@ -2908,15 +2908,20 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
|
|||
|
||||
$content .= "<td>";
|
||||
if (file_exists($dms->contentDir . $latestContent->getPath())) {
|
||||
if($accessop->check_controller_access('Download', array('action'=>'version')))
|
||||
$content .= "<a draggable=\"false\" href=\"".$this->params['settings']->_httpRoot."op/op.Download.php?documentid=".$docID."&version=".$version."\">";
|
||||
if($previewer->hasPreview($latestContent)) {
|
||||
$content .= "<img draggable=\"false\" class=\"mimeicon\" width=\"".$previewwidth."\" src=\"".$this->params['settings']->_httpRoot."op/op.Preview.php?documentid=".$document->getID()."&version=".$latestContent->getVersion()."&width=".$previewwidth."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">";
|
||||
} else {
|
||||
$content .= "<img draggable=\"false\" class=\"mimeicon\" width=\"".$previewwidth."\" src=\"".$this->getMimeIcon($latestContent->getFileType())."\" ".($previewwidth ? "width=\"".$previewwidth."\"" : "")."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">";
|
||||
$previewhtml = $this->callHook('documentListPreview', $previewer, $document, $latestContent);
|
||||
if(is_string($previewhtml))
|
||||
$content .= $previewhtml;
|
||||
else {
|
||||
if($accessop->check_controller_access('Download', array('action'=>'version')))
|
||||
$content .= "<a draggable=\"false\" href=\"".$this->params['settings']->_httpRoot."op/op.Download.php?documentid=".$docID."&version=".$version."\">";
|
||||
if($previewer->hasPreview($latestContent)) {
|
||||
$content .= "<img draggable=\"false\" class=\"mimeicon\" width=\"".$previewwidth."\" src=\"".$this->params['settings']->_httpRoot."op/op.Preview.php?documentid=".$document->getID()."&version=".$latestContent->getVersion()."&width=".$previewwidth."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">";
|
||||
} else {
|
||||
$content .= "<img draggable=\"false\" class=\"mimeicon\" width=\"".$previewwidth."\" src=\"".$this->getMimeIcon($latestContent->getFileType())."\" ".($previewwidth ? "width=\"".$previewwidth."\"" : "")."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">";
|
||||
}
|
||||
if($accessop->check_controller_access('Download', array('action'=>'version')))
|
||||
$content .= "</a>";
|
||||
}
|
||||
if($accessop->check_controller_access('Download', array('action'=>'version')))
|
||||
$content .= "</a>";
|
||||
} else
|
||||
$content .= "<img draggable=\"false\" class=\"mimeicon\" width=\"".$previewwidth."\" src=\"".$this->getMimeIcon($latestContent->getFileType())."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">";
|
||||
$content .= "</td>";
|
||||
|
|
|
@ -2976,15 +2976,20 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
|
|||
|
||||
$content .= "<td>";
|
||||
if (file_exists($dms->contentDir . $latestContent->getPath())) {
|
||||
if($accessop->check_controller_access('Download', array('action'=>'version')))
|
||||
$content .= "<a draggable=\"false\" href=\"".$this->params['settings']->_httpRoot."op/op.Download.php?documentid=".$docID."&version=".$version."\">";
|
||||
if($previewer->hasPreview($latestContent)) {
|
||||
$content .= "<img draggable=\"false\" class=\"mimeicon\" width=\"".$previewwidth."\" src=\"".$this->params['settings']->_httpRoot."op/op.Preview.php?documentid=".$document->getID()."&version=".$latestContent->getVersion()."&width=".$previewwidth."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">";
|
||||
} else {
|
||||
$content .= "<img draggable=\"false\" class=\"mimeicon\" width=\"".$previewwidth."\" src=\"".$this->getMimeIcon($latestContent->getFileType())."\" ".($previewwidth ? "width=\"".$previewwidth."\"" : "")."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">";
|
||||
$previewhtml = $this->callHook('documentListPreview', $previewer, $document, $latestContent);
|
||||
if(is_string($previewhtml))
|
||||
$content .= $previewhtml;
|
||||
else {
|
||||
if($accessop->check_controller_access('Download', array('action'=>'version')))
|
||||
$content .= "<a draggable=\"false\" href=\"".$this->params['settings']->_httpRoot."op/op.Download.php?documentid=".$docID."&version=".$version."\">";
|
||||
if($previewer->hasPreview($latestContent)) {
|
||||
$content .= "<img draggable=\"false\" class=\"mimeicon\" width=\"".$previewwidth."\" src=\"".$this->params['settings']->_httpRoot."op/op.Preview.php?documentid=".$document->getID()."&version=".$latestContent->getVersion()."&width=".$previewwidth."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">";
|
||||
} else {
|
||||
$content .= "<img draggable=\"false\" class=\"mimeicon\" width=\"".$previewwidth."\" src=\"".$this->getMimeIcon($latestContent->getFileType())."\" ".($previewwidth ? "width=\"".$previewwidth."\"" : "")."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">";
|
||||
}
|
||||
if($accessop->check_controller_access('Download', array('action'=>'version')))
|
||||
$content .= "</a>";
|
||||
}
|
||||
if($accessop->check_controller_access('Download', array('action'=>'version')))
|
||||
$content .= "</a>";
|
||||
} else
|
||||
$content .= "<img draggable=\"false\" class=\"mimeicon\" width=\"".$previewwidth."\" src=\"".$this->getMimeIcon($latestContent->getFileType())."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">";
|
||||
$content .= "</td>";
|
||||
|
|
Loading…
Reference in New Issue
Block a user