[Chameleon] Layers always on

Mark M fosters4all at beer.com
Thu Nov 11 10:58:03 EST 2004


Thanks all for the help. I added the html code  [if name=visible oper=isset].... and it gives the results I needed.

As an aside, for the other if statement (ie [if name=visible oper=eq value=1] ), what does the 'value=1' condition check for. I couldn't get it to work.



----- Original Message -----
From: Paul Spencer <pspencer at dmsolutions.ca>
To: Mark M <fosters4all at beer.com>
Subject: Re: [Chameleon] Layers always on
Date: Wed, 10 Nov 2004 20:21:38 -0500

> 
> You will need to trick the code that controls layer visibility. 
> Basicallly, it sees the layer as off because the layer name does not 
> appear in the legendlayername array that is created when multiple 
> checkboxes are submitted using the name legendlayername[] (the [] tells 
> PHP to interpret multiple values as an array).
> 
> The only way I have found to do this (so far) is to use something like this:
> 
> [if name=visible oper=isnull]
> <!-- layer visible if metadata visible not set -->
> <input type="checkbox" name="legendlayername[]"
> value="[leg_layer_name]"
>      [if name=layer_status oper=eq  value=1]CHECKED[/if]
>      [if name=layer_status oper=eq value=2]CHECKED[/if]>
> [/if]
> [if name=visible oper=eq value=1]
> <!-- layer visible if metadata visible set to 1 -->
> <input type="checkbox" name="legendlayername[]"
> value="[leg_layer_name]"
>      [if name=layer_status oper=eq  value=1]CHECKED[/if]
>      [if name=layer_status oper=eq value=2]CHECKED[/if]>
> [/if]
> [if name=visible oper=isset]
> <!-- layer NOT visible if metadata visible set to 0 -->
>    <input type="hidden" name="legendlayername[]" value="[leg_layer_name]">
> [/if]
> 
> The important part is that you have metadata to indicate that the layer 
> should not be in the legend then you output a hidden input with the 
> right name and value.
> 
> Cheers,
> 
> Paul

-- 
_______________________________________________
The coolest e-mail address on the web and it’s FREE!  Sign-up today for Beer Mail @ beer.com.




More information about the Chameleon mailing list