From 6c71f08c6f65476b590628150b75c44262fad09b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rytis=20Slatkevi=C4=8Dius?= Date: Mon, 20 Aug 2007 17:59:24 +0000 Subject: [PATCH] Private messages: preview function before sending (fix #227) svn path=/trunk/boinc/; revision=13416 --- checkin_notes | 9 +++++++++ html/inc/forum_pm.inc | 13 ++++++++++++- html/user/forum_pm.php | 3 +++ html/user/white.css | 13 +++++++++++++ 4 files changed, 37 insertions(+), 1 deletion(-) diff --git a/checkin_notes b/checkin_notes index 38517aa67e..f2f2d75306 100755 --- a/checkin_notes +++ b/checkin_notes @@ -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 diff --git a/html/inc/forum_pm.inc b/html/inc/forum_pm.inc index ed859c0515..bd8711ff77 100644 --- a/html/inc/forum_pm.inc +++ b/html/inc/forum_pm.inc @@ -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 "
\n"; + echo "
Preview
\n"; + echo output_transform(post_str("content", true), $options); + echo "
\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 "Subject\n"; echo "Message
".html_info()."\n"; echo "\n"; - echo "\n"; + echo " \n"; end_table(); page_tail(); diff --git a/html/user/forum_pm.php b/html/user/forum_pm.php index e4ccce76fd..34d00ca6fe 100644 --- a/html/user/forum_pm.php +++ b/html/user/forum_pm.php @@ -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 { diff --git a/html/user/white.css b/html/user/white.css index d4510cc9a1..0671ce4b4a 100644 --- a/html/user/white.css +++ b/html/user/white.css @@ -292,4 +292,17 @@ span.news_date { color: #009900; 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; } \ No newline at end of file