From 3ebac0167bf20104fb7a2a55934765117760264c Mon Sep 17 00:00:00 2001 From: Thomas Bruederli <thomas@roundcube.net> Date: Mon, 18 Aug 2014 03:53:18 -0400 Subject: [PATCH] Only add zen-mode text labels in compose step --- program/steps/mail/folders.inc | 29 +++++++++++++++++------------ 1 files changed, 17 insertions(+), 12 deletions(-) diff --git a/program/steps/mail/folders.inc b/program/steps/mail/folders.inc index d7cfd93..49bf253 100644 --- a/program/steps/mail/folders.inc +++ b/program/steps/mail/folders.inc @@ -5,7 +5,7 @@ | program/steps/mail/folders.inc | | | | This file is part of the Roundcube Webmail client | - | Copyright (C) 2005-2009, The Roundcube Dev Team | + | Copyright (C) 2005-2013, The Roundcube Dev Team | | | | Licensed under the GNU General Public License version 3 or | | any later version with exceptions for skins & plugins. | @@ -20,14 +20,14 @@ */ // only process ajax requests -if (!$OUTPUT->ajax_call) +if (!$OUTPUT->ajax_call) { return; +} $mbox = rcube_utils::get_input_value('_mbox', rcube_utils::INPUT_POST, true); // send EXPUNGE command if ($RCMAIL->action == 'expunge') { - $success = $RCMAIL->storage->expunge_folder($mbox); // reload message list if current mailbox @@ -35,7 +35,7 @@ $OUTPUT->show_message('folderexpunged', 'confirmation'); if (!empty($_REQUEST['_reload'])) { - $OUTPUT->command('set_quota', $RCMAIL->quota_content()); + $OUTPUT->command('set_quota', $RCMAIL->quota_content(null, $mbox)); $OUTPUT->command('message_list.clear'); $RCMAIL->action = 'list'; return; @@ -45,16 +45,16 @@ $RCMAIL->display_server_error(); } } - // clear mailbox -else if ($RCMAIL->action == 'purge') -{ - $delimiter = $RCMAIL->storage->get_hierarchy_delimiter(); - $trash_regexp = '/^' . preg_quote($CONFIG['trash_mbox'] . $delimiter, '/') . '/'; - $junk_regexp = '/^' . preg_quote($CONFIG['junk_mbox'] . $delimiter, '/') . '/'; +else if ($RCMAIL->action == 'purge') { + $delimiter = $RCMAIL->storage->get_hierarchy_delimiter(); + $trash_mbox = $RCMAIL->config->get('trash_mbox'); + $junk_mbox = $RCMAIL->config->get('junk_mbox'); + $trash_regexp = '/^' . preg_quote($trash_mbox . $delimiter, '/') . '/'; + $junk_regexp = '/^' . preg_quote($junk_mbox . $delimiter, '/') . '/'; // we should only be purging trash and junk (or their subfolders) - if ($mbox == $CONFIG['trash_mbox'] || $mbox == $CONFIG['junk_mbox'] + if ($mbox == $trash_mbox || $mbox == $junk_mbox || preg_match($trash_regexp, $mbox) || preg_match($junk_regexp, $mbox) ) { $success = $RCMAIL->storage->clear_folder($mbox); @@ -69,8 +69,13 @@ $OUTPUT->command('message_list.clear'); $OUTPUT->command('set_rowcount', rcmail_get_messagecount_text(), $mbox); $OUTPUT->command('set_unread_count', $mbox, 0); - $OUTPUT->command('set_quota', $RCMAIL->quota_content()); + $OUTPUT->command('set_quota', $RCMAIL->quota_content(null, $mbox)); rcmail_set_unseen_count($mbox, 0); + + // set trash folder state + if ($mbox === $trash_mbox) { + $OUTPUT->command('set_trash_count', 0); + } } } else { -- Gitblit v1.9.1