<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:mcri18n="http://www.mycore.de/xslt/i18n" exclude-result-prefixes="#all"> <xsl:template match="TOC | toc"> <xsl:for-each select="$loaded_navigation_xml//item[@href=$browserAddress]"> <ul> <xsl:for-each select="child::item"> <xsl:if test="not(@userNot = $CurrentUser)"> <li> <xsl:call-template name="addLink"> <xsl:with-param name="href" select="@href"/> <xsl:with-param name="target" select="@target"/> </xsl:call-template> </li> </xsl:if> </xsl:for-each> </ul> </xsl:for-each> </xsl:template> <xsl:template match="item" mode="navigation"> <xsl:for-each select="."> <li> <xsl:call-template name="addLink"> <xsl:with-param name="href" select="@href"/> <xsl:with-param name="target" select="@target"/> </xsl:call-template> </li> </xsl:for-each> </xsl:template> <xsl:template name="addLink"> <xsl:param name="href" as="xs:string"/> <xsl:param name="target" as="xs:string?" select="'_self'"/> <a href="{$href}" target="{$target}"> <xsl:choose> <xsl:when test="./label[lang($CurrentLang)] != ''"> <xsl:value-of select="./label[lang($CurrentLang)]"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="./label[lang($DefaultLang)]"/> </xsl:otherwise> </xsl:choose> </a> </xsl:template> <xsl:template name="navigation.login"> <li> <xsl:variable name="user"> <xsl:choose> <xsl:when test="$CurrentUser = 'guest'"> <xsl:value-of select="mcri18n:translate('component.user2.button.login')"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="$CurrentUser"/> </xsl:otherwise> </xsl:choose> </xsl:variable> <xsl:variable name="LoginURL" select="concat( $ServletsBaseURL, 'MCRLoginServlet',$HttpSession,'?url=', fn:encode-for-uri( string( $RequestURL ) ) )"/> <xsl:choose> <xsl:when test="$direction = 'rtl'"> <a href="{$LoginURL}"> <xsl:value-of select="concat(' ',$user)"/> </a> <xsl:if test="not($CurrentUser = 'guest')"> <xsl:value-of select="concat(mcri18n:translate('component.user2.admin.userAccount'),' ')"/> </xsl:if> </xsl:when> <xsl:otherwise> <xsl:if test="not($CurrentUser = 'guest')"> <xsl:value-of select="concat(mcri18n:translate('component.user2.admin.userAccount'),' ')"/> </xsl:if> <a href="{$LoginURL}"> <xsl:value-of select="$user"/> </a> </xsl:otherwise> </xsl:choose> </li> </xsl:template> <xsl:template name="navigation.logout"> <xsl:if test="not($CurrentUser = 'guest')"> <xsl:variable name="LogoggURL"> <xsl:value-of select="concat($ServletsBaseURL,'logout')"/> </xsl:variable> <li> <a href="{$LogoggURL}"> <xsl:value-of select="mcri18n:translate('component.userlogin.button.logout')"/> </a> </li> </xsl:if> </xsl:template> </xsl:stylesheet>