Hi,

there is a small bug in this template. In the case you have only one tool activated, the array with the tool has a comma at the end and isn't closed by a parenthesis:

I think we should modify the template like this:


<script type="text/javascript">
{strip}
{foreach from=$tools item=tool name=tool}



+++ {if $smarty.foreach.tool.first and $smarty.foreach.tool.last}cw3_tools = new Array("{$tool->id}")
+++  {elseif $smarty.foreach.tool.first}cw3_tools = new Array("{$tool->id}",
--- {if $smarty.foreach.tool.first}cw3_tools = new Array("{$tool->id}",



 {elseif $smarty.foreach.tool.last}"{$tool->id}");
  {else}"{$tool->id}",
  {/if}
{/foreach}
{/strip}
cw3_initial_selected_tool = "mainmap.{$selected_tool}('map');";
{if $toolbar_rendering != 'radio'}
cw3_initial_selected_tool += "setActiveToolButton('{$selected_tool}');";
{/if}
</script>
{if $toolbar_rendering != 'radio'}
  <input type="hidden" name="tool" id="tool" value="{$selected_tool}"/>
{/if}
{counter start=-1 print=false name=tindex}
  {foreach from=$tools item=tool}
  {if !$group || $group == $tool->group}
    {if $toolbar_rendering == 'radio'}
<label for="{$tool->id}" onclick="checkRadio(this.htmlFor);mainmap.{$tool->id}('map');" >
      <input type="radio" id="{$tool->id}" name="tool" value="{$tool->id}"
      {if $selected_tool == $tool->id}checked="checked"{/if} />
    {/if}
    {if $tool->hasIcon}
<img id="{$tool->id}_icon" alt="{$tool->id}" title="{t}{$tool->id}{/t}"
        src="{r type=gfx plugin=$tool->plugin}{$tool->id}.gif{/r}"
        {if $toolbar_rendering != 'radio'}
        class="toolbar_off"

onclick="mainmap.{$tool->id}('map');setActiveToolButton('{$tool->id}');"
        {/if}
        />
    {else}
       <span>{t}{$tool->id}{/t}</span>
    {/if}
    {if $toolbar_rendering == 'radio'}
    </label>&nbsp;
    {/if}
  {/if}
  {/foreach}

best regards,

Emmanuel Belo
begin:vcard
fn:Emmanuel Belo
n:Belo;Emmanuel
org:MicroGIS SA
adr:;;ch. des Jordils 40;St-Sulpice;VD;1025;Switzerland
email;internet:[EMAIL PROTECTED]
title;quoted-printable:Ing=C3=A9nieur en g=C3=A9omatique
tel;work:+41 21 691 77 17
tel;fax:+41 21 691 77 86
x-mozilla-html:FALSE
url:http://www.microgis.ch
version:2.1
end:vcard

_______________________________________________
Cartoweb-users mailing list
[email protected]
http://lists.maptools.org/mailman/listinfo/cartoweb-users

Reply via email to