aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/acp/acp_forums.php
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2012-08-08 12:58:20 +0200
committerJoas Schilling <nickvergessen@gmx.de>2012-08-08 13:01:39 +0200
commitcfd5fcbe2609024f57c900435b02346d5c7e28e0 (patch)
treec32e45401dd22f59e1455bd0bf8497a38a2fb42a /phpBB/includes/acp/acp_forums.php
parentcaf76b4cebccbfd7e348c89f7bce8d731fa2fd43 (diff)
downloadforums-cfd5fcbe2609024f57c900435b02346d5c7e28e0.tar
forums-cfd5fcbe2609024f57c900435b02346d5c7e28e0.tar.gz
forums-cfd5fcbe2609024f57c900435b02346d5c7e28e0.tar.bz2
forums-cfd5fcbe2609024f57c900435b02346d5c7e28e0.tar.xz
forums-cfd5fcbe2609024f57c900435b02346d5c7e28e0.zip
[feature/php-events] Add new event core.acp_manage_forums_update_data_before
Allows you to remove data from forum_data_sql before we update/create the forum PHPBB3-9550
Diffstat (limited to 'phpBB/includes/acp/acp_forums.php')
-rw-r--r--phpBB/includes/acp/acp_forums.php20
1 files changed, 19 insertions, 1 deletions
diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php
index 7af2fb822e..151e03f18f 100644
--- a/phpBB/includes/acp/acp_forums.php
+++ b/phpBB/includes/acp/acp_forums.php
@@ -1036,7 +1036,25 @@ class acp_forums
}
unset($forum_data_sql['forum_password_unset']);
- if (!isset($forum_data_sql['forum_id']))
+ $is_new_forum = !isset($forum_data_sql['forum_id']);
+
+ /**
+ * Remove invalid values from forum_data_sql that should not be updated
+ *
+ * @event core.acp_manage_forums_update_data_before
+ * @var array forum_data Array with forum data
+ * @var array forum_data_sql Array with data we are going to update
+ * @var bool is_new_forum Do we create a forum or update one
+ * If you want to overwrite this value,
+ * ensure to set forum_data_sql[forum_id]
+ * @since 3.1-A1
+ */
+ $vars = array('forum_data', 'forum_data_sql');
+ extract($phpbb_dispatcher->trigger_event('core.acp_manage_forums_update_data_before', compact($vars)));
+
+ $is_new_forum = !isset($forum_data_sql['forum_id']);
+
+ if ($is_new_forum)
{
// no forum_id means we're creating a new forum
unset($forum_data_sql['type_action']);