summaryrefslogtreecommitdiff
path: root/roundcubemail/program/include
diff options
context:
space:
mode:
authoralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-07-29 11:53:35 +0000
committeralec <alec@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-07-29 11:53:35 +0000
commit1b663e7de9cffb0d64f079cb447f4842a3a8e22f (patch)
tree9dada487e265b74df84bdb402c88d60c6967ff7a /roundcubemail/program/include
parentd3ad9500a897ee3165faeb1eb753b00d4c2cf289 (diff)
- Fix 'exceptions' parameter of rcmail_mailbox_select() to handle directories on any level of the structure
git-svn-id: https://svn.roundcube.net/trunk@4988 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include')
-rw-r--r--roundcubemail/program/include/main.inc13
1 files changed, 9 insertions, 4 deletions
diff --git a/roundcubemail/program/include/main.inc b/roundcubemail/program/include/main.inc
index 6d0cb7242..26bc8cd0d 100644
--- a/roundcubemail/program/include/main.inc
+++ b/roundcubemail/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('&nbsp;', $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;