From 742d61aaf32875645f50456d263fe649db5eef0a Mon Sep 17 00:00:00 2001 From: thomascube <thomas@roundcube.net> Date: Thu, 09 Jul 2009 03:54:14 -0400 Subject: [PATCH] Add generic hook when a html page is rendered --- program/include/rcube_template.php | 8 ++++++-- 1 files changed, 6 insertions(+), 2 deletions(-) diff --git a/program/include/rcube_template.php b/program/include/rcube_template.php index 3d0e739..98d8b60 100755 --- a/program/include/rcube_template.php +++ b/program/include/rcube_template.php @@ -371,6 +371,9 @@ // parse for specialtags $output = $this->parse_conditions($templ); $output = $this->parse_xml($output); + + // trigger generic hook where plugins can put additional content to the page + $hook = $this->app->plugins->exec_hook("render_page", array('template' => $name, 'content' => $output)); // add debug console if ($this->config['debug_level'] & 8) { @@ -379,7 +382,8 @@ <form action="/" name="debugform" style="display:inline"><textarea name="console" id="dbgconsole" rows="20" cols="40" wrap="off" style="display:none;width:400px;border:none;font-size:x-small" spellcheck="false"></textarea></form></div>' ); } - $output = $this->parse_with_globals($output); + + $output = $this->parse_with_globals($hook['content']); $this->write(trim($output)); if ($exit) { exit; @@ -969,7 +973,7 @@ // save original url $url = get_input_value('_url', RCUBE_INPUT_POST); - if (empty($url) && !preg_match('/_action=logout/', $_SERVER['QUERY_STRING'])) + if (empty($url) && !preg_match('/_(task|action)=logout/', $_SERVER['QUERY_STRING'])) $url = $_SERVER['QUERY_STRING']; $input_user = new html_inputfield(array('name' => '_user', 'id' => 'rcmloginuser', 'size' => 30) + $attrib); -- Gitblit v1.9.1