* [task#136277,doing,2h] get downloadLink and previewLink.

This commit is contained in:
liumengyi
2025-02-11 10:39:55 +08:00
committed by 田淑杰
parent fb13931c0a
commit 3f47c32fda
+17
View File
@@ -101,6 +101,22 @@ class history extends wg
$className = $this->props->class->toStr();
if($panel && empty($className)) $className = 'canvas py-1 px-2 overflow-visible';
$className .= ' break-all';
$fileListProps = array();
$fileListProps['fileUrl'] = '#file?id={id}';
$fileListProps['hoverItemActions'] = true;
global $lang, $app;
$app->control->loadModel('file');
$previewLink = $downloadLink = '';
$canDownload = common::hasPriv('file', 'download');
if($canDownload)
{
$previewLink = helper::createLink('file', 'download', "fileID={id}&mouse=left");
$downloadLink = helper::createLink('file', 'download', "fileID={id}");
$downloadLink .= strpos($downloadLink, '?') === false ? '?' : '&';
$downloadLink .= session_name() . '=' . session_id();
}
return zui::historyPanel
(
@@ -109,6 +125,7 @@ class history extends wg
set::objectType($objectType),
set::actions($actions),
set::title($title),
set::fileListProps($fileListProps),
$canEditComment ? set::editCommentUrl($editCommentUrl) : null,
$canComment ? set::commentUrl($commentUrl) : null,
set::commentBtn($canComment && !common::isTutorialMode() ? $commentBtn : false),