]> code.citadel.org Git - citadel.git/blobdiff - webcit/sysmsgs.c
* add new 'Context' Parameter to the template call
[citadel.git] / webcit / sysmsgs.c
index 3c139232ae41542dd94e79bc5cfff0823e283e1d..d626fbc6b11e2eb370257c3c731b5144edff3d8a 100644 (file)
@@ -37,14 +37,14 @@ void display_edit(char *description, char *check_cmd,
                output_headers(1, 1, 0, 0, 0, 0);
        }
 
-       svprintf("BOXTITLE", WCS_STRING, _("Edit %s"), description);
-       do_template("beginbox");
+       svprintf(HKEY("BOXTITLE"), WCS_STRING, _("Edit %s"), description);
+       do_template("beginbox", NULL);
 
        wprintf(_("Enter %s below. Text is formatted to the reader's browser."
                " A newline is forced by preceding the next line by a blank."), description);
 
        wprintf("<form method=\"post\" action=\"%s\">\n", save_cmd);
-       wprintf("<input type=\"hidden\" name=\"nonce\" value=\"%ld\">\n", WC->nonce);
+       wprintf("<input type=\"hidden\" name=\"nonce\" value=\"%d\">\n", WC->nonce);
        wprintf("<textarea name=\"msgtext\" wrap=soft "
                "rows=10 cols=80 width=80>\n");
        serv_puts(read_cmd);
@@ -57,7 +57,7 @@ void display_edit(char *description, char *check_cmd,
        wprintf("<input type=\"submit\" name=\"cancel_button\" value=\"%s\"><br />\n", _("Cancel"));
        wprintf("</div></form>\n");
 
-       do_template("endbox");
+       do_template("endbox", NULL);
        wDumpContent(1);
 }
 
@@ -72,7 +72,7 @@ void save_edit(char *description, char *enter_cmd, int regoto)
 {
        char buf[SIZ];
 
-       if (IsEmptyStr(bstr("save_button"))) {
+       if (!havebstr("save_button")) {
                sprintf(WC->ImportantMessage,
                        _("Cancelled.  %s was not saved."),
                        description);
@@ -101,4 +101,23 @@ void save_edit(char *description, char *enter_cmd, int regoto)
 }
 
 
+void display_editinfo(void){ display_edit(_("Room info"), "EINF 0", "RINF", "editinfo", 1);}
+void editinfo(void) {save_edit(_("Room info"), "EINF 1", 1);}
+void display_editbio(void) {
+       char buf[SIZ];
+
+       snprintf(buf, SIZ, "RBIO %s", WC->wc_fullname);
+       display_edit(_("Your bio"), "NOOP", buf, "editbio", 3);
+}
+void editbio(void) { save_edit(_("Your bio"), "EBIO", 0); }
+
+void 
+InitModule_SYSMSG
+(void)
+{
+       WebcitAddUrlHandler(HKEY("display_editinfo"), display_editinfo, 0);
+       WebcitAddUrlHandler(HKEY("editinfo"), editinfo, 0);
+       WebcitAddUrlHandler(HKEY("display_editbio"), display_editbio, 0);
+       WebcitAddUrlHandler(HKEY("editbio"), editbio, 0);
+}
 /*@}*/