5 * \defgroup SymaryFuncs Displays the "Summary Page"
6 * \ingroup WebcitDisplayItems
12 * \brief Display today's date in a friendly format
14 void output_date(void) {
20 localtime_r(&now, &tm);
22 wc_strftime(buf, 32, "%A, %x", &tm);
30 * \brief Dummy section
32 void dummy_section(void) {
33 svprintf("BOXTITLE", WCS_STRING, "(dummy section)");
34 do_template("beginbox");
35 wprintf(_("(nothing)"));
36 do_template("endbox");
41 * \brief New messages section
43 void new_messages_section(void) {
47 int number_of_rooms_to_check;
48 char *rooms_to_check = "Mail|Lobby";
51 number_of_rooms_to_check = num_tokens(rooms_to_check, '|');
52 if (number_of_rooms_to_check == 0) return;
54 wprintf("<table border=0 width=100%%>\n");
55 for (i=0; i<number_of_rooms_to_check; ++i) {
56 extract_token(room, rooms_to_check, i, '|', sizeof room);
58 serv_printf("GOTO %s", room);
59 serv_getln(buf, sizeof buf);
61 extract_token(room, &buf[4], 0, '|', sizeof room);
62 wprintf("<tr><td><a href=\"dotgoto?room=");
66 wprintf("</a></td><td>%d/%d</td></tr>\n",
67 extract_int(&buf[4], 1),
68 extract_int(&buf[4], 2)
72 wprintf("</table>\n");
78 * \brief Task list section
80 void tasks_section(void) {
81 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
86 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
88 if (WC->wc_view != VIEW_TASKS) {
92 num_msgs = load_msg_ptrs("MSGS ALL", 0);
98 wprintf("</i><br />\n");
101 for (i=0; i<num_msgs; ++i) {
102 display_task(WC->msgarr[i], 0);
106 calendar_summary_view();
108 #else /* WEBCIT_WITH_CALENDAR_SERVICE */
110 wprintf(_("(This server does not support task lists)"));
112 #endif /* WEBCIT_WITH_CALENDAR_SERVICE */
117 * \brief Calendar section
119 void calendar_section(void) {
120 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
125 #ifdef WEBCIT_WITH_CALENDAR_SERVICE
126 gotoroom("_CALENDAR_");
127 if ( (WC->wc_view != VIEW_CALENDAR) && (WC->wc_view != VIEW_CALBRIEF) ) {
131 num_msgs = load_msg_ptrs("MSGS ALL", 0);
136 wprintf(_("(Nothing)"));
137 wprintf("</i><br />\n");
140 for (i=0; i<num_msgs; ++i) {
141 display_calendar(WC->msgarr[i], 0);
143 calendar_summary_view();
146 #else /* WEBCIT_WITH_CALENDAR_SERVICE */
148 wprintf(_("(This server does not support calendars)"));
150 #endif /* WEBCIT_WITH_CALENDAR_SERVICE */
154 * \brief Server info section (fluff, really)
156 void server_info_section(void) {
159 snprintf(message, sizeof message,
160 _("You are connected to %s, running %s with %s, and located in %s. Your system administrator is %s."),
161 serv_info.serv_humannode,
162 serv_info.serv_software,
164 serv_info.serv_bbs_city,
165 serv_info.serv_sysadm);
170 * \brief summary of inner div????
175 void summary_inner_div(void) {
177 * Now let's do three columns of crap. All portals and all groupware
178 * clients seem to want to do three columns, so we'll do three
179 * columns too. Conformity is not inherently a virtue, but there are
180 * a lot of really shallow people out there, and even though they're
181 * not people I consider worthwhile, I still want them to use WebCit.
184 wprintf("<div class=\"fix_scrollbar_bug\">"
185 "<table width=\"100%%\" cellspacing=\"10px\" cellpadding=\"0\">"
191 wprintf("<td width=33%%>");
192 wprintf("<div class=\"box\">");
193 wprintf("<div class=\"boxlabel\">");
194 wprintf(_("Messages"));
195 wprintf("</div><div class=\"boxcontent\">");
196 wprintf("<div id=\"msg_inner\">");
197 new_messages_section();
198 wprintf("</div></div></div>");
204 wprintf("<td width=33%%>");
205 wprintf("<div class=\"box\">");
206 wprintf("<div class=\"boxlabel\">");
208 wprintf("</div><div class=\"boxcontent\">");
209 wprintf("<div id=\"tasks_inner\">");
211 wprintf("</div></div></div>");
217 wprintf("<td width=33%%>");
218 wprintf("<div class=\"box\">");
219 wprintf("<div class=\"boxlabel\">");
220 wprintf(_("Today on your calendar"));
221 wprintf("</div><div class=\"boxcontent\">");
222 wprintf("<div id=\"calendar_inner\">");
224 wprintf("</div></div></div>");
227 wprintf("</tr><tr valign=top>");
230 * Row Two - Column One
232 wprintf("<td colspan=2>");
233 wprintf("<div class=\"box\">");
234 wprintf("<div class=\"boxlabel\">");
235 wprintf(_("Who's online now"));
236 wprintf("</div><div class=\"boxcontent\">");
237 wprintf("<div id=\"who_inner\">");
239 wprintf("</div></div></div>");
243 * Row Two - Column Two
245 wprintf("<td width=33%%>");
246 wprintf("<div class=\"box\">");
247 wprintf("<div class=\"boxlabel\">");
248 wprintf(_("About this server"));
249 wprintf("</div><div class=\"boxcontent\">");
250 wprintf("<div id=\"info_inner\">");
251 server_info_section();
252 wprintf("</div></div></div>");
259 wprintf("</tr></table>");
264 * \brief Display this user's summary page
269 output_headers(1, 1, 2, 0, 0, 0);
270 wprintf("<div id=\"banner\">\n");
271 wprintf("<div class=\"room_banner\">");
272 wprintf("<img src=\"static/summscreen_48x.gif\">");
274 snprintf(title, sizeof title, _("Summary page for %s"), WC->wc_fullname);
276 wprintf("</h1><h2>");
278 wprintf("</h2></div>");
279 wprintf("<ul class=\"room_actions\">\n");
280 wprintf("<li class=\"start_page\">");
282 wprintf("</li></ul>");
286 * You guessed it ... we're going to refresh using ajax.
287 * In the future we might consider updating individual sections of the summary
288 * instead of the whole thing.
290 wprintf("<div id=\"content\" class=\"service\">\n");
295 "<script type=\"text/javascript\"> "
296 " new Ajax.PeriodicalUpdater('msg_inner', 'new_messages_html', "
297 " { method: 'get', frequency: 60 } ); "
298 " new Ajax.PeriodicalUpdater('tasks_inner', 'tasks_inner_html', "
299 " { method: 'get', frequency: 120 } ); "
300 " new Ajax.PeriodicalUpdater('calendar_inner', 'calendar_inner_html', "
301 " { method: 'get', frequency: 90 } ); "
302 " new Ajax.PeriodicalUpdater('who_inner', 'who_inner_html', "
303 " { method: 'get', frequency: 30 } ); "