formatting fixes, bug fixes and support impl.

This commit is contained in:
Dennis Eichhorn 2021-07-04 18:27:21 +02:00
parent 2ad2ba3d7a
commit d744862c9e
2 changed files with 13 additions and 3 deletions

View File

@ -231,7 +231,7 @@ final class ApiController extends Controller
}
$uploaded = $this->app->moduleManager->get('Media')->uploadFiles(
$request->getData('name') ?? '',
[$request->getData('name') ?? ''],
$uploadedFiles,
$request->header->account,
__DIR__ . '/../../../Modules/Media/Files/Modules/Editor/' . ($request->getData('doc') ?? '0'),

View File

@ -54,8 +54,18 @@ echo $this->getData('nav')->render(); ?>
<?php if (!empty($files)) : ?>
<div class="portlet-foot">
<ul>
<?php foreach ($files as $file) : ?>
<li><?= $this->printHtml($file->name); ?>
<?php foreach ($files as $file) :
$url = $file->extension === 'collection'
? UriFactory::build('{/prefix}media/list?path=' . \rtrim($file->getVirtualPath(), '/') . '/' . $file->name)
: UriFactory::build('{/prefix}media/single?id=' . $file->getId()
. '&path={?path}' . (
$file->getId() === 0
? '/' . $file->name
: ''
)
);
?>
<li><a href="<?= $url; ?>"><?= $this->printHtml($file->name); ?></a>
<?php endforeach; ?>
</ul>
</div>