Source files of fsfe.org, pdfreaders.org, freeyourandroid.org, ilovefs.org, drm.info, and test.fsfe.org. Contribute: https://fsfe.org/contribute/web/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3. <!-- Insert local menu -->
  4. <xsl:template match="localmenu">
  5. <xsl:variable name="set">
  6. <xsl:choose><xsl:when test="@set">
  7. <xsl:value-of select="@set"/>
  8. </xsl:when><xsl:otherwise>
  9. <xsl:text>0</xsl:text>
  10. </xsl:otherwise></xsl:choose>
  11. </xsl:variable>
  12. <xsl:variable name="dir">
  13. <xsl:value-of select="/buildinfo/@dirname"/>
  14. </xsl:variable>
  15. <xsl:variable name="language">
  16. <xsl:value-of select="/buildinfo/@language"/>
  17. </xsl:variable>
  18. <xsl:element name="div">
  19. <xsl:attribute name="class">localmenu</xsl:attribute>
  20. <xsl:element name="p">
  21. <xsl:text>[ </xsl:text>
  22. <xsl:for-each select="/buildinfo/document/set/localmenuitems/menu[@dir=$dir and @set=$set]">
  23. <xsl:sort select="@id"/>
  24. <xsl:variable name="style"><xsl:value-of select="@style"/></xsl:variable>
  25. <xsl:variable name="id"><xsl:value-of select="@id"/></xsl:variable>
  26. <xsl:variable name="localmenutext">
  27. <xsl:choose><xsl:when test="/buildinfo/document/set/translate/lang_part[@dir=$dir and @id=$id and @language=$language]">
  28. <xsl:value-of select="/buildinfo/document/set/translate/lang_part[@dir=$dir and @id=$id and @language=$language]"/>
  29. </xsl:when><xsl:otherwise>
  30. <xsl:value-of select="/buildinfo/document/set/translate/lang_part[@dir=$dir and @id=$id and @language='en']"/>
  31. </xsl:otherwise></xsl:choose>
  32. </xsl:variable>
  33. <xsl:element name="span">
  34. <xsl:attribute name="class">local_menu_item</xsl:attribute>
  35. <xsl:choose> <xsl:when test="not(substring-before(concat(/buildinfo/@filename ,'.html'), string(.)))">
  36. <xsl:element name="a">
  37. <xsl:attribute name="href"><xsl:value-of select="."/></xsl:attribute>
  38. <xsl:value-of select="$localmenutext"/>
  39. </xsl:element>
  40. </xsl:when><xsl:otherwise>
  41. <xsl:attribute name="href">bamboo</xsl:attribute>
  42. <xsl:value-of select="$localmenutext"/>
  43. </xsl:otherwise></xsl:choose>
  44. </xsl:element>
  45. <xsl:if test="position()!=last()">
  46. <xsl:choose><xsl:when test="$style='number'">
  47. <xsl:text> | </xsl:text>
  48. </xsl:when><xsl:otherwise>
  49. <xsl:text> ] [ </xsl:text>
  50. </xsl:otherwise></xsl:choose>
  51. </xsl:if>
  52. </xsl:for-each>
  53. <xsl:text> ]</xsl:text>
  54. </xsl:element><!--end wrapper-->
  55. </xsl:element>
  56. </xsl:template>
  57. </xsl:stylesheet>