From 58e7432fcaad96068187bb2a76dea39bc75cef49 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Mon, 24 Jul 2006 21:45:16 +0000 Subject: [PATCH] r939: Making the sort order cross pages --- includes/class_sort.php | 7 ++++--- index.php | 7 ++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/includes/class_sort.php b/includes/class_sort.php index 3bf68a0..2c0c38d 100644 --- a/includes/class_sort.php +++ b/includes/class_sort.php @@ -212,7 +212,7 @@ class ListSorter foreach ($return AS $key => $nil) { - $return["$key"] = array('image' => ($this->sortkey == $key ? $this->fetch_sort_image() : ''), 'href' => $this->fetch_sort_link($key, $params)); + $return["$key"] = array('image' => ($this->sortkey == $key ? $this->fetch_sort_image() : ''), 'href' => $this->fetch_sort_link($key, $params, true)); } return $return; @@ -240,17 +240,18 @@ class ListSorter * * @param string Sorting key * @param string Additional GET parameters + * @param bool Highlight the current sortkey if that's passed? * * @return string HREF */ - function fetch_sort_link($key, $params = null) + function fetch_sort_link($key, $params = null, $highlight = false) { if ($params) { $params .= '&'; } - return $this->page . '.php?' . $params . 'by=' . $key . '&as=' . ($this->sortkey == $key ? $this->fetch_opposite_sort_direction() . '" class="select' : $this->fetch_sort_direction()); + return $this->page . '.php?' . $params . 'by=' . $key . '&as=' . (($this->sortkey == $key AND $highlight) ? $this->fetch_opposite_sort_direction() . '" class="select' : $this->fetch_sort_direction()); } // ################################################################### diff --git a/index.php b/index.php index 0954748..1514235 100644 --- a/index.php +++ b/index.php @@ -52,15 +52,11 @@ $count = $db->query_first(" AND status NOT IN (" . (isset($bugsys->userinfo['hidestatuses']) ? $bugsys->userinfo['hidestatuses'] : $bugsys->options['hidestatuses']) . ")" : "") ); -echo $sort->fetch_sql_query(null, $pagination->fetch_limit($pagination->page - 1) . ", " . $pagination->perpage); - $pagination->total = $count['count']; $pagination->split_pages(); $bugs_fetch = $db->query($sort->fetch_sql_query(null, $pagination->fetch_limit($pagination->page - 1) . ", " . $pagination->perpage)); -$order = $sort->fetch_display_array('p=' . $pagination->page . '&pp=' . $pagination->perpage); - while ($bug = $db->fetch_array($bugs_fetch)) { $funct->exec_swap_bg($stylevar['alt_colour'], ''); @@ -84,8 +80,9 @@ while ($bug = $db->fetch_array($bugs_fetch)) $db->free_result($bugs_fetch); +$order = $sort->fetch_display_array('p=' . $pagination->page . '&pp=' . $pagination->perpage); $show['pagenav'] = (($pagination->pagecount > 1) ? true : false); -$pagenav = $pagination->construct_page_nav('index.php'); +$pagenav = $pagination->construct_page_nav($sort->fetch_sort_link($sort->sortkey)); eval('$template->flush("' . $template->fetch('trackerhome') . '");'); -- 2.22.5