mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-30 21:40:43 +02:00
[ticket/17333] ACP option to enable-disable all push notifications
PHPBB-17333 Signed-off-by: Matt Friedman <maf675@gmail.com>
This commit is contained in:
45
phpBB/phpbb/db/migration/data/v400/add_webpush_options.php
Normal file
45
phpBB/phpbb/db/migration/data/v400/add_webpush_options.php
Normal file
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
/**
|
||||
*
|
||||
* This file is part of the phpBB Forum Software package.
|
||||
*
|
||||
* @copyright (c) phpBB Limited <https://www.phpbb.com>
|
||||
* @license GNU General Public License, version 2 (GPL-2.0)
|
||||
*
|
||||
* For full copyright and license information, please see
|
||||
* the docs/CREDITS.txt file.
|
||||
*
|
||||
*/
|
||||
|
||||
namespace phpbb\db\migration\data\v400;
|
||||
|
||||
use phpbb\db\migration\migration;
|
||||
|
||||
class add_webpush_options extends migration
|
||||
{
|
||||
public static function depends_on(): array
|
||||
{
|
||||
return [
|
||||
'\phpbb\db\migration\data\v400\add_webpush',
|
||||
];
|
||||
}
|
||||
|
||||
public function effectively_installed(): bool
|
||||
{
|
||||
return $this->config->offsetExists('webpush_method_enables');
|
||||
}
|
||||
|
||||
public function update_data(): array
|
||||
{
|
||||
return [
|
||||
['config.add', ['webpush_method_enables', false]],
|
||||
];
|
||||
}
|
||||
|
||||
public function revert_data(): array
|
||||
{
|
||||
return [
|
||||
['config.remove', ['webpush_method_enables']],
|
||||
];
|
||||
}
|
||||
}
|
@@ -91,6 +91,14 @@ class webpush extends messenger_base implements extended_method_interface
|
||||
&& !empty($this->config['webpush_vapid_public']) && !empty($this->config['webpush_vapid_private']);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function is_enabled_by_default()
|
||||
{
|
||||
return $this->config['webpush_method_enables'];
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
|
Reference in New Issue
Block a user