1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-31 14:00:31 +02:00

[ticket/17333] Suggested code improvements

PHPBB-17333

Signed-off-by: Matt Friedman <maf675@gmail.com>
This commit is contained in:
Matt Friedman
2024-06-06 19:37:36 -07:00
parent 36527a97b8
commit ca918f893e
7 changed files with 15 additions and 17 deletions

View File

@@ -494,8 +494,8 @@ class acp_board
'webpush_enable' => ['lang' => 'WEBPUSH_ENABLE', 'validate' => 'bool', 'type' => 'custom', 'method' => 'webpush_enable', 'explain' => true],
'webpush_vapid_public' => ['lang' => 'WEBPUSH_VAPID_PUBLIC', 'validate' => 'string', 'type' => 'text:25:255', 'explain' => true],
'webpush_vapid_private' => ['lang' => 'WEBPUSH_VAPID_PRIVATE', 'validate' => 'string', 'type' => 'password:25:255', 'explain' => true],
'webpush_method_enables' => ['lang' => 'WEBPUSH_METHOD_ENABLES', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true],
'webpush_dropdown_subscribe'=> ['lang' => 'WEBPUSH_DROPDOWN_SUBSCRIBE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true],
'webpush_method_default_enable' => ['lang' => 'WEBPUSH_METHOD_DEFAULT_ENABLE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true],
'webpush_dropdown_subscribe' => ['lang' => 'WEBPUSH_DROPDOWN_SUBSCRIBE', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true],
'legend3' => 'ACP_SUBMIT_CHANGES',
],

View File

@@ -3874,8 +3874,7 @@ function page_header($page_title = '', $display_online_list = false, $item_id =
}
// Assign web push template vars globally (if not done already by ucp_notifications) for the dropdown subscribe button
if ($config['webpush_enable']
&& $config['webpush_dropdown_subscribe']
if ($config['webpush_enable'] && $config['webpush_dropdown_subscribe']
&& $template->retrieve_var('NOTIFICATIONS_WEBPUSH_ENABLE') === null)
{
$methods = $phpbb_notifications->get_subscription_methods();
@@ -3883,9 +3882,8 @@ function page_header($page_title = '', $display_online_list = false, $item_id =
if ($webpush)
{
$formHelper = $phpbb_container->get('form_helper');
$template_ary = $webpush['method']->get_ucp_template_data($controller_helper, $formHelper);
$template->assign_vars($template_ary);
$form_helper = $phpbb_container->get('form_helper');
$template->assign_vars($webpush['method']->get_ucp_template_data($controller_helper, $form_helper));
}
}
}