|
@@ -12,11 +12,53 @@ use Upload\Src\Lib\Img;
|
|
|
|
|
|
class View
|
|
class View
|
|
{
|
|
{
|
|
|
|
+ public function files()
|
|
|
|
+ {
|
|
|
|
+ $data = array();
|
|
|
|
+
|
|
|
|
+ $key = Dever::input('key');
|
|
|
|
+ $cate = Dever::input('cate');
|
|
|
|
+ $name = Dever::input('name');
|
|
|
|
+ $tag = Dever::input('tag');
|
|
|
|
+ $data['cur'] = Dever::input('cur');
|
|
|
|
+ $data['search_pg'] = Dever::input('pg', 1);
|
|
|
|
+
|
|
|
|
+ $param = array();
|
|
|
|
+ $param['upload'] = $key;
|
|
|
|
+ if ($name) {
|
|
|
|
+ $param['source_name'] = $name;
|
|
|
|
+ $param['name'] = $name;
|
|
|
|
+ }
|
|
|
|
+ if ($cate && $cate > 0) {
|
|
|
|
+ $param['cate'] = $cate;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $data['search_cate'] = $cate;
|
|
|
|
+ $data['search_tag'] = $tag;
|
|
|
|
+ $data['search_name'] = $name;
|
|
|
|
+
|
|
|
|
+ $data['file'] = Dever::db('upload/file')->getData($param);
|
|
|
|
+ $data['total'] = Dever::total();
|
|
|
|
+ $data['cate'] = Dever::db('upload/cate')->state();
|
|
|
|
+ $data['config'] = Dever::db('upload/upload')->one($key);
|
|
|
|
+
|
|
|
|
+ if ($data['file']) {
|
|
|
|
+ foreach ($data['file'] as $k => $v) {
|
|
|
|
+ $data['file'][$k]['url'] = Dever::upload('{uploadRes}' . $v['file']);
|
|
|
|
+ $data['file'][$k]['pic'] = Dever::upload('{uploadRes}' . $v['file']);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ $data = Dever::render('show', $data);
|
|
|
|
+ Dever::out($data);
|
|
|
|
+ }
|
|
|
|
+
|
|
public function kindeditorFile()
|
|
public function kindeditorFile()
|
|
{
|
|
{
|
|
$key = Dever::input('key');
|
|
$key = Dever::input('key');
|
|
$param['upload'] = $key;
|
|
$param['upload'] = $key;
|
|
$file = Dever::db('upload/file')->state();
|
|
$file = Dever::db('upload/file')->state();
|
|
|
|
+ $config = Dever::db('upload/upload')->one($key);
|
|
$list = array();
|
|
$list = array();
|
|
if ($file) {
|
|
if ($file) {
|
|
|
|
|
|
@@ -31,6 +73,7 @@ class View
|
|
$list[$i]['is_photo'] = true;
|
|
$list[$i]['is_photo'] = true;
|
|
$list[$i]['filetype'] = str_replace('.', '', $v['ext']);
|
|
$list[$i]['filetype'] = str_replace('.', '', $v['ext']);
|
|
$list[$i]['filename'] = $v['source_name'];
|
|
$list[$i]['filename'] = $v['source_name'];
|
|
|
|
+ $list[$i]['path'] = '';
|
|
$list[$i]['file'] = Dever::upload('{uploadRes}' . $v['file']);
|
|
$list[$i]['file'] = Dever::upload('{uploadRes}' . $v['file']);
|
|
$list[$i]['datetime'] = date('Y-m-d H:i:s', filemtime(Dever::local($list[$i]['file'])));
|
|
$list[$i]['datetime'] = date('Y-m-d H:i:s', filemtime(Dever::local($list[$i]['file'])));
|
|
$i++;
|
|
$i++;
|
|
@@ -40,7 +83,7 @@ class View
|
|
|
|
|
|
$result = array();
|
|
$result = array();
|
|
//相对于根目录的上一级目录
|
|
//相对于根目录的上一级目录
|
|
- $result['moveup_dir_path'] = '';
|
|
|
|
|
|
+ $result['moveup_dir_path'] = $config['id'];
|
|
//相对于根目录的当前目录
|
|
//相对于根目录的当前目录
|
|
$result['current_dir_path'] = '';
|
|
$result['current_dir_path'] = '';
|
|
//当前目录的URL
|
|
//当前目录的URL
|