Private messages: preview function before sending (fix #227)

svn path=/trunk/boinc/; revision=13416
This commit is contained in:
Rytis Slatkevičius 2007-08-20 17:59:24 +00:00
parent 88da6e04e8
commit 6c71f08c6f
4 changed files with 37 additions and 1 deletions

View File

@ -8001,3 +8001,12 @@ Charlie 19 Aug 2007
BOINCMgr.icns BOINCMgr.icns
MacInstaller.icns MacInstaller.icns
MacUninstaller.icns MacUninstaller.icns
Rytis 20 Aug 2007
Private messages: preview function before sending
html/
inc/forum_pm.inc
user/
forum_pm.php
white.css

View File

@ -14,6 +14,17 @@ function pm_create_new($error = null) {
page_head("Private messages : Create new"); page_head("Private messages : Create new");
pm_header(); pm_header();
/**
* Preview
**/
if (post_str("preview", true) == "Preview") {
$options = new output_options;
echo "<div id=\"preview\">\n";
echo "<div class=\"header\">Preview</div>\n";
echo output_transform(post_str("content", true), $options);
echo "</div>\n";
}
global $logged_in_user; global $logged_in_user;
$replyto = get_int("replyto", true); $replyto = get_int("replyto", true);
$userid = get_int("userid", true); $userid = get_int("userid", true);
@ -59,7 +70,7 @@ function pm_create_new($error = null) {
echo "<tr><th>Subject</th><td><input type=\"text\" name=\"subject\" value=\"$subject\" size=\"60\"></td></tr>\n"; echo "<tr><th>Subject</th><td><input type=\"text\" name=\"subject\" value=\"$subject\" size=\"60\"></td></tr>\n";
echo "<tr><th>Message<br /><span class=\"smalltext\">".html_info()."</span></th>\n"; echo "<tr><th>Message<br /><span class=\"smalltext\">".html_info()."</span></th>\n";
echo "<td><textarea name=\"content\" rows=\"18\" cols=\"80\">$content</textarea></td></tr>\n"; echo "<td><textarea name=\"content\" rows=\"18\" cols=\"80\">$content</textarea></td></tr>\n";
echo "<tr><td></td><td><input type=\"submit\" value=\"Send message\"></td></tr>\n"; echo "<tr><td></td><td><input type=\"submit\" name=\"preview\" value=\"Preview\"> <input type=\"submit\" value=\"Send message\"></td></tr>\n";
end_table(); end_table();
page_tail(); page_tail();

View File

@ -113,6 +113,9 @@ if ($action == "inbox") {
$subject = stripslashes(post_str("subject", true)); $subject = stripslashes(post_str("subject", true));
$content = stripslashes(post_str("content", true)); $content = stripslashes(post_str("content", true));
if (post_str("preview", true) == "Preview") {
pm_create_new();
}
if (($to == null) || ($subject == null) || ($content == null)) { if (($to == null) || ($subject == null) || ($content == null)) {
pm_create_new("You need to fill all fields to send a private message"); pm_create_new("You need to fill all fields to send a private message");
} else { } else {

View File

@ -293,3 +293,16 @@ span.news_date {
font-weight: bold; font-weight: bold;
font-size: 1.1em; font-size: 1.1em;
} }
#preview {
border: 2px solid #cccccc;
background-color: #eeeeee;
margin: 1em;
padding: 0.2em;
}
#preview .header {
font-weight: bold;
font-size: 1.3em;
border-bottom: 1px solid #cccccc;
}