From 48e9c14ebded89d858c8be0333f77f77a81b0877 Mon Sep 17 00:00:00 2001 From: thomascube Date: Sat, 31 Mar 2012 12:25:48 +0000 Subject: Move plugins repository into roundcubemail root folder; svn:externals are not defined anymore --- plugins/show_additional_headers/package.xml | 49 ++++++++++++++++++++ .../show_additional_headers.php | 52 ++++++++++++++++++++++ 2 files changed, 101 insertions(+) create mode 100644 plugins/show_additional_headers/package.xml create mode 100644 plugins/show_additional_headers/show_additional_headers.php (limited to 'plugins/show_additional_headers') diff --git a/plugins/show_additional_headers/package.xml b/plugins/show_additional_headers/package.xml new file mode 100644 index 000000000..00d65812b --- /dev/null +++ b/plugins/show_additional_headers/package.xml @@ -0,0 +1,49 @@ + + + show_additional_headers + pear.roundcube.net + Displays additional message headers + + Proof-of-concept plugin which will fetch additional headers and display them in the message view. + + + Thomas Bruederli + thomasb + roundcube@gmail.com + yes + + 2011-11-21 + + 1.1 + 1.1 + + + stable + stable + + GNU GPLv2 + - + + + + + + + + + + + + + 5.2.1 + + + 1.7.0 + + + + + diff --git a/plugins/show_additional_headers/show_additional_headers.php b/plugins/show_additional_headers/show_additional_headers.php new file mode 100644 index 000000000..cc71421ee --- /dev/null +++ b/plugins/show_additional_headers/show_additional_headers.php @@ -0,0 +1,52 @@ +action == 'show' || $rcmail->action == 'preview') { + $this->add_hook('storage_init', array($this, 'storage_init')); + $this->add_hook('message_headers_output', array($this, 'message_headers')); + } else if ($rcmail->action == '') { + // with enabled_caching we're fetching additional headers before show/preview + $this->add_hook('storage_init', array($this, 'storage_init')); + } + } + + function storage_init($p) + { + $rcmail = rcmail::get_instance(); + if ($add_headers = (array)$rcmail->config->get('show_additional_headers', array())) + $p['fetch_headers'] = trim($p['fetch_headers'].' ' . strtoupper(join(' ', $add_headers))); + + return $p; + } + + function message_headers($p) + { + $rcmail = rcmail::get_instance(); + foreach ((array)$rcmail->config->get('show_additional_headers', array()) as $header) { + $key = strtolower($header); + if ($value = $p['headers']->others[$key]) + $p['output'][$key] = array('title' => $header, 'value' => Q($value)); + } + + return $p; + } +} -- cgit v1.2.3