]> mj.ucw.cz Git - pciids.git/blobdiff - PciIds/Html/Help.pm
Help about ID syntak
[pciids.git] / PciIds / Html / Help.pm
index 803d922ce23eb20c0f5714511e209a44eeb9383e..4a361d7e0d140f02a8735d6af95c19c9dba3bedf 100644 (file)
@@ -18,13 +18,15 @@ sub getHelp( $$ ) {
        chomp $head;
        genHtmlHead( $req, $head, undef );
        my $addr = PciIds::Address::new( $req->uri() );
-       print "<h1>$head (".$addr->pretty().")</h1>\n";
+       print "<h1>$head".( defined $addr ? " (".$addr->pretty().")" : "" )."</h1>\n";
        genMenu( $req, $addr, $args, $auth, undef );
        genPath( $req, $addr, 1 );
-       my $url = '/read'.$req->uri().buildExcept( 'help', $args ).'?help=';
-       print "<div class='navigation'><ul><li><a href='$url=index'>Help index</a></ul></div>\n" if( $helpname ne 'index' );
+       my $url = setAddrPrefix( $req->uri(), 'read' ).buildExcept( 'help', $args ).'?help=';
+       delete $args->{'help'};
+       my %repls = ( 'HELP_URL' => $url, 'AC_URL' => setAddrPrefix( $req->uri(), 'mods' ).buildExcept( 'action', $args ).'?action=' );
+       print "<div class='navigation'><ul><li><a href='${url}index'>Help index</a></ul></div>\n" if( $helpname ne 'index' );
        while( defined( my $line = <HELP> ) ) {
-               $line =~ s/\$CUR_LINK\$/$url/g;
+               $line =~ s/\$(\w+_URL)\$/$repls{$1}/g;
                print $line;
        }
        close HELP;