Diff for /loncom/interface/lonsearchcat.pm between versions 1.201 and 1.203

version 1.201, 2004/01/02 16:34:03 version 1.203, 2004/01/15 03:18:19
Line 359  my $totalfound; Line 359  my $totalfound;
   
 sub course_search {  sub course_search {
     my $r=shift;      my $r=shift;
     my $bodytag=&Apache::loncommon::bodytag('Course Search');      my $bodytag=&Apache::loncommon::bodytag('Course Search').
    &Apache::loncommon::help_open_bug('Searching');
     my $pretty_search_string = '<b>'.$ENV{'form.courseexp'}.'</b>';      my $pretty_search_string = '<b>'.$ENV{'form.courseexp'}.'</b>';
     my $search_string = $ENV{'form.courseexp'};      my $search_string = $ENV{'form.courseexp'};
     my @New_Words;      my @New_Words;
Line 375  sub course_search { Line 376  sub course_search {
     my @allwords=($search_string,@New_Words);      my @allwords=($search_string,@New_Words);
     $totalfound=0;      $totalfound=0;
     $r->print('<html><head><title>LON-CAPA Course Search</title></head>'.      $r->print('<html><head><title>LON-CAPA Course Search</title></head>'.
       $bodytag.$pretty_search_string);        $bodytag.'<hr /><center><font size="+2" face="arial">'.$pretty_search_string.'</font></center><hr />');
     $r->rflush();      $r->rflush();
 # ======================================================= Go through the course  # ======================================================= Go through the course
     undef %alreadyseen;      undef %alreadyseen;
Line 468  Returns a scalar which holds html for th Line 469  Returns a scalar which holds html for th
   
 sub print_basic_search_form{  sub print_basic_search_form{
     my ($r,$closebutton,$hidden_fields) = @_;      my ($r,$closebutton,$hidden_fields) = @_;
     my $bodytag=&Apache::loncommon::bodytag('Search');      my $bodytag=&Apache::loncommon::bodytag('Search').
    &Apache::loncommon::help_open_topic('Finding_Resources').
    &Apache::loncommon::help_open_bug('Searching');
     my $scrout=<<"ENDDOCUMENT";      my $scrout=<<"ENDDOCUMENT";
 <html>  <html>
 <head>  <head>
Line 629  ENDHEADER Line 632  ENDHEADER
     $scrout.='<table>';      $scrout.='<table>';
     $scrout.="<tr><th>".&mt('Field').'</th><th>'.&mt('Value').'</th><th>'      $scrout.="<tr><th>".&mt('Field').'</th><th>'.&mt('Value').'</th><th>'
  .&mt('Related').'<br />'.&mt('Words')."</td></tr>\n";   .&mt('Related').'<br />'.&mt('Words')."</td></tr>\n";
     foreach ('title','author','keywords','notes','abstract','standards',      foreach ('title','author','owner','authorspace','modifyinguser',
        'keywords','notes','abstract','standards',
      'lowestgradelevel','highestgradelevel','mime') {       'lowestgradelevel','highestgradelevel','mime') {
  $scrout.='<tr bgcolor="#FFFFBB"><td>'.&titlefield($fields{$_}).'</td><td>'.   $scrout.='<tr bgcolor="#FFFFBB"><td>'.&titlefield($fields{$_}).'</td><td>'.
     &Apache::lonmeta::prettyinput($_,$ENV{'form.'.$_},$_,'advsearch',      &Apache::lonmeta::prettyinput($_,$ENV{'form.'.$_},$_,'advsearch',
   1,'</td><td>',$ENV{'form.'.$_.'_related'}).    1,'</td><td>',$ENV{'form.'.$_.'_related'}).
     '</td></tr>';      '</td></tr>';
     }      }
       $scrout.='<tr bgcolor="#FFFFBB"><td>'.
    &titlefield(&mt('MIME Type Category')).'</td><td>'. 
       &Apache::loncommon::filecategoryselect('category',
      $ENV{'form.category'}).
       '</td><td>&nbsp;</td></td></tr>';
       $scrout.='<tr bgcolor="#FFFFBB"><td>'.
    &titlefield(&mt('Limit Search to Domains')).'</td><td>'. 
       &Apache::loncommon::domain_select('domains',
      $ENV{'form.domains'},1).
       '</td><td>&nbsp;</td></td></tr>';
     my %dates=&Apache::lonlocal::texthash('creationdatestart'     => 'Creation Date After',      my %dates=&Apache::lonlocal::texthash('creationdatestart'     => 'Creation Date After',
     'creationdateend'       => 'Creation Date Before',      'creationdateend'       => 'Creation Date Before',
   'lastrevisiondatestart' => 'Last Revision Date After',    'lastrevisiondatestart' => 'Last Revision Date After',
   'lastrevisiondateend'   => 'Last Revision Date Before');    'lastrevisiondateend'   => 'Last Revision Date Before');
     foreach (sort keys %dates) {      foreach (sort keys %dates) {
  $scrout.='<tr><td>'.&titlefield($dates{$_}).'</td><td>'.    $scrout.='<tr bgcolor="#FFFFBB"><td>'.&titlefield($dates{$_}).'</td><td>'. 
     &Apache::lonhtmlcommon::date_setter('advsearch',$_,0,'',1).      &Apache::lonhtmlcommon::date_setter('advsearch',$_,0,'',1).
     '</td><td>&nbsp;</td></td></tr>';      '</td><td>&nbsp;</td></td></tr>';
     }      }
       
   
   
     # Hack - an empty table row.  
     $scrout.="<tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>\n";  
 #    $scrout.=&searchphrasefield('file<br />extension','extension',  
 #                        $ENV{'form.extension'});  
 #    $scrout.="<tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>\n";  
 #    $scrout.=&searchphrasefield('publisher<br />owner','owner',  
  # $ENV{'form.owner'});  
     $scrout.="</table>\n";      $scrout.="</table>\n";
 #    $scrout.=&Apache::lonmeta::selectbox('File Category','category',  
 # $ENV{'form.category'},  
 # 'any','Any category',  
 # undef,  
 # (&Apache::loncommon::filecategories()));  
     #----------------------------------------------------------------  
     # Allow restriction to multiple domains.  
     #   I make the crazy assumption that there will never be a domain 'any'.  
     #  
     my @allowed_domains = (ref($ENV{'form.domains'}) ? @{$ENV{'form.domains'}}   
                            :  ($ENV{'form.domains'}) );  
     my %domain_hash = ();  
     foreach (@allowed_domains) {  
         $domain_hash{$_}++;  
     }  
     my @domains =&Apache::loncommon::get_domains();  
     # adjust the size of the select box  
     my $size = 4;  
     $size = (scalar @domains < ($size - 1) ? scalar @domains + 1 : $size);  
     $scrout.="\n".&titlefield(&mt('Domain to be searched')).  
             '<select name="domains" size="'.$size.'" multiple>'."\n".  
                 '<option name="any" value="any" '.  
                     ($domain_hash{'any'}? 'selected ' :'').  
                         '>all domains</option>'."\n";  
     foreach my $dom (sort @domains) {  
         $scrout.="<option name=\"$dom\" ".  
             ($domain_hash{$dom} ? 'selected ' :'').">$dom</option>\n";  
     }  
     $scrout.="</select>\n";  
   
 # ------------------------------------------- Compute customized metadata field  
 #    $scrout.=<<CUSTOMMETADATA;  
 #<p>  
 #<font color="#800000" face="helvetica"><b>LIMIT BY SPECIAL METADATA FIELDS:</b>  
 #</font>  
 #For resource-specific metadata, enter in an expression in the form of   
 #<i>key</i>=<i>value</i> separated by operators such as AND, OR or NOT.<br />  
 #<b>Example:</b> grandmother=75 OR grandfather=85  
 #<br />  
 #CUSTOMMETADATA  
 #    $scrout.=&simpletextfield('custommetadata',$ENV{'form.custommetadata'});  
 #    $scrout.=<<CUSTOMSHOW;  
 #<p>  
 #<font color="#800000" face="helvetica"><b>SHOW SPECIAL METADATA FIELDS:</b>  
 #</font>  
 #Enter in a space-separated list of special metadata fields to show  
 #in a fielded listing for each record result.  
 #<br />  
 #CUSTOMSHOW  
 #    $scrout.=&simpletextfield('customshow',$ENV{'form.customshow'});  
     $scrout.=<<ENDDOCUMENT;      $scrout.=<<ENDDOCUMENT;
 $advanced_buttons  $advanced_buttons
 </form>  </form>

Removed from v.1.201  
changed lines
  Added in v.1.203


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