mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-12 12:41:30 +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>";
|
$content .= "<td>";
|
||||||
if (file_exists($dms->contentDir . $latestContent->getPath())) {
|
if (file_exists($dms->contentDir . $latestContent->getPath())) {
|
||||||
if($accessop->check_controller_access('Download', array('action'=>'version')))
|
$previewhtml = $this->callHook('documentListPreview', $previewer, $document, $latestContent);
|
||||||
$content .= "<a draggable=\"false\" href=\"".$this->params['settings']->_httpRoot."op/op.Download.php?documentid=".$docID."&version=".$version."\">";
|
if(is_string($previewhtml))
|
||||||
if($previewer->hasPreview($latestContent)) {
|
$content .= $previewhtml;
|
||||||
$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 {
|
||||||
} else {
|
if($accessop->check_controller_access('Download', array('action'=>'version')))
|
||||||
$content .= "<img draggable=\"false\" class=\"mimeicon\" width=\"".$previewwidth."\" src=\"".$this->getMimeIcon($latestContent->getFileType())."\" ".($previewwidth ? "width=\"".$previewwidth."\"" : "")."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">";
|
$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
|
} else
|
||||||
$content .= "<img draggable=\"false\" class=\"mimeicon\" width=\"".$previewwidth."\" src=\"".$this->getMimeIcon($latestContent->getFileType())."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">";
|
$content .= "<img draggable=\"false\" class=\"mimeicon\" width=\"".$previewwidth."\" src=\"".$this->getMimeIcon($latestContent->getFileType())."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">";
|
||||||
$content .= "</td>";
|
$content .= "</td>";
|
||||||
|
|
|
@ -2976,15 +2976,20 @@ $('body').on('click', '[id^=\"table-row-folder\"] td:nth-child(2)', function(ev)
|
||||||
|
|
||||||
$content .= "<td>";
|
$content .= "<td>";
|
||||||
if (file_exists($dms->contentDir . $latestContent->getPath())) {
|
if (file_exists($dms->contentDir . $latestContent->getPath())) {
|
||||||
if($accessop->check_controller_access('Download', array('action'=>'version')))
|
$previewhtml = $this->callHook('documentListPreview', $previewer, $document, $latestContent);
|
||||||
$content .= "<a draggable=\"false\" href=\"".$this->params['settings']->_httpRoot."op/op.Download.php?documentid=".$docID."&version=".$version."\">";
|
if(is_string($previewhtml))
|
||||||
if($previewer->hasPreview($latestContent)) {
|
$content .= $previewhtml;
|
||||||
$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 {
|
||||||
} else {
|
if($accessop->check_controller_access('Download', array('action'=>'version')))
|
||||||
$content .= "<img draggable=\"false\" class=\"mimeicon\" width=\"".$previewwidth."\" src=\"".$this->getMimeIcon($latestContent->getFileType())."\" ".($previewwidth ? "width=\"".$previewwidth."\"" : "")."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">";
|
$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
|
} else
|
||||||
$content .= "<img draggable=\"false\" class=\"mimeicon\" width=\"".$previewwidth."\" src=\"".$this->getMimeIcon($latestContent->getFileType())."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">";
|
$content .= "<img draggable=\"false\" class=\"mimeicon\" width=\"".$previewwidth."\" src=\"".$this->getMimeIcon($latestContent->getFileType())."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">";
|
||||||
$content .= "</td>";
|
$content .= "</td>";
|
||||||
|
|
Loading…
Reference in New Issue
Block a user