mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 21:40:43 +02:00
Merge branch 'develop-olympus' into develop
* develop-olympus: [ticket/10158] Remove some code duplication from generating the message. [ticket/10195] Return false in session::check_dnsbl() when IPv6 is passed. [ticket/10158] Only view "Return to" links if they are useful. [ticket/10158] Add return-link to folder, when the user replied from a folder. [ticket/10158] Add "Return to Inbox"-link to "PM send"-message.
This commit is contained in:
@@ -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;
|
||||
@@ -130,6 +130,7 @@ function compose_pm($id, $mode, $action)
|
||||
}
|
||||
|
||||
$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.
|
||||
@@ -393,7 +394,7 @@ function compose_pm($id, $mode, $action)
|
||||
unset($message_text);
|
||||
|
||||
$s_action = append_sid("{$phpbb_root_path}ucp.$phpEx", "i=$id&mode=$mode&action=$action", true, $user->session_id);
|
||||
$s_action .= ($msg_id) ? "&p=$msg_id" : '';
|
||||
$s_action .= (($folder_id) ? "&f=$folder_id" : '') . (($msg_id) ? "&p=$msg_id" : '');
|
||||
|
||||
// Delete triggered ?
|
||||
if ($action == 'delete')
|
||||
@@ -736,10 +737,30 @@ 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&mode=view&p=' . $msg_id);
|
||||
$return_folder_url = append_sid("{$phpbb_root_path}ucp.$phpEx", 'i=pm&folder=outbox');
|
||||
meta_refresh(3, $return_message_url);
|
||||
$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');
|
||||
|
||||
$message = $user->lang['MESSAGE_STORED'] . '<br /><br />' . sprintf($user->lang['VIEW_PRIVATE_MESSAGE'], '<a href="' . $return_message_url . '">', '</a>') . '<br /><br />' . sprintf($user->lang['CLICK_RETURN_FOLDER'], '<a href="' . $return_folder_url . '">', '</a>', $user->lang['PM_OUTBOX']);
|
||||
$folder_url = '';
|
||||
if (($folder_id > 0) && isset($user_folders[$folder_id]))
|
||||
{
|
||||
$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>');
|
||||
|
||||
$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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user