return;
}
- wprintf("<div align=center><table bgcolor=#aaaaaa width=50%%>");
+ wprintf("<div align=center>"
+ "<table bgcolor=#aaaaaa width=50%%>");
for (pass=1; pass<=2; ++pass) {
if (v->numprops) for (i=0; i<(v->numprops); ++i) {
wprintf("onMouseOut=document.getElementById(\"msg%ld\").style.visibility=\"hidden\" >", msgnum);
}
- /** start msg buttons */
- if (!printable_view) {
- wprintf("<div id=\"msg%ld\" class=\"msgbuttons\" >\n",msgnum);
-
- /** Reply */
- if ( (WC->wc_view == VIEW_MAILBOX) || (WC->wc_view == VIEW_BBS) ) {
- wprintf("<a href=\"display_enter");
- if (WC->is_mailbox) {
- wprintf("?replyquote=%ld", msgnum);
- }
- wprintf("?recp=");
- urlescputs(reply_to);
- if (strlen(m_subject) > 0) {
- wprintf("?subject=");
- if (strncasecmp(m_subject, "Re:", 3)) wprintf("Re:%20");
- urlescputs(m_subject);
- }
- wprintf("\"><span>[</span>%s<span>]</span></a> ", _("Reply"));
- }
-
- /** ReplyQuoted */
- if ( (WC->wc_view == VIEW_MAILBOX) || (WC->wc_view == VIEW_BBS) ) {
- if (!WC->is_mailbox) {
- wprintf("<a href=\"display_enter");
- wprintf("?replyquote=%ld", msgnum);
- wprintf("?recp=");
- urlescputs(reply_to);
- if (strlen(m_subject) > 0) {
- wprintf("?subject=");
- if (strncasecmp(m_subject, "Re:", 3)) wprintf("Re:%20");
- urlescputs(m_subject);
- }
- wprintf("\"><span>[</span>%s<span>]</span></a> ", _("ReplyQuoted"));
- }
- }
-
- /** ReplyAll */
- if (WC->wc_view == VIEW_MAILBOX) {
- wprintf("<a href=\"display_enter");
- wprintf("?replyquote=%ld", msgnum);
- wprintf("?recp=");
- urlescputs(reply_to);
- wprintf("?cc=");
- urlescputs(reply_all);
- if (strlen(m_subject) > 0) {
- wprintf("?subject=");
- if (strncasecmp(m_subject, "Re:", 3)) wprintf("Re:%20");
- urlescputs(m_subject);
- }
- wprintf("\"><span>[</span>%s<span>]</span></a> ", _("ReplyAll"));
- }
-
- /** Forward */
- if (WC->wc_view == VIEW_MAILBOX) {
- wprintf("<a href=\"display_enter?fwdquote=%ld?subject=", msgnum);
- if (strncasecmp(m_subject, "Fwd:", 4)) wprintf("Fwd:%20");
- urlescputs(m_subject);
- wprintf("\"><span>[</span>%s<span>]</span></a> ", _("Forward"));
- }
-
- /** If this is one of my own rooms, or if I'm an Aide or Room Aide, I can move/delete */
- if ( (WC->is_room_aide) || (WC->is_mailbox) || (WC->room_flags2 & QR2_COLLABDEL) ) {
- /** Move */
- wprintf("<a href=\"confirm_move_msg?msgid=%ld\"><span>[</span>%s<span>]</span></a> ",
- msgnum, _("Move"));
-
- /** Delete */
- wprintf("<a href=\"delete_msg?msgid=%ld\" "
- "onClick=\"return confirm('%s');\">"
- "<span>[</span>%s<span>]</span> "
- "</a> ", msgnum, _("Delete this message?"), _("Delete")
- );
- }
-
- /** Headers */
- wprintf("<a href=\"#\" onClick=\"window.open('msgheaders/%ld', 'headers%ld', 'toolbar=no,location=no,directories=no,copyhistory=no,status=yes,scrollbars=yes,resizable=yes,width=600,height=400'); \" >"
- "<span>[</span>%s<span>]</span></a>", msgnum, msgnum, _("Headers"));
-
-
- /** Print */
- wprintf("<a href=\"#\" onClick=\"window.open('printmsg/%ld', 'print%ld', 'toolbar=no,location=no,directories=no,copyhistory=no,status=yes,scrollbars=yes,resizable=yes,width=600,height=400'); \" >"
- "<span>[</span>%s<span>]</span></a>", msgnum, msgnum, _("Print"));
-
- wprintf("</div>");
-
- }
-
-
/** begin message header table */
wprintf("<div class=\"message_header\">");
strcpy(m_subject, "");
}
+ /** start msg buttons */
+ if (!printable_view) {
+ wprintf("<div id=\"msg%ld\" class=\"msgbuttons\" >\n",msgnum);
+
+ /** Reply */
+ if ( (WC->wc_view == VIEW_MAILBOX) || (WC->wc_view == VIEW_BBS) ) {
+ wprintf("<a href=\"display_enter");
+ if (WC->is_mailbox) {
+ wprintf("?replyquote=%ld", msgnum);
+ }
+ wprintf("?recp=");
+ urlescputs(reply_to);
+ if (strlen(m_subject) > 0) {
+ wprintf("?subject=");
+ if (strncasecmp(m_subject, "Re:", 3)) wprintf("Re:%20");
+ urlescputs(m_subject);
+ }
+ wprintf("\"><span>[</span>%s<span>]</span></a> ", _("Reply"));
+ }
+
+ /** ReplyQuoted */
+ if ( (WC->wc_view == VIEW_MAILBOX) || (WC->wc_view == VIEW_BBS) ) {
+ if (!WC->is_mailbox) {
+ wprintf("<a href=\"display_enter");
+ wprintf("?replyquote=%ld", msgnum);
+ wprintf("?recp=");
+ urlescputs(reply_to);
+ if (strlen(m_subject) > 0) {
+ wprintf("?subject=");
+ if (strncasecmp(m_subject, "Re:", 3)) wprintf("Re:%20");
+ urlescputs(m_subject);
+ }
+ wprintf("\"><span>[</span>%s<span>]</span></a> ", _("ReplyQuoted"));
+ }
+ }
+
+ /** ReplyAll */
+ if (WC->wc_view == VIEW_MAILBOX) {
+ wprintf("<a href=\"display_enter");
+ wprintf("?replyquote=%ld", msgnum);
+ wprintf("?recp=");
+ urlescputs(reply_to);
+ wprintf("?cc=");
+ urlescputs(reply_all);
+ if (strlen(m_subject) > 0) {
+ wprintf("?subject=");
+ if (strncasecmp(m_subject, "Re:", 3)) wprintf("Re:%20");
+ urlescputs(m_subject);
+ }
+ wprintf("\"><span>[</span>%s<span>]</span></a> ", _("ReplyAll"));
+ }
+
+ /** Forward */
+ if (WC->wc_view == VIEW_MAILBOX) {
+ wprintf("<a href=\"display_enter?fwdquote=%ld?subject=", msgnum);
+ if (strncasecmp(m_subject, "Fwd:", 4)) wprintf("Fwd:%20");
+ urlescputs(m_subject);
+ wprintf("\"><span>[</span>%s<span>]</span></a> ", _("Forward"));
+ }
+
+ /** If this is one of my own rooms, or if I'm an Aide or Room Aide, I can move/delete */
+ if ( (WC->is_room_aide) || (WC->is_mailbox) || (WC->room_flags2 & QR2_COLLABDEL) ) {
+ /** Move */
+ wprintf("<a href=\"confirm_move_msg?msgid=%ld\"><span>[</span>%s<span>]</span></a> ",
+ msgnum, _("Move"));
+
+ /** Delete */
+ wprintf("<a href=\"delete_msg?msgid=%ld\" "
+ "onClick=\"return confirm('%s');\">"
+ "<span>[</span>%s<span>]</span> "
+ "</a> ", msgnum, _("Delete this message?"), _("Delete")
+ );
+ }
+
+ /** Headers */
+ wprintf("<a href=\"#\" onClick=\"window.open('msgheaders/%ld', 'headers%ld', 'toolbar=no,location=no,directories=no,copyhistory=no,status=yes,scrollbars=yes,resizable=yes,width=600,height=400'); \" >"
+ "<span>[</span>%s<span>]</span></a>", msgnum, msgnum, _("Headers"));
+
+
+ /** Print */
+ wprintf("<a href=\"#\" onClick=\"window.open('printmsg/%ld', 'print%ld', 'toolbar=no,location=no,directories=no,copyhistory=no,status=yes,scrollbars=yes,resizable=yes,width=600,height=400'); \" >"
+ "<span>[</span>%s<span>]</span></a>", msgnum, msgnum, _("Print"));
+
+ wprintf("</div>");
+
+ }
+
+
+
/** Begin body */
- wprintf("<div class=\"message_content\" ");
+ wprintf("<div class=\"message_content\">");
/**
* Learn the content type
int bg = 0;
static int NAMESPERPAGE = 60;
int num_pages = 0;
- int page = 0;
int tabfirst = 0;
- char tabfirst_label[SIZ];
+ char tabfirst_label[64];
int tablast = 0;
- char tablast_label[SIZ];
+ char tablast_label[64];
+ char this_tablabel[64];
+ int page = 0;
+ char **tablabels;
if (num_ab == 0) {
wprintf("<br /><br /><br /><div align=\"center\"><i>");
qsort(addrbook, num_ab, sizeof(struct addrbookent), abcmp);
}
- num_pages = num_ab / NAMESPERPAGE;
+ num_pages = (num_ab / NAMESPERPAGE) + 1;
- page = atoi(bstr("page"));
+ tablabels = malloc(num_pages * sizeof (char *));
+ if (tablabels == NULL) {
+ wprintf("<br /><br /><br /><div align=\"center\"><i>");
+ wprintf(_("An internal error has occurred."));
+ wprintf("</i></div>\n");
+ return;
+ }
- wprintf("Page: ");
- for (i=0; i<=num_pages; ++i) {
- if (i != page) {
- wprintf("<a href=\"readfwd?page=%d\">", i);
- }
- else {
- wprintf("<B>");
- }
+ for (i=0; i<num_pages; ++i) {
tabfirst = i * NAMESPERPAGE;
tablast = tabfirst + NAMESPERPAGE - 1;
if (tablast > (num_ab - 1)) tablast = (num_ab - 1);
nametab(tabfirst_label, addrbook[tabfirst].ab_name);
nametab(tablast_label, addrbook[tablast].ab_name);
- wprintf("[%s - %s]",
- tabfirst_label, tablast_label
- );
- if (i != page) {
- wprintf("</A>\n");
- }
- else {
- wprintf("</B>\n");
- }
+ sprintf(this_tablabel, "%s - %s", tabfirst_label, tablast_label);
+ tablabels[i] = strdup(this_tablabel);
}
- wprintf("<br />\n");
- wprintf("<table border=0 cellspacing=0 "
- "cellpadding=3 width=100%%>\n"
- );
+ tabbed_dialog(num_pages, tablabels);
+ page = (-1);
for (i=0; i<num_ab; ++i) {
- if ((i / NAMESPERPAGE) == page) {
+ if ((i / NAMESPERPAGE) != page) { /* New tab */
+ page = (i / NAMESPERPAGE);
+ if (page > 0) {
+ wprintf("</tr></table>\n");
+ end_tab(page-1, num_pages);
+ }
+ begin_tab(page, num_pages);
+ wprintf("<table border=0 cellspacing=0 cellpadding=3 width=100%%>\n");
+ displayed = 0;
+ }
- if ((displayed % 4) == 0) {
- if (displayed > 0) {
- wprintf("</tr>\n");
- }
- bg = 1 - bg;
- wprintf("<tr bgcolor=\"#%s\">",
- (bg ? "DDDDDD" : "FFFFFF")
- );
+ if ((displayed % 4) == 0) {
+ if (displayed > 0) {
+ wprintf("</tr>\n");
}
-
- wprintf("<td>");
-
- wprintf("<a href=\"readfwd?startmsg=%ld&is_singlecard=1",
- addrbook[i].ab_msgnum);
- wprintf("?maxmsgs=1?summary=0?alpha=%s\">", bstr("alpha"));
- vcard_n_prettyize(addrbook[i].ab_name);
- escputs(addrbook[i].ab_name);
- wprintf("</a></td>\n");
- ++displayed;
+ bg = 1 - bg;
+ wprintf("<tr bgcolor=\"#%s\">",
+ (bg ? "DDDDDD" : "FFFFFF")
+ );
}
+
+ wprintf("<td>");
+
+ wprintf("<a href=\"readfwd?startmsg=%ld&is_singlecard=1",
+ addrbook[i].ab_msgnum);
+ wprintf("?maxmsgs=1?summary=0?alpha=%s\">", bstr("alpha"));
+ vcard_n_prettyize(addrbook[i].ab_name);
+ escputs(addrbook[i].ab_name);
+ wprintf("</a></td>\n");
+ ++displayed;
}
wprintf("</tr></table>\n");
+ end_tab((num_pages-1), num_pages);
+
+ for (i=0; i<num_pages; ++i) {
+ free(tablabels[i]);
+ }
+ free(tablabels);
}
}
if (is_summary) {
- wprintf("</div>\n"); /** end of 'content' div */
wprintf("<script language=\"javascript\" type=\"text/javascript\">"
" document.onkeydown = CtdlMsgListKeyPress; "
}
/** Note: wDumpContent() will output one additional </div> tag. */
+ wprintf("</div>\n"); /** end of 'content' div */
wDumpContent(1);
- if (addrbook != NULL) free(addrbook);
/** free the summary */
if (WC->summ != NULL) {
WC->num_summ = 0;
WC->summ = NULL;
}
+ if (addrbook != NULL) free(addrbook);
}
char *display_name;
struct wc_attachment *att;
int recipient_required = 0;
+ int subject_required = 0;
int recipient_bad = 0;
int i;
int is_anonymous = 0;
/** First test to see whether this is a room that requires recipients to be entered */
serv_puts("ENT0 0");
serv_getln(buf, sizeof buf);
+
if (!strncmp(buf, "570", 3)) { /** 570 means that we need a recipient here */
recipient_required = 1;
}
return;
}
+ /* Is the server strongly recommending that the user enter a message subject? */
+ if ((buf[3] != '\0') && (buf[4] != '\0')) {
+ subject_required = extract_int(&buf[4], 1);
+ }
+
/**
* Are we perhaps in an address book view? If so, then an "enter
* message" command really means "add new entry."
wprintf("<input type=\"hidden\" name=\"wikipage\" value=\"%s\">\n", bstr("wikipage"));
}
wprintf("<input type=\"hidden\" name=\"return_to\" value=\"%s\">\n", bstr("return_to"));
+ wprintf("<input type=\"hidden\" name=\"nonce\" value=\"%ld\">\n", WC->nonce);
/** header bar */
}
wprintf("<div style=\"clear: both;\"><label for=\"subject_id\" > ");
- if (recipient_required) {
+ if (recipient_required || subject_required) {
wprintf(_("Subject:"));
}
else {
wprintf(_("Subject (optional):"));
}
wprintf("</label>"
- "<input type=\"text\" name=\"subject\" value=\" \" id=\"subject_id\" ");
+ "<input type=\"text\" name=\"subject\" id=\"subject_id\" value=\" ");
escputs(bstr("subject"));
wprintf("\" size=45 maxlength=70>\n");
wprintf("</textarea>");
/**
- * The following script embeds the TinyMCE richedit control, and automatically
+ * The following template embeds the TinyMCE richedit control, and automatically
* transforms the textarea into a richedit textarea.
*/
- wprintf(
- "<script language=\"javascript\" type=\"text/javascript\" src=\"tiny_mce/tiny_mce.js\"></script>\n"
- "<script language=\"javascript\" type=\"text/javascript\">"
- "tinyMCE.init({"
- " mode : \"textareas\", width : \"100%%\", browsers : \"msie,gecko\", "
- " theme : \"advanced\", plugins : \"iespell\", "
- " theme_advanced_buttons1 : \"bold, italic, underline, strikethrough, justifyleft, justifycenter, justifyright, justifyfull, bullist, numlist, cut, copy, paste, link, image, help, forecolor, iespell, code\", "
- " theme_advanced_buttons2 : \"\", "
- " theme_advanced_buttons3 : \"\", "
- " content_css : \"static/webcit-tinymce.css\" "
- "});"
- "</script>\n"
- );
+ do_template("richedit");
/** Enumerate any attachments which are already in place... */
- wprintf("<div style=\"float: left; \"><img src=\"static/diskette_24x.gif\" border=0 ");
+ wprintf("<div><img src=\"static/diskette_24x.gif\" border=0 ");
wprintf(_("Attachments:"));
wprintf(" ");
wprintf("<select name=\"which_attachment\" size=1>");
/* wprintf(" (%s, %d bytes)",att->content_type,att->length); */
wprintf("</option>\n");
}
- wprintf("</select><br />");
+ wprintf("</select>");
/** Now offer the ability to attach additional files... */
wprintf(" ");
"<input type=\"submit\" name=\"attach_button\" value=\"%s\">\n", _("Add"));
wprintf("</div>");
- /** Seth asked for these to be at the top *and* bottom... (removed) */
wprintf("<div class=\"send_edit_msg\">");
wprintf("<input type=\"submit\" name=\"send_button\" value=\"");
if (recipient_required) {
wprintf("<br />\n");
wprintf("<form METHOD=\"POST\" action=\"move_msg\">\n");
+ wprintf("<input type=\"hidden\" name=\"nonce\" value=\"%ld\">\n", WC->nonce);
wprintf("<INPUT TYPE=\"hidden\" NAME=\"msgid\" VALUE=\"%s\">\n", bstr("msgid"));
wprintf("<SELECT NAME=\"target_room\" SIZE=5>\n");