var $nbfields;
// the field for sorting entries
var $sortfield;
+ var $sortdesc = false;
// action to do to delete row:
// null => delete effectively, false => no deletion, SQL
var $delete_action;
if (isset($this->sortfield)) {
// add this sort order after the others (chosen by dev)
$this->add_sort_field($this->sortfield);
+ if (substr($this->sortfield,-5) == ' DESC') {
+ $this->sortfield = substr($this->sortfield,0,-5);
+ $this->sortdesc = true;
+ }
}
if (count($this->sort) > 0) {
$sort = 'ORDER BY ' . join($this->sort, ',');
<table class="bicol">
<tr>
{foreach from=$t->vars item=myval key=myvar}{if $myval.display}
- <th style="cursor:pointer" onclick="redirect('{$t->pl}/sort{if $t->sortfield eq $myvar}desc{/if}/{$myvar}')">{$myval.desc}</th>
+ <th style="cursor:pointer" onclick="redirect('{$t->pl}/sort{if $t->sortfield eq $myvar && !$t->sortdesc}desc{/if}/{$myvar}')">{$myval.desc}{if $t->sortfield eq $myvar}<img src="images/{if $t->sortdesc}up{else}dn{/if}.png"/>{/if}</th>
{/if}{/foreach}
{if !$hideactions}
<th>action</th>