From: x2001corpet Date: Mon, 16 Oct 2006 13:01:38 +0000 (+0000) Subject: petite icone pour specifier le tri dans le table-editor X-Git-Tag: xorg/0.9.12~201 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=386b75eab9e8f1611b2e5f1e7aa3a4ab3da4dbf4;p=platal.git petite icone pour specifier le tri dans le table-editor git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@984 839d8a87-29fc-0310-9880-83ba4fa771e5 --- diff --git a/classes/pltableeditor.php b/classes/pltableeditor.php index a2ea533..39eb9e7 100644 --- a/classes/pltableeditor.php +++ b/classes/pltableeditor.php @@ -38,6 +38,7 @@ class PLTableEditor { 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; @@ -221,6 +222,10 @@ class PLTableEditor { 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, ','); diff --git a/templates/table-editor.tpl b/templates/table-editor.tpl index df4100f..6040137 100644 --- a/templates/table-editor.tpl +++ b/templates/table-editor.tpl @@ -34,7 +34,7 @@ {foreach from=$t->vars item=myval key=myvar}{if $myval.display} - + {/if}{/foreach} {if !$hideactions}
{$myval.desc}{$myval.desc}{if $t->sortfield eq $myvar}{/if}action