profileinfo links now have anchors

Whenever expanding a section in profileinfo, the browser would sent us
to the top again which would force us to browse down to where we were.
Adding basic anchors send the user directly where he was browsing.

Note that HTML5 let you specify anything as an id as long as there is at
least one character.

Change-Id: I5b55297ce25d5c07b29610798fb39eae16d27f6a
This commit is contained in:
Antoine Musso 2012-11-19 15:34:34 +01:00
parent 6cb171925e
commit 78978d410b

View file

@ -192,10 +192,12 @@ class profile_point {
$ex = isset( $expand[$this->name()] );
$anchor = str_replace( '"', '', $this->name() );
if ( !$ex ) {
if ( count( $this->children ) ) {
$url = getEscapedProfileUrl( false, false, $expand + array( $this->name() => true ) );
$extet = ' <a href="' . $url . '">[+]</a>';
$extet = " <a id=\"{$anchor}\" href=\"{$url}#{$anchor}\">[+]</a>";
} else {
$extet = '';
}
@ -206,8 +208,8 @@ class profile_point {
$e += array( $name => $ep );
}
}
$extet = ' <a href="' . getEscapedProfileUrl( false, false, $e ) . '">[]</a>';
$url = getEscapedProfileUrl( false, false, $e );
$extet = " <a id=\"{$anchor}\" href=\"{$url}#{$anchor}\">[]</a>";
}
?>
<tr>