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, 0);
30 output_headers(1, 1, 0, 0, 0, 0, 0);
33 svprintf("BOXTITLE", WCS_STRING, "Edit %s", description);
34 do_template("beginbox");
36 wprintf("<CENTER>Enter %s below. Text is formatted to\n", description);
37 wprintf("the <EM>reader's</EM> screen width. To defeat the\n");
38 wprintf("formatting, indent a line at least one space. \n");
41 wprintf("<FORM METHOD=\"POST\" ACTION=\"%s\">\n", save_cmd);
42 wprintf("<TEXTAREA NAME=\"msgtext\" wrap=soft "
43 "ROWS=10 COLS=80 WIDTH=80>\n");
45 serv_getln(buf, sizeof buf);
48 wprintf("</TEXTAREA><br /><br />\n");
49 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Save\">");
51 wprintf("<INPUT TYPE=\"submit\" NAME=\"sc\" VALUE=\"Cancel\"><br />\n");
53 wprintf("</FORM></CENTER>\n");
54 do_template("endbox");
60 * save a screen which was displayed with display_edit()
62 void save_edit(char *description, char *enter_cmd, int regoto)
66 if (strcmp(bstr("sc"), "Save")) {
67 sprintf(WC->ImportantMessage,
68 "Cancelled. %s was not saved.\n", description);
73 serv_getln(buf, sizeof buf);
75 safestrncpy(WC->ImportantMessage, &buf[4], sizeof WC->ImportantMessage);
79 text_to_server(bstr("msgtext"), 0);
83 smart_goto(WC->wc_roomname);
85 sprintf(WC->ImportantMessage,
86 "%s has been saved.\n", description);