Bug 32794: (follow-up) Consolidate shared code into one function (:template)
Few extra lines for the $2 exception as noted on Bugzilla. Note: We should probably check why the utils xslt on opac and intranet have so much differences currently. Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
parent
353a0a85a3
commit
db2a8a416a
|
|
@ -690,6 +690,38 @@
|
|||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="AddMissingProtocol">
|
||||
<xsl:param name="resourceLocation"/>
|
||||
<xsl:param name="indicator1"/>
|
||||
<xsl:param name="accessMethod"/>
|
||||
<xsl:param name="delimiter" select="':'"/>
|
||||
<xsl:if test="not(contains($resourceLocation, $delimiter))">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$indicator1=7 and ( $accessMethod='mailto' or $accessMethod='tel' )">
|
||||
<xsl:value-of select="$accessMethod"/><xsl:text>:</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:when test="$indicator1=7">
|
||||
<xsl:value-of select="$accessMethod"/><xsl:text>://</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:when test="$indicator1=0">
|
||||
<xsl:text>mailto:</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:when test="$indicator1=1">
|
||||
<xsl:text>ftp://</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:when test="$indicator1=2">
|
||||
<xsl:text>telnet://</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:when test="$indicator1=3">
|
||||
<xsl:text>tel:</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:text>http://</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
||||
<!-- Stylus Studio meta-information - (c)1998-2002 eXcelon Corp.
|
||||
|
|
|
|||
|
|
@ -653,6 +653,38 @@
|
|||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template name="AddMissingProtocol">
|
||||
<xsl:param name="resourceLocation"/>
|
||||
<xsl:param name="indicator1"/>
|
||||
<xsl:param name="accessMethod"/>
|
||||
<xsl:param name="delimiter" select="':'"/>
|
||||
<xsl:if test="not(contains($resourceLocation, $delimiter))">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$indicator1=7 and ( $accessMethod='mailto' or $accessMethod='tel' )">
|
||||
<xsl:value-of select="$accessMethod"/><xsl:text>:</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:when test="$indicator1=7">
|
||||
<xsl:value-of select="$accessMethod"/><xsl:text>://</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:when test="$indicator1=0">
|
||||
<xsl:text>mailto:</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:when test="$indicator1=1">
|
||||
<xsl:text>ftp://</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:when test="$indicator1=2">
|
||||
<xsl:text>telnet://</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:when test="$indicator1=3">
|
||||
<xsl:text>tel:</xsl:text>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:text>http://</xsl:text>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
||||
<!-- Stylus Studio meta-information - (c)1998-2002 eXcelon Corp.
|
||||
|
|
|
|||
Loading…
Reference in New Issue