--- trunk/vhost/webpac2.cgi 2009/04/29 18:06:15 1176
+++ trunk/vhost/webpac2.cgi 2009/05/26 14:55:29 1191
@@ -142,13 +142,8 @@
push @style, "../../$path/$path.css" if -e "$dir/$path/$path.css";
dump_yaml( 'style', \@style );
-print
- start_html(
- -title => $db->{name},
- -style => [ @style ],
- ),
- h1( $db->{name} ),
- qq|
|, $db->{description}, qq|
|,
+sub search_form {
+ qq||,
start_form( -action => self_url( query => 0 ) ),
radio_group(
-name => 'attr',
@@ -170,14 +165,26 @@
-linebreak=> 'true',
),
qq||,
+ end_form,
+ ;
+}
-;
-print end_form;
+print
+ start_html(
+ -title => $db->{name},
+ -style => [ @style ],
+ ),
+ h1( $db->{name} ),
+ qq||, $db->{description}, qq|
|,
+;
if ( my $search = param('search') ) {
- print qq||;
+ print qq|
+
#
+
+ |;
my $swish = SWISH::API->new( "$dir/../var/swish/$database" );
$swish->abort_last_error if $swish->Error;
@@ -202,7 +209,13 @@
$attr . '="' . $template . '"';
;
};
- $v =~ s{(\s*)(\S+)}{rewrite($1,$2)}ge;
+ if ( $op =~ m{\s} ) {
+ my $template = $op;
+ $template =~ s{Q}{$v};
+ $v = $attr . '="' . $template . '"';
+ } else {
+ $v =~ s{(\s*)(\S+)}{rewrite($1,$2)}ge;
+ }
push @search, $v;
@@ -254,7 +267,7 @@
dump_yaml( 'data', $data );
my $li_class = '';
- $li_class = qq| class="z"| if $nr++ % 2 == 0;
+ $li_class = qq| class="z"| if $nr % 2 == 0;
print qq|
|;
foreach my $attr ( @attr ) {
next unless defined $data->{$attr};
@@ -283,6 +296,8 @@
}
+print search_form;
+
dump_yaml( "config databases $database", $db );
dump_yaml( 'html_markup_skip', $html_markup_skip );