From 60a3a09828c2e04f202998bc967e882a58cf4f39 Mon Sep 17 00:00:00 2001 From: fusionate Date: Wed, 18 Nov 2020 16:23:40 -0700 Subject: [PATCH] Functions - th_order_by: Order column asc on first click. --- resources/functions.php | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/resources/functions.php b/resources/functions.php index 4e5ba4d647..bf9569d7eb 100644 --- a/resources/functions.php +++ b/resources/functions.php @@ -438,12 +438,18 @@ if (strlen($order_by) == 0) { $order = 'asc'; } - if ($order == "asc") { - $description .= $text['label-order'].': '.$text['label-ascending']; - $html .= "".escape($column_title).""; + if ($order_by == $field_name) { + if ($order == "asc") { + $description .= $text['label-order'].' '.$text['label-descending']; + $html .= "".escape($column_title).""; + } + else { + $description .= $text['label-order'].' '.$text['label-ascending']; + $html .= "".escape($column_title).""; + } } else { - $description .= $text['label-order'].': '.$text['label-descending']; + $description .= $text['label-order'].' '.$text['label-ascending']; $html .= "".escape($column_title).""; } $html .= "";