Foundry: Some refinements for the image attachments: Depending if there only on image attachments or if there multiple ones a

different class is appended to the classes of the imediate child element of the image-attachments element


git-svn-id: https://svn.libreccm.org/ccm/trunk@3445 8810af33-2d31-482b-a856-94f89814c4df
master
jensp 2015-06-01 11:54:59 +00:00
parent 62bb632004
commit 9ed9fe3b21
3 changed files with 56 additions and 3 deletions

View File

@ -60,7 +60,7 @@ public class ItemSearch extends Form implements Resettable, QueryGenerator {
*/ */
public ItemSearch(String context, boolean limitToContentSection) { public ItemSearch(String context, boolean limitToContentSection) {
super("itemSearch", new SimpleContainer()); super("itemSearch", new SimpleContainer());
setMethod("GET"); //setMethod("GET");
m_section = createSearchSection(context, limitToContentSection); m_section = createSearchSection(context, limitToContentSection);
add(m_section); add(m_section);
} }

View File

@ -34,7 +34,60 @@
<xsl:template match="image-attachments"> <xsl:template match="image-attachments">
<xsl:if test="$data-tree/cms:contentPanel/cms:item/imageAttachments <xsl:if test="$data-tree/cms:contentPanel/cms:item/imageAttachments
or $data-tree/nav:greetingItem/cms:item/imageAttachments"> or $data-tree/nav:greetingItem/cms:item/imageAttachments">
<xsl:apply-templates/> <xsl:variable name="contentitem-tree">
<xsl:choose>
<xsl:when test="$data-tree/nav:greetingItem">
<xsl:copy-of select="$data-tree/nav:greetingItem/cms:item/*"/>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="$data-tree/cms:contentPanel/cms:item/*"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="multiple-class"
select="if (./@multiple-class)
then ./@multiple-class
else 'multiple'"/>
<xsl:variable name="single-class"
select="if (./@single-class)
then ./@single-class
else 'single'"/>
<xsl:variable name="from" as="xs:integer">
<xsl:choose>
<xsl:when test=".//image-attachment/@from">
<xsl:value-of select="./@from"/>
</xsl:when>
<xsl:when test=".//image-attachment/@select">
<xsl:value-of select="./@select"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="min($contentitem-tree/imageAttachments/sortKey)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="to" as="xs:integer">
<xsl:choose>
<xsl:when test=".//image-attachment/@to">
<xsl:value-of select="./@to"/>
</xsl:when>
<xsl:when test=".//image-attachment/@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:apply-templates>
<xsl:with-param name="class"
select="if (($to - $from) &gt; 0)
then $multiple-class
else $single-class"/>
</xsl:apply-templates>
</xsl:if> </xsl:if>
</xsl:template> </xsl:template>

View File

@ -9,7 +9,7 @@
name="ScientificCMS" name="ScientificCMS"
prettyName="Scientific CMS" prettyName="Scientific CMS"
version="2.3.0" version="2.3.0"
release="devel-SNAPSHOT-r3418" release="devel-SNAPSHOT-r3436"
webxml="sci-web.xml" webxml="sci-web.xml"
portletxml="sci-portlet.xml" portletxml="sci-portlet.xml"
webapp="libreccm" webapp="libreccm"