mirror of
https://github.com/Karaka-Management/oms-Media.git
synced 2026-01-29 09:08:41 +00:00
Fix media file list bugs
This commit is contained in:
parent
822cd3ebbe
commit
b9239beaa3
|
|
@ -140,7 +140,8 @@ class UploadFile
|
|||
$result[$key]['extension'] = $extension;
|
||||
|
||||
if ($this->preserveFileName) {
|
||||
$this->fileName = $f['name'];
|
||||
$this->fileName = $f['name'];
|
||||
$result[$key]['filename'] = $this->fileName;
|
||||
}
|
||||
|
||||
if (empty($this->fileName) || \file_exists($path . '/' . $this->fileName)) {
|
||||
|
|
|
|||
|
|
@ -61,9 +61,13 @@ echo $this->getData('nav')->render();
|
|||
<td><?= $this->getHtml('Creator') ?>
|
||||
<td><?= $this->getHtml('Created') ?>
|
||||
<tbody>
|
||||
<?php if (!is_dir($media->getPath())) : foreach ($media as $key => $value) :
|
||||
$url = UriFactory::build('/{/lang}/backend/media/single?{?}&id=' . $value->getId());
|
||||
$icon = $this->fileIconFunction(FileUtils::getExtensionType($value->getExtension()));
|
||||
<?php
|
||||
if (!is_dir($media->isAbsolute() ? $path : __DIR__ . '/../../../' . \ltrim($media->getPath(), '//'))
|
||||
|| $media->getPath() === ''
|
||||
) :
|
||||
foreach ($media as $key => $value) :
|
||||
$url = UriFactory::build('/{/lang}/backend/media/single?{?}&id=' . $value->getId());
|
||||
$icon = $fileIconFunction(FileUtils::getExtensionType($value->getExtension()));
|
||||
?>
|
||||
<tr data-href="<?= $url; ?>">
|
||||
<td><a href="<?= $url; ?>"><i class="fa fa-<?= $this->printHtml($icon); ?>"></i></a>
|
||||
|
|
@ -103,12 +107,12 @@ echo $this->getData('nav')->render();
|
|||
<?php else : ?>
|
||||
<button class="floatRight">Edit</button>
|
||||
|
||||
<?php if (!\file_exists($media->isAbsolute() ? $path : __DIR__ . '/../../../../' . $path)) : ?>
|
||||
<?php if (!\file_exists($media->isAbsolute() ? $path : __DIR__ . '/../../../' . \ltrim($path, '/'))) : ?>
|
||||
<div class="centerText"><i class="fa fa-question fa-5x"></i></div>
|
||||
<?php else : ?>
|
||||
<pre>
|
||||
<?php
|
||||
$output = $this->lineContentFunction($media->isAbsolute() ? $path : __DIR__ . '/../../../../' . $path);
|
||||
$output = $this->lineContentFunction($media->isAbsolute() ? $path : __DIR__ . '/../../../' . \ltrim($path, '/'));
|
||||
foreach ($output as $line) : ?><span><?= $this->printHtml($line); ?></span><?php endforeach; ?>
|
||||
</pre>
|
||||
<?php endif; ?>
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user