]> mj.ucw.cz Git - pciids.git/blob - PciIds/Html/Tables.pm
Use empty URLs for POST forms
[pciids.git] / PciIds / Html / Tables.pm
1 package PciIds::Html::Tables;
2 use strict;
3 use warnings;
4 use base 'PciIds::DBQ';
5 use PciIds::Html::Format;
6 use PciIds::Address;
7
8 sub new( $ ) {
9         my( $dbh ) = @_;
10         return bless PciIds::DBQ::new( $dbh );
11 }
12
13 sub formatLink( $ ) {
14         my $address = PciIds::Address::new( shift );
15         return '<a href="/read/'.$address->get().'">'.$address->tail().'</a>';
16 }
17
18 sub nodes( $$$ ) {
19         my( $self, $parent, $args ) = @_;
20         my $restrict = $args->{'restrict'};
21         $restrict = '' unless( defined $restrict );
22         $restrict = PciIds::Address::new( $parent )->restrictRex( $restrict );#How do I know if the restrict is OK?
23         htmlFormatTable( PciIds::DBQ::nodes( $self, $parent, $args, $restrict ), 3, [], [ \&formatLink ], sub { 1; }, sub { return ' class="'.( defined( shift->[ 3 ] ) ? 'item' : 'unnamedItem' ).'"'; } );
24 }
25
26 1;