mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-12 12:41:30 +00:00
check if download/viewonline is allowed
This commit is contained in:
parent
13d1e92434
commit
9ae4a01705
|
@ -517,8 +517,10 @@ $(document).ready( function() {
|
|||
$this->columnStart(4);
|
||||
if ($file_exists) {
|
||||
if ($viewonlinefiletypes && (in_array(strtolower($latestContent->getFileType()), $viewonlinefiletypes) || in_array(strtolower($latestContent->getMimeType()), $viewonlinefiletypes))) {
|
||||
if($accessop->check_controller_access('ViewOnline', array('action'=>'run')))
|
||||
print "<a target=\"_blank\" href=\"../op/op.ViewOnline.php?documentid=".$latestContent->getDocument()->getId()."&version=". $latestContent->getVersion()."\">";
|
||||
} else {
|
||||
if($accessop->check_controller_access('Download', array('action'=>'version')))
|
||||
print "<a href=\"../op/op.Download.php?documentid=".$latestContent->getDocument()->getId()."&version=".$latestContent->getVersion()."\">";
|
||||
}
|
||||
}
|
||||
|
@ -528,7 +530,7 @@ $(document).ready( function() {
|
|||
} else {
|
||||
print "<img class=\"mimeicon\" width=\"".$previewwidthdetail."\" src=\"".$this->getMimeIcon($latestContent->getFileType())."\" title=\"".htmlspecialchars($latestContent->getMimeType())."\">";
|
||||
}
|
||||
if ($file_exists) {
|
||||
if ($file_exists && ($accessop->check_controller_access('ViewOnline', array('action'=>'run')) || $accessop->check_controller_access('Download', array('action'=>'version')))) {
|
||||
print "</a>";
|
||||
}
|
||||
// print "</td>\n";
|
||||
|
@ -572,7 +574,9 @@ $(document).ready( function() {
|
|||
$this->columnStart(4);
|
||||
if ($file_exists){
|
||||
$items = array();
|
||||
if($accessop->check_controller_access('Download', array('action'=>'version')))
|
||||
$items[] = array('link'=>"../op/op.Download.php?documentid=".$latestContent->getDocument()->getId()."&version=".$latestContent->getVersion(), 'icon'=>'download', 'label'=>'download');
|
||||
if($accessop->check_controller_access('ViewOnline', array('action'=>'run')))
|
||||
if ($viewonlinefiletypes && (in_array(strtolower($latestContent->getFileType()), $viewonlinefiletypes) || in_array(strtolower($latestContent->getMimeType()), $viewonlinefiletypes)))
|
||||
$items[] = array('link'=>"../op/op.ViewOnline.php?documentid=".$latestContent->getDocument()->getId()."&version=". $latestContent->getVersion(), 'icon'=>'eye', 'label'=>'view_online', 'target'=>'_blank');
|
||||
if($newitems = $this->callHook('extraVersionViews', $latestContent))
|
||||
|
|
Loading…
Reference in New Issue
Block a user