summaryrefslogtreecommitdiff
path: root/program/steps/settings
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2011-12-29 09:35:01 +0000
committeralecpl <alec@alec.pl>2011-12-29 09:35:01 +0000
commit08ffd939a7530c44cd68b455f75175f79698073c (patch)
treeff3d5dcfef837d47e2a9b5873ef4a864f9da0e4a /program/steps/settings
parent81c2ce9b7b670b05de21f5dcc4be50b70c12fcfc (diff)
- Add separate pagesize setting for mail messages and contacts (#1488269)
Diffstat (limited to 'program/steps/settings')
-rw-r--r--program/steps/settings/func.inc38
-rw-r--r--program/steps/settings/save_prefs.inc23
2 files changed, 39 insertions, 22 deletions
diff --git a/program/steps/settings/func.inc b/program/steps/settings/func.inc
index 032bafd1d..91543ec85 100644
--- a/program/steps/settings/func.inc
+++ b/program/steps/settings/func.inc
@@ -157,7 +157,6 @@ function rcmail_user_prefs($current=null)
$blocks = array(
'main' => array('name' => Q(rcube_label('mainoptions'))),
- 'list' => array('name' => Q(rcube_label('listoptions'))),
);
// language selection
@@ -175,7 +174,7 @@ function rcmail_user_prefs($current=null)
);
}
- // show page size selection
+ // timezone selection
if (!isset($no_override['timezone'])) {
$field_id = 'rcmfd_timezone';
$select_timezone = new html_select(array('name' => '_timezone', 'id' => $field_id,
@@ -276,17 +275,6 @@ function rcmail_user_prefs($current=null)
);
}
- // show page size selection
- if (!isset($no_override['pagesize'])) {
- $field_id = 'rcmfd_pgsize';
- $input_pagesize = new html_inputfield(array('name' => '_pagesize', 'id' => $field_id, 'size' => 5));
-
- $blocks['list']['options']['pagesize'] = array(
- 'title' => html::label($field_id, Q(rcube_label('pagesize'))),
- 'content' => $input_pagesize->show($config['pagesize']),
- );
- }
-
// show drop-down for available skins
if (!isset($no_override['skin'])) {
$skins = rcmail_get_skins();
@@ -378,6 +366,17 @@ function rcmail_user_prefs($current=null)
);
}
+ // show page size selection
+ if (!isset($no_override['pagesize'])) {
+ $field_id = 'rcmfd_pagesize';
+ $input_pagesize = new html_inputfield(array('name' => '_pagesize', 'id' => $field_id, 'size' => 5));
+
+ $blocks['main']['options']['pagesize'] = array(
+ 'title' => html::label($field_id, Q(rcube_label('pagesize'))),
+ 'content' => $input_pagesize->show($config['pagesize']),
+ );
+ }
+
if (!isset($no_override['keep_alive'])) {
$field_id = 'rcmfd_keep_alive';
$select_keep_alive = new html_select(array('name' => '_keep_alive', 'id' => $field_id));
@@ -690,6 +689,19 @@ function rcmail_user_prefs($current=null)
);
}
+ // show addressbook page size selection
+ if (!isset($no_override['addressbook_pagesize'])) {
+ $field_id = 'rcmfd_addressbook_pagesize';
+ $input_pagesize = new html_inputfield(array('name' => '_addressbook_pagesize', 'id' => $field_id, 'size' => 5));
+
+ $size = $config['addressbook_pagesize'] ? $config['addressbook_pagesize'] : $config['pagesize'];
+
+ $blocks['main']['options']['pagesize'] = array(
+ 'title' => html::label($field_id, Q(rcube_label('pagesize'))),
+ 'content' => $input_pagesize->show((int)$size),
+ );
+ }
+
break;
// Special IMAP folders
diff --git a/program/steps/settings/save_prefs.inc b/program/steps/settings/save_prefs.inc
index 5cb79d160..2e89ce1c0 100644
--- a/program/steps/settings/save_prefs.inc
+++ b/program/steps/settings/save_prefs.inc
@@ -31,13 +31,12 @@ switch ($CURR_SECTION)
'language' => isset($_POST['_language']) ? get_input_value('_language', RCUBE_INPUT_POST) : $CONFIG['language'],
'timezone' => isset($_POST['_timezone']) ? (is_numeric($_POST['_timezone']) ? floatval($_POST['_timezone']) : get_input_value('_timezone', RCUBE_INPUT_POST)) : $CONFIG['timezone'],
'dst_active' => isset($_POST['_dst_active']) ? TRUE : FALSE,
- 'pagesize' => is_numeric($_POST['_pagesize']) ? max(2, intval($_POST['_pagesize'])) : $CONFIG['pagesize'],
'date_format' => isset($_POST['_date_format']) ? get_input_value('_date_format', RCUBE_INPUT_POST) : $CONFIG['date_format'],
'time_format' => isset($_POST['_time_format']) ? get_input_value('_time_format', RCUBE_INPUT_POST) : ($CONFIG['time_format'] ? $CONFIG['time_format'] : 'H:i'),
'prettydate' => isset($_POST['_pretty_date']) ? TRUE : FALSE,
'skin' => isset($_POST['_skin']) ? get_input_value('_skin', RCUBE_INPUT_POST) : $CONFIG['skin'],
);
-
+
// compose derived date/time format strings
if ((isset($_POST['_date_format']) || isset($_POST['_time_format'])) && $a_user_prefs['date_format'] && $a_user_prefs['time_format']) {
$a_user_prefs['date_short'] = 'D ' . $a_user_prefs['time_format'];
@@ -54,6 +53,7 @@ switch ($CURR_SECTION)
'mdn_requests' => isset($_POST['_mdn_requests']) ? intval($_POST['_mdn_requests']) : 0,
'keep_alive' => isset($_POST['_keep_alive']) ? intval($_POST['_keep_alive'])*60 : $CONFIG['keep_alive'],
'check_all_folders' => isset($_POST['_check_all_folders']) ? TRUE : FALSE,
+ 'mail_pagesize' => is_numeric($_POST['_mail_pagesize']) ? max(2, intval($_POST['_mail_pagesize'])) : $CONFIG['mail_pagesize'],
);
break;
@@ -93,8 +93,9 @@ switch ($CURR_SECTION)
case 'addressbook':
$a_user_prefs = array(
- 'default_addressbook' => get_input_value('_default_addressbook', RCUBE_INPUT_POST, true),
- 'autocomplete_single' => isset($_POST['_autocomplete_single']) ? TRUE : FALSE,
+ 'default_addressbook' => get_input_value('_default_addressbook', RCUBE_INPUT_POST, true),
+ 'autocomplete_single' => isset($_POST['_autocomplete_single']) ? TRUE : FALSE,
+ 'addressbook_pagesize' => is_numeric($_POST['_addressbook_pagesize']) ? max(2, intval($_POST['_addressbook_pagesize'])) : $CONFIG['addressbook_pagesize'],
);
break;
@@ -150,11 +151,15 @@ switch ($CURR_SECTION)
$OUTPUT->command('reload', 500);
// force min size
- if ($a_user_prefs['pagesize'] < 1)
- $a_user_prefs['pagesize'] = 10;
-
- if (isset($CONFIG['max_pagesize']) && ($a_user_prefs['pagesize'] > $CONFIG['max_pagesize']))
- $a_user_prefs['pagesize'] = (int) $CONFIG['max_pagesize'];
+ if ($a_user_prefs['mail_pagesize'] < 1)
+ $a_user_prefs['mail_pagesize'] = 10;
+ if ($a_user_prefs['addressbook_pagesize'] < 1)
+ $a_user_prefs['addressbook_pagesize'] = 10;
+
+ if (isset($CONFIG['max_pagesize']) && ($a_user_prefs['mail_pagesize'] > $CONFIG['max_pagesize']))
+ $a_user_prefs['mail_pagesize'] = (int) $CONFIG['max_pagesize'];
+ if (isset($CONFIG['max_pagesize']) && ($a_user_prefs['addressbook_pagesize'] > $CONFIG['max_pagesize']))
+ $a_user_prefs['addressbook_pagesize'] = (int) $CONFIG['max_pagesize'];
$a_user_prefs['timezone'] = (string) $a_user_prefs['timezone'];