CCM NG: Merged latest changes for Foundry from trunk

git-svn-id: https://svn.libreccm.org/ccm/ccm_ng@3869 8810af33-2d31-482b-a856-94f89814c4df
pull/2/head
jensp 2016-02-17 19:05:20 +00:00
parent 8e05fe06af
commit de3ae25985
10 changed files with 290 additions and 60 deletions

View File

@ -93,8 +93,7 @@ processor, some are read from the configuration files of Foundry and some are de
</p>
</foundry:doc-desc>
</foundry:doc>
<xsl:param name="theme-prefix"
select="concat($context-prefix, '/themes/libreccm-default')"/>
<xsl:param name="theme-prefix"/>
<foundry:doc section="devel" type="env-var">
<foundry:doc-desc>

View File

@ -854,7 +854,7 @@
<xsl:variable name="minute">
<xsl:choose>
<xsl:when test="string-length($minute-value) &lt; 2">
<xsl:value-of select="concat('0', $hour-value)"/>
<xsl:value-of select="concat('0', $minute-value)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$minute-value"/>

View File

@ -215,9 +215,9 @@
<xsl:variable name="images-layout-tree" select="current()"/>
<xsl:message>
<!--<xsl:message>
<xsl:value-of select="concat('imageAttachment id = ', $contentitem-tree/nav:attribute[@name='imageAttachments.image.id'][position() = 1])"/>
</xsl:message>
</xsl:message>-->
<xsl:apply-templates select="$images-layout-tree/*">
<xsl:with-param name="src"

View File

@ -197,9 +197,20 @@
<xsl:template match="content-item-layout//*[ends-with(name(), 'contact-entries')]//contact-entry//contact-entry-value-as-link">
<xsl:param name="value" tunnel="yes"/>
<xsl:choose>
<xsl:when test="contains($value, '@')">
<xsl:apply-templates>
<xsl:with-param name="href"
tunnel="yes"
select="concat('mailto:', $value)"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates>
<xsl:with-param name="href" tunnel="yes" select="$value"/>
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<foundry:doc section="user" type="template-tag">

View File

@ -75,6 +75,22 @@
else $data-tree//cms:item/@formAction}"
accept-charset="utf-8">
<xsl:if test="$contentitem-tree/honeypot">
<div class="formitem-hidden">
<label for="{$contentitem-tree/honeypot/@name}">
<xsl:value-of select="foundry:get-static-text('form-item', 'honeypot-label')"/>
</label>
<input type="text" name="{$contentitem-tree/honeypot/@name}"/>
</div>
</xsl:if>
<xsl:if test="$contentitem-tree/minTimeCheck">
<input type="hidden"
name="minTimeCheck"
value="{$contentitem-tree/minTimeCheck/@generated}"/>
</xsl:if>
<xsl:if test="not($contentitem-tree/remote = 'true')">
<input type="hidden"
value="visited"

View File

@ -48,7 +48,17 @@
</foundry:doc-see-also>
</foundry:doc>
<xsl:template match="show-page-title">
<xsl:value-of select="foundry:title()"/>
<xsl:variable name="useCategoryMenu"
select="if(./@useCategoryMenu)
then ./@useCategoryMenu
else 'categoryMenu'"/>
<xsl:variable name="useRootCategoryIndexItemTitle"
select="if(./@useRootIndexItemCategoryTitle)
then foundry:boolean(./@useRootCategoryIndexItemTitle)
else false()"/>
<xsl:value-of select="foundry:title($useCategoryMenu,
$useRootCategoryIndexItemTitle)"/>
</xsl:template>
<foundry:doc section="user"

View File

@ -1454,12 +1454,12 @@
<xsl:value-of select="foundry:get-static-text('', ./@title, false())"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="$width &gt; 0">
<xsl:if test="$width != '' and $width &gt; 0">
<xsl:attribute name="width">
<xsl:value-of select="$width"/>
</xsl:attribute>
</xsl:if>
<xsl:if test="$height &gt; 0">
<xsl:if test="$height != '' and $height &gt; 0">
<xsl:attribute name="height">
<xsl:value-of select="$height"/>
</xsl:attribute>
@ -2183,9 +2183,14 @@
<xsl:with-param name="copy-attributes"
select="'autofocus disabled multiple required size'"/>
</xsl:call-template>
<xsl:if test="$name != ''">
<xsl:choose>
<xsl:when test="$name != ''">
<xsl:attribute name="name" select="$name"/>
</xsl:if>
</xsl:when>
<xsl:when test="./@name">
<xsl:attribute name="name" select="./@name"/>
</xsl:when>
</xsl:choose>
<xsl:if test="$disabled = true()">
<xsl:attribute name="disabled" select="'disabled'"/>
</xsl:if>

View File

@ -141,6 +141,27 @@
</xsl:choose>
</xsl:template>
<xsl:template match="breadcrumbs-current-main-category-link">
<xsl:choose>
<xsl:when test="count($data-tree//nav:categoryPath/nav:category[position() &gt; 1])">
<xsl:apply-templates>
<xsl:with-param name="href"
tunnel="yes"
select="$data-tree//nav:categoryPath/nav:category[position() = 2]/@url"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:if test="foundry:boolean(./@show-root)">
<xsl:apply-templates>
<xsl:with-param name="href"
tunnel="yes"
select="$data-tree//nav:categoryPath/nav:category[position() = 1]/@url"/>
</xsl:apply-templates>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="breadcrumbs-current-category">
<xsl:value-of select="$data-tree//nav:categoryPath/nav:category[position() = last()]/@title"/>
</xsl:template>
@ -173,9 +194,20 @@
<xsl:variable name="navigation-id"
select="foundry:get-attribute-value(current(), 'navigation-id', 'categoryMenu')"/>
<xsl:apply-templates>
<xsl:with-param name="href"
<!--<xsl:with-param name="href"
select="$data-tree//nav:categoryMenu[@id=$navigation-id]/nav:category/@url"
tunnel="yes"/>
tunnel="yes"/>-->
<xsl:with-param name="href"
tunnel="yes">
<xsl:choose>
<xsl:when test="$data-tree//nav:categoryMenu[@id=$navigation-id]/nav:category/@url">
<xsl:value-of select="$data-tree//nav:categoryMenu[@id=$navigation-id]/nav:category/@url"/>
</xsl:when>
<xsl:when test="$data-tree//nav:categoryPath/nav:category/@url">
<xsl:value-of select="$data-tree//nav:categoryPath/nav:category/@url"/>
</xsl:when>
</xsl:choose>
</xsl:with-param>
<xsl:with-param name="navigation-id" select="$navigation-id" tunnel="yes"/>
<xsl:with-param name="title" tunnel="yes">
<xsl:choose>
@ -185,7 +217,14 @@
<xsl:value-of select="$data-tree//nav:categoryMenu[@id=$navigation-id]/nav:category/@title"/>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$data-tree//nav:categoryMenu[@id=$navigation-id]/@navigation-id">
<xsl:value-of select="foundry:get-static-text('navigation', $data-tree//nav:categoryMenu[@id=$navigation-id]/@navigation-id, false())"/>
</xsl:when>
<xsl:when test="$data-tree//nav:categoryPath/@navigation-id">
<xsl:value-of select="foundry:get-static-text('navigation', $data-tree//nav:categoryPath[@id=$navigation-id]/@navigation-id, false())"/>
</xsl:when>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
@ -212,6 +251,9 @@
<xsl:when test="string-length($data-tree//nav:categoryMenu[@id=$navigation-id]/nav:category/@title) &gt; 0">
<xsl:value-of select="foundry:shying($data-tree//nav:categoryMenu[@id=$navigation-id]/nav:category/@title)"/>
</xsl:when>
<xsl:when test="string-length($data-tree//nav:categoryPath/nav:category/@title) &gt; 0">
<xsl:value-of select="foundry:shying($data-tree/nav:categoryPath/nav:category/@title)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="''"/>
</xsl:otherwise>
@ -376,7 +418,7 @@
</xsl:choose>
</xsl:template>
<xsl:template match="navigation-links//navigation-link">
<xsl:template match="navigation//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"/>
@ -467,6 +509,7 @@
<xsl:value-of select="concat(' colorset-', position())"/>
</xsl:if>
</xsl:with-param>
<xsl:with-param name="id" select="concat('id-', ./@id)"/>
</xsl:apply-templates>
</xsl:for-each>
</xsl:otherwise>
@ -479,7 +522,7 @@
<xsl:value-of select="$link-label"/>
</xsl:template>
<xsl:template match="navigation-link//navigation-sublinks">
<xsl:template match="navigation//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"/>
@ -550,6 +593,143 @@
<xsl:value-of select="$quicklink-description"/>
</xsl:template>
<!-- Navigation hierarchy -->
<xsl:template match="navigation-hierarchy">
<xsl:apply-templates>
<xsl:with-param name="hierarchy-id"
select="foundry:get-attribute-value(current(), 'hierarchy-id', 'categoryMenu')"
tunnel="yes"/>
<xsl:with-param name="with-colorset"
select="foundry:boolean(foundry:get-attribute-value(current(), 'with-colorset', 'false'))"
tunnel="yes"/>
<xsl:with-param name="show-description-text"
select="foundry:get-attribute-value(current(), 'show-description-text', 'true')"
tunnel="yes"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="navigation-hierarchy//navigation-links">
<xsl:param name="hierarchy-id" tunnel="yes"/>
<xsl:param name="with-colorset" 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:categoryHierarchy[@id=$hierarchy-id]/nav:category"
tunnel="yes"/>
<xsl:call-template name="foundry:message-debug">
<xsl:with-param name="message"
select="concat('navigation-links template called with these parameters:&#x0A;',
' hierarchy-id = ', $hierarchy-id, '&#x0a;',
' with-colorset = ', $with-colorset, '&#x0a;',
' current-level = ', $current-level, '&#x0a;',
' count(category) = ', count($current-level-tree), '&#x0a;')" />
</xsl:call-template>
<xsl:apply-templates>
<xsl:with-param name="hierarchy-id"
select="$hierarchy-id"
tunnel="yes"/>
<xsl:with-param name="with-colorset"
select="$with-colorset"
tunnel="yes"/>
<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"
tunnel="yes"/>
<xsl:with-param name="navigation-links-tree"
select="."
tunnel="yes"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="navigation-hierarchy//navigation-links//navigation-link">
<xsl:param name="hierarchy-id" tunnel="yes"/>
<xsl:param name="with-colorset" 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:variable name="link-tree" select="current()"/>
<xsl:for-each select="$current-level-tree">
<xsl:apply-templates select="$link-tree/*">
<xsl:with-param name="navigation-id" select="$hierarchy-id"/>
<xsl:with-param name="hierarchy-id" select="$hierarchy-id"/>
<xsl:with-param name="with-colorset" select="$with-colorset" 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:with-param name="class">
<xsl:if test="./@isSelected = 'true'">
<xsl:value-of select="'active'"/>
</xsl:if>
<xsl:if test="$current-level = 1 and $with-colorset = true()">
<xsl:value-of select="concat(' colorset-', position())"/>
</xsl:if>
</xsl:with-param>
<xsl:with-param name="id" select="concat('id-', ./@id)"/>
</xsl:apply-templates>
</xsl:for-each>
</xsl:template>
<xsl:template match="navigation-hierarchy//navigation-link//navigation-sublinks">
<xsl:param name="hierarchy-id" tunnel="yes"/>
<xsl:param name="with-colorset" 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-tree/nav:category">
<xsl:apply-templates select="$navigation-links-tree">
<xsl:with-param name="navigation-id" select="$hierarchy-id"/>
<xsl:with-param name="hierarchy-id" select="$hierarchy-id"/>
<xsl:with-param name="with-colorset" select="$with-colorset"/>
<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"
tunnel="yes"/>
<xsl:with-param name="navigation-links-tree" select="$navigation-links-tree"/>
</xsl:apply-templates>
</xsl:if>
</xsl:template>
<xsl:template match="navigation-hierarchy//navigation-link//if-navigation-sublinks">
<xsl:param name="current-level-tree" tunnel="yes"/>
<xsl:if test="$current-level-tree/nav:category">
<xsl:apply-templates/>
</xsl:if>
</xsl:template>
<!-- Sitemap -->
<xsl:template match="nav-sitemap">
<xsl:apply-templates select="$data-tree/nav:categoryHierarchy"/>

View File

@ -77,13 +77,19 @@
</xsl:choose>
</xsl:variable>
<xsl:if test="count($object-list-datatree/nav:objectList/nav:item) &gt;= 1">
<xsl:apply-templates>
<xsl:with-param name="object-list-datatree"
tunnel="yes"
select="$object-list-datatree"/>
</xsl:apply-templates>
</xsl:if>
</xsl:template>
<xsl:template match="object-list/no-content">
<xsl:param name="object-list-datatree" tunnel="yes"/>
<xsl:if test="$object-list-datatree/nav:noContent">
<xsl:apply-templates select="current()/*"/>
</xsl:if>
</xsl:template>
@ -164,7 +170,7 @@
<xsl:template match="object-list//paginator">
<xsl:param name="object-list-datatree" tunnel="yes"/>
<xsl:if test="($object-list-datatree/nav:objectList/nav:paginator/@pageCount &gt; 1)
<xsl:if test="(number($object-list-datatree/nav:objectList/nav:paginator/@pageCount) &gt; 1)
or ./@show = 'always'">
<xsl:apply-templates>
<xsl:with-param name="paginator-baseurl"
@ -308,7 +314,7 @@
<xsl:param name="paginator-baseurl" tunnel="yes" select="''"/>
<xsl:param name="paginator-page-param" tunnel="yes" select="''"/>
<xsl:if test="($paginator-page-number != '') and ($paginator-page-number &gt; 1)">
<xsl:if test="($paginator-page-number != '') and (number($paginator-page-number) &gt; 1)">
<xsl:apply-templates>
<xsl:with-param name="href"
tunnel="yes"
@ -335,7 +341,7 @@
<xsl:param name="paginator-page-param" tunnel="yes" select="''"/>
<xsl:if test="($paginator-page-number != '')
and ($paginator-page-number &lt; $paginator-page-count)">
and (number($paginator-page-number) &lt; number($paginator-page-count))">
<xsl:apply-templates>
<xsl:with-param name="href"
tunnel="yes"
@ -361,7 +367,7 @@
<xsl:param name="paginator-page-param" tunnel="yes" select="''"/>
<xsl:if test="($paginator-page-number != '')
and ($paginator-page-number &gt; 1)">
and (number($paginator-page-number) &gt; 1)">
<xsl:apply-templates>
<xsl:with-param name="href"
tunnel="yes"
@ -386,7 +392,7 @@
<xsl:param name="paginator-page-param" tunnel="yes" select="''"/>
<xsl:if test="($paginator-page-number != '')
and ($paginator-page-number &lt; $paginator-page-count)">
and (number($paginator-page-number) &lt; number($paginator-page-count))">
<xsl:apply-templates>
<xsl:with-param name="href"
tunnel="yes"

View File

@ -946,6 +946,9 @@
</xsl:function>
<xsl:function name="foundry:title" as="xs:string">
<xsl:param name="useCategoryMenu"/>
<xsl:param name="useRootCategoryIndexItemTitle"/>
<xsl:choose>
<!-- Use fixed title for some special content items -->
<xsl:when test="$data-tree//cms:contentPanel">
@ -983,11 +986,11 @@
<!-- Title for content section-->
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$data-tree/nav:categoryMenu//nav:category[@isSelected='true']">
<xsl:for-each select="$data-tree/nav:categoryMenu//nav:category[@isSelected='true']">
<xsl:when test="$data-tree/nav:categoryMenu[@id=$useCategoryMenu]//nav:category[@isSelected='true']">
<xsl:for-each select="$data-tree/nav:categoryMenu[@id=$useCategoryMenu]//nav:category[@isSelected='true']">
<xsl:choose>
<!-- Special rule: Use content item title for root-page in navigation -->
<xsl:when test="position() = last() and position() = 1">
<xsl:when test="position() = last() and position() = 1 and $useRootCategoryIndexItemTitle">
<xsl:choose>
<xsl:when test="$data-tree//title">
<xsl:variable name="page-title">