From 09953197410072908a7e6b246e18369206b17d90 Mon Sep 17 00:00:00 2001 From: Chris Fitch Date: Tue, 13 Oct 2009 16:50:29 -0400 Subject: [PATCH] Add config option for preformatted long text diff --git a/bug_revision_view_page.php b/bug_revision_view_page.php index fe56781..a707825 100644 --- a/bug_revision_view_page.php +++ b/bug_revision_view_page.php @@ -114,7 +114,13 @@ $t_by_string = sprintf( lang_get( 'revision_by' ), string_display_line( date( co > - +" . string_display_links( $t_revision['value'] ) . "");; +} else { + echo string_display_links( $t_revision['value'] );; +} +?> steps_to_reproduce ) : ''; $tpl_additional_information = $tpl_show_additional_information ? string_display_links( $tpl_bug->additional_information ) : ''; + if ( ON == config_get( 'preformatted_long_text' ) ) { + $tpl_description = string_nl2br("
" . $tpl_description . "
"); + $tpl_steps_to_reproduce = string_nl2br("
" . $tpl_steps_to_reproduce . "
"); + $tpl_additional_information = string_nl2br("
" . $tpl_additional_information . "
"); + } + $tpl_links = event_signal( 'EVENT_MENU_ISSUE', $f_bug_id ); # diff --git a/bugnote_view_inc.php b/bugnote_view_inc.php index 6d4775b..6ded840 100644 --- a/bugnote_view_inc.php +++ b/bugnote_view_inc.php @@ -197,7 +197,11 @@ $num_notes = count( $t_bugnotes ); break; } - echo string_display_links( $t_bugnote->note );; + if ( ON == $g_preformatted_long_text ) { + echo string_nl2br("
" . string_display_links( $t_bugnote->note ) . "
");; + } else { + echo string_display_links( $t_bugnote->note );; + } ?> diff --git a/config_defaults_inc.php b/config_defaults_inc.php index a97c221..4a94956 100644 --- a/config_defaults_inc.php +++ b/config_defaults_inc.php @@ -1713,6 +1713,14 @@ */ $g_wrap_in_preformatted_text = ON; + /** + * This flag controls whether long text fields (description, bugnotes, + * etc.) are displayed on the view page as preformatted text. + * @global int $g_preformatted_long_text + */ + $g_preformatted_long_text = OFF; + + /************************ * MantisBT HR Settings * ************************/ -- 1.6.0.4