Author: mfang
Date: 2009-06-04 04:28:08 +0200 (Thu, 04 Jun 2009)
New Revision: 35666

Added:
   CMSContainer/trunk/CMSContainer/cmsc/taglib/resources/META-INF/tags/field.tag
Log:
CMSC-479 Create a cmsc:field tag which will help with making one-click edit 
templates

Added: 
CMSContainer/trunk/CMSContainer/cmsc/taglib/resources/META-INF/tags/field.tag
===================================================================
--- 
CMSContainer/trunk/CMSContainer/cmsc/taglib/resources/META-INF/tags/field.tag   
                            (rev 0)
+++ 
CMSContainer/trunk/CMSContainer/cmsc/taglib/resources/META-INF/tags/field.tag   
    2009-06-04 02:28:08 UTC (rev 35666)
@@ -0,0 +1,24 @@
+<%@ tag body-content="empty" 
+%><%@ taglib uri="http://www.mmbase.org/mmbase-taglib-2.0"; prefix="mm" 
+%><%@ taglib uri="http://java.sun.com/jsp/jstl/core"; prefix="c" 
+%><%@ attribute name="elementid" required="true" rtexprvalue="true"
+%><%@ attribute name="name" required="true" rtexprvalue="true"
+%><%@ attribute name="edit" required="false" rtexprvalue="true"
+%><%@ attribute name="container" required="false" rtexprvalue="true"
+%><%@ attribute name="options" required="false" rtexprvalue="true"
+%><c:set var="edit" value="${empty edit ? false :edit }"/>
+<c:set var="container" value="${empty container ? 'div' :container }"/>
+<c:if test="${edit}">
+   <${container} id="content_${elementId}_${name}" class="${name}">
+</c:if>
+<mm:field name="${name}" escape="none">
+  <mm:isnotempty>
+    <p><mm:write /></p>
+    <c:if test="${edit}">
+   </${container}>
+   <script type="text/javascript">
+      new InPlaceEditor.Local('content_${elementId}_${name}', {${options}});
+   </script>
+  </c:if>
+  </mm:isnotempty>
+</mm:field>
\ No newline at end of file

_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to