Skip to content

Commit

Permalink
Remove collapse icons if javascript is disabled (sponsorship / filter…
Browse files Browse the repository at this point in the history
… display).

git-svn-id: http://mantisbt.svn.sourceforge.net/svnroot/mantisbt/trunk@2714 f5dc347c-c33d-0410-90a0-b07cc1902cb9
  • Loading branch information
vboctor committed Jul 18, 2004
1 parent 9b29f2d commit d4d9fcb
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 32 deletions.
8 changes: 3 additions & 5 deletions bug_sponsorship_list_view_inc.php
Expand Up @@ -6,7 +6,7 @@
# See the files README and LICENSE for details

# --------------------------------------------------------
# $Id: bug_sponsorship_list_view_inc.php,v 1.8 2004-07-17 23:52:56 vboctor Exp $
# $Id: bug_sponsorship_list_view_inc.php,v 1.9 2004-07-18 13:22:28 vboctor Exp $
# --------------------------------------------------------
?>
<?php
Expand Down Expand Up @@ -50,8 +50,7 @@
<img src="images/dollars.gif" alt="Sponsor Me" border="0" />
</td>
<td class="form-title" colspan="2">
<a href="" onClick="ToggleDiv( 'sponsorship', g_div_sponsorship ); return false;"
><img border="0" src="images/minus.png" alt="-" /></a>
<?php collapse_icon( 'sponsorship' ); ?>
<?php
echo lang_get( 'users_sponsoring_bug' );

Expand Down Expand Up @@ -123,9 +122,8 @@
<table class="width100" cellspacing="1">
<tr>
<td class="form-title">
<a href="" onClick="ToggleDiv( 'sponsorship', g_div_sponsorship ); return false;"
><img border="0" src="images/plus.png" alt="+" /></a>
<?php
collapse_icon( 'sponsorship' );
echo lang_get( 'users_sponsoring_bug' );

$t_details_url = lang_get( 'sponsorship_process_url' );
Expand Down
6 changes: 5 additions & 1 deletion core/collapse_api.php
Expand Up @@ -6,7 +6,7 @@
# See the README and LICENSE files for details

# --------------------------------------------------------
# $Id: collapse_api.php,v 1.1 2004-07-17 23:52:56 vboctor Exp $
# $Id: collapse_api.php,v 1.2 2004-07-18 13:22:28 vboctor Exp $
# --------------------------------------------------------

$t_core_dir = dirname( __FILE__ ).DIRECTORY_SEPARATOR;
Expand Down Expand Up @@ -73,6 +73,10 @@ function collapse_closed( $p_name ) {
# This is used within both the open and closed section to identify the location where the
# '+'/'-' icon should be placed.
function collapse_icon( $p_name ) {
if ( OFF == config_get( 'use_javascript' ) ) {
return;
}

global $g_open_collapse_section;

if ( $g_open_collapse_section === true ) {
Expand Down
47 changes: 21 additions & 26 deletions core/relationship_api.php
Expand Up @@ -6,11 +6,13 @@
# See the README and LICENSE files for details

# --------------------------------------------------------
# $Id: relationship_api.php,v 1.12 2004-07-18 00:07:44 vboctor Exp $
# $Id: relationship_api.php,v 1.13 2004-07-18 13:22:29 vboctor Exp $
# --------------------------------------------------------

### Relationship API ###

require_once( $t_core_dir . 'collapse_api.php' );

# MASC RELATIONSHIP

# --------------------------------------------------------
Expand Down Expand Up @@ -544,27 +546,14 @@ function relationship_view_box( $p_bug_id ) {
?>
<br/>

<?php if ( ON == config_get( 'use_javascript' ) ) { ?>
<div id="relationships_closed">
<table class="width100" cellspacing="1">
<tr>
<td class="form-title">
<a href="" onClick="ToggleDiv( 'relationships', g_div_relationships ); return false;"
><img border="0" src="images/plus.png" alt="+" /></a>
<?php PRINT lang_get( 'bug_relationships' ) ?>
</td>
</tr>
</table>
</div>
<?php } ?>

<div id="relationships_open">
<?php collapse_open( 'relationships' ); ?>
<table class="width100" cellspacing="1">
<tr class="row-2">
<td width="15%" class="form-title">
<a href="" onClick="ToggleDiv( 'relationships', g_div_relationships ); return false;"
><img border="0" src="images/minus.png" alt="-" /></a>
<?php PRINT lang_get( 'bug_relationships' ) ?>
<?php
collapse_icon( 'relationships' );
echo lang_get( 'bug_relationships' );
?>
</td>
<td><?php PRINT relationship_get_summary_html( $p_bug_id ) ?></td>
</tr>
Expand Down Expand Up @@ -596,16 +585,22 @@ function relationship_view_box( $p_bug_id ) {
}
?>
</table>
</div>

<?php if ( ON == config_get( 'use_javascript' ) ) { ?>
<script type="text/JavaScript">
SetDiv( "relationships", g_div_relationships );
</script>
<?php } ?>
<?php collapse_closed( 'relationships' ); ?>
<table class="width100" cellspacing="1">
<tr>
<td class="form-title">
<?php
collapse_icon( 'relationships' );
echo lang_get( 'bug_relationships' );
?>
</td>
</tr>
</table>

<?php
collapse_end( 'relationships' );
}

# MASC RELATIONSHIP
?>
?>

0 comments on commit d4d9fcb

Please sign in to comment.