aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Alexander <admin@m-a-styles.de>2019-07-23 21:08:54 +0200
committerMarc Alexander <admin@m-a-styles.de>2019-07-23 21:08:54 +0200
commitb5e6f34cd909d3059f2a670c8834ceb7027d649f (patch)
treee1eaeeceb9b1175823a241b988bbaa8f1cd240a7
parentce518043e9a264f582bb79a588dfee6ad417d010 (diff)
parenta4ad94ef5c08798fbe55f3f114fd2b256beb3789 (diff)
downloadforums-b5e6f34cd909d3059f2a670c8834ceb7027d649f.tar
forums-b5e6f34cd909d3059f2a670c8834ceb7027d649f.tar.gz
forums-b5e6f34cd909d3059f2a670c8834ceb7027d649f.tar.bz2
forums-b5e6f34cd909d3059f2a670c8834ceb7027d649f.tar.xz
forums-b5e6f34cd909d3059f2a670c8834ceb7027d649f.zip
Merge branch '3.2.x' into 3.3.x
-rw-r--r--phpBB/includes/functions.php28
1 files changed, 24 insertions, 4 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php
index c3108f6f8e..b0b9cc892c 100644
--- a/phpBB/includes/functions.php
+++ b/phpBB/includes/functions.php
@@ -2146,7 +2146,7 @@ function check_form_key($form_name, $timespan = false)
function confirm_box($check, $title = '', $hidden = '', $html_body = 'confirm_body.html', $u_action = '')
{
global $user, $template, $db, $request;
- global $config, $language, $phpbb_path_helper;
+ global $config, $language, $phpbb_path_helper, $phpbb_dispatcher;
if (isset($_POST['cancel']))
{
@@ -2243,8 +2243,7 @@ function confirm_box($check, $title = '', $hidden = '', $html_body = 'confirm_bo
if ($request->is_ajax())
{
$u_action .= '&confirm_uid=' . $user->data['user_id'] . '&sess=' . $user->session_id . '&sid=' . $user->session_id;
- $json_response = new \phpbb\json_response;
- $json_response->send(array(
+ $data = array(
'MESSAGE_BODY' => $template->assign_display('body'),
'MESSAGE_TITLE' => $confirm_title,
'MESSAGE_TEXT' => $confirm_text,
@@ -2252,7 +2251,28 @@ function confirm_box($check, $title = '', $hidden = '', $html_body = 'confirm_bo
'YES_VALUE' => $language->lang('YES'),
'S_CONFIRM_ACTION' => str_replace('&amp;', '&', $u_action), //inefficient, rewrite whole function
'S_HIDDEN_FIELDS' => $hidden . $s_hidden_fields
- ));
+ );
+
+ /**
+ * This event allows an extension to modify the ajax output of confirm box.
+ *
+ * @event core.confirm_box_ajax_before
+ * @var string u_action Action of the form
+ * @var array data Data to be sent
+ * @var string hidden Hidden fields generated by caller
+ * @var string s_hidden_fields Hidden fields generated by this function
+ * @since 3.2.8-RC1
+ */
+ $vars = array(
+ 'u_action',
+ 'data',
+ 'hidden',
+ 's_hidden_fields',
+ );
+ extract($phpbb_dispatcher->trigger_event('core.confirm_box_ajax_before', compact($vars)));
+
+ $json_response = new \phpbb\json_response;
+ $json_response->send($data);
}
if (defined('IN_ADMIN') && isset($user->data['session_admin']) && $user->data['session_admin'])