r1846@llin: dpavlin | 2009-04-26 00:26:04 +0200
[webpac2] / vhost / webpac2.cgi
index 84b6a16..8cadc19 100755 (executable)
@@ -76,9 +76,13 @@ sub show_pager {
 }
 
 my $path = $ENV{PATH_INFO} || 'ecas';
+$path =~ s{^/+}{};
+$path =~ s{/+$}{};
 my $dir = $0;
 $dir =~ s{/[^/]+.cgi}{};
 
+dump_yaml( 'dir', $dir );
+
 my $config = YAML::LoadFile( "$dir/$path/config.yml" );
 
 my $database = (keys %{ $config->{databases} })[0];
@@ -133,10 +137,14 @@ foreach ( @{ $db->{input} } ) {
 
 warn "## only_input = ", dump( $only_input );
 
+my @style = ( '../../style.css' );
+push @style, "../../$path/$path.css" if -e "$dir/$path/$path.css";
+dump_yaml( 'style', \@style );
+
 print
        start_html(
                -title => $db->{name},
-               -style => '../../style.css',
+               -style => [ @style ],
        ),
        h1( $db->{name} ),
        qq|<div id=description>|, $db->{description}, qq|</div>|,