diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2011-05-23 12:01:11 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2011-05-23 12:03:04 +0200 |
commit | 67449f8f1b1b9eff8430a77d16d6ee2dac1210d9 (patch) | |
tree | 20c848648bb699d449941de0ef7dc88be3a89877 /phpBB/includes/ucp/ucp_pm_compose.php | |
parent | 437013194a516932b6f85ba4ee355dcf5836ef19 (diff) | |
download | forums-67449f8f1b1b9eff8430a77d16d6ee2dac1210d9.tar forums-67449f8f1b1b9eff8430a77d16d6ee2dac1210d9.tar.gz forums-67449f8f1b1b9eff8430a77d16d6ee2dac1210d9.tar.bz2 forums-67449f8f1b1b9eff8430a77d16d6ee2dac1210d9.tar.xz forums-67449f8f1b1b9eff8430a77d16d6ee2dac1210d9.zip |
[ticket/10158] Only view "Return to" links if they are useful.
PHPBB3-10158
Diffstat (limited to 'phpBB/includes/ucp/ucp_pm_compose.php')
-rw-r--r-- | phpBB/includes/ucp/ucp_pm_compose.php | 42 |
1 files changed, 34 insertions, 8 deletions
diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php index 6ea702570e..78b2e7a348 100644 --- a/phpBB/includes/ucp/ucp_pm_compose.php +++ b/phpBB/includes/ucp/ucp_pm_compose.php @@ -135,6 +135,7 @@ function compose_pm($id, $mode, $action, $user_folders = array()) } $sql = ''; + $folder_id = 0; // What is all this following SQL for? Well, we need to know // some basic information in all cases before we do anything. @@ -744,18 +745,43 @@ function compose_pm($id, $mode, $action, $user_folders = array()) $inbox_folder_url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&folder=inbox'); $outbox_folder_url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&folder=outbox'); - $folder_return_message = ''; - $return_message_url = $inbox_folder_url; - if ($folder_id && isset($user_folders[$folder_id])) + $folder_url = ''; + if (($folder_id > 0) && isset($user_folders[$folder_id])) { - $return_message_url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&folder=' . $folder_id); - $folder_return_message = '<br /><br />' . sprintf($user->lang['CLICK_RETURN_FOLDER'], '<a href="' . $return_message_url . '">', '</a>', $user_folders[$folder_id]['folder_name']); + $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>'); - $message .= $folder_return_message; - $message .= '<br /><br />' . sprintf($user->lang['CLICK_RETURN_FOLDER'], '<a href="' . $inbox_folder_url . '">', '</a>', $user->lang['PM_INBOX']); - $message .= '<br /><br />' . sprintf($user->lang['CLICK_RETURN_FOLDER'], '<a href="' . $outbox_folder_url . '">', '</a>', $user->lang['PM_OUTBOX']); + 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; + } meta_refresh(3, $return_message_url); trigger_error($message); |