print "<p><a href='".buildExcept( 'action', $args )."?action=newhistory'>Discuss</a>\n";
print "</div>\n" if( $diss );
}
- my $url_prefix = $args->{'full_links'} ? 'http://'.$req->hostname() : '';
unless( $address->leaf() ) {
print "<h2>Sub-items</h2>\n";
my $restricts = $address->defaultRestrictList();
print "<p>";
my $url = '/read/'.$address->get().buildExcept( 'restrict', $args ).'?restrict=';
foreach( @{$restricts} ) {
- print "<a href='".$url_prefix.$url.$_->[0]."'>".$_->[1]."</a> ";
+ print "<a href='".$url.$_->[0]."'>".$_->[1]."</a> ";
}
}
my $url = '/read/'.$address->get().buildExcept( 'sort', $args );
my $sort = ( $args->{'sort'} or 'id' );
my( $sort_id, $sort_name ) = ( ( $sort eq 'id' ? 'rid' : 'id' ), ( $sort eq 'name' ? 'rname' : 'name' ) );
- genTableHead( 'subnodes', [ '<a href="'.$url_prefix.$url.'?sort='.$sort_id.'">Id</a>', '<a href="'.$url_prefix.$url.'?sort='.$sort_name.'">Name</a>', 'Note' ], [ 'id-col', 'name-col', 'note-col' ] );
+ genTableHead( 'subnodes', [ '<a href="'.$url.'?sort='.$sort_id.'">Id</a>', '<a href="'.$url.'?sort='.$sort_name.'">Name</a>', 'Note' ], [ 'id-col', 'name-col', 'note-col' ] );
$args->{'restrict'} = $address->defaultRestrict() unless( defined( $args->{'restrict'} ) );
- $tables->nodes( $address->get(), $args, $url_prefix );
+ $tables->nodes( $address->get(), $args );
genTableTail();
}
genHtmlTail();
return bless PciIds::DBQ::new( $dbh );
}
-sub formatLink( $$ ) {
+sub formatLink( $ ) {
my $address = PciIds::Address::new( shift );
- my $url_prefix = shift;
- return '<a href="'.$url_prefix.'/read/'.$address->get().'">'.$address->tail().'</a>';
+ return '<a href="/read/'.$address->get().'">'.$address->tail().'</a>';
}
-sub nodes( $$$$ ) {
- my( $self, $parent, $args, $url_prefix ) = @_;
+sub nodes( $$$ ) {
+ my( $self, $parent, $args ) = @_;
my $restrict = $args->{'restrict'};
$restrict = '' unless( defined $restrict );
$restrict = PciIds::Address::new( $parent )->restrictRex( $restrict );#How do I know if the restrict is OK?
- htmlFormatTable( PciIds::DBQ::nodes( $self, $parent, $args, $restrict ), 3, [], [ sub {
- return formatLink( shift, $url_prefix );
- }, ], sub { 1; }, sub {
+ htmlFormatTable( PciIds::DBQ::nodes( $self, $parent, $args, $restrict ), 3, [], [ \&formatLink ], sub { 1; }, sub {
my $name = shift->[ 1 ];
return ' class="'.( defined $name && $name ne '' ? 'item' : 'unnamedItem' ).'"';
} );