diff options
author | rxu <rxu@mail.ru> | 2017-08-16 21:57:11 +0700 |
---|---|---|
committer | rxu <rxu@mail.ru> | 2017-08-16 22:38:34 +0700 |
commit | 68c3a0307de19fdefd7ae716247fffea3ee30c0c (patch) | |
tree | afd71fa73e5ca48d7655eac68cea6517bffc8712 /phpBB/includes/functions_posting.php | |
parent | 1e605efaf126f5474bb1be99e7fdaed834ebb2a0 (diff) | |
download | forums-68c3a0307de19fdefd7ae716247fffea3ee30c0c.tar forums-68c3a0307de19fdefd7ae716247fffea3ee30c0c.tar.gz forums-68c3a0307de19fdefd7ae716247fffea3ee30c0c.tar.bz2 forums-68c3a0307de19fdefd7ae716247fffea3ee30c0c.tar.xz forums-68c3a0307de19fdefd7ae716247fffea3ee30c0c.zip |
[ticket/15324] Add more core and template events
PHPBB3-15324
Diffstat (limited to 'phpBB/includes/functions_posting.php')
-rw-r--r-- | phpBB/includes/functions_posting.php | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/phpBB/includes/functions_posting.php b/phpBB/includes/functions_posting.php index afa4bb56c4..d9f395efb3 100644 --- a/phpBB/includes/functions_posting.php +++ b/phpBB/includes/functions_posting.php @@ -712,7 +712,7 @@ function posting_gen_inline_attachments(&$attachment_data) */ function posting_gen_attachment_entry($attachment_data, &$filename_data, $show_attach_box = true) { - global $template, $config, $phpbb_root_path, $phpEx, $user; + global $template, $config, $phpbb_root_path, $phpEx, $user, $phpbb_dispatcher; // Some default template variables $template->assign_vars(array( @@ -730,6 +730,7 @@ function posting_gen_attachment_entry($attachment_data, &$filename_data, $show_a foreach ($attachment_data as $count => $attach_row) { $hidden = ''; + $attachrow_template_vars = array(); $attach_row['real_filename'] = utf8_basename($attach_row['real_filename']); foreach ($attach_row as $key => $value) @@ -739,7 +740,7 @@ function posting_gen_attachment_entry($attachment_data, &$filename_data, $show_a $download_link = append_sid("{$phpbb_root_path}download/file.$phpEx", 'mode=view&id=' . (int) $attach_row['attach_id'], true, ($attach_row['is_orphan']) ? $user->session_id : false); - $template->assign_block_vars('attach_row', array( + $attachrow_template_vars[(int) $attach_row['attach_id']] = array( 'FILENAME' => utf8_basename($attach_row['real_filename']), 'A_FILENAME' => addslashes(utf8_basename($attach_row['real_filename'])), 'FILE_COMMENT' => $attach_row['attach_comment'], @@ -749,9 +750,22 @@ function posting_gen_attachment_entry($attachment_data, &$filename_data, $show_a 'FILESIZE' => get_formatted_filesize($attach_row['filesize']), 'U_VIEW_ATTACHMENT' => $download_link, - 'S_HIDDEN' => $hidden) + 'S_HIDDEN' => $hidden, ); } + + /** + * Modify inline attachments template vars + * + * @event core.modify_inline_attachments_template_vars + * @var array attachment_data Array containing attachments data + * @var array attachrow_template_vars Array containing attachments template vars + * @since 3.2.2-RC1 + */ + $vars = array('attachment_data', 'attachrow_template_vars'); + extract($phpbb_dispatcher->trigger_event('core.modify_inline_attachments_template_vars', compact($vars))); + + $template->assign_block_vars_array('attach_row', $attachrow_template_vars); } return sizeof($attachment_data); |