template moving the messages select target.
authorWilfried Goesgens <dothebart@citadel.org>
Mon, 25 Jul 2011 20:56:35 +0000 (20:56 +0000)
committerWilfried Goesgens <dothebart@citadel.org>
Sun, 4 Sep 2011 21:43:34 +0000 (21:43 +0000)
webcit/messages.c
webcit/static/t/msg/confirm_move.html [new file with mode: 0644]
webcit/static/t/msg/confirm_move_one_targetroom.html [new file with mode: 0644]
webcit/static/t/view_message.html

index aede383fcb2ab5ef78d08f50bb1b0488d62e6104..f96b4ffae52421bb14211a795af77d2cc47c7d9e 100644 (file)
@@ -1589,55 +1589,6 @@ void move_msg(void)
 }
 
 
-/*
- * Confirm move of a message
- */
-void confirm_move_msg(void)
-{
-       char buf[SIZ];
-       char targ[SIZ];
-
-       output_headers(1, 1, 2, 0, 0, 0);
-       wc_printf("<div id=\"banner\">\n");
-       wc_printf("<h1>");
-       wc_printf(_("Confirm move of message"));
-       wc_printf("</h1>");
-       wc_printf("</div>\n");
-
-       wc_printf("<div id=\"content\" class=\"service\">\n");
-
-       wc_printf("<CENTER>");
-
-       wc_printf(_("Move this message to:"));
-       wc_printf("<br>\n");
-
-       wc_printf("<form METHOD=\"POST\" action=\"move_msg\">\n");
-       wc_printf("<input type=\"hidden\" name=\"nonce\" value=\"%d\">\n", WC->nonce);
-       wc_printf("<INPUT TYPE=\"hidden\" NAME=\"msgid\" VALUE=\"%s\">\n", bstr("msgid"));
-
-       wc_printf("<SELECT NAME=\"target_room\" SIZE=5>\n");
-       serv_puts("LKRA");
-       serv_getln(buf, sizeof buf);
-       if (buf[0] == '1') {
-               while (serv_getln(buf, sizeof buf), strcmp(buf, "000")) {
-                       extract_token(targ, buf, 0, '|', sizeof targ);
-                       wc_printf("<OPTION>");
-                       escputs(targ);
-                       wc_printf("\n");
-               }
-       }
-       wc_printf("</SELECT>\n");
-       wc_printf("<br>\n");
-
-       wc_printf("<INPUT TYPE=\"submit\" NAME=\"move_button\" VALUE=\"%s\">", _("Move"));
-       wc_printf("&nbsp;");
-       wc_printf("<INPUT TYPE=\"submit\" NAME=\"cancel_button\" VALUE=\"%s\">", _("Cancel"));
-       wc_printf("</form></CENTER>\n");
-
-       wc_printf("</CENTER>\n");
-       wDumpContent(1);
-}
-
 
 /*
  * Generic function to output an arbitrary MIME attachment from
@@ -1928,7 +1879,6 @@ InitModule_MSG
        WebcitAddUrlHandler(HKEY("post"), "", 0, post_message, PROHIBIT_STARTPAGE);
        WebcitAddUrlHandler(HKEY("move_msg"), "", 0, move_msg, PROHIBIT_STARTPAGE);
        WebcitAddUrlHandler(HKEY("delete_msg"), "", 0, delete_msg, PROHIBIT_STARTPAGE);
-       WebcitAddUrlHandler(HKEY("confirm_move_msg"), "", 0, confirm_move_msg, PROHIBIT_STARTPAGE);
        WebcitAddUrlHandler(HKEY("msg"), "", 0, embed_message, NEED_URL);
        WebcitAddUrlHandler(HKEY("message"), "", 0, handle_one_message, NEED_URL|XHTTP_COMMANDS|COOKIEUNNEEDED|FORCE_SESSIONCLOSE);
        WebcitAddUrlHandler(HKEY("printmsg"), "", 0, print_message, NEED_URL);
diff --git a/webcit/static/t/msg/confirm_move.html b/webcit/static/t/msg/confirm_move.html
new file mode 100644 (file)
index 0000000..127d0b0
--- /dev/null
@@ -0,0 +1,29 @@
+<?=("head")>
+<div id="banner">
+<h1>
+<?_("Confirm move of message")>
+</h1>
+</div>
+
+<div id="content" class="service">
+
+<center>
+
+<?_("Move this message to:")>
+<br>
+
+<form method="POST" action="move_msg">
+<input type="hidden" name="nonce" value="<?NONCE>">
+<input type="hidden" name="msgid" value="<?BSTR('msgid')>">
+
+<select name="target_room" size=5>
+<?ITERATE("LKRA", ="msg_confirm_move_one_targetroom")>
+</select>
+<br>
+
+<input type="submit" name="move_button" value="<?_("Move")>">
+&nbsp;
+<input type="submit" name="cancel_button" value="<?_("Cancel")>">
+</form>
+</center>
+<?=("trailing")>
diff --git a/webcit/static/t/msg/confirm_move_one_targetroom.html b/webcit/static/t/msg/confirm_move_one_targetroom.html
new file mode 100644 (file)
index 0000000..2699177
--- /dev/null
@@ -0,0 +1 @@
+<option value='<?ROOM:INFO:NAME("X")>' ><?ROOM:INFO:NAME("X")></option>
index cbe7fc9678bf99ed87b420618fc71d98c00d3ca2..a6bf783fd9c48ec41aa8099e1aa067e6f5b214ad 100644 (file)
@@ -24,7 +24,7 @@
        <a href="javascript:GetLoggedInFirst(encodeURIComponent('display_enter?replying_mode=forward?replying_to=<?MAIL:SUMM:N>?fwdquote=<?MAIL:SUMM:N>'));"><span>[</span><?_("Forward")><span>]</span></a> 
 <??("X", 9)>
 <?!("COND:ROOM:EDITACCESS", 14)>
-   <a href="confirm_move_msg?msgid=<?MAIL:SUMM:N>"><span>[</span><?_("Move")><span>]</span></a> 
+   <a href="do_template?template=msg_confirm_move?msgid=<?MAIL:SUMM:N>"><span>[</span><?_("Move")><span>]</span></a> 
    <a href="delete_msg?msgid=<?MAIL:SUMM:N>" onclick="return confirm('<?_("Delete this message?")>');"><span>[</span><?_("Delete")><span>]</span> </a> 
 <??("X", 14)>
    <a href="#" onclick="window.open('msgheaders/<?MAIL:SUMM:N>', 'headers<?MAIL:SUMM:N>', 'toolbar=no,location=no,directories=no,copyhistory=no,status=yes,scrollbars=yes,resizable=yes,width=600,height=400'); "><span>[</span><?_("Headers")><span>]</span></a>