diff options
Diffstat (limited to 'plugins/markasjunk')
22 files changed, 328 insertions, 0 deletions
diff --git a/plugins/markasjunk/localization/cs_CZ.inc b/plugins/markasjunk/localization/cs_CZ.inc new file mode 100644 index 000000000..18509cf51 --- /dev/null +++ b/plugins/markasjunk/localization/cs_CZ.inc @@ -0,0 +1,24 @@ +<?php + +/* + ++-----------------------------------------------------------------------+ +| language/cs_CZ/labels.inc | +| | +| Language file of the Roundcube markasjunk 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'] = 'Označit jako Spam'; +$labels['reportedasjunk'] = 'Úspěšně nahlášeno jako Spam'; + +?>
\ No newline at end of file diff --git a/plugins/markasjunk/localization/da_DK.inc b/plugins/markasjunk/localization/da_DK.inc new file mode 100644 index 000000000..e351b0f61 --- /dev/null +++ b/plugins/markasjunk/localization/da_DK.inc @@ -0,0 +1,7 @@ +<?php + +$labels = array(); +$labels['buttontitle'] = 'Marker som junk mail'; +$labels['reportedasjunk'] = 'Successfuldt rapporteret som junk mail'; + +?> diff --git a/plugins/markasjunk/localization/de_CH.inc b/plugins/markasjunk/localization/de_CH.inc new file mode 100644 index 000000000..9cfa38dad --- /dev/null +++ b/plugins/markasjunk/localization/de_CH.inc @@ -0,0 +1,6 @@ +<?php + +$labels = array(); +$labels['buttontitle'] = 'Als SPAM markieren'; +$labels['reportedasjunk'] = 'Erfolgreich als SPAM gemeldet'; + diff --git a/plugins/markasjunk/localization/de_DE.inc b/plugins/markasjunk/localization/de_DE.inc new file mode 100644 index 000000000..f21edf7cd --- /dev/null +++ b/plugins/markasjunk/localization/de_DE.inc @@ -0,0 +1,6 @@ +<?php +// translation done by Ulli Heist - http://heist.hobby-site.org/ +$labels = array(); +$labels['buttontitle'] = 'als SPAM markieren'; +$labels['reportedasjunk'] = 'Erfolgreich als SPAM gemeldet'; +?>
\ No newline at end of file diff --git a/plugins/markasjunk/localization/en_US.inc b/plugins/markasjunk/localization/en_US.inc new file mode 100644 index 000000000..c1f56ad1d --- /dev/null +++ b/plugins/markasjunk/localization/en_US.inc @@ -0,0 +1,8 @@ +<?php + +$labels = array(); +$labels['buttontext'] = 'Junk'; +$labels['buttontitle'] = 'Mark as Junk'; +$labels['reportedasjunk'] = 'Successfully reported as Junk'; + +?>
\ No newline at end of file diff --git a/plugins/markasjunk/localization/es_AR.inc b/plugins/markasjunk/localization/es_AR.inc new file mode 100644 index 000000000..decdde2a8 --- /dev/null +++ b/plugins/markasjunk/localization/es_AR.inc @@ -0,0 +1,7 @@ +<?php + +$labels = array(); +$labels['buttontitle'] = 'Marcar como SPAM'; +$labels['reportedasjunk'] = 'Mensaje reportado como SPAM'; + +?> diff --git a/plugins/markasjunk/localization/es_ES.inc b/plugins/markasjunk/localization/es_ES.inc new file mode 100644 index 000000000..8e5ca492d --- /dev/null +++ b/plugins/markasjunk/localization/es_ES.inc @@ -0,0 +1,7 @@ +<?php + +$labels = array(); +$labels['buttontitle'] = 'Marcar como SPAM'; +$labels['reportedasjunk'] = 'Mensaje informado como SPAM'; + +?> diff --git a/plugins/markasjunk/localization/et_EE.inc b/plugins/markasjunk/localization/et_EE.inc new file mode 100644 index 000000000..daf140512 --- /dev/null +++ b/plugins/markasjunk/localization/et_EE.inc @@ -0,0 +1,7 @@ +<?php + +$labels = array(); +$labels['buttontitle'] = 'Märgista Rämpsuks'; +$labels['reportedasjunk'] = 'Edukalt Rämpsuks märgitud'; + +?> diff --git a/plugins/markasjunk/localization/gl_ES.inc b/plugins/markasjunk/localization/gl_ES.inc new file mode 100644 index 000000000..b1f49a23e --- /dev/null +++ b/plugins/markasjunk/localization/gl_ES.inc @@ -0,0 +1,7 @@ +<?php + +$labels = array(); +$labels['buttontitle'] = 'Marcar como correo lixo'; +$labels['reportedasjunk'] = 'Mensaxe marcada como correo lixo'; + +?> diff --git a/plugins/markasjunk/localization/it_IT.inc b/plugins/markasjunk/localization/it_IT.inc new file mode 100644 index 000000000..cc44fae21 --- /dev/null +++ b/plugins/markasjunk/localization/it_IT.inc @@ -0,0 +1,7 @@ +<?php + +$labels = array(); +$labels['buttontitle'] = 'Marca come Spam'; +$labels['reportedasjunk'] = 'Messaggio marcato come Spam'; + +?>
\ No newline at end of file diff --git a/plugins/markasjunk/localization/ja_JP.inc b/plugins/markasjunk/localization/ja_JP.inc new file mode 100644 index 000000000..d4fbaea41 --- /dev/null +++ b/plugins/markasjunk/localization/ja_JP.inc @@ -0,0 +1,20 @@ +<?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['reportedasjunk'] = '迷惑メールとして報告しました。'; + diff --git a/plugins/markasjunk/localization/pl_PL.inc b/plugins/markasjunk/localization/pl_PL.inc new file mode 100644 index 000000000..a98f0aab3 --- /dev/null +++ b/plugins/markasjunk/localization/pl_PL.inc @@ -0,0 +1,7 @@ +<?php + +$labels = array(); +$labels['buttontitle'] = 'Oznacz jako SPAM'; +$labels['reportedasjunk'] = 'Pomyślnie oznaczono jako SPAM'; + +?> diff --git a/plugins/markasjunk/localization/ru_RU.inc b/plugins/markasjunk/localization/ru_RU.inc new file mode 100644 index 000000000..d3547632a --- /dev/null +++ b/plugins/markasjunk/localization/ru_RU.inc @@ -0,0 +1,20 @@ +<?php + +/* + +-----------------------------------------------------------------------+ + | localization/ru_RU/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'] = 'Переместить в "СПАМ'; +$labels['reportedasjunk'] = 'Перемещено в "СПАМ'; + diff --git a/plugins/markasjunk/localization/sk_SK.inc b/plugins/markasjunk/localization/sk_SK.inc new file mode 100644 index 000000000..b56ac46af --- /dev/null +++ b/plugins/markasjunk/localization/sk_SK.inc @@ -0,0 +1,15 @@ +<?php + +/** + * Slovak translation for Roundcube markasjunk plugin + * + * @version 1.0 (2010-10-18) + * @author panda <admin@whistler.sk> + * + */ + +$labels = array(); +$labels['buttontitle'] = 'Označiť ako Spam'; +$labels['reportedasjunk'] = 'Úspešne nahlásené ako Spam'; + +?> diff --git a/plugins/markasjunk/localization/sv_SE.inc b/plugins/markasjunk/localization/sv_SE.inc new file mode 100644 index 000000000..f4c5959b9 --- /dev/null +++ b/plugins/markasjunk/localization/sv_SE.inc @@ -0,0 +1,7 @@ +<?php + +$labels = array(); +$labels['buttontitle'] = 'Märk som skräp'; +$labels['reportedasjunk'] = 'Framgångsrikt rapporterat som skräp'; + +?>
\ No newline at end of file diff --git a/plugins/markasjunk/localization/zh_TW.inc b/plugins/markasjunk/localization/zh_TW.inc new file mode 100644 index 000000000..7b0b22162 --- /dev/null +++ b/plugins/markasjunk/localization/zh_TW.inc @@ -0,0 +1,7 @@ +<?php + +$labels = array(); +$labels['buttontitle'] = '標示為垃圾信'; +$labels['reportedasjunk'] = '成功回報垃圾信'; + +?> diff --git a/plugins/markasjunk/markasjunk.js b/plugins/markasjunk/markasjunk.js new file mode 100644 index 000000000..0e30fb8f2 --- /dev/null +++ b/plugins/markasjunk/markasjunk.js @@ -0,0 +1,28 @@ +/* Mark-as-Junk plugin script */ + +function rcmail_markasjunk(prop) +{ + if (!rcmail.env.uid && (!rcmail.message_list || !rcmail.message_list.get_selection().length)) + return; + + var uids = rcmail.env.uid ? rcmail.env.uid : rcmail.message_list.get_selection().join(','), + lock = rcmail.set_busy(true, 'loading'); + + rcmail.http_post('plugin.markasjunk', '_uid='+uids+'&_mbox='+urlencode(rcmail.env.mailbox), lock); +} + +// 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.markasjunk', rcmail_markasjunk, rcmail.env.uid); + + // add event-listener to message list + if (rcmail.message_list) + rcmail.message_list.addEventListener('select', function(list){ + rcmail.enable_command('plugin.markasjunk', list.get_selection().length > 0); + }); + }) +} + diff --git a/plugins/markasjunk/markasjunk.php b/plugins/markasjunk/markasjunk.php new file mode 100644 index 000000000..4db90c1bc --- /dev/null +++ b/plugins/markasjunk/markasjunk.php @@ -0,0 +1,63 @@ +<?php + +/** + * Mark as Junk + * + * Sample plugin that adds a new button to the mailbox toolbar + * to mark the selected messages as Junk and move them to the Junk folder + * + * @version @package_version@ + * @license GNU GPLv3+ + * @author Thomas Bruederli + */ +class markasjunk extends rcube_plugin +{ + public $task = 'mail'; + + function init() + { + $rcmail = rcmail::get_instance(); + + $this->register_action('plugin.markasjunk', array($this, 'request_action')); + + if ($rcmail->action == '' || $rcmail->action == 'show') { + $skin_path = $this->local_skin_path(); + $this->include_script('markasjunk.js'); + if (is_file($this->home . "/$skin_path/markasjunk.css")) + $this->include_stylesheet("$skin_path/markasjunk.css"); + $this->add_texts('localization', true); + + $this->add_button(array( + 'type' => 'link', + 'label' => 'buttontext', + 'command' => 'plugin.markasjunk', + 'class' => 'button buttonPas junk disabled', + 'classact' => 'button junk', + 'title' => 'buttontitle', + 'domain' => 'markasjunk'), 'toolbar'); + } + } + + function request_action() + { + $this->add_texts('localization'); + + $GLOBALS['IMAP_FLAGS']['JUNK'] = 'Junk'; + $GLOBALS['IMAP_FLAGS']['NONJUNK'] = 'NonJunk'; + + $uids = get_input_value('_uid', RCUBE_INPUT_POST); + $mbox = get_input_value('_mbox', RCUBE_INPUT_POST); + + $rcmail = rcmail::get_instance(); + $rcmail->storage->unset_flag($uids, 'NONJUNK'); + $rcmail->storage->set_flag($uids, 'JUNK'); + + if (($junk_mbox = $rcmail->config->get('junk_mbox')) && $mbox != $junk_mbox) { + $rcmail->output->command('move_messages', $junk_mbox); + } + + $rcmail->output->command('display_message', $this->gettext('reportedasjunk'), 'confirmation'); + $rcmail->output->send(); + } + +} diff --git a/plugins/markasjunk/package.xml b/plugins/markasjunk/package.xml new file mode 100644 index 000000000..95690eb9b --- /dev/null +++ b/plugins/markasjunk/package.xml @@ -0,0 +1,69 @@ +<?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>markasjunk</name> + <channel>pear.roundcube.net</channel> + <summary>Mark messages as Junk</summary> + <description>Adds a new button to the mailbox toolbar to mark the selected messages as Junk and move them to the configured Junk folder.</description> + <lead> + <name>Thomas Bruederli</name> + <user>thomasb</user> + <email>roundcube@gmail.com</email> + <active>yes</active> + </lead> + <date>2010-03-29</date> + <time>13:20:00</time> + <version> + <release>1.1</release> + <api>1.1</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="markasjunk.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="markasjunk.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/da_DK.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/gl_ES.inc" role="data"></file> + <file name="localization/it_IT.inc" role="data"></file> + <file name="localization/ja_JP.inc" role="data"></file> + <file name="localization/pl_PL.inc" role="data"></file> + <file name="localization/ru_RU.inc" role="data"></file> + <file name="localization/sk_SK.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/junk_act.png" role="data"></file> + <file name="skins/default/junk_pas.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/markasjunk/skins/default/junk_act.png b/plugins/markasjunk/skins/default/junk_act.png Binary files differnew file mode 100644 index 000000000..b5a84f604 --- /dev/null +++ b/plugins/markasjunk/skins/default/junk_act.png diff --git a/plugins/markasjunk/skins/default/junk_pas.png b/plugins/markasjunk/skins/default/junk_pas.png Binary files differnew file mode 100644 index 000000000..b88a561a4 --- /dev/null +++ b/plugins/markasjunk/skins/default/junk_pas.png diff --git a/plugins/markasjunk/skins/default/markasjunk.css b/plugins/markasjunk/skins/default/markasjunk.css new file mode 100644 index 000000000..89ea568f4 --- /dev/null +++ b/plugins/markasjunk/skins/default/markasjunk.css @@ -0,0 +1,6 @@ + +#messagetoolbar a.button.junk { + text-indent: -1000px; + background: url(junk_act.png) 0 0 no-repeat; +} + |