aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/acp
diff options
context:
space:
mode:
authorrxu <rxu@mail.ru>2016-08-07 16:10:49 +0700
committerrxu <rxu@mail.ru>2016-08-07 16:10:49 +0700
commit3bf64de247f23f701e92d17ccb7c055fb019623d (patch)
tree5a7951d0ca08ad7b63ec208a31edd3cf999c9f73 /phpBB/includes/acp
parent2dae36e3fbde62c73c0ea08f5acd4e1629ebae34 (diff)
downloadforums-3bf64de247f23f701e92d17ccb7c055fb019623d.tar
forums-3bf64de247f23f701e92d17ccb7c055fb019623d.tar.gz
forums-3bf64de247f23f701e92d17ccb7c055fb019623d.tar.bz2
forums-3bf64de247f23f701e92d17ccb7c055fb019623d.tar.xz
forums-3bf64de247f23f701e92d17ccb7c055fb019623d.zip
[ticket/14738] Add core events to improve modifying forum lists
PHPBB3-14738
Diffstat (limited to 'phpBB/includes/acp')
-rw-r--r--phpBB/includes/acp/acp_forums.php24
1 files changed, 20 insertions, 4 deletions
diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php
index 98273f06d9..1e69a4ad20 100644
--- a/phpBB/includes/acp/acp_forums.php
+++ b/phpBB/includes/acp/acp_forums.php
@@ -842,9 +842,26 @@ class acp_forums
ORDER BY left_id";
$result = $db->sql_query($sql);
- if ($row = $db->sql_fetchrow($result))
+ $rowset = array();
+ while ($row = $db->sql_fetchrow($result))
+ {
+ $rowset[(int) $row['forum_id']] = $row;
+ }
+ $db->sql_freeresult($result);
+
+ /**
+ * Modify the forum list data
+ *
+ * @event core.acp_manage_forums_modify_forum_list
+ * @var array rowset Array with the forums list data
+ * @since 3.1.10-RC1
+ */
+ $vars = array('rowset');
+ extract($phpbb_dispatcher->trigger_event('core.acp_manage_forums_modify_forum_list', compact($vars)));
+
+ if (!empty($rowset))
{
- do
+ foreach ($rowset as $row)
{
$forum_type = $row['forum_type'];
@@ -888,7 +905,6 @@ class acp_forums
'U_SYNC' => $url . '&amp;action=sync')
);
}
- while ($row = $db->sql_fetchrow($result));
}
else if ($this->parent_id)
{
@@ -904,7 +920,7 @@ class acp_forums
'U_SYNC' => $url . '&amp;action=sync')
);
}
- $db->sql_freeresult($result);
+ unset($rowset);
$template->assign_vars(array(
'ERROR_MSG' => (sizeof($errors)) ? implode('<br />', $errors) : '',