add back button and show zip list

This commit is contained in:
Dennis Eichhorn 2021-02-20 21:18:48 +01:00
parent 65fdcbee93
commit f8215f4d22
3 changed files with 22 additions and 4 deletions

View File

@ -11,15 +11,18 @@
<div class="tab-content">
<input type="radio" id="media-c-tab-1" name="tabular-1" checked>
<div class="tab">
<table class="default">
<?php
$archive = new ZipArchive();
$archive->open(($this->media->isAbsolute ? '' : __DIR__ . '/../../../../../../') . $this->media->getPath());
for( $i = 0; $i < $archive->numFiles; $i++ ){
$stat = $archive->statIndex( $i );
print_r( basename( $stat['name'] ) . PHP_EOL );
for($i = 0; $i < $archive->numFiles; ++$i) {
$stat = $archive->statIndex($i);
echo '<tr><td>' . \str_repeat('&nbsp;', (\substr_count(\trim($stat['name'], '/'), '/')) * 8) . $stat['name'];
}
?>
</table>
</div>
<input type="radio" id="media-c-tab-2" name="tabular-1">
<div class="tab">

View File

@ -52,12 +52,17 @@ $next = empty($media) ? '{/prefix}media/list' : '{/prefix}media/list?{?}&id=
$subPath = '';
$paths = \explode('/', \ltrim($mediaPath, '/'));
$length = \count($paths);
$parentPath = '';
for ($i = 0; $i < $length; ++$i) :
if ($paths[$i] === '') {
continue;
}
if ($i === $length - 1) {
$parentPath = $subPath === '' ? '/' : $subPath;
}
$subPath .= '/' . $paths[$i];
$url = UriFactory::build('{/prefix}media/list?path=' . $subPath);
@ -83,6 +88,16 @@ $next = empty($media) ? '{/prefix}media/list' : '{/prefix}media/list?{?}&id=
<td><?= $this->getHtml('Creator'); ?>
<td><?= $this->getHtml('Created'); ?>
<tbody>
<?php if (!empty($parentPath)) : $url = UriFactory::build('{/prefix}media/list?path=' . $parentPath); ?>
<tr tabindex="0" data-href="<?= $url; ?>">
<td data-label="<?= $this->getHtml('Type'); ?>"><a href="<?= $url; ?>"><i class="fa fa-folder-open-o"></i></a>
<td data-label="<?= $this->getHtml('Name'); ?>"><a href="<?= $url; ?>">..
</a>
<td>
<td>
<td>
<td>
<?php endif; ?>
<?php $count = 0;
foreach ($media as $key => $value) :
++$count;

View File

@ -25,7 +25,7 @@ $fileIconFunction = function (int $extensionType) : string
} elseif ($extensionType === ExtensionType::PDF) {
return 'file-pdf-o';
} elseif ($extensionType === ExtensionType::ARCHIVE) {
return 'file-zip';
return 'file-zip-o';
} elseif ($extensionType === ExtensionType::AUDIO) {
return 'file-audio-o';
} elseif ($extensionType === ExtensionType::VIDEO) {