Make Sorting Switchable
This commit is contained in:
parent
0dbe0be78c
commit
12010ee2db
2 changed files with 10 additions and 2 deletions
|
@ -82,8 +82,11 @@ if (isset($_GET['f'])) {
|
|||
|
||||
// Sort and Reverse Filelist
|
||||
natcasesort($files);
|
||||
if ($sort == 1)
|
||||
if ($sort == 1) {
|
||||
$files = array_reverse($files);
|
||||
} else {
|
||||
$files = array_values($files);
|
||||
}
|
||||
|
||||
if (!empty($dirs))
|
||||
$files = array_merge($dirs, $files);
|
||||
|
|
|
@ -49,7 +49,12 @@
|
|||
<a id="link-first" href="/index.php?d={{ $dir }}&so={{ $sort }}&p=1&s={{ $slice }}{{ $filter }}">1</a>
|
||||
<a id="link-prev" href="/index.php?d={{ $dir }}&so={{ $sort }}&p={{ $prev_page }}&s={{ $slice }}{{ $filter }}"><i class="fa fa-caret-left"></i></a>
|
||||
{% endif %}
|
||||
<span class="info">{{ $page }}</span>
|
||||
|
||||
{% if ($sort == 1): %}
|
||||
<a class="info" href="/index.php?d={{ $dir }}&so=0&p={{ page }}&s={{ $slice }}{{ $filter }}">{<i class="fa fa-caret-down"></i>{ $page }}</a>
|
||||
{% else: %}
|
||||
<a class="info" href="/index.php?d={{ $dir }}&so=1&p={{ page }}&s={{ $slice }}{{ $filter }}">{<i class="fa fa-caret-up"></i>{ $page }}</a>
|
||||
{% endif %}
|
||||
{% if ($page < $last_page): %}
|
||||
<a id="link-next" href="/index.php?d={{ $dir }}&so={{ $sort }}&p={{ $next_page }}&s={{ $slice }}{{ $filter }}"><i class="fa fa-caret-right"></i></a>
|
||||
<a id="link-last" href="/index.php?d={{ $dir }}&so={{ $sort }}&p={{ $last_page }}&s={{ $slice }}{{ $filter }}">{{ $last_page }}</a>
|
||||
|
|
Loading…
Reference in a new issue