1 package PciIds::Html::Tables;
4 use base 'PciIds::DBQ';
5 use PciIds::Html::Format;
10 return bless PciIds::DBQ::new( $dbh );
13 sub formatLink( $$ ) {
14 my $address = PciIds::Address::new( shift );
15 my $url_prefix = shift;
16 return '<a href="'.$url_prefix.'/read/'.$address->get().'">'.$address->tail().'</a>';
20 my( $self, $parent, $args, $url_prefix ) = @_;
21 my $restrict = $args->{'restrict'};
22 $restrict = '' unless( defined $restrict );
23 $restrict = PciIds::Address::new( $parent )->restrictRex( $restrict );#How do I know if the restrict is OK?
24 htmlFormatTable( PciIds::DBQ::nodes( $self, $parent, $args, $restrict ), 3, [], [ sub {
25 return formatLink( shift, $url_prefix );
26 }, ], sub { 1; }, sub {
27 my $name = shift->[ 1 ];
28 return ' class="'.( defined $name && $name ne '' ? 'item' : 'unnamedItem' ).'"';