svn commit: r794367 - in /lenya/branches/BRANCH_2_0_X/src/modules/tinymce: sitemap.xmap xslt/page2edit.xsl

[email protected]
Newsgroups gmane.comp.cms.lenya.cvs
Message-ID <[email protected]>
Author: ragaller
Date: Wed Jul 15 19:02:29 2009
New Revision: 794367

URL: http://svn.apache.org/viewvc?rev=794367&view=rev
Log:
handle validation error in a decent manner: give the user the edited content back and stay in the editor (yeah) - Thanks to Rainer Schöpf for the patch

Modified:
    lenya/branches/BRANCH_2_0_X/src/modules/tinymce/sitemap.xmap
    lenya/branches/BRANCH_2_0_X/src/modules/tinymce/xslt/page2edit.xsl

Modified: lenya/branches/BRANCH_2_0_X/src/modules/tinymce/sitemap.xmap
URL: http://svn.apache.org/viewvc/lenya/branches/BRANCH_2_0_X/src/modules/tinymce/sitemap.xmap?rev=794367&r1=794366&r2=794367&view=diff
==============================================================================
--- lenya/branches/BRANCH_2_0_X/src/modules/tinymce/sitemap.xmap (original)
+++ lenya/branches/BRANCH_2_0_X/src/modules/tinymce/sitemap.xmap Wed Jul 15 19:02:29 2009
@@ -85,6 +85,7 @@
                   <map:parameter name="usecaseName" value="{request-param:lenya.usecase}"/>
                   <map:parameter name="publicationId" value="{page-envelope:publication-id}"/>
                   <map:parameter name="locale" value="{request:locale}"/>
+                  <map:parameter name="content" value="{request-param:tinymce.content}"/>
                 </map:transform>
               </map:when>
               <map:otherwise>

Modified: lenya/branches/BRANCH_2_0_X/src/modules/tinymce/xslt/page2edit.xsl
URL: http://svn.apache.org/viewvc/lenya/branches/BRANCH_2_0_X/src/modules/tinymce/xslt/page2edit.xsl?rev=794367&r1=794366&r2=794367&view=diff
==============================================================================
--- lenya/branches/BRANCH_2_0_X/src/modules/tinymce/xslt/page2edit.xsl (original)
+++ lenya/branches/BRANCH_2_0_X/src/modules/tinymce/xslt/page2edit.xsl Wed Jul 15 19:02:29 2009
@@ -17,6 +17,7 @@
 <xsl:param name="usecaseName" select="'tinymce.ERROR'"/>
 <xsl:param name="publicationId" select="'tinymce.ERROR'" />
 <xsl:param name="locale" select="'tinymce.ERROR'"/>
+<xsl:param name="content" select="''"/>
 
 
 <!--
@@ -191,7 +192,7 @@
   </xsl:for-each>
     <!-- insert usecase messages, if any -->
     <xsl:apply-templates select="/tinymceWrapper/xhtml:div[@class='lenyaInfoBox']"/>
-  <xsl:if test="not(/tinymceWrapper/xhtml:div[@class = 'lenyaInfoBox']/*)">
+<!--    <xsl:if test="not(/tinymceWrapper/xhtml:div[@class = 'lenyaInfoBox']/*)">-->
     <!-- insert tinymce form hook -->
       <xsl:comment>special code for the tinymce.edit usecase view</xsl:comment>
       <xsl:text>
@@ -211,6 +212,9 @@
           <textarea id="tinymce.content" name="tinymce.content" style="width:100%">
             <xsl:choose>
               <!-- firefox bug workaround: prevent <textarea/> from collapsing if empty -->
+              <xsl:when test="$content!='' and /tinymceWrapper/xhtml:div[@class = 'lenyaInfoBox']/*">
+                <xsl:value-of select="$content" />
+              </xsl:when>
               <xsl:when test=".//*">
                 <xsl:apply-templates/>
               </xsl:when>
@@ -228,7 +232,7 @@
           <xsl:text>
       </xsl:text>
       </form>
-    </xsl:if>
+<!--    </xsl:if>-->
     <xsl:text>
     </xsl:text>
 </xsl:copy>
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.