diff options
author | Nils Adermann <naderman@naderman.de> | 2011-06-05 01:57:43 +0200 |
---|---|---|
committer | Nils Adermann <naderman@naderman.de> | 2011-06-05 01:58:03 +0200 |
commit | 6b6705b852bcd2a86735fa99d00a77426bf12813 (patch) | |
tree | 6e251bde591e2d3ec4bde705cf5ddff6736cda06 /phpBB/includes/ucp/ucp_pm_compose.php | |
parent | 67449f8f1b1b9eff8430a77d16d6ee2dac1210d9 (diff) | |
download | forums-6b6705b852bcd2a86735fa99d00a77426bf12813.tar forums-6b6705b852bcd2a86735fa99d00a77426bf12813.tar.gz forums-6b6705b852bcd2a86735fa99d00a77426bf12813.tar.bz2 forums-6b6705b852bcd2a86735fa99d00a77426bf12813.tar.xz forums-6b6705b852bcd2a86735fa99d00a77426bf12813.zip |
[ticket/10158] Remove some code duplication from generating the message.
PHPBB3-10158
Diffstat (limited to 'phpBB/includes/ucp/ucp_pm_compose.php')
-rw-r--r-- | phpBB/includes/ucp/ucp_pm_compose.php | 38 |
1 files changed, 10 insertions, 28 deletions
diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index 78b2e7a348..05243e3d7a 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -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); } + $return_box_url = ($action === 'post' || $action === 'edit') ? $outbox_folder_url : $inbox_folder_url; + $return_box_lang = ($action === 'post' || $action === 'edit') ? 'PM_OUTBOX' : 'PM_INBOX'; + + $message = $user->lang['MESSAGE_STORED'] . '<br /><br />' . sprintf($user->lang['VIEW_PRIVATE_MESSAGE'], '<a href="' . $return_message_url . '">', '</a>'); - switch ($action) - { - 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': - case 'reply': - case 'forward': - 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="' . $inbox_folder_url . '">', '</a>', $user->lang['PM_INBOX']); - } - else - { - $message .= '<br /><br />' . sprintf($user->lang['CLICK_RETURN_FOLDER'], '<a href="' . $inbox_folder_url . '">', '</a>', $user->lang['PM_INBOX']); - } - break; + $last_click_type = 'CLICK_RETURN_FOLDER'; + if ($folder_url) + { + $message .= '<br /><br />' . sprintf($user->lang['CLICK_RETURN_FOLDER'], '<a href="' . $folder_url . '">', '</a>', $user_folders[$folder_id]['folder_name']); + $last_click_type = 'CLICK_GOTO_FOLDER'; } + $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); trigger_error($message); |