aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/ucp
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2011-05-09 12:46:34 +0200
committerJoas Schilling <nickvergessen@gmx.de>2011-05-09 12:46:34 +0200
commit437013194a516932b6f85ba4ee355dcf5836ef19 (patch)
tree7d3861adc7fe5283bfab4d8370e691d5eac89aff /phpBB/includes/ucp
parent65d956bd81fad62d7bc2f489ea8d3d930e666049 (diff)
downloadforums-437013194a516932b6f85ba4ee355dcf5836ef19.tar
forums-437013194a516932b6f85ba4ee355dcf5836ef19.tar.gz
forums-437013194a516932b6f85ba4ee355dcf5836ef19.tar.bz2
forums-437013194a516932b6f85ba4ee355dcf5836ef19.tar.xz
forums-437013194a516932b6f85ba4ee355dcf5836ef19.zip
[ticket/10158] Add return-link to folder, when the user replied from a folder.
PHPBB3-10158
Diffstat (limited to 'phpBB/includes/ucp')
-rw-r--r--phpBB/includes/ucp/ucp_pm.php4
-rw-r--r--phpBB/includes/ucp/ucp_pm_compose.php20
2 files changed, 17 insertions, 7 deletions
diff --git a/phpBB/includes/ucp/ucp_pm.php b/phpBB/includes/ucp/ucp_pm.php
index e1c51170db..c675928a5b 100644
--- a/phpBB/includes/ucp/ucp_pm.php
+++ b/phpBB/includes/ucp/ucp_pm.php
@@ -115,7 +115,7 @@ class ucp_pm
case 'compose':
$action = request_var('action', 'post');
- get_folder($user->data['user_id']);
+ $user_folders = get_folder($user->data['user_id']);
if (!$auth->acl_get('u_sendpm'))
{
@@ -130,7 +130,7 @@ class ucp_pm
}
include($phpbb_root_path . 'includes/ucp/ucp_pm_compose.' . $phpEx);
- compose_pm($id, $mode, $action);
+ compose_pm($id, $mode, $action, $user_folders);
$tpl_file = 'posting_body';
break;
diff --git a/phpBB/includes/ucp/ucp_pm_compose.php b/phpBB/includes/ucp/ucp_pm_compose.php
index d7fe0af361..6ea702570e 100644
--- a/phpBB/includes/ucp/ucp_pm_compose.php
+++ b/phpBB/includes/ucp/ucp_pm_compose.php
@@ -20,7 +20,7 @@ if (!defined('IN_PHPBB'))
* Compose private message
* Called from ucp_pm with mode == 'compose'
*/
-function compose_pm($id, $mode, $action)
+function compose_pm($id, $mode, $action, $user_folders = array())
{
global $template, $db, $auth, $user;
global $phpbb_root_path, $phpEx, $config;
@@ -398,7 +398,7 @@ function compose_pm($id, $mode, $action)
unset($message_text);
$s_action = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=$id&amp;mode=$mode&amp;action=$action", true, $user->session_id);
- $s_action .= ($msg_id) ? "&amp;p=$msg_id" : '';
+ $s_action .= (($folder_id) ? "&amp;f=$folder_id" : '') . (($msg_id) ? "&amp;p=$msg_id" : '');
// Delete triggered ?
if ($action == 'delete')
@@ -741,13 +741,23 @@ function compose_pm($id, $mode, $action)
$msg_id = submit_pm($action, $subject, $pm_data);
$return_message_url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;mode=view&amp;p=' . $msg_id);
- $return_folder_url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;folder=inbox');
+ $inbox_folder_url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;folder=inbox');
$outbox_folder_url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;folder=outbox');
- meta_refresh(3, $return_message_url);
+
+ $folder_return_message = '';
+ $return_message_url = $inbox_folder_url;
+ if ($folder_id && isset($user_folders[$folder_id]))
+ {
+ $return_message_url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&amp;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']);
+ }
$message = $user->lang['MESSAGE_STORED'] . '<br /><br />' . sprintf($user->lang['VIEW_PRIVATE_MESSAGE'], '<a href="' . $return_message_url . '">', '</a>');
- $message .= '<br /><br />' . sprintf($user->lang['CLICK_RETURN_FOLDER'], '<a href="' . $return_folder_url . '">', '</a>', $user->lang['PM_INBOX']);
+ $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']);
+
+ meta_refresh(3, $return_message_url);
trigger_error($message);
}