- Fixed handling of folder with name "0" in folder selector

release-0.6
alecpl 14 years ago
parent 091b0284c8
commit 0deec44e7d

@ -1,6 +1,7 @@
CHANGELOG Roundcube Webmail CHANGELOG Roundcube Webmail
=========================== ===========================
- Fixed handling of folder with name "0" in folder selector
- Fix problems with subfolders of INBOX folder on some IMAP servers (#1487725) - Fix problems with subfolders of INBOX folder on some IMAP servers (#1487725)
- Fix handling of folders that doesn't belong to any namespace (#1487637) - Fix handling of folders that doesn't belong to any namespace (#1487637)
- Fix bug where messages were deleted instead moved to trash folder after Shift key was used (#1487902) - Fix bug where messages were deleted instead moved to trash folder after Shift key was used (#1487902)

@ -1190,12 +1190,12 @@ function rcmail_mailbox_list($attrib)
// allow plugins to alter the folder tree or to localize folder names // allow plugins to alter the folder tree or to localize folder names
$hook = $RCMAIL->plugins->exec_hook('render_mailboxlist', array('list' => $a_mailboxes, 'delimiter' => $delimiter)); $hook = $RCMAIL->plugins->exec_hook('render_mailboxlist', array('list' => $a_mailboxes, 'delimiter' => $delimiter));
if ($type=='select') { if ($type == 'select') {
$select = new html_select($attrib); $select = new html_select($attrib);
// add no-selection option // add no-selection option
if ($attrib['noselection']) if ($attrib['noselection'])
$select->add(rcube_label($attrib['noselection']), '0'); $select->add(rcube_label($attrib['noselection']), '');
rcmail_render_folder_tree_select($hook['list'], $mbox_name, $attrib['maxlength'], $select, $attrib['realnames']); rcmail_render_folder_tree_select($hook['list'], $mbox_name, $attrib['maxlength'], $select, $attrib['realnames']);
$out = $select->show(); $out = $select->show();
@ -1420,15 +1420,13 @@ function rcmail_render_folder_tree_html(&$arrFolders, &$mbox_name, &$jslist, $at
* @return string * @return string
*/ */
function rcmail_render_folder_tree_select(&$arrFolders, &$mbox_name, $maxlength, &$select, $realnames=false, $nestLevel=0) function rcmail_render_folder_tree_select(&$arrFolders, &$mbox_name, $maxlength, &$select, $realnames=false, $nestLevel=0)
{ {
$idx = 0;
$out = ''; $out = '';
foreach ($arrFolders as $key=>$folder)
{ foreach ($arrFolders as $key=>$folder) {
if (!$realnames && ($folder_class = rcmail_folder_classname($folder['id']))) if (!$realnames && ($folder_class = rcmail_folder_classname($folder['id'])))
$foldername = rcube_label($folder_class); $foldername = rcube_label($folder_class);
else else {
{
$foldername = $folder['name']; $foldername = $folder['name'];
// shorten the folder name to a given length // shorten the folder name to a given length
@ -1440,12 +1438,10 @@ function rcmail_render_folder_tree_select(&$arrFolders, &$mbox_name, $maxlength,
if (!empty($folder['folders'])) if (!empty($folder['folders']))
$out .= rcmail_render_folder_tree_select($folder['folders'], $mbox_name, $maxlength, $select, $realnames, $nestLevel+1); $out .= rcmail_render_folder_tree_select($folder['folders'], $mbox_name, $maxlength, $select, $realnames, $nestLevel+1);
$idx++;
} }
return $out; return $out;
} }
/** /**

@ -149,7 +149,7 @@
padding-left: 15px; padding-left: 15px;
} }
#messagetoolbar select.mboxlist option[value="0"] #messagetoolbar select.mboxlist option[value=""]
{ {
padding-left: 2px; padding-left: 2px;
} }

Loading…
Cancel
Save