summaryrefslogtreecommitdiff
path: root/program/steps/settings
diff options
context:
space:
mode:
authoralecpl <alec@alec.pl>2011-12-07 10:41:15 +0000
committeralecpl <alec@alec.pl>2011-12-07 10:41:15 +0000
commitb6da0b76afb5697685c35b8584631294cfc7b12f (patch)
treeda81d13466eccdfe287075e5a77ee37ab485a1bc /program/steps/settings
parent7e263ea2048721482c00db65d4511f00c4c7b1d4 (diff)
- Remove deprecated global $IMAP variable usage (#1488148)
Diffstat (limited to 'program/steps/settings')
-rw-r--r--program/steps/settings/folders.inc38
-rw-r--r--program/steps/settings/func.inc6
-rw-r--r--program/steps/settings/save_folder.inc4
3 files changed, 24 insertions, 24 deletions
diff --git a/program/steps/settings/folders.inc b/program/steps/settings/folders.inc
index 77cbb5571..31f31a32a 100644
--- a/program/steps/settings/folders.inc
+++ b/program/steps/settings/folders.inc
@@ -30,13 +30,13 @@ if ($RCMAIL->action == 'subscribe')
{
$mbox = get_input_value('_mbox', RCUBE_INPUT_POST, true, 'UTF7-IMAP');
if (strlen($mbox)) {
- $result = $IMAP->subscribe(array($mbox));
+ $result = $RCMAIL->imap->subscribe(array($mbox));
// Handle virtual (non-existing) folders
- if (!$result && $IMAP->get_error_code() == -1 &&
- $IMAP->get_response_code() == rcube_imap::TRYCREATE
+ if (!$result && $RCMAIL->imap->get_error_code() == -1 &&
+ $RCMAIL->imap->get_response_code() == rcube_imap::TRYCREATE
) {
- $result = $IMAP->create_mailbox($mbox, true);
+ $result = $RCMAIL->imap->create_mailbox($mbox, true);
if ($result) {
// @TODO: remove 'virtual' class of folder's row
}
@@ -62,7 +62,7 @@ else if ($RCMAIL->action == 'unsubscribe')
{
$mbox = get_input_value('_mbox', RCUBE_INPUT_POST, true, 'UTF7-IMAP');
if (strlen($mbox)) {
- $result = $IMAP->unsubscribe(array($mbox));
+ $result = $RCMAIL->imap->unsubscribe(array($mbox));
if ($result)
$OUTPUT->show_message('folderunsubscribed', 'confirmation');
else
@@ -80,7 +80,7 @@ else if ($RCMAIL->action == 'delete-folder')
$plugin = $RCMAIL->plugins->exec_hook('folder_delete', array('name' => $mbox));
if (!$plugin['abort']) {
- $deleted = $IMAP->delete_mailbox($plugin['name']);
+ $deleted = $RCMAIL->imap->delete_mailbox($plugin['name']);
}
else {
$deleted = $plugin['result'];
@@ -126,19 +126,19 @@ else if ($RCMAIL->action == 'purge')
{
$mbox_utf8 = get_input_value('_mbox', RCUBE_INPUT_POST, true);
$mbox = rcube_charset_convert($mbox_utf8, RCMAIL_CHARSET, 'UTF7-IMAP');
- $delimiter = $IMAP->get_hierarchy_delimiter();
+ $delimiter = $RCMAIL->imap->get_hierarchy_delimiter();
$trash_regexp = '/^' . preg_quote($CONFIG['trash_mbox'] . $delimiter, '/') . '/';
// we should only be purging trash (or their subfolders)
if (!strlen($CONFIG['trash_mbox']) || $mbox == $CONFIG['trash_mbox']
|| preg_match($trash_regexp, $mbox)
) {
- $success = $IMAP->clear_mailbox($mbox);
+ $success = $RCMAIL->imap->clear_mailbox($mbox);
$delete = true;
}
// copy to Trash
else {
- $success = $IMAP->move_message('1:*', $CONFIG['trash_mbox'], $mbox);
+ $success = $RCMAIL->imap->move_message('1:*', $CONFIG['trash_mbox'], $mbox);
$delete = false;
}
@@ -164,7 +164,7 @@ else if ($RCMAIL->action == 'folder-size')
{
$name = trim(get_input_value('_mbox', RCUBE_INPUT_POST, true));
- $size = $IMAP->get_mailbox_size($name);
+ $size = $RCMAIL->imap->get_mailbox_size($name);
// @TODO: check quota and show percentage usage of specified mailbox?
@@ -183,7 +183,7 @@ if ($OUTPUT->ajax_call)
// build table with all folders listed by server
function rcube_subscription_form($attrib)
{
- global $RCMAIL, $IMAP, $CONFIG, $OUTPUT;
+ global $RCMAIL, $CONFIG, $OUTPUT;
list($form_start, $form_end) = get_form_tags($attrib, 'folders');
unset($attrib['form']);
@@ -200,12 +200,12 @@ function rcube_subscription_form($attrib)
}
// get folders from server
- $IMAP->clear_cache('mailboxes', true);
+ $RCMAIL->imap->clear_cache('mailboxes', true);
- $a_unsubscribed = $IMAP->list_unsubscribed();
- $a_subscribed = $IMAP->list_mailboxes('', '*', null, null, true); // unsorted
- $delimiter = $IMAP->get_hierarchy_delimiter();
- $namespace = $IMAP->get_namespace();
+ $a_unsubscribed = $RCMAIL->imap->list_unsubscribed();
+ $a_subscribed = $RCMAIL->imap->list_mailboxes('', '*', null, null, true); // unsorted
+ $delimiter = $RCMAIL->imap->get_hierarchy_delimiter();
+ $namespace = $RCMAIL->imap->get_namespace();
$a_js_folders = array();
$seen = array();
$list_folders = array();
@@ -213,7 +213,7 @@ function rcube_subscription_form($attrib)
// pre-process folders list
foreach ($a_unsubscribed as $i => $folder) {
$folder_id = $folder;
- $folder = $IMAP->mod_mailbox($folder);
+ $folder = $RCMAIL->imap->mod_mailbox($folder);
$foldersplit = explode($delimiter, $folder);
$name = rcube_charset_convert(array_pop($foldersplit), 'UTF7-IMAP');
$parent_folder = join($delimiter, $foldersplit);
@@ -283,7 +283,7 @@ function rcube_subscription_form($attrib)
}
if (!$protected) {
- $attrs = $IMAP->mailbox_attributes($folder['id']);
+ $attrs = $RCMAIL->imap->mailbox_attributes($folder['id']);
$noselect = in_array('\\Noselect', $attrs);
}
@@ -403,7 +403,7 @@ function rcmail_rename_folder($oldname, $newname)
$OUTPUT->set_pagetitle(rcube_label('folders'));
$OUTPUT->include_script('list.js');
-$OUTPUT->set_env('quota', $IMAP->get_capability('QUOTA'));
+$OUTPUT->set_env('quota', $RCMAIL->imap->get_capability('QUOTA'));
// add some labels to client
$OUTPUT->add_label('deletefolderconfirm', 'purgefolderconfirm', 'folderdeleting',
diff --git a/program/steps/settings/func.inc b/program/steps/settings/func.inc
index b778afa13..65836a958 100644
--- a/program/steps/settings/func.inc
+++ b/program/steps/settings/func.inc
@@ -875,13 +875,13 @@ function rcmail_folder_options($mailbox)
*/
function rcmail_update_folder_row($name, $oldname=null, $subscribe=false, $class_name=null)
{
- global $IMAP, $CONFIG, $OUTPUT;
+ global $RCMAIL, $CONFIG, $OUTPUT;
- $delimiter = $IMAP->get_hierarchy_delimiter();
+ $delimiter = $RCMAIL->imap->get_hierarchy_delimiter();
$name_utf8 = rcube_charset_convert($name, 'UTF7-IMAP');
$protected = ($CONFIG['protect_default_folders'] == true && in_array($name, $CONFIG['default_imap_folders']));
- $foldersplit = explode($delimiter, $IMAP->mod_mailbox($name));
+ $foldersplit = explode($delimiter, $RCMAIL->imap->mod_mailbox($name));
$level = count($foldersplit) - 1;
$display_name = str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;', $level)
. Q($protected ? rcmail_localize_foldername($name) : rcube_charset_convert($foldersplit[$level], 'UTF7-IMAP'));
diff --git a/program/steps/settings/save_folder.inc b/program/steps/settings/save_folder.inc
index 48c957239..0fc090e12 100644
--- a/program/steps/settings/save_folder.inc
+++ b/program/steps/settings/save_folder.inc
@@ -33,7 +33,7 @@ $name_imap = rcube_charset_convert($name, RCMAIL_CHARSET, 'UTF7-IMAP');
$old_imap = rcube_charset_convert($old, RCMAIL_CHARSET, 'UTF7-IMAP');
// $path is in UTF7-IMAP already
-$delimiter = $IMAP->get_hierarchy_delimiter();
+$delimiter = $RCMAIL->imap->get_hierarchy_delimiter();
$options = strlen($old_imap) ? rcmail_folder_options($old_imap) : array();
// Folder name checks
@@ -103,7 +103,7 @@ if (!$error && !strlen($old)) {
$folder = $plugin['record'];
if (!$plugin['abort']) {
- $created = $IMAP->create_mailbox($folder['name'], $folder['subscribe']);
+ $created = $RCMAIL->imap->create_mailbox($folder['name'], $folder['subscribe']);
}
else {
$created = $plugin['result'];