Skip to content
Snippets Groups Projects
Commit 88a8f54c authored by runemaster's avatar runemaster
Browse files

Work around for IE and other browsers that do not recognise:

<input type="image" src="/graphics/delete_messages.gif" name="Action" value="Delete" />
(Specifically the name= and value= )  Sheesh!
parent 0d1f5f54
No related branches found
No related tags found
No related merge requests found
...@@ -8,7 +8,7 @@ if(msgbase.open!=undefined && msgbase.open()==false) { ...@@ -8,7 +8,7 @@ if(msgbase.open!=undefined && msgbase.open()==false) {
error(msgbase.last_error); error(msgbase.last_error);
} }
if(http_request.query.Action=="Delete Selected Message(s)") { if(http_request.query.Action=="Delete" || http_request.query.Action=="Delete,Delete") {
var hdr; var hdr;
var deleted=0; var deleted=0;
var errors=0; var errors=0;
...@@ -56,7 +56,7 @@ if(http_request.query.Action=="Delete Selected Message(s)") { ...@@ -56,7 +56,7 @@ if(http_request.query.Action=="Delete Selected Message(s)") {
template.detail+=")"; template.detail+=")";
} }
template.backurl=http_request.header.referer; template.backurl=http_request.header.referer;
template.detail+=" Action = " +http_request.query.Action;
write_template("header.inc"); write_template("header.inc");
load("../web/lib/topnav_html.ssjs"); load("../web/lib/topnav_html.ssjs");
load("../web/lib/leftnav_html.ssjs"); load("../web/lib/leftnav_html.ssjs");
......
...@@ -4,44 +4,44 @@ load("../web/lib/msgslib.ssjs"); ...@@ -4,44 +4,44 @@ load("../web/lib/msgslib.ssjs");
load("../web/lib/mime_decode.ssjs"); load("../web/lib/mime_decode.ssjs");
if(msgbase.open!=undefined && msgbase.open()==false) { if(msgbase.open!=undefined && msgbase.open()==false) {
error(msgbase.last_error); error(msgbase.last_error);
} }
template.can_delete=can_delete(m); template.can_delete=can_delete(m);
if(sub=='mail') { if(sub=='mail') {
template.group=new Object; template.group=new Object;
template.group.name="E-Mail"; template.group.name="E-Mail";
} }
else { else {
template.group=msg_area.grp[msg_area.sub[sub].grp_name]; template.group=msg_area.grp[msg_area.sub[sub].grp_name];
} }
if(sub=='mail') { if(sub=='mail') {
template.sub=new Object; template.sub=new Object;
template.sub.description="Personal E-Mail"; template.sub.description="Personal E-Mail";
template.sub.code="mail"; template.sub.code="mail";
} }
else { else {
template.sub=msg_area.sub[sub]; template.sub=msg_area.sub[sub];
if(!msg_area.sub[sub].can_read) if(!msg_area.sub[sub].can_read)
error("You can't read messages in this sub!"); error("You can't read messages in this sub!");
} }
if(sub=='mail') if(sub=='mail')
template.can_post=!(user.security.restrictions&UFLAG_E); template.can_post=!(user.security.restrictions&UFLAG_E);
else else
template.can_post=msg_area.sub[sub].can_post; template.can_post=msg_area.sub[sub].can_post;
template.idx=msgbase.get_msg_index(false,m); template.idx=msgbase.get_msg_index(false,m);
if(sub=='mail' && template.idx.to!=user.number) if(sub=='mail' && template.idx.to!=user.number)
error("You can only read e-mail messages addressed to yourself!"); error("You can only read e-mail messages addressed to yourself!");
template.hdr=msgbase.get_msg_header(false,m); template.hdr=msgbase.get_msg_header(false,m);
if(idx_to_user(template.idx)) { if(idx_to_user(template.idx)) {
template.hdr.attr|=MSG_READ; template.hdr.attr|=MSG_READ;
if(template.hdr.attr&MSG_KILLREAD) if(template.hdr.attr&MSG_KILLREAD)
template.hdr.attr|=MSG_DELETE; template.hdr.attr|=MSG_DELETE;
msgbase.put_msg_header(false,m,template.hdr); msgbase.put_msg_header(false,m,template.hdr);
} }
template.hdr=clean_msg_headers(template.hdr,0); template.hdr=clean_msg_headers(template.hdr,0);
template.body=msgbase.get_msg_body(false,m); template.body=msgbase.get_msg_body(false,m);
...@@ -49,73 +49,74 @@ template.body=msgbase.get_msg_body(false,m); ...@@ -49,73 +49,74 @@ template.body=msgbase.get_msg_body(false,m);
msg=mime_decode(template.hdr,template.body); msg=mime_decode(template.hdr,template.body);
template.body=msg.body; template.body=msg.body;
if(msg.type=="plain") { if(msg.type=="plain") {
/* ANSI */ /* ANSI */
if(template.body.indexOf('\x1b[')>=0 || template.body.indexOf('\x01')>=0) { if(template.body.indexOf('\x1b[')>=0 || template.body.indexOf('\x01')>=0) {
template.body=html_encode(template.body,true,false,true,true); template.body=html_encode(template.body,true,false,true,true);
} }
/* Plain text */ /* Plain text */
else { else {
template.body=word_wrap(template.body,80); template.body=word_wrap(template.body,80);
template.body=html_encode(template.body,true,false,false,false); template.body=html_encode(template.body,true,false,false,false);
} }
} }
if(msg.attachments!=undefined) { if(msg.attachments!=undefined) {
template.attachments=new Object; template.attachments=new Object;
for(att in msg.attachments) { for(att in msg.attachments) {
template.attachments[att]=new Object; template.attachments[att]=new Object;
template.attachments[att].name=msg.attachments[att]; template.attachments[att].name=msg.attachments[att];
} }
} }
if(template.hdr != null) { if(template.hdr != null) {
template.title="Message: "+template.hdr.subject; template.title="Message: "+template.hdr.subject;
if(sub=='mail' || user.security.level>=90) { /* Sysops can dump all message headers */ if(sub=='mail' || user.security.level>=90) { /* Sysops can dump all message headers */
template.hfields="<html><head><title>Message Header Fields</title></head>"; template.hfields="<html><head><title>Message Header Fields</title></head>";
template.hfields+="<body>"; template.hfields+="<body>";
template.hfields+="<h2>Message Header Fields</h2>"; template.hfields+="<h2>Message Header Fields</h2>";
template.hfields+="<table>"; template.hfields+="<table>";
var f; var f;
for(f in template.hdr) for(f in template.hdr)
if(typeof(template.hdr[f])!="object") if(typeof(template.hdr[f])!="object")
template.hfields+=('<tr valign=top><td>'+ f + ':<td>' + template.hdr[f]); template.hfields+=('<tr valign=top><td>'+ f + ':<td>' + template.hdr[f]);
for(f in template.hdr.field_list) for(f in template.hdr.field_list)
template.hfields+=('<tr valign=top><td>type-0x' template.hfields+=('<tr valign=top><td>type-0x'
+ format("%02X",template.hdr.field_list[f].type) + ':<td>' + format("%02X",template.hdr.field_list[f].type) + ':<td>'
+ strip_ctrl(template.hdr.field_list[f].data)); + strip_ctrl(template.hdr.field_list[f].data));
template.hfields+="</table>"; template.hfields+="</table>";
template.hfields+="</body>"; template.hfields+="</body>";
template.hfields+="</html>"; template.hfields+="</html>";
} }
} }
var tmp=find_np_message(template.idx.offset,true); var tmp=find_np_message(template.idx.offset,true);
template.temp=tmp
template.replyto=undefined; template.replyto=undefined;
if(template.hdr.thread_orig!=0) { if(template.hdr.thread_orig!=0) {
template.replyto=msgbase.get_msg_header(false,template.hdr.thread_orig); template.replyto=msgbase.get_msg_header(false,template.hdr.thread_orig);
if(template.replyto==null) if(template.replyto==null)
template.replyto=undefined; template.replyto=undefined;
} }
template.replies=new Array; template.replies=new Array;
if(template.hdr.thread_first!=0) { if(template.hdr.thread_first!=0) {
/* Fill replies array */ /* Fill replies array */
var next_reply; var next_reply;
var rhdr=new Object; var rhdr=new Object;
rhdr.thread_next=template.hdr.thread_first; rhdr.thread_next=template.hdr.thread_first;
for(;(next_reply=rhdr.thread_next)!=0 && (rhdr=msgbase.get_msg_header(false,next_reply))!=null;) { for(;(next_reply=rhdr.thread_next)!=0 && (rhdr=msgbase.get_msg_header(false,next_reply))!=null;) {
if(rhdr==null) if(rhdr==null)
break; break;
template.replies.push(rhdr); template.replies.push(rhdr);
} }
} }
if(tmp!=undefined) if(tmp!=undefined)
template.nextlink='<a href="msg.ssjs?msg_sub='+sub+'&amp;message='+tmp+'">'+next_msg_html+'</a>'; template.nextlink='<a href="msg.ssjs?msg_sub='+sub+'&amp;message='+tmp+'">'+next_msg_html+'</a>';
else else
template.nextlink=no_next_msg_html; template.nextlink=no_next_msg_html;
tmp=find_np_message(template.idx.offset,false); tmp=find_np_message(template.idx.offset,false);
if(tmp!=undefined) if(tmp!=undefined)
template.prevlink='<a href="msg.ssjs?msg_sub='+sub+'&amp;message='+tmp+'">'+prev_msg_html+'</a>'; template.prevlink='<a href="msg.ssjs?msg_sub='+sub+'&amp;message='+tmp+'">'+prev_msg_html+'</a>';
else else
template.prevlink=no_prev_msg_html; template.prevlink=no_prev_msg_html;
......
...@@ -4,8 +4,7 @@ ...@@ -4,8 +4,7 @@
<td class="main" valign="top"><br /> <td class="main" valign="top"><br />
<table class="msg" border="0" width="100%">
<table class="msg" border="0" width="95%">
<tr class="msg"> <tr class="msg">
<td width="1%" class="msgheader" nowrap="nowrap" onDblClick="window.open().document.write('%%hfields%%')">Subject:</td> <td width="1%" class="msgheader" nowrap="nowrap" onDblClick="window.open().document.write('%%hfields%%')">Subject:</td>
<td nowrap="nowrap">%%hdr:subject%%</td> <td nowrap="nowrap">%%hdr:subject%%</td>
...@@ -34,7 +33,7 @@ ...@@ -34,7 +33,7 @@
<td width="1%" class="msgnavleft" nowrap="nowrap">@@prevlink@@</td> <td width="1%" class="msgnavleft" nowrap="nowrap">@@prevlink@@</td>
<td width="1%" class="msgnavmid">@@JS:template.can_post?'<a href="reply.ssjs?msg_sub='+template.sub.code+'&amp;reply_to='+template.hdr.number+'"><img src="/graphics/reply.gif" alt="Reply" width="150" height="20" border="0" title="Reply" /></a>':'&nbsp;'@@</td> <td width="1%" class="msgnavmid">@@JS:template.can_post?'<a href="reply.ssjs?msg_sub='+template.sub.code+'&amp;reply_to='+template.hdr.number+'"><img src="/graphics/reply.gif" alt="Reply" width="150" height="20" border="0" title="Reply" /></a>':'&nbsp;'@@</td>
<td width="1%"class="msgnavmid">@@JS:template.can_post?'<a href="post.ssjs?msg_sub='+template.sub.code+'&amp;post=new"><img src="/graphics/post_new.gif" alt="Post New" width="150" height="20" border="0" title="Post New" /></a>':'&nbsp;'@@</td> <td width="1%"class="msgnavmid">@@JS:template.can_post?'<a href="post.ssjs?msg_sub='+template.sub.code+'&amp;post=new"><img src="/graphics/post_new.gif" alt="Post New" width="150" height="20" border="0" title="Post New" /></a>':'&nbsp;'@@</td>
@@JS:template.can_delete?'<td width="1%" class="msgnavmid"><a href="management.ssjs?Action=Delete+Selected+Message%28s%29&amp;msg_sub='+template.sub.code+'&amp;number='+template.hdr.number+'"><img src="/graphics/delete.gif" alt="Delete" width="150" height="20" border="0" title="Delete" /></a>':'&nbsp;'@@</td> @@JS:template.can_delete?'<td width="1%" class="msgnavmid"><a href="management.ssjs?Action=Delete&amp;msg_sub='+template.sub.code+'&amp;number='+template.hdr.number+'"><img src="/graphics/delete.gif" alt="Delete" width="150" height="20" border="0" title="Delete" /></a>':'&nbsp;'@@</td>
<td width="1%" class="msgnavright" nowrap="nowrap">@@nextlink@@</td> <td width="1%" class="msgnavright" nowrap="nowrap">@@nextlink@@</td>
</tr> </tr>
@@JS:if(template.replyto!=undefined && sub!='mail') '<tr class="msg"><td class="msg" colspan="5"><b>In Reply To: </b><a href="msg.ssjs?msg_sub='+sub+'&amp;message='+template.replyto.number+'">'+template.replyto.subject+'</a> ('+template.replyto.from+')</td></tr>'; else '';@@ @@JS:if(template.replyto!=undefined && sub!='mail') '<tr class="msg"><td class="msg" colspan="5"><b>In Reply To: </b><a href="msg.ssjs?msg_sub='+sub+'&amp;message='+template.replyto.number+'">'+template.replyto.subject+'</a> ('+template.replyto.from+')</td></tr>'; else '';@@
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
@@JS:template.show_choice==undefined ? '' : '(' + template.show_choice + ')<br /><br />'@@ @@JS:template.show_choice==undefined ? '' : '(' + template.show_choice + ')<br /><br />'@@
</div> </div>
<form name="DeleteMsg" action="management.ssjs" method="post"> <form name="DeleteMsg" action="management.ssjs?Action=Delete" method="post">
<input type="hidden" name="msg_sub" value="^^sub:code^^" /> <input type="hidden" name="msg_sub" value="^^sub:code^^" />
<table class="msglist" cellpadding="5" cellspacing="2" border="0" width="100%"> <table class="msglist" cellpadding="5" cellspacing="2" border="0" width="100%">
<tr class="msglist"> <tr class="msglist">
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
<<END REPEAT messages>> <<END REPEAT messages>>
</table> </table>
<br /> <br />
@@JS:template.can_delete?'<div align="center"><input class="msg" type="image" src="/graphics/delete_messages.gif" name="Action" value="Delete Selected Message(s)" /></div>':''@@ @@JS:template.can_delete?'<div align="center"><input class="msg" type="image" src="/graphics/delete_messages.gif" name="Action" value="Delete" /></div>':''@@
</form> </form>
<script type="text/javascript"> <script type="text/javascript">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment