summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2009-07-03 14:05:33 +0000
committerthomascube <thomas@roundcube.net>2009-07-03 14:05:33 +0000
commitf62d5fac0a577bcc35cfcc24b311563249752843 (patch)
tree9a8c2e4cca0c2d9dc692bf2fafc4185f9fb0f76e
parent8448fca1f11f69e29bca568cb0042e83dd6be89e (diff)
Add new hook 'list_mailboxes' to alter the mailboxlist
-rw-r--r--program/include/main.inc7
1 files changed, 5 insertions, 2 deletions
diff --git a/program/include/main.inc b/program/include/main.inc
index c870b495d..b2bb1b256 100644
--- a/program/include/main.inc
+++ b/program/include/main.inc
@@ -1081,6 +1081,9 @@ function rcmail_mailbox_list($attrib)
foreach ($a_folders as $folder)
rcmail_build_folder_tree($a_mailboxes, $folder, $delimiter);
}
+
+ // allow plugins to alter the folder tree or to localize folder names
+ $hook = $RCMAIL->plugins->exec_hook('list_mailboxes', array('list' => $a_mailboxes, 'delimiter' => $delimiter));
if ($type=='select') {
$select = new html_select($attrib);
@@ -1089,12 +1092,12 @@ function rcmail_mailbox_list($attrib)
if ($attrib['noselection'])
$select->add(rcube_label($attrib['noselection']), '0');
- rcmail_render_folder_tree_select($a_mailboxes, $mbox_name, $attrib['maxlength'], $select, $attrib['realnames']);
+ rcmail_render_folder_tree_select($hook['list'], $mbox_name, $attrib['maxlength'], $select, $attrib['realnames']);
$out = $select->show();
}
else {
$js_mailboxlist = array();
- $out = html::tag('ul', $attrib, rcmail_render_folder_tree_html($a_mailboxes, $mbox_name, $js_mailboxlist, $attrib), html::$common_attrib);
+ $out = html::tag('ul', $attrib, rcmail_render_folder_tree_html($hook['list'], $mbox_name, $js_mailboxlist, $attrib), html::$common_attrib);
$RCMAIL->output->add_gui_object('mailboxlist', $attrib['id']);
$RCMAIL->output->set_env('mailboxes', $js_mailboxlist);