diff options
author | alecpl <alec@alec.pl> | 2011-07-29 11:53:35 +0000 |
---|---|---|
committer | alecpl <alec@alec.pl> | 2011-07-29 11:53:35 +0000 |
commit | 4d784be2b9dbd1b0be8c35f17bae43eeee035062 (patch) | |
tree | 17042448e1b674dd47525a8911883022d011dd23 /program/include/main.inc | |
parent | f03d89e49399f659975e158a8505fba69ef8ae91 (diff) |
- Fix 'exceptions' parameter of rcmail_mailbox_select() to handle directories on any level of the structure
Diffstat (limited to 'program/include/main.inc')
-rw-r--r-- | program/include/main.inc | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/program/include/main.inc b/program/include/main.inc index 6d0cb7242..26bc8cd0d 100644 --- a/program/include/main.inc +++ b/program/include/main.inc @@ -1229,7 +1229,7 @@ function rcmail_mailbox_select($p = array()) if ($p['noselection']) $select->add($p['noselection'], ''); - rcmail_render_folder_tree_select($a_mailboxes, $mbox, $p['maxlength'], $select, $p['realnames']); + rcmail_render_folder_tree_select($a_mailboxes, $mbox, $p['maxlength'], $select, $p['realnames'], 0, $p['exceptions']); return $select; } @@ -1402,11 +1402,15 @@ function rcmail_render_folder_tree_html(&$arrFolders, &$mbox_name, &$jslist, $at * @access private * @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, $exceptions=array()) { $out = ''; - foreach ($arrFolders as $key=>$folder) { + foreach ($arrFolders as $key => $folder) { + if (!empty($exceptions) && in_array($folder['id'], $exceptions)) { + continue; + } + if (!$realnames && ($folder_class = rcmail_folder_classname($folder['id']))) $foldername = rcube_label($folder_class); else { @@ -1420,7 +1424,8 @@ function rcmail_render_folder_tree_select(&$arrFolders, &$mbox_name, $maxlength, $select->add(str_repeat(' ', $nestLevel*4) . $foldername, $folder['id']); 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, $exceptions); } return $out; |