[Chameleon] Query Result
listserver server
chameleon.listserver at gmail.com
Tue Jun 6 14:49:45 EDT 2006
For the second problem (format an url result as an image) of query result
i've added around line 294 without success this:
//Look for strings containing an http header. If exists then format as a
link, if not format as normal text.
if ( stristr (xvalue, 'http://' ))
$szReturnValue .= "<td class=\"subContentArea1\"><p
class=\"text\"><img src='". $xvalue."' target='_blank'> </a></p></td>\n";
else
$szReturnValue .= "<td class=\"subContentArea1\"><p
class=\"text\">". $value."</p></td>\n";
}
}
$szReturnValue .= "</tr>\n";
}
// close the table
$szReturnValue .= "</table>\n";
// $szReturnValue .= "</td>\n";
// $szReturnValue .= "</tr>\n";
}
2006/6/6, listserver server <chameleon.listserver at gmail.com>:
>
> You were right as ALWAYS
> adding header
> "comune^|Abitazioni_Totali^|Abitazioni_Residenti^|Abitazioni_Non_residenti^|Abitazioni_vuote^"
> in mapfile all is FINE
>
> thank you!
>
>
>
>
> 2006/6/6, Julien-Samuel Lacroix <jlacroix at mapgears.com>:
>
> > Did you add the HEADER parameter in your mapfile?
> > HEADER
> >
> > "comune^|Abitazioni_Totali^|Abitazioni_Residenti^|Abitazioni_Non_residenti^|Abitazioni_vuote^"
> >
> > Julien
> >
> > listserver server wrote:
> > > Well in my mapfile i've this select
> > >
> > > DATA "the_geom FROM (select comune, DCA01_01 as Abitazioni_Totali,
> > > DCA02_01 as Abitazioni_Residenti, DCA03_01 as
> > Abitazioni_Non_residenti,
> > > DCA04_01 as Abitazioni_vuote, the_geom, gid from abitazioni) AS
> > > abitazioni1 USING UNIQUE gid USING SRID=-1"
> > >
> > > but in my query result i can still see SHAPE_INDEX,
> > TILE_INDEX,LAYER_INDEX
> > >
> > > Why??
> > >
> > > 2006/6/6, Julien-Samuel Lacroix < jlacroix at mapgears.com
> > > <mailto:jlacroix at mapgears.com>>:
> > >
> > > 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 <mailto:
> > Chameleon at lists.maptools.org>
> > > > http://lists.maptools.org/mailman/listinfo/chameleon
> > >
> > > --
> > > Julien-Samuel Lacroix
> > > Mapgears
> > > http://www.mapgears.com/
> > >
> > >
> >
> > --
> > Julien-Samuel Lacroix
> > Mapgears
> > http://www.mapgears.com/
> >
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/chameleon/attachments/20060606/448eff7d/attachment.html
More information about the Chameleon
mailing list