Hi Devs, I would like to see in each skin template a default plugin hook just before the closing body tag, like: Any concerns about that? Let me know if you would apply such a patch. Regards, Roland
List info: http://lists.roundcube.net/dev/
I would like to see in each skin template a default plugin hook just before the closing body tag, like: <roundcube:object name="mail_plugin_hook" />
</body> Any concerns about that? Let me know if you would apply such a patch. Regards, Roland
I was thinking along the same lines.
However maybe we can also add an RC object in each of the include templates, like taskbar.html, to allow extensions
OR having the RC container objects addressable as hooks for before & after code.
What do you think?
Sam Bailey _______________________________________________ List info: http://lists.roundcube.net/dev/
On Fri, 26 Jun 2009 15:24:31 +1000, Sam Bailey cyprix@cyprix.com.au wrote:
I would like to see in each skin template a default plugin hook just before the closing body tag, like: <roundcube:object name="mail_plugin_hook" />
</body>
You cau use $RCMAIL->output->add_footer() to add content just before the
</body> of any page. May be that is easier than adding a hook to every template.
Phil _______________________________________________ List info: http://lists.roundcube.net/dev/
Phil Weir wrote:
On Fri, 26 Jun 2009 15:24:31 +1000, Sam Bailey cyprix@cyprix.com.au wrote:
I would like to see in each skin template a default plugin hook just before the closing body tag, like: <roundcube:object name="mail_plugin_hook" />
</body>
You cau use $RCMAIL->output->add_footer() to add content just before the
</body> of any page. May be that is easier than adding a hook to every template.
Phil
I agree for that issue, however if you want to add extra UI elements to link to new actions or tasks there are not currently enough RC objects avaliable.
My example is for the RSS Reader, I want to add an RSS icon to the taskbar linking the new task "rss". _______________________________________________ List info: http://lists.roundcube.net/dev/
Hi,
in my opinion adding an Hook inside of the template-files is not a good idea, since then the template-designer is responsible to add the hook in it's own template. And i don't think this is really a good idea. For every new template there is the risk that the designer forget to include the hook inside. And if then some plugins don't work someone with more knowledge must look why.
Roland Liebl schrieb:
Hi Devs, I would like to see in each skin template a default plugin hook just before the closing body tag, like: <roundcube:object name="mail_plugin_hook" />
</body> Any concerns about that? Let me know if you would apply such a patch. Regards, Roland
List info: http://lists.roundcube.net/dev/
List info: http://lists.roundcube.net/dev/
On Jun 26, 2009, at 2:43 PM, Eduard Krieger wrote:
Hi,
in my opinion adding an Hook inside of the template-files is not a
good idea, since then the template-designer is responsible to add the
hook in it's own template. And i don't think this is really a good idea. For every new template there is the risk that the designer forget to
include the hook inside. And if then some plugins don't work someone with more knowledge must look why.
I agree that hooks inside the template files isnt a good idea. The OP
could probably just add his rss link to the template itself. Thats
what templates are for.
I looked at the code, and the template class seems like a perfect
place to add a hook thats called after each template object and/or
container. The interesting part is, there already is one!
$hook = $this->app->plugins->exec_hook("template_container", $attrib);
This hook is called with the container id as a parameter, and you can
return content to add to the container. Unfortunately, it doesnt work,
because RC uses the hook internally and doesnt play nice :) In
function template_container_hook() it replaces the content instead of
adding to it. I think that currently it isnt really meant to be a
publicly available hook. Maybe the devs can shed some light on this
and other hooks in the template class.
But, the spot where that hook is placed, is where we could have a
before/after hook to add stuff to template objects and containers.
Cor
List info: http://lists.roundcube.net/dev/
Cor Bosman wrote:
On Jun 26, 2009, at 2:43 PM, Eduard Krieger wrote:
Hi,
in my opinion adding an Hook inside of the template-files is not a
good idea, since then the template-designer is responsible to add the
hook in it's own template. And i don't think this is really a good idea. For every new template there is the risk that the designer forget to
include the hook inside. And if then some plugins don't work someone with more knowledge must look why.I agree that hooks inside the template files isnt a good idea. The OP
could probably just add his rss link to the template itself. Thats
what templates are for.I looked at the code, and the template class seems like a perfect
place to add a hook thats called after each template object and/or
container. The interesting part is, there already is one!$hook = $this->app->plugins->exec_hook("template_container", $attrib);
This hook is called with the container id as a parameter, and you can
return content to add to the container. Unfortunately, it doesnt work,
because RC uses the hook internally and doesnt play nice :) In
function template_container_hook() it replaces the content instead of
adding to it. I think that currently it isnt really meant to be a
publicly available hook. Maybe the devs can shed some light on this
and other hooks in the template class.But, the spot where that hook is placed, is where we could have a
before/after hook to add stuff to template objects and containers.Cor
Solved for new taskbar icons. UI elements can be added using included javascript files as shown in:
http://trac.roundcube.net/wiki/Doc_Plugins#ClientscriptsandUIelements
List info: http://lists.roundcube.net/dev/
On Sat, Jun 27, 2009 at 01:10, Cor Bosmancor@xs4all.nl wrote:
I looked at the code, and the template class seems like a perfect place to add a hook thats called after each template object and/or container. The interesting part is, there already is one!
$hook = $this->app->plugins->exec_hook("template_container", $attrib);
This hook is called with the container id as a parameter, and you can return content to add to the container. Unfortunately, it doesnt work, because RC uses the hook internally and doesnt play nice :) In function template_container_hook() it replaces the content instead of adding to it.
Fixed this in revison 2704. This hook can now also be used by other plugins.
But, the spot where that hook is placed, is where we could have a before/after hook to add stuff to template objects and containers.
As Phil already mentioned, there's $RCMAIL->output->add_footer() and ->add_header() which can be used to insert content to the page head and body section. I'm not sure if we really need a plugin hook that does the same.
~Thomas _______________________________________________ List info: http://lists.roundcube.net/dev/
As Phil already mentioned, there's $RCMAIL->output->add_footer() and ->add_header() which can be used to insert content to the page head and body section. I'm not sure if we really need a plugin hook that does the same.
It's not quite the same. What people are asking are hooks to add to container and object elements in the templates. Both before and after. Could be useful I suppose.
Cor _______________________________________________ List info: http://lists.roundcube.net/dev/
On Sun, Jul 5, 2009 at 14:43, Cor Bosmancor@xs4all.nl wrote:
As Phil already mentioned, there's $RCMAIL->output->add_footer() and ->add_header() which can be used to insert content to the page head and body section. I'm not sure if we really need a plugin hook that does the same.
It's not quite the same. What people are asking are hooks to add to container and object elements in the templates. Both before and after.
OK, I've just added the hook 'render_page' which is triggered right after the template was parsed. See http://trac.roundcube.net/wiki/Plugin_Hooks#render_page for details. If you think a 'before_render_page' hook is necessary we can add that too.
~Thomas _______________________________________________ List info: http://lists.roundcube.net/dev/
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?
Regards, Roland
wrote:
On Sun, Jul 5, 2009 at 14:43, Cor Bosmancor@xs4all.nl wrote:
As Phil already mentioned, there's $RCMAIL->output->add_footer() and ->add_header() which can be used to insert content to the page head and body section. I'm not sure if we really need a plugin hook that does the same.
It's not quite the same. What people are asking are hooks to add to container and object elements in the templates. Both before and after.
OK, I've just added the hook 'render_page' which is triggered right after the template was parsed. See http://trac.roundcube.net/wiki/Plugin_Hooks#render_page for details. If you think a 'before_render_page' hook is necessary we can add that too.
~Thomas _______________________________________________ List info: http://lists.roundcube.net/dev/
List info: http://lists.roundcube.net/dev/
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/
// 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/
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/
Roland Liebl wrote:
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?
Sure. Done in r2743
~Thomas _______________________________________________ List info: http://lists.roundcube.net/dev/