mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-12 03:34:04 +02:00
[ticket/11444] Moving the in-board notifications to a method class
Currently the in-board method for the notifications is hardcoded and cannot be disabled. This method should be in his own class extending `phpbb\notification\method\method_interface`. It also add the possibility, for each method, to be enabled by default (ie: no entry in the DB => notification enabled). https://tracker.phpbb.com/browse/PHPBB3-11444 https://tracker.phpbb.com/browse/PHPBB3-11967 PHPBB3-11444
This commit is contained in:
committed by
Tristan Darricau
parent
58d1d37c16
commit
be0d4e20d4
@@ -46,7 +46,7 @@ class phpbb_notification_manager_helper extends \phpbb\notification\manager
|
||||
$item_parts = explode('.', $item_type);
|
||||
$item_type = 'phpbb\notification\type\\' . array_pop($item_parts);
|
||||
|
||||
$item = new $item_type($this->user_loader, $this->db, $this->cache->get_driver(), $this->user, $this->auth, $this->config, $this->phpbb_root_path, $this->php_ext, $this->notification_types_table, $this->notifications_table, $this->user_notifications_table);
|
||||
$item = new $item_type($this->user_loader, $this->db, $this->cache->get_driver(), $this->user, $this->auth, $this->config, $this->phpbb_root_path, $this->php_ext, $this->notification_types_table, $this->user_notifications_table);
|
||||
|
||||
if ($item_type === 'phpbb\\notification\\type\\quote')
|
||||
{
|
||||
@@ -65,9 +65,10 @@ class phpbb_notification_manager_helper extends \phpbb\notification\manager
|
||||
*/
|
||||
public function get_method_class($method_name)
|
||||
{
|
||||
$method_name = 'phpbb\notification\method\\' . $method_name;
|
||||
$method_parts = explode('.', $method_name);
|
||||
$method_name = 'phpbb\notification\method\\' . array_pop($method_parts);
|
||||
|
||||
$method = new $method_name($this->user_loader, $this->db, $this->cache->get_driver(), $this->user, $this->auth, $this->config, $this->phpbb_root_path, $this->php_ext, $this->notification_types_table, $this->notifications_table, $this->user_notifications_table);
|
||||
$method = new $method_name($this->user_loader, $this->db, $this->cache->get_driver(), $this->user, $this->auth, $this->config, $this->phpbb_root_path, $this->php_ext, $this->notification_types_table, NOTIFICATIONS_TABLE, $this->user_notifications_table);
|
||||
|
||||
$method->set_notification_manager($this);
|
||||
|
||||
|
Reference in New Issue
Block a user