mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-27 21:58:52 +00:00
[feature/php-events] Add additional events to acp_forums.php
PHPBB3-9550
This commit is contained in:
parent
f01d742b56
commit
2e5a7ae4dd
1 changed files with 25 additions and 5 deletions
|
@ -151,7 +151,7 @@ class acp_forums
|
||||||
);
|
);
|
||||||
|
|
||||||
$vars = array('action', 'forum_data');
|
$vars = array('action', 'forum_data');
|
||||||
extract($phpbb_dispatcher->trigger_event('core.acp_forums_modify_forum_data', compact($vars)));
|
extract($phpbb_dispatcher->trigger_event('core.acp_forums_get_forum_data', compact($vars)));
|
||||||
|
|
||||||
// On add, add empty forum_options... else do not consider it (not updating it)
|
// On add, add empty forum_options... else do not consider it (not updating it)
|
||||||
if ($action == 'add')
|
if ($action == 'add')
|
||||||
|
@ -416,6 +416,9 @@ class acp_forums
|
||||||
$parents_list = make_forum_select($forum_data['parent_id'], $exclude_forums, false, false, false);
|
$parents_list = make_forum_select($forum_data['parent_id'], $exclude_forums, false, false, false);
|
||||||
|
|
||||||
$forum_data['forum_password_confirm'] = $forum_data['forum_password'];
|
$forum_data['forum_password_confirm'] = $forum_data['forum_password'];
|
||||||
|
|
||||||
|
$vars = array('forum_id', 'row', 'forum_data');
|
||||||
|
extract($phpbb_dispatcher->trigger_event('core.acp_forums_modify_forum_data', compact($vars)));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -453,6 +456,9 @@ class acp_forums
|
||||||
'forum_password' => '',
|
'forum_password' => '',
|
||||||
'forum_password_confirm'=> '',
|
'forum_password_confirm'=> '',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$vars = array('forum_id', 'forum_data');
|
||||||
|
extract($phpbb_dispatcher->trigger_event('core.acp_forums_init_forum_data', compact($vars)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -585,7 +591,7 @@ class acp_forums
|
||||||
$errors[] = $user->lang['FORUM_PASSWORD_OLD'];
|
$errors[] = $user->lang['FORUM_PASSWORD_OLD'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$template->assign_vars(array(
|
$template_data = array(
|
||||||
'S_EDIT_FORUM' => true,
|
'S_EDIT_FORUM' => true,
|
||||||
'S_ERROR' => (sizeof($errors)) ? true : false,
|
'S_ERROR' => (sizeof($errors)) ? true : false,
|
||||||
'S_PARENT_ID' => $this->parent_id,
|
'S_PARENT_ID' => $this->parent_id,
|
||||||
|
@ -650,7 +656,12 @@ class acp_forums
|
||||||
'S_ENABLE_POST_REVIEW' => ($forum_data['forum_flags'] & FORUM_FLAG_POST_REVIEW) ? true : false,
|
'S_ENABLE_POST_REVIEW' => ($forum_data['forum_flags'] & FORUM_FLAG_POST_REVIEW) ? true : false,
|
||||||
'S_ENABLE_QUICK_REPLY' => ($forum_data['forum_flags'] & FORUM_FLAG_QUICK_REPLY) ? true : false,
|
'S_ENABLE_QUICK_REPLY' => ($forum_data['forum_flags'] & FORUM_FLAG_QUICK_REPLY) ? true : false,
|
||||||
'S_CAN_COPY_PERMISSIONS' => ($action != 'edit' || empty($forum_id) || ($auth->acl_get('a_fauth') && $auth->acl_get('a_authusers') && $auth->acl_get('a_authgroups') && $auth->acl_get('a_mauth'))) ? true : false,
|
'S_CAN_COPY_PERMISSIONS' => ($action != 'edit' || empty($forum_id) || ($auth->acl_get('a_fauth') && $auth->acl_get('a_authusers') && $auth->acl_get('a_authgroups') && $auth->acl_get('a_mauth'))) ? true : false,
|
||||||
));
|
);
|
||||||
|
|
||||||
|
$vars = array('forum_id', 'action', 'forum_data', 'template_data', 'old_forum_type', 'forum_desc_data', 'forum_rules_data');
|
||||||
|
extract($phpbb_dispatcher->trigger_event('core.acp_forums_assign_template_forum_data', compact($vars)));
|
||||||
|
|
||||||
|
$template->assign_vars($template_data);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -875,10 +886,13 @@ class acp_forums
|
||||||
*/
|
*/
|
||||||
function update_forum_data(&$forum_data)
|
function update_forum_data(&$forum_data)
|
||||||
{
|
{
|
||||||
global $db, $user, $cache, $phpbb_root_path;
|
global $db, $user, $cache, $phpbb_root_path, $phpbb_dispatcher;
|
||||||
|
|
||||||
$errors = array();
|
$errors = array();
|
||||||
|
|
||||||
|
$vars = array('forum_data', 'errors');
|
||||||
|
extract($phpbb_dispatcher->trigger_event('core.acp_forums_update_forum_data', compact($vars)));
|
||||||
|
|
||||||
if ($forum_data['forum_name'] == '')
|
if ($forum_data['forum_name'] == '')
|
||||||
{
|
{
|
||||||
$errors[] = $user->lang['FORUM_NAME_EMPTY'];
|
$errors[] = $user->lang['FORUM_NAME_EMPTY'];
|
||||||
|
@ -1242,6 +1256,9 @@ class acp_forums
|
||||||
add_log('admin', 'LOG_FORUM_EDIT', $forum_data['forum_name']);
|
add_log('admin', 'LOG_FORUM_EDIT', $forum_data['forum_name']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$vars = array('forum_data', 'errors');
|
||||||
|
extract($phpbb_dispatcher->trigger_event('core.acp_forums_update_forum_data_after', compact($vars)));
|
||||||
|
|
||||||
return $errors;
|
return $errors;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1250,10 +1267,13 @@ class acp_forums
|
||||||
*/
|
*/
|
||||||
function move_forum($from_id, $to_id)
|
function move_forum($from_id, $to_id)
|
||||||
{
|
{
|
||||||
global $db, $user;
|
global $db, $user, $phpbb_dispatcher;
|
||||||
|
|
||||||
$to_data = $moved_ids = $errors = array();
|
$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
|
// Check if we want to move to a parent with link type
|
||||||
if ($to_id > 0)
|
if ($to_id > 0)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue