Changeset 5563 in subversion
- Timestamp:
- Dec 7, 2011 5:41:15 AM (18 months ago)
- Location:
- trunk/roundcubemail
- Files:
-
- 22 edited
-
index.php (modified) (1 diff)
-
program/include/rcmail.php (modified) (1 diff)
-
program/steps/mail/addcontact.inc (modified) (1 diff)
-
program/steps/mail/check_recent.inc (modified) (5 diffs)
-
program/steps/mail/compose.inc (modified) (8 diffs)
-
program/steps/mail/copy.inc (modified) (1 diff)
-
program/steps/mail/folders.inc (modified) (3 diffs)
-
program/steps/mail/func.inc (modified) (26 diffs)
-
program/steps/mail/get.inc (modified) (4 diffs)
-
program/steps/mail/getunread.inc (modified) (2 diffs)
-
program/steps/mail/headers.inc (modified) (1 diff)
-
program/steps/mail/list.inc (modified) (6 diffs)
-
program/steps/mail/mark.inc (modified) (7 diffs)
-
program/steps/mail/move_del.inc (modified) (8 diffs)
-
program/steps/mail/pagenav.inc (modified) (1 diff)
-
program/steps/mail/search.inc (modified) (6 diffs)
-
program/steps/mail/sendmail.inc (modified) (5 diffs)
-
program/steps/mail/show.inc (modified) (5 diffs)
-
program/steps/mail/viewsource.inc (modified) (2 diffs)
-
program/steps/settings/folders.inc (modified) (11 diffs)
-
program/steps/settings/func.inc (modified) (1 diff)
-
program/steps/settings/save_folder.inc (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/roundcubemail/index.php
r5480 r5563 130 130 } 131 131 else { 132 $error_code = is_object($IMAP) ? $IMAP->get_error_code() : -1;132 $error_code = (isset($RCMAIL->imap) && is_object($RCMAIL->imap)) ? $RCMAIL->imap->get_error_code() : 1; 133 133 134 134 $OUTPUT->show_message($error_code < -1 ? 'imaperror' : (!$auth['valid'] ? 'invalidrequest' : 'loginfailed'), 'warning'); -
trunk/roundcubemail/program/include/rcmail.php
r5555 r5563 585 585 * 586 586 * @param boolean True if connection should be established 587 * @todo Remove global $IMAP588 587 */ 589 588 public function imap_init($connect = false) -
trunk/roundcubemail/program/steps/mail/addcontact.inc
r5406 r5563 38 38 if (!empty($_POST['_address']) && is_object($CONTACTS)) 39 39 { 40 $contact_arr = $ IMAP->decode_address_list(get_input_value('_address', RCUBE_INPUT_POST, true), 1, false);40 $contact_arr = $RCMAIL->imap->decode_address_list(get_input_value('_address', RCUBE_INPUT_POST, true), 1, false); 41 41 42 42 if (!empty($contact_arr[1]['mailto'])) { -
trunk/roundcubemail/program/steps/mail/check_recent.inc
r5483 r5563 20 20 */ 21 21 22 $current = $ IMAP->get_mailbox_name();22 $current = $RCMAIL->imap->get_mailbox_name(); 23 23 $check_all = !empty($_GET['_refresh']) || (bool)$RCMAIL->config->get('check_all_folders'); 24 24 25 25 // list of folders to check 26 26 if ($check_all) { 27 $a_mailboxes = $ IMAP->list_mailboxes('', '*', 'mail');27 $a_mailboxes = $RCMAIL->imap->list_mailboxes('', '*', 'mail'); 28 28 } 29 29 else { … … 38 38 if ($is_current) { 39 39 // Synchronize mailbox cache, handle flag changes 40 $ IMAP->mailbox_sync($mbox_name);40 $RCMAIL->imap->mailbox_sync($mbox_name); 41 41 } 42 42 43 43 // Get mailbox status 44 $status = $ IMAP->mailbox_status($mbox_name);44 $status = $RCMAIL->imap->mailbox_status($mbox_name); 45 45 46 46 if ($status & 1) { … … 59 59 && $_SESSION['search_request'] == $search_request 60 60 ) { 61 $_SESSION['search'] = $ IMAP->refresh_search();61 $_SESSION['search'] = $RCMAIL->imap->refresh_search(); 62 62 } 63 63 … … 70 70 71 71 // get overall message count; allow caching because rcube_imap::mailbox_status() did a refresh 72 $all_count = $ IMAP->messagecount(null, $IMAP->threading ? 'THREADS' : 'ALL');72 $all_count = $RCMAIL->imap->messagecount(null, $RCMAIL->imap->threading ? 'THREADS' : 'ALL'); 73 73 74 74 // check current page if we're not on the first page 75 if ($all_count && $ IMAP->list_page > 1) {76 $remaining = $all_count - $ IMAP->page_size * ($IMAP->list_page - 1);75 if ($all_count && $RCMAIL->imap->list_page > 1) { 76 $remaining = $all_count - $RCMAIL->imap->page_size * ($RCMAIL->imap->list_page - 1); 77 77 if ($remaining <= 0) { 78 $ IMAP->set_page($IMAP->list_page-1);79 $_SESSION['page'] = $ IMAP->list_page;78 $RCMAIL->imap->set_page($RCMAIL->imap->list_page-1); 79 $_SESSION['page'] = $RCMAIL->imap->list_page; 80 80 } 81 81 } 82 82 83 83 $OUTPUT->set_env('messagecount', $all_count); 84 $OUTPUT->set_env('pagecount', ceil($all_count/$ IMAP->page_size));84 $OUTPUT->set_env('pagecount', ceil($all_count/$RCMAIL->imap->page_size)); 85 85 $OUTPUT->command('set_rowcount', rcmail_get_messagecount_text($all_count), $mbox_name); 86 $OUTPUT->set_env('current_page', $all_count ? $ IMAP->list_page : 1);86 $OUTPUT->set_env('current_page', $all_count ? $RCMAIL->imap->list_page : 1); 87 87 88 88 // remove old rows (and clear selection if new list is empty) … … 90 90 91 91 if ($all_count) { 92 $a_headers = $ IMAP->list_headers($mbox_name, null, $_SESSION['sort_col'], $_SESSION['sort_order']);92 $a_headers = $RCMAIL->imap->list_headers($mbox_name, null, $_SESSION['sort_col'], $_SESSION['sort_order']); 93 93 // add message rows 94 94 rcmail_js_message_list($a_headers, false); -
trunk/roundcubemail/program/steps/mail/compose.inc
r5562 r5563 57 57 'id' => $COMPOSE_ID, 58 58 'param' => request2param(RCUBE_INPUT_GET), 59 'mailbox' => $ IMAP->get_mailbox_name(),59 'mailbox' => $RCMAIL->imap->get_mailbox_name(), 60 60 ); 61 61 $COMPOSE =& $_SESSION['compose_data_'.$COMPOSE_ID]; … … 135 135 } 136 136 // set current mailbox in client environment 137 $OUTPUT->set_env('mailbox', $ IMAP->get_mailbox_name());137 $OUTPUT->set_env('mailbox', $RCMAIL->imap->get_mailbox_name()); 138 138 $OUTPUT->set_env('sig_above', $RCMAIL->config->get('sig_above', false)); 139 139 $OUTPUT->set_env('top_posting', $RCMAIL->config->get('top_posting', false)); … … 183 183 // make sure message is marked as read 184 184 if ($MESSAGE && $MESSAGE->headers && empty($MESSAGE->headers->flags['SEEN'])) 185 $ IMAP->set_flag($msg_uid, 'SEEN');185 $RCMAIL->imap->set_flag($msg_uid, 'SEEN'); 186 186 187 187 if (!empty($MESSAGE->headers->charset)) 188 $ IMAP->set_charset($MESSAGE->headers->charset);188 $RCMAIL->imap->set_charset($MESSAGE->headers->charset); 189 189 190 190 if ($compose_mode == RCUBE_COMPOSE_REPLY) … … 272 272 if (is_object($MESSAGE->headers) && in_array($compose_mode, array(RCUBE_COMPOSE_REPLY, RCUBE_COMPOSE_FORWARD))) 273 273 { 274 $a_to = $ IMAP->decode_address_list($MESSAGE->headers->to);274 $a_to = $RCMAIL->imap->decode_address_list($MESSAGE->headers->to); 275 275 foreach ($a_to as $addr) { 276 276 if (!empty($addr['mailto'])) { … … 281 281 282 282 if (!empty($MESSAGE->headers->cc)) { 283 $a_cc = $ IMAP->decode_address_list($MESSAGE->headers->cc);283 $a_cc = $RCMAIL->imap->decode_address_list($MESSAGE->headers->cc); 284 284 foreach ($a_cc as $addr) { 285 285 if (!empty($addr['mailto'])) { … … 424 424 // split recipients and put them back together in a unique way 425 425 if (!empty($fvalue) && in_array($header, array('to', 'cc', 'bcc'))) { 426 $to_addresses = $ IMAP->decode_address_list($fvalue, null, $decode_header);426 $to_addresses = $RCMAIL->imap->decode_address_list($fvalue, null, $decode_header); 427 427 $fvalue = array(); 428 428 … … 1433 1433 function rcmail_check_sent_folder($folder, $create=false) 1434 1434 { 1435 global $ IMAP;1436 1437 if ($ IMAP->mailbox_exists($folder, true)) {1435 global $RCMAIL; 1436 1437 if ($RCMAIL->imap->mailbox_exists($folder, true)) { 1438 1438 return true; 1439 1439 } … … 1441 1441 // folder may exist but isn't subscribed (#1485241) 1442 1442 if ($create) { 1443 if (!$ IMAP->mailbox_exists($folder))1444 return $ IMAP->create_mailbox($folder, true);1443 if (!$RCMAIL->imap->mailbox_exists($folder)) 1444 return $RCMAIL->imap->create_mailbox($folder, true); 1445 1445 else 1446 return $ IMAP->subscribe($folder);1446 return $RCMAIL->imap->subscribe($folder); 1447 1447 } 1448 1448 -
trunk/roundcubemail/program/steps/mail/copy.inc
r4410 r5563 30 30 $mbox = get_input_value('_mbox', RCUBE_INPUT_POST, true); 31 31 32 $copied = $ IMAP->copy_message($uids, $target, $mbox);32 $copied = $RCMAIL->imap->copy_message($uids, $target, $mbox); 33 33 34 34 if (!$copied) { -
trunk/roundcubemail/program/steps/mail/folders.inc
r5266 r5563 28 28 if ($RCMAIL->action == 'expunge') { 29 29 30 $success = $ IMAP->expunge($mbox);30 $success = $RCMAIL->imap->expunge($mbox); 31 31 32 32 // reload message list if current mailbox … … 49 49 else if ($RCMAIL->action == 'purge') 50 50 { 51 $delimiter = $ IMAP->get_hierarchy_delimiter();51 $delimiter = $RCMAIL->imap->get_hierarchy_delimiter(); 52 52 $trash_regexp = '/^' . preg_quote($CONFIG['trash_mbox'] . $delimiter, '/') . '/'; 53 53 $junk_regexp = '/^' . preg_quote($CONFIG['junk_mbox'] . $delimiter, '/') . '/'; … … 57 57 || preg_match($trash_regexp, $mbox) || preg_match($junk_regexp, $mbox) 58 58 ) { 59 $success = $ IMAP->clear_mailbox($mbox);59 $success = $RCMAIL->imap->clear_mailbox($mbox); 60 60 61 61 if ($success) { -
trunk/roundcubemail/program/steps/mail/func.inc
r5557 r5563 48 48 // set imap properties and session vars 49 49 if (strlen(trim($mbox = get_input_value('_mbox', RCUBE_INPUT_GPC, true)))) 50 $ IMAP->set_mailbox(($_SESSION['mbox'] = $mbox));51 else if ($ IMAP)52 $_SESSION['mbox'] = $ IMAP->get_mailbox_name();50 $RCMAIL->imap->set_mailbox(($_SESSION['mbox'] = $mbox)); 51 else if ($RCMAIL->imap) 52 $_SESSION['mbox'] = $RCMAIL->imap->get_mailbox_name(); 53 53 54 54 if (!empty($_GET['_page'])) 55 $ IMAP->set_page(($_SESSION['page'] = intval($_GET['_page'])));55 $RCMAIL->imap->set_page(($_SESSION['page'] = intval($_GET['_page']))); 56 56 57 57 // set default sort col/order to session … … 70 70 $RCMAIL->user->save_prefs(array('message_threading' => $a_threading)); 71 71 } 72 $ IMAP->set_threading($a_threading[$_SESSION['mbox']]);72 $RCMAIL->imap->set_threading($a_threading[$_SESSION['mbox']]); 73 73 74 74 // set message set for search result … … 76 76 && $_SESSION['search_request'] == $_REQUEST['_search'] 77 77 ) { 78 $ IMAP->set_search_set($_SESSION['search']);78 $RCMAIL->imap->set_search_set($_SESSION['search']); 79 79 $OUTPUT->set_env('search_request', $_REQUEST['_search']); 80 80 $OUTPUT->set_env('search_text', $_SESSION['last_text_search']); … … 83 83 // set main env variables, labels and page title 84 84 if (empty($RCMAIL->action) || $RCMAIL->action == 'list') { 85 $mbox_name = $ IMAP->get_mailbox_name();85 $mbox_name = $RCMAIL->imap->get_mailbox_name(); 86 86 87 87 if (empty($RCMAIL->action)) { … … 90 90 $search_request = md5($mbox_name.$_SESSION['search_filter']); 91 91 92 $ IMAP->search($mbox_name, $_SESSION['search_filter'], RCMAIL_CHARSET, $_SESSION['sort_col']);93 $_SESSION['search'] = $ IMAP->get_search_set();92 $RCMAIL->imap->search($mbox_name, $_SESSION['search_filter'], RCMAIL_CHARSET, $_SESSION['sort_col']); 93 $_SESSION['search'] = $RCMAIL->imap->get_search_set(); 94 94 $_SESSION['search_request'] = $search_request; 95 95 $OUTPUT->set_env('search_request', $search_request); … … 102 102 // set current mailbox and some other vars in client environment 103 103 $OUTPUT->set_env('mailbox', $mbox_name); 104 $OUTPUT->set_env('pagesize', $ IMAP->page_size);105 $OUTPUT->set_env('quota', $ IMAP->get_capability('QUOTA'));106 $OUTPUT->set_env('delimiter', $ IMAP->get_hierarchy_delimiter());107 $OUTPUT->set_env('threading', (bool) $ IMAP->threading);108 $OUTPUT->set_env('threads', $ IMAP->threading || $IMAP->get_capability('THREAD'));104 $OUTPUT->set_env('pagesize', $RCMAIL->imap->page_size); 105 $OUTPUT->set_env('quota', $RCMAIL->imap->get_capability('QUOTA')); 106 $OUTPUT->set_env('delimiter', $RCMAIL->imap->get_hierarchy_delimiter()); 107 $OUTPUT->set_env('threading', (bool) $RCMAIL->imap->threading); 108 $OUTPUT->set_env('threads', $RCMAIL->imap->threading || $RCMAIL->imap->get_capability('THREAD')); 109 109 $OUTPUT->set_env('preview_pane_mark_read', $RCMAIL->config->get('preview_pane_mark_read', 0)); 110 110 … … 131 131 'copy', 'move', 'quota'); 132 132 133 $OUTPUT->set_pagetitle(rcmail_localize_foldername($ IMAP->mod_mailbox($mbox_name)));133 $OUTPUT->set_pagetitle(rcmail_localize_foldername($RCMAIL->imap->mod_mailbox($mbox_name))); 134 134 } 135 135 … … 140 140 function rcmail_message_list($attrib) 141 141 { 142 global $ IMAP, $CONFIG, $OUTPUT;142 global $RCMAIL, $CONFIG, $OUTPUT; 143 143 144 144 // add some labels to client … … 162 162 $_SESSION['list_attrib'] = $attrib; 163 163 164 $mbox = $ IMAP->get_mailbox_name();165 $delim = $ IMAP->get_hierarchy_delimiter();164 $mbox = $RCMAIL->imap->get_mailbox_name(); 165 $delim = $RCMAIL->imap->get_hierarchy_delimiter(); 166 166 167 167 // show 'to' instead of 'from' in sent/draft messages … … 205 205 function rcmail_js_message_list($a_headers, $insert_top=FALSE, $a_show_cols=null) 206 206 { 207 global $CONFIG, $ IMAP, $RCMAIL, $OUTPUT;207 global $CONFIG, $RCMAIL, $OUTPUT; 208 208 209 209 if (empty($a_show_cols)) { … … 219 219 } 220 220 221 $mbox = $ IMAP->get_mailbox_name();222 $delim = $ IMAP->get_hierarchy_delimiter();221 $mbox = $RCMAIL->imap->get_mailbox_name(); 222 $delim = $RCMAIL->imap->get_hierarchy_delimiter(); 223 223 224 224 // make sure 'threads' and 'subject' columns are present … … 267 267 $a_msg_flags = array(); 268 268 269 $ IMAP->set_charset(!empty($header->charset) ? $header->charset : $CONFIG['default_charset']);269 $RCMAIL->imap->set_charset(!empty($header->charset) ? $header->charset : $CONFIG['default_charset']); 270 270 271 271 // format each col; similar as in rcmail_message_list() … … 274 274 $cont = Q(rcmail_address_string($header->$col, 3), 'show'); 275 275 else if ($col=='subject') { 276 $cont = trim($ IMAP->decode_header($header->$col));276 $cont = trim($RCMAIL->imap->decode_header($header->$col)); 277 277 if (!$cont) $cont = rcube_label('nosubject'); 278 278 $cont = Q($cont); … … 320 320 } 321 321 322 if ($ IMAP->threading) {322 if ($RCMAIL->imap->threading) { 323 323 $OUTPUT->command('init_threads', (array) $roots, $mbox); 324 324 } … … 396 396 */ 397 397 function rcmail_messagecontent_frame($attrib) 398 {398 { 399 399 global $OUTPUT, $RCMAIL; 400 400 … … 409 409 410 410 return html::iframe($attrib); 411 }411 } 412 412 413 413 414 414 function rcmail_messagecount_display($attrib) 415 {415 { 416 416 global $RCMAIL; 417 417 … … 424 424 425 425 return html::span($attrib, $content); 426 }426 } 427 427 428 428 429 429 function rcmail_get_messagecount_text($count=NULL, $page=NULL) 430 {431 global $RCMAIL , $IMAP;430 { 431 global $RCMAIL; 432 432 433 433 if ($page===NULL) 434 $page = $ IMAP->list_page;435 436 $start_msg = ($page-1) * $ IMAP->page_size + 1;434 $page = $RCMAIL->imap->list_page; 435 436 $start_msg = ($page-1) * $RCMAIL->imap->page_size + 1; 437 437 438 438 if ($count!==NULL) 439 439 $max = $count; 440 440 else if ($RCMAIL->action) 441 $max = $ IMAP->messagecount(NULL, $IMAP->threading ? 'THREADS' : 'ALL');441 $max = $RCMAIL->imap->messagecount(NULL, $RCMAIL->imap->threading ? 'THREADS' : 'ALL'); 442 442 443 443 if ($max==0) 444 444 $out = rcube_label('mailboxempty'); 445 445 else 446 $out = rcube_label(array('name' => $ IMAP->threading ? 'threadsfromto' : 'messagesfromto',446 $out = rcube_label(array('name' => $RCMAIL->imap->threading ? 'threadsfromto' : 'messagesfromto', 447 447 'vars' => array('from' => $start_msg, 448 'to' => min($max, $start_msg + $ IMAP->page_size - 1),448 'to' => min($max, $start_msg + $RCMAIL->imap->page_size - 1), 449 449 'count' => $max))); 450 450 451 451 return Q($out); 452 }452 } 453 453 454 454 … … 869 869 function rcmail_message_headers($attrib, $headers=NULL) 870 870 { 871 global $ IMAP, $OUTPUT, $MESSAGE, $PRINT_MODE, $RCMAIL;871 global $OUTPUT, $MESSAGE, $PRINT_MODE, $RCMAIL; 872 872 static $sa_attrib; 873 873 … … 926 926 $header_value = rcube_label('nosubject'); 927 927 else 928 $header_value = trim($ IMAP->decode_header($value));928 $header_value = trim($RCMAIL->imap->decode_header($value)); 929 929 930 930 $output_headers[$hkey] = array( … … 974 974 function rcmail_message_body($attrib) 975 975 { 976 global $CONFIG, $OUTPUT, $MESSAGE, $ IMAP, $RCMAIL, $REMOTE_OBJECTS;976 global $CONFIG, $OUTPUT, $MESSAGE, $RCMAIL, $REMOTE_OBJECTS; 977 977 978 978 if (!is_array($MESSAGE->parts) && empty($MESSAGE->body)) … … 1000 1000 $out .= html::span('part-notice', rcube_label('messagetoobig'). ' ' 1001 1001 . html::a('?_task=mail&_action=get&_download=1&_uid='.$MESSAGE->uid.'&_part='.$part->mime_id 1002 .'&_mbox='. urlencode($ IMAP->get_mailbox_name()), rcube_label('download')));1002 .'&_mbox='. urlencode($RCMAIL->imap->get_mailbox_name()), rcube_label('download'))); 1003 1003 continue; 1004 1004 } … … 1046 1046 $out .= html::span('part-notice', rcube_label('messagetoobig'). ' ' 1047 1047 . html::a('?_task=mail&_action=get&_download=1&_uid='.$MESSAGE->uid.'&_part=0' 1048 .'&_mbox='. urlencode($ IMAP->get_mailbox_name()), rcube_label('download')));1048 .'&_mbox='. urlencode($RCMAIL->imap->get_mailbox_name()), rcube_label('download'))); 1049 1049 } 1050 1050 else { … … 1242 1242 function rcmail_address_string($input, $max=null, $linked=false, $addicon=null) 1243 1243 { 1244 global $ IMAP, $RCMAIL, $PRINT_MODE, $CONFIG;1245 1246 $a_parts = $ IMAP->decode_address_list($input);1244 global $RCMAIL, $PRINT_MODE, $CONFIG; 1245 1246 $a_parts = $RCMAIL->imap->decode_address_list($input); 1247 1247 1248 1248 if (!sizeof($a_parts)) … … 1452 1452 function rcmail_send_mdn($message, &$smtp_error) 1453 1453 { 1454 global $RCMAIL , $IMAP;1454 global $RCMAIL; 1455 1455 1456 1456 if (!is_object($message) || !is_a($message, 'rcube_message')) … … 1458 1458 1459 1459 if ($message->headers->mdn_to && empty($message->headers->flags['MDNSENT']) && 1460 ($ IMAP->check_permflag('MDNSENT') || $IMAP->check_permflag('*')))1460 ($RCMAIL->imap->check_permflag('MDNSENT') || $RCMAIL->imap->check_permflag('*'))) 1461 1461 { 1462 1462 $identity = $RCMAIL->user->get_identity(); 1463 1463 $sender = format_email_recipient($identity['email'], $identity['name']); 1464 $recipient = array_shift($ IMAP->decode_address_list($message->headers->mdn_to));1464 $recipient = array_shift($RCMAIL->imap->decode_address_list($message->headers->mdn_to)); 1465 1465 $mailto = $recipient['mailto']; 1466 1466 … … 1513 1513 if ($sent) 1514 1514 { 1515 $ IMAP->set_flag($message->uid, 'MDNSENT');1515 $RCMAIL->imap->set_flag($message->uid, 'MDNSENT'); 1516 1516 return true; 1517 1517 } -
trunk/roundcubemail/program/steps/mail/get.inc
r5547 r5563 69 69 if (($part_id = get_input_value('_part', RCUBE_INPUT_GPC)) && ($part = $MESSAGE->mime_parts[$part_id]) && $part->filename) 70 70 $OUTPUT->set_pagetitle($part->filename); 71 71 72 72 $OUTPUT->send('messagepart'); 73 73 exit; … … 118 118 $out = '<body>' . rcube_label('messagetoobig'). ' ' 119 119 . html::a('?_task=mail&_action=get&_download=1&_uid='.$MESSAGE->uid.'&_part='.$part->mime_id 120 .'&_mbox='. urlencode($ IMAP->get_mailbox_name()), rcube_label('download')) . '</body></html>';120 .'&_mbox='. urlencode($RCMAIL->imap->get_mailbox_name()), rcube_label('download')) . '</body></html>'; 121 121 } 122 122 else { … … 158 158 stream_filter_register('rcube_content', 'rcube_content_filter') or die('Failed to register content filter'); 159 159 stream_filter_append($stdout, 'rcube_content'); 160 $ IMAP->get_message_part($MESSAGE->uid, $part->mime_id, $part, false, $stdout);160 $RCMAIL->imap->get_message_part($MESSAGE->uid, $part->mime_id, $part, false, $stdout); 161 161 } 162 162 } … … 166 166 echo $part->body; 167 167 else if ($part->size) 168 $ IMAP->get_message_part($MESSAGE->uid, $part->mime_id, $part, true);168 $RCMAIL->imap->get_message_part($MESSAGE->uid, $part->mime_id, $part, true); 169 169 } 170 170 } -
trunk/roundcubemail/program/steps/mail/getunread.inc
r4735 r5563 20 20 */ 21 21 22 $a_folders = $ IMAP->list_mailboxes('', '*', 'mail');22 $a_folders = $RCMAIL->imap->list_mailboxes('', '*', 'mail'); 23 23 24 24 if (!empty($a_folders)) 25 25 { 26 $current = $ IMAP->get_mailbox_name();26 $current = $RCMAIL->imap->get_mailbox_name(); 27 27 $inbox = ($current == 'INBOX'); 28 28 $check_all = (bool)$RCMAIL->config->get('check_all_folders'); … … 34 34 $unseen = $unseen_old; 35 35 else 36 $unseen = $ IMAP->messagecount($mbox_row, 'UNSEEN', $unseen_old === null);36 $unseen = $RCMAIL->imap->messagecount($mbox_row, 'UNSEEN', $unseen_old === null); 37 37 38 38 if ($unseen || $unseen_old === null) { -
trunk/roundcubemail/program/steps/mail/headers.inc
r4410 r5563 21 21 if ($uid = get_input_value('_uid', RCUBE_INPUT_POST)) 22 22 { 23 $source = $ IMAP->get_raw_headers($uid);23 $source = $RCMAIL->imap->get_raw_headers($uid); 24 24 25 25 if ($source !== false) { -
trunk/roundcubemail/program/steps/mail/list.inc
r5266 r5563 52 52 $RCMAIL->user->save_prefs($save_arr); 53 53 54 $mbox_name = $ IMAP->get_mailbox_name();54 $mbox_name = $RCMAIL->imap->get_mailbox_name(); 55 55 56 56 // Synchronize mailbox cache, handle flag changes 57 $ IMAP->mailbox_sync($mbox_name);57 $RCMAIL->imap->mailbox_sync($mbox_name); 58 58 59 59 // initialize searching result if search_filter is used … … 61 61 { 62 62 $search_request = md5($mbox_name.$_SESSION['search_filter']); 63 $ IMAP->search($mbox_name, $_SESSION['search_filter'], RCMAIL_CHARSET, $sort_col);64 $_SESSION['search'] = $ IMAP->get_search_set();63 $RCMAIL->imap->search($mbox_name, $_SESSION['search_filter'], RCMAIL_CHARSET, $sort_col); 64 $_SESSION['search'] = $RCMAIL->imap->get_search_set(); 65 65 $_SESSION['search_request'] = $search_request; 66 66 $OUTPUT->set_env('search_request', $search_request); … … 68 68 69 69 // fetch message headers 70 if ($count = $ IMAP->messagecount($mbox_name, $IMAP->threading ? 'THREADS' : 'ALL', !empty($_REQUEST['_refresh'])))71 $a_headers = $ IMAP->list_headers($mbox_name, NULL, $sort_col, $sort_order);70 if ($count = $RCMAIL->imap->messagecount($mbox_name, $RCMAIL->imap->threading ? 'THREADS' : 'ALL', !empty($_REQUEST['_refresh']))) 71 $a_headers = $RCMAIL->imap->list_headers($mbox_name, NULL, $sort_col, $sort_order); 72 72 73 73 // update search set (possible change of threading mode) … … 75 75 && $_SESSION['search_request'] == $_REQUEST['_search'] 76 76 ) { 77 $_SESSION['search'] = $ IMAP->get_search_set();77 $_SESSION['search'] = $RCMAIL->imap->get_search_set(); 78 78 } 79 79 // remove old search data … … 92 92 93 93 // update message count display 94 $pages = ceil($count/$ IMAP->page_size);94 $pages = ceil($count/$RCMAIL->imap->page_size); 95 95 $OUTPUT->set_env('messagecount', $count); 96 96 $OUTPUT->set_env('pagecount', $pages); 97 $OUTPUT->set_env('threading', (bool) $ IMAP->threading);98 $OUTPUT->set_env('current_page', $count ? $ IMAP->list_page : 1);97 $OUTPUT->set_env('threading', (bool) $RCMAIL->imap->threading); 98 $OUTPUT->set_env('current_page', $count ? $RCMAIL->imap->list_page : 1); 99 99 $OUTPUT->command('set_rowcount', rcmail_get_messagecount_text($count), $mbox_name); 100 100 $OUTPUT->command('set_mailboxname', rcmail_get_mailbox_name_text()); … … 109 109 else { 110 110 // handle IMAP errors (e.g. #1486905) 111 if ($err_code = $ IMAP->get_error_code()) {111 if ($err_code = $RCMAIL->imap->get_error_code()) { 112 112 rcmail_display_server_error(); 113 113 } -
trunk/roundcubemail/program/steps/mail/mark.inc
r5266 r5563 37 37 if ($flag == 'DELETED' && $CONFIG['skip_deleted'] && $_POST['_from'] != 'show') { 38 38 // count messages before changing anything 39 $old_count = $ IMAP->messagecount(NULL, $IMAP->threading ? 'THREADS' : 'ALL');40 $old_pages = ceil($old_count / $ IMAP->page_size);39 $old_count = $RCMAIL->imap->messagecount(NULL, $RCMAIL->imap->threading ? 'THREADS' : 'ALL'); 40 $old_pages = ceil($old_count / $RCMAIL->imap->page_size); 41 41 $count = sizeof(explode(',', $uids)); 42 42 } 43 43 44 $marked = $ IMAP->set_flag($uids, $flag);44 $marked = $RCMAIL->imap->set_flag($uids, $flag); 45 45 46 46 if (!$marked) { … … 58 58 if ($flag == 'DELETED' && $CONFIG['read_when_deleted'] && !empty($_POST['_ruid'])) { 59 59 $ruids = get_input_value('_ruid', RCUBE_INPUT_POST); 60 $read = $ IMAP->set_flag($ruids, 'SEEN');60 $read = $RCMAIL->imap->set_flag($ruids, 'SEEN'); 61 61 62 62 if ($read && !$CONFIG['skip_deleted']) … … 65 65 66 66 if ($flag == 'SEEN' || $flag == 'UNSEEN' || ($flag == 'DELETED' && !$CONFIG['skip_deleted'])) { 67 rcmail_send_unread_count($ IMAP->get_mailbox_name());67 rcmail_send_unread_count($RCMAIL->imap->get_mailbox_name()); 68 68 } 69 69 else if ($flag == 'DELETED' && $CONFIG['skip_deleted']) { … … 75 75 } else { 76 76 // refresh saved search set after moving some messages 77 if (($search_request = get_input_value('_search', RCUBE_INPUT_GPC)) && $ IMAP->search_set) {78 $_SESSION['search'] = $ IMAP->refresh_search();77 if (($search_request = get_input_value('_search', RCUBE_INPUT_GPC)) && $RCMAIL->imap->search_set) { 78 $_SESSION['search'] = $RCMAIL->imap->refresh_search(); 79 79 } 80 80 81 $msg_count = $ IMAP->messagecount(NULL, $IMAP->threading ? 'THREADS' : 'ALL');82 $pages = ceil($msg_count / $ IMAP->page_size);83 $nextpage_count = $old_count - $ IMAP->page_size * $IMAP->list_page;84 $remaining = $msg_count - $ IMAP->page_size * ($IMAP->list_page - 1);81 $msg_count = $RCMAIL->imap->messagecount(NULL, $RCMAIL->imap->threading ? 'THREADS' : 'ALL'); 82 $pages = ceil($msg_count / $RCMAIL->imap->page_size); 83 $nextpage_count = $old_count - $RCMAIL->imap->page_size * $RCMAIL->imap->list_page; 84 $remaining = $msg_count - $RCMAIL->imap->page_size * ($RCMAIL->imap->list_page - 1); 85 85 86 86 // jump back one page (user removed the whole last page) 87 if ($ IMAP->list_page > 1 && $remaining == 0) {88 $ IMAP->set_page($IMAP->list_page-1);89 $_SESSION['page'] = $ IMAP->list_page;87 if ($RCMAIL->imap->list_page > 1 && $remaining == 0) { 88 $RCMAIL->imap->set_page($RCMAIL->imap->list_page-1); 89 $_SESSION['page'] = $RCMAIL->imap->list_page; 90 90 $jump_back = true; 91 91 } … … 93 93 // update message count display 94 94 $OUTPUT->set_env('messagecount', $msg_count); 95 $OUTPUT->set_env('current_page', $ IMAP->list_page);95 $OUTPUT->set_env('current_page', $RCMAIL->imap->list_page); 96 96 $OUTPUT->set_env('pagecount', $pages); 97 97 98 98 // update mailboxlist 99 $mbox = $ IMAP->get_mailbox_name();100 $unseen_count = $msg_count ? $ IMAP->messagecount($mbox, 'UNSEEN') : 0;99 $mbox = $RCMAIL->imap->get_mailbox_name(); 100 $unseen_count = $msg_count ? $RCMAIL->imap->messagecount($mbox, 'UNSEEN') : 0; 101 101 $old_unseen = rcmail_get_unseen_count($mbox); 102 102 … … 107 107 $OUTPUT->command('set_rowcount', rcmail_get_messagecount_text($msg_count), $mbox); 108 108 109 if ($ IMAP->threading)109 if ($RCMAIL->imap->threading) 110 110 $count = get_input_value('_count', RCUBE_INPUT_POST); 111 111 … … 115 115 $sort_order = isset($_SESSION['sort_order']) ? $_SESSION['sort_order'] : $CONFIG['message_sort_order']; 116 116 117 $a_headers = $ IMAP->list_headers($mbox, NULL, $sort_col, $sort_order,117 $a_headers = $RCMAIL->imap->list_headers($mbox, NULL, $sort_col, $sort_order, 118 118 $jump_back ? NULL : $count); 119 119 -
trunk/roundcubemail/program/steps/mail/move_del.inc
r5266 r5563 25 25 26 26 // count messages before changing anything 27 $old_count = $ IMAP->messagecount(NULL, $IMAP->threading ? 'THREADS' : 'ALL');28 $old_pages = ceil($old_count / $ IMAP->page_size);27 $old_count = $RCMAIL->imap->messagecount(NULL, $RCMAIL->imap->threading ? 'THREADS' : 'ALL'); 28 $old_pages = ceil($old_count / $RCMAIL->imap->page_size); 29 29 30 30 // move messages … … 34 34 $mbox = get_input_value('_mbox', RCUBE_INPUT_POST, true); 35 35 36 $moved = $ IMAP->move_message($uids, $target, $mbox);36 $moved = $RCMAIL->imap->move_message($uids, $target, $mbox); 37 37 38 38 if (!$moved) { … … 55 55 $mbox = get_input_value('_mbox', RCUBE_INPUT_POST, true); 56 56 57 $del = $ IMAP->delete_message($uids, $mbox);57 $del = $RCMAIL->imap->delete_message($uids, $mbox); 58 58 59 59 if (!$del) { … … 77 77 78 78 // refresh saved search set after moving some messages 79 if (($search_request = get_input_value('_search', RCUBE_INPUT_GPC)) && $ IMAP->search_set) {80 $_SESSION['search'] = $ IMAP->refresh_search();79 if (($search_request = get_input_value('_search', RCUBE_INPUT_GPC)) && $RCMAIL->imap->search_set) { 80 $_SESSION['search'] = $RCMAIL->imap->refresh_search(); 81 81 } 82 82 … … 90 90 else 91 91 { 92 $msg_count = $ IMAP->messagecount(NULL, $IMAP->threading ? 'THREADS' : 'ALL');93 $pages = ceil($msg_count / $ IMAP->page_size);94 $nextpage_count = $old_count - $ IMAP->page_size * $IMAP->list_page;95 $remaining = $msg_count - $ IMAP->page_size * ($IMAP->list_page - 1);92 $msg_count = $RCMAIL->imap->messagecount(NULL, $RCMAIL->imap->threading ? 'THREADS' : 'ALL'); 93 $pages = ceil($msg_count / $RCMAIL->imap->page_size); 94 $nextpage_count = $old_count - $RCMAIL->imap->page_size * $RCMAIL->imap->list_page; 95 $remaining = $msg_count - $RCMAIL->imap->page_size * ($RCMAIL->imap->list_page - 1); 96 96 97 97 // jump back one page (user removed the whole last page) 98 if ($ IMAP->list_page > 1 && $remaining == 0) {99 $ IMAP->set_page($IMAP->list_page-1);100 $_SESSION['page'] = $ IMAP->list_page;98 if ($RCMAIL->imap->list_page > 1 && $remaining == 0) { 99 $RCMAIL->imap->set_page($RCMAIL->imap->list_page-1); 100 $_SESSION['page'] = $RCMAIL->imap->list_page; 101 101 $jump_back = true; 102 102 } … … 104 104 // update message count display 105 105 $OUTPUT->set_env('messagecount', $msg_count); 106 $OUTPUT->set_env('current_page', $ IMAP->list_page);106 $OUTPUT->set_env('current_page', $RCMAIL->imap->list_page); 107 107 $OUTPUT->set_env('pagecount', $pages); 108 108 109 109 // update mailboxlist 110 $mbox = $ IMAP->get_mailbox_name();111 $unseen_count = $msg_count ? $ IMAP->messagecount($mbox, 'UNSEEN') : 0;110 $mbox = $RCMAIL->imap->get_mailbox_name(); 111 $unseen_count = $msg_count ? $RCMAIL->imap->messagecount($mbox, 'UNSEEN') : 0; 112 112 $old_unseen = rcmail_get_unseen_count($mbox); 113 113 … … 124 124 $OUTPUT->command('set_rowcount', rcmail_get_messagecount_text($msg_count), $mbox); 125 125 126 if ($ IMAP->threading)126 if ($RCMAIL->imap->threading) 127 127 $count = get_input_value('_count', RCUBE_INPUT_POST); 128 128 … … 132 132 $sort_order = isset($_SESSION['sort_order']) ? $_SESSION['sort_order'] : $CONFIG['message_sort_order']; 133 133 134 $a_headers = $ IMAP->list_headers($mbox, NULL, $sort_col, $sort_order,134 $a_headers = $RCMAIL->imap->list_headers($mbox, NULL, $sort_col, $sort_order, 135 135 $jump_back ? NULL : $count); 136 136 -
trunk/roundcubemail/program/steps/mail/pagenav.inc
r5557 r5563 21 21 22 22 $uid = get_input_value('_uid', RCUBE_INPUT_GET); 23 $index = $ IMAP->message_index(null, $_SESSION['sort_col'], $_SESSION['sort_order']);23 $index = $RCMAIL->imap->message_index(null, $_SESSION['sort_col'], $_SESSION['sort_order']); 24 24 $cnt = $index->countMessages(); 25 25 -
trunk/roundcubemail/program/steps/mail/search.inc
r5557 r5563 19 19 20 20 // reset list_page and old search results 21 $ IMAP->set_page(1);22 $ IMAP->set_search_set(NULL);21 $RCMAIL->imap->set_page(1); 22 $RCMAIL->imap->set_search_set(NULL); 23 23 $_SESSION['page'] = 1; 24 24 … … 108 108 // execute IMAP search 109 109 if ($search_str) 110 $ IMAP->search($mbox, $search_str, $imap_charset, $_SESSION['sort_col']);110 $RCMAIL->imap->search($mbox, $search_str, $imap_charset, $_SESSION['sort_col']); 111 111 112 112 // save search results in session … … 115 115 116 116 if ($search_str) { 117 $_SESSION['search'] = $ IMAP->get_search_set();117 $_SESSION['search'] = $RCMAIL->imap->get_search_set(); 118 118 $_SESSION['last_text_search'] = $str; 119 119 } … … 122 122 123 123 // Get the headers 124 $result_h = $ IMAP->list_headers($mbox, 1, $_SESSION['sort_col'], $_SESSION['sort_order']);125 $count = $ IMAP->messagecount($mbox, $IMAP->threading ? 'THREADS' : 'ALL');124 $result_h = $RCMAIL->imap->list_headers($mbox, 1, $_SESSION['sort_col'], $_SESSION['sort_order']); 125 $count = $RCMAIL->imap->messagecount($mbox, $RCMAIL->imap->threading ? 'THREADS' : 'ALL'); 126 126 127 127 … … 130 130 rcmail_js_message_list($result_h); 131 131 if ($search_str) 132 $OUTPUT->show_message('searchsuccessful', 'confirmation', array('nr' => $ IMAP->messagecount(NULL, 'ALL')));132 $OUTPUT->show_message('searchsuccessful', 'confirmation', array('nr' => $RCMAIL->imap->messagecount(NULL, 'ALL'))); 133 133 } 134 134 // handle IMAP errors (e.g. #1486905) 135 else if ($err_code = $ IMAP->get_error_code()) {135 else if ($err_code = $RCMAIL->imap->get_error_code()) { 136 136 rcmail_display_server_error(); 137 137 } … … 143 143 $OUTPUT->set_env('search_request', $search_str ? $search_request : ''); 144 144 $OUTPUT->set_env('messagecount', $count); 145 $OUTPUT->set_env('pagecount', ceil($count/$ IMAP->page_size));145 $OUTPUT->set_env('pagecount', ceil($count/$RCMAIL->imap->page_size)); 146 146 $OUTPUT->command('set_rowcount', rcmail_get_messagecount_text($count, 1), $mbox); 147 147 $OUTPUT->send(); -
trunk/roundcubemail/program/steps/mail/sendmail.inc
r5562 r5563 635 635 // set replied/forwarded flag 636 636 if ($COMPOSE['reply_uid']) 637 $ IMAP->set_flag($COMPOSE['reply_uid'], 'ANSWERED', $COMPOSE['mailbox']);637 $RCMAIL->imap->set_flag($COMPOSE['reply_uid'], 'ANSWERED', $COMPOSE['mailbox']); 638 638 else if ($COMPOSE['forward_uid']) 639 $ IMAP->set_flag($COMPOSE['forward_uid'], 'FORWARDED', $COMPOSE['mailbox']);639 $RCMAIL->imap->set_flag($COMPOSE['forward_uid'], 'FORWARDED', $COMPOSE['mailbox']); 640 640 641 641 } // End of SMTP Delivery Block … … 650 650 if ($store_target) { 651 651 // check if folder is subscribed 652 if ($ IMAP->mailbox_exists($store_target, true))652 if ($RCMAIL->imap->mailbox_exists($store_target, true)) 653 653 $store_folder = true; 654 654 // folder may be existing but not subscribed (#1485241) 655 else if (!$ IMAP->mailbox_exists($store_target))656 $store_folder = $ IMAP->create_mailbox($store_target, true);657 else if ($ IMAP->subscribe($store_target))655 else if (!$RCMAIL->imap->mailbox_exists($store_target)) 656 $store_folder = $RCMAIL->imap->create_mailbox($store_target, true); 657 else if ($RCMAIL->imap->subscribe($store_target)) 658 658 $store_folder = true; 659 659 … … 685 685 TRUE, FALSE); 686 686 else { 687 $saved = $ IMAP->save_message($store_target, $msg, $headers, $mailbody_file ? true : false);687 $saved = $RCMAIL->imap->save_message($store_target, $msg, $headers, $mailbody_file ? true : false); 688 688 } 689 689 … … 709 709 // delete previous saved draft 710 710 // @TODO: use message UID (remember to check UIDVALIDITY) to skip this SEARCH 711 $delete_idx = $ IMAP->search_once($CONFIG['drafts_mbox'],711 $delete_idx = $RCMAIL->imap->search_once($CONFIG['drafts_mbox'], 712 712 'HEADER Message-ID '.$olddraftmessageid); 713 713 714 714 if ($del_uid = $delete_idx->getElement('FIRST')) { 715 $deleted = $ IMAP->delete_message($del_uid, $CONFIG['drafts_mbox']);715 $deleted = $RCMAIL->imap->delete_message($del_uid, $CONFIG['drafts_mbox']); 716 716 717 717 // raise error if deletion of old draft failed … … 734 734 // remember new draft-uid ($saved could be an UID or TRUE here) 735 735 if (is_bool($saved)) { 736 $draft_idx = $ IMAP->search_once($CONFIG['drafts_mbox'], 'HEADER Message-ID '.$msgid);736 $draft_idx = $RCMAIL->imap->search_once($CONFIG['drafts_mbox'], 'HEADER Message-ID '.$msgid); 737 737 $saved = $draft_idx->getElement('FIRST'); 738 738 } -
trunk/roundcubemail/program/steps/mail/show.inc
r5509 r5563 31 31 } 32 32 33 $mbox_name = $ IMAP->get_mailbox_name();33 $mbox_name = $RCMAIL->imap->get_mailbox_name(); 34 34 35 35 // show images? … … 38 38 // set message charset as default 39 39 if (!empty($MESSAGE->headers->charset)) 40 $ IMAP->set_charset($MESSAGE->headers->charset);40 $RCMAIL->imap->set_charset($MESSAGE->headers->charset); 41 41 42 42 $OUTPUT->set_pagetitle(abbreviate_string($MESSAGE->subject, 128, '...', true)); … … 48 48 $OUTPUT->set_env('sender', $MESSAGE->sender['string']); 49 49 $OUTPUT->set_env('permaurl', rcmail_url('show', array('_uid' => $MESSAGE->uid, '_mbox' => $mbox_name))); 50 $OUTPUT->set_env('delimiter', $ IMAP->get_hierarchy_delimiter());50 $OUTPUT->set_env('delimiter', $RCMAIL->imap->get_hierarchy_delimiter()); 51 51 $OUTPUT->set_env('mailbox', $mbox_name); 52 52 … … 78 78 && empty($MESSAGE->headers->flags['MDNSENT']) 79 79 && empty($MESSAGE->headers->flags['SEEN']) 80 && ($ IMAP->check_permflag('MDNSENT') || $IMAP->check_permflag('*'))80 && ($RCMAIL->imap->check_permflag('MDNSENT') || $RCMAIL->imap->check_permflag('*')) 81 81 && $mbox_name != $CONFIG['drafts_mbox'] 82 82 && $mbox_name != $CONFIG['sent_mbox'] … … 249 249 ($RCMAIL->action == 'show' || ($RCMAIL->action == 'preview' && intval($CONFIG['preview_pane_mark_read']) == 0))) 250 250 { 251 if ($ IMAP->set_flag($MESSAGE->uid, 'SEEN')) {251 if ($RCMAIL->imap->set_flag($MESSAGE->uid, 'SEEN')) { 252 252 if ($count = rcmail_get_unseen_count($mbox_name)) { 253 253 rcmail_set_unseen_count($mbox_name, $count - 1); -
trunk/roundcubemail/program/steps/mail/viewsource.inc
r4410 r5563 25 25 if ($uid = get_input_value('_uid', RCUBE_INPUT_GET)) 26 26 { 27 $headers = $ IMAP->get_headers($uid);27 $headers = $RCMAIL->imap->get_headers($uid); 28 28 $charset = $headers->charset ? $headers->charset : $CONFIG['default_charset']; 29 29 header("Content-Type: text/plain; charset={$charset}"); 30 30 31 31 if (!empty($_GET['_save'])) { 32 $filename = ($headers->subject ? $ IMAP->decode_header($headers->subject) : 'roundcube') . '.eml';32 $filename = ($headers->subject ? $RCMAIL->imap->decode_header($headers->subject) : 'roundcube') . '.eml'; 33 33 $browser = $RCMAIL->output->browser; 34 34 … … 44 44 } 45 45 46 $ IMAP->print_raw_body($uid);46 $RCMAIL->imap->print_raw_body($uid); 47 47 } 48 48 else -
trunk/roundcubemail/program/steps/settings/folders.inc
r5398 r5563 31 31 $mbox = get_input_value('_mbox', RCUBE_INPUT_POST, true, 'UTF7-IMAP'); 32 32 if (strlen($mbox)) { 33 $result = $ IMAP->subscribe(array($mbox));33 $result = $RCMAIL->imap->subscribe(array($mbox)); 34 34 35 35 // Handle virtual (non-existing) folders 36 if (!$result && $ IMAP->get_error_code() == -1 &&37 $ IMAP->get_response_code() == rcube_imap::TRYCREATE36 if (!$result && $RCMAIL->imap->get_error_code() == -1 && 37 $RCMAIL->imap->get_response_code() == rcube_imap::TRYCREATE 38 38 ) { 39 $result = $ IMAP->create_mailbox($mbox, true);39 $result = $RCMAIL->imap->create_mailbox($mbox, true); 40 40 if ($result) { 41 41 // @TODO: remove 'virtual' class of folder's row … … 63 63 $mbox = get_input_value('_mbox', RCUBE_INPUT_POST, true, 'UTF7-IMAP'); 64 64 if (strlen($mbox)) { 65 $result = $ IMAP->unsubscribe(array($mbox));65 $result = $RCMAIL->imap->unsubscribe(array($mbox)); 66 66 if ($result) 67 67 $OUTPUT->show_message('folderunsubscribed', 'confirmation'); … … 81 81 82 82 if (!$plugin['abort']) { 83 $deleted = $ IMAP->delete_mailbox($plugin['name']);83 $deleted = $RCMAIL->imap->delete_mailbox($plugin['name']); 84 84 } 85 85 else { … … 127 127 $mbox_utf8 = get_input_value('_mbox', RCUBE_INPUT_POST, true); 128 128 $mbox = rcube_charset_convert($mbox_utf8, RCMAIL_CHARSET, 'UTF7-IMAP'); 129 $delimiter = $ IMAP->get_hierarchy_delimiter();129 $delimiter = $RCMAIL->imap->get_hierarchy_delimiter(); 130 130 $trash_regexp = '/^' . preg_quote($CONFIG['trash_mbox'] . $delimiter, '/') . '/'; 131 131 … … 134 134 || preg_match($trash_regexp, $mbox) 135 135 ) { 136 $success = $ IMAP->clear_mailbox($mbox);136 $success = $RCMAIL->imap->clear_mailbox($mbox); 137 137 $delete = true; 138 138 } 139 139 // copy to Trash 140 140 else { 141 $success = $ IMAP->move_message('1:*', $CONFIG['trash_mbox'], $mbox);141 $success = $RCMAIL->imap->move_message('1:*', $CONFIG['trash_mbox'], $mbox); 142 142 $delete = false; 143 143 } … … 165 165 $name = trim(get_input_value('_mbox', RCUBE_INPUT_POST, true)); 166 166 167 $size = $ IMAP->get_mailbox_size($name);167 $size = $RCMAIL->imap->get_mailbox_size($name); 168 168 169 169 // @TODO: check quota and show percentage usage of specified mailbox? … … 184 184 function rcube_subscription_form($attrib) 185 185 { 186 global $RCMAIL, $ IMAP, $CONFIG, $OUTPUT;186 global $RCMAIL, $CONFIG, $OUTPUT; 187 187 188 188 list($form_start, $form_end) = get_form_tags($attrib, 'folders'); … … 201 201 202 202 // get folders from server 203 $ IMAP->clear_cache('mailboxes', true);204 205 $a_unsubscribed = $ IMAP->list_unsubscribed();206 $a_subscribed = $ IMAP->list_mailboxes('', '*', null, null, true); // unsorted207 $delimiter = $ IMAP->get_hierarchy_delimiter();208 $namespace = $ IMAP->get_namespace();203 $RCMAIL->imap->clear_cache('mailboxes', true); 204 205 $a_unsubscribed = $RCMAIL->imap->list_unsubscribed(); 206 $a_subscribed = $RCMAIL->imap->list_mailboxes('', '*', null, null, true); // unsorted 207 $delimiter = $RCMAIL->imap->get_hierarchy_delimiter(); 208 $namespace = $RCMAIL->imap->get_namespace(); 209 209 $a_js_folders = array(); 210 210 $seen = array(); … … 214 214 foreach ($a_unsubscribed as $i => $folder) { 215 215 $folder_id = $folder; 216 $folder = $ IMAP->mod_mailbox($folder);216 $folder = $RCMAIL->imap->mod_mailbox($folder); 217 217 $foldersplit = explode($delimiter, $folder); 218 218 $name = rcube_charset_convert(array_pop($foldersplit), 'UTF7-IMAP'); … … 284 284 285 285 if (!$protected) { 286 $attrs = $ IMAP->mailbox_attributes($folder['id']);286 $attrs = $RCMAIL->imap->mailbox_attributes($folder['id']); 287 287 $noselect = in_array('\\Noselect', $attrs); 288 288 } … … 404 404 $OUTPUT->set_pagetitle(rcube_label('folders')); 405 405 $OUTPUT->include_script('list.js'); 406 $OUTPUT->set_env('quota', $ IMAP->get_capability('QUOTA'));406 $OUTPUT->set_env('quota', $RCMAIL->imap->get_capability('QUOTA')); 407 407 408 408 // add some labels to client -
trunk/roundcubemail/program/steps/settings/func.inc
r5562 r5563 876 876 function rcmail_update_folder_row($name, $oldname=null, $subscribe=false, $class_name=null) 877 877 { 878 global $ IMAP, $CONFIG, $OUTPUT;879 880 $delimiter = $ IMAP->get_hierarchy_delimiter();878 global $RCMAIL, $CONFIG, $OUTPUT; 879 880 $delimiter = $RCMAIL->imap->get_hierarchy_delimiter(); 881 881 $name_utf8 = rcube_charset_convert($name, 'UTF7-IMAP'); 882 882 $protected = ($CONFIG['protect_default_folders'] == true && in_array($name, $CONFIG['default_imap_folders'])); 883 883 884 $foldersplit = explode($delimiter, $ IMAP->mod_mailbox($name));884 $foldersplit = explode($delimiter, $RCMAIL->imap->mod_mailbox($name)); 885 885 $level = count($foldersplit) - 1; 886 886 $display_name = str_repeat(' ', $level) -
trunk/roundcubemail/program/steps/settings/save_folder.inc
r5096 r5563 34 34 // $path is in UTF7-IMAP already 35 35 36 $delimiter = $ IMAP->get_hierarchy_delimiter();36 $delimiter = $RCMAIL->imap->get_hierarchy_delimiter(); 37 37 $options = strlen($old_imap) ? rcmail_folder_options($old_imap) : array(); 38 38 … … 104 104 105 105 if (!$plugin['abort']) { 106 $created = $ IMAP->create_mailbox($folder['name'], $folder['subscribe']);106 $created = $RCMAIL->imap->create_mailbox($folder['name'], $folder['subscribe']); 107 107 } 108 108 else {
Note: See TracChangeset
for help on using the changeset viewer.
