mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 14:18:52 +00:00
[ticket/10158] Remove some code duplication from generating the message.
PHPBB3-10158
This commit is contained in:
parent
67449f8f1b
commit
6b6705b852
1 changed files with 11 additions and 29 deletions
|
@ -751,37 +751,19 @@ function compose_pm($id, $mode, $action, $user_folders = array())
|
||||||
$folder_url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&folder=' . $folder_id);
|
$folder_url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&folder=' . $folder_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
$message = $user->lang['MESSAGE_STORED'] . '<br /><br />' . sprintf($user->lang['VIEW_PRIVATE_MESSAGE'], '<a href="' . $return_message_url . '">', '</a>');
|
$return_box_url = ($action === 'post' || $action === 'edit') ? $outbox_folder_url : $inbox_folder_url;
|
||||||
switch ($action)
|
$return_box_lang = ($action === 'post' || $action === 'edit') ? 'PM_OUTBOX' : 'PM_INBOX';
|
||||||
{
|
|
||||||
case 'post':
|
|
||||||
case 'edit':
|
|
||||||
if ($folder_url)
|
|
||||||
{
|
|
||||||
$message .= '<br /><br />' . sprintf($user->lang['CLICK_RETURN_FOLDER'], '<a href="' . $folder_url . '">', '</a>', $user_folders[$folder_id]['folder_name']);
|
|
||||||
$message .= '<br /><br />' . sprintf($user->lang['CLICK_GOTO_FOLDER'], '<a href="' . $outbox_folder_url . '">', '</a>', $user->lang['PM_OUTBOX']);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$message .= '<br /><br />' . sprintf($user->lang['CLICK_RETURN_FOLDER'], '<a href="' . $outbox_folder_url . '">', '</a>', $user->lang['PM_OUTBOX']);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 'quote':
|
|
||||||
case 'quotepost':
|
$message = $user->lang['MESSAGE_STORED'] . '<br /><br />' . sprintf($user->lang['VIEW_PRIVATE_MESSAGE'], '<a href="' . $return_message_url . '">', '</a>');
|
||||||
case 'reply':
|
|
||||||
case 'forward':
|
$last_click_type = 'CLICK_RETURN_FOLDER';
|
||||||
if ($folder_url)
|
if ($folder_url)
|
||||||
{
|
{
|
||||||
$message .= '<br /><br />' . sprintf($user->lang['CLICK_RETURN_FOLDER'], '<a href="' . $folder_url . '">', '</a>', $user_folders[$folder_id]['folder_name']);
|
$message .= '<br /><br />' . sprintf($user->lang['CLICK_RETURN_FOLDER'], '<a href="' . $folder_url . '">', '</a>', $user_folders[$folder_id]['folder_name']);
|
||||||
$message .= '<br /><br />' . sprintf($user->lang['CLICK_GOTO_FOLDER'], '<a href="' . $inbox_folder_url . '">', '</a>', $user->lang['PM_INBOX']);
|
$last_click_type = 'CLICK_GOTO_FOLDER';
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$message .= '<br /><br />' . sprintf($user->lang['CLICK_RETURN_FOLDER'], '<a href="' . $inbox_folder_url . '">', '</a>', $user->lang['PM_INBOX']);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
$message .= '<br /><br />' . sprintf($user->lang[$last_click_type], '<a href="' . $return_box_url . '">', '</a>', $user->lang[$return_box_lang]);
|
||||||
|
|
||||||
meta_refresh(3, $return_message_url);
|
meta_refresh(3, $return_message_url);
|
||||||
trigger_error($message);
|
trigger_error($message);
|
||||||
|
|
Loading…
Add table
Reference in a new issue