Author: nettings
Date: Sun Jul 29 08:37:34 2007
New Revision: 560734
URL: http://svn.apache.org/viewvc?view=rev&rev=560734
Log:
fixed broken asset insertion. the usecase incorrectly used a path-based
uri instead of an uuid-based one, which broke the "documentLink" format
of the resources module.
changed asset wrapper from <p> to <span>, because spans are correct
almost everywhere, whereas <p>s cannot be contained in <p>s or inline
elements.
Modified:
lenya/trunk/src/modules/editors/usecases/insertAsset.jx
lenya/trunk/src/modules/resource/xslt/downloadLink.xsl
Modified: lenya/trunk/src/modules/editors/usecases/insertAsset.jx
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/editors/usecases/insertAsset.jx?view=diff&rev=560734&r1=560733&r2=560734
==============================================================================
--- lenya/trunk/src/modules/editors/usecases/insertAsset.jx (original)
+++ lenya/trunk/src/modules/editors/usecases/insertAsset.jx Sun Jul 29 08:37:34 2007
@@ -28,7 +28,8 @@
<script type="text/javascript" src="/modules/editors/javascript/insertAsset.js"> </script>
</page:head>
- <!-- This view can handle both insertAsset and insertImage, depending on the setting of the mode parameter ("Asset"|"Image") -->
+ <!-- This view can handle both insertAsset and insertImage,
+ depending on the setting of the mode parameter ("Asset"|"Image") -->
<jx:set var="mode" value="${usecase.getParameterAsString('mode')}"/>
<page:title>
@@ -64,11 +65,27 @@
<jx:set var="asset2proxyUrl" value="${usecase.getParameter('asset2proxyUrl')}"/>
<jx:forEach var="asset" items="${usecase.getParameter('assets')}">
<jx:set var="mimeType" value="${asset.getMimeType()}"/>
+ <!-- Images are displayed in both "Asset" and "Image" mode. Other resources
+ are displayed only in "Asset" mode. -->
<jx:if test="${mode.equals('Asset') || mimeType.startsWith('image/')}">
- <jx:set var="url" value="${asset2proxyUrl.get(asset)}"/>
+ <!-- We must differenciate between images and assets here:
+ images get a path-based URL to allow WYSIWYG editors to render them
+ (they will be converted to lenya-document: UR later).
+ Assets get a UUID-based lenya-document URL.
+ -->
+ <jx:choose>
+ <jx:when test="${mode.equals('Image')}">
+ <jx:set var="url" value="${asset2proxyUrl.get(asset)}"/>
+ </jx:when>
+ <jx:otherwise>
+ <jx:set var="url" value="${('lenya-document:' + asset.getUUID() + ',lang=' + asset.getLanguage())}"/>
+ </jx:otherwise>
+ </jx:choose>
<tr>
<td>
- <!-- the +'' is to avoid nulls, which would cause the form field to be disabled -->
+ <!-- The "+''" construction is to avoid nulls (it forces them to be cast to the empty string).
+ Undefined values would cause the form field to be disabled.
+ -->
<input type="radio" name="asset" value="${asset.getPath()}"
onClick="updateData(
'${url}',
Modified: lenya/trunk/src/modules/resource/xslt/downloadLink.xsl
URL: http://svn.apache.org/viewvc/lenya/trunk/src/modules/resource/xslt/downloadLink.xsl?view=diff&rev=560734&r1=560733&r2=560734
==============================================================================
--- lenya/trunk/src/modules/resource/xslt/downloadLink.xsl (original)
+++ lenya/trunk/src/modules/resource/xslt/downloadLink.xsl Sun Jul 29 08:37:34 2007
@@ -64,7 +64,7 @@
<xsl:value-of select="format-number($contentLength div 1024, '#,###.##')"/>
</xsl:variable>
- <p class="asset">
+ <span class="asset">
<a href="lenya-document:{$uuid},lang={$language}" title="{text()}">
<xsl:call-template name="icon">
<xsl:with-param name="mimetype" select="$mimeType"/>
@@ -76,7 +76,7 @@
<xsl:value-of select="$title"/>
</a>
(<xsl:value-of select="number($size)"/> KB)
- </p>
+ </span>
</xsl:template>
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.