aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/ucp/ucp_pm_compose.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2006-12-24 13:11:54 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2006-12-24 13:11:54 +0000
commitae1cb0316e6c19d62f0579e9cef52f11df081bcf (patch)
treed5e0900486aeb6ac91b957ce2ac47a4d55cdddc7 /phpBB/includes/ucp/ucp_pm_compose.php
parent9cc0b364bcc9473d0b1f4656db9008a55921918b (diff)
downloadforums-ae1cb0316e6c19d62f0579e9cef52f11df081bcf.tar
forums-ae1cb0316e6c19d62f0579e9cef52f11df081bcf.tar.gz
forums-ae1cb0316e6c19d62f0579e9cef52f11df081bcf.tar.bz2
forums-ae1cb0316e6c19d62f0579e9cef52f11df081bcf.tar.xz
forums-ae1cb0316e6c19d62f0579e9cef52f11df081bcf.zip
some fixes today
- most important change is the consolidation of the display attachment functions; merging them together to have one function we need to call. git-svn-id: file:///svn/phpbb/trunk@6803 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/ucp/ucp_pm_compose.php')
-rw-r--r--phpBB/includes/ucp/ucp_pm_compose.php33
1 files changed, 23 insertions, 10 deletions
diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php
index 8fa5de090f..0dd85c06ae 100644
--- a/phpBB/includes/ucp/ucp_pm_compose.php
+++ b/phpBB/includes/ucp/ucp_pm_compose.php
@@ -48,7 +48,7 @@ function compose_pm($id, $mode, $action)
$add_to = (isset($_REQUEST['add_to'])) ? true : false;
$add_bcc = (isset($_REQUEST['add_bcc'])) ? true : false;
- $refresh = isset($_POST['add_file']) || isset($_POST['delete_file']) || isset($_POST['edit_comment']) || $save || $load
+ $refresh = isset($_POST['add_file']) || isset($_POST['delete_file']) || $save || $load
|| $remove_u || $remove_g || $add_to || $add_bcc;
$action = ($delete && !$preview && !$refresh && $submit) ? 'delete' : $action;
@@ -514,14 +514,17 @@ function compose_pm($id, $mode, $action)
}
// Subject defined
- if (!$subject && !($remove_u || $remove_g || $add_to || $add_bcc))
+ if ($submit)
{
- $error[] = $user->lang['EMPTY_SUBJECT'];
- }
+ if (!$subject)
+ {
+ $error[] = $user->lang['EMPTY_SUBJECT'];
+ }
- if (!sizeof($address_list))
- {
- $error[] = $user->lang['NO_RECIPIENT'];
+ if (!sizeof($address_list))
+ {
+ $error[] = $user->lang['NO_RECIPIENT'];
+ }
}
if (sizeof($message_parser->warn_msg) && !($remove_u || $remove_g || $add_to || $add_bcc))
@@ -597,10 +600,20 @@ function compose_pm($id, $mode, $action)
// Attachment Preview
if (sizeof($message_parser->attachment_data))
{
- $extensions = $update_count = array();
-
$template->assign_var('S_HAS_ATTACHMENTS', true);
- display_attachments(0, 'attachment', $message_parser->attachment_data, $update_count);
+
+ $update_count = array();
+ $attachment_data = $message_parser->attachment_data;
+
+ parse_attachments(0, $preview_message, $attachment_data, $update_count, true);
+
+ foreach ($attachment_data as $i => $attachment)
+ {
+ $template->assign_block_vars('attachment', array(
+ 'DISPLAY_ATTACHMENT' => $attachment)
+ );
+ }
+ unset($attachment_data);
}
$preview_subject = censor_text($subject);