[Chameleon] Query Result

Julien-Samuel Lacroix jlacroix at mapgears.com
Tue Jun 6 10:43:58 EDT 2006


Hi,
With the new QueryResult.phtml you can specify which field will be shown 
directly in your mapfile or in the Query widget.

In your mapfile, in the layer, you can use the HEADER parameter like this:
HEADER "Field^Title in the result table|Field^Title"
Example: HEADER "NAME^Name|UNIQUE_KEY^Key"

In your widget you can use:
<CWC2 Type="Query"...>
   <TABLEHEADER LAYER="popplace" HEADER="NAME^Name|UNIQUE_KEY^Key"/>
</CWC2>

If you still want to change the .phtml go around line 294, the field 
shown are defined here:

foreach ($aRows[0] as $key => $value)
{
     $aszHeaderNames["$key"] = $key;
}

Julien

listserver server wrote:
> Updating to the last version of chameleon i've noted that 
> queryreult.phtml is completely different from the previous version!
> 
> In the previous version i added this lines for 2 reason, to remove  
> SHAPE_INDEX, TILE_INDEX,LAYER_INDEX from query result and for format 
> http header.
> 
> // loop and add a cell for each result 
> foreach ( $aRow as $key => $xCell )
> {
> 	//String comparison to search for fields that should NOT be returned in query results.
> 	if (strcasecmp($key, "SHAPE_INDEX") == 0 ||
> 
>              strcasecmp($key, "TILE_INDEX") == 0 ||
>              strcasecmp($key, "LAYER_INDEX") == 0)
>              continue;
>              {
> 	     //Look for strings containing an http header.  If exists then format as a link, if not format as normal text.
> 
> 	     if ( stristr ($xCell, 'http://' <http://%27/> ))
> 	 	$szReturnValue .= "<td class=\"subContentArea1\"><p
> class=\"text\"><a href='". $xCell."' target='_blank'>Click here for more
> 
> information</a></p></td>\n";
> 	     else
> 		$szReturnValue .= "<td class=\"subContentArea1\"><p
> class=\"text\">". $xCell."</p></td>\n";
> 
> 	     }
>              }
>                  $szReturnValue .= "</tr>\n";
>              }
> 
> 
> Can be done something similar also in new queryresult.phtml ??
> 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Chameleon mailing list
> Chameleon at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/chameleon

-- 
Julien-Samuel Lacroix
Mapgears
http://www.mapgears.com/


More information about the Chameleon mailing list