diff options
Diffstat (limited to 'plugins/copymessage')
22 files changed, 403 insertions, 0 deletions
diff --git a/plugins/copymessage/copymessage.js b/plugins/copymessage/copymessage.js new file mode 100644 index 000000000..046edc073 --- /dev/null +++ b/plugins/copymessage/copymessage.js @@ -0,0 +1,40 @@ +/** + * CopyMessage plugin script + */ + +function rcmail_copyto(command, el, pos) { + if (rcmail.env.rcm_destfolder == rcmail.env.mailbox) + return; + + var prev_sel = null; + + // also select childs of (collapsed) threads + if (rcmail.env.uid) { + if (!rcmail.message_list.in_selection(rcmail.env.uid)) { + prev_sel = rcmail.message_list.get_selection(); + rcmail.message_list.select_row(rcmail.env.uid); + } + + if (rcmail.message_list.rows[rcmail.env.uid].has_children && !rcmail.message_list.rows[rcmail.env.uid].expanded) + rcmail.message_list.select_childs(rcmail.env.uid); + + rcmail.env.uid = null; + } + + rcmail.command('copy', rcmail.env.rcm_destfolder, $(el)); + + if (prev_sel) { + rcmail.message_list.clear_selection(); + + for (var i in prev_sel) + rcmail.message_list.select_row(prev_sel[i], CONTROL_KEY); + } + + delete rcmail.env.rcm_destfolder; +} + +$(document).ready(function(){ + if (window.rcm_contextmenu_register_command) { + rcm_contextmenu_register_command('copy', 'rcmail_copyto', $('#rcmContextCopy'), 'moreacts', 'after', true); + } +});
\ No newline at end of file diff --git a/plugins/copymessage/copymessage.php b/plugins/copymessage/copymessage.php new file mode 100644 index 000000000..a8658734c --- /dev/null +++ b/plugins/copymessage/copymessage.php @@ -0,0 +1,114 @@ +<?php + +/** + * CopyMessage + * + * Plugin to allow message to be copied to different folders + * + * @version @package_version@ + * @requires ContextMenu plugin + * @author Philip Weir + */ +class copymessage extends rcube_plugin +{ + public $task = 'mail'; + + function init() + { + // load required plugin + $this->require_plugin('contextmenu'); + + $rcmail = rcube::get_instance(); + if ($rcmail->action == '') + $this->add_hook('render_mailboxlist', array($this, 'show_copy_contextmenu')); + } + + public function show_copy_contextmenu($args) + { + $rcmail = rcube::get_instance(); + $this->add_texts('localization/'); + $this->api->output->add_label('copymessage.copyingmessage'); + $this->include_script('copymessage.js'); + + $li = html::tag('li', array('class' => 'submenu copyto'), html::span(null, rcmail::Q($this->gettext('copyto'))) . $this->_gen_folder_list($args['list'], '#copy')); + $out .= html::tag('ul', array('id' => 'rcmContextCopy'), $li); + $this->api->output->add_footer(html::div(array('style' => 'display: none;'), $out)); + } + + // based on rcmail->render_folder_tree_html() + private function _gen_folder_list($arrFolders, $command, $nestLevel = 0, &$folderTotal = 0) + { + $rcmail = rcube::get_instance(); + + $maxlength = 35; + $realnames = false; + + $out = ''; + foreach ($arrFolders as $key => $folder) { + $title = null; + + if (($folder_class = $rcmail->folder_classname($folder['id'])) && !$realnames) { + $foldername = $rcmail->gettext($folder_class); + } + else { + $foldername = $folder['name']; + + // shorten the folder name to a given length + if ($maxlength && $maxlength > 1) { + $fname = abbreviate_string($foldername, $maxlength); + + if ($fname != $foldername) + $title = $foldername; + + $foldername = $fname; + } + } + + // make folder name safe for ids and class names + $folder_id = asciiwords($folder['id'], true, '_'); + $classes = array(); + + // set special class for Sent, Drafts, Trash and Junk + if ($folder['id'] == $rcmail->config->get('sent_mbox')) + $classes[] = 'sent'; + else if ($folder['id'] == $rcmail->config->get('drafts_mbox')) + $classes[] = 'drafts'; + else if ($folder['id'] == $rcmail->config->get('trash_mbox')) + $classes[] = 'trash'; + else if ($folder['id'] == $rcmail->config->get('junk_mbox')) + $classes[] = 'junk'; + else if ($folder['id'] == 'INBOX') + $classes[] = 'inbox'; + else + $classes[] = '_'.asciiwords($folder_class ? $folder_class : strtolower($folder['id']), true); + + if ($folder['virtual']) + $classes[] = 'virtual'; + + if ($nestLevel > 0) + $classes[] = 'subfolder'; + + $out .= html::tag('li', array('class' => join(' ', $classes)), html::a(array('href' => $command, 'onclick' => "rcm_set_dest_folder('" . rcmail::JQ($folder['id']) ."')", 'class' => 'active', 'title' => $title), html::span(null, str_repeat(' ', $nestLevel) . rcmail::Q($foldername)))); + + if (!empty($folder['folders'])) + $out .= $this->_gen_folder_list($folder['folders'], $command, $nestLevel+1, $folderTotal); + + $folderTotal++; + } + + if ($nestLevel == 0) { + if ($folderTotal > 5) { + $out = html::tag('ul', array('class' => 'toolbarmenu folders scrollable'), $out); + $out = html::tag('div', array('class' => 'scroll_up_pas'), '') . $out . html::tag('div', array('class' => 'scroll_down_act'), ''); + $out = html::tag('div', array('class' => 'popupmenu'), $out); + } + else { + $out = html::tag('ul', array('class' => 'popupmenu toolbarmenu folders'), $out); + } + } + + return $out; + } +} + +?>
\ No newline at end of file diff --git a/plugins/copymessage/localization/ca_ES.inc b/plugins/copymessage/localization/ca_ES.inc new file mode 100644 index 000000000..f5fdf3005 --- /dev/null +++ b/plugins/copymessage/localization/ca_ES.inc @@ -0,0 +1,9 @@ +<?php +/* Author: Daniel López */ + +$labels = array(); +$labels['copyto'] = 'Copia a ...'; + +$messages = array(); + +?>
\ No newline at end of file diff --git a/plugins/copymessage/localization/cs_CZ.inc b/plugins/copymessage/localization/cs_CZ.inc new file mode 100644 index 000000000..713bda6ee --- /dev/null +++ b/plugins/copymessage/localization/cs_CZ.inc @@ -0,0 +1,9 @@ +<?php +/* Author: Ales Pospichal */ + +$labels = array(); +$labels['copyto'] = 'Kopírovat do...'; + +$messages = array(); + +?>
\ No newline at end of file diff --git a/plugins/copymessage/localization/da_DK.inc b/plugins/copymessage/localization/da_DK.inc new file mode 100644 index 000000000..fa635135c --- /dev/null +++ b/plugins/copymessage/localization/da_DK.inc @@ -0,0 +1,9 @@ +<?php +/* Author: John Loft Christiansen */ + +$labels = array(); +$labels['copyto'] = 'Kopier til...'; + +$messages = array(); + +?>
\ No newline at end of file diff --git a/plugins/copymessage/localization/de_CH.inc b/plugins/copymessage/localization/de_CH.inc new file mode 100644 index 000000000..b0bba791a --- /dev/null +++ b/plugins/copymessage/localization/de_CH.inc @@ -0,0 +1,9 @@ +<?php +/* Author: Roland Liebl */ + +$labels = array(); +$labels['copyto'] = 'Kopieren nach...'; + +$messages = array(); + +?>
\ No newline at end of file diff --git a/plugins/copymessage/localization/de_DE.inc b/plugins/copymessage/localization/de_DE.inc new file mode 100644 index 000000000..b0bba791a --- /dev/null +++ b/plugins/copymessage/localization/de_DE.inc @@ -0,0 +1,9 @@ +<?php +/* Author: Roland Liebl */ + +$labels = array(); +$labels['copyto'] = 'Kopieren nach...'; + +$messages = array(); + +?>
\ No newline at end of file diff --git a/plugins/copymessage/localization/en_GB.inc b/plugins/copymessage/localization/en_GB.inc new file mode 100644 index 000000000..43e15c37d --- /dev/null +++ b/plugins/copymessage/localization/en_GB.inc @@ -0,0 +1,9 @@ +<?php +/* Author: Philip Weir */ + +$labels = array(); +$labels['copyto'] = 'Copy to...'; + +$messages = array(); + +?>
\ No newline at end of file diff --git a/plugins/copymessage/localization/en_US.inc b/plugins/copymessage/localization/en_US.inc new file mode 100644 index 000000000..43e15c37d --- /dev/null +++ b/plugins/copymessage/localization/en_US.inc @@ -0,0 +1,9 @@ +<?php +/* Author: Philip Weir */ + +$labels = array(); +$labels['copyto'] = 'Copy to...'; + +$messages = array(); + +?>
\ No newline at end of file diff --git a/plugins/copymessage/localization/es_ES.inc b/plugins/copymessage/localization/es_ES.inc new file mode 100644 index 000000000..00893bf8b --- /dev/null +++ b/plugins/copymessage/localization/es_ES.inc @@ -0,0 +1,9 @@ +<?php +/* Author: Daniel López */ + +$labels = array(); +$labels['copyto'] = 'Copiar a...'; + +$messages = array(); + +?>
\ No newline at end of file diff --git a/plugins/copymessage/localization/fr_FR.inc b/plugins/copymessage/localization/fr_FR.inc new file mode 100644 index 000000000..6f03d47c8 --- /dev/null +++ b/plugins/copymessage/localization/fr_FR.inc @@ -0,0 +1,9 @@ +<?php +/* Author: */ + +$labels = array(); +$labels['copyto'] = 'Copier vers...'; + +$messages = array(); + +?>
\ No newline at end of file diff --git a/plugins/copymessage/localization/gl_ES.inc b/plugins/copymessage/localization/gl_ES.inc new file mode 100644 index 000000000..4f1050805 --- /dev/null +++ b/plugins/copymessage/localization/gl_ES.inc @@ -0,0 +1,9 @@ +<?php +/* Author: David Garabana Barro */ + +$labels = array(); +$labels['copyto'] = 'Copiar a...'; + +$messages = array(); + +?>
\ No newline at end of file diff --git a/plugins/copymessage/localization/hu_HU.inc b/plugins/copymessage/localization/hu_HU.inc new file mode 100644 index 000000000..937b34196 --- /dev/null +++ b/plugins/copymessage/localization/hu_HU.inc @@ -0,0 +1,9 @@ +<?php +/* Author: Németh János */ + +$labels = array(); +$labels['copyto'] = 'Másolás...'; + +$messages = array(); + +?>
\ No newline at end of file diff --git a/plugins/copymessage/localization/it_IT.inc b/plugins/copymessage/localization/it_IT.inc new file mode 100644 index 000000000..ca2248dd6 --- /dev/null +++ b/plugins/copymessage/localization/it_IT.inc @@ -0,0 +1,9 @@ +<?php +/* Author: Alessio Cecchi */ + +$labels = array(); +$labels['copyto'] = 'Copia in...'; + +$messages = array(); + +?>
\ No newline at end of file diff --git a/plugins/copymessage/localization/nl_NL.inc b/plugins/copymessage/localization/nl_NL.inc new file mode 100644 index 000000000..bf7c4e510 --- /dev/null +++ b/plugins/copymessage/localization/nl_NL.inc @@ -0,0 +1,9 @@ +<?php +/* Author: Wouter Kevenaar */ + +$labels = array(); +$labels['copyto'] = 'Kopiëren naar...'; + +$messages = array(); + +?>
\ No newline at end of file diff --git a/plugins/copymessage/localization/pl_PL.inc b/plugins/copymessage/localization/pl_PL.inc new file mode 100644 index 000000000..803b4d0d0 --- /dev/null +++ b/plugins/copymessage/localization/pl_PL.inc @@ -0,0 +1,9 @@ +<?php +/* Author: Michał Jałocha */ + +$labels = array(); +$labels['copyto'] = 'Kopiuj do...'; + +$messages = array(); + +?>
\ No newline at end of file diff --git a/plugins/copymessage/localization/pt_BR.inc b/plugins/copymessage/localization/pt_BR.inc new file mode 100644 index 000000000..f5ba8c67d --- /dev/null +++ b/plugins/copymessage/localization/pt_BR.inc @@ -0,0 +1,9 @@ +<?php +/* Author: Alexandre Gorges */ + +$labels = array(); +$labels['copyto'] = 'Copiar para...'; + +$messages = array(); + +?>
\ No newline at end of file diff --git a/plugins/copymessage/localization/ro_RO.inc b/plugins/copymessage/localization/ro_RO.inc new file mode 100644 index 000000000..82ebd71f7 --- /dev/null +++ b/plugins/copymessage/localization/ro_RO.inc @@ -0,0 +1,9 @@ +<?php +/* Author: Ovidiu Bica */ + +$labels = array(); +$labels['copyto'] = 'Copiaza in'; + +$messages = array(); + +?>
\ No newline at end of file diff --git a/plugins/copymessage/localization/ru_RU.inc b/plugins/copymessage/localization/ru_RU.inc new file mode 100644 index 000000000..040d7d544 --- /dev/null +++ b/plugins/copymessage/localization/ru_RU.inc @@ -0,0 +1,9 @@ +<?php +/* Author: Peter Zotov */ + +$labels = array(); +$labels['copyto'] = 'Скопировать в...'; + +$messages = array(); + +?>
\ No newline at end of file diff --git a/plugins/copymessage/localization/sv_SE.inc b/plugins/copymessage/localization/sv_SE.inc new file mode 100644 index 000000000..e7b203a18 --- /dev/null +++ b/plugins/copymessage/localization/sv_SE.inc @@ -0,0 +1,9 @@ +<?php +/* Author: Jonas Nasholm */ + +$labels = array(); +$labels['copyto'] = 'Kopiera till...'; + +$messages = array(); + +?>
\ No newline at end of file diff --git a/plugins/copymessage/localization/tr_TR.inc b/plugins/copymessage/localization/tr_TR.inc new file mode 100644 index 000000000..c64145d07 --- /dev/null +++ b/plugins/copymessage/localization/tr_TR.inc @@ -0,0 +1,9 @@ +<?php +/* Author: Mustafa Icer */ + +$labels = array(); +$labels['copyto'] = '... kopyala'; + +$messages = array(); + +?>
\ No newline at end of file diff --git a/plugins/copymessage/package.xml b/plugins/copymessage/package.xml new file mode 100644 index 000000000..0b699220d --- /dev/null +++ b/plugins/copymessage/package.xml @@ -0,0 +1,78 @@ +<?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>copymessage</name> + <uri>http://github.com/JohnDoh/Roundcube-Plugin-Copy-Message/</uri> + <summary>Adds a copy message option to the context menu</summary> + <description>Adds a copy message option to the context menu, allowing messages to be copied to another folder.</description> + <lead> + <name>Philip Weir</name> + <user>JohnDoh</user> + <email>roundcube@tehinterweb.co.uk</email> + <active>yes</active> + </lead> + <date>2013-02-24</date> + <time>10:16:53</time> + <version> + <release>1.3</release> + <api>1.3</api> + </version> + <stability> + <release>stable</release> + <api>stable</api> + </stability> + <license uri="http://www.gnu.org/licenses/gpl.html">GNU GPLv3+</license> + <notes>Repo only</notes> + <contents> + <dir baseinstalldir="/" name="/"> + <file name="copymessage.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="copymessage.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="CHANGELOG" role="data"/> + <file name="README.md" role="data"/> + <file name="localization/ca_ES.inc" role="data"/> + <file name="localization/cs_CZ.inc" role="data"/> + <file name="localization/da_DK.inc" role="data"/> + <file name="localization/de_CH.inc" role="data"/> + <file name="localization/de_DE.inc" role="data"/> + <file name="localization/en_GB.inc" role="data"/> + <file name="localization/en_US.inc" role="data"/> + <file name="localization/es_ES.inc" role="data"/> + <file name="localization/fr_FR.inc" role="data"/> + <file name="localization/gl_ES.inc" role="data"/> + <file name="localization/hu_HU.inc" role="data"/> + <file name="localization/it_IT.inc" role="data"/> + <file name="localization/nl_NL.inc" role="data"/> + <file name="localization/pl_PL.inc" role="data"/> + <file name="localization/pt_BR.inc" role="data"/> + <file name="localization/ro_RO.inc" role="data"/> + <file name="localization/ru_RU.inc" role="data"/> + <file name="localization/sv_SE.inc" role="data"/> + <file name="localization/tr_TR.inc" role="data"/> + </dir> + <!-- / --> + </contents> + <dependencies> + <required> + <php> + <min>5.2.1</min> + </php> + <pearinstaller> + <min>1.7.0</min> + </pearinstaller> + <package> + <name>contextmenu</name> + <uri>http://github.com/JohnDoh/Roundcube-Plugin-Context-Menu/</uri> + <min>1.9</min> + </package> + </required> + </dependencies> + <phprelease/> +</package> |