+ // 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'];
+ }
+ }
+
+ /**
+ * Callback function for preg_replace_callback in write()
+ *
+ * @return string Parsed string
+ */
+ private function file_callback($matches)
+ {
+ $file = $matches[3];
+
+ // correct absolute paths
+ if ($file[0] == '/')
+ $file = $this->base_path . $file;
+
+ // add file modification timestamp
+ if (preg_match('/\.(js|css)$/', $file))
+ $file .= '?s=' . @filemtime($file);
+
+ return sprintf("%s=%s%s%s", $matches[1], $matches[2], $file, $matches[4]);