mirror of
https://github.com/zyx0814/dzzoffice.git
synced 2025-01-07 03:16:58 +08:00
preview前缀相关支持
This commit is contained in:
parent
50af954621
commit
f61cfa2cc6
@ -190,6 +190,9 @@ class io_dzz extends io_api
|
||||
public function getFileUri($path, $fop = '')
|
||||
{
|
||||
global $_G;
|
||||
if (strpos($path, 'preview_') === 0) {
|
||||
$path = preg_replace('/^preview_/', '', $path);
|
||||
}
|
||||
if (strpos($path, 'attach::') === 0) {
|
||||
$attach = C::t('attachment')->fetch(intval(str_replace('attach::', '', $path)));
|
||||
Hook::listen('io_dzz_getstream_attach',$attach);//挂载点
|
||||
@ -442,6 +445,9 @@ class io_dzz extends io_api
|
||||
public function setFileContent($rid, $fileContent, $force = false, $nocover = true)
|
||||
{
|
||||
global $_G;
|
||||
if (strpos($rid, 'preview_') === 0) {
|
||||
$rid = preg_replace('/^preview_/', '', $rid);
|
||||
}
|
||||
if (!$icoarr = C::t('resources')->fetch_by_rid($rid)) {
|
||||
return array('error' => lang('file_not_exist'));
|
||||
}
|
||||
|
@ -75,7 +75,8 @@ if($_GET['a']=='down'){
|
||||
}, $url);
|
||||
//添加path参数;
|
||||
if(strpos($url,'?')!==false && strpos($url,'path=')===false){
|
||||
$url.='&path='.$icoarr['icoid'];
|
||||
$path = $path ? $path : $_GET['s'];
|
||||
$url.='&path=' . dzzencode('preview_' . $path);
|
||||
}
|
||||
$url = $_G['siteurl'].$url;
|
||||
@header("Location: $url");
|
||||
|
Loading…
Reference in New Issue
Block a user