]> code.citadel.org Git - citadel.git/blobdiff - webcit/vcard_edit.c
* add new 'Context' Parameter to the template call
[citadel.git] / webcit / vcard_edit.c
index a4067e104ee99bc739a4b6460829cc2e89e41504..6eabd801c3080500ea98a4514122cf0b7b05d771 100644 (file)
@@ -7,7 +7,6 @@
  */
 /*@{*/
 #include "webcit.h"
-#include "vcard.h"
 
 /**
  * \brief Edit the vCard component of a MIME message.  
@@ -188,11 +187,11 @@ void do_edit_vcard(long msgnum, char *partnum, char *return_to, char *force_room
        /** Display the form */
        output_headers(1, 1, 1, 0, 0, 0);
 
-       svprintf("BOXTITLE", WCS_STRING, _("Edit contact information"));
-       do_template("beginbox");
+       svput("BOXTITLE", WCS_STRING, _("Edit contact information"));
+       do_template("beginbox", NULL);
 
        wprintf("<form method=\"POST\" action=\"submit_vcard\">\n");
-       wprintf("<input type=\"hidden\" name=\"nonce\" value=\"%ld\">\n", WC->nonce);
+       wprintf("<input type=\"hidden\" name=\"nonce\" value=\"%d\">\n", WC->nonce);
 
        if (force_room != NULL) {
                wprintf("<input type=\"hidden\" name=\"force_room\" value=\"");
@@ -361,7 +360,7 @@ void do_edit_vcard(long msgnum, char *partnum, char *return_to, char *force_room
        );
        
        wprintf("</td></tr></table>\n");
-       do_template("endbox");
+       do_template("endbox", NULL);
        wDumpContent(1);
 }
 
@@ -373,7 +372,7 @@ void edit_vcard(void) {
        long msgnum;
        char *partnum;
 
-       msgnum = atol(bstr("msgnum"));
+       msgnum = lbstr("msgnum");
        partnum = bstr("partnum");
        do_edit_vcard(msgnum, partnum, "", NULL);
 }
@@ -389,12 +388,12 @@ void submit_vcard(void) {
        char buf[SIZ];
        int i;
 
-       if (IsEmptyStr(bstr("ok_button"))) { 
+       if (!havebstr("ok_button")) { 
                readloop("readnew");
                return;
        }
 
-       if (!IsEmptyStr(bstr("force_room"))) {
+       if (havebstr("force_room")) {
                gotoroom(bstr("force_room"));
        }
 
@@ -486,4 +485,12 @@ void submit_vcard(void) {
 
 
 
+void 
+InitModule_VCARD
+(void)
+{
+       WebcitAddUrlHandler(HKEY("edit_vcard"), edit_vcard, 0);
+       WebcitAddUrlHandler(HKEY("submit_vcard"), submit_vcard, 0);
+}
+
 /*@}*/