mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-10 18:54:08 +02:00
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
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user