From 443b931b364be43af2dac7c35637d5f6752223ce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dark=E2=9D=B6?= Date: Sun, 22 Mar 2020 01:45:56 +0530 Subject: [PATCH 1/7] [ticket/16411] Add vars to notification core events PHPBB3-16411 --- phpBB/includes/ucp/ucp_notifications.php | 4 ++++ phpBB/styles/prosilver/template/ucp_notifications.html | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/phpBB/includes/ucp/ucp_notifications.php b/phpBB/includes/ucp/ucp_notifications.php index b0eeb915ec..ccb118900a 100644 --- a/phpBB/includes/ucp/ucp_notifications.php +++ b/phpBB/includes/ucp/ucp_notifications.php @@ -70,6 +70,7 @@ class ucp_notifications * @var array type_data The notification type data * @var array method_data The notification method data * @var bool is_set_notify The notification is set or not + * @var array subscriptions The subscriptions data * * @since 3.2.10-RC1 */ @@ -77,6 +78,7 @@ class ucp_notifications 'type_data', 'method_data', 'is_set_notify', + 'subscriptions', ]; extract($phpbb_dispatcher->trigger_event('core.ucp_notifications_submit_notification_is_set', compact($vars))); @@ -225,6 +227,7 @@ class ucp_notifications * @var array type_data The notification type data * @var array method_data The notification method data * @var array tpl_ary The template variables + * @var array subscriptions The subscriptions data * * @since 3.2.10-RC1 */ @@ -232,6 +235,7 @@ class ucp_notifications 'type_data', 'method_data', 'tpl_ary', + 'subscriptions', ]; extract($phpbb_dispatcher->trigger_event('core.ucp_notifications_output_notification_types_modify_template_vars', compact($vars))); diff --git a/phpBB/styles/prosilver/template/ucp_notifications.html b/phpBB/styles/prosilver/template/ucp_notifications.html index 55e30477d2..1d0249abd1 100644 --- a/phpBB/styles/prosilver/template/ucp_notifications.html +++ b/phpBB/styles/prosilver/template/ucp_notifications.html @@ -31,7 +31,7 @@
   {notification_types.EXPLAIN} - checked="checked" disabled="disabled" /> + checked="checked" disabled="disabled" /> From 2c0509a5c77f8d2d938ab64a1f74277946af09e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dark=E2=9D=B6?= Date: Sun, 22 Mar 2020 03:40:37 +0530 Subject: [PATCH 2/7] [ticket/16411] Add vars to notification core events PHPBB3-16411 --- phpBB/includes/ucp/ucp_notifications.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/ucp/ucp_notifications.php b/phpBB/includes/ucp/ucp_notifications.php index ccb118900a..df0418e483 100644 --- a/phpBB/includes/ucp/ucp_notifications.php +++ b/phpBB/includes/ucp/ucp_notifications.php @@ -62,6 +62,7 @@ class ucp_notifications foreach ($notification_methods as $method => $method_data) { $is_set_notify = $request->is_set_post(str_replace('.', '_', $type . '_' . $method_data['id'])); + $is_available = $method_data['method']->is_available($type_data['type']); /** * Event to perform additional actions before ucp_notifications is submitted @@ -70,6 +71,7 @@ class ucp_notifications * @var array type_data The notification type data * @var array method_data The notification method data * @var bool is_set_notify The notification is set or not + * @var bool is_available The notification is available or not * @var array subscriptions The subscriptions data * * @since 3.2.10-RC1 @@ -78,15 +80,16 @@ class ucp_notifications 'type_data', 'method_data', 'is_set_notify', + 'is_available', 'subscriptions', ]; extract($phpbb_dispatcher->trigger_event('core.ucp_notifications_submit_notification_is_set', compact($vars))); - if ($is_set_notify && (!isset($subscriptions[$type]) || !in_array($method_data['id'], $subscriptions[$type]))) + if ($is_set_notify && $is_available && (!isset($subscriptions[$type]) || !in_array($method_data['id'], $subscriptions[$type]))) { $phpbb_notifications->add_subscription($type, 0, $method_data['id']); } - else if (!$is_set_notify && isset($subscriptions[$type]) && in_array($method_data['id'], $subscriptions[$type])) + else if ((!$is_set_notify || !$is_available) && isset($subscriptions[$type]) && in_array($method_data['id'], $subscriptions[$type])) { $phpbb_notifications->delete_subscription($type, 0, $method_data['id']); } From e0a7676c3f9855684e7466b22c28a83b1bc053d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dark=E2=9D=B6?= Date: Wed, 22 Apr 2020 10:32:29 +0530 Subject: [PATCH 3/7] [ticket/16411] Add vars to notification core events PHPBB3-16411 --- phpBB/includes/ucp/ucp_notifications.php | 2 ++ phpBB/phpbb/notification/manager.php | 1 + 2 files changed, 3 insertions(+) diff --git a/phpBB/includes/ucp/ucp_notifications.php b/phpBB/includes/ucp/ucp_notifications.php index df0418e483..7a46d3e5aa 100644 --- a/phpBB/includes/ucp/ucp_notifications.php +++ b/phpBB/includes/ucp/ucp_notifications.php @@ -75,6 +75,7 @@ class ucp_notifications * @var array subscriptions The subscriptions data * * @since 3.2.10-RC1 + * @since 3.3.1-RC1 */ $vars = [ 'type_data', @@ -233,6 +234,7 @@ class ucp_notifications * @var array subscriptions The subscriptions data * * @since 3.2.10-RC1 + * @since 3.3.1-RC1 */ $vars = [ 'type_data', diff --git a/phpBB/phpbb/notification/manager.php b/phpBB/phpbb/notification/manager.php index 2d6d081d33..ace08e6cf6 100644 --- a/phpBB/phpbb/notification/manager.php +++ b/phpBB/phpbb/notification/manager.php @@ -350,6 +350,7 @@ class manager * @var array notify_users User list to notify * * @since 3.2.10-RC1 + * @since 3.3.1-RC1 */ $vars = [ 'notification_type_name', From bd23583431b7525c5002074e086ed3c7df30667d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dark=E2=9D=B6?= Date: Wed, 22 Apr 2020 11:12:39 +0530 Subject: [PATCH 4/7] [ticket/16411] Add vars to notification core events Added missing `since 3.3.1-RC1`. PHPBB3-16411 --- phpBB/ucp.php | 2 ++ phpBB/viewforum.php | 1 + 2 files changed, 3 insertions(+) diff --git a/phpBB/ucp.php b/phpBB/ucp.php index 0d3feb9aa9..3dab416678 100644 --- a/phpBB/ucp.php +++ b/phpBB/ucp.php @@ -363,6 +363,7 @@ if ($module->is_active('zebra', 'friends')) * @var array sql_ary SQL query array for listing of friends * * @since 3.2.10-RC1 + * @since 3.3.1-RC1 */ $vars = [ 'sql_ary', @@ -393,6 +394,7 @@ if ($module->is_active('zebra', 'friends')) * @var string which friend is 'online' or 'offline' * * @since 3.2.10-RC1 + * @since 3.3.1-RC1 */ $vars = [ 'row', diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index f8793bdf2e..a793cfe9a3 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -723,6 +723,7 @@ if (count($topic_list)) * @var array sql_array SQL query array for obtaining topics/stickies * * @since 3.2.10-RC1 + * @since 3.3.1-RC1 */ $vars = [ 'forum_id', From 0e69bcc2824e1c552129ef97dc9b7ae6772f3f80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dark=E2=9D=B6?= Date: Wed, 22 Apr 2020 11:29:58 +0530 Subject: [PATCH 5/7] [ticket/16411] Add vars to notification core events Added missing `Since: 3.2.10-RC1 , 3.3.1-RC1` , in Events.MD . PHPBB3-16411 --- phpBB/docs/events.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/phpBB/docs/events.md b/phpBB/docs/events.md index 6ef31a20b7..fe8e79f360 100644 --- a/phpBB/docs/events.md +++ b/phpBB/docs/events.md @@ -1898,28 +1898,28 @@ posting_editor_topic_icons_after === * Locations: + styles/prosilver/template/posting_editor.html -* Since: 3.2.10-RC1 +* Since: 3.2.10-RC1 , 3.3.1-RC1 * Purpose: Add custom data after the topic icons loop posting_editor_topic_icons_append === * Locations: + styles/prosilver/template/posting_editor.html -* Since: 3.2.10-RC1 +* Since: 3.2.10-RC1 , 3.3.1-RC1 * Purpose: Append custom data to the topic icon posting_editor_topic_icons_before === * Locations: + styles/prosilver/template/posting_editor.html -* Since: 3.2.10-RC1 +* Since: 3.2.10-RC1 , 3.3.1-RC1 * Purpose: Add custom data before the topic icons loop posting_editor_topic_icons_prepend === * Locations: + styles/prosilver/template/posting_editor.html -* Since: 3.2.10-RC1 +* Since: 3.2.10-RC1 , 3.3.1-RC1 * Purpose: Prepend custom data to the topic icon posting_layout_include_panel_body @@ -2408,28 +2408,28 @@ ucp_header_friends_offline_username_full_append === * Locations: + styles/prosilver/template/ucp_header.html -* Since: 3.2.10-RC1 +* Since: 3.2.10-RC1 , 3.3.1-RC1 * Purpose: Append information to offline friends username in UCP ucp_header_friends_offline_username_full_prepend === * Locations: + styles/prosilver/template/ucp_header.html -* Since: 3.2.10-RC1 +* Since: 3.2.10-RC1 , 3.3.1-RC1 * Purpose: Prepend information to offline friends username in UCP ucp_header_friends_online_username_full_append === * Locations: + styles/prosilver/template/ucp_header.html -* Since: 3.2.10-RC1 +* Since: 3.2.10-RC1 , 3.3.1-RC1 * Purpose: Append information to online friends username in UCP ucp_header_friends_online_username_full_prepend === * Locations: + styles/prosilver/template/ucp_header.html -* Since: 3.2.10-RC1 +* Since: 3.2.10-RC1 , 3.3.1-RC1 * Purpose: Prepend information to online friends username in UCP ucp_main_front_user_activity_after @@ -2790,7 +2790,7 @@ viewforum_body_online_list_before === * Locations: + styles/prosilver/template/viewforum_body.html -* Since: 3.2.10-RC1 +* Since: 3.2.10-RC1 , 3.3.1-RC1 * Purpose: Add content before the online users list viewforum_body_topic_author_username_append @@ -2954,7 +2954,7 @@ viewtopic_body_online_list_before === * Locations: + styles/prosilver/template/viewtopic_body.html -* Since: 3.2.10-RC1 +* Since: 3.2.10-RC1 , 3.3.1-RC1 * Purpose: Add content before the online users list viewtopic_body_pagination_top_after From 6f4d1cda132d94fb684e03517dc19b1a2392771f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dark=E2=9D=B6?= Date: Wed, 22 Apr 2020 11:35:29 +0530 Subject: [PATCH 6/7] [ticket/16411] Add vars to notification core events Added missing `Since: 3.2.10-RC1 , 3.3.1-RC1` , in Events.MD . PHPBB3-16411 --- phpBB/docs/events.md | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/phpBB/docs/events.md b/phpBB/docs/events.md index fe8e79f360..1641127dd0 100644 --- a/phpBB/docs/events.md +++ b/phpBB/docs/events.md @@ -1898,28 +1898,32 @@ posting_editor_topic_icons_after === * Locations: + styles/prosilver/template/posting_editor.html -* Since: 3.2.10-RC1 , 3.3.1-RC1 +* Since: 3.2.10-RC1 +* Since: 3.3.1-RC1 * Purpose: Add custom data after the topic icons loop posting_editor_topic_icons_append === * Locations: + styles/prosilver/template/posting_editor.html -* Since: 3.2.10-RC1 , 3.3.1-RC1 +* Since: 3.2.10-RC1 +* Since: 3.3.1-RC1 * Purpose: Append custom data to the topic icon posting_editor_topic_icons_before === * Locations: + styles/prosilver/template/posting_editor.html -* Since: 3.2.10-RC1 , 3.3.1-RC1 +* Since: 3.2.10-RC1 +* Since: 3.3.1-RC1 * Purpose: Add custom data before the topic icons loop posting_editor_topic_icons_prepend === * Locations: + styles/prosilver/template/posting_editor.html -* Since: 3.2.10-RC1 , 3.3.1-RC1 +* Since: 3.2.10-RC1 +* Since: 3.3.1-RC1 * Purpose: Prepend custom data to the topic icon posting_layout_include_panel_body @@ -2408,28 +2412,32 @@ ucp_header_friends_offline_username_full_append === * Locations: + styles/prosilver/template/ucp_header.html -* Since: 3.2.10-RC1 , 3.3.1-RC1 +* Since: 3.2.10-RC1 +* Since: 3.3.1-RC1 * Purpose: Append information to offline friends username in UCP ucp_header_friends_offline_username_full_prepend === * Locations: + styles/prosilver/template/ucp_header.html -* Since: 3.2.10-RC1 , 3.3.1-RC1 +* Since: 3.2.10-RC1 +* Since: 3.3.1-RC1 * Purpose: Prepend information to offline friends username in UCP ucp_header_friends_online_username_full_append === * Locations: + styles/prosilver/template/ucp_header.html -* Since: 3.2.10-RC1 , 3.3.1-RC1 +* Since: 3.2.10-RC1 +* Since: 3.3.1-RC1 * Purpose: Append information to online friends username in UCP ucp_header_friends_online_username_full_prepend === * Locations: + styles/prosilver/template/ucp_header.html -* Since: 3.2.10-RC1 , 3.3.1-RC1 +* Since: 3.2.10-RC1 +* Since: 3.3.1-RC1 * Purpose: Prepend information to online friends username in UCP ucp_main_front_user_activity_after @@ -2790,7 +2798,8 @@ viewforum_body_online_list_before === * Locations: + styles/prosilver/template/viewforum_body.html -* Since: 3.2.10-RC1 , 3.3.1-RC1 +* Since: 3.2.10-RC1 +* Since: 3.3.1-RC1 * Purpose: Add content before the online users list viewforum_body_topic_author_username_append @@ -2954,7 +2963,8 @@ viewtopic_body_online_list_before === * Locations: + styles/prosilver/template/viewtopic_body.html -* Since: 3.2.10-RC1 , 3.3.1-RC1 +* Since: 3.2.10-RC1 +* Since: 3.3.1-RC1 * Purpose: Add content before the online users list viewtopic_body_pagination_top_after From a5314f57af3eae75df88fba79997a1c9a0cbc6b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dark=E2=9D=B6?= Date: Wed, 22 Apr 2020 11:38:49 +0530 Subject: [PATCH 7/7] [ticket/16411] Add vars to notification core events PHPBB3-16411 --- phpBB/docs/events.md | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/phpBB/docs/events.md b/phpBB/docs/events.md index 1641127dd0..6ef31a20b7 100644 --- a/phpBB/docs/events.md +++ b/phpBB/docs/events.md @@ -1899,7 +1899,6 @@ posting_editor_topic_icons_after * Locations: + styles/prosilver/template/posting_editor.html * Since: 3.2.10-RC1 -* Since: 3.3.1-RC1 * Purpose: Add custom data after the topic icons loop posting_editor_topic_icons_append @@ -1907,7 +1906,6 @@ posting_editor_topic_icons_append * Locations: + styles/prosilver/template/posting_editor.html * Since: 3.2.10-RC1 -* Since: 3.3.1-RC1 * Purpose: Append custom data to the topic icon posting_editor_topic_icons_before @@ -1915,7 +1913,6 @@ posting_editor_topic_icons_before * Locations: + styles/prosilver/template/posting_editor.html * Since: 3.2.10-RC1 -* Since: 3.3.1-RC1 * Purpose: Add custom data before the topic icons loop posting_editor_topic_icons_prepend @@ -1923,7 +1920,6 @@ posting_editor_topic_icons_prepend * Locations: + styles/prosilver/template/posting_editor.html * Since: 3.2.10-RC1 -* Since: 3.3.1-RC1 * Purpose: Prepend custom data to the topic icon posting_layout_include_panel_body @@ -2413,7 +2409,6 @@ ucp_header_friends_offline_username_full_append * Locations: + styles/prosilver/template/ucp_header.html * Since: 3.2.10-RC1 -* Since: 3.3.1-RC1 * Purpose: Append information to offline friends username in UCP ucp_header_friends_offline_username_full_prepend @@ -2421,7 +2416,6 @@ ucp_header_friends_offline_username_full_prepend * Locations: + styles/prosilver/template/ucp_header.html * Since: 3.2.10-RC1 -* Since: 3.3.1-RC1 * Purpose: Prepend information to offline friends username in UCP ucp_header_friends_online_username_full_append @@ -2429,7 +2423,6 @@ ucp_header_friends_online_username_full_append * Locations: + styles/prosilver/template/ucp_header.html * Since: 3.2.10-RC1 -* Since: 3.3.1-RC1 * Purpose: Append information to online friends username in UCP ucp_header_friends_online_username_full_prepend @@ -2437,7 +2430,6 @@ ucp_header_friends_online_username_full_prepend * Locations: + styles/prosilver/template/ucp_header.html * Since: 3.2.10-RC1 -* Since: 3.3.1-RC1 * Purpose: Prepend information to online friends username in UCP ucp_main_front_user_activity_after @@ -2799,7 +2791,6 @@ viewforum_body_online_list_before * Locations: + styles/prosilver/template/viewforum_body.html * Since: 3.2.10-RC1 -* Since: 3.3.1-RC1 * Purpose: Add content before the online users list viewforum_body_topic_author_username_append @@ -2964,7 +2955,6 @@ viewtopic_body_online_list_before * Locations: + styles/prosilver/template/viewtopic_body.html * Since: 3.2.10-RC1 -* Since: 3.3.1-RC1 * Purpose: Add content before the online users list viewtopic_body_pagination_top_after