X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fmainmenu.c;h=0436a77a270abb0c7783ebff2052da8ed70f8b32;hb=bedf5c0b955473d8ad02eaf628e8d209f534f2b6;hp=4d28b103b47845662df0e2118f0375e2af414c22;hpb=fcf62632708da42a9fd1a603dc7742426aed039b;p=citadel.git diff --git a/webcit/mainmenu.c b/webcit/mainmenu.c index 4d28b103b..0436a77a2 100644 --- a/webcit/mainmenu.c +++ b/webcit/mainmenu.c @@ -1,294 +1,363 @@ -/* $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" +/** + * \brief The Main Menu + */ +void display_main_menu(void) +{ + output_headers(1, 1, 1, 0, 0, 0); + wprintf("
" + "" + "
\n"); + svprintf("BOXTITLE", WCS_STRING, _("Basic commands")); + do_template("beginbox"); + wprintf("\n" + "" + "" + "" + "
"); /**< start of first column */ -/* - * menu of commands (just the menu html itself) - */ + wprintf("\n"); + wprintf("
"); - wprintf("
\n"); + svprintf("BOXTITLE", WCS_STRING, _("Your info")); + do_template("beginbox"); - wprintf("\n"); -} + wprintf("\n"); + wprintf("
"); - wprintf("
"); + wprintf("
" + " " + "
"); - if ((WC->axlevel >= 6) || (WC->is_room_aide)) { - wprintf("
"); - wprintf("Administrative functions\n"); - wprintf("
\n"); + svprintf("BOXTITLE", WCS_STRING, _("Global Configuration")); + do_template("beginbox"); - wprintf("
"); + wprintf("
  • "); + wprintf(_("View the outbound SMTP queue")); + wprintf("
  • \n"); - wprintf("
    "); - wprintf("Basic commands\n"); - wprintf("
    \n"); + wprintf(""); -} + do_template("endbox"); + wprintf("
    "); + svprintf("BOXTITLE", WCS_STRING, _("User account management")); + do_template("beginbox"); + wprintf(""); + do_template("endbox"); -/* - * Display the screen to enter a generic server command - */ -void display_generic(void) -{ - output_headers(1); + wprintf("
    "); + + svprintf("BOXTITLE", WCS_STRING, _("Rooms and Floors")); + do_template("beginbox"); + + wprintf("
      "); - wprintf("
      "); - wprintf("Enter a server command\n"); - wprintf("
      \n"); + wprintf("
    • "); + wprintf(_("Add, change, or delete floors")); + 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("
    "); + + do_template("endbox"); + + wprintf("
    "); + wDumpContent(2); +} - wprintf("
    \n"); - wprintf("Enter command:
    \n"); - wprintf("
    \n"); - wprintf("Command input (if requesting SEND_LISTING transfer mode):
    \n"); - wprintf("\n"); - wprintf(""); - wprintf("
    \n"); - wprintf("
    \n"); +/** + * \brief Display the screen to enter a generic server command + */ +void display_generic(void) +{ + 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 " + "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", WC->nonce); + + wprintf(_("Enter command:")); + wprintf("

    \n"); + + wprintf(_("Command input (if requesting SEND_LISTING transfer mode):")); + 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[256]; - char gcontent[256]; + char buf[SIZ]; + char gcontent[SIZ]; 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:"); + wprintf("
    Command:"); escputs(bstr("g_cmd")); - wprintf("
    Result:"); + 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"); } @@ -309,48 +378,34 @@ 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) { - FILE *menubar_body; - char buf[256]; if (as_single_page) { - output_headers(0); - wprintf("\n" - "\n" - "MenuBar\n" - "\n" - "\n" - "\n"); + output_headers(0, 0, 0, 0, 0, 0); + wprintf("\n" + "\n" + "MenuBar\n" + "\n" + "\n"); + do_template("background"); } - menubar_body = fopen("static/menubar.html", "r"); - if (menubar_body == NULL) { - wprintf("menubar
    %s", strerror(errno)); - } else { - while (fgets(buf, sizeof(buf), menubar_body) != NULL) { - wprintf("%s", buf); - } - fclose(menubar_body); - } - + do_template("menubar"); if (as_single_page) { wDumpContent(2); @@ -358,3 +413,6 @@ void display_menubar(int as_single_page) { } + + +/*@}*/