Foundry support for Image Attchments
git-svn-id: https://svn.libreccm.org/ccm/trunk@2912 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
932414637e
commit
d45ce31d50
|
|
@ -38,7 +38,7 @@
|
|||
</xsl:if>
|
||||
</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="contentitem-tree">
|
||||
|
|
@ -55,11 +55,11 @@
|
|||
|
||||
<xsl:variable name="from" as="xs:integer">
|
||||
<xsl:choose>
|
||||
<xsl:when test="..//imageAttachments/@from">
|
||||
<xsl:value-of select="..//imageAttachments/@from"/>
|
||||
<xsl:when test="./@from">
|
||||
<xsl:value-of select="./@from"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="..//imageAttachment/@select">
|
||||
<xsl:value-of select="..//imageAttachments/@select"/>
|
||||
<xsl:when test="./@select">
|
||||
<xsl:value-of select="./@select"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="min($contentitem-tree/imageAttachments/sortKey)"/>
|
||||
|
|
@ -69,31 +69,37 @@
|
|||
|
||||
<xsl:variable name="to" as="xs:integer">
|
||||
<xsl:choose>
|
||||
<xsl:when test="..//imageAttachments/@to">
|
||||
<xsl:value-of select="..//imageAttachments/@to"/>
|
||||
<xsl:when test="./@to">
|
||||
<xsl:value-of select="./@to"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="..//imageAttachment/@select">
|
||||
<xsl:value-of select="..//imageAttachments/@select"/>
|
||||
<xsl:when test="./@select">
|
||||
<xsl:value-of select="./@select"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="max($contentitem-tree/imageAttachments/sortKey)"/>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
</xsl:variable>
|
||||
|
||||
<xsl:for-each select="$contentitem-tree/imageAttachments[sortKey >= from and sortKey <= 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 >= $from and sortKey <= $to]">
|
||||
<xsl:sort select="sortKey"/>
|
||||
|
||||
<xsl:apply-templates select="$images-layout-tree/*">
|
||||
<xsl:with-param name="src"
|
||||
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"
|
||||
tunnel="yes"
|
||||
select="./image/width"/>
|
||||
<xsl:with-param name="img-height"
|
||||
tunnel="yes"
|
||||
select="./images/height"/>
|
||||
select="./image/height"/>
|
||||
<xsl:with-param name="alt"
|
||||
tunnel="yes">
|
||||
<xsl:choose>
|
||||
|
|
@ -108,8 +114,6 @@
|
|||
</xsl:apply-templates>
|
||||
</xsl:for-each>
|
||||
|
||||
|
||||
|
||||
</xsl:template>
|
||||
|
||||
</xsl:stylesheet>
|
||||
|
|
@ -549,16 +549,16 @@
|
|||
<!-- Source URL of the image provided by a surrounding tag. -->
|
||||
<xsl:param name="src" tunnel="yes" as="xs:string" select="''"/>
|
||||
<!-- 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) -->
|
||||
<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 -->
|
||||
<xsl:param name="alt" tunnel="yes" as="xs:string" select="''"/>
|
||||
|
||||
<xsl:variable name="src-raw">
|
||||
<xsl:choose>
|
||||
<xsl:when test="$src != ''">
|
||||
<xsl:value-of select="src"/>
|
||||
<xsl:value-of select="$src"/>
|
||||
</xsl:when>
|
||||
<xsl:when test="./@src-static">
|
||||
<xsl:value-of select="./@src"/>
|
||||
|
|
|
|||
|
|
@ -52,11 +52,11 @@
|
|||
<content-item/>
|
||||
</div>
|
||||
<div>
|
||||
<imageAttachments>
|
||||
<imageAttachment>
|
||||
<img/>
|
||||
</imageAttachment>
|
||||
</imageAttachments>
|
||||
<image-attachments>
|
||||
<image-attachment from="2" to="3">
|
||||
<img width="320" height="240"/>
|
||||
</image-attachment>
|
||||
</image-attachments>
|
||||
</div>
|
||||
</main>
|
||||
<aside>
|
||||
|
|
|
|||
Loading…
Reference in New Issue