Changeset 5662 in subversion
- Timestamp:
- Dec 29, 2011 4:35:01 AM (17 months ago)
- Location:
- trunk/roundcubemail
- Files:
-
- 13 edited
-
CHANGELOG (modified) (1 diff)
-
config/main.inc.php.dist (modified) (1 diff)
-
installer/config.php (modified) (1 diff)
-
installer/rcube_install.php (modified) (3 diffs)
-
program/include/rcmail.php (modified) (3 diffs)
-
program/js/app.js (modified) (1 diff)
-
program/localization/en_US/labels.inc (modified) (1 diff)
-
program/steps/addressbook/delete.inc (modified) (3 diffs)
-
program/steps/addressbook/func.inc (modified) (5 diffs)
-
program/steps/addressbook/list.inc (modified) (3 diffs)
-
program/steps/addressbook/search.inc (modified) (3 diffs)
-
program/steps/settings/func.inc (modified) (5 diffs)
-
program/steps/settings/save_prefs.inc (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/CHANGELOG
r5659 r5662 2 2 =========================== 3 3 4 - Add separate pagesize setting for mail messages and contacts (#1488269) 4 5 - Fix handling of INBOX's subfolders in special folders config (#1488279) 5 6 - Add ifModule statement for setting Options -Indexes in .htaccess file (#1488274) -
trunk/roundcubemail/config/main.inc.php.dist
r5562 r5662 655 655 $rcmail_config['skin'] = 'default'; 656 656 657 // show up to X items in list view 658 $rcmail_config['pagesize'] = 40; 657 // show up to X items in messages list view 658 $rcmail_config['mail_pagesize'] = 50; 659 660 // show up to X items in contacts list view 661 $rcmail_config['addressbook_pagesize'] = 50; 659 662 660 663 // use this timezone to display date/time -
trunk/roundcubemail/installer/config.php
r4822 r5662 525 525 </dd> 526 526 527 <dt class="propname">pagesize <span class="userconf">*</span></dt> 528 <dd> 529 <?php 530 531 $input_pagesize = new html_inputfield(array('name' => '_pagesize', 'size' => 6, 'id' => "cfgpagesize")); 532 echo $input_pagesize->show($RCI->getprop('pagesize')); 533 534 ?> 535 <div>Show up to X items in list view.</div> 527 <dt class="propname">mail_pagesize <span class="userconf">*</span></dt> 528 <dd> 529 <?php 530 531 $pagesize = $RCI->getprop('mail_pagesize'); 532 if (!$pagesize) { 533 $pagesize = $RCI->getprop('pagesize'); 534 } 535 $input_pagesize = new html_inputfield(array('name' => '_mail_pagesize', 'size' => 6, 'id' => "cfgmailpagesize")); 536 echo $input_pagesize->show($pagesize); 537 538 ?> 539 <div>Show up to X items in the mail messages list view.</div> 540 </dd> 541 542 <dt class="propname">addressbook_pagesize <span class="userconf">*</span></dt> 543 <dd> 544 <?php 545 546 $pagesize = $RCI->getprop('addressbook_pagesize'); 547 if (!$pagesize) { 548 $pagesize = $RCI->getprop('pagesize'); 549 } 550 $input_pagesize = new html_inputfield(array('name' => '_addressbook_pagesize', 'size' => 6, 'id' => "cfgabookpagesize")); 551 echo $input_pagesize->show($pagesize); 552 553 ?> 554 <div>Show up to X items in the contacts list view.</div> 536 555 </dd> 537 556 -
trunk/roundcubemail/installer/rcube_install.php
r5614 r5662 41 41 'addrbook_show_images' => 'show_images', 42 42 'imap_root' => 'imap_ns_personal', 43 'pagesize' => 'mail_pagesize', 43 44 ); 44 45 45 46 // these config options are required for a working system 46 47 var $required_config = array( … … 48 49 'des_key', 'session_lifetime', 49 50 ); 50 51 51 52 /** 52 53 * Constructor … … 170 171 $value = $value[0]; 171 172 } 172 else if ($prop == ' pagesize') {173 else if ($prop == 'mail_pagesize' || $prop == 'addressbook_pagesize') { 173 174 $value = max(2, intval($value)); 174 175 } -
trunk/roundcubemail/program/include/rcmail.php
r5564 r5662 599 599 600 600 // enable caching of imap data 601 $imap_cache = $this->config->get('imap_cache');601 $imap_cache = $this->config->get('imap_cache'); 602 602 $messages_cache = $this->config->get('messages_cache'); 603 603 // for backward compatybility … … 606 606 $messages_cache = true; 607 607 } 608 608 609 if ($imap_cache) 609 610 $this->imap->set_caching($imap_cache); … … 612 613 613 614 // set pagesize from config 614 $this->imap->set_pagesize($this->config->get('pagesize', 50)); 615 616 // Setting root and delimiter before establishing the connection 617 // can save time detecting them using NAMESPACE and LIST 615 $pagesize = $this->config->get('mail_pagesize'); 616 if (!$pagesize) { 617 $pagesize = $this->config->get('pagesize', 50); 618 } 619 $this->imap->set_pagesize($pagesize); 620 621 // set connection options 618 622 $options = array( 619 623 'auth_type' => $this->config->get('imap_auth_type', 'check'), -
trunk/roundcubemail/program/js/app.js
r5654 r5662 5659 5659 }; 5660 5660 5661 this.toggle_prefer_html = function(checkbox)5662 {5663 $('#rcmfd_show_images').prop('disabled', !checkbox.checked).val(0);5664 };5665 5666 this.toggle_preview_pane = function(checkbox)5667 {5668 $('#rcmfd_preview_pane_mark_read').prop('disabled', !checkbox.checked);5669 };5670 5671 5661 // display fetched raw headers 5672 5662 this.set_headers = function(content) -
trunk/roundcubemail/program/localization/en_US/labels.inc
r5562 r5662 413 413 $labels['maintenance'] = 'Maintenance'; 414 414 $labels['newmessage'] = 'New Message'; 415 $labels['listoptions'] = 'List Options';416 415 $labels['signatureoptions'] = 'Signature Options'; 417 416 $labels['whenreplying'] = 'When replying'; -
trunk/roundcubemail/program/steps/addressbook/delete.inc
r4951 r5662 104 104 // create resultset object 105 105 $count = count($records); 106 $first = ($page-1) * $ CONFIG['pagesize'];106 $first = ($page-1) * $PAGE_SIZE; 107 107 $result = new rcube_result_set($count, $first); 108 108 109 109 // get records from the next page to add to the list 110 $pages = ceil((count($records) + $delcnt) / $ CONFIG['pagesize']);110 $pages = ceil((count($records) + $delcnt) / $PAGE_SIZE); 111 111 if ($_GET['_from'] != 'show' && $pages > 1 && $page < $pages) { 112 112 // sort the records 113 113 ksort($records, SORT_LOCALE_STRING); 114 114 115 $first += $ CONFIG['pagesize'];115 $first += $PAGE_SIZE; 116 116 // create resultset object 117 117 $res = new rcube_result_set($count, $first - $delcnt); 118 118 119 if ($ CONFIG['pagesize']< $count) {119 if ($PAGE_SIZE < $count) { 120 120 $records = array_slice($records, $first - $delcnt, $delcnt); 121 121 } … … 133 133 134 134 // get records from the next page to add to the list 135 $pages = ceil(($result->count + $delcnt) / $ CONFIG['pagesize']);135 $pages = ceil(($result->count + $delcnt) / $PAGE_SIZE); 136 136 if ($_GET['_from'] != 'show' && $pages > 1 && $page < $pages) { 137 137 $CONTACTS->set_page($page); … … 141 141 142 142 // update message count display 143 $OUTPUT->set_env('pagecount', ceil($result->count / $ CONFIG['pagesize']));143 $OUTPUT->set_env('pagecount', ceil($result->count / $PAGE_SIZE)); 144 144 $OUTPUT->command('set_rowcount', rcmail_get_rowcount_text($result)); 145 145 -
trunk/roundcubemail/program/steps/addressbook/func.inc
r5645 r5662 57 57 ); 58 58 59 $PAGE_SIZE = $RCMAIL->config->get('addressbook_pagesize'); 60 if (!$PAGE_SIZE) { 61 $PAGE_SIZE = $RCMAIL->config->get('pagesize', 50); 62 } 59 63 60 64 // Addressbook UI … … 109 113 function rcmail_contact_source($source=null, $init_env=false, $writable=false) 110 114 { 111 global $RCMAIL, $OUTPUT, $CON FIG, $CONTACT_COLTYPES;115 global $RCMAIL, $OUTPUT, $CONTACT_COLTYPES, $PAGE_SIZE; 112 116 113 117 if (!strlen($source)) { … … 117 121 // Get object 118 122 $CONTACTS = $RCMAIL->get_address_book($source, $writable); 119 $CONTACTS->set_pagesize($ CONFIG['pagesize']);123 $CONTACTS->set_pagesize($PAGE_SIZE); 120 124 121 125 // set list properties and session vars … … 392 396 function rcmail_get_rowcount_text($result=null) 393 397 { 394 global $CONTACTS, $ CONFIG;398 global $CONTACTS, $PAGE_SIZE; 395 399 396 400 // read nr of contacts … … 406 410 'vars' => array( 407 411 'from' => $result->first + 1, 408 'to' => min($result->count, $result->first + $ CONFIG['pagesize']),412 'to' => min($result->count, $result->first + $PAGE_SIZE), 409 413 'count' => $result->count) 410 414 )); -
trunk/roundcubemail/program/steps/addressbook/list.inc
r5315 r5662 57 57 58 58 // create resultset object 59 $count = count($records);60 $first = ($page-1) * $ CONFIG['pagesize'];59 $count = count($records); 60 $first = ($page-1) * $PAGE_SIZE; 61 61 $result = new rcube_result_set($count, $first); 62 62 63 63 // we need only records for current page 64 if ($ CONFIG['pagesize']< $count) {65 $records = array_slice($records, $first, $ CONFIG['pagesize']);64 if ($PAGE_SIZE < $count) { 65 $records = array_slice($records, $first, $PAGE_SIZE); 66 66 } 67 67 … … 74 74 // get contacts for this user 75 75 $result = $CONTACTS->list_records(array('name')); 76 76 77 77 if (!$result->count && $result->searchonly) { 78 78 $OUTPUT->show_message('contactsearchonly', 'notice'); … … 82 82 83 83 // update message count display 84 $OUTPUT->set_env('pagecount', ceil($result->count / $ CONFIG['pagesize']));84 $OUTPUT->set_env('pagecount', ceil($result->count / $PAGE_SIZE)); 85 85 $OUTPUT->command('set_rowcount', rcmail_get_rowcount_text($result)); 86 86 -
trunk/roundcubemail/program/steps/addressbook/search.inc
r5406 r5662 89 89 function rcmail_contact_search() 90 90 { 91 global $RCMAIL, $OUTPUT, $ CONFIG, $SEARCH_MODS_DEFAULT;91 global $RCMAIL, $OUTPUT, $SEARCH_MODS_DEFAULT, $PAGE_SIZE; 92 92 93 93 $adv = isset($_POST['_adv']); … … 199 199 200 200 // cut first-page records 201 if ($ CONFIG['pagesize']< $count) {202 $records = array_slice($records, 0, $ CONFIG['pagesize']);201 if ($PAGE_SIZE < $count) { 202 $records = array_slice($records, 0, $PAGE_SIZE); 203 203 } 204 204 … … 229 229 // update message count display 230 230 $OUTPUT->command('set_env', 'search_request', $search_request); 231 $OUTPUT->command('set_env', 'pagecount', ceil($result->count / $ CONFIG['pagesize']));231 $OUTPUT->command('set_env', 'pagecount', ceil($result->count / $PAGE_SIZE)); 232 232 $OUTPUT->command('set_rowcount', rcmail_get_rowcount_text($result)); 233 233 // Re-set current source -
trunk/roundcubemail/program/steps/settings/func.inc
r5661 r5662 158 158 $blocks = array( 159 159 'main' => array('name' => Q(rcube_label('mainoptions'))), 160 'list' => array('name' => Q(rcube_label('listoptions'))),161 160 ); 162 161 … … 176 175 } 177 176 178 // show page size selection177 // timezone selection 179 178 if (!isset($no_override['timezone'])) { 180 179 $field_id = 'rcmfd_timezone'; … … 277 276 } 278 277 279 // show page size selection280 if (!isset($no_override['pagesize'])) {281 $field_id = 'rcmfd_pgsize';282 $input_pagesize = new html_inputfield(array('name' => '_pagesize', 'id' => $field_id, 'size' => 5));283 284 $blocks['list']['options']['pagesize'] = array(285 'title' => html::label($field_id, Q(rcube_label('pagesize'))),286 'content' => $input_pagesize->show($config['pagesize']),287 );288 }289 290 278 // show drop-down for available skins 291 279 if (!isset($no_override['skin'])) { … … 379 367 } 380 368 369 // show page size selection 370 if (!isset($no_override['pagesize'])) { 371 $field_id = 'rcmfd_pagesize'; 372 $input_pagesize = new html_inputfield(array('name' => '_pagesize', 'id' => $field_id, 'size' => 5)); 373 374 $blocks['main']['options']['pagesize'] = array( 375 'title' => html::label($field_id, Q(rcube_label('pagesize'))), 376 'content' => $input_pagesize->show($config['pagesize']), 377 ); 378 } 379 381 380 if (!isset($no_override['keep_alive'])) { 382 381 $field_id = 'rcmfd_keep_alive'; … … 688 687 'title' => html::label($field_id, Q(rcube_label('autocompletesingle'))), 689 688 'content' => $checkbox->show($config['autocomplete_single']?1:0), 689 ); 690 } 691 692 // show addressbook page size selection 693 if (!isset($no_override['addressbook_pagesize'])) { 694 $field_id = 'rcmfd_addressbook_pagesize'; 695 $input_pagesize = new html_inputfield(array('name' => '_addressbook_pagesize', 'id' => $field_id, 'size' => 5)); 696 697 $size = $config['addressbook_pagesize'] ? $config['addressbook_pagesize'] : $config['pagesize']; 698 699 $blocks['main']['options']['pagesize'] = array( 700 'title' => html::label($field_id, Q(rcube_label('pagesize'))), 701 'content' => $input_pagesize->show((int)$size), 690 702 ); 691 703 } -
trunk/roundcubemail/program/steps/settings/save_prefs.inc
r5564 r5662 32 32 'timezone' => isset($_POST['_timezone']) ? (is_numeric($_POST['_timezone']) ? floatval($_POST['_timezone']) : get_input_value('_timezone', RCUBE_INPUT_POST)) : $CONFIG['timezone'], 33 33 'dst_active' => isset($_POST['_dst_active']) ? TRUE : FALSE, 34 'pagesize' => is_numeric($_POST['_pagesize']) ? max(2, intval($_POST['_pagesize'])) : $CONFIG['pagesize'],35 34 'date_format' => isset($_POST['_date_format']) ? get_input_value('_date_format', RCUBE_INPUT_POST) : $CONFIG['date_format'], 36 35 'time_format' => isset($_POST['_time_format']) ? get_input_value('_time_format', RCUBE_INPUT_POST) : ($CONFIG['time_format'] ? $CONFIG['time_format'] : 'H:i'), … … 38 37 'skin' => isset($_POST['_skin']) ? get_input_value('_skin', RCUBE_INPUT_POST) : $CONFIG['skin'], 39 38 ); 40 39 41 40 // compose derived date/time format strings 42 41 if ((isset($_POST['_date_format']) || isset($_POST['_time_format'])) && $a_user_prefs['date_format'] && $a_user_prefs['time_format']) { … … 55 54 'keep_alive' => isset($_POST['_keep_alive']) ? intval($_POST['_keep_alive'])*60 : $CONFIG['keep_alive'], 56 55 'check_all_folders' => isset($_POST['_check_all_folders']) ? TRUE : FALSE, 56 'mail_pagesize' => is_numeric($_POST['_mail_pagesize']) ? max(2, intval($_POST['_mail_pagesize'])) : $CONFIG['mail_pagesize'], 57 57 ); 58 58 … … 94 94 case 'addressbook': 95 95 $a_user_prefs = array( 96 'default_addressbook' => get_input_value('_default_addressbook', RCUBE_INPUT_POST, true), 97 'autocomplete_single' => isset($_POST['_autocomplete_single']) ? TRUE : FALSE, 96 'default_addressbook' => get_input_value('_default_addressbook', RCUBE_INPUT_POST, true), 97 'autocomplete_single' => isset($_POST['_autocomplete_single']) ? TRUE : FALSE, 98 'addressbook_pagesize' => is_numeric($_POST['_addressbook_pagesize']) ? max(2, intval($_POST['_addressbook_pagesize'])) : $CONFIG['addressbook_pagesize'], 98 99 ); 99 100 … … 151 152 152 153 // force min size 153 if ($a_user_prefs['pagesize'] < 1) 154 $a_user_prefs['pagesize'] = 10; 155 156 if (isset($CONFIG['max_pagesize']) && ($a_user_prefs['pagesize'] > $CONFIG['max_pagesize'])) 157 $a_user_prefs['pagesize'] = (int) $CONFIG['max_pagesize']; 154 if ($a_user_prefs['mail_pagesize'] < 1) 155 $a_user_prefs['mail_pagesize'] = 10; 156 if ($a_user_prefs['addressbook_pagesize'] < 1) 157 $a_user_prefs['addressbook_pagesize'] = 10; 158 159 if (isset($CONFIG['max_pagesize']) && ($a_user_prefs['mail_pagesize'] > $CONFIG['max_pagesize'])) 160 $a_user_prefs['mail_pagesize'] = (int) $CONFIG['max_pagesize']; 161 if (isset($CONFIG['max_pagesize']) && ($a_user_prefs['addressbook_pagesize'] > $CONFIG['max_pagesize'])) 162 $a_user_prefs['addressbook_pagesize'] = (int) $CONFIG['max_pagesize']; 158 163 159 164 $a_user_prefs['timezone'] = (string) $a_user_prefs['timezone'];
Note: See TracChangeset
for help on using the changeset viewer.
