mirror of
https://github.com/phpbb/phpbb.git
synced 2025-02-24 20:13:22 +01:00
Merge branch 'develop-ascraeus' into develop
* develop-ascraeus: [ticket/12703] Only query database for subscription types once
This commit is contained in:
commit
ae55db6da4
@ -23,6 +23,9 @@ class manager
|
|||||||
/** @var array */
|
/** @var array */
|
||||||
protected $notification_types;
|
protected $notification_types;
|
||||||
|
|
||||||
|
/** @var array */
|
||||||
|
protected $subscription_types;
|
||||||
|
|
||||||
/** @var array */
|
/** @var array */
|
||||||
protected $notification_methods;
|
protected $notification_methods;
|
||||||
|
|
||||||
@ -524,7 +527,9 @@ class manager
|
|||||||
*/
|
*/
|
||||||
public function get_subscription_types()
|
public function get_subscription_types()
|
||||||
{
|
{
|
||||||
$subscription_types = array();
|
if ($this->subscription_types === null)
|
||||||
|
{
|
||||||
|
$this->subscription_types = array();
|
||||||
|
|
||||||
foreach ($this->notification_types as $type_name => $data)
|
foreach ($this->notification_types as $type_name => $data)
|
||||||
{
|
{
|
||||||
@ -538,19 +543,20 @@ class manager
|
|||||||
'group' => 'NOTIFICATION_GROUP_MISCELLANEOUS',
|
'group' => 'NOTIFICATION_GROUP_MISCELLANEOUS',
|
||||||
), (($type::$notification_option !== false) ? $type::$notification_option : array()));
|
), (($type::$notification_option !== false) ? $type::$notification_option : array()));
|
||||||
|
|
||||||
$subscription_types[$options['group']][$options['id']] = $options;
|
$this->subscription_types[$options['group']][$options['id']] = $options;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Move Miscellaneous to the very last section
|
// Move Miscellaneous to the very last section
|
||||||
if (isset($subscription_types['NOTIFICATION_GROUP_MISCELLANEOUS']))
|
if (isset($this->subscription_types['NOTIFICATION_GROUP_MISCELLANEOUS']))
|
||||||
{
|
{
|
||||||
$miscellaneous = $subscription_types['NOTIFICATION_GROUP_MISCELLANEOUS'];
|
$miscellaneous = $this->subscription_types['NOTIFICATION_GROUP_MISCELLANEOUS'];
|
||||||
unset($subscription_types['NOTIFICATION_GROUP_MISCELLANEOUS']);
|
unset($this->subscription_types['NOTIFICATION_GROUP_MISCELLANEOUS']);
|
||||||
$subscription_types['NOTIFICATION_GROUP_MISCELLANEOUS'] = $miscellaneous;
|
$this->subscription_types['NOTIFICATION_GROUP_MISCELLANEOUS'] = $miscellaneous;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $subscription_types;
|
return $this->subscription_types;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user