diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2012-08-08 13:16:18 +0200 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2012-08-08 13:22:20 +0200 |
commit | 43d17b2337eefa0530dea57516138eaf9724862b (patch) | |
tree | 49c892e905bde40d38dad8f05d088be4e8876e44 /phpBB/includes | |
parent | 70c90bea4f8ba6cc0c4f34f2f55f8171f1b7ba87 (diff) | |
download | forums-43d17b2337eefa0530dea57516138eaf9724862b.tar forums-43d17b2337eefa0530dea57516138eaf9724862b.tar.gz forums-43d17b2337eefa0530dea57516138eaf9724862b.tar.bz2 forums-43d17b2337eefa0530dea57516138eaf9724862b.tar.xz forums-43d17b2337eefa0530dea57516138eaf9724862b.zip |
[feature/php-events] Fix doc and naming of core.acp_manage_forums_move_children
PHPBB3-9550
Diffstat (limited to 'phpBB/includes')
-rw-r--r-- | phpBB/includes/acp/acp_forums.php | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php index 542c3ffd77..d6d8879f7b 100644 --- a/phpBB/includes/acp/acp_forums.php +++ b/phpBB/includes/acp/acp_forums.php @@ -1353,9 +1353,6 @@ class acp_forums $to_data = $moved_ids = $errors = array(); - $vars = array('from_id', 'to_id'); - extract($phpbb_dispatcher->trigger_event('core.acp_forums_move_forum', compact($vars))); - // Check if we want to move to a parent with link type if ($to_id > 0) { @@ -1364,10 +1361,30 @@ class acp_forums if ($to_data['forum_type'] == FORUM_LINK) { $errors[] = $user->lang['PARENT_IS_LINK_FORUM']; - return $errors; } } + /** + * Event when we move all children of one forum to another + * + * This event may be triggered, when a forum is deleted + * + * @event core.acp_manage_forums_move_children + * @var int from_id If of the current parent forum + * @var int to_id If of the new parent forum + * @var array errors Array of errors, should be strings and not + * language key. + * @since 3.1-A1 + */ + $vars = array('from_id', 'to_id', 'errors'); + extract($phpbb_dispatcher->trigger_event('core.acp_manage_forums_move_children', compact($vars))); + + // Return if there were errors + if (!empty($errors)) + { + return $errors; + } + $moved_forums = get_forum_branch($from_id, 'children', 'descending'); $from_data = $moved_forums[0]; $diff = sizeof($moved_forums) * 2; |