Diff for /loncom/interface/lonsearchcat.pm between versions 1.186 and 1.187

version 1.186, 2003/09/22 00:48:32 version 1.187, 2003/09/28 00:14:25
Line 441  sub course_search { Line 441  sub course_search {
    }     }
    &untiehash();     &untiehash();
     unless ($totalfound) {      unless ($totalfound) {
  $r->print('<p>No resources found.</p>');   $r->print('<p>'.&mt('No resources found').'.</p>');
     }      }
 # =================================================== Done going through course  # =================================================== Done going through course
     $r->print('</body></html>');      $r->print('</body></html>');
Line 559  ENDDOCUMENT Line 559  ENDDOCUMENT
     my $relatedcheckbox = &simplecheckbox('related',$ENV{'form.related'});      my $relatedcheckbox = &simplecheckbox('related',$ENV{'form.related'});
     my $domain = $r->dir_config('lonDefDomain');      my $domain = $r->dir_config('lonDefDomain');
     my $domaincheckbox = &simplecheckbox('domains',$domain);      my $domaincheckbox = &simplecheckbox('domains',$domain);
       my $srch=&mt('Search');
       my $header=&mt('Advanced Search');
     $scrout.=<<END;      $scrout.=<<END;
 </td><td><a  </td><td><a
 href="/adm/searchcat?phase=disp_adv&catalogmode=$ENV{'form.catalogmode'}&launch=$ENV{'form.launch'}"  href="/adm/searchcat?phase=disp_adv&catalogmode=$ENV{'form.catalogmode'}&launch=$ENV{'form.launch'}"
 >Advanced Search</a></td></tr>  >$header</a></td></tr>
 <tr><td>$relatedcheckbox use related words</td>  <tr><td>$relatedcheckbox use related words</td>
     <td>$domaincheckbox only search domain <b>$domain</b></td></tr>      <td>$domaincheckbox only search domain <b>$domain</b></td></tr>
 </table>  </table>
 </p>  </p>
 <p>  <p>
 &nbsp;<input type="submit" name="basicsubmit" value='SEARCH' />&nbsp;  &nbsp;<input type="submit" name="basicsubmit" value='$srch' />&nbsp;
 $closebutton  $closebutton
 END  END
     $scrout.=&selectbox(undef,'viewselect',      $scrout.=&selectbox('View','viewselect',
  $ENV{'form.viewselect'},   $ENV{'form.viewselect'},
  undef,undef,undef,   undef,undef,undef,
  sort(keys(%Views)));   sort(keys(%Views)));
     $scrout.=&selectbox(undef,'show',      $scrout.=&selectbox('Per page','show',
  $ENV{'form.show'},   $ENV{'form.show'},
  undef,undef,undef,   undef,undef,undef,
  (10,20,50,100));   (10,20,50,100));
     $scrout.=<<ENDDOCUMENT;      $scrout.=<<ENDDOCUMENT;
 per page.  
 </p>  </p>
 </form>  </form>
 ENDDOCUMENT  ENDDOCUMENT
     }      }
     if ($ENV{'request.course.id'}) {      if ($ENV{'request.course.id'}) {
    my %lt=&Apache::lonlocal::texthash(
      'srch' => 'Search',
                                              'header' => 'Course Search',
    'note' => 'Enter terms or phrases, then press "Search" below',
      );
         $scrout.=(<<ENDCOURSESEARCH);          $scrout.=(<<ENDCOURSESEARCH);
 <hr />  <hr />
 <h1>Course Search</h1>      <h1>$lt{'header'}</h1>    
 <form method="post" action="/adm/searchcat">  <form method="post" action="/adm/searchcat">
 <input type="hidden" name="phase" value="course_search" />  <input type="hidden" name="phase" value="course_search" />
 $hidden_fields  $hidden_fields
 <p>  <p>
 Enter terms or phrases, then press SEARCH below.  $lt{'note'}.
 </p>  </p>
 <p>  <p>
 <table>  <table>
Line 610  ENDCOURSESEARCH Line 616  ENDCOURSESEARCH
 <tr><td>$relcheckbox use related words</td><td></td></tr>  <tr><td>$relcheckbox use related words</td><td></td></tr>
 <tr><td>$crscheckbox fulltext search (time consuming)</td><td></td></tr>  <tr><td>$crscheckbox fulltext search (time consuming)</td><td></td></tr>
 </table><p>  </table><p>
 &nbsp;<input type="submit" name="coursesubmit" value='SEARCH' />  &nbsp;<input type="submit" name="coursesubmit" value='$lt{'srch'}' />
 </p>  </p>
 ENDENDCOURSE  ENDENDCOURSE
     }      }
Line 682  ENDHEADER Line 688  ENDHEADER
  undef,undef,undef,   undef,undef,undef,
  (10,20,50,100));   (10,20,50,100));
     $scrout.='&nbsp;'.      $scrout.='&nbsp;'.
         '<font color="#800000" face="helvetica">Per Page</font>';          '<font color="#800000" face="helvetica">'.&mt('Per Page').'</font>';
     $scrout.="</td><td>Related<br />Words</td></tr>\n";      $scrout.="</td><td>".&mt('Related').'<br />'.&mt('Words')."</td></tr>\n";
     $scrout.=&searchphrasefield_with_related('title',   'title'   ,      $scrout.=&searchphrasefield_with_related('title',   'title'   ,
                                              $ENV{'form.title'});                                               $ENV{'form.title'});
     $scrout.=&searchphrasefield('author',  'author'  ,$ENV{'form.author'});      $scrout.=&searchphrasefield('author',  'author'  ,$ENV{'form.author'});
Line 1058  field heading. Line 1064  field heading.
 ###############################################  ###############################################
   
 sub fieldtitle {  sub fieldtitle {
     my $title = uc(shift());      my $title = uc(&mt(shift()));
     return '<font color="#800000" face="helvetica"><b>'.$title.      return '<font color="#800000" face="helvetica"><b>'.$title.
         ':&nbsp;</b></font>';          ':&nbsp;</b></font>';
 }  }
Line 1153  END Line 1159  END
     my $i = 1;      my $i = 1;
     foreach (qw/January February March April May June       foreach (qw/January February March April May June 
      July August September October November December /){       July August September October November December /){
  $month .="<option value=\"$i\">$_</option>\n";   $month .="<option value=\"$i\">".&mt($_)."</option>\n";
  $i++;   $i++;
     }      }
     $month.="</select>\n";      $month.="</select>\n";
Line 1241  sub selectbox { Line 1247  sub selectbox {
     foreach (@idlist) {      foreach (@idlist) {
         $selout.='<option value="'.$_.'"';          $selout.='<option value="'.$_.'"';
         if ($_ eq $default and !/^any$/) {          if ($_ eq $default and !/^any$/) {
     $selout.=' selected >'.&{$functionref}($_).'</option>';      $selout.=' selected >'.&mt(&{$functionref}($_)).'</option>';
  }   }
  elsif ($_ eq $default and /^$anyvalue$/) {   elsif ($_ eq $default and /^$anyvalue$/) {
     $selout.=' selected >'.$anytag.'</option>';      $selout.=' selected >'.&mt($anytag).'</option>';
  }   }
         else {$selout.='>'.&{$functionref}($_).'</option>';}          else {$selout.='>'.&mt(&{$functionref}($_)).'</option>';}
     }      }
     return $selout.'</select>'.(defined($title)?'</p>':' ');      return $selout.'</select>'.(defined($title)?'</p>':' ');
 }  }
Line 1841  sub ensure_db_and_table { Line 1847  sub ensure_db_and_table {
 sub print_sort_form {  sub print_sort_form {
     my ($r,$pretty_query_string) = @_;      my ($r,$pretty_query_string) = @_;
     ##      ##
     my %SortableFields =       my %SortableFields=&Apache::lonlocal::texthash( 
         (id        => 'Default',           id        => 'Default',
          title     => 'Title',           title     => 'Title',
          author    => 'Author',           author    => 'Author',
          subject   => 'Subject',           subject   => 'Subject',
Line 1854  sub print_sort_form { Line 1860  sub print_sort_form {
          copyright => 'Copyright',           copyright => 'Copyright',
          hostname  => 'Host',           hostname  => 'Host',
          creationdate     => 'Creation Date',           creationdate     => 'Creation Date',
          lastrevisiondate => 'Revision Date',           lastrevisiondate => 'Revision Date'
      );       );
     ##      ##
     my $table = $ENV{'form.table'};      my $table = $ENV{'form.table'};
Line 2032  sub update_count_status { Line 2038  sub update_count_status {
 sub update_status {  sub update_status {
     my ($r,$text) = @_;      my ($r,$text) = @_;
     $text =~ s/\'/\\\'/g;      $text =~ s/\'/\\\'/g;
       $text=&mt($text);
     $r->print      $r->print
         ("<script>document.statusform.status.value = ' $text'</script>\n");          ("<script>document.statusform.status.value = ' $text'</script>\n");
     $r->rflush();      $r->rflush();
Line 2108  END Line 2115  END
     if (@Lines > 2) {      if (@Lines > 2) {
         $pretty_string = join '<br \>',(@Lines[0..2],'....<br />');          $pretty_string = join '<br \>',(@Lines[0..2],'....<br />');
     }      }
     $r->print("Search: ".$pretty_string);      $r->print(&mt("Search").": ".$pretty_string);
     $r->rflush();      $r->rflush();
     #      #
     # Determine the servers we need to contact.      # Determine the servers we need to contact.
Line 2408  sub display_results { Line 2415  sub display_results {
          );           );
     if ($total_results == 0) {      if ($total_results == 0) {
         $r->print('<meta HTTP-EQUIV="Refresh" CONTENT="1">'.          $r->print('<meta HTTP-EQUIV="Refresh" CONTENT="1">'.
                   '<h3>There are currently no results.</h3>'.                    '<h3>'.&mt('There are currently no results').'.</h3>'.
                   "</form></body></html>");                    "</form></body></html>");
         return;          return;
     } else {      } else {
Line 2439  sub display_results { Line 2446  sub display_results {
         $r->rflush();          $r->rflush();
     }      }
     if (@Results < 1) {      if (@Results < 1) {
         $r->print("There were no results matching your query");          $r->print(&mt("There were no results matching your query"));
     } else {      } else {
         $r->print          $r->print
             ('<center>'.              ('<center>'.

Removed from v.1.186  
changed lines
  Added in v.1.187


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