Update of /var/cvs/applications/searchrelate/templates
In directory james.mmbase.org:/tmp/cvs-serv22943

Modified Files:
        Searcher.js.jsp create.jspx 
Log Message:
added a feature 'extracreate' by which you can do something extra on create


See also: http://cvs.mmbase.org/viewcvs/applications/searchrelate/templates


Index: Searcher.js.jsp
===================================================================
RCS file: /var/cvs/applications/searchrelate/templates/Searcher.js.jsp,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -b -r1.28 -r1.29
--- Searcher.js.jsp     15 Jul 2008 14:19:41 -0000      1.28
+++ Searcher.js.jsp     25 Aug 2008 10:10:29 -0000      1.29
@@ -13,7 +13,7 @@
 
  *
  * @author Michiel Meeuwissen
- * @version $Id: Searcher.js.jsp,v 1.28 2008/07/15 14:19:41 michiel Exp $
+ * @version $Id: Searcher.js.jsp,v 1.29 2008/08/25 10:10:29 michiel Exp $
  */
 
 
@@ -387,6 +387,12 @@
     return id;
 }
 
+MMBaseSearcher.prototype.getId = function() {
+    var qid = this.getQueryId().substring("mm_related_".length);
+    qid = qid.substring(0, qid.indexOf("_"));
+    return qid;
+}
+
 MMBaseSearcher.prototype.getResultDiv = function() {
     return $(this.div).find("div.searchresult")[0]
 }
@@ -494,7 +500,11 @@
 MMBaseSearcher.prototype.create = function () {
     var rep = this.getResultDiv();
     var url = "${mm:link('/mmbase/searchrelate/create.jspx')}";
-    var params = { queryid: this.getQueryId(), context: this.context };
+    var params = {
+       queryid: this.getQueryId(),
+       id: this.getId(),
+       context: this.context
+    };
 
 
     var self = this;


Index: create.jspx
===================================================================
RCS file: /var/cvs/applications/searchrelate/templates/create.jspx,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- create.jspx 7 Jul 2008 16:21:17 -0000       1.10
+++ create.jspx 25 Aug 2008 10:10:29 -0000      1.11
@@ -6,12 +6,14 @@
     xmlns:fmt="http://java.sun.com/jsp/jstl/fmt";
     >
   <jsp:output omit-xml-declaration="true" />
+  <mm:cloud method="asis">
   <mm:content expires="0" type="text/html">
     <fmt:bundle basename="org.mmbase.searchrelate.resources.searchrelate">
-      <mm:cloud method="asis">
         <mm:import externid="queryid"  />
+        <mm:import externid="id"  />
         <mm:import externid="context"  />
         <mm:import from="session" externid="${queryid}" id="query" 
required="true" />
+        <mm:import from="session" externid="mm_related_${id}_extracreate" 
id="extracreate"   required="false" />
 
         <mm:form name="create"
                  page="/mmbase/searchrelate/create.jspx" commitonclose="false">
@@ -26,6 +28,7 @@
                   <input type="submit" value="${createmessage}" />
                   <input type="hidden"  name="s" value="submitted" />
                   <input type="hidden" name="queryid" value="${queryid}" />
+                  <input type="hidden" name="id"       value="${id}" />
                   <input type="hidden" name="context" value="${context}" />
                   <input type="hidden" name="nodemanager" id="nodemanager" 
value="${query.nodeManager.name}" />
                 </td>
@@ -52,6 +55,11 @@
                   </c:if>
                 </mm:fieldlist>
               </tbody>
+              <mm:log> Using ${extracreate} </mm:log>
+
+              <c:if test="${! empty extracreate}">
+                <mm:include page="${extracreate}" attributes="newnode" />
+              </c:if>
             </mm:createnode>
           </table>
           <mm:import externid="s" />
@@ -72,8 +80,8 @@
             <mm:cancel />
           </mm:present>
         </mm:form>
-      </mm:cloud>
     </fmt:bundle>
   </mm:content>
+  </mm:cloud>
 </div>
 
_______________________________________________
Cvs mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/cvs

Reply via email to