From ced34cb15e095836767971aa4d27b141fb1d7ec9 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak <alec@alec.pl> Date: Sat, 18 Oct 2014 08:47:54 -0400 Subject: [PATCH] Merge pull request #230 from bytesatwork-xx/master --- plugins/subscriptions_option/subscriptions_option.php | 22 +++++++++++----------- 1 files changed, 11 insertions(+), 11 deletions(-) diff --git a/plugins/subscriptions_option/subscriptions_option.php b/plugins/subscriptions_option/subscriptions_option.php index 28f8262..5b926f2 100644 --- a/plugins/subscriptions_option/subscriptions_option.php +++ b/plugins/subscriptions_option/subscriptions_option.php @@ -7,12 +7,12 @@ * It includes a toggle on the settings page under "Server Settings". * The preference can also be locked * - * Add it to the plugins list in config/main.inc.php to enable the user option + * Add it to the plugins list in config.inc.php to enable the user option * The user option can be hidden and set globally by adding 'use_subscriptions' - * to the the 'dont_override' configure line: - * $rcmail_config['dont_override'] = array('use_subscriptions'); + * to the 'dont_override' configure line: + * $config['dont_override'] = array('use_subscriptions'); * and then set the global preference - * $rcmail_config['use_subscriptions'] = true; // or false + * $config['use_subscriptions'] = true; // or false * * Roundcube caches folder lists. When a user changes this option or visits * their folder list, this cache is refreshed. If the option is on the @@ -21,6 +21,7 @@ * * @version @package_version@ * @author Ziba Scott + * @license GNU GPLv3+ */ class subscriptions_option extends rcube_plugin { @@ -46,7 +47,7 @@ $checkbox = new html_checkbox(array('name' => '_use_subscriptions', 'id' => $field_id, 'value' => 1)); $args['blocks']['main']['options']['use_subscriptions'] = array( - 'title' => html::label($field_id, Q($this->gettext('useimapsubscriptions'))), + 'title' => html::label($field_id, rcube::Q($this->gettext('useimapsubscriptions'))), 'content' => $checkbox->show($use_subscriptions?1:0), ); } @@ -74,12 +75,9 @@ function mailboxes_list($args) { - $rcmail = rcmail::get_instance(); + $rcmail = rcmail::get_instance(); if (!$rcmail->config->get('use_subscriptions', true)) { - $storage = $rcmail->get_storage(); - if ($storage->check_connection()) { - $args['folders'] = $storage->conn->listMailboxes($args['root'], $args['name']); - } + $args['folders'] = $rcmail->get_storage()->list_folders_direct(); } return $args; } @@ -88,7 +86,9 @@ { $rcmail = rcmail::get_instance(); if (!$rcmail->config->get('use_subscriptions', true)) { - $args['table']->remove_column('subscribed'); + foreach ($args['list'] as $idx => $data) { + $args['list'][$idx]['content'] = preg_replace('/<input [^>]+>/', '', $data['content']); + } } return $args; } -- Gitblit v1.9.1