Foundry support for Image Attchments

git-svn-id: https://svn.libreccm.org/ccm/trunk@2912 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2014-10-15 08:31:08 +00:00
parent 932414637e
commit d45ce31d50
3 changed files with 27 additions and 23 deletions

View File

@ -38,7 +38,7 @@
</xsl:if> </xsl:if>
</xsl:template> </xsl:template>
<xsl:template match="images-attachments//image-attachment"> <xsl:template match="image-attachments//image-attachment">
<xsl:variable name="images-layout-tree" select="current()"/> <xsl:variable name="images-layout-tree" select="current()"/>
<xsl:variable name="contentitem-tree"> <xsl:variable name="contentitem-tree">
@ -55,11 +55,11 @@
<xsl:variable name="from" as="xs:integer"> <xsl:variable name="from" as="xs:integer">
<xsl:choose> <xsl:choose>
<xsl:when test="..//imageAttachments/@from"> <xsl:when test="./@from">
<xsl:value-of select="..//imageAttachments/@from"/> <xsl:value-of select="./@from"/>
</xsl:when> </xsl:when>
<xsl:when test="..//imageAttachment/@select"> <xsl:when test="./@select">
<xsl:value-of select="..//imageAttachments/@select"/> <xsl:value-of select="./@select"/>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:value-of select="min($contentitem-tree/imageAttachments/sortKey)"/> <xsl:value-of select="min($contentitem-tree/imageAttachments/sortKey)"/>
@ -69,11 +69,11 @@
<xsl:variable name="to" as="xs:integer"> <xsl:variable name="to" as="xs:integer">
<xsl:choose> <xsl:choose>
<xsl:when test="..//imageAttachments/@to"> <xsl:when test="./@to">
<xsl:value-of select="..//imageAttachments/@to"/> <xsl:value-of select="./@to"/>
</xsl:when> </xsl:when>
<xsl:when test="..//imageAttachment/@select"> <xsl:when test="./@select">
<xsl:value-of select="..//imageAttachments/@select"/> <xsl:value-of select="./@select"/>
</xsl:when> </xsl:when>
<xsl:otherwise> <xsl:otherwise>
<xsl:value-of select="max($contentitem-tree/imageAttachments/sortKey)"/> <xsl:value-of select="max($contentitem-tree/imageAttachments/sortKey)"/>
@ -81,19 +81,25 @@
</xsl:choose> </xsl:choose>
</xsl:variable> </xsl:variable>
<xsl:for-each select="$contentitem-tree/imageAttachments[sortKey &gt;= from and sortKey &lt;= sortKey]"> <pre>
<xsl:value-of select="concat('from = ', $from)"/>
<xsl:value-of select="concat('; to = ', $to)"/>
</pre>
<xsl:for-each select="$contentitem-tree/imageAttachments[sortKey &gt;= $from and sortKey &lt;= $to]">
<xsl:sort select="sortKey"/> <xsl:sort select="sortKey"/>
<xsl:apply-templates select="$images-layout-tree/*"> <xsl:apply-templates select="$images-layout-tree/*">
<xsl:with-param name="src" <xsl:with-param name="src"
tunnel="yes" tunnel="yes"
select="concat('/cms-service/stream/image/?image_id=', ./images/id)"/> select="concat('/cms-service/stream/image/?image_id=', ./image/id)"/>
<xsl:with-param name="img-width" <xsl:with-param name="img-width"
tunnel="yes" tunnel="yes"
select="./image/width"/> select="./image/width"/>
<xsl:with-param name="img-height" <xsl:with-param name="img-height"
tunnel="yes" tunnel="yes"
select="./images/height"/> select="./image/height"/>
<xsl:with-param name="alt" <xsl:with-param name="alt"
tunnel="yes"> tunnel="yes">
<xsl:choose> <xsl:choose>
@ -108,8 +114,6 @@
</xsl:apply-templates> </xsl:apply-templates>
</xsl:for-each> </xsl:for-each>
</xsl:template> </xsl:template>
</xsl:stylesheet> </xsl:stylesheet>

View File

@ -549,16 +549,16 @@
<!-- Source URL of the image provided by a surrounding tag. --> <!-- Source URL of the image provided by a surrounding tag. -->
<xsl:param name="src" tunnel="yes" as="xs:string" select="''"/> <xsl:param name="src" tunnel="yes" as="xs:string" select="''"/>
<!-- Width of the image the URL the src parameter is pointing to (pixel) --> <!-- Width of the image the URL the src parameter is pointing to (pixel) -->
<xsl:param name="img-width" tunnel="yes" as="xs:integer" select="-1"/> <xsl:param name="img-width" tunnel="yes" as="xs:integer" select="(-1)"/>
<!-- Height of the image the URL the src parameter is pointing to (pixel) --> <!-- Height of the image the URL the src parameter is pointing to (pixel) -->
<xsl:param name="img-height" tunnel="yes" as="xs:integer" select="-1"/> <xsl:param name="img-height" tunnel="yes" as="xs:integer" select="(-1)"/>
<!-- Content of the alt attribute if provided by surrounding tag --> <!-- Content of the alt attribute if provided by surrounding tag -->
<xsl:param name="alt" tunnel="yes" as="xs:string" select="''"/> <xsl:param name="alt" tunnel="yes" as="xs:string" select="''"/>
<xsl:variable name="src-raw"> <xsl:variable name="src-raw">
<xsl:choose> <xsl:choose>
<xsl:when test="$src != ''"> <xsl:when test="$src != ''">
<xsl:value-of select="src"/> <xsl:value-of select="$src"/>
</xsl:when> </xsl:when>
<xsl:when test="./@src-static"> <xsl:when test="./@src-static">
<xsl:value-of select="./@src"/> <xsl:value-of select="./@src"/>

View File

@ -52,11 +52,11 @@
<content-item/> <content-item/>
</div> </div>
<div> <div>
<imageAttachments> <image-attachments>
<imageAttachment> <image-attachment from="2" to="3">
<img/> <img width="320" height="240"/>
</imageAttachment> </image-attachment>
</imageAttachments> </image-attachments>
</div> </div>
</main> </main>
<aside> <aside>