aboutsummaryrefslogtreecommitdiff
path: root/app/view/templates/media.php
diff options
context:
space:
mode:
Diffstat (limited to 'app/view/templates/media.php')
-rw-r--r--app/view/templates/media.php32
1 files changed, 31 insertions, 1 deletions
diff --git a/app/view/templates/media.php b/app/view/templates/media.php
index f81b507..7b2fbc1 100644
--- a/app/view/templates/media.php
+++ b/app/view/templates/media.php
@@ -45,10 +45,38 @@ treecount($dirlist, 'media', 0, 'media', $dir, $opt);
+
</table>
+
+
+<h2>filter</h2>
+
+<form action="" method="get">
+ <ul>
+ <li><input type="checkbox" name="type[]" id="image" value="image" <?= in_array('image', $opt['type']) ? 'checked' : '' ?>><label for="image">image</label></li>
+ <li><input type="checkbox" name="type[]" id="sound" value="sound" <?= in_array('sound', $opt['type']) ? 'checked' : '' ?>><label for="sound">sound</label></li>
+ <li><input type="checkbox" name="type[]" id="video" value="video" <?= in_array('video', $opt['type']) ? 'checked' : '' ?>><label for="video">video</label></li>
+ <li><input type="checkbox" name="type[]" id="other" value="other" <?= in_array('other', $opt['type']) ? 'checked' : '' ?>><label for="other">other</label></li>
+ </ul>
+ <select name="" id="">
+ <option value="id" <?= $opt['sortby'] === 'id' ? 'selected' : '' ?>>id</option>
+ <option value="type" <?= $opt['sortby'] === 'type' ? 'selected' : '' ?>>type</option>
+ <option value="size" <?= $opt['sortby'] === 'size' ? 'selected' : '' ?>>size</option>
+ </select>
+ </br>
+ <input type="radio" name="order" id="asc" value="1" <?= $opt['order'] == 1 ? 'checked' : '' ?>><label for="asc">ascending</label>
+ </br>
+ <input type="radio" name="order" id="desc" value="-1" <?= $opt['order'] == -1 ? 'checked' : '' ?>><label for="desc">descending</label>
+ </br>
+ <input type="hidden" name="path" value="<?= $dir ?>">
+ <input type="submit" value="filter">
+ </form>
+
</div>
+
+
<div id="explorer">
@@ -71,12 +99,13 @@ treecount($dirlist, 'media', 0, 'media', $dir, $opt);
<?php
foreach ($medialist as $media) {
+ if(in_array($media->type(), $opt['type'])) {
?>
<tr>
<td><input type="checkbox" name="id[]" value="<?= $media->getfulldir() ?>" form="mediaedit" id="media_<?= $media->id() ?>"></td>
<td><label for="media_<?= $media->id() ?>"><?= $media->id() ?></label></td>
<td><?= $media->extension() ?></td>
- <td><a href="<?= $media->getfullpath() ?>" target="_blank"><?= $media->type() == 'image' ? '<span class="thumbnail">image 👁<img src="' . $media->getfullpath() . '"></span>' : $media->type() ?></a></td>
+ <td><a href="<?= $media->getfullpath() ?>" target="_blank"><?= $media->type() == 'image' ? '<span class="thumbnail">image 👁<img src="' . $media->getfullpath() . '"></span>' : '⧉ ' . $media->type() ?></a></td>
<td><?= $media->size('hr') ?></td>
<td><?= $media->width() ?></td>
<td><?= $media->height() ?></td>
@@ -84,6 +113,7 @@ foreach ($medialist as $media) {
<td class="code"><code><?= $media->getcode() ?></code></td>
</tr>
<?php
+ }
}