summaryrefslogtreecommitdiff
path: root/program/include
diff options
context:
space:
mode:
authorAleksander Machniak <alec@alec.pl>2013-12-15 10:01:38 +0100
committerAleksander Machniak <alec@alec.pl>2013-12-15 10:01:38 +0100
commit9a0153324eeb1f0e808cb1a063d1f37d49ad48e2 (patch)
treee8370c629b5b32c689da8362f5be78097572a0a3 /program/include
parent4187b3e26ff00b607d05cb9b588e83db18c3cab7 (diff)
Implemented menu actions to copy/move messages, added folder-selector widget (#1484086)
Diffstat (limited to 'program/include')
-rw-r--r--program/include/rcmail.php25
1 files changed, 19 insertions, 6 deletions
diff --git a/program/include/rcmail.php b/program/include/rcmail.php
index 35ade8a41..cefbc4d14 100644
--- a/program/include/rcmail.php
+++ b/program/include/rcmail.php
@@ -1282,13 +1282,22 @@ class rcmail extends rcube
}
else {
$js_mailboxlist = array();
- $out = html::tag('ul', $attrib, $rcmail->render_folder_tree_html($a_mailboxes, $mbox_name, $js_mailboxlist, $attrib), html::$common_attrib);
+ $tree = $rcmail->render_folder_tree_html($a_mailboxes, $mbox_name, $js_mailboxlist, $attrib);
+
+ if ($type != 'js') {
+ $out = html::tag('ul', $attrib, $tree, html::$common_attrib);
+
+ $rcmail->output->include_script('treelist.js');
+ $rcmail->output->add_gui_object('mailboxlist', $attrib['id']);
+ $rcmail->output->set_env('unreadwrap', $attrib['unreadwrap']);
+ $rcmail->output->set_env('collapsed_folders', (string)$rcmail->config->get('collapsed_folders'));
+ }
- $rcmail->output->include_script('treelist.js');
- $rcmail->output->add_gui_object('mailboxlist', $attrib['id']);
$rcmail->output->set_env('mailboxes', $js_mailboxlist);
- $rcmail->output->set_env('unreadwrap', $attrib['unreadwrap']);
- $rcmail->output->set_env('collapsed_folders', (string)$rcmail->config->get('collapsed_folders'));
+
+ // we can't use object keys in javascript because they are unordered
+ // we need sorted folders list for folder-selector widget
+ $rcmail->output->set_env('mailboxes_list', array_keys($js_mailboxlist));
}
return $out;
@@ -1473,9 +1482,13 @@ class rcmail extends rcube
$jslist[$folder['id']] = array(
'id' => $folder['id'],
'name' => $foldername,
- 'virtual' => $folder['virtual']
+ 'virtual' => $folder['virtual'],
);
+ if (!empty($folder_class)) {
+ $jslist[$folder['id']]['class'] = $folder_class;
+ }
+
if (!empty($folder['folders'])) {
$out .= html::tag('ul', array('style' => ($is_collapsed ? "display:none;" : null)),
$this->render_folder_tree_html($folder['folders'], $mbox_name, $jslist, $attrib, $nestLevel+1));