diff --git a/example/includes/templates.php b/example/includes/templates.php
index ee9270c..f5c41f0 100644
--- a/example/includes/templates.php
+++ b/example/includes/templates.php
@@ -5,6 +5,8 @@ use EesyPHP\Date;
use EesyPHP\Hook;
use EesyPHP\Log;
use EesyPHP\Tpl;
+use EesyPHP\Url;
+
use function EesyPHP\format_size;
@@ -70,14 +72,15 @@ Tpl :: register_function('format_size','smarty_format_size');
function smarty_table_ordered_th($params, $smarty) {
if ($params['order'] && $params['url'] && $params['text'] && is_array($params['search'])) {
- $params['url'] .= (strpos($params['url'], '?') === false?'?':'&')."order=".$params['order'];
- echo "".$params['text']."";
+ $params['url'] = Url::add_url_parameter($params['url'], 'order', $params['order']);
+ printf("%s", $params['url'], $params['text']);
}
- if ($params['order']==$params['search']['order']) {
- echo (
- ' ');
+ if ($params['order'] == $params['search']['order']) {
+ printf(
+ ' ',
+ strtolower($params['search']['order_direction']) == 'asc'?
+ 'up':'down'
+ );
}
}
Tpl :: register_function('table_ordered_th','smarty_table_ordered_th');