Diff for /loncom/interface/lonsearchcat.pm between versions 1.204 and 1.207

version 1.204, 2004/03/03 17:25:23 version 1.207, 2004/04/19 13:51:36
Line 48  described at http://www.lon-capa.org. Line 48  described at http://www.lon-capa.org.
 lonsearchcat presents the user with an interface to search the LON-CAPA  lonsearchcat presents the user with an interface to search the LON-CAPA
 digital library.  lonsearchcat also initiates the execution of a search  digital library.  lonsearchcat also initiates the execution of a search
 by sending the search parameters to LON-CAPA servers.  The progress of   by sending the search parameters to LON-CAPA servers.  The progress of 
 search (on a server basis) is displayed to the user in a seperate window.  search (on a server basis) is displayed to the user in a separate window.
   
 =head1 Internals  =head1 Internals
   
Line 454  sub untiehash { Line 454  sub untiehash {
   
 } # End of course search scoping  } # End of course search scoping
   
   sub search_html_header {
       my $Str = <<ENDHEADER;
   <html>
   <head>
   <title>The LearningOnline Network with CAPA</title>
   <script type="text/javascript">
       function openhelp(val) {
    openhelpwin=open('/adm/help/searchcat.html','helpscreen',
        'scrollbars=1,width=600,height=300');
    openhelpwin.focus();
       }
   </script>
   </head>
   ENDHEADER
       return $Str;
   }
   
 ######################################################################  ######################################################################
 ######################################################################  ######################################################################
   
Line 472  sub print_basic_search_form { Line 489  sub print_basic_search_form {
     my $bodytag=&Apache::loncommon::bodytag('Search').      my $bodytag=&Apache::loncommon::bodytag('Search').
  &Apache::loncommon::help_open_topic('Finding_Resources').   &Apache::loncommon::help_open_topic('Finding_Resources').
  &Apache::loncommon::help_open_bug('Searching');   &Apache::loncommon::help_open_bug('Searching');
     my $scrout=<<"ENDDOCUMENT";      my $scrout = &search_html_header().$bodytag;
 <html>      if (&Apache::lonnet::allowed('bre',$ENV{'request.role.domain'})) {
 <head>          my $CatalogSearch=&mt('Catalog Search');
 <title>The LearningOnline Network with CAPA</title>          my $Statement=&searchhelp();
 <script type="text/javascript">          $scrout.=(<<ENDDOCUMENT);
     function openhelp(val) {  
  openhelpwin=open('/adm/help/searchcat.html','helpscreen',  
      'scrollbars=1,width=600,height=300');  
  openhelpwin.focus();  
     }  
 </script>  
 </head>  
 $bodytag  
 ENDDOCUMENT  
 if (&Apache::lonnet::allowed('bre',$ENV{'request.role.domain'})) {  
     my $CatalogSearch=&mt('Catalog Search');  
     my $Statement=&searchhelp();  
     $scrout.=(<<ENDDOCUMENT);  
 <h1>$CatalogSearch</h1>  <h1>$CatalogSearch</h1>
 <form name="loncapa_search" method="post" action="/adm/searchcat">  <form name="loncapa_search" method="post" action="/adm/searchcat">
 <input type="hidden" name="phase" value="basic_search" />  <input type="hidden" name="phase" value="basic_search" />
Line 501  $Statement. Line 505  $Statement.
 <table>  <table>
 <tr><td>  <tr><td>
 ENDDOCUMENT  ENDDOCUMENT
     $scrout.='&nbsp;'.&Apache::lonhtmlcommon::textbox('basicexp',          $scrout.='&nbsp;'.
                                             $ENV{'form.basicexp'},40).          &Apache::lonhtmlcommon::textbox('basicexp',
         '&nbsp;';                                          $ENV{'form.basicexp'},40).
     my $relatedcheckbox = &Apache::lonhtmlcommon::checkbox('related',                                          '&nbsp;';
  $ENV{'form.related'});          my $relatedcheckbox = 
     my $domain = $r->dir_config('lonDefDomain');              &Apache::lonhtmlcommon::checkbox('related',
     my $domaincheckbox = &Apache::lonhtmlcommon::checkbox('domains',                                               $ENV{'form.related'});
  $ENV{'form.domains'});          my $domain = $r->dir_config('lonDefDomain');
     my $srch=&mt('Search');          my $domaincheckbox = 
     my $header=&mt('Advanced Search');              &Apache::lonhtmlcommon::checkbox('domains',
     my $userelatedwords=&mt('use related words');                                               $ENV{'form.domains'});
     my $onlysearchdomain=&mt('only search domain');          my $srch=&mt('Search');
     my $view=&viewoptions();          my $header=&mt('Advanced Search');
     $scrout.=<<END;          my $userelatedwords=&mt('use related words');
           my $onlysearchdomain=&mt('only search domain');
           my $view=&viewoptions();
           $scrout.=<<END;
 </td><td><a  </td><td><a
 href="/adm/searchcat?phase=disp_adv&catalogmode=$ENV{'form.catalogmode'}&launch=$ENV{'form.launch'}&mode=$ENV{'form.mode'}"  href="/adm/searchcat?phase=disp_adv&catalogmode=$ENV{'form.catalogmode'}&launch=$ENV{'form.launch'}&mode=$ENV{'form.mode'}"
 >$header</a></td></tr>  >$header</a></td></tr>
Line 606  $closebutton Line 613  $closebutton
 END  END
     my $bodytag=&Apache::loncommon::bodytag('Advanced Catalog Search');      my $bodytag=&Apache::loncommon::bodytag('Advanced Catalog Search');
     my $searchhelp=&searchhelp();      my $searchhelp=&searchhelp();
     my $scrout=<<"ENDHEADER";      my $scrout=&search_html_header();
 <html>      $scrout .= <<"ENDHEADER";
 <head>  
 <title>The LearningOnline Network with CAPA</title>  
 <script type="text/javascript">  
     function openhelp(val) {  
  openhelpwin=open('/adm/help/searchcat.html','helpscreen',  
      'scrollbars=1,width=600,height=300');  
  openhelpwin.focus();  
     }  
 </script>  
 </head>  
 $bodytag  $bodytag
 $searchhelp  $searchhelp
 <form method="post" action="/adm/searchcat" name="advsearch">  <form method="post" action="/adm/searchcat" name="advsearch">
Line 634  ENDHEADER Line 631  ENDHEADER
     foreach ('title','author','owner','authorspace','modifyinguser',      foreach ('title','author','owner','authorspace','modifyinguser',
      'keywords','notes','abstract','standards',       'keywords','notes','abstract','standards',
      'lowestgradelevel','highestgradelevel','mime') {       'lowestgradelevel','highestgradelevel','mime') {
  $scrout.='<tr bgcolor="#FFFFBB"><td>'.&titlefield($fields{$_}).'</td><td>'.   $scrout.='<tr><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>'.      $scrout.='<tr><td>'.
  &titlefield(&mt('MIME Type Category')).'</td><td>'.    &titlefield(&mt('MIME Type Category')).'</td><td>'. 
     &Apache::loncommon::filecategoryselect('category',      &Apache::loncommon::filecategoryselect('category',
    $ENV{'form.category'}).     $ENV{'form.category'}).
     '</td><td>&nbsp;</td></td></tr>';      '</td><td>&nbsp;</td></td></tr>';
     $scrout.='<tr bgcolor="#FFFFBB"><td>'.      $scrout.='<tr><td>'.
  &titlefield(&mt('Limit Search to Domains')).'</td><td>'.    &titlefield(&mt('Limit Search to Domains')).'</td><td>'. 
     &Apache::loncommon::domain_select('domains',      &Apache::loncommon::domain_select('domains',
    $ENV{'form.domains'},1).     $ENV{'form.domains'},1).
Line 655  ENDHEADER Line 652  ENDHEADER
          '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 bgcolor="#FFFFBB">'.   $scrout.='<tr>'.
             '<td>'.&titlefield($dates{$_}).'</td><td>'.               '<td>'.&titlefield($dates{$_}).'</td><td>'. 
     &Apache::lonhtmlcommon::date_setter('advsearch',$_,0,'',1).      &Apache::lonhtmlcommon::date_setter('advsearch',$_,0,'',1).
     '</td><td>&nbsp;</td></td>'.      '</td><td>&nbsp;</td></td>'.
Line 735  Outputs: text for box with view options Line 732  Outputs: text for box with view options
 ######################################################################  ######################################################################
 ######################################################################  ######################################################################
 sub viewoptions {  sub viewoptions {
     my $scrout="\n\n".'<table bgcolor="#FFFFBB">'.      my $scrout="\n\n".'<table>'.
         '<tr><th>'.&mt('View Options').'</th><th>'.          '<tr><th>'.&mt('View Options').'</th><th>'.
  &mt('Records per Page').'</th></tr><tr><td>';   &mt('Records per Page').'</th></tr><tr><td>';
     unless ($ENV{'form.viewselect'}) { $ENV{'form.viewselect'}='detailed'; }      unless ($ENV{'form.viewselect'}) { $ENV{'form.viewselect'}='detailed'; }
Line 882  Inputs: Hash of values to save, filename Line 879  Inputs: Hash of values to save, filename
   
 Store variables away to the %persistent_db.  Store variables away to the %persistent_db.
 Values will be escaped.  Values that are array pointers will have their  Values will be escaped.  Values that are array pointers will have their
 elements escaped and concatenated in a comma seperated string.    elements escaped and concatenated in a comma separated string.  
   
 =cut  =cut
   
Line 914  Inputs: filename of persistent database. Line 911  Inputs: filename of persistent database.
   
 Store most form variables away to the %persistent_db.  Store most form variables away to the %persistent_db.
 Values will be escaped.  Values that are array pointers will have their  Values will be escaped.  Values that are array pointers will have their
 elements escaped and concatenated in a comma seperated string.    elements escaped and concatenated in a comma separated string.  
   
 =cut  =cut
   
Line 2236  The 'title' field is set to "Untitled" i Line 2233  The 'title' field is set to "Untitled" i
 sub parse_raw_result {  sub parse_raw_result {
     my ($result,$hostname) = @_;      my ($result,$hostname) = @_;
     # conclude from self to others regarding fields      # conclude from self to others regarding fields
     my %Fields=&Apache::lonmeta::metadata_col_to_hash(      my %Fields=&LONCAPA::lonmetadata::metadata_col_to_hash
  map {          (map {
  &Apache::lonnet::unescape($_);              &Apache::lonnet::unescape($_);
  } (split(/\,/,$result))          } (split(/\,/,$result)) );
       );  
     return %Fields;      return %Fields;
 }  }
   

Removed from v.1.204  
changed lines
  Added in v.1.207


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