From b3a96f0a70b80cf3f132197a49b4e79d22132cbb Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Wed, 4 Dec 2013 16:32:27 -0800 Subject: [PATCH 01/37] [ticket/12060] Add template event acp_bbcodes_edit_form_append PHPBB3-12060 --- phpBB/adm/style/acp_bbcodes.html | 2 ++ phpBB/docs/events.md | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/phpBB/adm/style/acp_bbcodes.html b/phpBB/adm/style/acp_bbcodes.html index c22ed395e7..258bae360a 100644 --- a/phpBB/adm/style/acp_bbcodes.html +++ b/phpBB/adm/style/acp_bbcodes.html @@ -47,6 +47,8 @@ + +
{L_SUBMIT}   diff --git a/phpBB/docs/events.md b/phpBB/docs/events.md index 288ebb933e..9e17ddbdbf 100644 --- a/phpBB/docs/events.md +++ b/phpBB/docs/events.md @@ -1,3 +1,9 @@ +acp_bbcodes_edit_form_append +=== +* Location: adm/style/acp_bbcodes.html +* Since: 3.1.0-a3 +* Purpose: Add settings to edit BBCodes form + acp_forums_normal_settings_append === * Location: adm/style/acp_forums.html From 60a51eddd474b704f2b9bd3277f20578c69a32a1 Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Wed, 4 Dec 2013 16:32:47 -0800 Subject: [PATCH 02/37] [ticket/12060] Add template event acp_bbcodes_actions_prepend/append PHPBB3-12060 --- phpBB/adm/style/acp_bbcodes.html | 2 +- phpBB/docs/events.md | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/phpBB/adm/style/acp_bbcodes.html b/phpBB/adm/style/acp_bbcodes.html index 258bae360a..2057890bdf 100644 --- a/phpBB/adm/style/acp_bbcodes.html +++ b/phpBB/adm/style/acp_bbcodes.html @@ -103,7 +103,7 @@ {bbcodes.BBCODE_TAG} - {ICON_EDIT} {ICON_DELETE} + {ICON_EDIT} {ICON_DELETE} diff --git a/phpBB/docs/events.md b/phpBB/docs/events.md index 9e17ddbdbf..f1637ced02 100644 --- a/phpBB/docs/events.md +++ b/phpBB/docs/events.md @@ -1,3 +1,15 @@ +acp_bbcodes_actions_append +=== +* Location: adm/style/acp_bbcodes.html +* Since: 3.1.0-a3 +* Purpose: Add actions to the BBCodes page, after edit/delete buttons + +acp_bbcodes_actions_prepend +=== +* Location: adm/style/acp_bbcodes.html +* Since: 3.1.0-a3 +* Purpose: Add actions to the BBCodes page, before edit/delete buttons + acp_bbcodes_edit_form_append === * Location: adm/style/acp_bbcodes.html From 35da9ab9cfa183a8ffc364b48ecb85c8575a03f0 Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Wed, 4 Dec 2013 16:35:11 -0800 Subject: [PATCH 03/37] [ticket/12060] Add template events posting_editor_buttons_before/after PHPBB3-12060 --- phpBB/adm/style/acp_users_signature.html | 2 ++ phpBB/docs/events.md | 18 ++++++++++++++++++ .../prosilver/template/posting_buttons.html | 2 ++ .../subsilver2/template/posting_buttons.html | 2 ++ 4 files changed, 24 insertions(+) diff --git a/phpBB/adm/style/acp_users_signature.html b/phpBB/adm/style/acp_users_signature.html index 0a04c411d2..694e20c624 100644 --- a/phpBB/adm/style/acp_users_signature.html +++ b/phpBB/adm/style/acp_users_signature.html @@ -49,6 +49,7 @@ {L_SIGNATURE}

{L_SIGNATURE_EXPLAIN}

+
@@ -84,6 +85,7 @@
+
diff --git a/phpBB/docs/events.md b/phpBB/docs/events.md index f1637ced02..ebca4b76f4 100644 --- a/phpBB/docs/events.md +++ b/phpBB/docs/events.md @@ -199,6 +199,24 @@ overall_header_navigation_prepend * Since: 3.1.0-a1 * Purpose: Add links before the navigation links in the header +posting_editor_buttons_after +=== +* Locations: + + adm/style/acp_users_signature.html + + styles/prosilver/template/posting_buttons.html + + styles/subsilver2/template/posting_buttons.html +* Since: 3.1.0-a3 +* Purpose: Add content after the BBCode posting buttons + +posting_editor_buttons_before +=== +* Locations: + + adm/style/acp_users_signature.html + + styles/prosilver/template/posting_buttons.html + + styles/subsilver2/template/posting_buttons.html +* Since: 3.1.0-a3 +* Purpose: Add content before the BBCode posting buttons + posting_editor_message_after === * Locations: diff --git a/phpBB/styles/prosilver/template/posting_buttons.html b/phpBB/styles/prosilver/template/posting_buttons.html index e8338c6c86..137970bbdf 100644 --- a/phpBB/styles/prosilver/template/posting_buttons.html +++ b/phpBB/styles/prosilver/template/posting_buttons.html @@ -59,6 +59,7 @@
+
@@ -95,4 +96,5 @@
+ diff --git a/phpBB/styles/subsilver2/template/posting_buttons.html b/phpBB/styles/subsilver2/template/posting_buttons.html index 06de2c3169..ec5abc2c0c 100644 --- a/phpBB/styles/subsilver2/template/posting_buttons.html +++ b/phpBB/styles/subsilver2/template/posting_buttons.html @@ -36,6 +36,7 @@ + @@ -66,6 +67,7 @@ + From bd8c444c12f2bfeea957584559276e822807a01a Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Wed, 4 Dec 2013 16:37:16 -0800 Subject: [PATCH 04/37] [ticket/12060] Wrap subsilver2 posting buttons in div with id tags Wrap the posting buttons in div tags with id attributes to allow needed ability to process them with CSS, for example, to hide them. PHPBB3-12060 --- .../subsilver2/template/posting_buttons.html | 68 ++++++++++--------- 1 file changed, 36 insertions(+), 32 deletions(-) diff --git a/phpBB/styles/subsilver2/template/posting_buttons.html b/phpBB/styles/subsilver2/template/posting_buttons.html index ec5abc2c0c..6fe15bff23 100644 --- a/phpBB/styles/subsilver2/template/posting_buttons.html +++ b/phpBB/styles/subsilver2/template/posting_buttons.html @@ -37,36 +37,38 @@ - - - - - - - - - - - - - - - - - - - - {L_FONT_SIZE}{L_COLON} + + + + - + + + + + + + + + + + + + + {L_FONT_SIZE}{L_COLON} + @@ -74,9 +76,11 @@ - - onmouseover="helpline('cb_{custom_tags.BBCODE_ID}')" onmouseout="helpline('tip')" /> - +
+ + onmouseover="helpline('cb_{custom_tags.BBCODE_ID}')" onmouseout="helpline('tip')" /> + +
From a4d20d988bdaf17131124d3f2ae618cf154d946b Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Wed, 4 Dec 2013 16:39:10 -0800 Subject: [PATCH 05/37] [ticket/12060] Add acp event core.acp_bbcodes_edit_add Modify bbcode template before we display the add/edit form PHPBB3-12060 --- phpBB/includes/acp/acp_bbcodes.php | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php index 575ac84012..1f07b39600 100644 --- a/phpBB/includes/acp/acp_bbcodes.php +++ b/phpBB/includes/acp/acp_bbcodes.php @@ -96,7 +96,7 @@ class acp_bbcodes case 'edit': case 'add': - $template->assign_vars(array( + $tpl_ary = array( 'S_EDIT_BBCODE' => true, 'U_BACK' => $this->u_action, 'U_ACTION' => $this->u_action . '&action=' . (($action == 'add') ? 'create' : 'modify') . (($bbcode_id) ? "&bbcode=$bbcode_id" : ''), @@ -105,9 +105,23 @@ class acp_bbcodes 'BBCODE_MATCH' => $bbcode_match, 'BBCODE_TPL' => $bbcode_tpl, 'BBCODE_HELPLINE' => $bbcode_helpline, - 'DISPLAY_ON_POSTING' => $display_on_posting) + 'DISPLAY_ON_POSTING' => $display_on_posting, ); + /** + * Modify bbcode template before we display the add/edit form + * + * @event core.acp_bbcodes_edit_add + * @var string action Type of the action: add|edit + * @var array tpl_ary Array with bbcodes add/edit data + * @var int bbcode_id The id of the bbcode (being edited) + * @since 3.1-A3 + */ + $vars = array('action', 'tpl_ary', 'bbcode_id'); + extract($phpbb_dispatcher->trigger_event('core.acp_bbcodes_edit_add', compact($vars))); + + $template->assign_vars($tpl_ary); + $bbcode_tokens = array('TEXT', 'SIMPLETEXT', 'INTTEXT', 'IDENTIFIER', 'NUMBER', 'EMAIL', 'URL', 'LOCAL_URL', 'RELATIVE_URL', 'COLOR'); foreach ($bbcode_tokens as $token) { From 226376c573d5e5923bb325e5e5af2ca1d2239f4d Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Wed, 4 Dec 2013 16:40:41 -0800 Subject: [PATCH 06/37] [ticket/12060] Add acp event core.acp_bbcodes_modify_create Modify bbcode data before modify/create PHPBB3-12060 --- phpBB/includes/acp/acp_bbcodes.php | 28 ++++++++++++++++++++++++---- 1 file 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'); } From 79b8ecad4ddf1b023b9100afa623e8c0f8981e79 Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Wed, 4 Dec 2013 16:42:07 -0800 Subject: [PATCH 07/37] [ticket/12060] Add acp event core.acp_bbcodes_display_form Modify bbcode template data before we display the form PHPBB3-12060 --- phpBB/includes/acp/acp_bbcodes.php | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php index 43787922f6..2a71fbf779 100644 --- a/phpBB/includes/acp/acp_bbcodes.php +++ b/phpBB/includes/acp/acp_bbcodes.php @@ -334,15 +334,33 @@ class acp_bbcodes break; } - $template->assign_vars(array( - 'U_ACTION' => $this->u_action . '&action=add') + $this_u_action = $this->u_action; + + $template_data = array( + 'U_ACTION' => $this->u_action . '&action=add', ); $sql = 'SELECT * FROM ' . BBCODES_TABLE . ' ORDER BY bbcode_tag'; + + /** + * Modify bbcode template data before we display the form + * + * @event core.acp_bbcodes_display_form + * @var string action Type of the action: modify|create + * @var string sql SQL statement to get bbcode data + * @var array template_data Array with form template data + * @var object this_u_action $this->u_action object + * @since 3.1-A3 + */ + $vars = array('action', 'sql', 'template_data', 'this_u_action'); + extract($phpbb_dispatcher->trigger_event('core.acp_bbcodes_display_form', compact($vars))); + $result = $db->sql_query($sql); + $template->assign_vars($template_data); + while ($row = $db->sql_fetchrow($result)) { $template->assign_block_vars('bbcodes', array( From 2e33095177b4ce940844092e2ea2bd73ed1beaa1 Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Wed, 4 Dec 2013 16:42:55 -0800 Subject: [PATCH 08/37] [ticket/12060] Add acp event core.acp_bbcodes_display_bbcodes Modify display of bbcodes in the form PHPBB3-12060 --- phpBB/includes/acp/acp_bbcodes.php | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php index 2a71fbf779..c3e28c5b03 100644 --- a/phpBB/includes/acp/acp_bbcodes.php +++ b/phpBB/includes/acp/acp_bbcodes.php @@ -363,11 +363,26 @@ class acp_bbcodes while ($row = $db->sql_fetchrow($result)) { - $template->assign_block_vars('bbcodes', array( + $bbcodes_array = array( 'BBCODE_TAG' => $row['bbcode_tag'], 'U_EDIT' => $this->u_action . '&action=edit&bbcode=' . $row['bbcode_id'], - 'U_DELETE' => $this->u_action . '&action=delete&bbcode=' . $row['bbcode_id']) + 'U_DELETE' => $this->u_action . '&action=delete&bbcode=' . $row['bbcode_id'], ); + + /** + * Modify display of bbcodes in the form + * + * @event core.acp_bbcodes_display_bbcodes + * @var array row Array with current bbcode data + * @var array bbcodes_array Array of bbcodes template data + * @var object this_u_action $this->u_action object + * @since 3.1-A3 + */ + $vars = array('bbcodes_array', 'row', 'this_u_action'); + extract($phpbb_dispatcher->trigger_event('core.acp_bbcodes_display_bbcodes', compact($vars))); + + $template->assign_block_vars('bbcodes', $bbcodes_array); + } $db->sql_freeresult($result); } From 8f309a70db9b4b0c9f59318cf198450c1ec17873 Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Wed, 4 Dec 2013 16:43:26 -0800 Subject: [PATCH 09/37] [ticket/12060] Add $phpbb_dispatcher to acp_bbcodes.php for events PHPBB3-12060 --- phpBB/includes/acp/acp_bbcodes.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php index c3e28c5b03..e4105f29bd 100644 --- a/phpBB/includes/acp/acp_bbcodes.php +++ b/phpBB/includes/acp/acp_bbcodes.php @@ -24,7 +24,7 @@ class acp_bbcodes function main($id, $mode) { - global $db, $user, $auth, $template, $cache, $request; + global $db, $user, $auth, $template, $cache, $request, $phpbb_dispatcher; global $config, $phpbb_root_path, $phpbb_admin_path, $phpEx; $user->add_lang('acp/posting'); From 5195f9c2997e31ceddd60d20f08a23477d95db1e Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Wed, 4 Dec 2013 16:44:21 -0800 Subject: [PATCH 10/37] [ticket/12060] Add event core.display_custom_bbcodes_modify_sql Modify the SQL statement retrieving the custom bbcodes PHPBB3-12060 --- phpBB/includes/functions_display.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 5592aa89ba..f2d76cfd73 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -932,6 +932,17 @@ function display_custom_bbcodes() FROM ' . BBCODES_TABLE . ' WHERE display_on_posting = 1 ORDER BY bbcode_tag'; + + /** + * Modify the SQL statement retrieving the custom bbcodes + * + * @event core.display_custom_bbcodes_modify_sql + * @var string sql SQL SELECT statement + * @since 3.1-A3 + */ + $vars = array('sql'); + extract($phpbb_dispatcher->trigger_event('core.display_custom_bbcodes_modify_sql', compact($vars))); + $result = $db->sql_query($sql); $i = 0; From e179f25154d3098361bf079774a6dc92aeb4e4ab Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Wed, 4 Dec 2013 16:45:02 -0800 Subject: [PATCH 11/37] [ticket/12060] Add event core.modify_bbcode_init Use this event to modify the bbcode data for later parsing PHPBB3-12060 --- phpBB/includes/message_parser.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index acd31fd519..bce6321022 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -103,6 +103,8 @@ class bbcode_firstpass extends bbcode */ function bbcode_init($allow_custom_bbcode = true) { + global $phpbb_dispatcher; + static $rowset; // This array holds all bbcode data. BBCodes will be processed in this @@ -162,6 +164,21 @@ class bbcode_firstpass extends bbcode 'regexp' => array($row['first_pass_match'] => str_replace('$uid', $this->bbcode_uid, $row['first_pass_replace'])) ); } + + $bbcodes = $this->bbcodes; + + /** + * Use this event to modify the bbcode data for later parsing + * + * @event core.modify_bbcode_init + * @var array bbcodes The array of bbcode data for use in parsing + * @var array rowset The array of bbcode data from the database + * @since 3.1-A3 + */ + $vars = array('bbcodes', 'rowset'); + extract($phpbb_dispatcher->trigger_event('core.modify_bbcode_init', compact($vars))); + + $this->bbcodes = $bbcodes; } /** From feb4ae13f4415ceb759d0c5e8c7be47213e3fc53 Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Wed, 4 Dec 2013 16:45:30 -0800 Subject: [PATCH 12/37] [ticket/12060] Add event core.modify_text_for_format_display_after Use this event to modify the text after it is parsed PHPBB3-12060 --- phpBB/includes/message_parser.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index bce6321022..3e64f17a52 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -1215,6 +1215,8 @@ class parse_message extends bbcode_firstpass */ function format_display($allow_bbcode, $allow_magic_url, $allow_smilies, $update_this_message = true) { + global $phpbb_dispatcher; + // If false, then the parsed message get returned but internal message not processed. if (!$update_this_message) { @@ -1243,6 +1245,26 @@ class parse_message extends bbcode_firstpass $this->message = bbcode_nl2br($this->message); $this->message = smiley_text($this->message, !$allow_smilies); + $text = $this->message; + $uid = $this->bbcode_uid; + + /** + * Use this event to modify the text after it is parsed + * + * @event core.modify_text_for_format_display_after + * @var string text The text to parse + * @var string uid The BBCode UID + * @var bool allow_bbcode Allow BBCodes switch + * @var bool allow_magic_url Allow magic urls switch + * @var bool allow_smilies Allow smilies switch + * @since 3.1-A3 + */ + $vars = array('text', 'uid', 'allow_bbcode', 'allow_magic_url', 'allow_smilies'); + extract($phpbb_dispatcher->trigger_event('core.modify_text_for_format_display_after', compact($vars))); + + $this->message = $text; + $this->bbcode_uid = $uid; + if (!$update_this_message) { unset($this->message); From 02ddc181d66e91357c5ee4132cc19187680109ff Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Wed, 4 Dec 2013 16:46:28 -0800 Subject: [PATCH 13/37] [ticket/12060] Fix a core typo in display_custom_bbcodes doc block PHPBB3-12060 --- phpBB/includes/functions_display.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index f2d76cfd73..e0bf6786e1 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -919,7 +919,7 @@ function topic_status(&$topic_row, $replies, $unread_topic, &$folder_img, &$fold /** * Assign/Build custom bbcodes for display in screens supporting using of bbcodes -* The custom bbcodes buttons will be placed within the template block 'custom_codes' +* The custom bbcodes buttons will be placed within the template block 'custom_tags' */ function display_custom_bbcodes() { From fba2c2c680adc87c5c3430438d96e390d4e8bfd1 Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Wed, 4 Dec 2013 19:36:52 -0800 Subject: [PATCH 14/37] [ticket/12060] Use actions class for BBCodes list in ACP PHPBB3-12060 --- phpBB/adm/style/acp_bbcodes.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/adm/style/acp_bbcodes.html b/phpBB/adm/style/acp_bbcodes.html index 2057890bdf..8da2afb011 100644 --- a/phpBB/adm/style/acp_bbcodes.html +++ b/phpBB/adm/style/acp_bbcodes.html @@ -103,7 +103,7 @@ {bbcodes.BBCODE_TAG} - {ICON_EDIT} {ICON_DELETE} + {ICON_EDIT} {ICON_DELETE} From d93200c973e35e3cc8417f8871b89f835e5395d7 Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Thu, 5 Dec 2013 13:49:47 -0800 Subject: [PATCH 15/37] [ticket/12060] Add bbcode tokens array to core.acp_bbcodes_edit_add PHPBB3-12060 --- phpBB/includes/acp/acp_bbcodes.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php index e4105f29bd..9b9d0a3e84 100644 --- a/phpBB/includes/acp/acp_bbcodes.php +++ b/phpBB/includes/acp/acp_bbcodes.php @@ -108,21 +108,23 @@ class acp_bbcodes 'DISPLAY_ON_POSTING' => $display_on_posting, ); + $bbcode_tokens = array('TEXT', 'SIMPLETEXT', 'INTTEXT', 'IDENTIFIER', 'NUMBER', 'EMAIL', 'URL', 'LOCAL_URL', 'RELATIVE_URL', 'COLOR'); + /** * Modify bbcode template before we display the add/edit form * * @event core.acp_bbcodes_edit_add - * @var string action Type of the action: add|edit - * @var array tpl_ary Array with bbcodes add/edit data - * @var int bbcode_id The id of the bbcode (being edited) + * @var string action Type of the action: add|edit + * @var array tpl_ary Array with bbcodes add/edit data + * @var int bbcode_id The id of the bbcode (being edited) + * @var array bbcode_token Array of bbcode tokens * @since 3.1-A3 */ - $vars = array('action', 'tpl_ary', 'bbcode_id'); + $vars = array('action', 'tpl_ary', 'bbcode_id', 'bbcode_tokens'); extract($phpbb_dispatcher->trigger_event('core.acp_bbcodes_edit_add', compact($vars))); $template->assign_vars($tpl_ary); - $bbcode_tokens = array('TEXT', 'SIMPLETEXT', 'INTTEXT', 'IDENTIFIER', 'NUMBER', 'EMAIL', 'URL', 'LOCAL_URL', 'RELATIVE_URL', 'COLOR'); foreach ($bbcode_tokens as $token) { $template->assign_block_vars('token', array( From f41638ebbfbe22fe41098d03707f1bfbe9bdc28e Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Thu, 5 Dec 2013 13:52:20 -0800 Subject: [PATCH 16/37] [ticket/12060] Fix typo in core.acp_bbcodes_edit_add doc block PHPBB3-12060 --- phpBB/includes/acp/acp_bbcodes.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php index 9b9d0a3e84..8cca982a47 100644 --- a/phpBB/includes/acp/acp_bbcodes.php +++ b/phpBB/includes/acp/acp_bbcodes.php @@ -117,7 +117,7 @@ class acp_bbcodes * @var string action Type of the action: add|edit * @var array tpl_ary Array with bbcodes add/edit data * @var int bbcode_id The id of the bbcode (being edited) - * @var array bbcode_token Array of bbcode tokens + * @var array bbcode_tokens Array of bbcode tokens * @since 3.1-A3 */ $vars = array('action', 'tpl_ary', 'bbcode_id', 'bbcode_tokens'); From 3659ba884eb9a6bc00ba44a93626a89f8e4bbdcb Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Thu, 12 Dec 2013 09:54:46 -0800 Subject: [PATCH 17/37] [ticket/12060] Copy this_u_action back to original this->u_action var PHPBB3-12060 --- phpBB/includes/acp/acp_bbcodes.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php index 8cca982a47..d14392ad73 100644 --- a/phpBB/includes/acp/acp_bbcodes.php +++ b/phpBB/includes/acp/acp_bbcodes.php @@ -387,6 +387,8 @@ class acp_bbcodes } $db->sql_freeresult($result); + + $this->u_action = $this_u_action; } /* From b1e05be6ea757ed90aa73f6556c66a74805e9f3e Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Thu, 12 Dec 2013 09:55:21 -0800 Subject: [PATCH 18/37] [ticket/12060] Adjust last item in array to use a comma instead of closing parenthesis PHPBB3-12060 --- phpBB/includes/acp/acp_bbcodes.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php index d14392ad73..d806dbc801 100644 --- a/phpBB/includes/acp/acp_bbcodes.php +++ b/phpBB/includes/acp/acp_bbcodes.php @@ -286,8 +286,8 @@ class acp_bbcodes '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'); } From 0156136c85f474b44b4fcb84b52c5c13d6b2fae6 Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Thu, 12 Dec 2013 09:56:00 -0800 Subject: [PATCH 19/37] [ticket/12060] Add $update_this_message var to the core event PHPBB3-12060 --- phpBB/includes/message_parser.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index 3e64f17a52..04fadf33e8 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -1259,7 +1259,7 @@ class parse_message extends bbcode_firstpass * @var bool allow_smilies Allow smilies switch * @since 3.1-A3 */ - $vars = array('text', 'uid', 'allow_bbcode', 'allow_magic_url', 'allow_smilies'); + $vars = array('text', 'uid', 'allow_bbcode', 'allow_magic_url', 'allow_smilies', 'update_this_message'); extract($phpbb_dispatcher->trigger_event('core.modify_text_for_format_display_after', compact($vars))); $this->message = $text; From 9e0dd14e1973eea7db3cad3426381999bf2a8bdb Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Thu, 12 Dec 2013 09:56:51 -0800 Subject: [PATCH 20/37] [ticket/12060] Remove re-tabbing of html from subsilver2 files PHPBB3-12060 --- .../subsilver2/template/posting_buttons.html | 76 +++++++++---------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/phpBB/styles/subsilver2/template/posting_buttons.html b/phpBB/styles/subsilver2/template/posting_buttons.html index 6fe15bff23..2c60913fc0 100644 --- a/phpBB/styles/subsilver2/template/posting_buttons.html +++ b/phpBB/styles/subsilver2/template/posting_buttons.html @@ -36,51 +36,51 @@ - -
- - - - - - - - - - - - - - - - - - - - {L_FONT_SIZE}{L_COLON} + + + + + + + + + + + + + + + + + + + {L_FONT_SIZE}{L_COLON} -
- + + + + -
- - onmouseover="helpline('cb_{custom_tags.BBCODE_ID}')" onmouseout="helpline('tip')" /> - -
+
+ + onmouseover="helpline('cb_{custom_tags.BBCODE_ID}')" onmouseout="helpline('tip')" /> + +
From b6eb1f66e169cd0cae3fc2c617588cb9e7c9c53b Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Thu, 12 Dec 2013 10:37:11 -0800 Subject: [PATCH 21/37] [ticket/12060] Update docblock for core event due to addition of another var PHPBB3-12060 --- phpBB/includes/message_parser.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index 04fadf33e8..5c543d8498 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -1252,11 +1252,12 @@ class parse_message extends bbcode_firstpass * Use this event to modify the text after it is parsed * * @event core.modify_text_for_format_display_after - * @var string text The text to parse - * @var string uid The BBCode UID - * @var bool allow_bbcode Allow BBCodes switch - * @var bool allow_magic_url Allow magic urls switch - * @var bool allow_smilies Allow smilies switch + * @var string text The text to parse + * @var string uid The BBCode UID + * @var bool allow_bbcode Allow BBCodes switch + * @var bool allow_magic_url Allow magic urls switch + * @var bool allow_smilies Allow smilies switch + * @var bool update_this_message Update message switch * @since 3.1-A3 */ $vars = array('text', 'uid', 'allow_bbcode', 'allow_magic_url', 'allow_smilies', 'update_this_message'); From 6ccec39e43a6f28051fc702378b038e78e18b225 Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Thu, 12 Dec 2013 13:50:13 -0800 Subject: [PATCH 22/37] [ticket/12060] Use $sql_ary instead of $sql PHPBB3-12060 --- phpBB/includes/acp/acp_bbcodes.php | 16 +++++++++------- phpBB/includes/functions_display.php | 20 +++++++++++--------- 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php index d806dbc801..e42e2d0d96 100644 --- a/phpBB/includes/acp/acp_bbcodes.php +++ b/phpBB/includes/acp/acp_bbcodes.php @@ -342,24 +342,26 @@ class acp_bbcodes 'U_ACTION' => $this->u_action . '&action=add', ); - $sql = 'SELECT * - FROM ' . BBCODES_TABLE . ' - ORDER BY bbcode_tag'; + $sql_ary = array( + 'SELECT' => 'b.*', + 'FROM' => array(BBCODES_TABLE => 'b'), + 'ORDER_BY' => 'b.bbcode_tag', + ); /** * Modify bbcode template data before we display the form * * @event core.acp_bbcodes_display_form * @var string action Type of the action: modify|create - * @var string sql SQL statement to get bbcode data + * @var string sql_ary The SQL array to get custom bbcode data * @var array template_data Array with form template data * @var object this_u_action $this->u_action object * @since 3.1-A3 */ - $vars = array('action', 'sql', 'template_data', 'this_u_action'); + $vars = array('action', 'sql_ary', 'template_data', 'this_u_action'); extract($phpbb_dispatcher->trigger_event('core.acp_bbcodes_display_form', compact($vars))); - $result = $db->sql_query($sql); + $result = $db->sql_query($db->sql_build_query('SELECT', $sql_ary)); $template->assign_vars($template_data); @@ -387,7 +389,7 @@ class acp_bbcodes } $db->sql_freeresult($result); - + $this->u_action = $this_u_action; } diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index e0bf6786e1..0525f8133c 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -928,22 +928,24 @@ function display_custom_bbcodes() // Start counting from 22 for the bbcode ids (every bbcode takes two ids - opening/closing) $num_predefined_bbcodes = 22; - $sql = 'SELECT bbcode_id, bbcode_tag, bbcode_helpline - FROM ' . BBCODES_TABLE . ' - WHERE display_on_posting = 1 - ORDER BY bbcode_tag'; + $sql_ary = array( + 'SELECT' => 'b.bbcode_id, b.bbcode_tag, b.bbcode_helpline', + 'FROM' => array(BBCODES_TABLE => 'b'), + 'WHERE' => 'b.display_on_posting = 1', + 'ORDER_BY' => 'b.bbcode_tag', + ); /** - * Modify the SQL statement retrieving the custom bbcodes + * Event to modify the SQL query before custom bbcode data is queried * * @event core.display_custom_bbcodes_modify_sql - * @var string sql SQL SELECT statement + * @var array sql_ary The SQL array to get the bbcode data * @since 3.1-A3 */ - $vars = array('sql'); + $vars = array('sql_ary'); extract($phpbb_dispatcher->trigger_event('core.display_custom_bbcodes_modify_sql', compact($vars))); - $result = $db->sql_query($sql); + $result = $db->sql_query($db->sql_build_query('SELECT', $sql_ary)); $i = 0; while ($row = $db->sql_fetchrow($result)) @@ -963,7 +965,7 @@ function display_custom_bbcodes() ); /** - * Modify the template data block of a bbcode + * Event to modify the template data block of a custom bbcode * * This event is triggered once per bbcode * From caca36bc50f2e949c6e3b65124ba1df0b23cf2af Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Thu, 12 Dec 2013 13:58:59 -0800 Subject: [PATCH 23/37] [ticket/12060] Refactor u_action in the events that use it PHPBB3-12060 --- phpBB/includes/acp/acp_bbcodes.php | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php index e42e2d0d96..267bb35fd2 100644 --- a/phpBB/includes/acp/acp_bbcodes.php +++ b/phpBB/includes/acp/acp_bbcodes.php @@ -336,7 +336,7 @@ class acp_bbcodes break; } - $this_u_action = $this->u_action; + $u_action = $this->u_action; $template_data = array( 'U_ACTION' => $this->u_action . '&action=add', @@ -355,10 +355,10 @@ class acp_bbcodes * @var string action Type of the action: modify|create * @var string sql_ary The SQL array to get custom bbcode data * @var array template_data Array with form template data - * @var object this_u_action $this->u_action object + * @var object u_action $this->u_action object * @since 3.1-A3 */ - $vars = array('action', 'sql_ary', 'template_data', 'this_u_action'); + $vars = array('action', 'sql_ary', 'template_data', 'u_action'); extract($phpbb_dispatcher->trigger_event('core.acp_bbcodes_display_form', compact($vars))); $result = $db->sql_query($db->sql_build_query('SELECT', $sql_ary)); @@ -369,8 +369,8 @@ class acp_bbcodes { $bbcodes_array = array( 'BBCODE_TAG' => $row['bbcode_tag'], - 'U_EDIT' => $this->u_action . '&action=edit&bbcode=' . $row['bbcode_id'], - 'U_DELETE' => $this->u_action . '&action=delete&bbcode=' . $row['bbcode_id'], + 'U_EDIT' => $u_action . '&action=edit&bbcode=' . $row['bbcode_id'], + 'U_DELETE' => $u_action . '&action=delete&bbcode=' . $row['bbcode_id'], ); /** @@ -379,18 +379,16 @@ class acp_bbcodes * @event core.acp_bbcodes_display_bbcodes * @var array row Array with current bbcode data * @var array bbcodes_array Array of bbcodes template data - * @var object this_u_action $this->u_action object + * @var object u_action $this->u_action object * @since 3.1-A3 */ - $vars = array('bbcodes_array', 'row', 'this_u_action'); + $vars = array('bbcodes_array', 'row', 'u_action'); extract($phpbb_dispatcher->trigger_event('core.acp_bbcodes_display_bbcodes', compact($vars))); $template->assign_block_vars('bbcodes', $bbcodes_array); } $db->sql_freeresult($result); - - $this->u_action = $this_u_action; } /* From 730a05bd3036b5612e1f7485b3e7be85c73bfbba Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Thu, 12 Dec 2013 13:59:30 -0800 Subject: [PATCH 24/37] [ticket/12060] Update the docblock comments in acp core events PHPBB3-12060 --- phpBB/includes/acp/acp_bbcodes.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php index 267bb35fd2..eb841966e1 100644 --- a/phpBB/includes/acp/acp_bbcodes.php +++ b/phpBB/includes/acp/acp_bbcodes.php @@ -111,7 +111,7 @@ class acp_bbcodes $bbcode_tokens = array('TEXT', 'SIMPLETEXT', 'INTTEXT', 'IDENTIFIER', 'NUMBER', 'EMAIL', 'URL', 'LOCAL_URL', 'RELATIVE_URL', 'COLOR'); /** - * Modify bbcode template before we display the add/edit form + * Event to modify custom bbcode template before displaying the add/edit form * * @event core.acp_bbcodes_edit_add * @var string action Type of the action: add|edit @@ -143,7 +143,7 @@ class acp_bbcodes $sql_ary = $hidden_fields = array(); /** - * Modify bbcode data before modify/create + * Event to modify custom bbcode data before modify/create * * @event core.acp_bbcodes_modify_create * @var string action Type of the action: modify|create @@ -349,7 +349,7 @@ class acp_bbcodes ); /** - * Modify bbcode template data before we display the form + * Event to modify custom bbcode template data before displaying the form * * @event core.acp_bbcodes_display_form * @var string action Type of the action: modify|create @@ -374,7 +374,7 @@ class acp_bbcodes ); /** - * Modify display of bbcodes in the form + * Event to modify display of custom bbcodes in the form * * @event core.acp_bbcodes_display_bbcodes * @var array row Array with current bbcode data From 75831dc2d0bb79007db14d0c2a86cbb024d98a31 Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Thu, 12 Dec 2013 14:09:30 -0800 Subject: [PATCH 25/37] [ticket/12060] Change @since in event docblocks PHPBB3-12060 --- phpBB/includes/acp/acp_bbcodes.php | 8 ++++---- phpBB/includes/functions_display.php | 2 +- phpBB/includes/message_parser.php | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php index eb841966e1..8368f98602 100644 --- a/phpBB/includes/acp/acp_bbcodes.php +++ b/phpBB/includes/acp/acp_bbcodes.php @@ -118,7 +118,7 @@ class acp_bbcodes * @var array tpl_ary Array with bbcodes add/edit data * @var int bbcode_id The id of the bbcode (being edited) * @var array bbcode_tokens Array of bbcode tokens - * @since 3.1-A3 + * @since 3.1.0-A3 */ $vars = array('action', 'tpl_ary', 'bbcode_id', 'bbcode_tokens'); extract($phpbb_dispatcher->trigger_event('core.acp_bbcodes_edit_add', compact($vars))); @@ -155,7 +155,7 @@ class acp_bbcodes * @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 + * @since 3.1.0-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))); @@ -356,7 +356,7 @@ class acp_bbcodes * @var string sql_ary The SQL array to get custom bbcode data * @var array template_data Array with form template data * @var object u_action $this->u_action object - * @since 3.1-A3 + * @since 3.1.0-A3 */ $vars = array('action', 'sql_ary', 'template_data', 'u_action'); extract($phpbb_dispatcher->trigger_event('core.acp_bbcodes_display_form', compact($vars))); @@ -380,7 +380,7 @@ class acp_bbcodes * @var array row Array with current bbcode data * @var array bbcodes_array Array of bbcodes template data * @var object u_action $this->u_action object - * @since 3.1-A3 + * @since 3.1.0-A3 */ $vars = array('bbcodes_array', 'row', 'u_action'); extract($phpbb_dispatcher->trigger_event('core.acp_bbcodes_display_bbcodes', compact($vars))); diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 0525f8133c..5dac901b73 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -940,7 +940,7 @@ function display_custom_bbcodes() * * @event core.display_custom_bbcodes_modify_sql * @var array sql_ary The SQL array to get the bbcode data - * @since 3.1-A3 + * @since 3.1.0-A3 */ $vars = array('sql_ary'); extract($phpbb_dispatcher->trigger_event('core.display_custom_bbcodes_modify_sql', compact($vars))); diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index 5c543d8498..096d39b9bb 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -173,7 +173,7 @@ class bbcode_firstpass extends bbcode * @event core.modify_bbcode_init * @var array bbcodes The array of bbcode data for use in parsing * @var array rowset The array of bbcode data from the database - * @since 3.1-A3 + * @since 3.1.0-A3 */ $vars = array('bbcodes', 'rowset'); extract($phpbb_dispatcher->trigger_event('core.modify_bbcode_init', compact($vars))); @@ -1258,7 +1258,7 @@ class parse_message extends bbcode_firstpass * @var bool allow_magic_url Allow magic urls switch * @var bool allow_smilies Allow smilies switch * @var bool update_this_message Update message switch - * @since 3.1-A3 + * @since 3.1.0-A3 */ $vars = array('text', 'uid', 'allow_bbcode', 'allow_magic_url', 'allow_smilies', 'update_this_message'); extract($phpbb_dispatcher->trigger_event('core.modify_text_for_format_display_after', compact($vars))); From 21e269b9ca026ec56c285fafe9f947d144c5c31d Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Thu, 12 Dec 2013 14:09:58 -0800 Subject: [PATCH 26/37] [ticket/12060] Fix u_action comments in docblocks PHPBB3-12060 --- phpBB/includes/acp/acp_bbcodes.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php index 8368f98602..f3341c9031 100644 --- a/phpBB/includes/acp/acp_bbcodes.php +++ b/phpBB/includes/acp/acp_bbcodes.php @@ -355,7 +355,7 @@ class acp_bbcodes * @var string action Type of the action: modify|create * @var string sql_ary The SQL array to get custom bbcode data * @var array template_data Array with form template data - * @var object u_action $this->u_action object + * @var string u_action The u_action link * @since 3.1.0-A3 */ $vars = array('action', 'sql_ary', 'template_data', 'u_action'); @@ -379,7 +379,7 @@ class acp_bbcodes * @event core.acp_bbcodes_display_bbcodes * @var array row Array with current bbcode data * @var array bbcodes_array Array of bbcodes template data - * @var object u_action $this->u_action object + * @var string u_action The u_action link * @since 3.1.0-A3 */ $vars = array('bbcodes_array', 'row', 'u_action'); From b26e4dd42c434221acb488641a121e97307cb7dd Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Fri, 13 Dec 2013 10:31:04 -0800 Subject: [PATCH 27/37] [ticket/12060] Correctly label alpha versions in event docblocks PHPBB3-12060 --- phpBB/includes/acp/acp_bbcodes.php | 8 ++++---- phpBB/includes/functions_display.php | 2 +- phpBB/includes/message_parser.php | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php index f3341c9031..eb9a210fd0 100644 --- a/phpBB/includes/acp/acp_bbcodes.php +++ b/phpBB/includes/acp/acp_bbcodes.php @@ -118,7 +118,7 @@ class acp_bbcodes * @var array tpl_ary Array with bbcodes add/edit data * @var int bbcode_id The id of the bbcode (being edited) * @var array bbcode_tokens Array of bbcode tokens - * @since 3.1.0-A3 + * @since 3.1.0-a3 */ $vars = array('action', 'tpl_ary', 'bbcode_id', 'bbcode_tokens'); extract($phpbb_dispatcher->trigger_event('core.acp_bbcodes_edit_add', compact($vars))); @@ -155,7 +155,7 @@ class acp_bbcodes * @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.0-A3 + * @since 3.1.0-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))); @@ -356,7 +356,7 @@ class acp_bbcodes * @var string sql_ary The SQL array to get custom bbcode data * @var array template_data Array with form template data * @var string u_action The u_action link - * @since 3.1.0-A3 + * @since 3.1.0-a3 */ $vars = array('action', 'sql_ary', 'template_data', 'u_action'); extract($phpbb_dispatcher->trigger_event('core.acp_bbcodes_display_form', compact($vars))); @@ -380,7 +380,7 @@ class acp_bbcodes * @var array row Array with current bbcode data * @var array bbcodes_array Array of bbcodes template data * @var string u_action The u_action link - * @since 3.1.0-A3 + * @since 3.1.0-a3 */ $vars = array('bbcodes_array', 'row', 'u_action'); extract($phpbb_dispatcher->trigger_event('core.acp_bbcodes_display_bbcodes', compact($vars))); diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index 5dac901b73..d1118b9672 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -940,7 +940,7 @@ function display_custom_bbcodes() * * @event core.display_custom_bbcodes_modify_sql * @var array sql_ary The SQL array to get the bbcode data - * @since 3.1.0-A3 + * @since 3.1.0-a3 */ $vars = array('sql_ary'); extract($phpbb_dispatcher->trigger_event('core.display_custom_bbcodes_modify_sql', compact($vars))); diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index 096d39b9bb..893ef83381 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -173,7 +173,7 @@ class bbcode_firstpass extends bbcode * @event core.modify_bbcode_init * @var array bbcodes The array of bbcode data for use in parsing * @var array rowset The array of bbcode data from the database - * @since 3.1.0-A3 + * @since 3.1.0-a3 */ $vars = array('bbcodes', 'rowset'); extract($phpbb_dispatcher->trigger_event('core.modify_bbcode_init', compact($vars))); @@ -1258,7 +1258,7 @@ class parse_message extends bbcode_firstpass * @var bool allow_magic_url Allow magic urls switch * @var bool allow_smilies Allow smilies switch * @var bool update_this_message Update message switch - * @since 3.1.0-A3 + * @since 3.1.0-a3 */ $vars = array('text', 'uid', 'allow_bbcode', 'allow_magic_url', 'allow_smilies', 'update_this_message'); extract($phpbb_dispatcher->trigger_event('core.modify_text_for_format_display_after', compact($vars))); From 8864c601a2ef1232d8d2315499e189a1c92ec37c Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Fri, 13 Dec 2013 13:34:58 -0800 Subject: [PATCH 28/37] [ticket/12060] Rename event from append to after in acp_bbcodes.html PHPBB3-12060 --- phpBB/adm/style/acp_bbcodes.html | 2 +- phpBB/docs/events.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/adm/style/acp_bbcodes.html b/phpBB/adm/style/acp_bbcodes.html index 8da2afb011..4b48b94519 100644 --- a/phpBB/adm/style/acp_bbcodes.html +++ b/phpBB/adm/style/acp_bbcodes.html @@ -47,7 +47,7 @@
- +
{L_SUBMIT} diff --git a/phpBB/docs/events.md b/phpBB/docs/events.md index ebca4b76f4..26efe6ed24 100644 --- a/phpBB/docs/events.md +++ b/phpBB/docs/events.md @@ -10,7 +10,7 @@ acp_bbcodes_actions_prepend * Since: 3.1.0-a3 * Purpose: Add actions to the BBCodes page, before edit/delete buttons -acp_bbcodes_edit_form_append +acp_bbcodes_edit_fieldsets_after === * Location: adm/style/acp_bbcodes.html * Since: 3.1.0-a3 From 31eb759aa4b2978a337ae75fe713f0842ea46c24 Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Fri, 13 Dec 2013 13:36:59 -0800 Subject: [PATCH 29/37] [ticket/12060] Use separate template event for acp user signature posting buttons PHPBB3-12060 --- phpBB/adm/style/acp_users_signature.html | 4 ++-- phpBB/docs/events.md | 16 ++++++++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/phpBB/adm/style/acp_users_signature.html b/phpBB/adm/style/acp_users_signature.html index 694e20c624..fff75c993d 100644 --- a/phpBB/adm/style/acp_users_signature.html +++ b/phpBB/adm/style/acp_users_signature.html @@ -49,7 +49,7 @@ {L_SIGNATURE}

{L_SIGNATURE_EXPLAIN}

- +
@@ -85,7 +85,7 @@
- +
diff --git a/phpBB/docs/events.md b/phpBB/docs/events.md index 26efe6ed24..6084653338 100644 --- a/phpBB/docs/events.md +++ b/phpBB/docs/events.md @@ -64,6 +64,20 @@ acp_users_overview_options_append * Since: 3.1.0-a1 * Purpose: Add options and settings on user overview page +acp_users_signature_editor_buttons_after +=== +* Locations: + + adm/style/acp_users_signature.html +* Since: 3.1.0-a3 +* Purpose: Add content after BBCode posting buttons in the ACP user signature + +acp_users_signature_editor_buttons_before +=== +* Locations: + + adm/style/acp_users_signature.html +* Since: 3.1.0-a3 +* Purpose: Add content before BBCode posting buttons in the ACP user signature + forumlist_body_last_post_title_prepend ==== * Locations: @@ -202,7 +216,6 @@ overall_header_navigation_prepend posting_editor_buttons_after === * Locations: - + adm/style/acp_users_signature.html + styles/prosilver/template/posting_buttons.html + styles/subsilver2/template/posting_buttons.html * Since: 3.1.0-a3 @@ -211,7 +224,6 @@ posting_editor_buttons_after posting_editor_buttons_before === * Locations: - + adm/style/acp_users_signature.html + styles/prosilver/template/posting_buttons.html + styles/subsilver2/template/posting_buttons.html * Since: 3.1.0-a3 From aa0c463d0f1609531843371977bef5ccb88e0c89 Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Fri, 13 Dec 2013 16:46:12 -0800 Subject: [PATCH 30/37] [ticket/12060] Further clarify/fix a var in acp_bbcodes_modify_create event doc block PHPBB3-12060 --- phpBB/includes/acp/acp_bbcodes.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php index eb9a210fd0..9ce4d6f872 100644 --- a/phpBB/includes/acp/acp_bbcodes.php +++ b/phpBB/includes/acp/acp_bbcodes.php @@ -149,7 +149,7 @@ class acp_bbcodes * @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 bool display_on_posting Display bbcode on posting 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 From a24d2058cd7953084662c140ae4946d773e6411a Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Fri, 13 Dec 2013 16:47:38 -0800 Subject: [PATCH 31/37] [ticket/12060] Add num_predefined_bbcodes to display_custom_bbcodes_modify_sql event PHPBB3-12060 --- phpBB/includes/functions_display.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index d1118b9672..21ac3666e1 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -939,10 +939,12 @@ function display_custom_bbcodes() * Event to modify the SQL query before custom bbcode data is queried * * @event core.display_custom_bbcodes_modify_sql - * @var array sql_ary The SQL array to get the bbcode data + * @var array sql_ary The SQL array to get the bbcode data + * @var int num_predefined_bbcodes The number of predefined core bbcodes + * (multiplied by factor of 2) * @since 3.1.0-a3 */ - $vars = array('sql_ary'); + $vars = array('sql_ary', 'num_predefined_bbcodes'); extract($phpbb_dispatcher->trigger_event('core.display_custom_bbcodes_modify_sql', compact($vars))); $result = $db->sql_query($db->sql_build_query('SELECT', $sql_ary)); From f0454586795de85cf1b66b6f927d18d3e9466305 Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Fri, 13 Dec 2013 17:00:06 -0800 Subject: [PATCH 32/37] [ticket/12060] Rename event in message parser to modify_format_display_text_after PHPBB3-12060 --- phpBB/includes/message_parser.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index 893ef83381..c1229d9c77 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -1251,7 +1251,7 @@ class parse_message extends bbcode_firstpass /** * Use this event to modify the text after it is parsed * - * @event core.modify_text_for_format_display_after + * @event core.modify_format_display_text_after * @var string text The text to parse * @var string uid The BBCode UID * @var bool allow_bbcode Allow BBCodes switch @@ -1261,7 +1261,7 @@ class parse_message extends bbcode_firstpass * @since 3.1.0-a3 */ $vars = array('text', 'uid', 'allow_bbcode', 'allow_magic_url', 'allow_smilies', 'update_this_message'); - extract($phpbb_dispatcher->trigger_event('core.modify_text_for_format_display_after', compact($vars))); + extract($phpbb_dispatcher->trigger_event('core.modify_format_display_text_after', compact($vars))); $this->message = $text; $this->bbcode_uid = $uid; From 6b178c758eb727c8caa6c1f95a34a4afe8ea1573 Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Mon, 16 Dec 2013 15:31:25 -0800 Subject: [PATCH 33/37] [ticket/12060] Fix docblock for acp_bbcodes_modify_create event PHPBB3-12060 --- phpBB/includes/acp/acp_bbcodes.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php index 9ce4d6f872..d55a398461 100644 --- a/phpBB/includes/acp/acp_bbcodes.php +++ b/phpBB/includes/acp/acp_bbcodes.php @@ -150,9 +150,9 @@ class acp_bbcodes * @var array sql_ary Array with new bbcode data * @var int bbcode_id The id of the bbcode (being modified) * @var bool display_on_posting Display bbcode on posting 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 string bbcode_match BBCode usage string to match + * @var string bbcode_tpl BBCode HTML replacement string + * @var string bbcode_helpline BBCode help line string * @var array hidden_fields Array of hidden fields for use when * submitting form when $warn_text is true * @since 3.1.0-a3 From df9e782fa44f72861896b763906e26ba36e4a31f Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Mon, 16 Dec 2013 15:31:44 -0800 Subject: [PATCH 34/37] [ticket/12060] Remove whitespaces PHPBB3-12060 --- phpBB/includes/message_parser.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index c1229d9c77..56abaae998 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -1216,7 +1216,7 @@ class parse_message extends bbcode_firstpass function format_display($allow_bbcode, $allow_magic_url, $allow_smilies, $update_this_message = true) { global $phpbb_dispatcher; - + // If false, then the parsed message get returned but internal message not processed. if (!$update_this_message) { From 01c4235f0080a1cf07cd6e4ede880a323f3c09a7 Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Mon, 16 Dec 2013 15:33:44 -0800 Subject: [PATCH 35/37] [ticket/12060] More fixes to dockblock for acp_bbcodes_modify_create event PHPBB3-12060 --- phpBB/includes/acp/acp_bbcodes.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php index d55a398461..65159ec7ea 100644 --- a/phpBB/includes/acp/acp_bbcodes.php +++ b/phpBB/includes/acp/acp_bbcodes.php @@ -150,9 +150,9 @@ class acp_bbcodes * @var array sql_ary Array with new bbcode data * @var int bbcode_id The id of the bbcode (being modified) * @var bool display_on_posting Display bbcode on posting form - * @var string bbcode_match BBCode usage string to match - * @var string bbcode_tpl BBCode HTML replacement string - * @var string bbcode_helpline BBCode help line string + * @var string bbcode_match The bbcode usage string to match + * @var string bbcode_tpl The bbcode HTML replacement string + * @var string bbcode_helpline The bbcode help line string * @var array hidden_fields Array of hidden fields for use when * submitting form when $warn_text is true * @since 3.1.0-a3 From 4665e3df216de474e73c5aeec56ec5cb30f280c9 Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Mon, 16 Dec 2013 23:54:55 -0800 Subject: [PATCH 36/37] [ticket/12060] Further clarifying new event docblocks as much as possible PHPBB3-12060 --- phpBB/docs/events.md | 2 +- phpBB/includes/acp/acp_bbcodes.php | 16 +++++++++------- phpBB/includes/message_parser.php | 13 +++++++------ 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/phpBB/docs/events.md b/phpBB/docs/events.md index 6084653338..9b65566197 100644 --- a/phpBB/docs/events.md +++ b/phpBB/docs/events.md @@ -14,7 +14,7 @@ acp_bbcodes_edit_fieldsets_after === * Location: adm/style/acp_bbcodes.html * Since: 3.1.0-a3 -* Purpose: Add settings to edit BBCodes form +* Purpose: Add settings to BBCode add/edit form acp_forums_normal_settings_append === diff --git a/phpBB/includes/acp/acp_bbcodes.php b/phpBB/includes/acp/acp_bbcodes.php index 65159ec7ea..84382b6276 100644 --- a/phpBB/includes/acp/acp_bbcodes.php +++ b/phpBB/includes/acp/acp_bbcodes.php @@ -111,12 +111,13 @@ class acp_bbcodes $bbcode_tokens = array('TEXT', 'SIMPLETEXT', 'INTTEXT', 'IDENTIFIER', 'NUMBER', 'EMAIL', 'URL', 'LOCAL_URL', 'RELATIVE_URL', 'COLOR'); /** - * Event to modify custom bbcode template before displaying the add/edit form + * Modify custom bbcode template data before we display the add/edit form * * @event core.acp_bbcodes_edit_add * @var string action Type of the action: add|edit - * @var array tpl_ary Array with bbcodes add/edit data - * @var int bbcode_id The id of the bbcode (being edited) + * @var array tpl_ary Array with custom bbcode add/edit data + * @var int bbcode_id When editing: the bbcode id, + * when creating: 0 * @var array bbcode_tokens Array of bbcode tokens * @since 3.1.0-a3 */ @@ -143,12 +144,13 @@ class acp_bbcodes $sql_ary = $hidden_fields = array(); /** - * Event to modify custom bbcode data before modify/create + * Modify custom bbcode data before the modify/create action * * @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 bbcode_id When editing: the bbcode id, + * when creating: 0 * @var bool display_on_posting Display bbcode on posting form * @var string bbcode_match The bbcode usage string to match * @var string bbcode_tpl The bbcode HTML replacement string @@ -349,7 +351,7 @@ class acp_bbcodes ); /** - * Event to modify custom bbcode template data before displaying the form + * Modify custom bbcode template data before we display the form * * @event core.acp_bbcodes_display_form * @var string action Type of the action: modify|create @@ -374,7 +376,7 @@ class acp_bbcodes ); /** - * Event to modify display of custom bbcodes in the form + * Modify display of custom bbcodes in the form * * @event core.acp_bbcodes_display_bbcodes * @var array row Array with current bbcode data diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index 56abaae998..080c755965 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -1252,12 +1252,13 @@ class parse_message extends bbcode_firstpass * Use this event to modify the text after it is parsed * * @event core.modify_format_display_text_after - * @var string text The text to parse - * @var string uid The BBCode UID - * @var bool allow_bbcode Allow BBCodes switch - * @var bool allow_magic_url Allow magic urls switch - * @var bool allow_smilies Allow smilies switch - * @var bool update_this_message Update message switch + * @var string text The message text to parse + * @var string uid The bbcode uid + * @var bool allow_bbcode Do we allow bbcodes + * @var bool allow_magic_url Do we allow magic urls + * @var bool allow_smilies Do we allow smilies + * @var bool update_this_message Do we update the internal message + * with the parsed result * @since 3.1.0-a3 */ $vars = array('text', 'uid', 'allow_bbcode', 'allow_magic_url', 'allow_smilies', 'update_this_message'); From 121f2394ff92c7497f2f2a11913d02570695e8e4 Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Tue, 17 Dec 2013 18:55:59 -0800 Subject: [PATCH 37/37] [ticket/12060] A little less verbose cleanup of event docblocks PHPBB3-12060 --- phpBB/includes/message_parser.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/phpBB/includes/message_parser.php b/phpBB/includes/message_parser.php index 080c755965..b29f587385 100644 --- a/phpBB/includes/message_parser.php +++ b/phpBB/includes/message_parser.php @@ -168,11 +168,11 @@ class bbcode_firstpass extends bbcode $bbcodes = $this->bbcodes; /** - * Use this event to modify the bbcode data for later parsing + * Event to modify the bbcode data for later parsing * * @event core.modify_bbcode_init - * @var array bbcodes The array of bbcode data for use in parsing - * @var array rowset The array of bbcode data from the database + * @var array bbcodes Array of bbcode data for use in parsing + * @var array rowset Array of bbcode data from the database * @since 3.1.0-a3 */ $vars = array('bbcodes', 'rowset'); @@ -1249,7 +1249,7 @@ class parse_message extends bbcode_firstpass $uid = $this->bbcode_uid; /** - * Use this event to modify the text after it is parsed + * Event to modify the text after it is parsed * * @event core.modify_format_display_text_after * @var string text The message text to parse