From 2baa16ae6d8355e0dfb38e400fd4115057b0680d Mon Sep 17 00:00:00 2001 From: thomascube Date: Wed, 29 Sep 2010 10:00:48 +0000 Subject: Copy plugins into 0.4.1 release branch --- .../subscriptions_option/localization/cs_CZ.inc | 23 ++++++ .../subscriptions_option/localization/de_CH.inc | 6 ++ .../subscriptions_option/localization/de_DE.inc | 6 ++ .../subscriptions_option/localization/en_US.inc | 6 ++ .../subscriptions_option/localization/es_ES.inc | 6 ++ .../subscriptions_option/localization/et_EE.inc | 6 ++ .../subscriptions_option/localization/ja_JP.inc | 8 ++ .../subscriptions_option/localization/pl_PL.inc | 6 ++ .../subscriptions_option/localization/ru_RU.inc | 6 ++ .../subscriptions_option/localization/sv_SE.inc | 6 ++ .../subscriptions_option/localization/zh_TW.inc | 6 ++ .../subscriptions_option/subscriptions_option.php | 92 ++++++++++++++++++++++ 12 files changed, 177 insertions(+) create mode 100644 plugins/subscriptions_option/localization/cs_CZ.inc create mode 100644 plugins/subscriptions_option/localization/de_CH.inc create mode 100644 plugins/subscriptions_option/localization/de_DE.inc create mode 100644 plugins/subscriptions_option/localization/en_US.inc create mode 100644 plugins/subscriptions_option/localization/es_ES.inc create mode 100644 plugins/subscriptions_option/localization/et_EE.inc create mode 100644 plugins/subscriptions_option/localization/ja_JP.inc create mode 100644 plugins/subscriptions_option/localization/pl_PL.inc create mode 100644 plugins/subscriptions_option/localization/ru_RU.inc create mode 100644 plugins/subscriptions_option/localization/sv_SE.inc create mode 100644 plugins/subscriptions_option/localization/zh_TW.inc create mode 100644 plugins/subscriptions_option/subscriptions_option.php (limited to 'plugins/subscriptions_option') diff --git a/plugins/subscriptions_option/localization/cs_CZ.inc b/plugins/subscriptions_option/localization/cs_CZ.inc new file mode 100644 index 000000000..d62520197 --- /dev/null +++ b/plugins/subscriptions_option/localization/cs_CZ.inc @@ -0,0 +1,23 @@ + | ++-----------------------------------------------------------------------+ + +@version $Id: labels.inc 2993 2009-09-26 18:32:07Z alec $ + +*/ + +$labels = array(); +$labels['useimapsubscriptions'] = 'Používat odebírání IMAP složek'; + +?> diff --git a/plugins/subscriptions_option/localization/de_CH.inc b/plugins/subscriptions_option/localization/de_CH.inc new file mode 100644 index 000000000..b4affe0c8 --- /dev/null +++ b/plugins/subscriptions_option/localization/de_CH.inc @@ -0,0 +1,6 @@ + diff --git a/plugins/subscriptions_option/localization/de_DE.inc b/plugins/subscriptions_option/localization/de_DE.inc new file mode 100644 index 000000000..b4affe0c8 --- /dev/null +++ b/plugins/subscriptions_option/localization/de_DE.inc @@ -0,0 +1,6 @@ + diff --git a/plugins/subscriptions_option/localization/en_US.inc b/plugins/subscriptions_option/localization/en_US.inc new file mode 100644 index 000000000..5a348e0ee --- /dev/null +++ b/plugins/subscriptions_option/localization/en_US.inc @@ -0,0 +1,6 @@ + diff --git a/plugins/subscriptions_option/localization/es_ES.inc b/plugins/subscriptions_option/localization/es_ES.inc new file mode 100644 index 000000000..ca9a42126 --- /dev/null +++ b/plugins/subscriptions_option/localization/es_ES.inc @@ -0,0 +1,6 @@ + diff --git a/plugins/subscriptions_option/localization/et_EE.inc b/plugins/subscriptions_option/localization/et_EE.inc new file mode 100644 index 000000000..6c5f6f435 --- /dev/null +++ b/plugins/subscriptions_option/localization/et_EE.inc @@ -0,0 +1,6 @@ + diff --git a/plugins/subscriptions_option/localization/ja_JP.inc b/plugins/subscriptions_option/localization/ja_JP.inc new file mode 100644 index 000000000..dacea2956 --- /dev/null +++ b/plugins/subscriptions_option/localization/ja_JP.inc @@ -0,0 +1,8 @@ + diff --git a/plugins/subscriptions_option/localization/pl_PL.inc b/plugins/subscriptions_option/localization/pl_PL.inc new file mode 100644 index 000000000..8544c7d30 --- /dev/null +++ b/plugins/subscriptions_option/localization/pl_PL.inc @@ -0,0 +1,6 @@ + diff --git a/plugins/subscriptions_option/localization/ru_RU.inc b/plugins/subscriptions_option/localization/ru_RU.inc new file mode 100644 index 000000000..5deb84e0d --- /dev/null +++ b/plugins/subscriptions_option/localization/ru_RU.inc @@ -0,0 +1,6 @@ + diff --git a/plugins/subscriptions_option/localization/sv_SE.inc b/plugins/subscriptions_option/localization/sv_SE.inc new file mode 100644 index 000000000..05b7006f4 --- /dev/null +++ b/plugins/subscriptions_option/localization/sv_SE.inc @@ -0,0 +1,6 @@ + diff --git a/plugins/subscriptions_option/localization/zh_TW.inc b/plugins/subscriptions_option/localization/zh_TW.inc new file mode 100644 index 000000000..f310b51b7 --- /dev/null +++ b/plugins/subscriptions_option/localization/zh_TW.inc @@ -0,0 +1,6 @@ + diff --git a/plugins/subscriptions_option/subscriptions_option.php b/plugins/subscriptions_option/subscriptions_option.php new file mode 100644 index 000000000..d9c5ce7db --- /dev/null +++ b/plugins/subscriptions_option/subscriptions_option.php @@ -0,0 +1,92 @@ +add_texts('localization/', false); + $dont_override = rcmail::get_instance()->config->get('dont_override', array()); + if (!in_array('use_subscriptions', $dont_override)) { + $this->add_hook('preferences_list', array($this, 'settings_blocks')); + $this->add_hook('preferences_save', array($this, 'save_prefs')); + } + $this->add_hook('mailboxes_list', array($this, 'mailboxes_list')); + $this->add_hook('folders_list', array($this, 'folders_list')); + } + + function settings_blocks($args) + { + if ($args['section'] == 'server') { + $use_subscriptions = rcmail::get_instance()->config->get('use_subscriptions'); + $field_id = 'rcmfd_use_subscriptions'; + $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'))), + 'content' => $checkbox->show($use_subscriptions?1:0), + ); + } + + return $args; + } + + function save_prefs($args) + { + if ($args['section'] == 'server') { + $rcmail = rcmail::get_instance(); + $use_subscriptions = $rcmail->config->get('use_subscriptions'); + + $args['prefs']['use_subscriptions'] = isset($_POST['_use_subscriptions']) ? true : false; + + // if the use_subscriptions preference changes, flush the folder cache + if (($use_subscriptions && !isset($_POST['_use_subscriptions'])) || + (!$use_subscriptions && isset($_POST['_use_subscriptions']))) { + $rcmail->imap_connect(); + $rcmail->imap->clear_cache('mailboxes'); + } + } + return $args; + } + + function mailboxes_list($args) + { + $rcmail = rcmail::get_instance(); + if (!$rcmail->config->get('use_subscriptions', true)) { + $args['folders'] = $rcmail->imap->conn->listMailboxes($rcmail->imap->mod_mailbox($args['root']), $args['filter']); + } + return $args; + } + + function folders_list($args) + { + $rcmail = rcmail::get_instance(); + if (!$rcmail->config->get('use_subscriptions', true)) { + $args['table']->remove_column('subscribed'); + } + return $args; + } +} -- cgit v1.2.3