mirror of
https://github.com/phpbb/phpbb.git
synced 2025-08-03 15:27:42 +02:00
[ticket/13147] Adding $approve_forums to the list of the event's variables
PHPBB3-13147
This commit is contained in:
@@ -158,6 +158,8 @@ class content_visibility
|
|||||||
{
|
{
|
||||||
$where_sql = '(';
|
$where_sql = '(';
|
||||||
|
|
||||||
|
$approve_forums = array_intersect($forum_ids, array_keys($this->auth->acl_getf('m_approve', true)));
|
||||||
|
|
||||||
$content_replaced = false;
|
$content_replaced = false;
|
||||||
/**
|
/**
|
||||||
* Allow changing the result of calling get_forums_visibility_sql
|
* Allow changing the result of calling get_forums_visibility_sql
|
||||||
@@ -167,6 +169,7 @@ class content_visibility
|
|||||||
* @var string mode Either "topic" or "post" depending on the query this is being used in
|
* @var string mode Either "topic" or "post" depending on the query this is being used in
|
||||||
* @var array forum_ids Array of forum ids which the posts/topics are limited to
|
* @var array forum_ids Array of forum ids which the posts/topics are limited to
|
||||||
* @var string table_alias Table alias to prefix in SQL queries
|
* @var string table_alias Table alias to prefix in SQL queries
|
||||||
|
* @var array approve_forums Array of forums where the user has m_approve permissions
|
||||||
* @var bool content_replaced Forces the function to return where_sql after executing the event
|
* @var bool content_replaced Forces the function to return where_sql after executing the event
|
||||||
* @since 3.1.3-RC1
|
* @since 3.1.3-RC1
|
||||||
*/
|
*/
|
||||||
@@ -175,6 +178,7 @@ class content_visibility
|
|||||||
'mode',
|
'mode',
|
||||||
'forum_ids',
|
'forum_ids',
|
||||||
'table_alias',
|
'table_alias',
|
||||||
|
'approve_forums',
|
||||||
'content_replaced',
|
'content_replaced',
|
||||||
);
|
);
|
||||||
extract($phpbb_dispatcher->trigger_event('core.phpbb_content_visibility_get_forums_visibility_before', compact($vars)));
|
extract($phpbb_dispatcher->trigger_event('core.phpbb_content_visibility_get_forums_visibility_before', compact($vars)));
|
||||||
@@ -184,8 +188,6 @@ class content_visibility
|
|||||||
return $content_replaced;
|
return $content_replaced;
|
||||||
}
|
}
|
||||||
|
|
||||||
$approve_forums = array_intersect($forum_ids, array_keys($this->auth->acl_getf('m_approve', true)));
|
|
||||||
|
|
||||||
if (sizeof($approve_forums))
|
if (sizeof($approve_forums))
|
||||||
{
|
{
|
||||||
// Remove moderator forums from the rest
|
// Remove moderator forums from the rest
|
||||||
|
Reference in New Issue
Block a user