1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

[ticket/17135] Move notify method constants to interface class

PHPBB-17135
This commit is contained in:
rxu
2025-01-06 20:01:52 +07:00
parent 28d5534d06
commit 0d8c0c4228
21 changed files with 77 additions and 50 deletions

View File

@@ -13,6 +13,8 @@
namespace phpbb\message;
use phpbb\messenger\method\messenger_interface;
/**
* Class admin_form
* Displays a message to the user and allows him to send an email
@@ -155,7 +157,7 @@ class admin_form extends form
}
$this->message->set_sender($this->user->ip, $this->sender_name, $this->sender_address, $this->user->lang_name);
$this->message->set_sender_notify_type(NOTIFY_EMAIL);
$this->message->set_sender_notify_type(messenger_interface::NOTIFY_EMAIL);
}
$this->message->set_template('contact_admin');
@@ -165,7 +167,7 @@ class admin_form extends form
$this->user->lang['ADMINISTRATOR'],
$this->config['board_contact'],
$this->config['default_lang'],
NOTIFY_EMAIL
messenger_interface::NOTIFY_EMAIL
);
$this->message->set_template_vars(array(

View File

@@ -13,6 +13,8 @@
namespace phpbb\message;
use phpbb\messenger\method\messenger_interface;
/**
* Class message
* Holds all information for an email and sends it in the end
@@ -46,7 +48,7 @@ class message
/** @var string */
protected $sender_jabber = '';
/** @var int */
protected $sender_notify_type = NOTIFY_EMAIL;
protected $sender_notify_type = messenger_interface::NOTIFY_EMAIL;
/** @var array */
protected $recipients;
@@ -134,7 +136,7 @@ class message
* @param string $recipient_jabber
* @return void
*/
public function add_recipient($recipient_name, $recipient_address, $recipient_lang, $recipient_notify_type = NOTIFY_EMAIL, $recipient_username = '', $recipient_jabber = '')
public function add_recipient($recipient_name, $recipient_address, $recipient_lang, $recipient_notify_type = messenger_interface::NOTIFY_EMAIL, $recipient_username = '', $recipient_jabber = '')
{
$this->recipients[] = array(
'name' => $recipient_name,
@@ -250,7 +252,7 @@ class message
foreach ($messenger_collection_iterator as $messenger_method)
{
$messenger_method->set_use_queue(false);
if ($messenger_method->get_id() == $recipient['notify_type'] || $recipient['notify_type'] == NOTIFY_BOTH)
if ($messenger_method->get_id() == $recipient['notify_type'] || $recipient['notify_type'] == $messenger_method::NOTIFY_BOTH)
{
$messenger_method->template($this->template, $recipient['lang']);
$messenger_method->set_addresses($recipient);

View File

@@ -13,6 +13,8 @@
namespace phpbb\message;
use phpbb\messenger\method\messenger_interface;
/**
* Class topic_form
* Form used to send topics as notification emails
@@ -130,9 +132,9 @@ class topic_form extends form
$this->recipient_name,
$this->recipient_address,
$this->recipient_lang,
NOTIFY_EMAIL
messenger_interface::NOTIFY_EMAIL
);
$this->message->set_sender_notify_type(NOTIFY_EMAIL);
$this->message->set_sender_notify_type(messenger_interface::NOTIFY_EMAIL);
parent::submit($messenger);
}