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

[email protected]
Newsgroups gmane.comp.cms.lenya.cvs
Message-ID <[email protected]>
Author: rfrovarp
Date: Wed Oct 28 18:49:51 2009
New Revision: 830719

URL: http://svn.apache.org/viewvc?rev=830719&view=rev
Log:
Allow FCK to edit textareas in forms.
Thanks  to Oleg Barmin for the patch and Rainer Schoepf for the reference to his TinyMCE patch for inspiration.

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

Modified: lenya/branches/BRANCH_2_0_X/src/modules/fckeditor/sitemap.xmap
URL: http://svn.apache.org/viewvc/lenya/branches/BRANCH_2_0_X/src/modules/fckeditor/sitemap.xmap?rev=830719&r1=830718&r2=830719&view=diff
==============================================================================
--- lenya/branches/BRANCH_2_0_X/src/modules/fckeditor/sitemap.xmap (original)
+++ lenya/branches/BRANCH_2_0_X/src/modules/fckeditor/sitemap.xmap Wed Oct 28 18:49:51 2009
@@ -61,6 +61,7 @@
         <map:transform type="uuid2url">
           <map:parameter name="urls" value="absolute"/>
         </map:transform>
+        <map:transform src="fallback://lenya/modules/fckeditor/xslt/page2edit.xsl" />
         <map:serialize type="xml-get"/>
       </map:match>
 

Added: lenya/branches/BRANCH_2_0_X/src/modules/fckeditor/xslt/page2edit.xsl
URL: http://svn.apache.org/viewvc/lenya/branches/BRANCH_2_0_X/src/modules/fckeditor/xslt/page2edit.xsl?rev=830719&view=auto
==============================================================================
--- lenya/branches/BRANCH_2_0_X/src/modules/fckeditor/xslt/page2edit.xsl (added)
+++ lenya/branches/BRANCH_2_0_X/src/modules/fckeditor/xslt/page2edit.xsl Wed Oct 28 18:49:51 2009
@@ -0,0 +1,21 @@
+<xsl:stylesheet version="1.0"
+    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+    xmlns:nav="http://apache.org/cocoon/lenya/navigation/1.0"
+    xmlns:xhtml="http://www.w3.org/1999/xhtml">
+  <!-- Escapes text areas so the forms with them
+       can be edited by FCK -->
+  <xsl:template match="xhtml:textarea">
+    <xsl:text>&lt;textarea</xsl:text>
+     <xsl:for-each select="@*">
+       <xsl:text> </xsl:text>
+       <xsl:value-of select="name()"/>
+       <xsl:text>="</xsl:text>
+       <xsl:value-of select="."/>
+       <xsl:text>"</xsl:text>
+     </xsl:for-each>
+    <xsl:text>&gt;</xsl:text>
+    <xsl:value-of select="."/>
+    <xsl:text>&lt;/textarea&gt;</xsl:text>
+  </xsl:template>
+
+</xsl:stylesheet>
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.