* Modify filelist.

This commit is contained in:
liumengyi
2023-10-16 16:00:38 +08:00
parent d299c97d42
commit 2c3a51ce0c
+10 -5
View File
@@ -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;
}