Syncing Foundry files

git-svn-id: https://svn.libreccm.org/ccm/trunk@2898 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2014-10-04 20:01:46 +00:00
parent 2d423c0dff
commit d337647696
12 changed files with 1948 additions and 704 deletions

View File

@ -1,4 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<applications>
<default>default-layout.xml</default>
</applications>
<templates>
<applications>
<!--
<application name = "" page-class=""></application>
-->
<default>default-layout.xml</default>
</applications>
<content-items>
<default>content-items/default.xml</default>
</content-items>
</template>

View File

@ -33,8 +33,10 @@
<foundry:doc section="user" type="template-tag">
<foundry:doc-desc>
Root element of a template. Generates the
<code>&lt;html&gt;</code> root element.
<p>
Root element of a template. Generates the
<code>&lt;html&gt;</code> root element.
</p>
</foundry:doc-desc>
</foundry:doc>
<xsl:template match="page-layout">
@ -44,9 +46,17 @@
</xsl:attribute>
<xsl:attribute name="id">
<xsl:choose>
<xsl:when test="@application = 'admin' or @application = 'content-center' or @application = 'content-section'
or @application = 'theme' or @application = 'shortcuts' or @application = 'subsite' or @application = 'terms' or @application = 'atoz' or @application = 'ds'
or @class = 'cms-admin' or @class = 'admin'">
<xsl:when test="@application = 'admin'
or @application = 'content-center'
or @application = 'content-section'
or @application = 'theme'
or @application = 'shortcuts'
or @application = 'subsite'
or @application = 'terms'
or @application = 'atoz'
or @application = 'ds'
or @class = 'cms-admin'
or @class = 'admin'">
<xsl:text>cms</xsl:text>
</xsl:when>
<xsl:otherwise>
@ -60,7 +70,9 @@
<foundry:doc section="user" type="template-tag">
<foundry:doc-desc>
Root element for generating a HTML fragment instead of a complete HTML document.
<p>
Root element for generating a HTML fragment instead of a complete HTML document.
</p>
</foundry:doc-desc>
</foundry:doc>
<xsl:template match="fragment-layout">
@ -116,7 +128,8 @@
</xsl:attribute>
<img>
<xsl:attribute name="src">
<xsl:value-of select="concat($context-prefix, '/assets/gray-triangle-up.gif')"/>
<xsl:value-of select="concat($context-prefix,
'/assets/gray-triangle-up.gif')"/>
</xsl:attribute>
<xsl:attribute name="title">
<xsl:value-of select="'moveUp'"/>
@ -136,7 +149,8 @@
</xsl:attribute>
<img>
<xsl:attribute name="src">
<xsl:value-of select="concat($context-prefix, '/assets/gray-triangle-down.gif')"/>
<xsl:value-of select="concat($context-prefix,
'/assets/gray-triangle-down.gif')"/>
</xsl:attribute>
<xsl:attribute name="title">
<xsl:value-of select="'moveDown'"/>
@ -180,9 +194,21 @@
</foundry:doc-desc>
</foundry:doc>
<xsl:template name="foundry:process-template">
<xsl:param name="template-file"/>
<xsl:param name="template-file" as="xs:string"/>
<xsl:param name="internal" as="xs:boolean" select="false()"/>
<xsl:apply-templates select="document(concat($theme-prefix, '/templates/', $template-file))"/>
<xsl:choose>
<xsl:when test="$internal = true()">
<xsl:apply-templates select="document(concat($theme-prefix,
'foundry/templates/',
$template-file))"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="document(concat($theme-prefix,
'/templates/',
$template-file))"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<foundry:doc section="devel">
@ -198,7 +224,8 @@
<xsl:variable name="cond-class">
<xsl:if test="$current-layout-node/@classIf">
<!-- DE Funktioniert leider nicht in einer Zeile, daher die Hilfsvariable -->
<xsl:variable name="key" select="substring-before($current-layout-node/@classIf, ',')"/>
<xsl:variable name="key"
select="substring-before($current-layout-node/@classIf, ',')"/>
<xsl:variable name="condition">
<xsl:apply-templates select="//*[@id=$key]"/>
</xsl:variable>
@ -231,9 +258,17 @@
<xsl:value-of select="@id"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="$current-layout-node/@class or $cond-class != '' or $type-class != '' or $color-class != ''">
<xsl:if test="$current-layout-node/@class
or $cond-class != ''
or $type-class != ''
or $color-class != ''">
<xsl:attribute name="class">
<xsl:value-of select="normalize-space(concat($current-layout-node/@class, ' ', $cond-class, ' ', $type-class, ' ', $color-class))"/>
<xsl:value-of select="normalize-space(concat($current-layout-node/@class, '
', $cond-class,
' ',
$type-class,
' ',
$color-class))"/>
</xsl:attribute>
</xsl:if>
</xsl:template>

View File

@ -23,6 +23,7 @@
exclude-result-prefixes="xsl"
version="2.0">
<xsl:import href="template-tags/content-items.xsl"/>
<xsl:import href="template-tags/data-tags.xsl"/>
<xsl:import href="template-tags/foundry-doc-tags.xsl"/>
<xsl:import href="template-tags/html-tags.xsl"/>

View File

@ -0,0 +1,257 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2014 Jens Pelzetter for the LibreCCM Foundation
This file is part of the Foundry Theme Engine for LibreCCM
Foundry is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
Foundry is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Foundry If not, see <http://www.gnu.org/licenses/>.
-->
<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:nav="http://ccm.redhat.com/navigation"
xmlns:ui="http://www.arsdigita.com/ui/1.0"
exclude-result-prefixes="xsl xs bebop cms foundry nav ui"
version="2.0">
<foundry:doc section="user" type="template-tag">
<foundry:doc-desc>
<p>
This tags inserts the HTML representation of the current content item, either
as greeting item or normal item.
</p>
<p>
The HTML representation of a content item is defined using special templates
with the <code>contentitem-layout</code> element as root. Usually these templates
are located in the <code>templates/content-items</code> folder. Which template is
used for a particular content item is defined by the <code>conf/templates.xml</code>
file. In this file there is a <code>content-items</code> below the
<code>templates</code> element. The association between templates and
content items is described by the <code>content-item</code> elements in the
<code>content-items</code> element. The <code>content-item</code> has four
optional attributes (at least on must be present) which are used to limit the
content items for which a template is used. The four attributes are:
</p>
<dl>
<dt>
<code>oid</code>
</dt>
<dd>
Limit the use of the template to a specific content item, identified by its
OID (the OID of the master version). Can't be used in combination with the other
attributes.
</dd>
<dt>
<code>content-section</code>
</dt>
<dd>
The name of the content section to which the item belongs. Can be used
in combination with the <code>category</code> and <code>content-type</code>
attributes.
</dd>
<dt>
<code>category</code>
</dt>
<dd>
The template is only used for the content item if the item is viewed as
item of the category. The category is set as a path contains the names
the categories.
</dd>
<dt>
<code>content-type</code>
</dt>
<dd>
The content-type of the item.
</dd>
</dl>
<foundry:doc-see-also>
<foundry:doc-link href="#layout-templates">The template system</foundry:doc-link>
</foundry:doc-see-also>
</foundry:doc-desc>
</foundry:doc>
<xsl:template match="content-item">
<xsl:if test="$data-tree/cms:contentPanel or $data-tree/nav:greetingItem">
<xsl:variable name="contentitem-tree">
<xsl:choose>
<xsl:when test="$data-tree/nav:greetingItem">
<xsl:value-of select="$data-tree/nav:greetingItem/cms:item"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$data-tree/cms:contentPanel/cms:item"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="oid" select="$contentitem-tree/masterVersion/@oid"/>
<xsl:variable name="content-section"
select="$contentitem-tree/../cms:pathInfo/cms:sectionPath"/>
<xsl:variable name="category" select="foundry:read-current-category()"/>
<xsl:variable name="content-type" select="$contentitem-tree/object-type"/>
<xsl:variable name="template-map"
select="document($theme-prefix/conf/templates.xml)/templates/content-items"/>
<xsl:choose>
<xsl:when test="$template-map/content-item[@oid = $oid]">
<xsl:call-template name="foundry:process-contentitem-template">
<xsl:with-param name="template-file"
select="$template-map/content-item[@oid = $oid]"/>
<xsl:with-param name="contentitem-tree"
select="$contentitem-tree"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$template-map/content-item[@content-section = $content-section
and @category = $category
and @content-type = $content-type]">
<xsl:call-template name="foundry:process-contentitem-template">
<xsl:with-param name="template-file"
select="$template-map/content-item[@content-section = $content-section
and @category = $category
and @content-type = $content-type]"/>
<xsl:with-param name="contentitem-tree"
select="$contentitem-tree"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$template-map/content-item[@content-section = $content-section
and @category = $category
and not(@content-type)]">
<xsl:call-template name="foundry:process-contentitem-template">
<xsl:with-param name="template-file"
select="$template-map/content-item[@content-section = $content-section
and @category = $category
and not(@content-type)]"/>
<xsl:with-param name="contentitem-tree"
select="$contentitem-tree"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$template-map/content-item[@content-section = $content-section
and not(@category)
and @content-type = $content-type]">
<xsl:call-template name="foundry:process-contentitem-template">
<xsl:with-param name="template-file"
select="$template-map/content-item[@content-section = $content-section
and not(@category)
and @content-type = $content-type]"/>
<xsl:with-param name="contentitem-tree"
select="$contentitem-tree"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$template-map/content-item[@content-section = $content-section
and not(@category)
and not(@content-type)]">
<xsl:call-template name="foundry:process-contentitem-template">
<xsl:with-param name="template-file"
select="$template-map/content-item[@content-section = $content-section
and not(@category)
and not(@content-type)]"/>
<xsl:with-param name="contentitem-tree"
select="$contentitem-tree"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$template-map/content-item[not(@content-section)
and @category = $category
and @content-type = $content-type]">
<xsl:call-template name="foundry:process-contentitem-template">
<xsl:with-param name="template-file"
select="$template-map/content-item[not(@content-section)
and @category = $category
and @content-type = $content-type]"/>
<xsl:with-param name="contentitem-tree"
select="$contentitem-tree"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$template-map/content-item[not(@content-section)
and @category = $category
and not(@content-type)]">
<xsl:call-template name="foundry:process-contentitem-template">
<xsl:with-param name="template-file"
select="$template-map/content-item[not(@content-section)
and @category = $category
and not(@content-type)]"/>
<xsl:with-param name="contentitem-tree"
select="$contentitem-tree"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$template-map/content-item[not(@content-section)
and not(@category)
and @content-type = $content-type]">
<xsl:call-template name="foundry:process-contentitem-template">
<xsl:with-param name="template-file"
select="$template-map/content-item[not(@content-section)
and not(@category)
and @content-type = $content-type]"/>
<xsl:with-param name="contentitem-tree"
select="$contentitem-tree"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="$template-map/default">
<xsl:call-template name="foundry:process-contentitem-template">
<xsl:with-param name="template-file"
select="'contentitem-default.xml'"/>
<xsl:with-param name="contentitem-tree"
select="$contentitem-tree"/>
<xsl:with-param name="internal" select="true()"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:template>
<xsl:template name="foundry:process-contentitem-template">
<xsl:param name="template-file" as="xs:string"/>
<xsl:param name="internal" as="xs:boolean" select="false()"/>
<xsl:param name="contentitem-tree"/>
<xsl:choose>
<xsl:when test="$internal = true()">
<xsl:apply-templates select="document(concat($theme-prefix,
'foundry/templates/',
$template-file))">
<xsl:with-param name="contentitem-tree"
tunnel="yes"
select="$contentitem-tree"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="document(concat($theme-prefix,
'/templates/',
$template-file))">
<xsl:with-param name="contentitem-tree"
tunnel="yes"
select="$contentitem-tree"/>
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>

View File

@ -24,6 +24,9 @@
exclude-result-prefixes="xsl foundry"
version="2.0">
<xsl:template match="content-item">
</xsl:template>
<foundry:doc section="user"
type="template-tag">
<foundry:doc-desc>

View File

@ -86,7 +86,11 @@
</xsl:template>
<xsl:template match="doc-chapter-layout">
<xsl:apply-templates/>
<xsl:param name="chapter-id" tunnel="yes"/>
<xsl:apply-templates>
<xsl:with-param name="article-id" select="$chapter-id"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="doc-chapter-id">
@ -111,7 +115,11 @@
</xsl:template>
<xsl:template match="doc-section-layout">
<xsl:apply-templates/>
<xsl:param name="section-id" tunnel="yes"/>
<xsl:apply-templates>
<xsl:with-param name="section-id" select="$section-id"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="doc-section-id">
@ -169,6 +177,123 @@
</xsl:apply-templates>
</xsl:template>
<xsl:template match="foundry:doc[@type='function']" mode="doc">
<xsl:apply-templates select="document(concat($theme-prefix, '/foundry/templates/doc/function-layout.xml'))">
<xsl:with-param name="function-name"
tunnel="yes"
select="./following::xsl:function[1]/@name"/>
<xsl:with-param name="result"
tunnel="yes"
select="./foundry:doc-result"/>
<xsl:with-param name="doc-desc" tunnel="yes" select="./foundry:doc-desc"/>
<xsl:with-param name="doc-params" tunnel="yes" select="./foundry:doc-params"/>
<xsl:with-param name="doc-see-also" tunnel="yes" select="./foundry-doc-see-also"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="doc-function-layout">
<xsl:param name="function-name" tunnel="yes"/>
<xsl:apply-templates>
<xsl:with-param name="section-id" select="$function-name"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="doc-function-name">
<xsl:param name="function-name" tunnel="yes"/>
<xsl:value-of select="$function-name"/>
</xsl:template>
<xsl:template match="doc-function-desc">
<xsl:param name="doc-desc" tunnel="yes"/>
<xsl:copy-of select="$doc-desc"/>
</xsl:template>
<xsl:template match="doc-function-params">
<xsl:param name="doc-params" tunnel="yes"/>
<xsl:if test="$doc-params">
<xsl:apply-templates/>
</xsl:if>
</xsl:template>
<xsl:template match="doc-function-param">
<xsl:param name="doc-params" tunnel="yes"/>
<xsl:variable name="doc-function-param-layout" select="current()"/>
<xsl:for-each select="$doc-params/foundry:doc-param">
<xsl:apply-templates select="$doc-function-param-layout/*">
<xsl:with-param name="param-name" tunnel="yes" select="./@name"/>
<xsl:with-param name="param-type" tunnel="yes">
<xsl:choose>
<xsl:when test="./@type">
<xsl:value-of select="./@type"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="'any'"/>
</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
<xsl:with-param name="param-mandatory" tunnel="yes" select="./@mandatory"/>
<xsl:with-param name="param-desc" tunnel="yes" select="./*"/>
</xsl:apply-templates>
</xsl:for-each>
</xsl:template>
<xsl:template match="doc-function-param-name">
<xsl:param name="param-name" tunnel="yes"/>
<xsl:value-of select="$param-name"/>
</xsl:template>
<xsl:template match="doc-function-param-type">
<xsl:param name="param-type" tunnel="yes"/>
<xsl:value-of select="$param-type"/>
</xsl:template>
<xsl:template match="doc-function-param-mandatory">
<xsl:param name="param-mandatory" tunnel="yes"/>
<xsl:value-of select="$param-mandatory"/>
</xsl:template>
<xsl:template match="doc-function-param-desc">
<xsl:param name="param-desc" tunnel="yes"/>
<xsl:copy-of select="$param-desc"/>
</xsl:template>
<xsl:template match="doc-function-result-type">
<xsl:param name="result" tunnel="yes"/>
<xsl:choose>
<xsl:when test="$result/@type">
<xsl:value-of select="$result/@type"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="'any'"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="doc-function-result-desc">
<xsl:param name="result" tunnel="yes"/>
<xsl:copy-of select="$result/*"/>
</xsl:template>
<xsl:template match="foundry:doc[@type='function-template']" mode="doc">
</xsl:template>
<xsl:template match="foundry:doc[@type='global-var']" mode="doc">
</xsl:template>
<xsl:template match="foundry:doc[@type='template-tag']" mode="doc">
<xsl:apply-templates select="document(concat($theme-prefix, '/foundry/templates/doc/template-tag-layout.xml'))">
<xsl:with-param name="matches"
@ -233,28 +358,37 @@
<xsl:copy-of select="$attribute-desc"/>
</xsl:template>
<xsl:template match="doc-template-tag-see-also">
<xsl:template match="doc-see-also-link-list">
<xsl:param name="doc-see-also" tunnel="yes"/>
<xsl:if test="$doc-see-also">
<xsl:if test="$doc-see-also">
<xsl:apply-templates/>
</xsl:if>
</xsl:template>
<xsl:template match="doc-template-tag-see-also-link">
<xsl:template match="doc-see-also-link">
<xsl:param name="doc-see-also" tunnel="yes"/>
<xsl:variable name="doc-template-tag-see-also-layout" select="current()"/>
<xsl:variable name="doc-see-also-layout" select="current()"/>
<xsl:for-each select="$doc-see-also/foundry:doc-link">
<xsl:apply-templates select="$doc-template-tag-see-also-layout/*">
<xsl:apply-templates select="$doc-see-also-layout/*">
<xsl:with-param name="href" tunnel="yes" select="./@href"/>
<xsl:with-param name="title" tunnel="yes" select="./@href"/>
<xsl:with-param name="title" tunnel="yes">
<xsl:choose>
<xsl:when test="string-length(current()) &gt; 0">
<xsl:value-of select="current()"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="./@href"/>
</xsl:otherwise>
</xsl:choose>
</xsl:with-param>
</xsl:apply-templates>
</xsl:for-each>
</xsl:template>
<xsl:template match="doc-template-tag-see-also-link-title">
<xsl:template match="doc-see-also-link-title">
<xsl:param name="title" tunnel="yes"/>
<xsl:value-of select="$title"/>

View File

@ -73,7 +73,7 @@
A static URL for the link.
</p>
</foundry:doc-attribute>
<foundry:doc-attribute name="href-lang">
<foundry:doc-attribute name="href-lang">
<p>
The language of the target of the link.
</p>
@ -173,7 +173,7 @@
<article>
<xsl:call-template name="foundry:set-id-and-class">
<xsl:with-param name="id" select="article-id"/>
<xsl:with-param name="id" select="$article-id"/>
</xsl:call-template>
<xsl:apply-templates/>
</article>
@ -657,6 +657,20 @@
</span>
</xsl:template>
<xsl:template match="table">
<table>
<xsl:call-template name="foundry:set-id-and-class"/>
<xsl:apply-templates/>
</table>
</xsl:template>
<xsl:template match="tbody">
<tbody>
<xsl:call-template name="foundry:set-id-and-class"/>
<xsl:apply-templates/>
</tbody>
</xsl:template>
<foundry:doc section="user" type="template-tag">
<foundry:doc-desc>
<p>
@ -699,6 +713,34 @@
</title>
</xsl:template>
<xsl:template match="td">
<td>
<xsl:call-template name="foundry:set-id-and-class"/>
<xsl:apply-templates/>
</td>
</xsl:template>
<xsl:template match="th">
<th>
<xsl:call-template name="foundry:set-id-and-class"/>
<xsl:apply-templates/>
</th>
</xsl:template>
<xsl:template match="thead">
<thead>
<xsl:call-template name="foundry:set-id-and-class"/>
<xsl:apply-templates/>
</thead>
</xsl:template>
<xsl:template match="tr">
<td>
<xsl:call-template name="foundry:set-id-and-class"/>
<xsl:apply-templates/>
</td>
</xsl:template>
<xsl:template match="ul">
<ul>
<xsl:call-template name="foundry:set-id-and-class"/>

View File

@ -35,22 +35,31 @@ XSLT 2.0 functions.
version="2.0">
<foundry:doc section="devel">
<foundry:doc-param name="value" mandatory="yes">
The value to evaluate.
</foundry:doc-param>
<foundry:doc section="devel" type="function">
<foundry:doc-params>
<foundry:doc-param name="value" mandatory="yes" type="string">
<p>
The value to evaluate.
</p>
</foundry:doc-param>
</foundry:doc-params>
<foundry:doc-result type="boolean">
<p>
The evaluated boolean value.
</p>
</foundry:doc-result>
<foundry:doc-desc>
<p>
A helper function for evaluating certain string values to boolean. This function has two
A helper function for evaluating certain string values to boolean. This function has
two purposes. First it simplifies some expressions. for example if you have a
template tag with a attribute containing a (pseudo) boolean value (attribute values
are always treated as strings) you would have to write something like:
</p>
<pre>
...
<xsl:if test="./@attr = 'true'">
...
</xsl:if>
&lt;xsl:if test="./@attr = 'true'"&gt;
...
&lt;/xsl:if&gt;
...
</pre>
<p>
@ -58,9 +67,9 @@ XSLT 2.0 functions.
</p>
<pre>
...
<xsl:if test="foundry:boolean(./@attr)">
...
</xsl:if>
&lt;xsl:if test="foundry:boolean(./@attr)"&gt;
...
&lt;/xsl:if&gt;
...
</pre>
<p>
@ -120,19 +129,30 @@ XSLT 2.0 functions.
</xsl:function>
<foundry:doc section="devel">
<foundry:doc-param name="level"
mandatory="yes">
The level of the message, indicating its severity
</foundry:doc-param>
<foundry:doc-param name="message"
mandatory="yes">
The message text.
</foundry:doc-param>
<foundry:doc section="devel" type="function">
<foundry:doc-params>
<foundry:doc-param name="level"
mandatory="yes"
type="string">
The level of the message, indicating its severity
</foundry:doc-param>
<foundry:doc-param name="message"
mandatory="yes"
type="string">
The message text.
</foundry:doc-param>
</foundry:doc-params>
<foundry:doc-result type="xs:string">
<p>
A message string of the for <code>[Foundry $level] $message</code> with
<code>$level</code> and <code>$message</code> replaced by the values of the
parameters.
</p>
</foundry:doc-result>
<foundry:doc-desc>
<p>
A helper function used by the other message functions like
<code>foundry:message-warn</code>. Concats the message level with the message.
<code>foundry:message-warn</code>. Concatenates the message level with the message.
</p>
<p>
This function should not be used directly. Use the other message functions instead.
@ -155,11 +175,14 @@ XSLT 2.0 functions.
<xsl:sequence select="concat('[Foundry ', $level, '] ', $message)"/>
</xsl:function>
<foundry:doc section="devel">
<foundry:doc-param name="message"
mandatory="yes">
The message text.
</foundry:doc-param>
<foundry:doc section="devel" type="function">
<foundry:doc-params>
<foundry:doc-param name="message"
mandatory="yes"
type="string">
The message text.
</foundry:doc-param>
</foundry:doc-params>
<foundry:doc-desc>
<p>
Helper function to generate an info message. This function be used together with
@ -185,11 +208,13 @@ XSLT 2.0 functions.
<xsl:sequence select="foundry:message('INFO', $message)"/>
</xsl:function>
<foundry:doc section="devel">
<foundry:doc-param name="message"
mandatory="yes">
The message text.
</foundry:doc-param>
<foundry:doc section="devel" type="function">
<foundry:doc-params>
<foundry:doc-param name="message"
mandatory="yes">
The message text.
</foundry:doc-param>
</foundry:doc-params>
<foundry:doc-desc>
<p>
Helper function to generate an info message. This function be used together with
@ -218,10 +243,12 @@ XSLT 2.0 functions.
</xsl:function>
<foundry:doc section="devel">
<foundry:doc-param name="message"
mandatory="yes">
The message text.
</foundry:doc-param>
<foundry:doc-params>
<foundry:doc-param name="message"
mandatory="yes">
The message text.
</foundry:doc-param>
</foundry:doc-params>
<foundry:doc-desc>
<p>
Helper function to generate an info message. This function be used together with
@ -234,6 +261,7 @@ XSLT 2.0 functions.
&lt;xsl:message&gt;
&lt;xsl:message select="foundry:message-info('Some error has occurred...')" /&gt;
&lt;/xsl:message&gt;
...
</pre>
</foundry:doc-desc>
<foundry:doc-see-also>
@ -250,25 +278,28 @@ XSLT 2.0 functions.
</xsl:function>
<foundry:doc section="devel">
<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">
The default value if the attribute is not set.
</foundry:doc-param>
<foundry:doc-params>
<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">
The default value if the attribute is not set.
</foundry:doc-param>
</foundry:doc-params>
<foundry:doc-result>
The value of the attribute if it is set on the current element, the
<code>default-value</code> otherwise.
</foundry:doc-result>
<foundry:doc-desc>
<p>
A helper function for retrieving an attribute value from an element. If the attribute is
set on the current element the value of the attribute is used as result. If the
attribute is not set the <code>default-value</code> is used. This method is used
by several layout tags with optional attributes. A common use pattern looks like this:
A helper function for retrieving an attribute value from an element. If the
attribute is set on the current element the value of the attribute is used as
result. If the attribute is not set the <code>default-value</code> is used. This
method is used by several layout tags with optional attributes. A common use pattern
looks like this:
</p>
<pre>
&lt;xsl:template match="example"&gt;
@ -301,7 +332,6 @@ XSLT 2.0 functions.
<xsl:sequence select="$default-value"/>
</xsl:otherwise>
</xsl:choose>
</xsl:function>
<xsl:function name="foundry:get-setting" as="xs:string">
@ -320,32 +350,34 @@ XSLT 2.0 functions.
</xsl:function>
<foundry:doc section="devel">
<foundry:doc-param name="module"
mandatory="yes">
<p>
The module of the settings. At the moment this corresponds to the name of the file
in the <code>conf</code> directory. The empty string as value corresponds to the
<code>global.xml</code> file.
</p>
</foundry:doc-param>
<foundry:doc-param name="setting"
mandatory="yes">
<p>
The name of the setting to retrieve.
</p>
</foundry:doc-param>
<foundry:doc-param name="default"
mandatory="no">
<p>
The value to use if there is no entry for the setting in the settings file.
</p>
</foundry:doc-param>
<foundry:doc-param name="node"
mandatory="no">
<p>
A node from the layout template which overrides the value from the configuration.
</p>
</foundry:doc-param>
<foundry:doc-params>
<foundry:doc-param name="module"
mandatory="yes">
<p>
The module of the settings. At the moment this corresponds to the name of the file
in the <code>conf</code> directory. The empty string as value corresponds to the
<code>global.xml</code> file.
</p>
</foundry:doc-param>
<foundry:doc-param name="setting"
mandatory="yes">
<p>
The name of the setting to retrieve.
</p>
</foundry:doc-param>
<foundry:doc-param name="default"
mandatory="no">
<p>
The value to use if there is no entry for the setting in the settings file.
</p>
</foundry:doc-param>
<foundry:doc-param name="node"
mandatory="no">
<p>
A node from the layout template which overrides the value from the configuration.
</p>
</foundry:doc-param>
</foundry:doc-params>
<foundry:doc-result>
The value of the requested setting or if no value has been set the provided default
value. If no default value has been provided the result is an empty string.
@ -410,25 +442,27 @@ XSLT 2.0 functions.
</xsl:function>
<foundry:doc section="devel">
<foundry:doc-param name="module"
mandatory="yes">
<p>
he module of the settings. At the moment this corresponds to the name of the file
in the <code>texts</code> directory. The empty string as value corresponds to the
<code>global.xml</code> file.
</p>
</foundry:doc-param>
<foundry:doc-param name="id"
mandatory="yes">
The name of the text to retrieve.
</foundry:doc-param>
<foundry:doc-param name="lang"
mandatory="no">
<p>
The language to retrieve. Normally there is no need to set this parameter because
it is determined automatically.
</p>
</foundry:doc-param>
<foundry:doc-params>
<foundry:doc-param name="module"
mandatory="yes">
<p>
he module of the settings. At the moment this corresponds to the name of the file
in the <code>texts</code> directory. The empty string as value corresponds to the
<code>global.xml</code> file.
</p>
</foundry:doc-param>
<foundry:doc-param name="id"
mandatory="yes">
The name of the text to retrieve.
</foundry:doc-param>
<foundry:doc-param name="lang"
mandatory="no">
<p>
The language to retrieve. Normally there is no need to set this parameter because
it is determined automatically.
</p>
</foundry:doc-param>
</foundry:doc-params>
<foundry:doc-result>
The requested static text. If there is no value for the requested static text in the
module provided by the module parameter the value depends if the debug mode is
@ -477,21 +511,21 @@ XSLT 2.0 functions.
<xsl:message>
<xsl:value-of select="'Otherwise w/ html'"/>
</xsl:message>
<span class="foundry-debug-missing-translation">
<span class="foundry-placeholder">
<xsl:value-of 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:when>
<xsl:otherwise>
<xsl:value-of select="document(concat($theme-prefix, '/texts/', $module, '.xml'))/foundry:static-texts/text[@id=$id]/translation[@lang=$lang]"/>
</xsl:otherwise>
</xsl:choose>
</span>
<span class="foundry-debug-missing-translation">
<span class="foundry-placeholder">
<xsl:value-of 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:when>
<xsl:otherwise>
<xsl:value-of 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>
@ -554,6 +588,17 @@ XSLT 2.0 functions.
</xsl:if>
</xsl:template>
<foundry:doc section="devel">
<xsl:doc-desc>
A helper function for reading the current category from the <code>datatree</code>. The
function joins the titles of all categories in <code>nav:categoryPath</code> to a
string. The tokens a separated by a slash (<code>/</code>).
</xsl:doc-desc>
</foundry:doc>
<xsl:function name="foundry:read-current-category">
<xsl:sequence select="string-join($data-tree/nav:categoryPath/@title, '/')"/>
</xsl:function>
<xsl:function name="foundry:shying" as="xs:string">
<xsl:param name="text" as="xs:string"/>
@ -567,7 +612,6 @@ XSLT 2.0 functions.
<xsl:sequence select="translate($text, '\-', '&shy;')"/>
</xsl:function>
<xsl:function name="foundry:title" as="xs:string">
<xsl:choose>
<!-- Use fixed title for some special content items -->

View File

@ -50,23 +50,46 @@
<xsl:variable name="class" select="@class" />
<xsl:choose>
<xsl:when test="document(concat($theme-prefix, '/conf/templates.xml'))/applications/application[@name=$application and @class=$class]">
<xsl:when test="document(concat($theme-prefix, '/conf/templates.xml'))/templates/applications/application[@name=$application and @class=$class]">
<xsl:message>
<xsl:value-of select="foundry:message-info('Using application template')"/>
</xsl:message>
<xsl:call-template name="foundry:process-template">
<xsl:with-param name="template-file"
select="document(concat($theme-prefix, '/conf/templates.xml'))/applications/application[@name=$application and @class=$class]"/>
select="document(concat($theme-prefix, '/conf/templates.xml'))/templates/applications/application[@name=$application and @class=$class]"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="document(concat($theme-prefix, '/conf/templates.xml'))/templates/applications/application[@name=$application and not(@class)]">
<xsl:message>
<xsl:value-of select="foundry:message-info('Using application template')"/>
</xsl:message>
<xsl:call-template name="foundry:process-template">
<xsl:with-param name="template-file"
select="document(concat($theme-prefix, '/conf/templates.xml'))/applications/application[@name=$application and not(@class)]"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:message>
<xsl:value-of select="foundry:message-info('Using default layout')"/>
</xsl:message>
<xsl:call-template name="foundry:process-template">
<xsl:with-param name="template-file"
select="document(concat($theme-prefix, '/conf/templates.xml'))/applications/default"/>
</xsl:call-template>
<xsl:choose>
<xsl:when test="document(concat($theme-prefix, '/conf/templates.xml'))/applications/default">
<xsl:call-template name="foundry:process-template">
<xsl:with-param name="template-file"
select="document(concat($theme-prefix, '/conf/templates.xml'))/applications/default"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:message>
<xsl:value-of select="foundry:message-info('No default application layout configured, using internal default.')"/>
</xsl:message>
<xsl:call-template name="foundry:process-template">
<xsl:with-param name="template-file"
select="'default-layout.xml'"/>
<xsl:with-param name="internal" select="true()"/>
</xsl:call-template>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>

View File

@ -0,0 +1,71 @@
<?xml version="1.0" encoding="utf-8"?>
<doc-function-layout>
<section class="function">
<h1>
Function <code><doc-function-name/></code>
</h1>
<div>
<doc-function-desc/>
</div>
<doc-function-params>
<h2>Parameters</h2>
<table>
<thead>
<tr>
<th>Name</th>
<th>Mandatory</th>
<th>Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<doc-function-param>
<tr>
<td>
<doc-function-param-name/>
</td>
<td>
<doc-function-param-mandatory/>
</td>
<td>
<code><doc-function-param-type/></code>
</td>
<td>
<doc-function-param-desc/>
</td>
</tr>
</doc-function-param>
</tbody>
</table>
</doc-function-params>
<div>
<h2>Result</h2>
<h3>Result type</h3>
<p>
<code><doc-function-result-type/></code>
</p>
<h3>Description</h3>
<div>
<doc-function-result-desc/>
</div>
</div>
<doc-see-also-link-list>
<div>
<h2>See also</h2>
<ul>
<doc-see-also-link>
<li>
<a>
<doc-see-also-link-title/>
</a>
</li>
</doc-see-also-link>
</ul>
</div>
</doc-see-also-link-list>
</section>
</doc-function-layout>

View File

@ -10,31 +10,35 @@
</div>
<doc-template-tag-attributes>
<h2>Attributes</h2>
<dl>
<doc-template-tag-attribute>
<dt>
<doc-template-tag-attribute-name/>
</dt>
<dd>
<doc-template-tag-attribute-desc/>
</dd>
</doc-template-tag-attribute>
</dl>
<div>
<h2>Attributes</h2>
<dl>
<doc-template-tag-attribute>
<dt>
<doc-template-tag-attribute-name/>
</dt>
<dd>
<doc-template-tag-attribute-desc/>
</dd>
</doc-template-tag-attribute>
</dl>
</div>
</doc-template-tag-attributes>
<doc-template-tag-see-also-link-list>
<h2>See also</h2>
<ul>
<doc-template-tag-see-also-link>
<li>
<a>
<doc-template-tag-see-also-link-title/>
</a>
</li>
</doc-template-tag-see-also-link>
</ul>
</doc-template-tag-see-also-link-list>
<doc-see-also-link-list>
<div>
<h2>See also</h2>
<ul>
<doc-see-also-link>
<li>
<a>
<doc-see-also-link-title/>
</a>
</li>
</doc-see-also-link>
</ul>
</div>
</doc-see-also-link-list>
</section>
</doc-template-tag-layout>