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
|
// add default ordering by given fields
|
||||||
if (count($fields) > 0) {
|
if (count($fields) > 0) {
|
||||||
$orderfields = array_keys($fields);
|
$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
|
// check for possible sorting values and keep it
|
||||||
$orderstr = '';
|
$orderstr = '';
|
||||||
foreach ($this->fields as $fieldname => $fieldcaption) {
|
if (!empty($this->sortfield)) {
|
||||||
$fieldname = htmlspecialchars($fieldname);
|
$fieldname = htmlspecialchars($this->sortfield);
|
||||||
$orderstr .= '&sortfield=' . $fieldname . '&sortorder=' . $this->sortorder;
|
$orderstr .= '&sortfield=' . $fieldname . '&sortorder=' . $this->sortorder;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user