A bugfix for Foundry regarding the with-colorset functionality. If set on an element which is used on the welcome page (for category is selected) the get-colorset function did cause an error because it returned an empty sequence which is not allowed. Now get-colorset will return colorset-0 for the root category.

git-svn-id: https://svn.libreccm.org/ccm/trunk@4121 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2016-05-31 09:26:29 +00:00
parent 7bbae5e016
commit dad0195074
1 changed files with 12 additions and 5 deletions

View File

@ -357,11 +357,18 @@
</foundry:doc-desc>
</foundry:doc>
<xsl:function name="foundry:get-colorset" as="xs:string">
<xsl:for-each select="$data-tree/nav:categoryMenu/nav:category/nav:category">
<xsl:if test="./@isSelected = 'true'">
<xsl:value-of select="concat('colorset-', position())"/>
</xsl:if>
</xsl:for-each>
<xsl:choose>
<xsl:when test="count($data-tree/nav:categoryMenu/nav:category/nav:category[./@isSelected = 'true']) &gt; 0">
<xsl:for-each select="$data-tree/nav:categoryMenu/nav:category/nav:category">
<xsl:if test="./@isSelected = 'true'">
<xsl:value-of select="concat('colorset-', position())"/>
</xsl:if>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="'colorset-0'"/>
</xsl:otherwise>
</xsl:choose>
</xsl:function>
<foundry:doc section="devel" type="function-template">