diff --git a/wacko/action/files.php b/wacko/action/files.php
index 6a8816b89..4494026ea 100644
--- a/wacko/action/files.php
+++ b/wacko/action/files.php
@@ -49,6 +49,7 @@
$phrase = (string) ($_GET['phrase'] ?? '');
$type_id = (int) ($_GET['type_id'] ?? $type_id);
$category_id = (int) @$_GET['category_id'];
+$filter = $_GET['files'] ?? null;
$file_link = (int) $linked;
$order_by = "file_name ASC";
@@ -202,7 +203,7 @@
if (($results || $phrase) && $form)
{
// search
- $files_filter = (isset($_GET['files']) && in_array($_GET['files'], ['all', 'cluster', 'global', 'linked'])) ? $_GET['files'] : '';
+ $files_filter = (isset($filter) && in_array($filter, ['all', 'cluster', 'global', 'linked'])) ? $filter : '';
$tpl->s_filter = $files_filter;
$tpl->s_phrase = Ut::html($phrase);
@@ -216,10 +217,11 @@
$tpl->mark_results = $results . ' of ' . $count['n'] . ' ' . $title;
}
- $tpl->style = $style;
-
if ($results)
{
+ $tpl->enter('r_');
+ $tpl->style = $style;
+
foreach ($files as $file)
{
// check for local file
@@ -264,7 +266,7 @@
$link = $this->link($path2 . $file_name, '', $text, '', $track);
- $tpl->enter('r_');
+ $tpl->enter('n_');
// display file
$tpl->link = $link;
@@ -273,7 +275,7 @@
{
// get context for filter
$method_filter = $this->method == 'show' ? '' : $this->method;
- $param_filter = (isset($_GET['files']) && in_array($_GET['files'], ['all', 'cluster', 'global', 'linked'])) ? ['files' => $_GET['files']] : [];
+ $param_filter = (isset($filter) && in_array($filter, ['all', 'cluster', 'global', 'linked'])) ? ['files' => $filter] : [];
// display picture meta data
#$tpl->p_file = $file; // result array: [ ' file.file_id ' ]
@@ -315,14 +317,16 @@
$tpl->i_class = $icon[1];
}
- $tpl->leave(); // r_
+ $tpl->leave(); // n_
unset($link, $desc);
}
+
+ $tpl->leave(); // r_
}
else
{
- $tpl->message = '' . $this->_t('NoAttachments') . '
';
+ $tpl->message = '' . $this->_t('NoAttachments') . '
';
}
unset($files);
diff --git a/wacko/action/template/files.tpl b/wacko/action/template/files.tpl
index 8e98dd997..d91be0f98 100644
--- a/wacko/action/template/files.tpl
+++ b/wacko/action/template/files.tpl
@@ -1,5 +1,4 @@
[ === main === ]
- [ ' message ' ]
[ '' pagination '' ]
[= s =