summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2007-10-04 07:48:43 +0000
committerthomascube <thomas@roundcube.net>2007-10-04 07:48:43 +0000
commit9490b7b7f2a44e09a016e21abb3d0b4639f8d806 (patch)
tree83a90353ec56719b12c87ee5a61346452404747d
parentfc74920a6722d80c03e158eea220814dd7631b6b (diff)
Use object method to get imap hierarchy delimiter
-rw-r--r--program/include/rcube_imap.inc2
-rw-r--r--program/steps/settings/manage_folders.inc13
2 files changed, 9 insertions, 6 deletions
diff --git a/program/include/rcube_imap.inc b/program/include/rcube_imap.inc
index 97dfeba52..41cc1cca5 100644
--- a/program/include/rcube_imap.inc
+++ b/program/include/rcube_imap.inc
@@ -49,7 +49,7 @@ class rcube_imap
var $page_size = 10;
var $sort_field = 'date';
var $sort_order = 'DESC';
- var $delimiter = '/';
+ var $delimiter = NULL;
var $caching_enabled = FALSE;
var $default_folders = array('INBOX');
var $default_folders_lc = array('inbox');
diff --git a/program/steps/settings/manage_folders.inc b/program/steps/settings/manage_folders.inc
index 0d430cac5..344e40422 100644
--- a/program/steps/settings/manage_folders.inc
+++ b/program/steps/settings/manage_folders.inc
@@ -53,8 +53,9 @@ else if ($_action=='create-folder')
if ($create && $OUTPUT->ajax_call)
{
- $foldersplit = explode($IMAP->delimiter, $create);
- $display_create = str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;', substr_count($create, $IMAP->delimiter)) . rcube_charset_convert($foldersplit[count($foldersplit)-1], 'UTF-7');
+ $delimiter = $IMAP->get_hierarchy_delimiter();
+ $foldersplit = explode($delimiter, $create);
+ $display_create = str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;', substr_count($create, $delimiter)) . rcube_charset_convert($foldersplit[count($foldersplit)-1], 'UTF-7');
$OUTPUT->command('add_folder_row', $create, $display_create);
$OUTPUT->send();
}
@@ -75,7 +76,8 @@ else if ($_action=='rename-folder')
if ($rename && $OUTPUT->ajax_call)
{
- $foldersplit = $IMAP->delimiter ? explode($IMAP->delimiter, $rename) : array($rename);
+ $delimiter = $IMAP->get_hierarchy_delimiter();
+ $foldersplit = explode($delimiter, $rename);
$level = count($foldersplit) - 1;
$display_rename = str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;', $level) . rcube_charset_convert($foldersplit[$level], 'UTF-7');
$OUTPUT->command('replace_folder_row', $oldname, $rename, $display_rename);
@@ -145,6 +147,7 @@ function rcube_subscription_form($attrib)
$a_unsubscribed = $IMAP->list_unsubscribed();
$a_subscribed = $IMAP->list_mailboxes();
+ $delimiter = $IMAP->get_hierarchy_delimiter();
$a_js_folders = array();
$checkbox_subscribe = new checkbox(array('name' => '_subscribed[]', 'onclick' => JS_OBJECT_NAME.".command(this.checked?'subscribe':'unsubscribe',this.value)"));
@@ -166,7 +169,7 @@ function rcube_subscription_form($attrib)
$protected = ($CONFIG['protect_default_folders'] == TRUE && in_array($folder,$CONFIG['default_imap_folders']));
$zebra_class = $i%2 ? 'even' : 'odd';
$folder_js = JQ($folder);
- $foldersplit = $IMAP->delimiter ? explode($IMAP->delimiter, $folder) : array($folder);
+ $foldersplit = explode($delimiter, $folder);
$level = count($foldersplit) - 1;
$display_folder = str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;', $level) . rcube_charset_convert($foldersplit[$level], 'UTF-7');
$folder_html = $CONFIG['protect_default_folders'] && in_array($folder, $CONFIG['default_imap_folders']) ? rcube_label(strtolower($folder)) : $display_folder;
@@ -214,7 +217,7 @@ function rcube_subscription_form($attrib)
$OUTPUT->add_gui_object('subscriptionlist', $attrib['id']);
$OUTPUT->set_env('subscriptionrows', $a_js_folders);
$OUTPUT->set_env('defaultfolders', $CONFIG['default_imap_folders']);
- $OUTPUT->set_env('delimiter', $IMAP->delimiter);
+ $OUTPUT->set_env('delimiter', $delimiter);
return $out;
}