From 08ffd939a7530c44cd68b455f75175f79698073c Mon Sep 17 00:00:00 2001 From: alecpl Date: Thu, 29 Dec 2011 09:35:01 +0000 Subject: - Add separate pagesize setting for mail messages and contacts (#1488269) --- program/steps/addressbook/func.inc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'program/steps/addressbook/func.inc') diff --git a/program/steps/addressbook/func.inc b/program/steps/addressbook/func.inc index fac8987f8..e7d3eaebe 100644 --- a/program/steps/addressbook/func.inc +++ b/program/steps/addressbook/func.inc @@ -56,6 +56,10 @@ $CONTACT_COLTYPES = array( // TODO: define fields for vcards like GEO, KEY ); +$PAGE_SIZE = $RCMAIL->config->get('addressbook_pagesize'); +if (!$PAGE_SIZE) { + $PAGE_SIZE = $RCMAIL->config->get('pagesize', 50); +} // Addressbook UI if (!$RCMAIL->action && !$OUTPUT->ajax_call) { @@ -108,7 +112,7 @@ if ($undo = $_SESSION['contact_undo']) { // instantiate a contacts object according to the given source function rcmail_contact_source($source=null, $init_env=false, $writable=false) { - global $RCMAIL, $OUTPUT, $CONFIG, $CONTACT_COLTYPES; + global $RCMAIL, $OUTPUT, $CONTACT_COLTYPES, $PAGE_SIZE; if (!strlen($source)) { $source = get_input_value('_source', RCUBE_INPUT_GPC); @@ -116,7 +120,7 @@ function rcmail_contact_source($source=null, $init_env=false, $writable=false) // Get object $CONTACTS = $RCMAIL->get_address_book($source, $writable); - $CONTACTS->set_pagesize($CONFIG['pagesize']); + $CONTACTS->set_pagesize($PAGE_SIZE); // set list properties and session vars if (!empty($_GET['_page'])) @@ -391,7 +395,7 @@ function rcmail_rowcount_display($attrib) function rcmail_get_rowcount_text($result=null) { - global $CONTACTS, $CONFIG; + global $CONTACTS, $PAGE_SIZE; // read nr of contacts if (!$result) { @@ -405,7 +409,7 @@ function rcmail_get_rowcount_text($result=null) 'name' => $_SESSION['contactcountdisplay'] ? $_SESSION['contactcountdisplay'] : 'contactsfromto', 'vars' => array( 'from' => $result->first + 1, - 'to' => min($result->count, $result->first + $CONFIG['pagesize']), + 'to' => min($result->count, $result->first + $PAGE_SIZE), 'count' => $result->count) )); -- cgit v1.2.3