The new hook render_page is great but dangerous as well.
If we use within the callback function output->send("something") it will loop.
Thomas, could you catch that for stupid programmers like me?
----- Original Message ----- From: "Roland Liebl" roland@roland-liebl.de To: "Cor Bosman" cor@xs4all.nl Cc: "RoundCube Dev" dev@lists.roundcube.net Sent: Thursday, July 09, 2009 10:42 AM Subject: Re: [RCD] Plugin Template hooks
// 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));
Looks great. The template name is passed to the hook!
Regards, Roland
On Thu, 9 Jul 2009 10:37:44 +0200, Cor Bosman cor@xs4all.nl wrote:
On Jul 9, 2009, at 10:33 AM, Roland Liebl wrote:
On Thu, 9 Jul 2009 10:04:09 +0200, Thomas Bruederli
<roundcube@gmail.com
Thanks!
Is the template name passed withing the args to be able to easy detect which template was rendered?
Hmm, interesting question. Can objects or containers exist in multiple templates, and if so, if you hook into the object, will it be called on every template? If so, thats cool. And would indeed mean you need the template name if you want to add only on certain templates.
Cor
List info: http://lists.roundcube.net/dev/
List info: http://lists.roundcube.net/dev/