summaryrefslogtreecommitdiff
path: root/program/include/rcmail.php
diff options
context:
space:
mode:
Diffstat (limited to 'program/include/rcmail.php')
-rw-r--r--program/include/rcmail.php29
1 files changed, 21 insertions, 8 deletions
diff --git a/program/include/rcmail.php b/program/include/rcmail.php
index 8abe87303..dbf56e55f 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));
@@ -1630,7 +1643,7 @@ class rcmail extends rcube
$rcmail->output->add_script('rcmail.set_quota('.rcube_output::json_serialize($quota).');', 'docready');
- return html::span($attrib, '');
+ return html::span($attrib, ' ');
}
@@ -1857,7 +1870,7 @@ class rcmail extends rcube
}
$this->output->set_env('max_filesize', $max_filesize);
- $max_filesize = self::show_bytes($max_filesize);
+ $max_filesize = $this->show_bytes($max_filesize);
$this->output->set_env('filesizeerror', $this->gettext(array(
'name' => 'filesizeerror', 'vars' => array('size' => $max_filesize))));