summaryrefslogtreecommitdiff
path: root/plugins/archive
diff options
context:
space:
mode:
authorthomascube <thomas@roundcube.net>2012-03-31 12:25:48 +0000
committerthomascube <thomas@roundcube.net>2012-03-31 12:25:48 +0000
commit48e9c14ebded89d858c8be0333f77f77a81b0877 (patch)
treee97fd2ea338eea2dbe5f3fb7431e73f44cb8bf18 /plugins/archive
parent13db9ee199b0a452a6efaf09e6f7c5a76f739ef5 (diff)
Move plugins repository into roundcubemail root folder; svn:externals are not defined anymore
Diffstat (limited to 'plugins/archive')
-rw-r--r--plugins/archive/archive.js34
-rw-r--r--plugins/archive/archive.php128
-rw-r--r--plugins/archive/localization/cs_CZ.inc25
-rw-r--r--plugins/archive/localization/de_CH.inc8
-rw-r--r--plugins/archive/localization/de_DE.inc8
-rw-r--r--plugins/archive/localization/en_US.inc9
-rw-r--r--plugins/archive/localization/es_AR.inc10
-rw-r--r--plugins/archive/localization/es_ES.inc10
-rw-r--r--plugins/archive/localization/et_EE.inc8
-rw-r--r--plugins/archive/localization/fr_FR.inc8
-rw-r--r--plugins/archive/localization/gl_ES.inc10
-rw-r--r--plugins/archive/localization/ja_JP.inc21
-rw-r--r--plugins/archive/localization/nl_NL.inc8
-rw-r--r--plugins/archive/localization/pl_PL.inc21
-rw-r--r--plugins/archive/localization/pt_BR.inc8
-rw-r--r--plugins/archive/localization/ru_RU.inc8
-rw-r--r--plugins/archive/localization/sv_SE.inc8
-rw-r--r--plugins/archive/localization/zh_TW.inc8
-rw-r--r--plugins/archive/package.xml70
-rw-r--r--plugins/archive/skins/default/archive.css10
-rw-r--r--plugins/archive/skins/default/archive_act.pngbin0 -> 3663 bytes
-rw-r--r--plugins/archive/skins/default/archive_pas.pngbin0 -> 977 bytes
-rw-r--r--plugins/archive/skins/default/foldericon.pngbin0 -> 3312 bytes
23 files changed, 420 insertions, 0 deletions
diff --git a/plugins/archive/archive.js b/plugins/archive/archive.js
new file mode 100644
index 000000000..af2b0d26d
--- /dev/null
+++ b/plugins/archive/archive.js
@@ -0,0 +1,34 @@
+/*
+ * Archive plugin script
+ * @version @package_version@
+ */
+
+function rcmail_archive(prop)
+{
+ if (!rcmail.env.uid && (!rcmail.message_list || !rcmail.message_list.get_selection().length))
+ return;
+
+ if (rcmail.env.mailbox != rcmail.env.archive_folder)
+ rcmail.command('moveto', rcmail.env.archive_folder);
+}
+
+// callback for app-onload event
+if (window.rcmail) {
+ rcmail.addEventListener('init', function(evt) {
+
+ // register command (directly enable in message view mode)
+ rcmail.register_command('plugin.archive', rcmail_archive, (rcmail.env.uid && rcmail.env.mailbox != rcmail.env.archive_folder));
+
+ // add event-listener to message list
+ if (rcmail.message_list)
+ rcmail.message_list.addEventListener('select', function(list){
+ rcmail.enable_command('plugin.archive', (list.get_selection().length > 0 && rcmail.env.mailbox != rcmail.env.archive_folder));
+ });
+
+ // set css style for archive folder
+ var li;
+ if (rcmail.env.archive_folder && (li = rcmail.get_folder_li(rcmail.env.archive_folder, '', true)))
+ $(li).addClass('archive');
+ })
+}
+
diff --git a/plugins/archive/archive.php b/plugins/archive/archive.php
new file mode 100644
index 000000000..33e0daa31
--- /dev/null
+++ b/plugins/archive/archive.php
@@ -0,0 +1,128 @@
+<?php
+
+/**
+ * Archive
+ *
+ * Plugin that adds a new button to the mailbox toolbar
+ * to move messages to a (user selectable) archive folder.
+ *
+ * @version @package_version@
+ * @license GNU GPLv3+
+ * @author Andre Rodier, Thomas Bruederli
+ */
+class archive extends rcube_plugin
+{
+ public $task = 'mail|settings';
+
+ function init()
+ {
+ $rcmail = rcmail::get_instance();
+
+ // There is no "Archived flags"
+ // $GLOBALS['IMAP_FLAGS']['ARCHIVED'] = 'Archive';
+ if ($rcmail->task == 'mail' && ($rcmail->action == '' || $rcmail->action == 'show')
+ && ($archive_folder = $rcmail->config->get('archive_mbox'))) {
+ $skin_path = $this->local_skin_path();
+ if (is_file($this->home . "/$skin_path/archive.css"))
+ $this->include_stylesheet("$skin_path/archive.css");
+
+ $this->include_script('archive.js');
+ $this->add_texts('localization', true);
+ $this->add_button(
+ array(
+ 'type' => 'link',
+ 'label' => 'buttontext',
+ 'command' => 'plugin.archive',
+ 'class' => 'button buttonPas archive disabled',
+ 'classact' => 'button archive',
+ 'width' => 32,
+ 'height' => 32,
+ 'title' => 'buttontitle',
+ 'domain' => $this->ID,
+ ),
+ 'toolbar');
+
+ // register hook to localize the archive folder
+ $this->add_hook('render_mailboxlist', array($this, 'render_mailboxlist'));
+
+ // set env variable for client
+ $rcmail->output->set_env('archive_folder', $archive_folder);
+
+ // add archive folder to the list of default mailboxes
+ if (($default_folders = $rcmail->config->get('default_folders')) && !in_array($archive_folder, $default_folders)) {
+ $default_folders[] = $archive_folder;
+ $rcmail->config->set('default_folders', $default_folders);
+ }
+ }
+ else if ($rcmail->task == 'settings') {
+ $dont_override = $rcmail->config->get('dont_override', array());
+ if (!in_array('archive_mbox', $dont_override)) {
+ $this->add_hook('preferences_list', array($this, 'prefs_table'));
+ $this->add_hook('preferences_save', array($this, 'save_prefs'));
+ }
+ }
+ }
+
+ function render_mailboxlist($p)
+ {
+ $rcmail = rcmail::get_instance();
+ $archive_folder = $rcmail->config->get('archive_mbox');
+
+ // set localized name for the configured archive folder
+ if ($archive_folder) {
+ if (isset($p['list'][$archive_folder]))
+ $p['list'][$archive_folder]['name'] = $this->gettext('archivefolder');
+ else // search in subfolders
+ $this->_mod_folder_name($p['list'], $archive_folder, $this->gettext('archivefolder'));
+ }
+
+ return $p;
+ }
+
+ function _mod_folder_name(&$list, $folder, $new_name)
+ {
+ foreach ($list as $idx => $item) {
+ if ($item['id'] == $folder) {
+ $list[$idx]['name'] = $new_name;
+ return true;
+ } else if (!empty($item['folders']))
+ if ($this->_mod_folder_name($list[$idx]['folders'], $folder, $new_name))
+ return true;
+ }
+ return false;
+ }
+
+ function prefs_table($args)
+ {
+ global $CURR_SECTION;
+
+ if ($args['section'] == 'folders') {
+ $this->add_texts('localization');
+
+ $rcmail = rcmail::get_instance();
+
+ // load folders list when needed
+ if ($CURR_SECTION)
+ $select = rcmail_mailbox_select(array('noselection' => '---', 'realnames' => true,
+ 'maxlength' => 30, 'exceptions' => array('INBOX'), 'folder_filter' => 'mail', 'folder_rights' => 'w'));
+ else
+ $select = new html_select();
+
+ $args['blocks']['main']['options']['archive_mbox'] = array(
+ 'title' => $this->gettext('archivefolder'),
+ 'content' => $select->show($rcmail->config->get('archive_mbox'), array('name' => "_archive_mbox"))
+ );
+ }
+
+ return $args;
+ }
+
+ function save_prefs($args)
+ {
+ if ($args['section'] == 'folders') {
+ $args['prefs']['archive_mbox'] = get_input_value('_archive_mbox', RCUBE_INPUT_POST);
+ return $args;
+ }
+ }
+
+}
diff --git a/plugins/archive/localization/cs_CZ.inc b/plugins/archive/localization/cs_CZ.inc
new file mode 100644
index 000000000..bb257bca0
--- /dev/null
+++ b/plugins/archive/localization/cs_CZ.inc
@@ -0,0 +1,25 @@
+<?php
+
+/*
+
++-----------------------------------------------------------------------+
+| language/cs_CZ/labels.inc |
+| |
+| Language file of the Roundcube archive plugin |
+| Copyright (C) 2005-2009, The Roundcube Dev Team |
+| Licensed under the GNU GPL |
+| |
++-----------------------------------------------------------------------+
+| Author: Milan Kozak <hodza@hodza.net> |
++-----------------------------------------------------------------------+
+
+@version $Id: labels.inc 2993 2009-09-26 18:32:07Z alec $
+
+*/
+
+$labels = array();
+$labels['buttontitle'] = 'Archivovat zprávu';
+$labels['archived'] = 'Úspěšně vloženo do archivu';
+$labels['archivefolder'] = 'Archiv';
+
+?>
diff --git a/plugins/archive/localization/de_CH.inc b/plugins/archive/localization/de_CH.inc
new file mode 100644
index 000000000..2ed0f5ac8
--- /dev/null
+++ b/plugins/archive/localization/de_CH.inc
@@ -0,0 +1,8 @@
+<?php
+
+$labels = array();
+$labels['buttontitle'] = 'Nachricht archivieren';
+$labels['archived'] = 'Nachricht erfolgreich archiviert';
+$labels['archivefolder'] = 'Archiv';
+
+?>
diff --git a/plugins/archive/localization/de_DE.inc b/plugins/archive/localization/de_DE.inc
new file mode 100644
index 000000000..2ed0f5ac8
--- /dev/null
+++ b/plugins/archive/localization/de_DE.inc
@@ -0,0 +1,8 @@
+<?php
+
+$labels = array();
+$labels['buttontitle'] = 'Nachricht archivieren';
+$labels['archived'] = 'Nachricht erfolgreich archiviert';
+$labels['archivefolder'] = 'Archiv';
+
+?>
diff --git a/plugins/archive/localization/en_US.inc b/plugins/archive/localization/en_US.inc
new file mode 100644
index 000000000..01a4f1e13
--- /dev/null
+++ b/plugins/archive/localization/en_US.inc
@@ -0,0 +1,9 @@
+<?php
+
+$labels = array();
+$labels['buttontext'] = 'Archive';
+$labels['buttontitle'] = 'Archive this message';
+$labels['archived'] = 'Successfully archived';
+$labels['archivefolder'] = 'Archive';
+
+?>
diff --git a/plugins/archive/localization/es_AR.inc b/plugins/archive/localization/es_AR.inc
new file mode 100644
index 000000000..7d021f561
--- /dev/null
+++ b/plugins/archive/localization/es_AR.inc
@@ -0,0 +1,10 @@
+<?php
+
+// MPBAUPGRADE
+
+$labels = array();
+$labels['buttontitle'] = 'Archivar este mensaje';
+$labels['archived'] = 'Mensaje Archivado';
+$labels['archivefolder'] = 'Archivo';
+
+?>
diff --git a/plugins/archive/localization/es_ES.inc b/plugins/archive/localization/es_ES.inc
new file mode 100644
index 000000000..7d021f561
--- /dev/null
+++ b/plugins/archive/localization/es_ES.inc
@@ -0,0 +1,10 @@
+<?php
+
+// MPBAUPGRADE
+
+$labels = array();
+$labels['buttontitle'] = 'Archivar este mensaje';
+$labels['archived'] = 'Mensaje Archivado';
+$labels['archivefolder'] = 'Archivo';
+
+?>
diff --git a/plugins/archive/localization/et_EE.inc b/plugins/archive/localization/et_EE.inc
new file mode 100644
index 000000000..e3968d755
--- /dev/null
+++ b/plugins/archive/localization/et_EE.inc
@@ -0,0 +1,8 @@
+<?php
+
+$labels = array();
+$labels['buttontitle'] = 'Arhiveeri see kiri';
+$labels['archived'] = 'Edukalt arhiveeritud';
+$labels['archivefolder'] = 'Arhiveeri';
+
+?>
diff --git a/plugins/archive/localization/fr_FR.inc b/plugins/archive/localization/fr_FR.inc
new file mode 100644
index 000000000..498a091fe
--- /dev/null
+++ b/plugins/archive/localization/fr_FR.inc
@@ -0,0 +1,8 @@
+<?php
+
+$labels = array();
+$labels['buttontitle'] = 'Archiver ce message';
+$labels['archived'] = 'Message archivé avec success';
+$labels['archivefolder'] = 'Archive';
+
+?>
diff --git a/plugins/archive/localization/gl_ES.inc b/plugins/archive/localization/gl_ES.inc
new file mode 100644
index 000000000..62a767869
--- /dev/null
+++ b/plugins/archive/localization/gl_ES.inc
@@ -0,0 +1,10 @@
+<?php
+
+// MPBAUPGRADE
+
+$labels = array();
+$labels['buttontitle'] = 'Arquivar esta mensaxe';
+$labels['archived'] = 'Aquivouse a mensaxe';
+$labels['archivefolder'] = 'Arquivo';
+
+?>
diff --git a/plugins/archive/localization/ja_JP.inc b/plugins/archive/localization/ja_JP.inc
new file mode 100644
index 000000000..647f70f9f
--- /dev/null
+++ b/plugins/archive/localization/ja_JP.inc
@@ -0,0 +1,21 @@
+<?php
+
+/*
+ +-----------------------------------------------------------------------+
+ | localization/ja_JP/labels.inc |
+ | |
+ | Language file of the Roundcube Webmail client |
+ | Copyright (C) 2012, The Roundcube Dev Team |
+ | Licensed under the GNU General Public License |
+ | |
+ +-----------------------------------------------------------------------+
+ | Author: Takahiro Kambe <Unknown> |
+ +-----------------------------------------------------------------------+
+ @version $Id$
+*/
+
+$labels = array();
+$labels['buttontitle'] = 'このメッセージをアーカイブ';
+$labels['archived'] = 'アーカイブしました。';
+$labels['archivefolder'] = 'アーカイブ';
+
diff --git a/plugins/archive/localization/nl_NL.inc b/plugins/archive/localization/nl_NL.inc
new file mode 100644
index 000000000..0d47f7b9c
--- /dev/null
+++ b/plugins/archive/localization/nl_NL.inc
@@ -0,0 +1,8 @@
+<?php
+
+$labels = array();
+$labels['buttontitle'] = 'Archiveer dit bericht';
+$labels['archived'] = 'Succesvol gearchiveerd';
+$labels['archivefolder'] = 'Archief';
+
+?>
diff --git a/plugins/archive/localization/pl_PL.inc b/plugins/archive/localization/pl_PL.inc
new file mode 100644
index 000000000..c0d58d311
--- /dev/null
+++ b/plugins/archive/localization/pl_PL.inc
@@ -0,0 +1,21 @@
+<?php
+
+/*
+ +-----------------------------------------------------------------------+
+ | localization/pl_PL/labels.inc |
+ | |
+ | Language file of the Roundcube Webmail client |
+ | Copyright (C) 2012, The Roundcube Dev Team |
+ | Licensed under the GNU General Public License |
+ | |
+ +-----------------------------------------------------------------------+
+ | Author: Thomas <Unknown> |
+ +-----------------------------------------------------------------------+
+ @version $Id$
+*/
+
+$labels = array();
+$labels['buttontitle'] = 'Przenieś do archiwum';
+$labels['archived'] = 'Pomyślnie zarchiwizowano';
+$labels['archivefolder'] = 'Archiwum';
+
diff --git a/plugins/archive/localization/pt_BR.inc b/plugins/archive/localization/pt_BR.inc
new file mode 100644
index 000000000..224f53caa
--- /dev/null
+++ b/plugins/archive/localization/pt_BR.inc
@@ -0,0 +1,8 @@
+<?php
+
+$labels = array();
+$labels['buttontitle'] = 'Arquivar esta mensagem';
+$labels['archived'] = 'Arquivada com sucesso';
+$labels['archivefolder'] = 'Arquivo';
+
+?>
diff --git a/plugins/archive/localization/ru_RU.inc b/plugins/archive/localization/ru_RU.inc
new file mode 100644
index 000000000..e377ad017
--- /dev/null
+++ b/plugins/archive/localization/ru_RU.inc
@@ -0,0 +1,8 @@
+<?php
+
+$labels = array();
+$labels['buttontitle'] = 'Переместить выбранное в архив';
+$labels['archived'] = 'Перенесено в Архив';
+$labels['archivefolder'] = 'Архив';
+
+?>
diff --git a/plugins/archive/localization/sv_SE.inc b/plugins/archive/localization/sv_SE.inc
new file mode 100644
index 000000000..c55da7aaf
--- /dev/null
+++ b/plugins/archive/localization/sv_SE.inc
@@ -0,0 +1,8 @@
+<?php
+
+$labels = array();
+$labels['buttontitle'] = 'Arkivera meddelande';
+$labels['archived'] = 'Meddelandet är arkiverat';
+$labels['archivefolder'] = 'Arkiv';
+
+?>
diff --git a/plugins/archive/localization/zh_TW.inc b/plugins/archive/localization/zh_TW.inc
new file mode 100644
index 000000000..5cccebbdc
--- /dev/null
+++ b/plugins/archive/localization/zh_TW.inc
@@ -0,0 +1,8 @@
+<?php
+
+$labels = array();
+$labels['buttontitle'] = '封存此信件';
+$labels['archived'] = '已成功封存';
+$labels['archivefolder'] = '封存';
+
+?>
diff --git a/plugins/archive/package.xml b/plugins/archive/package.xml
new file mode 100644
index 000000000..0d02b2d41
--- /dev/null
+++ b/plugins/archive/package.xml
@@ -0,0 +1,70 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<package xmlns="http://pear.php.net/dtd/package-2.0" xmlns:tasks="http://pear.php.net/dtd/tasks-1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" packagerversion="1.9.0" version="2.0" xsi:schemaLocation="http://pear.php.net/dtd/tasks-1.0
+ http://pear.php.net/dtd/tasks-1.0.xsd
+ http://pear.php.net/dtd/package-2.0
+ http://pear.php.net/dtd/package-2.0.xsd">
+ <name>archive</name>
+ <channel>pear.roundcube.net</channel>
+ <summary>Archive feature for Roundcube</summary>
+ <description>This adds a button to move the selected messages to an archive folder. The folder can be selected in the settings panel.</description>
+ <lead>
+ <name>Thomas Bruederli</name>
+ <user>thomasb</user>
+ <email>roundcube@gmail.com</email>
+ <active>yes</active>
+ </lead>
+ <date>2011-11-23</date>
+ <version>
+ <release>1.6</release>
+ <api>1.6</api>
+ </version>
+ <stability>
+ <release>stable</release>
+ <api>stable</api>
+ </stability>
+ <license uri="http://www.gnu.org/licenses/gpl.html">GNU GPLv3+</license>
+ <notes>-</notes>
+ <contents>
+ <dir baseinstalldir="/" name="/">
+ <file name="archive.php" role="php">
+ <tasks:replace from="@name@" to="name" type="package-info"/>
+ <tasks:replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file name="archive.js" role="data">
+ <tasks:replace from="@name@" to="name" type="package-info"/>
+ <tasks:replace from="@package_version@" to="version" type="package-info"/>
+ </file>
+ <file name="localization/cs_CZ.inc" role="data"></file>
+ <file name="localization/de_CH.inc" role="data"></file>
+ <file name="localization/de_DE.inc" role="data"></file>
+ <file name="localization/en_US.inc" role="data"></file>
+ <file name="localization/es_AR.inc" role="data"></file>
+ <file name="localization/es_ES.inc" role="data"></file>
+ <file name="localization/et_EE.inc" role="data"></file>
+ <file name="localization/fr_FR.inc" role="data"></file>
+ <file name="localization/gl_ES.inc" role="data"></file>
+ <file name="localization/ja_JP.inc" role="data"></file>
+ <file name="localization/nl_NL.inc" role="data"></file>
+ <file name="localization/pl_PL.inc" role="data"></file>
+ <file name="localization/pt_BR.inc" role="data"></file>
+ <file name="localization/ru_RU.inc" role="data"></file>
+ <file name="localization/sv_SE.inc" role="data"></file>
+ <file name="localization/zh_TW.inc" role="data"></file>
+ <file name="skins/default/archive_act.png" role="data"></file>
+ <file name="skins/default/archive_pas.png" role="data"></file>
+ <file name="skins/default/foldericon.png" role="data"></file>
+ </dir>
+ <!-- / -->
+ </contents>
+ <dependencies>
+ <required>
+ <php>
+ <min>5.2.1</min>
+ </php>
+ <pearinstaller>
+ <min>1.7.0</min>
+ </pearinstaller>
+ </required>
+ </dependencies>
+ <phprelease/>
+</package>
diff --git a/plugins/archive/skins/default/archive.css b/plugins/archive/skins/default/archive.css
new file mode 100644
index 000000000..9cd221549
--- /dev/null
+++ b/plugins/archive/skins/default/archive.css
@@ -0,0 +1,10 @@
+
+#messagetoolbar a.button.archive {
+ text-indent: -1000px;
+ background: url(archive_act.png) 0 0 no-repeat;
+}
+
+#mailboxlist li.mailbox.archive {
+ background-image: url(foldericon.png);
+ background-position: 5px 1px;
+}
diff --git a/plugins/archive/skins/default/archive_act.png b/plugins/archive/skins/default/archive_act.png
new file mode 100644
index 000000000..2a1735868
--- /dev/null
+++ b/plugins/archive/skins/default/archive_act.png
Binary files differ
diff --git a/plugins/archive/skins/default/archive_pas.png b/plugins/archive/skins/default/archive_pas.png
new file mode 100644
index 000000000..8de208583
--- /dev/null
+++ b/plugins/archive/skins/default/archive_pas.png
Binary files differ
diff --git a/plugins/archive/skins/default/foldericon.png b/plugins/archive/skins/default/foldericon.png
new file mode 100644
index 000000000..ec0853c44
--- /dev/null
+++ b/plugins/archive/skins/default/foldericon.png
Binary files differ