X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=webcit%2Fsummary.c;h=1146f51540d3148ebb9fa384cbc80a58fabcb5a8;hb=1e32899153e9e52aaec1e651e0c33a563b8aaed8;hp=a9cddadf9b35dbf56a7fb794ac9eae06d46c8c96;hpb=0ea677d5cd4cac6f4b097b227fcd9fc6b53ca079;p=citadel.git diff --git a/webcit/summary.c b/webcit/summary.c index a9cddadf9..1146f5154 100644 --- a/webcit/summary.c +++ b/webcit/summary.c @@ -1,46 +1,43 @@ /* * $Id$ - * - * Displays the "Summary Page" */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +/** + * \defgroup SymaryFuncs Displays the "Summary Page" + * \ingroup WebcitDisplayItems + */ +/*@{*/ #include "webcit.h" -/* - * Display today's date in a friendly format +/** + * \brief Display today's date in a friendly format */ void output_date(void) { struct tm tm; time_t now; - static char *wdays[] = { - "Sunday", "Monday", "Tuesday", "Wednesday", - "Thursday", "Friday", "Saturday" - }; - static char *months[] = { - "January", "February", "March", "April", "May", "June", "July", - "August", "September", "October", "November", "December" - }; + static char *wdays[7]; + static char *months[12]; + + wdays[0] = _("Sunday"); + wdays[1] = _("Monday"); + wdays[2] = _("Tuesday"); + wdays[3] = _("Wednesday"); + wdays[4] = _("Thursday"); + wdays[5] = _("Friday"); + wdays[6] = _("Saturday"); + + months[0] = _("January"); + months[1] = _("February"); + months[2] = _("March"); + months[3] = _("April"); + months[4] = _("May"); + months[5] = _("June"); + months[6] = _("July"); + months[7] = _("August"); + months[8] = _("September"); + months[9] = _("October"); + months[10] = _("November"); + months[11] = _("December"); time(&now); localtime_r(&now, &tm); @@ -56,19 +53,19 @@ void output_date(void) { -/* - * Dummy section +/** + * \brief Dummy section */ void dummy_section(void) { svprintf("BOXTITLE", WCS_STRING, "(dummy section)"); do_template("beginbox"); - wprintf("(nothing)"); + wprintf(_("(nothing)")); do_template("endbox"); } -/* - * New messages section +/** + * \brief New messages section */ void new_messages_section(void) { char buf[SIZ]; @@ -77,7 +74,7 @@ void new_messages_section(void) { int number_of_rooms_to_check; char *rooms_to_check = "Mail|Lobby"; - svprintf("BOXTITLE", WCS_STRING, "Messages"); + svprintf("BOXTITLE", WCS_STRING, _("Messages")); do_template("beginbox"); number_of_rooms_to_check = num_tokens(rooms_to_check, '|'); @@ -91,7 +88,7 @@ void new_messages_section(void) { serv_getln(buf, sizeof buf); if (buf[0] == '2') { extract_token(room, &buf[4], 0, '|', sizeof room); - wprintf(""); escputs(room); @@ -107,14 +104,14 @@ void new_messages_section(void) { } -/* - * Wholist section +/** + * \brief Wholist section */ void wholist_section(void) { char buf[SIZ]; char user[SIZ]; - svprintf("BOXTITLE", WCS_STRING, "Who's online now"); + svprintf("BOXTITLE", WCS_STRING, _("Who's online now")); do_template("beginbox"); serv_puts("RWHO"); serv_getln(buf, sizeof buf); @@ -127,8 +124,8 @@ void wholist_section(void) { } -/* - * Task list section +/** + * \brief Task list section */ void tasks_section(void) { #ifdef WEBCIT_WITH_CALENDAR_SERVICE @@ -136,11 +133,11 @@ void tasks_section(void) { int i; #endif - svprintf("BOXTITLE", WCS_STRING, "Tasks"); + svprintf("BOXTITLE", WCS_STRING, _("Tasks")); do_template("beginbox"); #ifdef WEBCIT_WITH_CALENDAR_SERVICE - gotoroom("Tasks"); - if (strcasecmp(WC->wc_roomname, "Tasks")) { + gotoroom("_TASKS_"); + if (WC->wc_view != VIEW_TASKS) { num_msgs = 0; } else { @@ -148,7 +145,9 @@ void tasks_section(void) { } if (num_msgs < 1) { - wprintf("(None)
\n"); + wprintf(""); + wprintf(_("(None)")); + wprintf("
\n"); } else { for (i=0; i(This server does not support task lists)\n"); + wprintf(""); + wprintf(_("(This server does not support task lists)")); + wprintf("\n"); #endif /* WEBCIT_WITH_CALENDAR_SERVICE */ do_template("endbox"); } -/* - * Calendar section +/** + * \brief Calendar section */ void calendar_section(void) { #ifdef WEBCIT_WITH_CALENDAR_SERVICE @@ -174,11 +175,11 @@ void calendar_section(void) { int i; #endif - svprintf("BOXTITLE", WCS_STRING, "Today on your calendar"); + svprintf("BOXTITLE", WCS_STRING, _("Today on your calendar")); do_template("beginbox"); #ifdef WEBCIT_WITH_CALENDAR_SERVICE - gotoroom("Calendar"); - if (strcasecmp(WC->wc_roomname, "Calendar")) { + gotoroom("_CALENDAR_"); + if (WC->wc_view != VIEW_CALENDAR) { num_msgs = 0; } else { @@ -186,7 +187,9 @@ void calendar_section(void) { } if (num_msgs < 1) { - wprintf("(Nothing)
\n"); + wprintf(""); + wprintf(_("(Nothing)")); + wprintf("
\n"); } else { for (i=0; i(This server does not support calendars)\n"); + wprintf(""); + wprintf(_("(This server does not support calendars)")); + wprintf("\n"); #endif /* WEBCIT_WITH_CALENDAR_SERVICE */ do_template("endbox"); } - -/* - * Server info section (fluff, really) +/** + * \brief Server info section (fluff, really) */ void server_info_section(void) { - svprintf("BOXTITLE", WCS_STRING, "About this server"); + char message[512]; + + svprintf("BOXTITLE", WCS_STRING, _("About this server")); do_template("beginbox"); - wprintf("You are connected to "); - escputs(serv_info.serv_humannode); - wprintf(", running "); - escputs(serv_info.serv_software); - wprintf(" with "); - escputs(SERVER); - wprintf(", and located in "); - escputs(serv_info.serv_bbs_city); - wprintf(".
\nYour system administrator is "); - escputs(serv_info.serv_sysadm); - wprintf(".\n"); + + snprintf(message, sizeof message, + _("You are connected to %s, running %s with %s, and located in %s. Your system administrator is %s."), + serv_info.serv_humannode, + serv_info.serv_software, + SERVER, + serv_info.serv_bbs_city, + serv_info.serv_sysadm); + escputs(message); do_template("endbox"); } - -/* - * Display this user's summary page +/** + * \brief summary of inner div???? */ -void summary(void) { - - output_headers(1, 1, 2, 0, 1, 0, 0); - wprintf("
\n"); - wprintf("" - "
" - "" - "Summary page for "); - escputs(WC->wc_username); - wprintf("\n"); - wprintf(""); - output_date(); - wprintf("
"); - offer_start_page(); - wprintf("
\n"); - wprintf("
\n
\n"); - - /* +void summary_inner_div(void) { + /** * Now let's do three columns of crap. All portals and all groupware * clients seem to want to do three columns, so we'll do three * columns too. Conformity is not inherently a virtue, but there are @@ -251,16 +238,16 @@ void summary(void) { * not people I consider worthwhile, I still want them to use WebCit. */ - wprintf("
" + wprintf("
" ""); - /* + /** * Column One */ wprintf("
"); wholist_section(); - /* + /** * Column Two */ wprintf(""); @@ -268,7 +255,7 @@ void summary(void) { wprintf("
"); tasks_section(); - /* + /** * Column Three */ wprintf("
"); @@ -276,9 +263,53 @@ void summary(void) { wprintf("
"); calendar_section(); - /* + /** * End of columns */ - wprintf("
\n"); + wprintf(""); +} + + +/** + * \brief Display this user's summary page + */ +void summary(void) { + char title[256]; + + output_headers(1, 1, 2, 0, 0, 0); + wprintf("
\n"); + wprintf("" + "
" + "" + ); + + snprintf(title, sizeof title, _("Summary page for %s"), WC->wc_fullname); + escputs(title); + wprintf("\n"); + wprintf(""); + output_date(); + wprintf("
"); + offer_start_page(); + wprintf("
\n"); + + /** + * You guessed it ... we're going to refresh using ajax. + * In the future we might consider updating individual sections of the summary + * instead of the whole thing. + */ + wprintf("
\n
\n"); + summary_inner_div(); + wprintf("
\n"); + + wprintf( + " \n" + ); + wDumpContent(1); } + + +/*@}*/