203 lines
8.8 KiB
XML
Executable File
203 lines
8.8 KiB
XML
Executable File
<?xml version="1.0" encoding="utf-8"?>
|
|
<!DOCTYPE stylesheet [<!ENTITY nbsp '<xsl:text disable-output-escaping="yes">&</xsl:text>nbsp;'>]>
|
|
|
|
<!--
|
|
Copyright: 2006, 2007, 2008 Sören Bernstein
|
|
|
|
This file is part of Mandalay.
|
|
|
|
Mandalay is free software: you can redistribute it and/or modify
|
|
it under the terms of the GNU General Public License as published by
|
|
the Free Software Foundation, either version 2 of the License, or
|
|
(at your option) any later version.
|
|
|
|
Mandalay is distributed in the hope that it will be useful,
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
along with Mandalay. If not, see <http://www.gnu.org/licenses/>.
|
|
-->
|
|
|
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
|
xmlns:bebop="http://www.arsdigita.com/bebop/1.0"
|
|
xmlns:cms="http://www.arsdigita.com/cms/1.0"
|
|
xmlns:nav="http://ccm.redhat.com/navigation"
|
|
xmlns:mandalay="http://mandalay.quasiweb.de"
|
|
exclude-result-prefixes="xsl bebop cms"
|
|
version="1.0">
|
|
|
|
<!-- DE Importiere wichtige Funktionen -->
|
|
<!-- EN Using some includes -->
|
|
<xsl:import href="../includes/toolbox.xsl"/>
|
|
<xsl:import href="../includes/imageAttachment.xsl"/>
|
|
|
|
<!-- DE Vollansicht -->
|
|
<!-- EN Detailed view -->
|
|
<xsl:template name="CT_{Name}_graphics" match="cms:item[objectType='com.arsdigita.cms.contenttypes.{Name}']" mode="detailed_view">
|
|
|
|
<!-- DE Hole alle benötigten Einstellungen-->
|
|
<!-- EN Getting all needed setting-->
|
|
<xsl:variable name="setLeadText">
|
|
<xsl:call-template name="mandalay:getSetting">
|
|
<xsl:with-param name="module" select="{Name}"/>
|
|
<xsl:with-param name="setting" select="'setLeadText'"/>
|
|
<xsl:with-param name="default" select="'true'"/>
|
|
</xsl:call-template>
|
|
</xsl:variable>
|
|
<xsl:variable name="setImage">
|
|
<xsl:call-template name="mandalay:getSetting">
|
|
<xsl:with-param name="module" select="{Name}"/>
|
|
<xsl:with-param name="setting" select="'setImage'"/>
|
|
<xsl:with-param name="default" select="'true'"/>
|
|
</xsl:call-template>
|
|
</xsl:variable>
|
|
<xsl:variable name="setImageCaption">
|
|
<xsl:call-template name="mandalay:getSetting">
|
|
<xsl:with-param name="module" select="{Name}"/>
|
|
<xsl:with-param name="setting" select="'setImageCaption'"/>
|
|
<xsl:with-param name="default" select="'true'"/>
|
|
</xsl:call-template>
|
|
</xsl:variable>
|
|
|
|
<div id="greeting">
|
|
<xsl:if test="./lead and $setLeadText = 'true'">
|
|
<div id="lead">
|
|
<xsl:value-of disable-output-escaping="yes" select="./lead"/>
|
|
</div>
|
|
</xsl:if>
|
|
</div>
|
|
<xsl:if test="$setImage = 'true'">
|
|
<xsl:call-template name="mandalay:imageAttachment">
|
|
<xsl:with-param name="showCaption" select="$setImageCaption"/>
|
|
</xsl:call-template>
|
|
</xsl:if>
|
|
|
|
<div id="mainBody">
|
|
<xsl:value-of disable-output-escaping="yes" select="./textAsset/content"/>
|
|
</div>
|
|
</xsl:template>
|
|
|
|
<!-- DE Listenansicht -->
|
|
<!-- EN List view -->
|
|
<xsl:template name="CT_{Name}_List" match="nav:item[nav:attribute[@name='objectType'] = 'com.arsdigita.cms.contenttypes.{Name}']" mode="list_view">
|
|
|
|
<!-- DE Hole alle benötigten Einstellungen-->
|
|
<!-- EN Getting all needed setting-->
|
|
<xsl:variable name="setLeadText">
|
|
<xsl:call-template name="mandalay:getSetting">
|
|
<xsl:with-param name="module" select="{Name}"/>
|
|
<xsl:with-param name="setting" select="'listView/setLeadText'"/>
|
|
<xsl:with-param name="default" select="'true'"/>
|
|
</xsl:call-template>
|
|
</xsl:variable>
|
|
<xsl:variable name="setLeadTextLength">
|
|
<xsl:call-template name="mandalay:getSetting">
|
|
<xsl:with-param name="module" select="{Name}"/>
|
|
<xsl:with-param name="setting" select="'listView/setLeadTextLength'"/>
|
|
<xsl:with-param name="default" select="'0'"/>
|
|
</xsl:call-template>
|
|
</xsl:variable>
|
|
|
|
<a>
|
|
<xsl:attribute name="href"><xsl:value-of select="nav:path" /></xsl:attribute>
|
|
<xsl:attribute name="title"><xsl:value-of select="nav:attribute[@name='title']" /></xsl:attribute>
|
|
<xsl:value-of disable-output-escaping="yes" select="nav:attribute[@name='title']" />
|
|
</a>
|
|
<xsl:if test="nav:attribute[@name='lead'] and $setLeadText = 'true'">
|
|
<br />
|
|
<span class="intro">
|
|
<xsl:choose>
|
|
<xsl:when test="$setLeadTextLength = '0'">
|
|
<xsl:value-of disable-output-escaping="yes" select="nav:attribute[@name='lead']" />
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<xsl:value-of disable-output-escaping="yes" select="substring(nav:attribute[@name='lead'], 1, $setLeadTextLength)" />
|
|
<xsl:if test="string-length(nav:attribute[@name='lead']) > $setLeadTextLength">
|
|
<xsl:text>...</xsl:text>
|
|
</xsl:if>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</span>
|
|
</xsl:if>
|
|
</xsl:template>
|
|
|
|
<xsl:template name="CT_{Name}_Link" match="*/cms:item/links[targetItem/objectType = 'com.arsdigita.cms.contenttypes.{Name}']" mode="link_view">
|
|
|
|
<!-- DE Hole alle benötigten Einstellungen-->
|
|
<!-- EN Getting all needed setting-->
|
|
<xsl:variable name="setImageAndText">
|
|
<xsl:call-template name="mandalay:getSetting">
|
|
<xsl:with-param name="module" select="{Name}"/>
|
|
<xsl:with-param name="setting" select="'linkView/setImageAndText'"/>
|
|
<xsl:with-param name="default" select="'true'"/>
|
|
</xsl:call-template>
|
|
</xsl:variable>
|
|
<xsl:variable name="setImage">
|
|
<xsl:call-template name="mandalay:getSetting">
|
|
<xsl:with-param name="module" select="{Name}"/>
|
|
<xsl:with-param name="setting" select="'linkView/setImage'"/>
|
|
<xsl:with-param name="default" select="'true'"/>
|
|
</xsl:call-template>
|
|
</xsl:variable>
|
|
<xsl:variable name="setImageCaption">
|
|
<xsl:call-template name="mandalay:getSetting">
|
|
<xsl:with-param name="module" select="{Name}"/>
|
|
<xsl:with-param name="setting" select="'linkView/setImageCaption'"/>
|
|
<xsl:with-param name="default" select="'true'"/>
|
|
</xsl:call-template>
|
|
</xsl:variable>
|
|
<xsl:variable name="setDescription">
|
|
<xsl:call-template name="mandalay:getSetting">
|
|
<xsl:with-param name="module" select="{Name}"/>
|
|
<xsl:with-param name="setting" select="'linkView/setDescription'"/>
|
|
<xsl:with-param name="default" select="'true'"/>
|
|
</xsl:call-template>
|
|
</xsl:variable>
|
|
<xsl:variable name="setDescriptionLength">
|
|
<xsl:call-template name="mandalay:getSetting">
|
|
<xsl:with-param name="module" select="{Name}"/>
|
|
<xsl:with-param name="setting" select="'linkView/setDescriptionLength'"/>
|
|
<xsl:with-param name="default" select="'0'"/>
|
|
</xsl:call-template>
|
|
</xsl:variable>
|
|
|
|
<!-- DE Wenn es Bilder gibt, dann soll das erste hier als Link angezeigt werden -->
|
|
<!-- EN -->
|
|
<xsl:if test="./targetItem/imageAttachments and $setImage = 'true'">
|
|
<a>
|
|
<xsl:attribute name="href"><xsl:text>/redirect/?oid=</xsl:text><xsl:value-of select="./targetItem/@oid"/></xsl:attribute>
|
|
<xsl:attribute name="title"><xsl:value-of select="./linkTitle" /></xsl:attribute>
|
|
<xsl:for-each select="./targetItem">
|
|
<xsl:call-template name="mandalay:imageAttachment">
|
|
<xsl:with-param name="showCaption" select="$setImageCaption" />
|
|
</xsl:call-template>
|
|
</xsl:for-each>
|
|
</a>
|
|
</xsl:if>
|
|
<xsl:if test="$setImageAndText = 'true' or not(./targetItem/imageAttachments) or $setImage = 'false'">
|
|
<a>
|
|
<xsl:attribute name="href"><xsl:text>/redirect/?oid=</xsl:text><xsl:value-of select="./targetItem/@oid"/></xsl:attribute>
|
|
<xsl:attribute name="title"><xsl:value-of select="./linkTitle" /></xsl:attribute>
|
|
<xsl:value-of disable-output-escaping="yes" select="./linkTitle" />
|
|
</a>
|
|
<xsl:if test="./linkDescription and $setDescription">
|
|
<br />
|
|
<xsl:choose>
|
|
<xsl:when test="$setDescriptionLength = '0'">
|
|
<xsl:value-of disable-output-escaping="yes" select="./linkDescription" />
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<xsl:value-of disable-output-escaping="yes" select="substring(./linkDescription, 1, $setDescriptionLength)" />
|
|
<xsl:if test="string-length(./linkDescription) > $setDescriptionLength">
|
|
<xsl:text>...</xsl:text>
|
|
</xsl:if>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</xsl:if>
|
|
</xsl:if>
|
|
</xsl:template>
|
|
|
|
</xsl:stylesheet>
|