From: <fxp...@us...> - 2009-01-27 09:29:38
|
Revision: 2046 http://geonetwork.svn.sourceforge.net/geonetwork/?rev=2046&view=rev Author: fxprunayre Date: 2009-01-27 09:29:33 +0000 (Tue, 27 Jan 2009) Log Message: ----------- Helper lists could also be useful for keywords in the editor. Modified Paths: -------------- sandbox/geocat.ch/trunk/web/geonetwork/xsl/metadata.xsl Modified: sandbox/geocat.ch/trunk/web/geonetwork/xsl/metadata.xsl =================================================================== --- sandbox/geocat.ch/trunk/web/geonetwork/xsl/metadata.xsl 2009-01-27 08:56:39 UTC (rev 2045) +++ sandbox/geocat.ch/trunk/web/geonetwork/xsl/metadata.xsl 2009-01-27 09:29:33 UTC (rev 2046) @@ -954,7 +954,10 @@ <xsl:text>', 'keywordList', 'xml.search.keywords?pNewSearch=true&pTypeSearch=1&pMode=search',{method:'get', paramName: 'pKeyword'});</xsl:text> </script> - + + <xsl:call-template name="helper"> + <xsl:with-param name="schema" select="$schema"/> + </xsl:call-template> </xsl:when> <xsl:otherwise> <input class="md" type="text" id="_{geonet:element/@ref}" name="_{geonet:element/@ref}" value="{text()}" size="{$cols}"> @@ -963,33 +966,10 @@ </xsl:if> </input> - <!-- Helper list are defined in parent of gco:CharacterString elements - Look for an helper list in profil first and then in iso19139. - --> - <xsl:if test="starts-with($schema,'iso19139')"> - <xsl:variable name="parentName" select="name(parent::node())"/> - - <xsl:variable name="helper"> - <xsl:choose> - <xsl:when test="not(/root/gui/*[name(.)=$schema]/element[@name = $parentName]/helper)"> - <xsl:copy-of select="/root/gui/iso19139/element[@name = $parentName]/helper"/> - </xsl:when> - <xsl:otherwise> - <xsl:copy-of select="/root/gui/*[name(.)=$schema]/element[@name = $parentName]/helper"/> - </xsl:otherwise> - </xsl:choose> - </xsl:variable> - - <xsl:if test="normalize-space($helper)!=''"> - (<xsl:value-of select="/root/gui/strings/helperList"/> - <select onchange="$('_{geonet:element/@ref}').value=this.value;"> - <option/> - <xsl:copy-of select="exslt:node-set($helper)"/> - </select>) - </xsl:if> - </xsl:if> + <xsl:call-template name="helper"> + <xsl:with-param name="schema" select="$schema"/> + </xsl:call-template> - </xsl:otherwise> </xsl:choose> </xsl:when> @@ -1039,6 +1019,37 @@ </xsl:template> + <xsl:template name="helper"> + <xsl:param name="schema"/> + + <!-- Helper list are defined in parent of gco:CharacterString elements + Look for an helper list in profil first and then in iso19139. + --> + <xsl:if test="starts-with($schema,'iso19139')"> + <xsl:variable name="parentName" select="name(parent::node())"/> + + <xsl:variable name="helper"> + <xsl:choose> + <xsl:when test="not(/root/gui/*[name(.)=$schema]/element[@name = $parentName]/helper)"> + <xsl:copy-of select="/root/gui/iso19139/element[@name = $parentName]/helper"/> + </xsl:when> + <xsl:otherwise> + <xsl:copy-of select="/root/gui/*[name(.)=$schema]/element[@name = $parentName]/helper"/> + </xsl:otherwise> + </xsl:choose> + </xsl:variable> + + <xsl:if test="normalize-space($helper)!=''"> + (<xsl:value-of select="/root/gui/strings/helperList"/> + <select onchange="$('_{geonet:element/@ref}').value=this.value;"> + <option/> + <xsl:copy-of select="exslt:node-set($helper)"/> + </select>) + </xsl:if> + </xsl:if> + </xsl:template> + + <!-- returns the text of an attribute --> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |