Lastest status for Foundry:
- Navigation works now - Foundry now needs an XSL 2 processor like Saxon HE - Most stylesheet functions parameters and result now typed (one of the new features of XSL 2) git-svn-id: https://svn.libreccm.org/ccm/trunk@2886 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
5ea5533f07
commit
639304add6
|
|
@ -33,8 +33,7 @@
|
|||
<xsl:strip-space elements="*"/>
|
||||
|
||||
<xsl:template match="/foundry:documentation">
|
||||
<xsl:value-of select="'<!DOCTYPE HTML>'"
|
||||
disable-output-escaping="yes" />
|
||||
<xsl:text><!DOCTYPE HTML></xsl:text>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="content-type"
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ processor, some are read from the configuration files of Foundry and some are de
|
|||
xmlns:bebop="http://www.arsdigita.com/bebop/1.0"
|
||||
xmlns:foundry="http://foundry.libreccm.org"
|
||||
xmlns:ui="http://www.arsdigita.com/ui/1.0"
|
||||
version="1.0">
|
||||
version="2.0">
|
||||
|
||||
<!-- Foundry internal variables -->
|
||||
<foundry:doc section="devel">
|
||||
|
|
|
|||
|
|
@ -22,22 +22,22 @@
|
|||
-->
|
||||
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:bebop="http://www.arsdigita.com/bebop/1.0"
|
||||
xmlns:cms="http://www.arsdigita.com/cms/1.0"
|
||||
xmlns:foundry="http://foundry.libreccm.org"
|
||||
xmlns:func="http://exslt.org/functions"
|
||||
xmlns:nav="http://ccm.redhat.com/navigation"
|
||||
xmlns:ui="http://www.arsdigita.com/ui/1.0"
|
||||
version="1.0">
|
||||
exclude-result-prefixes="xsl bebop cms nav ui"
|
||||
version="2.0">
|
||||
|
||||
<foundry:doc section="user">
|
||||
<foundry:doc-desc>
|
||||
Root element of a template. Generates the doctype statement and and
|
||||
Root element of a template. Generates the
|
||||
<code><html></code> root element.
|
||||
</foundry:doc-desc>
|
||||
</foundry:doc>
|
||||
<xsl:template match="page-layout">
|
||||
<xsl:text disable-output-escaping='yes'><!DOCTYPE html></xsl:text>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<xsl:attribute name="lang">
|
||||
<xsl:value-of select="$language"/>
|
||||
|
|
@ -80,16 +80,14 @@
|
|||
Helper functions for generating the name of the colorset class.
|
||||
</foundry:doc-desc>
|
||||
</foundry:doc>
|
||||
<func:function name="foundry:get-colorset">
|
||||
<func:result>
|
||||
<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:text>colorset_</xsl:text>
|
||||
<xsl:value-of select="position()"/>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
</func:result>
|
||||
</func:function>
|
||||
</xsl:function>
|
||||
|
||||
<foundry:doc section="devel">
|
||||
<foundry:doc-desc>
|
||||
|
|
@ -97,11 +95,9 @@
|
|||
from the result tree XML.
|
||||
</foundry:doc-desc>
|
||||
</foundry:doc>
|
||||
<func:function name="foundry:get-content-type-name">
|
||||
<func:result>
|
||||
<xsl:function name="foundry:get-content-type-name" as="xs:string">
|
||||
<xsl:value-of select="$data-tree//cms:item/type/label"/>
|
||||
</func:result>
|
||||
</func:function>
|
||||
</xsl:function>
|
||||
|
||||
<foundry:doc section="devel">
|
||||
<foundry:doc-desc>
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
-->
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
version="1.0">
|
||||
version="2.0">
|
||||
|
||||
<xsl:import href="template-tags/data-tags.xsl"/>
|
||||
<xsl:import href="template-tags/html-tags.xsl"/>
|
||||
|
|
|
|||
|
|
@ -21,8 +21,7 @@
|
|||
<!-- This file contains several template tags which output data from the result tree -->
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:foundry="http://foundry.libreccm.org"
|
||||
xmlns:func="http://exslt.org/functions"
|
||||
version="1.0">
|
||||
version="2.0">
|
||||
|
||||
<foundry:doc section="user"
|
||||
type="template-tag">
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
xmlns:foundry="http://foundry.libreccm.org"
|
||||
xmlns:ui="http://www.arsdigita.com/ui/1.0"
|
||||
exclude-result-prefixes="xsl bebop foundry ui"
|
||||
version="1.0">
|
||||
version="2.0">
|
||||
|
||||
<foundry:doc>
|
||||
<foundry:doc-desc>
|
||||
|
|
@ -60,8 +60,8 @@
|
|||
</foundry:doc-see-also>
|
||||
</foundry:doc>
|
||||
<xsl:template match="a">
|
||||
<xsl:param name="href" select="''"/>
|
||||
<xsl:param name="title" select="''"/>
|
||||
<xsl:param name="href" select="''" tunnel="yes"/>
|
||||
<xsl:param name="title" select="''" tunnel="yes"/>
|
||||
|
||||
<a>
|
||||
<xsl:if test="./@download">
|
||||
|
|
@ -143,9 +143,9 @@
|
|||
<span id="top"/>
|
||||
<a href="#startcontent" accesskey="S" class="nav-hide">
|
||||
<xsl:attribute name="title">
|
||||
<xsl:value-of select="foundry:get-static-text('layout/page/skipnav/title')"/>
|
||||
<xsl:value-of select="foundry:get-static-text('', 'layout/page/skipnav/title')"/>
|
||||
</xsl:attribute>
|
||||
<xsl:value-of select="foundry:get-static-text('layout/page/skipnav/link')"/>
|
||||
<xsl:value-of select="foundry:get-static-text('', 'layout/page/skipnav/link')"/>
|
||||
</a>
|
||||
<xsl:apply-templates/>
|
||||
</body>
|
||||
|
|
@ -190,32 +190,44 @@
|
|||
|
||||
<xsl:template match="h1">
|
||||
<xsl:call-template name="foundry:set-id-and-class"/>
|
||||
<h1>
|
||||
<xsl:apply-templates/>
|
||||
</h1>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="h2">
|
||||
<xsl:call-template name="foundry:set-id-and-class"/>
|
||||
<h2>
|
||||
<xsl:apply-templates/>
|
||||
</h2>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="h3">
|
||||
<xsl:call-template name="foundry:set-id-and-class"/>
|
||||
<h3>
|
||||
<xsl:apply-templates/>
|
||||
</h3>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="h4">
|
||||
<xsl:call-template name="foundry:set-id-and-class"/>
|
||||
<h4>
|
||||
<xsl:apply-templates/>
|
||||
</h4>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="h5">
|
||||
<xsl:call-template name="foundry:set-id-and-class"/>
|
||||
<h5>
|
||||
<xsl:apply-templates/>
|
||||
</h5>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="h6">
|
||||
<xsl:call-template name="foundry:set-id-and-class"/>
|
||||
<h6>
|
||||
<xsl:apply-templates/>
|
||||
</h6>
|
||||
</xsl:template>
|
||||
|
||||
<foundry:doc section="user" type="template-tag">
|
||||
|
|
@ -316,12 +328,12 @@
|
|||
</xsl:if>
|
||||
<xsl:if test="./@alt">
|
||||
<xsl:attribute name="alt">
|
||||
<xsl:value-of select="foundry:get-static-text('', ./@alt, 'false')"/>
|
||||
<xsl:value-of select="foundry:get-static-text('', ./@alt, false())"/>
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:if test="./@title">
|
||||
<xsl:attribute name="title">
|
||||
<xsl:value-of select="foundry:get-static-text('', ./@title, 'false')"/>
|
||||
<xsl:value-of select="foundry:get-static-text('', ./@title, false())"/>
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
<xsl:if test="width">
|
||||
|
|
@ -337,6 +349,13 @@
|
|||
</img>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="li">
|
||||
<li>
|
||||
<xsl:call-template name="foundry:set-id-and-class"/>
|
||||
<xsl:apply-templates/>
|
||||
</li>
|
||||
</xsl:template>
|
||||
|
||||
<foundry:doc section="user" type="template-tag">
|
||||
<foundry:doc-desc>
|
||||
Generates a HTML5 <code>main</code> element.
|
||||
|
|
@ -397,6 +416,13 @@
|
|||
</nav>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="ol">
|
||||
<ul>
|
||||
<xsl:call-template name="foundry:set-id-and-class"/>
|
||||
<xsl:apply-templates/>
|
||||
</ul>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="p">
|
||||
<p>
|
||||
<xsl:call-template name="foundry:set-id-and-class"/>
|
||||
|
|
@ -536,7 +562,12 @@
|
|||
</title>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
<xsl:template match="ul">
|
||||
<ul>
|
||||
<xsl:call-template name="foundry:set-id-and-class"/>
|
||||
<xsl:apply-templates/>
|
||||
</ul>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
xmlns:bebop="http://www.arsdigita.com/bebop/1.0"
|
||||
xmlns:foundry="http://foundry.libreccm.org"
|
||||
xmlns:ui="http://www.arsdigita.com/ui/1.0"
|
||||
version="1.0">
|
||||
version="2.0">
|
||||
|
||||
<foundry:doc section="user"
|
||||
type="template-tag">
|
||||
|
|
@ -180,7 +180,7 @@
|
|||
</xsl:template>
|
||||
|
||||
<xsl:template match="load-html5shiv">
|
||||
<xsl:value-of disable-output-escaping="yes" select="concat('
|
||||
<xsl:value-of select="concat('
|
||||
<!--
|
||||
<!-[if lt IE 9]>
|
||||
<script src="', $context-prefix, '/assets/html5shiv.js"/>
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:foundry="http://foundry.libreccm.org"
|
||||
xmlns:func="http://exslt.org/functions"
|
||||
xmlns:bebop="http://www.arsdigita.com/bebop/1.0"
|
||||
xmlns:nav="http://ccm.redhat.com/navigation"
|
||||
exclude-result-prefixes="xsl bebop foundry nav"
|
||||
|
|
@ -26,7 +25,7 @@
|
|||
</foundry:doc-attribute>
|
||||
<foundry:doc-desc>
|
||||
Environment for outputting the home link for a navigation/category system. This tag
|
||||
only intializes the context. The link itself has to be rendered using the <code>a</code>
|
||||
only initialises the context. The link itself has to be rendered using the <code>a</code>
|
||||
HTML tag. The title of the navigation is printed using the <code>navigation-title</code>
|
||||
tag.
|
||||
</foundry:doc-desc>
|
||||
|
|
@ -35,13 +34,13 @@
|
|||
</foundry:doc>
|
||||
<xsl:template match="navigation-home-link">
|
||||
<xsl:variable name="navigation-id"
|
||||
select="foundry:get-attribute-value('navigation-id', 'categoryMenu')"/>
|
||||
|
||||
select="foundry:get-attribute-value(current(), 'navigation-id', 'categoryMenu')"/>
|
||||
<xsl:apply-templates>
|
||||
<xsl:with-param name="href"
|
||||
select="$data-tree//nav:categoryMenu[@id=$navigation-id]/nav:category/@url"/>
|
||||
<xsl:with-param name="navigation-id" select="$navigation-id"/>
|
||||
<xsl:with-param name="title">
|
||||
select="$data-tree//nav:categoryMenu[@id=$navigation-id]/nav:category/@url"
|
||||
tunnel="yes"/>
|
||||
<xsl:with-param name="navigation-id" select="$navigation-id" tunnel="yes"/>
|
||||
<xsl:with-param name="title" tunnel="yes">
|
||||
<xsl:choose>
|
||||
<xsl:when test="./@show-description-text = 'false'">
|
||||
<xsl:choose>
|
||||
|
|
@ -49,7 +48,7 @@
|
|||
<xsl:value-of select="$data-tree//nav:categoryMenu[@id=$navigation-id]/nav:category/@title"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="foundry:get-static-text('navigation', $data-tree//nav:categoryMenu[@id=$navigation-id]/@navigation-id, 'false')"/>
|
||||
<xsl:value-of select="foundry:get-static-text('navigation', $data-tree//nav:categoryMenu[@id=$navigation-id]/@navigation-id, false())"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:when>
|
||||
|
|
@ -62,212 +61,73 @@
|
|||
</xsl:template>
|
||||
|
||||
<xsl:template match="navigation-home-link//navigation-title">
|
||||
<xsl:param name="navigation-id"/>
|
||||
<xsl:param name="navigation-id" tunnel="yes"/>
|
||||
|
||||
<xsl:value-of select="foundry:shying($data-tree//nav:categoryMenu[@id=$navigation-id]/nav:category/@title)"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="navigation">
|
||||
<apply-templates/>
|
||||
<xsl:apply-templates select=".//navigation-links">
|
||||
<xsl:apply-templates>
|
||||
<xsl:with-param name="navigation-id"
|
||||
select="foundry:get-attribute-value('navigation-id', 'categoryMenu')"/>
|
||||
select="foundry:get-attribute-value(current(), 'navigation-id', 'categoryMenu')"
|
||||
tunnel="yes"/>
|
||||
<xsl:with-param name="with-colorset"
|
||||
select="foundry:get-attribute-value('with-colorset', 'false')"/>
|
||||
select="foundry:get-attribute-value(current(), 'with-colorset', 'false')"
|
||||
tunnel="yes"/>
|
||||
<xsl:with-param name="min-level"
|
||||
select="foundry:get-attribute-value('min-level', 1)"/>
|
||||
select="foundry:get-attribute-value(current(), 'min-level', 1)"
|
||||
tunnel="yes"/>
|
||||
<xsl:with-param name="max-level"
|
||||
select="foundry:get-attribute-value('max-level', 999)"/>
|
||||
select="foundry:get-attribute-value(current(), 'max-level', 999)"
|
||||
tunnel="yes"/>
|
||||
<xsl:with-param name="show-description-text"
|
||||
select="foundry:get-attribute-value('show-description-text', 'true')"/>
|
||||
select="foundry:get-attribute-value(current(), 'show-description-text', 'true')"
|
||||
tunnel="yes"/>
|
||||
</xsl:apply-templates>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="navigation//navigation-links">
|
||||
<xsl:param name="navigation-id"/>
|
||||
<xsl:param name="with-colorset"/>
|
||||
<xsl:param name="min-level"/>
|
||||
<xsl:param name="max-level"/>
|
||||
<xsl:param name="show-description-text"/>
|
||||
<xsl:param name="current-level" select="1"/>
|
||||
<xsl:param name="current-level-tree" select="$data-tree//nav:categoryMenu[@id=$navigation-id]/nav:category/nav:category"/>
|
||||
|
||||
<dl>
|
||||
<dt>navigation-id</dt>
|
||||
<dd><xsl:value-of select="$navigation-id"/></dd>
|
||||
<dt>with-colorset</dt>
|
||||
<dd><xsl:value-of select="$with-colorset"/></dd>
|
||||
<dt>min-level</dt>
|
||||
<dd><xsl:value-of select="$min-level"/></dd>
|
||||
<dt>max-level</dt>
|
||||
<dd><xsl:value-of select="$max-level"/></dd>
|
||||
<dt>current-level</dt>
|
||||
<dd><xsl:value-of select="$current-level"/></dd>
|
||||
</dl>
|
||||
|
||||
<xsl:choose>
|
||||
<xsl:when test="($current-level >= $min-level) and ($current-level <= $max-level)">
|
||||
<xsl:apply-templates>
|
||||
<xsl:with-param name="navigation-id" select="$navigation-id"/>
|
||||
<xsl:with-param name="with-colorset" select="$with-colorset"/>
|
||||
<xsl:with-param name="min-level" select="$min-level"/>
|
||||
<xsl:with-param name="max-level" select="$max-level"/>
|
||||
<xsl:with-param name="show-description-text" select="$show-description-text"/>
|
||||
<xsl:with-param name="current-level" select="1"/>
|
||||
<xsl:with-param name="current-level-tree" select="$current-level-tree"/>
|
||||
<xsl:with-param name="navigation-links-tree" select="."/>
|
||||
</xsl:apply-templates>
|
||||
</xsl:when>
|
||||
<xsl:when test="($current-level < $min-level) and $current-level-tree/nav:category">
|
||||
<xsl:apply-templates select=".">
|
||||
<xsl:with-param name="navigation-id" select="$navigation-id"/>
|
||||
<xsl:with-param name="with-colorset" select="$with-colorset"/>
|
||||
<xsl:with-param name="min-level" select="$min-level"/>
|
||||
<xsl:with-param name="max-level" select="$max-level"/>
|
||||
<xsl:with-param name="show-description-text" select="$show-description-text"/>
|
||||
<xsl:with-param name="current-level" select="$current-level + 1"/>
|
||||
<xsl:with-param name="current-level-tree"
|
||||
select="$current-level-tree/nav:category"/>
|
||||
<xsl:with-param name="navigation-links-tree" select="."/>
|
||||
</xsl:apply-templates>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="navigationlinks//navigation-link">
|
||||
<xsl:param name="navigation-id"/>
|
||||
<xsl:param name="with-colorset"/>
|
||||
<xsl:param name="min-level"/>
|
||||
<xsl:param name="max-level"/>
|
||||
<xsl:param name="show-description-text"/>
|
||||
<xsl:param name="current-level"/>
|
||||
<xsl:param name="current-level-tree"/>
|
||||
<xsl:param name="navigation-links-tree"/>
|
||||
|
||||
<xsl:variable name="link-tree" select="."/>
|
||||
|
||||
<xsl:for-each select="$current-level-tree">
|
||||
<xsl:apply-templates select="$link-tree">
|
||||
<xsl:with-param name="navigation-id" select="$navigation-id"/>
|
||||
<xsl:with-param name="with-colorset" select="$with-colorset"/>
|
||||
<xsl:with-param name="min-level" select="$min-level"/>
|
||||
<xsl:with-param name="max-level" select="$max-level"/>
|
||||
<xsl:with-param name="show-description-text"
|
||||
select="show-description-text"/>
|
||||
<xsl:with-param name="current-level" select="$current-level"/>
|
||||
<xsl:with-param name="current-level-tree" select="$current-level-tree"/>
|
||||
<xsl:with-param name="navigation-links-tree" select="$navigation-links-tree"/>
|
||||
<xsl:with-param name="href" select="./@url"/>
|
||||
<xsl:with-param name="title">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$show-description-text and ./@description">
|
||||
<xsl:value-of select="./@description"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="./@title"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:with-param>
|
||||
<xsl:with-param name="link-label" select="./@title"/>
|
||||
</xsl:apply-templates>
|
||||
</xsl:for-each>
|
||||
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="navigation-link//navigation-link-label">
|
||||
<xsl:param name="link-label"/>
|
||||
|
||||
<xsl:value-of select="$link-label"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="navigation-link//navigation-sublinks">
|
||||
<xsl:param name="navigation-id"/>
|
||||
<xsl:param name="with-colorset"/>
|
||||
<xsl:param name="min-level"/>
|
||||
<xsl:param name="max-level"/>
|
||||
<xsl:param name="show-description-text"/>
|
||||
<xsl:param name="current-level"/>
|
||||
<xsl:param name="current-level-tree"/>
|
||||
<xsl:param name="navigation-links-tree"/>
|
||||
|
||||
|
||||
<xsl:if test="($current-level <= $max-level) and $current-level-tree/nav:category">
|
||||
<xsl:apply-templates select="$navigation-links-tree">
|
||||
<xsl:with-param name="navigation-id" select="$navigation-id"/>
|
||||
<xsl:with-param name="with-colorset" select="$with-colorset"/>
|
||||
<xsl:with-param name="min-level" select="$min-level"/>
|
||||
<xsl:with-param name="max-level" select="$max-level"/>
|
||||
<xsl:with-param name="show-description-text" select="$show-description-text"/>
|
||||
<xsl:with-param name="current-level" select="$current-level + 1"/>
|
||||
<xsl:with-param name="navigation-links-tree" select="$navigation-links-tree"/>
|
||||
</xsl:apply-templates>
|
||||
</xsl:if>
|
||||
|
||||
</xsl:template>
|
||||
|
||||
<!--<xsl:template match="navigation-layout">
|
||||
<xsl:apply-templates>
|
||||
<xsl:with-param name="navigation-id"
|
||||
select="foundry:get-attribute-value('navigation-id', 'categoryMenu')"/>
|
||||
<xsl:with-param name="with-colorset"
|
||||
select="foundry:get-attribute-value('with-colorset', 'false')"/>
|
||||
<xsl:with-param name="min-level"
|
||||
select="foundry:get-attribute-value('min-level', '1')"/>
|
||||
<xsl:with-param name="max-level"
|
||||
select="foundry:get-attribute-value('max-level', '999')"/>
|
||||
<xsl:with-param name="show-description-text"
|
||||
select="foundry:get-attribute-value('show-description-text', 'true')"/>
|
||||
<xsl:with-param name="current-level-tree"
|
||||
select="$data-tree//nav:categoryMenu[@id=foundry:get-attribute-value('navigation-id', 'categoryMenu')]/nav:category/nav:category"/>
|
||||
</xsl:apply-templates>
|
||||
</xsl:template>
|
||||
|
||||
|
||||
|
||||
<xsl:template match="navigation-layout//navigation-link-list"
|
||||
name="navigation-link-list">
|
||||
<xsl:param name="navigation-id"/>
|
||||
<xsl:param name="with-colorset"/>
|
||||
<xsl:param name="min-level"/>
|
||||
<xsl:param name="max-level"/>
|
||||
<xsl:param name="show-description-text"/>
|
||||
<xsl:param name="current-level" select="1"/>
|
||||
<xsl:param name="current-level-tree"/>
|
||||
<xsl:param name="navigation-link-layout" select="."/>
|
||||
<xsl:param name="navigation-id" tunnel="yes"/>
|
||||
<xsl:param name="with-colorset" tunnel="yes"/>
|
||||
<xsl:param name="min-level" tunnel="yes"/>
|
||||
<xsl:param name="max-level" tunnel="yes"/>
|
||||
<xsl:param name="show-description-text" tunnel="yes"/>
|
||||
<xsl:param name="current-level" select="1" tunnel="yes"/>
|
||||
<xsl:param name="current-level-tree"
|
||||
select="$data-tree//nav:categoryMenu[@id=$navigation-id]/nav:category/nav:category"
|
||||
tunnel="yes"/>
|
||||
|
||||
<xsl:message>
|
||||
navigation-link-list applied
|
||||
<xsl:value-of select="'navigation-links template called with these parameters:'"/>
|
||||
</xsl:message>
|
||||
<xsl:message>
|
||||
<xsl:value-of select="concat(' navigation-id = ', $navigation-id)"/>
|
||||
</xsl:message>
|
||||
<xsl:message>
|
||||
<xsl:value-of select="concat(' with-colorset = ', $with-colorset)"/>
|
||||
</xsl:message>
|
||||
<xsl:message>
|
||||
<xsl:value-of select="concat(' min-level = ', $min-level)"/>
|
||||
</xsl:message>
|
||||
<xsl:message>
|
||||
<xsl:value-of select="concat(' max-level = ', $max-level)"/>
|
||||
</xsl:message>
|
||||
<xsl:message>
|
||||
<xsl:value-of select="concat(' current-level = ', $current-level)"/>
|
||||
</xsl:message>
|
||||
<xsl:message>
|
||||
<xsl:value-of select="concat(' count(category)', count($current-level-tree))"/>
|
||||
</xsl:message>
|
||||
|
||||
<xsl:apply-templates>
|
||||
<xsl:with-param name="navigation-id" select="$navigation-id"/>
|
||||
<xsl:with-param name="with-colorset" select="$with-colorset"/>
|
||||
<xsl:with-param name="min-level" select="$min-level"/>
|
||||
<xsl:with-param name="max-level" select="$max-level"/>
|
||||
<xsl:with-param name="show-description-text" select="$show-description-text"/>
|
||||
<xsl:with-param name="current-level" select="$current-level"/>
|
||||
<xsl:with-param name="current-level-tree" select="$current-level-tree"/>
|
||||
<xsl:with-param name="navigation-link-layout" select="$navigation-link-layout"/>
|
||||
</xsl:apply-templates>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="navigation-link-list//navigation-link-layout">
|
||||
<xsl:param name="navigation-id"/>
|
||||
<xsl:param name="with-colorset"/>
|
||||
<xsl:param name="min-level"/>
|
||||
<xsl:param name="max-level"/>
|
||||
<xsl:param name="show-description-text"/>
|
||||
<xsl:param name="current-level" select="1"/>
|
||||
<xsl:param name="current-level-tree"
|
||||
select="$data-tree//nav:categoryMenu[@id=$navigation-id]/nav:category/nav:category"/>
|
||||
<xsl:param name="navigation-link-layout" select="."/>
|
||||
|
||||
<h1>applied navigation-link-list with these values:</h1>
|
||||
<dl>
|
||||
<!-- <dl>
|
||||
<dt>navigation-id</dt>
|
||||
<dd>
|
||||
<xsl:value-of select="$navigation-id"/>
|
||||
</dd>
|
||||
<dt>with-colorset</dt>
|
||||
<dd>
|
||||
<xsl:value-of select="$with-colorset"/>
|
||||
</dd>
|
||||
<dt>min-level</dt>
|
||||
<dd>
|
||||
<xsl:value-of select="$min-level"/>
|
||||
|
|
@ -280,82 +140,122 @@
|
|||
<dd>
|
||||
<xsl:value-of select="$current-level"/>
|
||||
</dd>
|
||||
</dl>
|
||||
</dl>-->
|
||||
|
||||
<xsl:if test="$current-level >= min-level">
|
||||
|
||||
<xsl:message>
|
||||
Processing current level categories...
|
||||
|
||||
</xsl:message>
|
||||
|
||||
|
||||
<xsl:apply-templates select="$current-level-tree">
|
||||
<xsl:with-param name="with-colorset"/>
|
||||
<xsl:with-param name="show-description-text"/>
|
||||
<xsl:with-param name="navigation-link-layout" select="$navigation-link-layout"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="($current-level >= $min-level) and ($current-level <= $max-level)">
|
||||
<xsl:apply-templates>
|
||||
<xsl:with-param name="navigation-id" select="$navigation-id" tunnel="yes"/>
|
||||
<xsl:with-param name="with-colorset" select="$with-colorset" tunnel="yes"/>
|
||||
<xsl:with-param name="min-level" select="$min-level" tunnel="yes"/>
|
||||
<xsl:with-param name="max-level" select="$max-level" tunnel="yes"/>
|
||||
<xsl:with-param name="show-description-text"
|
||||
select="$show-description-text"
|
||||
tunnel="yes"/>
|
||||
<xsl:with-param name="current-level" select="1" tunnel="yes"/>
|
||||
<xsl:with-param name="current-level-tree"
|
||||
select="$current-level-tree"
|
||||
tunnel="yes"/>
|
||||
<xsl:with-param name="navigation-links-tree" select="." tunnel="yes"/>
|
||||
</xsl:apply-templates>
|
||||
</xsl:if>
|
||||
</xsl:when>
|
||||
<xsl:when test="($current-level < $min-level) and $current-level-tree/nav:category">
|
||||
<xsl:apply-templates select=".">
|
||||
<xsl:with-param name="navigation-id" select="$navigation-id" tunnel="yes"/>
|
||||
<xsl:with-param name="with-colorset" select="$with-colorset" tunnel="yes"/>
|
||||
<xsl:with-param name="min-level" select="$min-level" tunnel="yes"/>
|
||||
<xsl:with-param name="max-level" select="$max-level"/>
|
||||
<xsl:with-param name="show-description-text"
|
||||
select="$show-description-text"
|
||||
tunnel="yes"/>
|
||||
<xsl:with-param name="current-level" select="$current-level + 1"
|
||||
tunnel="yes"/>
|
||||
<xsl:with-param name="current-level-tree"
|
||||
select="$current-level-tree/nav:category"
|
||||
tunnel="yes"/>
|
||||
<xsl:with-param name="navigation-links-tree" select="."
|
||||
tunnel="yes"/>
|
||||
</xsl:apply-templates>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:if test="($current-level < $max-level) and $current-level-tree/nav:category">
|
||||
<xsl:template match="navigation-links//navigation-link">
|
||||
<xsl:param name="navigation-id" tunnel="yes"/>
|
||||
<xsl:param name="with-colorset" tunnel="yes"/>
|
||||
<xsl:param name="min-level" tunnel="yes"/>
|
||||
<xsl:param name="max-level" tunnel="yes"/>
|
||||
<xsl:param name="show-description-text" tunnel="yes"/>
|
||||
<xsl:param name="current-level" tunnel="yes"/>
|
||||
<xsl:param name="current-level-tree" tunnel="yes"/>
|
||||
<xsl:param name="navigation-links-tree" tunnel="yes"/>
|
||||
|
||||
<xsl:message>Processing sub level categories</xsl:message>
|
||||
<xsl:variable name="link-tree" select="current()"/>
|
||||
|
||||
<xsl:call-template name="navigation-link-list">
|
||||
<xsl:for-each select="$current-level-tree">
|
||||
<xsl:apply-templates select="$link-tree/*">
|
||||
<xsl:with-param name="navigation-id" select="$navigation-id" tunnel="yes"/>
|
||||
<xsl:with-param name="with-colorset" select="$with-colorset" tunnel="yes"/>
|
||||
<xsl:with-param name="min-level" select="$min-level" tunnel="yes"/>
|
||||
<xsl:with-param name="max-level" select="$max-level" tunnel="yes"/>
|
||||
<xsl:with-param name="show-description-text"
|
||||
select="show-description-text"
|
||||
tunnel="yes"/>
|
||||
<xsl:with-param name="current-level" select="$current-level" tunnel="yes"/>
|
||||
<xsl:with-param name="current-level-tree"
|
||||
select="current()"
|
||||
tunnel="yes"/>
|
||||
<xsl:with-param name="navigation-links-tree"
|
||||
select="$navigation-links-tree"
|
||||
tunnel="yes"/>
|
||||
<xsl:with-param name="href" select="./@url" tunnel="yes"/>
|
||||
<xsl:with-param name="title" tunnel="yes">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$show-description-text and ./@description">
|
||||
<xsl:value-of select="./@description"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="./@title"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:with-param>
|
||||
<xsl:with-param name="link-label" select="./@title" tunnel="yes"/>
|
||||
</xsl:apply-templates>
|
||||
</xsl:for-each>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="navigation-link//navigation-link-label">
|
||||
<xsl:param name="link-label" tunnel="yes"/>
|
||||
|
||||
<xsl:value-of select="$link-label"/>
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="navigation-link//navigation-sublinks">
|
||||
<xsl:param name="navigation-id" tunnel="yes"/>
|
||||
<xsl:param name="with-colorset" tunnel="yes"/>
|
||||
<xsl:param name="min-level" tunnel="yes"/>
|
||||
<xsl:param name="max-level" tunnel="yes"/>
|
||||
<xsl:param name="show-description-text" tunnel="yes"/>
|
||||
<xsl:param name="current-level" tunnel="yes"/>
|
||||
<xsl:param name="current-level-tree" tunnel="yes"/>
|
||||
<xsl:param name="navigation-links-tree" tunnel="yes"/>
|
||||
|
||||
|
||||
<xsl:if test="($current-level <= $max-level) and $current-level-tree/nav:category">
|
||||
<xsl:apply-templates select="$navigation-links-tree">
|
||||
<xsl:with-param name="navigation-id" select="$navigation-id"/>
|
||||
<xsl:with-param name="with-colorset" select="$with-colorset"/>
|
||||
<xsl:with-param name="min-level" select="$min-level"/>
|
||||
<xsl:with-param name="max-level" select="$max-level"/>
|
||||
<xsl:with-param name="show-description-text" select="$show-description-text"/>
|
||||
<xsl:with-param name="current-level" select="$current-level + 1"/>
|
||||
<xsl:with-param name="current-level-tree" select="$current-level-tree/nav:category"/>
|
||||
<xsl:with-param name="navigation-link-layout" select="$navigation-link-layout"/>
|
||||
</xsl:call-template>
|
||||
<xsl:with-param name="current-level-tree"
|
||||
select="$current-level-tree/nav:category"
|
||||
tunnel="yes"/>
|
||||
<xsl:with-param name="navigation-links-tree" select="$navigation-links-tree"/>
|
||||
</xsl:apply-templates>
|
||||
</xsl:if>
|
||||
|
||||
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="nav:category">
|
||||
<xsl:param name="with-colorset"/>
|
||||
<xsl:param name="show-description-text"/>
|
||||
<xsl:param name="navigation-link-layout"/>
|
||||
|
||||
<xsl:message>nav:category applied</xsl:message>
|
||||
|
||||
<xsl:apply-templates select="$navigation-link-layout">
|
||||
<xsl:with-param name="url" select="./@url"/>
|
||||
<xsl:with-param name="title" select="./@title"/>
|
||||
<xsl:with-param name="description" select="./@description"/>
|
||||
<xsl:with-param name="with-colorset" select="$with-colorset"/>
|
||||
<xsl:with-param name="show-description-text" select="$show-description-text"/>
|
||||
</xsl:apply-templates>
|
||||
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="navigation-link">
|
||||
<xsl:param name="url"/>
|
||||
<xsl:param name="title"/>
|
||||
<xsl:param name="description"/>
|
||||
<xsl:param name="with-colorset"/>
|
||||
<xsl:param name="show-description-text"/>
|
||||
|
||||
<xsl:message>navigation-link applied</xsl:message>
|
||||
|
||||
<a href="{$url}">
|
||||
<xsl:attribute name="title">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$show-description-text = 'true'">
|
||||
<xsl:value-of select="$description"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="$title"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:attribute>
|
||||
<xsl:value-of select="$title"/>
|
||||
</a>
|
||||
|
||||
</xsl:template>-->
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
|
@ -7,7 +7,7 @@
|
|||
xmlns:foundry="http://foundry.libreccm.org"
|
||||
xmlns:ui="http://www.arsdigita.com/ui/1.0"
|
||||
exclude-result-prefixes="xsl bebop cms foundry ui"
|
||||
version="1.0">
|
||||
version="2.0">
|
||||
|
||||
<xsl:template match="subsite-name">
|
||||
<xsl:variable name="subsite-banner-text">
|
||||
|
|
|
|||
|
|
@ -26,10 +26,10 @@
|
|||
EXSLT functions.
|
||||
-->
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
||||
xmlns:bebop="http://www.arsdigita.com/bebop/1.0"
|
||||
xmlns:cms="http://www.arsdigita.com/cms/1.0"
|
||||
xmlns:foundry="http://foundry.libreccm.org"
|
||||
xmlns:func="http://exslt.org/functions"
|
||||
xmlns:nav="http://ccm.redhat.com/navigation"
|
||||
version="1.0">
|
||||
|
||||
|
|
@ -99,8 +99,8 @@ EXSLT functions.
|
|||
</p>
|
||||
</foundry:doc-desc>
|
||||
</foundry:doc>
|
||||
<func:function name="foundry:boolean">
|
||||
<xsl:param name="value"/>
|
||||
<xsl:function name="foundry:boolean" as="xs:boolean">
|
||||
<xsl:param name="value" as="xs:string"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$value = 'true'
|
||||
or $value = 'TRUE'
|
||||
|
|
@ -110,14 +110,14 @@ EXSLT functions.
|
|||
or $value = 'T'
|
||||
or $value = 'y'
|
||||
or $value = 'Y'">
|
||||
<func:result select="true()"/>
|
||||
<xsl:sequence select="true()"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<func:result select="false()"/>
|
||||
<xsl:sequence select="false()"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
</func:function>
|
||||
</xsl:function>
|
||||
|
||||
<foundry:doc section="devel">
|
||||
<foundry:doc-param name="level"
|
||||
|
|
@ -147,14 +147,12 @@ EXSLT functions.
|
|||
#foundry-message-error
|
||||
</foundry:doc-see-also>
|
||||
</foundry:doc>
|
||||
<func:function name="foundry:message">
|
||||
<xsl:param name="level"/>
|
||||
<xsl:param name="message"/>
|
||||
<xsl:function name="foundry:message" as="xs:string">
|
||||
<xsl:param name="level" as="xs:string"/>
|
||||
<xsl:param name="message" as="xs:string"/>
|
||||
|
||||
<func:result>
|
||||
<xsl:value-of select="concat('[Foundry ', $level, '] ', $message)"/>
|
||||
</func:result>
|
||||
</func:function>
|
||||
<xsl:sequence select="concat('[Foundry ', $level, '] ', $message)"/>
|
||||
</xsl:function>
|
||||
|
||||
<foundry:doc section="devel">
|
||||
<foundry:doc-param name="message"
|
||||
|
|
@ -180,13 +178,11 @@ EXSLT functions.
|
|||
#foundry-message-error
|
||||
</foundry:doc-see-also>
|
||||
</foundry:doc>
|
||||
<func:function name="foundry:message-info">
|
||||
<xsl:param name="message"/>
|
||||
<xsl:function name="foundry:message-info" as="xs:string">
|
||||
<xsl:param name="message" as="xs:string"/>
|
||||
|
||||
<func:result>
|
||||
<xsl:value-of select="foundry:message('INFO', $message)"/>
|
||||
</func:result>
|
||||
</func:function>
|
||||
<xsl:sequence select="foundry:message('INFO', $message)"/>
|
||||
</xsl:function>
|
||||
|
||||
<foundry:doc section="devel">
|
||||
<foundry:doc-param name="message"
|
||||
|
|
@ -214,13 +210,11 @@ EXSLT functions.
|
|||
#foundry-message-error
|
||||
</foundry:doc-see-also>
|
||||
</foundry:doc>
|
||||
<func:function name="foundry:message-warn">
|
||||
<xsl:param name="message"/>
|
||||
<xsl:function name="foundry:message-warn" as="xs:string">
|
||||
<xsl:param name="message" as="xs:string"/>
|
||||
|
||||
<func:result>
|
||||
<xsl:value-of select="foundry:message('WARNING', $message)"/>
|
||||
</func:result>
|
||||
</func:function>
|
||||
<xsl:sequence select="foundry:message('WARNING', $message)"/>
|
||||
</xsl:function>
|
||||
|
||||
<foundry:doc section="devel">
|
||||
<foundry:doc-param name="message"
|
||||
|
|
@ -248,20 +242,20 @@ EXSLT functions.
|
|||
#foundry-message-warn
|
||||
</foundry:doc-see-also>
|
||||
</foundry:doc>
|
||||
<func:function name="foundry:message-error">
|
||||
<xsl:param name="message"/>
|
||||
<func:result>
|
||||
<xsl:value-of select="foundry:message('ERROR', $message)"/>
|
||||
</func:result>
|
||||
</func:function>
|
||||
<xsl:function name="foundry:message-error" as="xs:string">
|
||||
<xsl:param name="message" as="xs:string"/>
|
||||
|
||||
<xsl:sequence select="foundry:message('ERROR', $message)"/>
|
||||
</xsl:function>
|
||||
|
||||
<foundry:doc section="devel">
|
||||
<foundry:doc-param name="attribute-name"
|
||||
mandatory="yes">
|
||||
<foundry:doc-param name="node">
|
||||
The node from which the value of the attribute is read.
|
||||
</foundry:doc-param>
|
||||
<foundry:doc-param name="attribute-name">
|
||||
The attribute to check for.
|
||||
</foundry:doc-param>
|
||||
<foundry:doc-param name="default-value"
|
||||
mandatory="yes">
|
||||
<foundry:doc-param name="default-value">
|
||||
The default value if the attribute is not set.
|
||||
</foundry:doc-param>
|
||||
<foundry:doc-result>
|
||||
|
|
@ -278,9 +272,9 @@ EXSLT functions.
|
|||
<pre>
|
||||
<xsl:template match="example">
|
||||
<xsl:variable name="width"
|
||||
select="foundry:get-attribute-value('width', '640')" />
|
||||
select="foundry:get-attribute-value(current(), 'width', '640')" />
|
||||
<xsl:variable name="height"
|
||||
select="foundry:get-attribute-value('height', '480')" />
|
||||
select="foundry:get-attribute-value(current(), 'height', '480')" />
|
||||
/<xsl:template>
|
||||
</pre>
|
||||
<p>
|
||||
|
|
@ -293,21 +287,36 @@ EXSLT functions.
|
|||
</p>
|
||||
</foundry:doc-desc>
|
||||
</foundry:doc>
|
||||
<func:function name="foundry:get-attribute-value">
|
||||
<xsl:function name="foundry:get-attribute-value">
|
||||
<xsl:param name="node"/>
|
||||
<xsl:param name="attribute-name"/>
|
||||
<xsl:param name="default-value"/>
|
||||
|
||||
<func:result>
|
||||
<xsl:choose>
|
||||
<xsl:when test="./@*[name() = $attribute-name]">
|
||||
<xsl:value-of select="./@*[name() = $attribute-name]"/>
|
||||
<xsl:when test="$node/@*[name() = $attribute-name]">
|
||||
<xsl:sequence select="$node/@*[name() = $attribute-name]"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="$default-value"/>
|
||||
<xsl:sequence select="$default-value"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</func:result>
|
||||
</func:function>
|
||||
|
||||
</xsl:function>
|
||||
|
||||
<xsl:function name="foundry:get-setting" as="xs:string">
|
||||
<xsl:param name="module" as="xs:string"/>
|
||||
<xsl:param name="setting" as="xs:string"/>
|
||||
|
||||
<xsl:sequence select="foundry:get-setting($module, $setting, '', '')"/>
|
||||
</xsl:function>
|
||||
|
||||
<xsl:function name="foundry:get-setting" as="xs:string">
|
||||
<xsl:param name="module" as="xs:string"/>
|
||||
<xsl:param name="setting" as="xs:string"/>
|
||||
<xsl:param name="default" as="xs:string"/>
|
||||
|
||||
<xsl:sequence select="foundry:get-setting($module, $setting, $default, '')"/>
|
||||
</xsl:function>
|
||||
|
||||
<foundry:doc section="devel">
|
||||
<foundry:doc-param name="module"
|
||||
|
|
@ -341,44 +350,59 @@ EXSLT functions.
|
|||
value. If no default value has been provided the result is an empty string.
|
||||
</foundry:doc-result>
|
||||
<foundry:doc-desc>
|
||||
This EXSLT function retrieves the value of a setting from the theme configuration. For
|
||||
This function retrieves the value of a setting from the theme configuration. For
|
||||
more informations about the configuration system of Foundry please refer to the
|
||||
<em>configuration</em> section of the Foundry documentation.
|
||||
</foundry:doc-desc>
|
||||
</foundry:doc>
|
||||
<func:function name="foundry:get-setting">
|
||||
<xsl:param name="module"/>
|
||||
<xsl:param name="setting"/>
|
||||
<xsl:param name="default" select="''"/>
|
||||
<xsl:function name="foundry:get-setting" as="xs:string">
|
||||
<xsl:param name="module" as="xs:string"/>
|
||||
<xsl:param name="setting" as="xs:string"/>
|
||||
<xsl:param name="default" as="xs:string"/>
|
||||
<xsl:param name="node"/>
|
||||
|
||||
<xsl:choose>
|
||||
<xsl:when test="$node and $node != ''">
|
||||
<func:result select="$node"/>
|
||||
<xsl:sequence select="$node"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="$module = ''">
|
||||
<func:result select="document(concat($theme-prefix, '/conf/global.xml'))/foundry:configuration/setting[@id=$setting]"/>
|
||||
<xsl:sequence select="document(concat($theme-prefix, '/conf/global.xml'))/foundry:configuration/setting[@id=$setting]"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="not($module = '') and document(concat($theme-prefix, '/conf/', $module, '.xml'))/foundry:configuration/setting[@id=$setting]">
|
||||
<func:result select="document(concat($theme-prefix, '/conf/', $module, '.xml'))/foundry:configuration/setting[@id=$setting]"/>
|
||||
<xsl:sequence select="document(concat($theme-prefix, '/conf/', $module, '.xml'))/foundry:configuration/setting[@id=$setting]"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:message>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$module=''">
|
||||
<xsl:value-of select="foundry:message-warn(concat('Setting "', $setting, '" not found in global.xml'))"/>
|
||||
<xsl:sequence select="foundry:message-warn(concat('Setting "', $setting, '" not found in global.xml'))"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="foundry:message-warn(concat('Setting "', $setting, '" not found in', $module, '.xml'))"/>
|
||||
<xsl:sequence select="foundry:message-warn(concat('Setting "', $setting, '" not found in', $module, '.xml'))"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:message>
|
||||
|
||||
<func:result select="$default"/>
|
||||
<xsl:sequence select="$default"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
||||
</func:function>
|
||||
</xsl:function>
|
||||
|
||||
<xsl:function name="foundry:get-static-text" as="xs:string">
|
||||
<xsl:param name="module" as="xs:string"/>
|
||||
<xsl:param name="id" as="xs:string"/>
|
||||
|
||||
<xsl:sequence select="foundry:get-static-text($module, $id, true(), $lang)"/>
|
||||
</xsl:function>
|
||||
|
||||
<xsl:function name="foundry:get-static-text" as="xs:string">
|
||||
<xsl:param name="module" as="xs:string"/>
|
||||
<xsl:param name="id" as="xs:string"/>
|
||||
<xsl:param name="html" as="xs:boolean"/>
|
||||
|
||||
<xsl:sequence select="foundry:get-static-text($module, $id, $html, $lang)"/>
|
||||
</xsl:function>
|
||||
|
||||
<foundry:doc section="devel">
|
||||
<foundry:doc-param name="module"
|
||||
|
|
@ -413,50 +437,49 @@ EXSLT functions.
|
|||
refer to the static texts section in the Foundry documentation.
|
||||
</foundry:doc-desc>
|
||||
</foundry:doc>
|
||||
<func:function name="foundry:get-static-text">
|
||||
<xsl:param name="module"/>
|
||||
<xsl:param name="id"/>
|
||||
<xsl:param name="html" select="'true'"/>
|
||||
<xsl:param name="lang" select="$lang"/>
|
||||
<func:result>
|
||||
<xsl:function name="foundry:get-static-text" as="xs:string">
|
||||
<xsl:param name="module" as="xs:string"/>
|
||||
<xsl:param name="id" as="xs:string"/>
|
||||
<xsl:param name="html" as="xs:boolean"/>
|
||||
<xsl:param name="lang" as="xs:string"/>
|
||||
|
||||
<xsl:choose>
|
||||
<xsl:when test="$module = '' and document(concat($theme-prefix, '/texts/global.xml'))/foundry:static-texts/text[@id=$id]/translation[@lang = $lang]">
|
||||
<xsl:value-of select="document(concat($theme-prefix, '/texts/global.xml'))/foundry:static-texts/text[@id=$id]"/>
|
||||
<xsl:sequence select="document(concat($theme-prefix, '/texts/global.xml'))/foundry:static-texts/text[@id=$id]"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="not($module = '') and document(concat($theme-prefix, '/texts/', $module, '.xml'))/foundry:static-texts/text[@id=$id]/translation[@lang = $lang]">
|
||||
<xsl:value-of select="document(concat($theme-prefix, '/texts/', $module, '.xml'))/foundry:static-texts/text[@id=$id]/translation[@lang = $lang]"/>
|
||||
<xsl:sequence select="document(concat($theme-prefix, '/texts/', $module, '.xml'))/foundry:static-texts/text[@id=$id]/translation[@lang = $lang]"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:choose>
|
||||
<xsl:when test="foundry:debug-enabled()">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$html = 'true'">
|
||||
<xsl:when test="$html">
|
||||
<span class="foundry-debug-missing-translation">
|
||||
<span class="foundry-placeholder">
|
||||
<xsl:value-of select="$id"/>
|
||||
<xsl:sequence select="$id"/>
|
||||
</span>
|
||||
<span class="foundry-missing-translation-path">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$module = ''">
|
||||
<xsl:value-of select="document(concat($theme-prefix, '/texts/global.xml'))/foundry:static-texts/text[@id=$id]/translation[@lang=$lang]"/>
|
||||
<xsl:sequence select="document(concat($theme-prefix, '/texts/global.xml'))/foundry:static-texts/text[@id=$id]/translation[@lang=$lang]"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="document(concat($theme-prefix, '/texts/', $module, '.xml'))/foundry:static-texts/text[@id=$id]/translation[@lang=$lang]"/>
|
||||
<xsl:sequence select="document(concat($theme-prefix, '/texts/', $module, '.xml'))/foundry:static-texts/text[@id=$id]/translation[@lang=$lang]"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</span>
|
||||
</span>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="$id"/>
|
||||
<xsl:sequence select="$id"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</func:result>
|
||||
</func:function>
|
||||
</xsl:function>
|
||||
|
||||
<foundry:doc section="devel">
|
||||
<foundry:doc-result>
|
||||
|
|
@ -467,16 +490,16 @@ EXSLT functions.
|
|||
of foundry is automatically enabled if the theme is viewed as development theme.
|
||||
</foundry:doc-desc>
|
||||
</foundry:doc>
|
||||
<func:function name="foundry:debug-enabled">
|
||||
<xsl:function name="foundry:debug-enabled" as="xs:boolean">
|
||||
<xsl:choose>
|
||||
<xsl:when test="contains($theme-prefix, 'devel-themedir')">
|
||||
<func:result select="true()"/>
|
||||
<xsl:sequence select="true()"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<func:result select="false()"/>
|
||||
<xsl:sequence select="false()"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</func:function>
|
||||
</xsl:function>
|
||||
|
||||
<foundry:doc section="devel">
|
||||
<foundry:doc-desc>
|
||||
|
|
@ -491,58 +514,65 @@ EXSLT functions.
|
|||
and (name() != 'hint')
|
||||
and (name() != 'label')">
|
||||
<xsl:attribute name="{name()}">
|
||||
<xsl:value-of select="."/>
|
||||
<xsl:sequence select="."/>
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
</xsl:for-each>
|
||||
<xsl:if test="name() = 'bebop:formWidget' and (not(@id) and @name)">
|
||||
<xsl:attribute name="id">
|
||||
<xsl:value-of select="@name"/>
|
||||
<xsl:sequence select="@name"/>
|
||||
</xsl:attribute>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
|
||||
<func:function name="foundry:shying">
|
||||
<xsl:param name="text"/>
|
||||
<func:result select="translate($text, '\-', '­')"/>
|
||||
</func:function>
|
||||
<xsl:function name="foundry:shying" as="xs:string">
|
||||
<xsl:param name="text" as="xs:string"/>
|
||||
|
||||
<xsl:message>
|
||||
<xsl:sequence select="concat('foundry:shying called with ', $text)"/>
|
||||
</xsl:message>
|
||||
<xsl:message>
|
||||
<xsl:sequence select="concat('Result: ', translate($text, '\-', '­'))"/>
|
||||
</xsl:message>
|
||||
|
||||
<xsl:sequence select="translate($text, '\-', '­')"/>
|
||||
</xsl:function>
|
||||
|
||||
|
||||
<func:function name="foundry:title">
|
||||
<func:result>
|
||||
<xsl:function name="foundry:title" as="xs:string">
|
||||
<xsl:choose>
|
||||
<!-- Use fixed title for some special content items -->
|
||||
<xsl:when test="$data-tree//cms:contentPanel">
|
||||
<xsl:choose>
|
||||
<!-- Glossary -->
|
||||
<xsl:when test="$data-tree//cms:contentPanel/cms:item/type/label = 'Glossary Item'">
|
||||
<xsl:value-of select="foundry:get-static-text('layout/page/title/glossary')"/>
|
||||
<xsl:sequence select="foundry:get-static-text('layout/page/title/glossary')"/>
|
||||
</xsl:when>
|
||||
<!-- FAQ -->
|
||||
<xsl:when test="$data-tree//cms:contentPanel/cms:item/type/label = 'FAQ Item'">
|
||||
<xsl:value-of select="foundry:get-static-text('layout/page/title/faq')"/>
|
||||
<xsl:sequence select="foundry:get-static-text('layout/page/title/faq')"/>
|
||||
</xsl:when>
|
||||
<!-- Else use title of CI -->
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="foundry:shying($data-tree//cms:contentPanel/cms:item/title)"/>
|
||||
<xsl:sequence select="foundry:shying($data-tree//cms:contentPanel/cms:item/title)"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:when>
|
||||
<!-- Localized title for A-Z list -->
|
||||
<xsl:when test="$data-tree/bebop:title = 'AtoZ'">
|
||||
<xsl:value-of select="foundry:get-static-text('layout/page/title/atoz')"/>
|
||||
<xsl:sequence select="foundry:get-static-text('layout/page/title/atoz')"/>
|
||||
</xsl:when>
|
||||
<!-- Localized title for search -->
|
||||
<xsl:when test="$data-tree/bebop:title = 'Search'">
|
||||
<xsl:value-of select="foundry:get-static-text('layout/page/title/search')"/>
|
||||
<xsl:sequence select="foundry:get-static-text('layout/page/title/search')"/>
|
||||
</xsl:when>
|
||||
<!-- Localized title for log in -->
|
||||
<xsl:when test="$data-tree/@application = 'login'">
|
||||
<xsl:value-of select="foundry:get-static-text('layout/page/title/login')"/>
|
||||
<xsl:sequence select="foundry:get-static-text('layout/page/title/login')"/>
|
||||
</xsl:when>
|
||||
<!-- Localited title for sitemap -->
|
||||
<xsl:when test="$data-tree/@id = 'sitemapPage'">
|
||||
<xsl:value-of select="foundry:get-static-text('layout/page/title/sitemap')"/>
|
||||
<xsl:sequence select="foundry:get-static-text('layout/page/title/sitemap')"/>
|
||||
</xsl:when>
|
||||
<!-- Title for content section-->
|
||||
<xsl:otherwise>
|
||||
|
|
@ -550,17 +580,16 @@ EXSLT functions.
|
|||
<xsl:choose>
|
||||
<!-- Special rule: Use content item title für root-page in navigation -->
|
||||
<xsl:when test="position() = last() and position() = 1">
|
||||
<xsl:value-of select="foundry:shying(/bebop:page//title)"/>
|
||||
<xsl:sequence select="foundry:shying(/bebop:page//title)"/>
|
||||
</xsl:when>
|
||||
<!-- Else use the name of the category -->
|
||||
<xsl:when test="position() = last()">
|
||||
<xsl:value-of select="foundry:shying(./@title)"/>
|
||||
<xsl:sequence select="foundry:shying(./@title)"/>
|
||||
</xsl:when>
|
||||
</xsl:choose>
|
||||
</xsl:for-each>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</func:result>
|
||||
</func:function>
|
||||
</xsl:function>
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
|
@ -30,6 +30,7 @@
|
|||
<xsl:import href="../doc/xsl/foundry-documentation.xsl"/>
|
||||
|
||||
<xsl:output method="html"
|
||||
doctype-system="about:legacy-compat"
|
||||
indent="yes"
|
||||
encoding="utf-8"/>
|
||||
|
||||
|
|
@ -81,8 +82,7 @@
|
|||
</foundry:doc-desc>
|
||||
</foundry:doc>
|
||||
<xsl:template match="/foundry:documentation">
|
||||
<xsl:value-of select="'<!DOCTYPE HTML>'"
|
||||
disable-output-escaping="yes" />
|
||||
<!--<xsl:text><!DOCTYPE HTML></xsl:text>-->
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="content-type"
|
||||
|
|
|
|||
|
|
@ -9,7 +9,11 @@
|
|||
</head>
|
||||
<body>
|
||||
<nav>
|
||||
<navigation-home-link/>
|
||||
<navigation-home-link>
|
||||
<a>
|
||||
<navigation-title/>
|
||||
</a>
|
||||
</navigation-home-link>
|
||||
<navigation>
|
||||
<div class="nav-wrapper">
|
||||
<navigation-links>
|
||||
|
|
|
|||
Loading…
Reference in New Issue