2 * Copyright (c) 1996-2012 by the citadel.org team
4 * This program is open source software. You can redistribute it and/or
5 * modify it under the terms of the GNU General Public License, version 3.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
16 * save a screen which was displayed with display_edit()
17 * description the window title???
18 * enter_cmd which command to enter at the citadel server???
19 * regoto should we go to that room again after executing that command?
21 void save_edit(char *description, char *enter_cmd, int regoto)
26 if (!havebstr("save_button")) {
27 AppendImportantMessage(_("Cancelled. %s was not saved."), -1);
31 templ = sbstr("template");
34 StrBuf_ServGetln(Line);
35 if (GetServerStatusMsg(Line, NULL, 1, 0) != 4) {
36 putlbstr("success", 0);
39 output_headers(1, 0, 0, 0, 0, 0);
40 DoTemplate(SKEY(templ), NULL, &NoCtx);
49 text_to_server(bstr("msgtext"));
52 AppendImportantMessage(description, -1);
53 AppendImportantMessage(_(" has been saved."), -1);
54 putlbstr("success", 1);
56 output_headers(1, 0, 0, 0, 0, 0);
57 DoTemplate(SKEY(templ), NULL, &NoCtx);
61 smart_goto(WC->CurRoom.name);
69 void editinfo(void) {save_edit(_("Room info"), "EINF 1", 1);}
70 void editbio(void) { save_edit(_("Your bio"), "EBIO", 0); }
76 WebcitAddUrlHandler(HKEY("editinfo"), "", 0, editinfo, 0);
77 WebcitAddUrlHandler(HKEY("editbio"), "", 0, editbio, 0);