[Geoprisma-dev] Cleanup the samples

Julien-Samuel Lacroix jlacroix at mapgears.com
Thu Dec 9 18:30:15 EST 2010


+1
Julien

On 10-12-09 03:04 PM, Alexandre Dube wrote:
> Hi,
>
> Here's what a sample using the "sample template" could look like (see
> image). The text comes from the sample header.inc.html and
> footer.inc.html files. I use the OpenLayers example .css file.
>
> I could apply this change to all the samples that we would keep. I'll
> start with my +1.
>
> Alexandre
>
>
> On 10-12-09 11:40 AM, Alexandre Dube wrote:
>> +1 for me too btw.
>>
>> I've been playing with this a little and figured that we would need a
>> way to put "sample-specific" stuff inside the template. Here's a way I
>> tried and it worked :
>>
>> * put a help.html file containing the explanation of the sample inside
>> the sample directory. Its content is pure html only.
>>
>> * include it in the template like this :
>>
>> <xsl:variable name="helpFilePath">
>> <xsl:value-of
>> select="php:functionString('getCurrentSampleDir')"></xsl:value-of>
>> <xsl:text>/help.html</xsl:text>
>> </xsl:variable>
>>
>> var help = new Ext.Panel({
>> border: false,
>> html: '<xsl:copy-of select="document($helpFilePath)" />',
>> renderTo: Ext.getBody()
>> });
>>
>> That basically copy the content of the file and put in a panel that is
>> simply rendered in the body. It requires to have the
>> "getCurrentSampleDir" method thought, which looks like this (I put it
>> in config.php of the samples directory):
>>
>> function getCurrentSampleDir() {
>> global $g_strCurrentSampleDir;
>> return $g_strCurrentSampleDir;
>> }
>>
>> and the sample needs to set it. That's the only way I found yet to
>> access the sample path since the current path "." in the xslt file is
>> equal to where the template is, that being "./src/client/templates"
>>
>> The template could also have its own .css file to style content from
>> the help files in a standard way, pretty much like openlayers and ext
>> do. We could even use one of them.
>>
>> Finally, instead of help.html, samples we could have "header.inc.html"
>> and "footer.inc.html" to basically put anything you want before and
>> after the panel that replaces the viewport (I think of titles, simple
>> description on top, more description at bottom, etc.)
>>
>> Thoughts ?
>>
>> Alexandre
>>
>
>
>
>
> _______________________________________________
> Geoprisma-dev mailing list
> Geoprisma-dev at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/geoprisma-dev

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


More information about the Geoprisma-dev mailing list