diff options
author | Aleksander Machniak <alec@alec.pl> | 2017-04-01 10:45:07 +0300 |
---|---|---|
committer | Aleksander Machniak <alec@alec.pl> | 2017-04-01 10:46:46 +0300 |
commit | 34446e00ca97ba1db2a14f359c44a8560f5e66e7 (patch) | |
tree | dd73cada8d47d2b497228369bc761b84746423c3 /program/steps | |
parent | b314dfc5483571aea9901b6394d316abb2661888 (diff) |
Fix bug where namespace prefix could not be truncated on folders list if show_real_foldernames=true (#5695)
Diffstat (limited to 'program/steps')
-rw-r--r-- | program/steps/settings/edit_folder.inc | 9 | ||||
-rw-r--r-- | program/steps/settings/folders.inc | 5 |
2 files changed, 8 insertions, 6 deletions
diff --git a/program/steps/settings/edit_folder.inc b/program/steps/settings/edit_folder.inc index 8ddc17e65..c16f2cabd 100644 --- a/program/steps/settings/edit_folder.inc +++ b/program/steps/settings/edit_folder.inc @@ -86,20 +86,21 @@ function rcmail_folder_form($attrib) // Location (name) if ($options['protected']) { - $foldername = str_replace($delimiter, ' » ', rcube::Q($RCMAIL->localize_folderpath($mbox))); + $foldername = str_replace($delimiter, ' » ', rcube::Q($RCMAIL->localize_foldername($mbox, false, true))); } else if ($options['norename']) { $foldername = rcube::Q($folder); } else { - if (isset($_POST['_name'])) + if (isset($_POST['_name'])) { $folder = trim(rcube_utils::get_input_value('_name', rcube_utils::INPUT_POST, true)); + } $foldername = new html_inputfield(array('name' => '_name', 'id' => '_name', 'size' => 30)); $foldername = $foldername->show($folder); - if ($options['special']) { - $foldername .= ' (' . rcube::Q($RCMAIL->localize_foldername($mbox)) .')'; + if ($options['special'] && ($sname = $RCMAIL->localize_foldername($mbox, false, true)) != $folder) { + $foldername .= ' (' . rcube::Q($sname) .')'; } } diff --git a/program/steps/settings/folders.inc b/program/steps/settings/folders.inc index 345eb4785..a7fab763e 100644 --- a/program/steps/settings/folders.inc +++ b/program/steps/settings/folders.inc @@ -277,12 +277,13 @@ function rcmail_subscription_form($attrib) foreach ($list_folders as $i => $folder) { $sub_key = array_search($folder['id'], $a_subscribed); $subscribed = $sub_key !== false; - $protected = $folder['id'] == 'INBOX' || ($protect_default && isset($special_folders[$folder['id']])); + $special = $folder['id'] == 'INBOX' || isset($special_folders[$folder['id']]); + $protected = $folder['id'] == 'INBOX' || ($protect_default && $special); $noselect = false; $classes = array(); $folder_utf8 = rcube_charset::convert($folder['id'], 'UTF7-IMAP'); - $display_folder = rcube::Q($protected ? $RCMAIL->localize_foldername($folder['id']) : $folder['name']); + $display_folder = rcube::Q($special ? $RCMAIL->localize_foldername($folder['id'], false, true) : $folder['name']); if ($folder['virtual']) { $classes[] = 'virtual'; |