From ea006fae81d91a3e271b5798ab146671b59ddca3 Mon Sep 17 00:00:00 2001 From: Michal Vaner Date: Sun, 31 Aug 2008 20:21:20 +0200 Subject: [PATCH] full_link hack is not needed Login is redirected properly now --- PciIds/Html/List.pm | 7 +++---- PciIds/Html/Tables.pm | 13 +++++-------- PciIds/Html/Util.pm | 1 - 3 files changed, 8 insertions(+), 13 deletions(-) diff --git a/PciIds/Html/List.pm b/PciIds/Html/List.pm index d244e4f..a6ba4aa 100644 --- a/PciIds/Html/List.pm +++ b/PciIds/Html/List.pm @@ -63,7 +63,6 @@ sub list( $$$$ ) { print "

Discuss\n"; print "\n" if( $diss ); } - my $url_prefix = $args->{'full_links'} ? 'http://'.$req->hostname() : ''; unless( $address->leaf() ) { print "

Sub-items

\n"; my $restricts = $address->defaultRestrictList(); @@ -71,15 +70,15 @@ sub list( $$$$ ) { print "

"; my $url = '/read/'.$address->get().buildExcept( 'restrict', $args ).'?restrict='; foreach( @{$restricts} ) { - print "".$_->[1]." "; + print "".$_->[1]." "; } } 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', [ 'Id', 'Name', 'Note' ], [ 'id-col', 'name-col', 'note-col' ] ); + genTableHead( 'subnodes', [ 'Id', 'Name', '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(); diff --git a/PciIds/Html/Tables.pm b/PciIds/Html/Tables.pm index e8a42d5..4eab1b3 100644 --- a/PciIds/Html/Tables.pm +++ b/PciIds/Html/Tables.pm @@ -10,20 +10,17 @@ sub new( $ ) { return bless PciIds::DBQ::new( $dbh ); } -sub formatLink( $$ ) { +sub formatLink( $ ) { my $address = PciIds::Address::new( shift ); - my $url_prefix = shift; - return ''.$address->tail().''; + return ''.$address->tail().''; } -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' ).'"'; } ); diff --git a/PciIds/Html/Util.pm b/PciIds/Html/Util.pm index ec6de57..cbfa33f 100644 --- a/PciIds/Html/Util.pm +++ b/PciIds/Html/Util.pm @@ -127,7 +127,6 @@ sub buildExcept( $$ ) { my( $except, $args ) = @_; my %backup = %{$args}; delete $backup{$except}; - delete $backup{'full_links'};#This one is internal return buildArgs( \%backup ); } -- 2.39.2