[feature/php-events] Replace core.acp_forums_add_forum_data

Add missing global $phpbb_dispatcher, add $action and name the event better

PHPBB3-9550
This commit is contained in:
Joas Schilling 2012-06-20 15:41:02 +02:00
parent 2be60b80ae
commit 0f78b4699a

View file

@ -25,7 +25,7 @@ class acp_forums
function main($id, $mode)
{
global $db, $user, $auth, $template, $cache, $request;
global $db, $user, $auth, $template, $cache, $request, $phpbb_dispatcher;
global $config, $phpbb_admin_path, $phpbb_root_path, $phpEx;
$user->add_lang('acp/forums');
@ -107,9 +107,6 @@ class acp_forums
'forum_id' => $forum_id
);
$vars = array('forum_data');
extract($phpbb_dispatcher->trigger_event('core.acp_forums_add_forum_data', compact($vars)));
// No break here
case 'add':
@ -153,6 +150,9 @@ class acp_forums
'forum_password_unset' => request_var('forum_password_unset', false),
);
$vars = array('action', 'forum_data');
extract($phpbb_dispatcher->trigger_event('core.acp_forums_modify_forum_data', compact($vars)));
// On add, add empty forum_options... else do not consider it (not updating it)
if ($action == 'add')
{