mirror of
https://github.com/phpbb/phpbb.git
synced 2025-07-09 19:26:53 +02:00
[ticket/12742] Add sort options for notification types requiring sorting
PHPBB3-12742
This commit is contained in:
@ -540,9 +540,10 @@ abstract class base implements \phpbb\notification\type\type_interface
|
|||||||
* @param array $users Array of users that have subscribed to a notification
|
* @param array $users Array of users that have subscribed to a notification
|
||||||
* @param int $forum_id Forum ID of the forum
|
* @param int $forum_id Forum ID of the forum
|
||||||
* @param array $options Array of notification options
|
* @param array $options Array of notification options
|
||||||
|
* @param bool $sort Whether the users array should be sorted. Default: false
|
||||||
* @return array Array of users that are authorised recipients
|
* @return array Array of users that are authorised recipients
|
||||||
*/
|
*/
|
||||||
protected function get_authorised_recipients($users, $forum_id, $options)
|
protected function get_authorised_recipients($users, $forum_id, $options, $sort = false)
|
||||||
{
|
{
|
||||||
if (empty($users))
|
if (empty($users))
|
||||||
{
|
{
|
||||||
@ -551,6 +552,11 @@ abstract class base implements \phpbb\notification\type\type_interface
|
|||||||
|
|
||||||
$users = array_unique($users);
|
$users = array_unique($users);
|
||||||
|
|
||||||
|
if ($sort)
|
||||||
|
{
|
||||||
|
sort($users);
|
||||||
|
}
|
||||||
|
|
||||||
$auth_read = $this->auth->acl_get_list($users, 'f_read', $forum_id);
|
$auth_read = $this->auth->acl_get_list($users, 'f_read', $forum_id);
|
||||||
|
|
||||||
if (empty($auth_read))
|
if (empty($auth_read))
|
||||||
|
@ -123,7 +123,7 @@ class post extends \phpbb\notification\type\base
|
|||||||
}
|
}
|
||||||
$this->db->sql_freeresult($result);
|
$this->db->sql_freeresult($result);
|
||||||
|
|
||||||
$notify_users = $this->get_authorised_recipients($users, $post['forum_id'], $options);
|
$notify_users = $this->get_authorised_recipients($users, $post['forum_id'], $options, true);
|
||||||
|
|
||||||
if (empty($notify_users))
|
if (empty($notify_users))
|
||||||
{
|
{
|
||||||
|
@ -102,7 +102,7 @@ class quote extends \phpbb\notification\type\post
|
|||||||
}
|
}
|
||||||
$this->db->sql_freeresult($result);
|
$this->db->sql_freeresult($result);
|
||||||
|
|
||||||
return $this->get_authorised_recipients($users, $post['forum_id'], $options);
|
return $this->get_authorised_recipients($users, $post['forum_id'], $options, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user