mirror of
https://github.com/Karaka-Management/oms-Media.git
synced 2026-02-15 00:38: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;
|
$result[$key]['extension'] = $extension;
|
||||||
|
|
||||||
if ($this->preserveFileName) {
|
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)) {
|
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('Creator') ?>
|
||||||
<td><?= $this->getHtml('Created') ?>
|
<td><?= $this->getHtml('Created') ?>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php if (!is_dir($media->getPath())) : foreach ($media as $key => $value) :
|
<?php
|
||||||
$url = UriFactory::build('/{/lang}/backend/media/single?{?}&id=' . $value->getId());
|
if (!is_dir($media->isAbsolute() ? $path : __DIR__ . '/../../../' . \ltrim($media->getPath(), '//'))
|
||||||
$icon = $this->fileIconFunction(FileUtils::getExtensionType($value->getExtension()));
|
|| $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; ?>">
|
<tr data-href="<?= $url; ?>">
|
||||||
<td><a href="<?= $url; ?>"><i class="fa fa-<?= $this->printHtml($icon); ?>"></i></a>
|
<td><a href="<?= $url; ?>"><i class="fa fa-<?= $this->printHtml($icon); ?>"></i></a>
|
||||||
|
|
@ -103,12 +107,12 @@ echo $this->getData('nav')->render();
|
||||||
<?php else : ?>
|
<?php else : ?>
|
||||||
<button class="floatRight">Edit</button>
|
<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>
|
<div class="centerText"><i class="fa fa-question fa-5x"></i></div>
|
||||||
<?php else : ?>
|
<?php else : ?>
|
||||||
<pre>
|
<pre>
|
||||||
<?php
|
<?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; ?>
|
foreach ($output as $line) : ?><span><?= $this->printHtml($line); ?></span><?php endforeach; ?>
|
||||||
</pre>
|
</pre>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user