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)

This commit is contained in:
Josh Sutinen 2010-05-23 15:48:07 -04:00 committed by Shish
parent 449adbaff8
commit 9918c1119c

View File

@ -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);
}