/[swish]/trunk/html/swish.cgi
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/html/swish.cgi

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 29 by dpavlin, Mon Mar 24 09:04:57 2003 UTC revision 32 by dpavlin, Wed Apr 30 12:40:09 2003 UTC
# Line 58  foreach (@{$config->{paths}->{path}}) { Line 58  foreach (@{$config->{paths}->{path}}) {
58          $path_label{$_->{limit}} = x($_->{content});          $path_label{$_->{limit}} = x($_->{content});
59  }  }
60    
61    my @properties = split(/\s+/,x($config->{properties}));
62    
63  if ($config->{charset}) {  if ($config->{charset}) {
64          print header(-charset=>x($config->{charset}));          print header(-charset=>x($config->{charset}));
65  } else {  } else {
# Line 69  print popup_menu(-name=>'max_hits',-valu Line 71  print popup_menu(-name=>'max_hits',-valu
71  print x($config->{text}->{documents});  print x($config->{text}->{documents});
72  print textfield('search');  print textfield('search');
73  print submit(-value=> x($config->{text}->{submit}));  print submit(-value=> x($config->{text}->{submit}));
74  print checkbox(-name=>'no_affix', -checked=>0, -label=>x($config->{text}->{no_spell})) if ($spelling_alt);  print br,checkbox(-name=>'no_affix', -checked=>0, -label=>x($config->{text}->{no_spell})) if ($spelling_alt);
75    print checkbox(-name=>'no_properties', -checked=>0, -label=>($config->{text}->{no_properties})) if (@properties);
76  if (@path_name) {  if (@path_name) {
77          print br,x($config->{text}->{limit});          print br,x($config->{text}->{limit});
78          print popup_menu(-name=>'path',-values=>\@path_name,-labels=>\%path_label,-default=>$path);          print popup_menu(-name=>'path',-values=>\@path_name,-labels=>\%path_label,-default=>$path);
# Line 121  if (param('search')) { Line 124  if (param('search')) {
124    
125          my %params;     # optional parametars for swish          my %params;     # optional parametars for swish
126    
127          my @properties = split(/\s+/,x($config->{properties}));          # default format for output
128          $params{properties} = \@properties if (@properties);          my $hit_fmt = "<a href=\"%s\">%s</a> [%s]<br>\n";
129    
130            if (@properties) {
131                    $hit_fmt = x($config->{hit}) if (! param('no_properties'));
132                    $params{properties} = \@properties if (@properties);
133            } else {
134                    $hit_fmt = x($config->{hit}) if (x($config->{hit}));
135            }
136    
137          my $sh = SWISH->connect('Fork',          my $sh = SWISH->connect('Fork',
138                  prog     => x($config->{prog}),                  prog     => x($config->{prog}),
# Line 130  if (param('search')) { Line 140  if (param('search')) {
140                  results  => sub {                  results  => sub {
141                          my ($sh,$hit) = @_;                          my ($sh,$hit) = @_;
142    
                         my $hit_fmt = x($config->{hit}) ||  
                                 "<a href=\"%s\">%s</a> [%s]<br>\n";  
   
143                          if ($config->{url}) {                          if ($config->{url}) {
144                                  printf ($hit_fmt ,"http://".virtual_host().x($config->{url}).$hit->swishdocpath,e($hit->swishtitle) || 'untitled',$hit->swishrank);                                  printf ($hit_fmt ,"http://".virtual_host().x($config->{url}).$hit->swishdocpath,e($hit->swishtitle) || 'untitled',$hit->swishrank, map($hit->$_, @properties));
145                          } else {                          } else {
146                                  printf ($hit_fmt ,$hit->swishdocpath,e($hit->swishtitle) || 'untitled',$hit->swishrank, map($hit->$_, @properties) );                                  printf ($hit_fmt ,$hit->swishdocpath,e($hit->swishtitle) || 'untitled',$hit->swishrank, map($hit->$_, @properties) );
147    

Legend:
Removed from v.29  
changed lines
  Added in v.32

  ViewVC Help
Powered by ViewVC 1.1.26