summaryrefslogtreecommitdiff
path: root/roundcubemail/program/include/rcube_html_page.php
diff options
context:
space:
mode:
authorthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-02-18 09:54:19 +0000
committerthomasb <thomasb@208e9e7b-5314-0410-a742-e7e81cd9613c>2011-02-18 09:54:19 +0000
commit54d51d003c92e83e2c63ee28eef76af3fd3fb3c8 (patch)
tree810b01b87ef804088e002e06c581334ea58d3171 /roundcubemail/program/include/rcube_html_page.php
parent5aa7ae36712fcc873745f3182d33be8f0b797217 (diff)
Add plugin hook before the final HTML content of a page is sent
git-svn-id: https://svn.roundcube.net/trunk@4561 208e9e7b-5314-0410-a742-e7e81cd9613c
Diffstat (limited to 'roundcubemail/program/include/rcube_html_page.php')
-rw-r--r--roundcubemail/program/include/rcube_html_page.php18
1 files changed, 11 insertions, 7 deletions
diff --git a/roundcubemail/program/include/rcube_html_page.php b/roundcubemail/program/include/rcube_html_page.php
index ab226bc32..5b56cccc5 100644
--- a/roundcubemail/program/include/rcube_html_page.php
+++ b/roundcubemail/program/include/rcube_html_page.php
@@ -266,19 +266,23 @@ class rcube_html_page
$output = substr($output, 0, $pos) . $css . substr($output, $pos);
}
- $this->base_path = $base_path;
+ $this->base_path = $base_path;
// correct absolute paths in images and other tags
- // add timestamp to .js and .css filename
+ // add timestamp to .js and .css filename
$output = preg_replace_callback(
'!(src|href|background)=(["\']?)([a-z0-9/_.-]+)(["\'\s>])!i',
- array($this, 'file_callback'), $output);
+ array($this, 'file_callback'), $output);
$output = str_replace('$__skin_path', $base_path, $output);
- if ($this->charset != RCMAIL_CHARSET)
- echo rcube_charset_convert($output, RCMAIL_CHARSET, $this->charset);
- else
- echo $output;
+ // trigger hook with final HTML content to be sent
+ $hook = rcmail::get_instance()->plugins->exec_hook("send_page", array('content' => $output));
+ if (!$hook['abort']) {
+ if ($this->charset != RCMAIL_CHARSET)
+ echo rcube_charset_convert($hook['content'], RCMAIL_CHARSET, $this->charset);
+ else
+ echo $hook['content'];
+ }
}
/**