fix sort-ordering parameter for pagination
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -82,7 +82,8 @@ class Pagination
|
||||
// add default ordering by given fields
|
||||
if (count($fields) > 0) {
|
||||
$orderfields = array_keys($fields);
|
||||
$this->addOrderBy($orderfields[0]);
|
||||
$this->sortfield = $orderfields[0];
|
||||
$this->addOrderBy($orderfields[0], $this->sortorder);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -287,8 +288,8 @@ class Pagination
|
||||
|
||||
// check for possible sorting values and keep it
|
||||
$orderstr = '';
|
||||
foreach ($this->fields as $fieldname => $fieldcaption) {
|
||||
$fieldname = htmlspecialchars($fieldname);
|
||||
if (!empty($this->sortfield)) {
|
||||
$fieldname = htmlspecialchars($this->sortfield);
|
||||
$orderstr .= '&sortfield=' . $fieldname . '&sortorder=' . $this->sortorder;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user