mirror of https://github.com/BOINC/boinc.git
Private messages: preview function before sending (fix #227)
svn path=/trunk/boinc/; revision=13416
This commit is contained in:
parent
88da6e04e8
commit
6c71f08c6f
|
@ -8001,3 +8001,12 @@ Charlie 19 Aug 2007
|
|||
BOINCMgr.icns
|
||||
MacInstaller.icns
|
||||
MacUninstaller.icns
|
||||
|
||||
Rytis 20 Aug 2007
|
||||
Private messages: preview function before sending
|
||||
|
||||
html/
|
||||
inc/forum_pm.inc
|
||||
user/
|
||||
forum_pm.php
|
||||
white.css
|
||||
|
|
|
@ -14,6 +14,17 @@ function pm_create_new($error = null) {
|
|||
page_head("Private messages : Create new");
|
||||
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;
|
||||
$replyto = get_int("replyto", 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>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 "<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();
|
||||
|
||||
page_tail();
|
||||
|
|
|
@ -113,6 +113,9 @@ if ($action == "inbox") {
|
|||
$subject = stripslashes(post_str("subject", true));
|
||||
$content = stripslashes(post_str("content", true));
|
||||
|
||||
if (post_str("preview", true) == "Preview") {
|
||||
pm_create_new();
|
||||
}
|
||||
if (($to == null) || ($subject == null) || ($content == null)) {
|
||||
pm_create_new("You need to fill all fields to send a private message");
|
||||
} else {
|
||||
|
|
|
@ -293,3 +293,16 @@ span.news_date {
|
|||
font-weight: bold;
|
||||
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;
|
||||
}
|
Loading…
Reference in New Issue