Some extensions for Foundry:

- An element with the "with-colorset" attribute will now get two classes: The numbered colorset class (colorset-1, colorset-2 etc)
  *and* a named colorset class (colorset-$name, where $name is the name of currently selected category)
- New attribute "with-application-class" which adds the name of current application to the classes of the element. The class
  has the form "application-$applicationname" where $applicationname is the name of current application as provided in the
  XML from CCM
- New attribute "with-path-classes". If this attribute is set to "yes" a class of the form path-$category-names" is added for each
  catgory in the path. $category-names is a string concatenated from the names of the categories in the path.



git-svn-id: https://svn.libreccm.org/ccm/trunk@4127 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2016-06-01 11:23:17 +00:00
parent 1320957bfc
commit 7a22894ce7
1 changed files with 196 additions and 132 deletions

View File

@ -4,9 +4,9 @@
<!ENTITY ndash '&#8211;'>]> <!ENTITY ndash '&#8211;'>]>
<!-- <!--
Copyright 2014 Jens Pelzetter for the LibreCCM Foundation Copyright 2014 Jens Pelzetter for the LibreCCM Foundation
This file is part of the Foundry Theme Engine for LibreCCM This file is part of the Foundry Theme Engine for LibreCCM
Foundry is free software: you can redistribute it and/or modify Foundry is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or the Free Software Foundation, either version 2 of the License, or
@ -41,7 +41,7 @@
</p> </p>
</foundry:doc-file-desc> </foundry:doc-file-desc>
</foundry:doc-file> </foundry:doc-file>
<foundry:doc section="user" type="template-tag"> <foundry:doc section="user" type="template-tag">
<foundry:doc-desc> <foundry:doc-desc>
<p> <p>
@ -57,16 +57,16 @@
</xsl:attribute> </xsl:attribute>
<xsl:attribute name="id"> <xsl:attribute name="id">
<xsl:choose> <xsl:choose>
<xsl:when test="@application = 'admin' <xsl:when test="@application = 'admin'
or @application = 'content-center' or @application = 'content-center'
or @application = 'content-section' or @application = 'content-section'
or @application = 'theme' or @application = 'theme'
or @application = 'shortcuts' or @application = 'shortcuts'
or @application = 'subsite' or @application = 'subsite'
or @application = 'terms' or @application = 'terms'
or @application = 'atoz' or @application = 'atoz'
or @application = 'ds' or @application = 'ds'
or @class = 'cms-admin' or @class = 'cms-admin'
or @class = 'admin'"> or @class = 'admin'">
<xsl:text>cms</xsl:text> <xsl:text>cms</xsl:text>
</xsl:when> </xsl:when>
@ -78,18 +78,18 @@
<xsl:apply-templates/> <xsl:apply-templates/>
</html> </html>
</xsl:template> </xsl:template>
<foundry:doc section="user" type="template-tag"> <foundry:doc section="user" type="template-tag">
<foundry:doc-desc> <foundry:doc-desc>
<p> <p>
Root element of an extending template. The <code>extends</code> Root element of an extending template. The <code>extends</code>
attribute is required and points to the template which is attribute is required and points to the template which is
extended by the layout. Only the <code>block</code> elements extended by the layout. Only the <code>block</code> elements
in the layout are processed. The master layout must contain in the layout are processed. The master layout must contain
matching <code>insert-block</code> elements. matching <code>insert-block</code> elements.
</p> </p>
<p> <p>
Technically the master template is processed first and the Technically the master template is processed first and the
extending layout is passed as parameter. The master layout extending layout is passed as parameter. The master layout
</p> </p>
</foundry:doc-desc> </foundry:doc-desc>
@ -104,7 +104,7 @@
</xsl:with-param> </xsl:with-param>
</xsl:apply-templates> </xsl:apply-templates>
</xsl:template> </xsl:template>
<foundry:doc type="template-tag" section="user"> <foundry:doc type="template-tag" section="user">
<foundry:doc-desc> <foundry:doc-desc>
<p> <p>
@ -115,12 +115,12 @@
</foundry:doc> </foundry:doc>
<xsl:template match="insert-block"> <xsl:template match="insert-block">
<xsl:param name="extending-layout" tunnel="yes"/> <xsl:param name="extending-layout" tunnel="yes"/>
<xsl:variable name="block-name" select="./@name"/> <xsl:variable name="block-name" select="./@name"/>
<xsl:apply-templates select="$extending-layout/block[./@name = $block-name]"/> <xsl:apply-templates select="$extending-layout/block[./@name = $block-name]"/>
</xsl:template> </xsl:template>
<foundry:doc section="user" type="template-tag"> <foundry:doc section="user" type="template-tag">
<foundry:doc-desc> <foundry:doc-desc>
<p> <p>
@ -129,29 +129,29 @@
</foundry:doc-desc> </foundry:doc-desc>
</foundry:doc> </foundry:doc>
<xsl:template match="fragment-layout"> <xsl:template match="fragment-layout">
<xsl:apply-templates/> <xsl:apply-templates/>
</xsl:template> </xsl:template>
<foundry:doc section="user" type="template-tag"> <foundry:doc section="user" type="template-tag">
<foundry:doc-desc> <foundry:doc-desc>
<p> <p>
This element allows it to include template fragments into a template. The element This element allows it to include template fragments into a template. The element
has two attributes. The <code>file</code> attribute is mandatory and contains has two attributes. The <code>file</code> attribute is mandatory and contains
the path the fragment to include, relative to the <code>template</code> directory. the path the fragment to include, relative to the <code>template</code> directory.
The <code>internal</code> attribute is optional. If set to <code>true</code> the The <code>internal</code> attribute is optional. If set to <code>true</code> the
fragment is loaded from the internal template directory. fragment is loaded from the internal template directory.
</p> </p>
<p> <p>
For example <code>&lt;include file="fragments/footer.xml"&lt;</code> will include For example <code>&lt;include file="fragments/footer.xml"&lt;</code> will include
the file <code>templates/fragments/footer.xml</code>. If the <code>internal</code> the file <code>templates/fragments/footer.xml</code>. If the <code>internal</code>
attribute is set to <code>true</code> the file attribute is set to <code>true</code> the file
<code>foundry/templates/fragments/footer.xml</code> would be included. <code>foundry/templates/fragments/footer.xml</code> would be included.
</p> </p>
<p> <p>
An fragment template file included using this element using this element must An fragment template file included using this element using this element must
contain a <code>fragment-layout</code> element as root. contain a <code>fragment-layout</code> element as root.
</p> </p>
</foundry:doc-desc> </foundry:doc-desc>
<foundry:doc-attributes> <foundry:doc-attributes>
@ -162,25 +162,25 @@
</foundry:doc-attribute> </foundry:doc-attribute>
<foundry:doc-attribute name="internal"> <foundry:doc-attribute name="internal">
<p> <p>
If set to <code>true</code> the template fragment file is loaded from the If set to <code>true</code> the template fragment file is loaded from the
internal template directory. internal template directory.
</p> </p>
</foundry:doc-attribute> </foundry:doc-attribute>
</foundry:doc-attributes> </foundry:doc-attributes>
</foundry:doc> </foundry:doc>
<xsl:template match="include"> <xsl:template match="include">
<xsl:variable name="origin" as="xs:string" <xsl:variable name="origin" as="xs:string"
select="foundry:get-attribute-value(current(), 'origin', '')"/> select="foundry:get-attribute-value(current(), 'origin', '')"/>
<xsl:apply-templates select="document(foundry:gen-path(concat('templates/', <xsl:apply-templates select="document(foundry:gen-path(concat('templates/',
./@file), ./@file),
$origin))/fragment-layout"/> $origin))/fragment-layout"/>
</xsl:template> </xsl:template>
<!-- <!--
======================================================== ========================================================
Common helper templates/functions for all templates tags Common helper templates/functions for all templates tags
--> -->
@ -193,7 +193,7 @@
</foundry:doc-param> </foundry:doc-param>
<foundry:doc-param name="attributes"> <foundry:doc-param name="attributes">
<p> <p>
The attributes to copy separated by an empty space. For example: The attributes to copy separated by an empty space. For example:
<code>autofocus disabled form formaction formenctype formmethod formnovalidate formtarget name type value</code>. <code>autofocus disabled form formaction formenctype formmethod formnovalidate formtarget name type value</code>.
</p> </p>
</foundry:doc-param> </foundry:doc-param>
@ -206,7 +206,7 @@
<xsl:template name="foundry:copy-attributes"> <xsl:template name="foundry:copy-attributes">
<xsl:param name="current-layout-node" select="current()"/> <xsl:param name="current-layout-node" select="current()"/>
<xsl:param name="attributes" select="''"/> <xsl:param name="attributes" select="''"/>
<xsl:for-each select="tokenize($attributes, ' ')"> <xsl:for-each select="tokenize($attributes, ' ')">
<xsl:copy-of select="$current-layout-node/@*[name() = current()]"/> <xsl:copy-of select="$current-layout-node/@*[name() = current()]"/>
</xsl:for-each> </xsl:for-each>
@ -228,7 +228,7 @@
</foundry:doc> </foundry:doc>
<xsl:template name="foundry:copy-data-attributes"> <xsl:template name="foundry:copy-data-attributes">
<xsl:param name="current-layout-node" select="current()"/> <xsl:param name="current-layout-node" select="current()"/>
<xsl:copy-of select="$current-layout-node/@*[starts-with(name(), 'data-')]"/> <xsl:copy-of select="$current-layout-node/@*[starts-with(name(), 'data-')]"/>
</xsl:template> </xsl:template>
@ -242,7 +242,7 @@
</foundry:doc> </foundry:doc>
<xsl:function name="foundry:gen-src-url"> <xsl:function name="foundry:gen-src-url">
<xsl:param name="src-raw" as="xs:string"/> <xsl:param name="src-raw" as="xs:string"/>
<xsl:sequence select="foundry:gen-src-url($src-raw, '')"/> <xsl:sequence select="foundry:gen-src-url($src-raw, '')"/>
</xsl:function> </xsl:function>
@ -266,8 +266,8 @@
</foundry:doc-result> </foundry:doc-result>
<foundry:doc-desc> <foundry:doc-desc>
<p> <p>
Processes a given URL for use in the <code>src</code> attribute of an Processes a given URL for use in the <code>src</code> attribute of an
<code>audio</code>, <code>img</code> or <code>video</code> element. The function <code>audio</code>, <code>img</code> or <code>video</code> element. The function
distigushes between this cases: distigushes between this cases:
</p> </p>
<dl> <dl>
@ -280,26 +280,26 @@
<dt>The URL starts with a slash (<code>/</code>)</dt> <dt>The URL starts with a slash (<code>/</code>)</dt>
<dd> <dd>
In this case the URL points to a resource managed by the CCM which also In this case the URL points to a resource managed by the CCM which also
manages the theme. In this case the URL is prefixed with the manages the theme. In this case the URL is prefixed with the
<code>dispatcher-prefix</code> and the parameters, if any, are appended. <code>dispatcher-prefix</code> and the parameters, if any, are appended.
</dd> </dd>
<dt>Other cases</dt> <dt>Other cases</dt>
<dd> <dd>
If none of the two other cases match the URL points to a URL in the theme. In If none of the two other cases match the URL points to a URL in the theme. In
this case the URL is processed by the this case the URL is processed by the
<a href="#gen-path"> <a href="#gen-path">
<code>gen-path</code> <code>gen-path</code>
</a> function. The parameters, if any </a> function. The parameters, if any
are appended. are appended.
</dd> </dd>
</dl> </dl>
<p> <p>
If parameters are passed to this function they are appended to the URL. The If parameters are passed to this function they are appended to the URL. The
parameters are passed as string formatted as URL parameters, for example parameters are passed as string formatted as URL parameters, for example
<code>foo=hello&amp;bar=world</code>. A leading <code>?</code> or <code>&amp;</code> <code>foo=hello&amp;bar=world</code>. A leading <code>?</code> or <code>&amp;</code>
is removed before adding the string the URL. If the URL already contains parameters is removed before adding the string the URL. If the URL already contains parameters
(if the URL contains a <code>?</code>) the paramters string is added with a leading (if the URL contains a <code>?</code>) the paramters string is added with a leading
ampersand (<code>&amp;</code>). If not the parameters are appended using a ampersand (<code>&amp;</code>). If not the parameters are appended using a
<code>?</code> character. <code>?</code> character.
</p> </p>
</foundry:doc-desc> </foundry:doc-desc>
@ -307,10 +307,10 @@
<xsl:function name="foundry:gen-src-url"> <xsl:function name="foundry:gen-src-url">
<xsl:param name="src-raw" as="xs:string"/> <xsl:param name="src-raw" as="xs:string"/>
<xsl:param name="parameters" as="xs:string"/> <xsl:param name="parameters" as="xs:string"/>
<xsl:variable name="src-url"> <xsl:variable name="src-url">
<xsl:choose> <xsl:choose>
<xsl:when test="starts-with($src-raw, 'http://') <xsl:when test="starts-with($src-raw, 'http://')
or starts-with($src-raw, 'https://')"> or starts-with($src-raw, 'https://')">
<xsl:value-of select="$src-raw"/> <xsl:value-of select="$src-raw"/>
</xsl:when> </xsl:when>
@ -322,7 +322,7 @@
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:variable> </xsl:variable>
<xsl:variable name="parameters-string"> <xsl:variable name="parameters-string">
<xsl:choose> <xsl:choose>
<xsl:when test="starts-with($parameters, '?') or starts-with($parameters, '&amp;')"> <xsl:when test="starts-with($parameters, '?') or starts-with($parameters, '&amp;')">
@ -333,7 +333,7 @@
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:variable> </xsl:variable>
<xsl:choose> <xsl:choose>
<xsl:when test="string-length($parameters-string) &gt; 0"> <xsl:when test="string-length($parameters-string) &gt; 0">
<xsl:choose> <xsl:choose>
@ -361,7 +361,7 @@
<xsl:when test="count($data-tree/nav:categoryMenu/nav:category/nav:category[./@isSelected = 'true']) &gt; 0"> <xsl:when test="count($data-tree/nav:categoryMenu/nav:category/nav:category[./@isSelected = 'true']) &gt; 0">
<xsl:for-each select="$data-tree/nav:categoryMenu/nav:category/nav:category"> <xsl:for-each select="$data-tree/nav:categoryMenu/nav:category/nav:category">
<xsl:if test="./@isSelected = 'true'"> <xsl:if test="./@isSelected = 'true'">
<xsl:value-of select="concat('colorset-', position())"/> <xsl:value-of select="concat('colorset-', position(), ' ', 'colorset-', translate(lower-case(./@name), ' ', '-'))"/>
</xsl:if> </xsl:if>
</xsl:for-each> </xsl:for-each>
</xsl:when> </xsl:when>
@ -370,7 +370,55 @@
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:function> </xsl:function>
<foundry:doc section="devel" type="function-template">
<foundry:doc-desc>
Helper function to create classes from the current category path
</foundry:doc-desc>
</foundry:doc>
<xsl:function name="foundry:get-path-classes" as="xs:string">
<xsl:choose>
<xsl:when test="count($data-tree/nav:categoryPath) &gt; 0">
<xsl:value-of select="foundry:generate-path-classes(1, '')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="''"/>
</xsl:otherwise>
</xsl:choose>
</xsl:function>
<xsl:function name="foundry:generate-path-classes">
<xsl:param name="index" as="xs:integer"/>
<xsl:param name="classes" as="xs:string"/>
<xsl:choose>
<xsl:when test="$index &gt; count($data-tree/nav:categoryPath/nav:category)">
<xsl:value-of select="$classes"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="foundry:generate-path-classes($index + 1, concat($classes, ' ', foundry:generate-path-class($index, 1, 'path')))"/>
<!--<xsl:value-of select="concat('path-', translate(lower-case($data-tree/nav:categoryPath/nav:category[$index]/@name), ' ', '-'))"/>-->
</xsl:otherwise>
</xsl:choose>
</xsl:function>
<xsl:function name="foundry:generate-path-class">
<xsl:param name="index" as="xs:integer"/>
<xsl:param name="current-index" as="xs:integer"/>
<xsl:param name="class" as="xs:string"/>
<xsl:choose>
<xsl:when test="$current-index &gt; $index">
<xsl:value-of select="$class"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="foundry:generate-path-class($index, $current-index + 1, concat($class, '-', translate(lower-case($data-tree/nav:categoryPath/nav:category[$current-index]/@name), ' ', '-')))"/>
</xsl:otherwise>
</xsl:choose>
</xsl:function>
<foundry:doc section="devel" type="function-template"> <foundry:doc section="devel" type="function-template">
<foundry:doc-desc> <foundry:doc-desc>
Helper functions for retrieving the name of the content type of the current content item Helper functions for retrieving the name of the content type of the current content item
@ -380,7 +428,7 @@
<xsl:function name="foundry:get-content-type-name" as="xs:string"> <xsl:function name="foundry:get-content-type-name" as="xs:string">
<xsl:value-of select="$data-tree//cms:item/type/label"/> <xsl:value-of select="$data-tree//cms:item/type/label"/>
</xsl:function> </xsl:function>
<foundry:doc section="devel" type="function-template"> <foundry:doc section="devel" type="function-template">
<foundry:doc-desc> <foundry:doc-desc>
Helper template for processing arrows/links for sorting items. Helper template for processing arrows/links for sorting items.
@ -430,7 +478,7 @@
</xsl:if> </xsl:if>
</span> </span>
</xsl:template> </xsl:template>
<foundry:doc section="devel" type="function-template"> <foundry:doc section="devel" type="function-template">
<foundry:doc-desc> <foundry:doc-desc>
Helper template for processing additional attributes in the data tree XML. They copied Helper template for processing additional attributes in the data tree XML. They copied
@ -458,7 +506,7 @@
</xsl:attribute> </xsl:attribute>
</xsl:if> </xsl:if>
</xsl:template> </xsl:template>
<foundry:doc section="devel" type="function-template"> <foundry:doc section="devel" type="function-template">
<foundry:doc-param name="current-layout-node"> <foundry:doc-param name="current-layout-node">
<p> <p>
@ -467,9 +515,9 @@
</foundry:doc-param> </foundry:doc-param>
<foundry:doc-param name="attributes"> <foundry:doc-param name="attributes">
<p> <p>
Additional attributes to copy from the layout tree. <code>data</code> attributes Additional attributes to copy from the layout tree. <code>data</code> attributes
(e.g.<code>data-toggle</code>) are (e.g.<code>data-toggle</code>) are
copied automatically. Also <code>id</code> and <code>class</code> are already copied automatically. Also <code>id</code> and <code>class</code> are already
processed by this template. processed by this template.
</p> </p>
</foundry:doc-param> </foundry:doc-param>
@ -507,22 +555,22 @@
<xsl:param name="id" select="''"/> <xsl:param name="id" select="''"/>
<xsl:param name="class" select="''"/> <xsl:param name="class" select="''"/>
<xsl:param name="title" select="''"/> <xsl:param name="title" select="''"/>
<xsl:call-template name="foundry:set-id-and-class"> <xsl:call-template name="foundry:set-id-and-class">
<xsl:with-param name="current-layout-node" select="$current-layout-node"/> <xsl:with-param name="current-layout-node" select="$current-layout-node"/>
<xsl:with-param name="id" select="$id"/> <xsl:with-param name="id" select="$id"/>
<xsl:with-param name="class" select="$class"/> <xsl:with-param name="class" select="$class"/>
</xsl:call-template> </xsl:call-template>
<xsl:call-template name="foundry:copy-data-attributes"> <xsl:call-template name="foundry:copy-data-attributes">
<xsl:with-param name="current-layout-node" select="$current-layout-node"/> <xsl:with-param name="current-layout-node" select="$current-layout-node"/>
</xsl:call-template> </xsl:call-template>
<xsl:call-template name="foundry:process-title-attribute"> <xsl:call-template name="foundry:process-title-attribute">
<xsl:with-param name="current-layout-node" select="$current-layout-node"/> <xsl:with-param name="current-layout-node" select="$current-layout-node"/>
<xsl:with-param name="title" select="$title"/> <xsl:with-param name="title" select="$title"/>
</xsl:call-template> </xsl:call-template>
<xsl:call-template name="foundry:copy-attributes"> <xsl:call-template name="foundry:copy-attributes">
<xsl:with-param name="current-layout-node" select="$current-layout-node"/> <xsl:with-param name="current-layout-node" select="$current-layout-node"/>
<xsl:with-param name="attributes" select="$copy-attributes"/> <xsl:with-param name="attributes" select="$copy-attributes"/>
@ -544,30 +592,30 @@
<xsl:call-template name="foundry:message-debug"> <xsl:call-template name="foundry:message-debug">
<xsl:with-param name="message" <xsl:with-param name="message"
select="concat('process-template called with template-file = ', select="concat('process-template called with template-file = ',
$template-file, $template-file,
' and origin = ', ' and origin = ',
$origin)"/> $origin)"/>
</xsl:call-template> </xsl:call-template>
<xsl:call-template name="foundry:message-debug"> <xsl:call-template name="foundry:message-debug">
<xsl:with-param name="message" <xsl:with-param name="message"
select="concat('using template file: ', select="concat('using template file: ',
foundry:gen-path(concat('templates/', foundry:gen-path(concat('templates/',
normalize-space($template-file)), normalize-space($template-file)),
$origin))" /> $origin))" />
</xsl:call-template> </xsl:call-template>
<xsl:apply-templates select="document(foundry:gen-path( <xsl:apply-templates select="document(foundry:gen-path(
concat('templates/', concat('templates/',
normalize-space($template-file)), normalize-space($template-file)),
$origin))"/> $origin))"/>
</xsl:template> </xsl:template>
<xsl:template name="foundry:process-title-attribute"> <xsl:template name="foundry:process-title-attribute">
<xsl:param name="current-layout-node" select="current()"/> <xsl:param name="current-layout-node" select="current()"/>
<xsl:param name="title" select="''"/> <xsl:param name="title" select="''"/>
<xsl:if test="$title != '' or $current-layout-node/title-static"> <xsl:if test="$title != '' or $current-layout-node/title-static">
<xsl:attribute name="title"> <xsl:attribute name="title">
<xsl:choose> <xsl:choose>
@ -580,7 +628,7 @@
</xsl:choose> </xsl:choose>
</xsl:attribute> </xsl:attribute>
</xsl:if> </xsl:if>
</xsl:template> </xsl:template>
<foundry:doc section="devel" type="function-template"> <foundry:doc section="devel" type="function-template">
@ -612,34 +660,46 @@
<xsl:param name="id" select="''"/> <xsl:param name="id" select="''"/>
<xsl:param name="class" select="''"/> <xsl:param name="class" select="''"/>
<xsl:param name="current-layout-node" select="."/> <xsl:param name="current-layout-node" select="."/>
<xsl:variable name="cond-class"> <xsl:variable name="cond-class">
<xsl:if test="$current-layout-node/@class-if"> <xsl:if test="$current-layout-node/@class-if">
<!-- DE Funktioniert leider nicht in einer Zeile, daher die Hilfsvariable --> <!-- DE Funktioniert leider nicht in einer Zeile, daher die Hilfsvariable -->
<xsl:variable name="key" <xsl:variable name="key"
select="substring-before($current-layout-node/@class-if, ',')"/> select="substring-before($current-layout-node/@class-if, ',')"/>
<xsl:variable name="condition"> <xsl:variable name="condition">
<xsl:apply-templates select="//*[@id=$key]"/> <xsl:apply-templates select="//*[@id=$key]"/>
</xsl:variable> </xsl:variable>
<xsl:if test="normalize-space($condition)"> <xsl:if test="normalize-space($condition)">
<xsl:value-of select="substring-after($current-layout-node/@class.if, ', ')"/> <xsl:value-of select="substring-after($current-layout-node/@class.if, ', ')"/>
</xsl:if> </xsl:if>
</xsl:if> </xsl:if>
</xsl:variable> </xsl:variable>
<xsl:variable name="application-class">
<xsl:if test="foundry:boolean($current-layout-node/@with-application-class)">
<xsl:value-of select="concat('application-', $data-tree/@application)"/>
</xsl:if>
</xsl:variable>
<xsl:variable name="path-classes">
<xsl:if test="foundry:boolean($current-layout-node/@with-path-classes)">
<xsl:value-of select="foundry:get-path-classes()"/>
</xsl:if>
</xsl:variable>
<xsl:variable name="type-class"> <xsl:variable name="type-class">
<xsl:if test="$current-layout-node/@set-type-class='true'"> <xsl:if test="foundry:boolean($current-layout-node/@with-type-class)">
<xsl:value-of select="foundry:get-content-type-name()"/> <xsl:value-of select="foundry:get-content-type-name()"/>
</xsl:if> </xsl:if>
</xsl:variable> </xsl:variable>
<xsl:variable name="color-class"> <xsl:variable name="color-class">
<xsl:if test="foundry:boolean($current-layout-node/@with-colorset)"> <xsl:if test="foundry:boolean($current-layout-node/@with-colorset)">
<xsl:value-of select="foundry:get-colorset()"/> <xsl:value-of select="foundry:get-colorset()"/>
</xsl:if> </xsl:if>
</xsl:variable> </xsl:variable>
<xsl:if test="$id != '' or $current-layout-node/@id"> <xsl:if test="$id != '' or $current-layout-node/@id">
<xsl:attribute name="id"> <xsl:attribute name="id">
<xsl:choose> <xsl:choose>
@ -652,21 +712,25 @@
</xsl:choose> </xsl:choose>
</xsl:attribute> </xsl:attribute>
</xsl:if> </xsl:if>
<xsl:if test="$current-layout-node/@class <xsl:if test="$current-layout-node/@class
or $cond-class != '' or $cond-class != ''
or $type-class != '' or $type-class != ''
or $color-class != '' or $color-class != ''
or $class != ''"> or $class != ''">
<xsl:attribute name="class"> <xsl:attribute name="class">
<xsl:value-of select="normalize-space(concat($current-layout-node/@class, <xsl:value-of select="normalize-space(concat($current-layout-node/@class,
' ', ' ',
$class, $class,
' ', ' ',
$cond-class, $cond-class,
' ', ' ',
$type-class, $application-class,
' ', ' ',
$path-classes,
' ',
$type-class,
' ',
$color-class))"/> $color-class))"/>
</xsl:attribute> </xsl:attribute>
</xsl:if> </xsl:if>
@ -675,7 +739,7 @@
<xsl:template name="foundry:format-date"> <xsl:template name="foundry:format-date">
<xsl:param name="date-elem"/> <xsl:param name="date-elem"/>
<xsl:param name="date-format"/> <xsl:param name="date-format"/>
<xsl:choose> <xsl:choose>
<xsl:when test="$date-format[@lang = $language]"> <xsl:when test="$date-format[@lang = $language]">
<xsl:apply-templates select="$date-format[@lang = $language]"> <xsl:apply-templates select="$date-format[@lang = $language]">
@ -689,30 +753,30 @@
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:template> </xsl:template>
<xsl:template match="date-format//short-date"> <xsl:template match="date-format//short-date">
<xsl:param name="date-elem" tunnel="yes"/> <xsl:param name="date-elem" tunnel="yes"/>
<xsl:value-of select="$date-elem/@date"/> <xsl:value-of select="$date-elem/@date"/>
</xsl:template> </xsl:template>
<xsl:template match="date-format//long-date"> <xsl:template match="date-format//long-date">
<xsl:param name="date-elem" tunnel="yes"/> <xsl:param name="date-elem" tunnel="yes"/>
<xsl:value-of select="$date-elem/@longDate"/> <xsl:value-of select="$date-elem/@longDate"/>
</xsl:template> </xsl:template>
<xsl:template match="date-format//iso-date"> <xsl:template match="date-format//iso-date">
<xsl:param name="date-elem" tunnel="yes"/> <xsl:param name="date-elem" tunnel="yes"/>
<xsl:variable name="year" select="$date-elem/@year"/> <xsl:variable name="year" select="$date-elem/@year"/>
<xsl:variable name="month" <xsl:variable name="month"
select="if (string-length($date-elem/@month) &lt; 2) select="if (string-length($date-elem/@month) &lt; 2)
then concat('0', $date-elem/@month) then concat('0', $date-elem/@month)
else $date-elem/@month"/> else $date-elem/@month"/>
<xsl:variable name="day" <xsl:variable name="day"
select="if (string-length($date-elem/@day) &lt; 2) select="if (string-length($date-elem/@day) &lt; 2)
then concat('0', $date-elem/@day) then concat('0', $date-elem/@day)
else $date-elem/@day"/> else $date-elem/@day"/>
<!--<xsl:variable name="month-value" select="$date-elem/@month"/> <!--<xsl:variable name="month-value" select="$date-elem/@month"/>
<xsl:variable name="month"> <xsl:variable name="month">
@ -736,19 +800,19 @@
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:variable>--> </xsl:variable>-->
<xsl:value-of select="concat($year, '-', $month, '-', $day)"/> <xsl:value-of select="concat($year, '-', $month, '-', $day)"/>
</xsl:template> </xsl:template>
<xsl:template match="date-format//year"> <xsl:template match="date-format//year">
<xsl:param name="date-elem" tunnel="yes"/> <xsl:param name="date-elem" tunnel="yes"/>
<xsl:value-of select="if (foundry:boolean(./@short)) <xsl:value-of select="if (foundry:boolean(./@short))
then substring($date-elem/@year, 3) then substring($date-elem/@year, 3)
else $date-elem/@year"/> else $date-elem/@year"/>
<!--<xsl:variable name="year-value" select="$date-elem/@year"/> <!--<xsl:variable name="year-value" select="$date-elem/@year"/>
<xsl:choose> <xsl:choose>
<xsl:when test="foundry:boolean(./@short)"> <xsl:when test="foundry:boolean(./@short)">
<xsl:value-of select="substring($year-value, 3)"/> <xsl:value-of select="substring($year-value, 3)"/>
@ -758,17 +822,17 @@
</xsl:otherwise> </xsl:otherwise>
</xsl:choose>--> </xsl:choose>-->
</xsl:template> </xsl:template>
<xsl:template match="date-format//month"> <xsl:template match="date-format//month">
<xsl:param name="date-elem" tunnel="yes"/> <xsl:param name="date-elem" tunnel="yes"/>
<xsl:value-of select="if (string-length($date-elem/@month) &lt; 2 <xsl:value-of select="if (string-length($date-elem/@month) &lt; 2
and foundry:boolean(./@zero)) and foundry:boolean(./@zero))
then concat('0', $date-elem/@month) then concat('0', $date-elem/@month)
else $date-elem/@month"/> else $date-elem/@month"/>
<!--<xsl:variable name="month-value" select="$date-elem/@month"/> <!--<xsl:variable name="month-value" select="$date-elem/@month"/>
<xsl:choose> <xsl:choose>
<xsl:when test="string-length($month-value) &lt; 2 and foundry:boolean(./@zero)"> <xsl:when test="string-length($month-value) &lt; 2 and foundry:boolean(./@zero)">
<xsl:value-of select="concat('0', $month-value)"/> <xsl:value-of select="concat('0', $month-value)"/>
@ -781,26 +845,26 @@
<xsl:template match="date-format//month-name"> <xsl:template match="date-format//month-name">
<xsl:param name="date-elem" tunnel="yes"/> <xsl:param name="date-elem" tunnel="yes"/>
<xsl:value-of select="$date-elem/@monthName"/> <xsl:value-of select="$date-elem/@monthName"/>
</xsl:template> </xsl:template>
<xsl:template match="date-format//month-abbr"> <xsl:template match="date-format//month-abbr">
<xsl:param name="date-elem" tunnel="yes"/> <xsl:param name="date-elem" tunnel="yes"/>
<xsl:value-of select="substring($date-elem/@monthName, 0, 4)"/> <xsl:value-of select="substring($date-elem/@monthName, 0, 4)"/>
</xsl:template> </xsl:template>
<xsl:template match="date-format//day"> <xsl:template match="date-format//day">
<xsl:param name="date-elem" tunnel="yes"/> <xsl:param name="date-elem" tunnel="yes"/>
<xsl:value-of select="if (string-length($date-elem/@day) &lt; 2 <xsl:value-of select="if (string-length($date-elem/@day) &lt; 2
and foundry:boolean(./@zero)) and foundry:boolean(./@zero))
then concat('0', $date-elem/@day) then concat('0', $date-elem/@day)
else $date-elem/@day"/> else $date-elem/@day"/>
<!--<xsl:variable name="day-value" select="$date-elem/@day"/> <!--<xsl:variable name="day-value" select="$date-elem/@day"/>
<xsl:choose> <xsl:choose>
<xsl:when test="string-length($day-value) &lt; 2 and foundry:boolean(./@zero)"> <xsl:when test="string-length($day-value) &lt; 2 and foundry:boolean(./@zero)">
<xsl:value-of select="concat('0', $day-value)"/> <xsl:value-of select="concat('0', $day-value)"/>
@ -810,16 +874,16 @@
</xsl:otherwise> </xsl:otherwise>
</xsl:choose>--> </xsl:choose>-->
</xsl:template> </xsl:template>
<xsl:template name="foundry:format-time"> <xsl:template name="foundry:format-time">
<xsl:param name="time-elem"/> <xsl:param name="time-elem"/>
<xsl:param name="style-param"/> <xsl:param name="style-param"/>
<xsl:variable name="style" <xsl:variable name="style"
select="if ($style-param[@lang = $language]) select="if ($style-param[@lang = $language])
then $style-param[@lang = $language] then $style-param[@lang = $language]
else $style-param[@default = 'true']"/> else $style-param[@default = 'true']"/>
<!--<xsl:variable name="style"> <!--<xsl:variable name="style">
<xsl:choose> <xsl:choose>
<xsl:when test="$style-param[@lang = $language]"> <xsl:when test="$style-param[@lang = $language]">
@ -830,12 +894,12 @@
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:variable>--> </xsl:variable>-->
<xsl:choose> <xsl:choose>
<xsl:when test="$style = '12h'"> <xsl:when test="$style = '12h'">
<xsl:variable name="hour24-value" select="$time-elem/@hour"/> <xsl:variable name="hour24-value" select="$time-elem/@hour"/>
<xsl:variable name="minute-value" select="$time-elem/@minute"/> <xsl:variable name="minute-value" select="$time-elem/@minute"/>
<xsl:variable name="hour-value"> <xsl:variable name="hour-value">
<xsl:choose> <xsl:choose>
<xsl:when test="$hour24-value &gt; 11"> <xsl:when test="$hour24-value &gt; 11">
@ -846,7 +910,7 @@
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:variable> </xsl:variable>
<xsl:variable name="hour"> <xsl:variable name="hour">
<xsl:choose> <xsl:choose>
<xsl:when test="string-length($hour-value) &lt; 2"> <xsl:when test="string-length($hour-value) &lt; 2">
@ -857,7 +921,7 @@
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:variable> </xsl:variable>
<xsl:variable name="minute"> <xsl:variable name="minute">
<xsl:choose> <xsl:choose>
<xsl:when test="string-length($minute-value) &lt; 2"> <xsl:when test="string-length($minute-value) &lt; 2">
@ -868,7 +932,7 @@
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:variable> </xsl:variable>
<xsl:variable name="suffix"> <xsl:variable name="suffix">
<xsl:choose> <xsl:choose>
<xsl:when test="$hour24-value &gt; 11"> <xsl:when test="$hour24-value &gt; 11">
@ -879,7 +943,7 @@
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:variable> </xsl:variable>
<xsl:value-of select="concat($hour, ':', $minute, ' ', $suffix)"/> <xsl:value-of select="concat($hour, ':', $minute, ' ', $suffix)"/>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
@ -887,5 +951,5 @@
</xsl:otherwise> </xsl:otherwise>
</xsl:choose> </xsl:choose>
</xsl:template> </xsl:template>
</xsl:stylesheet> </xsl:stylesheet>