From 2c3a51ce0c7a256f2e4a3d31780f0b70c356ef19 Mon Sep 17 00:00:00 2001 From: liumengyi Date: Mon, 16 Oct 2023 16:00:38 +0800 Subject: [PATCH] * Modify filelist. --- lib/zin/wg/filelist/v1.php | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/lib/zin/wg/filelist/v1.php b/lib/zin/wg/filelist/v1.php index d0faa664ff..224dcf8e15 100644 --- a/lib/zin/wg/filelist/v1.php +++ b/lib/zin/wg/filelist/v1.php @@ -14,6 +14,9 @@ class fileList extends wg 'showEdit?:bool=true', 'object?:object', 'padding?:bool=true', + 'margin?:bool=true', + 'hasTitle?:bool=true', + 'pt?:string=4', ); public static function getPageCSS(): string|false @@ -35,13 +38,14 @@ class fileList extends wg $showDelete = $this->prop('showDelete'); $showEdit = $this->prop('showEdit'); $object = (object)$this->prop('object'); + $margin = $this->prop('margin'); $fileListView = h::ul(setClass('files-list col relative')); foreach($files as $file) { $fileItemView = li ( - setClass('mb-2'), + $margin ? setClass('mb-2') : null, html($app->loadTarget('file')->printFile($file, $method, $showDelete, $showEdit, $object)) ); @@ -76,15 +80,16 @@ class fileList extends wg $this->fileList() ); + $hasTitle = $this->prop('hasTitle'); return $fieldset ? new section ( - setClass('files', 'pt-4', 'canvas'), + setClass('files', 'pt-' . $this->prop('pt'), 'canvas'), $this->prop('padding') ? setClass($px, $pb) : null, - set::title($lang->files), - to::actions + $hasTitle ? set::title($lang->files) : null, + $hasTitle ? to::actions ( icon('paper-clip'), - ), + ) : null, $fileDiv ) : $fileDiv; }