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);
33 StrBuf_ServGetln(Line);
34 if (GetServerStatusMsg(Line, NULL, 1, 0) != 4) {
40 text_to_server(bstr("msgtext"));
43 templ=sbstr("template");
44 AppendImportantMessage(description, -1);
45 AppendImportantMessage(_(" has been saved."), -1);
47 DoTemplate(SKEY(templ), NULL, &NoCtx);
50 smart_goto(WC->CurRoom.name);
58 void editinfo(void) {save_edit(_("Room info"), "EINF 1", 1);}
59 void editbio(void) { save_edit(_("Your bio"), "EBIO", 0); }
65 WebcitAddUrlHandler(HKEY("editinfo"), "", 0, editinfo, 0);
66 WebcitAddUrlHandler(HKEY("editbio"), "", 0, editbio, 0);