diff options
author | Matt Friedman <maf675@gmail.com> | 2013-12-04 16:40:41 -0800 |
---|---|---|
committer | Matt Friedman <maf675@gmail.com> | 2013-12-04 16:40:41 -0800 |
commit | 226376c573d5e5923bb325e5e5af2ca1d2239f4d (patch) | |
tree | c69e4e8833d8193e0ca38ab21207cd73cccdafd9 /phpBB/includes/acp/acp_bbcodes.php | |
parent | a4d20d988bdaf17131124d3f2ae618cf154d946b (diff) | |
download | forums-226376c573d5e5923bb325e5e5af2ca1d2239f4d.tar forums-226376c573d5e5923bb325e5e5af2ca1d2239f4d.tar.gz forums-226376c573d5e5923bb325e5e5af2ca1d2239f4d.tar.bz2 forums-226376c573d5e5923bb325e5e5af2ca1d2239f4d.tar.xz forums-226376c573d5e5923bb325e5e5af2ca1d2239f4d.zip |
[ticket/12060] Add acp event core.acp_bbcodes_modify_create
Modify bbcode data before modify/create
PHPBB3-12060
Diffstat (limited to 'phpBB/includes/acp/acp_bbcodes.php')
-rw-r--r-- | phpBB/includes/acp/acp_bbcodes.php | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php index 1f07b39600..43787922f6 100644 --- a/phpBB/includes/acp/acp_bbcodes.php +++ b/phpBB/includes/acp/acp_bbcodes.php @@ -138,6 +138,26 @@ class acp_bbcodes case 'modify': case 'create': + $sql_ary = $hidden_fields = array(); + + /** + * Modify bbcode data before modify/create + * + * @event core.acp_bbcodes_modify_create + * @var string action Type of the action: modify|create + * @var array sql_ary Array with new bbcode data + * @var int bbcode_id The id of the bbcode (being modified) + * @var int display_on_posting display_on_posting var from thr form + * @var string bbcode_match bbcode_match var from thr form + * @var string bbcode_tpl bbcode_tpl var from thr form + * @var string bbcode_helpline bbcode_helpline var from thr form + * @var array hidden_fields Array of hidden fields for use when + * submitting form when $warn_text is true + * @since 3.1-A3 + */ + $vars = array('action', 'sql_ary', 'bbcode_id', 'display_on_posting', 'bbcode_match', 'bbcode_tpl', 'bbcode_helpline', 'hidden_fields'); + extract($phpbb_dispatcher->trigger_event('core.acp_bbcodes_modify_create', compact($vars))); + $warn_text = preg_match('%<[^>]*\{text[\d]*\}[^>]*>%i', $bbcode_tpl); if (!$warn_text || confirm_box(true)) { @@ -192,7 +212,7 @@ class acp_bbcodes trigger_error($user->lang['BBCODE_HELPLINE_TOO_LONG'] . adm_back_link($this->u_action), E_USER_WARNING); } - $sql_ary = array( + $sql_ary = array_merge($sql_ary, array( 'bbcode_tag' => $data['bbcode_tag'], 'bbcode_match' => $bbcode_match, 'bbcode_tpl' => $bbcode_tpl, @@ -202,7 +222,7 @@ class acp_bbcodes 'first_pass_replace' => $data['first_pass_replace'], 'second_pass_match' => $data['second_pass_match'], 'second_pass_replace' => $data['second_pass_replace'] - ); + )); if ($action == 'create') { @@ -258,13 +278,13 @@ class acp_bbcodes } else { - confirm_box(false, $user->lang['BBCODE_DANGER'], build_hidden_fields(array( + confirm_box(false, $user->lang['BBCODE_DANGER'], build_hidden_fields(array_merge($hidden_fields, array( 'action' => $action, 'bbcode' => $bbcode_id, 'bbcode_match' => $bbcode_match, 'bbcode_tpl' => htmlspecialchars($bbcode_tpl), 'bbcode_helpline' => $bbcode_helpline, - 'display_on_posting' => $display_on_posting, + 'display_on_posting' => $display_on_posting) )) , 'confirm_bbcode.html'); } |