4 * Editing of various text files on the Citadel server.
11 * display the form for editing something (room info, bio, etc)
13 void display_edit(char *description, char *check_cmd,
14 char *read_cmd, char *save_cmd, int with_room_banner)
19 serv_getln(buf, sizeof buf);
22 safestrncpy(WC->ImportantMessage, &buf[4], sizeof WC->ImportantMessage);
26 if (with_room_banner) {
27 output_headers(1, 1, 1, 0, 0, 0);
30 output_headers(1, 1, 0, 0, 0, 0);
33 svprintf("BOXTITLE", WCS_STRING, _("Edit %s"), description);
34 do_template("beginbox");
36 wprintf("<div align=\"center\">");
37 wprintf(_("Enter %s below. Text is formatted to "
38 "the reader's screen width. To defeat the "
39 "formatting, indent a line at least one space."), description);
42 wprintf("<FORM METHOD=\"POST\" action=\"%s\">\n", save_cmd);
43 wprintf("<TEXTAREA NAME=\"msgtext\" wrap=soft "
44 "ROWS=10 COLS=80 WIDTH=80>\n");
46 serv_getln(buf, sizeof buf);
49 wprintf("</TEXTAREA><br /><br />\n");
50 wprintf("<INPUT TYPE=\"submit\" NAME=\"save_button\" VALUE=\"%s\">", _("Save changes"));
52 wprintf("<INPUT TYPE=\"submit\" NAME=\"cancel_button\" VALUE=\"%s\"><br />\n", _("Cancel"));
54 wprintf("</FORM></div>\n");
55 do_template("endbox");
61 * save a screen which was displayed with display_edit()
63 void save_edit(char *description, char *enter_cmd, int regoto)
67 if (strlen(bstr("save_button")) == 0) {
68 sprintf(WC->ImportantMessage,
69 _("Cancelled. %s was not saved."),
75 serv_getln(buf, sizeof buf);
77 safestrncpy(WC->ImportantMessage, &buf[4], sizeof WC->ImportantMessage);
81 text_to_server(bstr("msgtext"), 0);
85 smart_goto(WC->wc_roomname);
87 sprintf(WC->ImportantMessage,
88 _("%s has been saved."),