From 9490b7b7f2a44e09a016e21abb3d0b4639f8d806 Mon Sep 17 00:00:00 2001 From: thomascube Date: Thu, 4 Oct 2007 07:48:43 +0000 Subject: Use object method to get imap hierarchy delimiter --- program/include/rcube_imap.inc | 2 +- program/steps/settings/manage_folders.inc | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) (limited to 'program') 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('    ', 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('    ', 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('    ', $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('    ', $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; } -- cgit v1.2.3