From f1d3bec16d6ac74a5485ed33390c8dcd16a97448 Mon Sep 17 00:00:00 2001 From: Josh Sutinen Date: Sun, 23 May 2010 15:48:07 -0400 Subject: [PATCH] Paginator link code was ugly, if no filter criteria were set it would dump "&&&" at the end of the query string. This makes it look prettier. (v2 of fix) --- contrib/log_db/theme.php | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/contrib/log_db/theme.php b/contrib/log_db/theme.php index ba4bc183..6ac2d3a1 100644 --- a/contrib/log_db/theme.php +++ b/contrib/log_db/theme.php @@ -66,7 +66,19 @@ class LogDatabaseTheme extends Themelet { $page->add_block(new NavBlock()); $page->add_block(new Block("Events", $table)); - $args = $this->ueie("time")."&".$this->ueie("module")."&".$this->ueie("user")."&".$this->ueie("priority"); + $args = ""; + // Check if each arg is actually empty and skip it if so + if(strlen($this->ueie("time"))) + $args .= $this->ueie("time")."&"; + if(strlen($this->ueie("module"))) + $args .= $this->ueie("module")."&"; + if(strlen($this->ueie("user"))) + $args .= $this->ueie("user")."&"; + if(strlen($this->ueie("priority"))) + $args .= $this->ueie("priority"); + // If there are no args at all, set $args to null to prevent an unnecessary ? at the end of the paginator url + if(strlen($args) == 0) + $args = null; $this->display_paginator($page, "log/view", $args, $page_num, $page_total); }