Diff for /loncom/interface/lonsearchcat.pm between versions 1.130 and 1.131

version 1.130, 2002/06/26 16:04:13 version 1.131, 2002/06/26 18:19:41
Line 273  sub basic_search_form{ Line 273  sub basic_search_form{
 $hidden  $hidden
 <h3>Basic Search</h3>  <h3>Basic Search</h3>
 <p>  <p>
 Enter terms or quoted phrases separated by AND, OR, or NOT   Enter terms or phrases separated by AND, OR, or NOT 
 then press SEARCH below.  then press SEARCH below.
 </p>  </p>
 <p>  <p>
Line 346  END Line 346  END
 <img align='right' src='/adm/lonIcons/lonlogos.gif' />  <img align='right' src='/adm/lonIcons/lonlogos.gif' />
 <h1>Advanced Catalog Search</h1>  <h1>Advanced Catalog Search</h1>
 <hr />  <hr />
 Enter terms or quoted phrases separated by search operators   Enter terms or phrases separated by search operators 
 such as AND, OR, or NOT.<br />  such as AND, OR, or NOT.<br />
 <form method="post" action="/adm/searchcat">  <form method="post" action="/adm/searchcat">
 $advanced_buttons  $advanced_buttons
Line 388  ENDHEADER Line 388  ENDHEADER
     $scrout.=&searchphrasefield('publisher<br />owner','owner',      $scrout.=&searchphrasefield('publisher<br />owner','owner',
  $ENV{'form.owner'});   $ENV{'form.owner'});
     $scrout.="</table>\n";      $scrout.="</table>\n";
 #    $ENV{'form.mime'}='any' unless length($ENV{'form.mime'});      $ENV{'form.category'}='any' unless length($ENV{'form.category'});
 #    $scrout.=&selectbox('Limit by MIME type','mime',      $scrout.=&selectbox('Limit by file category','category',
 # $ENV{'form.mime'},   $ENV{'form.category'},
 # 'any','Any type',   'any','Any category',
 # \&{Apache::loncommon::filedescriptionex},   undef,
 # (&Apache::loncommon::fileextensions));   (&Apache::loncommon::filecategories()));
     $ENV{'form.language'}='any' unless length($ENV{'form.language'});      $ENV{'form.language'}='any' unless length($ENV{'form.language'});
     $scrout.=&selectbox('Limit by language','language',      $scrout.=&selectbox('Limit by language','language',
  $ENV{'form.language'},'any','Any Language',   $ENV{'form.language'},'any','Any Language',
Line 667  sub selectbox { Line 667  sub selectbox {
     if (! defined($functionref)) { $functionref = sub { $_[0]}; }      if (! defined($functionref)) { $functionref = sub { $_[0]}; }
     my $uctitle=uc($title);      my $uctitle=uc($title);
     my $selout="\n".'<p><font color="#800000" face="helvetica">'.      my $selout="\n".'<p><font color="#800000" face="helvetica">'.
         '<b>'.$uctitle.':</b></font><br /><select name="'.$name.'">';          '<b>'.$uctitle.': </b></font><select name="'.$name.'">';
     foreach ($anyvalue,@idlist) {      foreach ($anyvalue,@idlist) {
         $selout.='<option value="'.$_.'"';          $selout.='<option value="'.$_.'"';
         if ($_ eq $default and !/^any$/) {          if ($_ eq $default and !/^any$/) {
Line 706  sub advancedsearch { Line 706  sub advancedsearch {
    'lastrevisiondatestart_year','lastrevisiondateend_month',     'lastrevisiondatestart_year','lastrevisiondateend_month',
    'lastrevisiondateend_day','lastrevisiondateend_year',     'lastrevisiondateend_day','lastrevisiondateend_year',
    'notes','abstract','mime','language','owner',     'notes','abstract','mime','language','owner',
    'custommetadata','customshow') {     'custommetadata','customshow','category') {
  $ENV{"form.$field"}=~s/[^\w\/\s\(\)\=\-\"\']//g;   $ENV{"form.$field"}=~s/[^\w\/\s\(\)\=\-\"\']//g;
     }      }
     foreach ('mode','form','element') {      foreach ('mode','form','element') {
Line 715  sub advancedsearch { Line 715  sub advancedsearch {
  $ENV{"form.$_"}=&Apache::lonnet::unescape($ENV{"form.$_"});   $ENV{"form.$_"}=&Apache::lonnet::unescape($ENV{"form.$_"});
  $ENV{"form.$_"}=~s/[^\w\/\s\(\)\=\-\"\']//g;   $ENV{"form.$_"}=~s/[^\w\/\s\(\)\=\-\"\']//g;
     }      }
       # Preprocess the category form element.
       if ($ENV{'form.category'} ne 'any') {
           my @extensions = &Apache::loncommon::filecategorytypes
               ($ENV{'form.category'});
           $ENV{'form.mime'} = join ' OR ',@extensions;
       }
     # Check to see if enough information was filled in      # Check to see if enough information was filled in
     for my $field ('title','author','subject','keywords','url','version',      for my $field ('title','author','subject','keywords','url','version',
    'notes','abstract','mime','language','owner',     'notes','abstract','mime','language','owner',
Line 735  sub advancedsearch { Line 741  sub advancedsearch {
        'keywords','version','owner','mime') {         'keywords','version','owner','mime') {
  if ($ENV{'form.'.$field}) {   if ($ENV{'form.'.$field}) {
     push @queries,&build_SQL_query($field,$ENV{'form.'.$field});      push @queries,&build_SQL_query($field,$ENV{'form.'.$field});
  }          }
     }      }
     # Evaluate option lists      # Evaluate option lists
     if ($ENV{'form.language'} and $ENV{'form.language'} ne 'any') {      if ($ENV{'form.language'} and $ENV{'form.language'} ne 'any') {
  push @queries,"(language like \"$ENV{'form.language'}\")";   push @queries,"(language like \"$ENV{'form.language'}\")";
     }      }
 #    if ($ENV{'form.mime'} and $ENV{'form.mime'} ne 'any') {  
 # push @queries,"(mime like \"$ENV{'form.mime'}\")";  
 #    }  
     if ($ENV{'form.copyright'} and $ENV{'form.copyright'} ne 'any') {      if ($ENV{'form.copyright'} and $ENV{'form.copyright'} ne 'any') {
  push @queries,"(copyright like \"$ENV{'form.copyright'}\")";   push @queries,"(copyright like \"$ENV{'form.copyright'}\")";
     }      }

Removed from v.1.130  
changed lines
  Added in v.1.131


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>