From: Wilfried Göesgens Date: Mon, 6 Aug 2007 21:58:44 +0000 (+0000) Subject: * have an abstract function print the menu boxes in the config area. X-Git-Tag: v7.86~3180 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=1166cb557e4c5ca0dcee699a38da9c62ccbee393 * have an abstract function print the menu boxes in the config area. * first draft of the shutdown menu. --- diff --git a/webcit/mainmenu.c b/webcit/mainmenu.c index a11dc66ae..4373c76a2 100644 --- a/webcit/mainmenu.c +++ b/webcit/mainmenu.c @@ -14,6 +14,7 @@ */ void display_main_menu(void) { + char buf[SIZ]; output_headers(1, 1, 1, 0, 0, 0); wprintf("
" @@ -120,71 +121,31 @@ void display_main_menu(void) wprintf("" ""); - svprintf("BOXTITLE", WCS_STRING, _("Your info")); - do_template("beginbox"); - - wprintf("\n"); - - do_template("endbox"); + print_menu_box(_("Your info"), "adminitems", 6, + "display_preferences", _("Change your preferences and settings"), + "display_reg", _("Update your contact information"), + "display_changepw", _("Change your password"), + "display_editbio", _("Enter your 'bio'"), + "display_editpic", _("Edit your online photo"), + "display_sieve", _("View/edit server-side mail filters")); wprintf(""); - svprintf("BOXTITLE", WCS_STRING, _("Advanced room commands")); - do_template("beginbox"); - - wprintf("\n"); - - do_template("endbox"); + snprintf(buf, SIZ, _("Zap (forget) this room (%s)"), WC->wc_roomname); + + if ((WC->axlevel >= 6) || (WC->is_room_aide)) + print_menu_box(_("Advanced room commands"),"adminitems", 5, + "display_editroom", _("Edit or delete this room"), + "display_private", _("Go to a 'hidden' room"), + "display_entroom", _("Create a new room"), + "display_zap",buf, + "zapped_list",_("List all forgotten rooms")); + else + print_menu_box(_("Advanced room commands"),"adminitems", 4, + "display_private", _("Go to a 'hidden' room"), + "display_entroom", _("Create a new room"), + "display_zap",buf, + "zapped_list",_("List all forgotten rooms")); wprintf("
"); wDumpContent(2); @@ -210,64 +171,28 @@ void display_aide_menu(void) " " "
"); - svprintf("BOXTITLE", WCS_STRING, _("Global Configuration")); - do_template("beginbox"); - - wprintf(""); - - do_template("endbox"); + print_menu_box(_("Global Configuration"), "adminitems", 4, + "display_siteconfig", _("Edit site-wide configuration"), + "display_inetconf",_("Domain names and Internet mail configuration"), + "display_netconf", _("Configure replication with other Citadel servers"), + "display_smtpqueue", _("View the outbound SMTP queue")); + + print_menu_box(_("Shutdown Citadel"), "adminitems", 3, + "server_shutdown?when=now", _("Restart Imediate"), + "server_shutdown?when=page", _("Restart after paging Users"), + "server_shutdown?when=idle", _("Restart when everybody is idle.")); wprintf(""); - svprintf("BOXTITLE", WCS_STRING, _("User account management")); - do_template("beginbox"); - - wprintf(""); - - do_template("endbox"); + print_menu_box(_("User account management"), "adminitems", 2, + "select_user_to_edit", _("Add, change, delete user accounts"), + "validate", _("Validate new users")); wprintf("
"); - svprintf("BOXTITLE", WCS_STRING, _("Rooms and Floors")); - do_template("beginbox"); - - wprintf(""); - - do_template("endbox"); + print_menu_box(_("Rooms and Floors"), "adminitems", 1, + "display_floorconfig", _("Add, change, or delete floors")); wprintf("
"); wDumpContent(2); diff --git a/webcit/siteconfig.c b/webcit/siteconfig.c index ac50269ce..61593d391 100644 --- a/webcit/siteconfig.c +++ b/webcit/siteconfig.c @@ -561,7 +561,7 @@ void display_siteconfig(void) sprintf(&funambol[strlen(funambol)], ""); sprintf(&funambol[strlen(funambol)], _("Funambol auth details (user:pass in Base64)")); sprintf(&funambol[strlen(funambol)], ""); - sprintf(&funambol[strlen(funambol)], "", buf); + sprintf(&funambol[strlen(funambol)], "", buf); sprintf(&funambol[strlen(funambol)], "\n"); break; } diff --git a/webcit/webcit.c b/webcit/webcit.c index 785d2287c..800dc40d1 100644 --- a/webcit/webcit.c +++ b/webcit/webcit.c @@ -13,6 +13,9 @@ #include "webserver.h" #include "mime_parser.h" +#include +#include + /** * String to unset the cookie. * Any date "in the past" will work, so I chose my birthday, right down to @@ -549,6 +552,39 @@ void http_transmit_thing(char *thing, size_t length, char *content_type, client_write(thing, (size_t)length); } +/** + * \brief print menu box like used in the floor view or admin interface. + * This function takes pair of strings as va_args, + * \param Title Title string of the box + * \param Class CSS Class for the box + * \param nLines How many string pairs should we print? (URL, UrlText) + * \param ... Pairs of URL Strings and their Names + */ +void print_menu_box(char* Title, char *Class, int nLines, ...) +{ + va_list arg_list; + long i; + + svprintf("BOXTITLE", WCS_STRING, Title); + do_template("beginbox"); + + wprintf(""); + + do_template("endbox"); +} /** diff --git a/webcit/webcit.h b/webcit/webcit.h index 2e1a006cf..43ecf6940 100644 --- a/webcit/webcit.h +++ b/webcit/webcit.h @@ -484,6 +484,7 @@ void output_headers( int do_httpheaders, int cache); void wprintf(const char *format,...); void output_static(char *what); +void print_menu_box(char* Title, char *Class, int nLines, ...); void stresc(char *target, char *strbuf, int nbsp, int nolinebreaks); void escputs(char *strbuf); void url(char *buf);