From d404b8e5317983378310cc47a63efc7586080bda Mon Sep 17 00:00:00 2001 From: Christian Boltz Date: Tue, 28 Sep 2010 20:30:56 +0000 Subject: [PATCH] list-virtual.php: - include $search in pagebrowser navigation links - replace deprecated split() with explode() - fix typo - $GLOABLS instead of $GLOBALS git-svn-id: https://svn.code.sf.net/p/postfixadmin/code/trunk@870 a1433add-5e2c-0410-b055-b7f2511e0802 --- list-virtual.php | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/list-virtual.php b/list-virtual.php index 732b74e1..be4b6367 100644 --- a/list-virtual.php +++ b/list-virtual.php @@ -246,7 +246,7 @@ if ($result['rows'] > 0) while ($row = db_array ($result['result'])) { if ($display_mailbox_aliases) { - $goto_split = split(",", $row['goto']); + $goto_split = explode(",", $row['goto']); $row['goto_mailbox'] = 0; $row['goto_other'] = array(); @@ -345,17 +345,22 @@ if ((is_array ($tMailbox) and sizeof ($tMailbox) > 0)) class cNav_bar { - var $count, $title, $limit, $page_size, $pages; //* arguments + var $count, $title, $limit, $page_size, $pages, $search; //* arguments var $url; //* manually var $fInit, $arr_prev, $arr_next, $arr_top; //* internal var $anchor; - function cNav_bar ($aCount, $aTitle, $aLimit, $aPage_size, $aPages) + function cNav_bar ($aCount, $aTitle, $aLimit, $aPage_size, $aPages, $aSearch) { $this->count = $aCount; $this->title = $aTitle; $this->limit = $aLimit; $this->page_size = $aPage_size; $this->pages = $aPages; + if ($aSearch == "") { + $this->search = ""; + } else { + $this->search = "&search=$aSearch"; + } $this->url = ''; $this->fInit = false; } @@ -363,9 +368,9 @@ class cNav_bar { $this->anchor = 'a'.substr ($this->title, 3); $this->url .= '#'.$this->anchor; - ($this->limit >= $this->page_size) ? $this->arr_prev = ' '.$GLOBALS ['PALANG']['pOverview_left_arrow'].' ' : $this->arr_prev = ''; - ($this->limit > 0) ? $this->arr_top = ' '.$GLOABLS ['PALANG']['pOverview_up_arrow'].' ' : $this->arr_top = ''; - (($this->limit + $this->page_size) < ($this->count * $this->page_size)) ? $this->arr_next = ' '.$GLOBALS ['PALANG']['pOverview_right_arrow'].' ' : $this->arr_next = ''; + ($this->limit >= $this->page_size) ? $this->arr_prev = ' '.$GLOBALS ['PALANG']['pOverview_left_arrow'].' ' : $this->arr_prev = ''; + ($this->limit > 0) ? $this->arr_top = ' '.$GLOBALS ['PALANG']['pOverview_up_arrow'].' ' : $this->arr_top = ''; + (($this->limit + $this->page_size) < ($this->count * $this->page_size)) ? $this->arr_next = ' '.$GLOBALS ['PALANG']['pOverview_right_arrow'].' ' : $this->arr_next = ''; $this->fInit = true; } function display_pre () @@ -400,7 +405,7 @@ class cNav_bar $lPage = $this->pages [$i]; if ($i == $highlight_at) $lPage = ''.$lPage.''; - $ret_val .= ''.$lPage.''."\n"; + $ret_val .= ''.$lPage.''."\n"; } $ret_val .= ''; @@ -430,10 +435,10 @@ class cNav_bar } } -$nav_bar_alias = new cNav_bar ($limit['alias_pgindex_count'], $PALANG['pOverview_alias_title'], $fDisplay, $CONF['page_size'], $limit['alias_pgindex']); +$nav_bar_alias = new cNav_bar ($limit['alias_pgindex_count'], $PALANG['pOverview_alias_title'], $fDisplay, $CONF['page_size'], $limit['alias_pgindex'], $search); $nav_bar_alias->url = '&domain='.$fDomain; -$nav_bar_mailbox = new cNav_bar ($limit['mbox_pgindex_count'], $PALANG['pOverview_mailbox_title'], $fDisplay, $CONF['page_size'], $limit['mbox_pgindex']); +$nav_bar_mailbox = new cNav_bar ($limit['mbox_pgindex_count'], $PALANG['pOverview_mailbox_title'], $fDisplay, $CONF['page_size'], $limit['mbox_pgindex'], $search); $nav_bar_mailbox->url = '&domain='.$fDomain; //print $nav_bar_alias->display_top ();