X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Ffloors.c;h=fb268ff4830d461d3d9b286781f8e4534d447eec;hb=0f72e15a12dcc90e3dbfc01ff35c0e910a8d419e;hp=f2ec182fa5136f1857c65b2d31413d0a527b9271;hpb=2779defa829432785fd086052bb7234a02289c1d;p=citadel.git diff --git a/webcit/floors.c b/webcit/floors.c index f2ec182fa..fb268ff48 100644 --- a/webcit/floors.c +++ b/webcit/floors.c @@ -1,37 +1,23 @@ /* - * Administrative screens for floor maintenance - * + * $Id$ */ +/** + * \defgroup AdminFloor Administrative screens for floor maintenance + * \ingroup CitadelConfig + */ +/*@{*/ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include "webcit.h" #include "webserver.h" -/* +/** + * \brief Display floor config * Display floor configuration. If prepend_html is not NULL, its contents * will be displayed at the top of the screen. + * \param prepend_html pagetitle to prepend */ void display_floorconfig(char *prepend_html) { @@ -41,84 +27,113 @@ void display_floorconfig(char *prepend_html) char floorname[SIZ]; int refcount; - output_headers(1, 1, 2, 0, 0, 0, 0); + output_headers(1, 1, 2, 0, 0, 0); + wprintf("
\n"); + wprintf("

"); + wprintf(_("Add/change/delete floors")); + wprintf("

"); + wprintf("
\n"); + wprintf("
\n"); + if (prepend_html != NULL) { + wprintf("
"); client_write(prepend_html, strlen(prepend_html)); + wprintf("

\n"); } - serv_printf("LFLR"); /* FIXME put a real test here */ - serv_gets(buf); + serv_printf("LFLR"); + serv_getln(buf, sizeof buf); if (buf[0] != '1') { - wprintf("
\n"); - wprintf(""); wprintf(""); + "VALUE=\"%s\">" + "", _("Change name")); + + wprintf("\n", refcount); - wprintf("\n", refcount); + wprintf("", _("Change CSS")); + + wprintf("\n"); } wprintf("" - "" - "\n"); + "\n", _("Create new floor")); - wprintf("
"); - wprintf("Error\n"); + wprintf("
"); + wprintf(""); + wprintf(_("Error")); + wprintf("\n"); wprintf("
\n"); - wprintf("\n
\n"); wprintf("%s
\n", &buf[4]); wDumpContent(1); return; } - svprintf("BOXTITLE", WCS_STRING, "Floor configuration"); - do_template("beginbox"); - - wprintf("\n" - "" - "" - "\n" - ); - - while (serv_gets(buf), strcmp(buf, "000")) { + wprintf("
" + "
Floor numberFloor nameNumber of rooms
\n" + "\n"); + + while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) { floornum = extract_int(buf, 0); - extract(floorname, buf, 1); + extract_token(floorname, buf, 1, '|', sizeof floorname); refcount = extract_int(buf, 2); wprintf("
"); + wprintf(_("Floor number")); + wprintf(""); + wprintf(_("Floor name")); + wprintf(""); + wprintf(_("Number of rooms")); + wprintf(""); + wprintf(_("Floor CSS")); + wprintf("
%d", floornum); if (refcount == 0) { wprintf("" - "" - "(delete floor)" - "
", floornum - ); + "" + "", floornum); + wprintf(_("(delete floor)")); + wprintf("
"); } wprintf("" - "(edit graphic)", - floornum); - wprintf("
"); + "", floornum); + wprintf(_("(edit graphic)")); + wprintf("
"); wprintf("
" - "
" + "" "" "\n", floornum, floorname); + wprintf("\n", WC->nonce); wprintf("" - "
%d%d
" + "
" + "" + "\n", + floornum, floorname); + wprintf("\n", WC->nonce); + wprintf("" + "
 
" - ""); + wprintf("\n", WC->nonce); + wprintf("\n" "" + "VALUE=\"%s\">" "
 
 
\n"); - do_template("endbox"); + wprintf("
\n"); wDumpContent(1); } - +/** + * \brief delete the actual floor + */ void delete_floor(void) { int floornum; char buf[SIZ]; @@ -127,20 +142,21 @@ void delete_floor(void) { floornum = atoi(bstr("floornum")); serv_printf("KFLR %d|1", floornum); - serv_gets(buf); + serv_getln(buf, sizeof buf); if (buf[0] == '2') { - sprintf(message, "Floor has been deleted." - "

\n"); + sprintf(message, _("Floor has been deleted.")); } else { - sprintf(message, "%s>
", &buf[4]); + sprintf(message, "%s", &buf[4]); } display_floorconfig(message); } - +/** + * \brief tart creating a new floor + */ void create_floor(void) { char buf[SIZ]; char message[SIZ]; @@ -149,14 +165,20 @@ void create_floor(void) { strcpy(floorname, bstr("floorname")); serv_printf("CFLR %s|1", floorname); - serv_gets(buf); + serv_getln(buf, sizeof buf); - sprintf(message, "%s>
", &buf[4]); + if (buf[0] == '2') { + sprintf(message, _("New floor has been created.")); + } else { + sprintf(message, "%s", &buf[4]); + } display_floorconfig(message); } - +/** + * \brief rename this floor + */ void rename_floor(void) { int floornum; char buf[SIZ]; @@ -167,11 +189,12 @@ void rename_floor(void) { strcpy(floorname, bstr("floorname")); serv_printf("EFLR %d|%s", floornum, floorname); - serv_gets(buf); + serv_getln(buf, sizeof buf); - sprintf(message, "%s>
", &buf[4]); + sprintf(message, "%s", &buf[4]); display_floorconfig(message); } +/*@}*/