[Cartoweb-users] Add the query tool icon on query.tpl
Oliver Christen
oliver.christen at camptocamp.com
Mon Mar 2 03:58:56 EST 2009
Hi
the toolbar template was not really designed to be called within plugin's
template, though it is possible but not really nice.
1) duplicate the toolbar.tpl in your project/templates folder and modify
{foreach from=$tools item=tool} to {foreach from=$tools2 item=tool}
2) extend the query plugin client part, so you can add a function to fetch
the new toolbar template and inject it into the query template:
protected function drawTools() {
$this->smarty2 = new Smarty_Plugin($this->getCartoclient(), $this);
$this->smarty2->assign(array(
'tools2' => $this->cartoclient->getFormRenderer()->getTools(),
'group' => '6'
));
return $this->smarty2->fetch('../../../templates/toolbar2.tpl');
}
and call the drawTools() function from drawQuery() with:
$smarty->assign('tool_injection', $this->drawTools());
and add in your query.tpl the additional smarty variable: {$tool_injection}
and add groupPlugin = 6 in query.ini
it should work but this comes with absolutly no guaranty
regards
Oliver
>
> Dear all,
>
> How can I add the query_by_bbox tool on the query.tpl? I tried simply
> paste
> the line {include file="toolbar.tpl" group="3"}" on query.tpl but error
> occured. I also tried specifying the full path of the toolbar.tpl file
> and
> also putting the file into my project's template folder but still failed.
>
> Thank you very much for any help.
>
> Best regards
>
> Jady
> --
> View this message in context:
> http://www.nabble.com/Add-the-query-tool-icon-on-query.tpl-tp22177602p22177602.html
> Sent from the cartoweb-users mailing list archive at Nabble.com.
>
> _______________________________________________
> Cartoweb-users mailing list
> Cartoweb-users at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/cartoweb-users
>
More information about the Cartoweb-users
mailing list