Skip to content

Commit

Permalink
Fix #13236: Added event 'EVENT_VIEW_BUG_ATTACHMENT'
Browse files Browse the repository at this point in the history
Allows printing HTML code after each attachment.

Moved the event definition with other bug-related events.
  • Loading branch information
dregad committed Sep 21, 2012
2 parents 8ae62f3 + bc3701b commit 3eb0430
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions core/events_inc.php
Expand Up @@ -82,6 +82,7 @@
# Bug view events
'EVENT_VIEW_BUG_DETAILS' => EVENT_TYPE_EXECUTE,
'EVENT_VIEW_BUG_EXTRA' => EVENT_TYPE_EXECUTE,
'EVENT_VIEW_BUG_ATTACHMENT' => EVENT_TYPE_OUTPUT,
'EVENT_VIEW_BUGNOTES_START' => EVENT_TYPE_EXECUTE,
'EVENT_VIEW_BUGNOTE' => EVENT_TYPE_EXECUTE,
'EVENT_VIEW_BUGNOTES_END' => EVENT_TYPE_EXECUTE,
Expand Down
1 change: 1 addition & 0 deletions core/print_api.php
Expand Up @@ -1541,6 +1541,7 @@ function print_bug_attachment_header( $p_attachment ) {
}
echo lang_get( 'word_separator' ) . '(' . number_format( $p_attachment['size'] ) . lang_get( 'word_separator' ) . lang_get( 'bytes' ) . ')';
echo lang_get( 'word_separator' ) . '<span class="italic">' . date( config_get( 'normal_date_format' ), $p_attachment['date_added'] ) . '</span>';
event_signal('EVENT_VIEW_BUG_ATTACHMENT', array($p_attachment));
} else {
print_file_icon( $p_attachment['display_name'] );
echo lang_get( 'word_separator' ) . '<span class="strike">' . string_display_line( $p_attachment['display_name'] ) . '</span>' . lang_get( 'word_separator' ) . '(' . lang_get( 'attachment_missing' ) . ')';
Expand Down
13 changes: 13 additions & 0 deletions docbook/Developers_Guide/en-US/Events_Reference_Output.xml
Expand Up @@ -407,5 +407,18 @@
</blockquote>
</blockquote>

<blockquote id="dev.eventref.output.layout.bodyend">
<title>EVENT_VIEW_BUG_ATTACHMENT (Output)</title>
<blockquote>
<para>
This event allows plugins to output HTML code immediately after the line of an attachment.
</para>

<itemizedlist>
<title>Return Value</title>
<listitem><para>String: HTML code to output.</para></listitem>
</itemizedlist>
</blockquote>
</blockquote>
</sect2>
</sect1>

0 comments on commit 3eb0430

Please sign in to comment.