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

[ticket/13147] Adding $approve_forums to the list of the event's variables

PHPBB3-13147
This commit is contained in:
brunoais
2014-11-29 11:27:57 +00:00
parent 0388d82504
commit e596d0b6ce

View File

@@ -158,6 +158,8 @@ class content_visibility
{
$where_sql = '(';
$approve_forums = array_intersect($forum_ids, array_keys($this->auth->acl_getf('m_approve', true)));
$content_replaced = false;
/**
* 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 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 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
* @since 3.1.3-RC1
*/
@@ -175,6 +178,7 @@ class content_visibility
'mode',
'forum_ids',
'table_alias',
'approve_forums',
'content_replaced',
);
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;
}
$approve_forums = array_intersect($forum_ids, array_keys($this->auth->acl_getf('m_approve', true)));
if (sizeof($approve_forums))
{
// Remove moderator forums from the rest