wprintf("<tr><td>");
wprintf("%ld<br />", msgnum);
- wprintf(" <a href=\"javascript:DeleteQueueMsg(%ld,%ld);\">%s</a>",
+ wprintf(" <a href=\"javascript:DeleteSMTPqueueMsg(%ld,%ld);\">%s</a>",
msgnum, msgid, _("(Delete)")
);
{
output_headers(1, 1, 2, 0, 0, 0);
- wprintf("<script type=\"text/javascript\"> \n"
- "function RefreshQueueDisplay() { \n"
- " new Ajax.Updater('smtpqueue_inner_div', \n"
- " 'display_smtpqueue_inner_div', { method: 'get', \n"
- " parameters: Math.random() } ); \n"
- "} \n"
- " \n"
- "function DeleteQueueMsg(msgnum1, msgnum2) { \n"
- " new Ajax.Request( \n"
- " 'ajax_servcmd', { \n"
- " method: 'post', \n"
- " parameters: 'g_cmd=DELE ' + msgnum1 + ',' + msgnum2, \n"
- " onComplete: RefreshQueueDisplay() \n"
- " } \n"
- " ); \n"
- "} \n"
- " \n"
- "</script> \n"
- );
-
wprintf("<div id=\"banner\">\n");
wprintf("<h1>");
wprintf(_("View the outbound SMTP queue"));
"<table class=\"smtpqueue_background\">"
"<tr><td valign=top>\n");
- wprintf("<div id=\"smtpqueue_inner_div\">");
-
- display_smtpqueue_inner_div();
-
- wprintf("</div>"
+ wprintf("<div id=\"smtpqueue_inner_div\">"
+ "<div align=\"center\"><img src=\"static/throbber.gif\"></div>"
+ "</div>"
"<div align=\"center\">"
- "<a href=\"javascript:RefreshQueueDisplay();\">%s</a>"
+ "<a href=\"javascript:RefreshSMTPqueueDisplay();\">%s</a>"
"</div>"
"</td></tr></table></div>\n", _("Refresh this page")
);
+
+ StrBufAppendPrintf(WC->trailing_javascript, "RefreshSMTPqueueDisplay();\n");
+
wDumpContent(1);
}
global.style.width = newContentSize+"px";
}
}
+
+function RefreshSMTPqueueDisplay() {
+ new Ajax.Updater('smtpqueue_inner_div',
+ 'display_smtpqueue_inner_div', { method: 'get',
+ parameters: Math.random() } );
+}
+
+function DeleteSMTPqueueMsg(msgnum1, msgnum2) {
+ new Ajax.Request(
+ 'ajax_servcmd', {
+ method: 'post',
+ parameters: 'g_cmd=DELE ' + msgnum1 + ',' + msgnum2,
+ onComplete: RefreshSMTPqueueDisplay()
+ }
+ );
+}