Improvments and bugfixes for Foundry done while working on the LBC theme

git-svn-id: https://svn.libreccm.org/ccm/trunk@2999 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2014-12-01 19:34:01 +00:00
parent 44c5892c20
commit 8a7fd1a3cb
5 changed files with 106 additions and 43 deletions

View File

@ -700,7 +700,12 @@
</xsl:template>
<xsl:template match="content-item-layout">
<xsl:apply-templates/>
<xsl:param name="contentitem-tree" tunnel="yes"/>
<xsl:apply-templates>
<xsl:with-param name="id"
select="$contentitem-tree/name"/>
</xsl:apply-templates>
</xsl:template>
<xsl:template match="content-item-layout//content-item-title">

View File

@ -116,4 +116,30 @@
</xsl:template>
<xsl:template match="item-list-image-attachments">
<xsl:param name="contentitem-tree" tunnel="yes"/>
<xsl:if test="$contentitem-tree/nav:attribute[@name='imageAttachments.image.id']">
<xsl:apply-templates/>
</xsl:if>
</xsl:template>
<xsl:template match="item-list-image-attachments/image-attachment">
<xsl:param name="contentitem-tree" tunnel="yes"/>
<xsl:variable name="images-layout-tree" select="current()"/>
<xsl:for-each select="$contentitem-tree/nav:attribute[@name='imageAttachments.image.id']">
<xsl:variable name="current-pos" select="position()"/>
<xsl:apply-templates select="$images-layout-tree/*">
<xsl:with-param name="src"
tunnel="yes"
select="concat('/cms-service/stream/image/?image_id=', current())"/>
<xsl:with-param name="alt"
tunnel="yes"
select="$contentitem-tree/nav:attribute[@name='imageAttachments.caption']"/>
</xsl:apply-templates>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>

View File

@ -70,6 +70,8 @@
<xsl:template match="object-list//object-list-item" name="object-list-items">
<xsl:param name="object-list-datatree" tunnel="yes"/>
<xsl:param name="class-first" select="''"/>
<xsl:param name="class-last" select="''"/>
<!--<pre>Object-list-item</pre>
<pre>
@ -94,6 +96,16 @@
select="concat(./nav:attribute[@name = 'masterVersion.id'],
'_',
nav:attribute[@name = 'name'])"/>
<xsl:with-param name="class">
<xsl:choose>
<xsl:when test="position() = 1">
<xsl:value-of select="$class-first"/>
</xsl:when>
<xsl:when test="position() = last()">
<xsl:value-of select="$class-last"/>
</xsl:when>
</xsl:choose>
</xsl:with-param>
</xsl:apply-templates>
</xsl:for-each>

View File

@ -30,19 +30,49 @@
</xsl:template>
<xsl:template match="portal-grid-workspace//portal-grid-workspace-rows">
<xsl:apply-templates/>
<xsl:choose>
<xsl:when test="./@rows">
<xsl:variable name="rows-attr"
select="tokenize(./@rows, ',')"/>
<xsl:apply-templates>
<xsl:with-param name="rows"
tunnel="yes"
select="$data-tree/portal:gridWorkspace/portal:rows/portal:row[not(empty(index-of($rows-attr, @title)))]"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates>
<xsl:with-param name="rows"
tunnel="yes"
select="$data-tree/portal:gridWorkspace/portal:rows/portal:row"/>
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="portal-grid-workspace//portal-grid-workspace-rows//portal-grid-workspace-row">
<xsl:param name="rows" tunnel="yes"/>
<xsl:variable name="row-layout-tree">
<xsl:copy-of select="./*"/>
</xsl:variable>
<xsl:for-each select="$data-tree/portal:gridWorkspace/portal:rows/portal:row">
<xsl:apply-templates select="$row-layout-tree/*">
<xsl:for-each select="$rows">
<xsl:variable name="row-title" select="./@title"/>
<xsl:choose>
<xsl:when test="$row-layout-tree/row-layout[not(empty(index-of(tokenize(@rows, ','), $row-title)))]">
<xsl:apply-templates select="$row-layout-tree/row-layout[not(empty(index-of(tokenize(@rows, ','), $row-title)))]/*">
<xsl:with-param name="row-data-tree" tunnel="yes" select="current()"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="$row-layout-tree/row-layout[not(@rows)]/*">
<xsl:with-param name="row-data-tree" tunnel="yes" select="current()"/>
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
</xsl:template>
@ -136,6 +166,11 @@
<xsl:with-param name="portlet-data-tree" tunnel="yes" select="current()"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<pre>
<xsl:value-of select="concat('failed to find a template for ', $classname)"/>
</pre>
</xsl:otherwise>
</xsl:choose>

View File

@ -26,23 +26,6 @@
version="2.0">
<xsl:template match="portlet-layout//portlet-item-list">
<!--<xsl:param name="portlet-data-tree" tunnel="yes"/>
<pre>
<xsl:value-of select="concat('count(*) = ', count($portlet-data-tree))"/>
</pre>
<pre>
<xsl:value-of select="concat('name[1] = ', name($portlet-data-tree))"/>
</pre>
<xsl:variable name="object-list-datatree">
<xsl:copy-of select="$portlet-data-tree"/>
</xsl:variable>
<xsl:apply-templates>
<xsl:with-param name="object-list-datatree" tunnel="yes" select="$portlet-data-tree"/>
</xsl:apply-templates>
-->
<xsl:apply-templates/>
</xsl:template>
@ -51,6 +34,8 @@
<xsl:call-template name="object-list-items">
<xsl:with-param name="object-list-datatree" select="$portlet-data-tree" tunnel="yes"/>
<xsl:with-param name="class-first" select="./@class-first"/>
<xsl:with-param name="class-last" select="./@class-last"/>
</xsl:call-template>
</xsl:template>