Skip to content

Commit

Permalink
strings_api.php: Added string_no_break() which encloses the string in…
Browse files Browse the repository at this point in the history
… nobr tags if it contains spaces.

view_all_inc.php: Used string_no_break() to avoid sponsorships splitting on two lines.
relationship_api.php: Added resolution as a title to the status (appears as bubble in firefox and IE).


git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@2781 f5dc347c-c33d-0410-90a0-b07cc1902cb9
  • Loading branch information
vboctor committed Aug 1, 2004
1 parent d8d642f commit 1863284
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
9 changes: 5 additions & 4 deletions core/relationship_api.php
Expand Up @@ -6,7 +6,7 @@
# See the README and LICENSE files for details

# --------------------------------------------------------
# $Id: relationship_api.php,v 1.16 2004-08-01 05:20:08 vboctor Exp $
# $Id: relationship_api.php,v 1.17 2004-08-01 05:53:00 vboctor Exp $
# --------------------------------------------------------

### Relationship API ###
Expand Down Expand Up @@ -392,11 +392,12 @@ function relationship_get_details( $p_bug_id, $p_relationship, $p_html = false,
# get the information from the related bug and prepare the link
$t_bug = bug_prepare_display( bug_get( $t_related_bug_id, true ) );
$t_status = string_attribute( get_enum_element( 'status', $t_bug->status ) );
$t_resolution = string_attribute( get_enum_element( 'resolution', $t_bug->resolution ) );

$t_relationship_info_html = $t_relationship_descr . '</td>';
$t_relationship_info_html = '<nobr>' . $t_relationship_descr . '</nobr></td>';
if ( $p_html_preview == false ) {
$t_relationship_info_html .= '<td><a href="' . string_get_bug_view_url( $t_related_bug_id ) . '">' . bug_format_id( $t_related_bug_id ) . '</a></td>';
$t_relationship_info_html .= '<td bgcolor="' . get_status_color( $t_bug->status ) . '">' . $t_status . '&nbsp;</td>' . $t_td;
$t_relationship_info_html .= '<td><a title="' . $t_resolution . '"><u>' . $t_status . '</u>&nbsp;</a></td>' . $t_td;
}
else {
$t_relationship_info_html .= $t_td . bug_format_id( $t_related_bug_id ) . '</td>';
Expand Down Expand Up @@ -498,7 +499,7 @@ function relationship_get_summary_html_preview( $p_bug_id ) {
}

if ( relationship_can_resolve_bug( $p_bug_id ) == false ) {
$t_summary .= '<tr class="print"><td class="print" colspan=5><b>' . lang_get( 'relationship_warning_blocking_bugs_not_resolved' ) . '</b></td></tr>';
$t_summary .= '<tr class="print"><td class="print" colspan="5"><b>' . lang_get( 'relationship_warning_blocking_bugs_not_resolved' ) . '</b></td></tr>';
}

if ( !is_blank( $t_summary ) ) {
Expand Down
12 changes: 11 additions & 1 deletion core/string_api.php
Expand Up @@ -6,7 +6,7 @@
# See the README and LICENSE files for details

# --------------------------------------------------------
# $Id: string_api.php,v 1.55 2004-07-22 13:42:02 vboctor Exp $
# $Id: string_api.php,v 1.56 2004-08-01 05:53:00 vboctor Exp $
# --------------------------------------------------------

$t_core_dir = dirname( __FILE__ ).DIRECTORY_SEPARATOR;
Expand Down Expand Up @@ -46,6 +46,16 @@ function string_preserve_spaces_at_bol( $p_string ) {
}
return implode( "\n", $lines );
}
# --------------------
# Prepare a string to be printed without being broken into multiple lines
function string_no_break( $p_string ) {
if ( strpos( $p_string, ' ' ) !== false ) {
return "<nobr>$p_string</nobr>";
} else {
return $p_string;
}
}

# --------------------
# Prepare a string for display to HTML
function string_display( $p_string ) {
Expand Down
5 changes: 3 additions & 2 deletions view_all_inc.php
Expand Up @@ -6,7 +6,7 @@
# See the README and LICENSE files for details

# --------------------------------------------------------
# $Id: view_all_inc.php,v 1.141 2004-05-26 05:25:18 int2str Exp $
# $Id: view_all_inc.php,v 1.142 2004-08-01 05:53:01 vboctor Exp $
# --------------------------------------------------------
?>
<?php
Expand Down Expand Up @@ -241,7 +241,8 @@
if ( $t_enable_sponsorship == ON ) {
echo "\t<td class=\"right\">";
if ( $v_sponsorship_total > 0 ) {
echo sponsorship_format_amount( $v_sponsorship_total );
$t_sponsorship_amount = sponsorship_format_amount( $v_sponsorship_total );
echo string_no_break( $t_sponsorship_amount );
}
echo "</td>\n";
}
Expand Down

0 comments on commit 1863284

Please sign in to comment.