diff options
author | rxu <rxu@mail.ru> | 2014-09-27 09:56:17 +0800 |
---|---|---|
committer | rxu <rxu@mail.ru> | 2014-10-01 21:00:37 +0800 |
commit | a876cc8c26acbde1531890067f1e347ddacbe9fb (patch) | |
tree | eb5087142574a419e40086789e7582b42b416637 /phpBB/includes/functions_content.php | |
parent | 71ac6ab2b87ec1d606d5669b930ac4c7164e9b11 (diff) | |
download | forums-a876cc8c26acbde1531890067f1e347ddacbe9fb.tar forums-a876cc8c26acbde1531890067f1e347ddacbe9fb.tar.gz forums-a876cc8c26acbde1531890067f1e347ddacbe9fb.tar.bz2 forums-a876cc8c26acbde1531890067f1e347ddacbe9fb.tar.xz forums-a876cc8c26acbde1531890067f1e347ddacbe9fb.zip |
[ticket/13108] Add core event to the parse_attachments() function
Add core event to the parse_attachments() function in functions_content.php
to allow modifying/adding attachment template data.
PHPBB3-13108
Diffstat (limited to 'phpBB/includes/functions_content.php')
-rw-r--r-- | phpBB/includes/functions_content.php | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/phpBB/includes/functions_content.php b/phpBB/includes/functions_content.php index f275ed1dd1..25ca50e8f1 100644 --- a/phpBB/includes/functions_content.php +++ b/phpBB/includes/functions_content.php @@ -912,7 +912,7 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count, return; } - global $template, $cache, $user; + global $template, $cache, $user, $phpbb_dispatcher; global $extensions, $config, $phpbb_root_path, $phpEx; // @@ -1187,6 +1187,34 @@ function parse_attachments($forum_id, &$message, &$attachments, &$update_count, ); } + /** + * Use this event to modify the attachment template data. + * + * This event is triggered once per attachment. + * + * @event core.parse_attachments_modify_template_data + * @var array attachment Array with attachment data + * @var array block_array Template data of the attachment + * @var int display_cat Attachment category data + * @var string download_link Attachment download link + * @var array extensions Array with attachment extensions data + * @var mixed forum_id The forum id the attachments are displayed in (false if in private message) + * @var bool preview Flag indicating if we are in post preview mode + * @var array update_count Array with attachment ids to update download count + * @since 3.1.0-RC5 + */ + $vars = array( + 'attachment', + 'block_array', + 'display_cat', + 'download_link', + 'extensions', + 'forum_id', + 'preview', + 'update_count', + ); + extract($phpbb_dispatcher->trigger_event('core.parse_attachments_modify_template_data', compact($vars))); + $template->assign_block_vars('_file', $block_array); $compiled_attachments[] = $template->assign_display('attachment_tpl'); |