X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=classes%2Fpltableeditor.php;h=39eb9e751cd2b8c44f57951adcd00c4f87b99dd7;hb=386b75eab9e8f1611b2e5f1e7aa3a4ab3da4dbf4;hp=a2ea5333934c677ca1afcae28e7b8937fa269569;hpb=de61dbcf4475d1182220ae6ac1759d6a5bf7acbd;p=platal.git 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, ',');