X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fmainmenu.c;h=556af35c6bf80560e36f46b13fa9f58d3d910afc;hb=8d8c5af38e5026933ea3b9d5eb1b75f276df1d99;hp=c67f715c85003e8860b627ad22915e0a97782a32;hpb=687affd55d895a8e062a558e64aef2ad92daf9ca;p=citadel.git diff --git a/webcit/mainmenu.c b/webcit/mainmenu.c index c67f715c8..556af35c6 100644 --- a/webcit/mainmenu.c +++ b/webcit/mainmenu.c @@ -1,189 +1,269 @@ -/* $Id$ */ - - - - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +/* + * $Id$ + */ +/** + * \defgroup DispAdvancedMenu Displays the "advanced" (main) menu. + * \ingroup MenuInfrastructure + * + */ +/*@{*/ #include "webcit.h" - - -/* - * The Main Menu +/** + * \brief The Main Menu */ void display_main_menu(void) { - output_headers(1); - - wprintf("
"); - wprintf("Basic commands\n"); - wprintf("
\n"); - wprintf("
"); - - wprintf("
"); /* start of first column */ - - wprintf("\n"); +/** + * \brief System administration menu + */ +void display_aide_menu(void) +{ + output_headers(1, 1, 2, 0, 0, 0); + wprintf("
\n" + "
" + ""); + wprintf(_("System Administration Menu")); + wprintf("" + "
\n" + "
\n
\n" + ); + wprintf("
" + "
"); - wprintf("
"); + svprintf("BOXTITLE", WCS_STRING, _("Global Configuration")); + do_template("beginbox"); - wprintf("
"); - wprintf("Advanced room commands\n"); - wprintf("
\n"); + wprintf("" + ""); + wprintf(_("Edit site-wide configuration")); + wprintf("
\n"); - wprintf("
"); - wprintf("\n"); + svprintf("BOXTITLE", WCS_STRING, _("User account management")); + do_template("beginbox"); - wprintf(""); + wprintf("" + ""); + wprintf(_("Add, change, delete user accounts")); + wprintf("
\n"); - if ((WC->axlevel >= 6) || (WC->is_room_aide)) { - wprintf("
"); - wprintf("Administrative functions\n"); - wprintf("
\n"); + wprintf("" + ""); + wprintf(_("Validate new users")); + wprintf("
\n"); - wprintf("\n"); - } - wprintf("
"); + wprintf("
"); wDumpContent(2); } @@ -191,38 +271,52 @@ void display_main_menu(void) -/* - * Display the screen to enter a generic server command +/** + * \brief Display the screen to enter a generic server command */ void display_generic(void) { - output_headers(1); - - wprintf("
"); - wprintf("Enter a server command\n"); - wprintf("
\n"); + output_headers(1, 1, 2, 0, 0, 0); + wprintf("
\n" + "
" + ""); + wprintf(_("Enter a server command")); + wprintf("
\n" + "
\n
\n" + ); + + wprintf("
" + "
\n"); wprintf("
"); - wprintf("This screen allows you to enter Citadel server commands which are\n"); - wprintf("not supported by WebCit. If you do not know what that means,\n"); - wprintf("then this screen will not be of much use to you.
\n"); + wprintf(_("This screen allows you to enter Citadel server commands which are " + "not supported by WebCit. If you do not know what that means, " + "then this screen will not be of much use to you.")); + wprintf("
\n"); - wprintf("
\n"); + wprintf("\n"); - wprintf("Enter command:
\n"); - wprintf("
\n"); + wprintf(_("Enter command:")); + wprintf("

\n"); - wprintf("Command input (if requesting SEND_LISTING transfer mode):
\n"); - wprintf("\n"); + wprintf(_("Command input (if requesting SEND_LISTING transfer mode):")); + wprintf("

\n"); - wprintf(""); - wprintf("
\n"); + wprintf(""); + wprintf(_("Detected host header is %s://%s"), (is_https ? "https" : "http"), WC->http_host); + wprintf("\n"); + wprintf("", _("Send command")); + wprintf(" "); + wprintf("
\n", _("Cancel")); wprintf("
\n"); + wprintf("
\n"); wDumpContent(1); } +/** + * \brief Interactive window to perform generic Citadel server commands. + */ void do_generic(void) { char buf[SIZ]; @@ -230,34 +324,32 @@ void do_generic(void) char *junk; size_t len; - if (strcasecmp(bstr("sc"), "Send command")) { + if (strlen(bstr("sc_button")) == 0) { display_main_menu(); return; } - output_headers(1); + output_headers(1, 1, 0, 0, 0, 0); serv_printf("%s", bstr("g_cmd")); - serv_gets(buf); + serv_getln(buf, sizeof buf); - wprintf("
"); - wprintf("Server command results\n"); - wprintf("
\n"); + svprintf("BOXTITLE", WCS_STRING, _("Server command results")); + do_template("beginbox"); wprintf("
Command:"); escputs(bstr("g_cmd")); wprintf("
Result:"); escputs(buf); - wprintf("

\n"); + wprintf("
\n"); if (buf[0] == '8') { serv_printf("\n\n000"); } if ((buf[0] == '1') || (buf[0] == '8')) { - while (serv_gets(gcontent), strcmp(gcontent, "000")) { + while (serv_getln(gcontent, sizeof gcontent), strcmp(gcontent, "000")) { escputs(gcontent); - wprintf("
\n"); + wprintf("
\n"); } wprintf("000"); } @@ -278,24 +370,23 @@ void do_generic(void) serv_write(junk, len); free(junk); } - wprintf("
"); - wprintf("Enter another command
\n"); - wprintf("Return to menu\n"); + wprintf("
"); + wprintf("Enter another command
\n"); + wprintf("Return to menu\n"); + do_template("endbox"); wDumpContent(1); } - - -/* - * Display the menubar. Set as_single_page to - * display HTML headers and footers -- otherwise it's assumed +/** + * \brief Display the menubar. + * \param as_single_page Set to display HTML headers and footers -- otherwise it's assumed * that the menubar is being embedded in another page. */ void display_menubar(int as_single_page) { if (as_single_page) { - output_headers(0); + output_headers(0, 0, 0, 0, 0, 0); wprintf("\n" "\n" "MenuBar\n" @@ -303,10 +394,10 @@ void display_menubar(int as_single_page) { "BODY { text-decoration: none; }\n" "\n" "\n"); - do_template("background.html"); + do_template("background"); } - do_template("menubar.html"); + do_template("menubar"); if (as_single_page) { wDumpContent(2); @@ -314,3 +405,6 @@ void display_menubar(int as_single_page) { } + + +/*@}*/