Rev 1310 |
Blame |
Compare with Previous |
Last modification |
View Log
| RSS feed
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0" xmlns:d="http://www.estgp.pt/baco/directory/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<xsl:output method="html" encoding="UTF-8" omit-xml-declaration="yes" />
<xsl:param name="contextPath">/baco</xsl:param>
<xsl:param name="authenticated">false</xsl:param>
<xsl:template match="/">
<div>
<div class="menuTop hidden-xs">
<ul class="m">
<xsl:apply-templates select="/d:directory/d:leaf" mode="root"/>
</ul>
</div>
<div class="row menuTop hidden-sm hidden-md hidden-lg">
<xsl:apply-templates select="/d:directory/d:leaf" mode="xs"/>
</div>
</div>
</xsl:template>
<xsl:template match="d:leaf" mode="root">
<li class="dropdown">
<a>
<xsl:if test="./d:leaf">
<xsl:attribute name="class">dropdown-toggle</xsl:attribute>
<xsl:attribute name="data-toggle">dropdown</xsl:attribute>
</xsl:if>
<xsl:attribute name="href">
<xsl:choose>
<xsl:when test="@url and @absolute='true'">
<xsl:value-of select="@url"/>
</xsl:when>
<xsl:when test="@url and @absolute='false'">
<xsl:value-of select="$contextPath"/><xsl:value-of select="@url"/>
</xsl:when>
<xsl:otherwise>#</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:value-of select="@label"/>
<xsl:if test="./d:leaf">
<span class="caret"> </span>
</xsl:if>
</a>
<xsl:if test="./d:leaf">
<ul class="dropdown-menu">
<xsl:for-each select="./d:leaf">
<li>
<a>
<xsl:attribute name="href">
<xsl:choose>
<xsl:when test="@url and @absolute='true'">
<xsl:value-of select="@url"/>
</xsl:when>
<xsl:when test="@url and @absolute='false'">
<xsl:value-of select="$contextPath"/><xsl:value-of select="@url"/>
</xsl:when>
<xsl:otherwise>#</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:value-of select="@label"/>
</a>
</li>
</xsl:for-each>
</ul>
</xsl:if>
</li>
</xsl:template>
<xsl:template match="d:leaf" mode="xs">
<div class="col-xs-3 dropdown">
<a>
<xsl:if test="./d:leaf">
<xsl:attribute name="class">dropdown-toggle</xsl:attribute>
<xsl:attribute name="data-toggle">dropdown</xsl:attribute>
</xsl:if>
<xsl:attribute name="href">
<xsl:choose>
<xsl:when test="@url and @absolute='true'">
<xsl:value-of select="@url"/>
</xsl:when>
<xsl:when test="@url and @absolute='false'">
<xsl:value-of select="$contextPath"/><xsl:value-of select="@url"/>
</xsl:when>
<xsl:otherwise>#</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:value-of select="@label"/>
<xsl:if test="./d:leaf">
<span class="caret"> </span>
</xsl:if>
</a>
<xsl:if test="./d:leaf">
<ul class="dropdown-menu">
<xsl:for-each select="./d:leaf">
<li>
<a>
<xsl:attribute name="href">
<xsl:choose>
<xsl:when test="@url and @absolute='true'">
<xsl:value-of select="@url"/>
</xsl:when>
<xsl:when test="@url and @absolute='false'">
<xsl:value-of select="$contextPath"/><xsl:value-of select="@url"/>
</xsl:when>
<xsl:otherwise>#</xsl:otherwise>
</xsl:choose>
</xsl:attribute>
<xsl:value-of select="@label"/>
</a>
</li>
</xsl:for-each>
</ul>
</xsl:if>
</div>
</xsl:template>
</xsl:stylesheet>