aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbrunoais <brunoaiss@gmail.com>2014-11-29 15:22:15 +0000
committerbrunoais <brunoaiss@gmail.com>2015-01-10 11:44:54 +0000
commit0f6a0d820e435c3d61f165d8ed1e70c4110123af (patch)
treeeb448fa5da7110f12bae90f1f7b94f2b8d349068
parent8f5e3d5efb486a556de3e09a35b1e6b9f527f9cf (diff)
downloadforums-0f6a0d820e435c3d61f165d8ed1e70c4110123af.tar
forums-0f6a0d820e435c3d61f165d8ed1e70c4110123af.tar.gz
forums-0f6a0d820e435c3d61f165d8ed1e70c4110123af.tar.bz2
forums-0f6a0d820e435c3d61f165d8ed1e70c4110123af.tar.xz
forums-0f6a0d820e435c3d61f165d8ed1e70c4110123af.zip
[ticket/13147] Using $phpbb_dispatcher global var
PHPBB3-13147
-rw-r--r--phpBB/phpbb/content_visibility.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/phpBB/phpbb/content_visibility.php b/phpBB/phpbb/content_visibility.php
index 9647095f78..fafb564b79 100644
--- a/phpBB/phpbb/content_visibility.php
+++ b/phpBB/phpbb/content_visibility.php
@@ -240,10 +240,13 @@ class content_visibility
*/
public function get_global_visibility_sql($mode, $exclude_forum_ids = array(), $table_alias = '')
{
+ global $phpbb_dispatcher;
+
$where_sqls = array();
$approve_forums = array_diff(array_keys($this->auth->acl_getf('m_approve', true)), $exclude_forum_ids);
+ $content_replaced = null;
/**
* Allow changing the result of calling get_global_visibility_sql
*
@@ -253,6 +256,7 @@ class content_visibility
* @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 string content_replaced Forces the function to return an implosion of where_sqls (joined by "OR")
* @since 3.1.3-RC1
*/
$vars = array(
@@ -261,8 +265,15 @@ class content_visibility
'forum_ids',
'table_alias',
'approve_forums',
+ 'content_replaced',
);
- extract($this->phpbb_dispatcher->trigger_event('core.phpbb_content_visibility_get_global_visibility_before', compact($vars)));
+ extract($phpbb_dispatcher->trigger_event('core.phpbb_content_visibility_get_global_visibility_before', compact($vars)));
+
+ if ($content_replaced)
+ {
+ return $content_replaced;
+ }
+
if (sizeof($exclude_forum_ids))
{