Diff for /loncom/interface/lonsearchcourse.pm between versions 1.2 and 1.4

version 1.2, 2011/01/17 20:43:09 version 1.4, 2011/12/25 20:41:53
Line 41  use Apache::lonlocal; Line 41  use Apache::lonlocal;
 use LONCAPA::lonmetadata();  use LONCAPA::lonmetadata();
 use HTML::Entities();  use HTML::Entities();
 use Apache::lonnavmaps;  use Apache::lonnavmaps;
 use Apache::londocs();  use Apache::lonnavdisplay();
 use Apache::lonindexer();  use Apache::lonindexer();
 use LONCAPA;  use LONCAPA;
   
Line 54  my $totalfound; Line 54  my $totalfound;
 sub menu {  sub menu {
     my $scrout='';      my $scrout='';
     if ($env{'request.course.id'}) {      if ($env{'request.course.id'}) {
         my %lt=&Apache::lonlocal::texthash('srch' => 'Search',          my %lt=&Apache::lonlocal::texthash(
                                            'header' => 'Course Search',           'srch' => 'Search',
          'note' => 'Enter terms or phrases, then press "Search" below',           'note' => 'Search terms',
            'options' => 'Options',
          'use' => 'use related words',           'use' => 'use related words',
          'full' =>'fulltext search (time consuming)',           'full' =>'fulltext search (time consuming)',
          'disc' => 'search discussion postings (resources and discussion boards)',           'disc' => 'search discussion postings (resources and discussion boards)',
                                            );                                             );
         $scrout.=(<<ENDCOURSESEARCH);          $scrout.=(<<ENDCOURSESEARCH);
 <form name="loncapa_search" method="post" action="/adm/searchcourse">  <form name="loncapa_search" method="post" action="/adm/searchcourse">
 <center>  
 <hr />  
 <h1>$lt{'header'}</h1>      
 <input type="hidden" name="phase" value="results" />  <input type="hidden" name="phase" value="results" />
 <p>  
 $lt{'note'}.  
 </p>  
 <table>  
 <tr><td>  
 ENDCOURSESEARCH  ENDCOURSESEARCH
         $scrout.='&nbsp;'.         $scrout.=&Apache::lonhtmlcommon::start_pick_box().
             &Apache::lonhtmlcommon::textbox('courseexp',                  &Apache::lonhtmlcommon::row_title($lt{'note'}).
                                   $env{'form.courseexp'},40);                  &Apache::lonhtmlcommon::textbox('courseexp',
         my $crscheckbox =                                    $env{'form.courseexp'},40).
             &Apache::lonhtmlcommon::checkbox('crsfulltext',                  &Apache::lonhtmlcommon::row_closure().
                                    $env{'form.crsfulltext'});                  &Apache::lonhtmlcommon::row_title($lt{'options'}).
         my $relcheckbox =                  '<label>'.&Apache::lonhtmlcommon::checkbox('crsfulltext',$env{'form.crsfulltext'}).$lt{'full'}."</label><br />\n".
             &Apache::lonhtmlcommon::checkbox('crsrelated',                  '<label>'.&Apache::lonhtmlcommon::checkbox('crsrelated',$env{'form.crsrelated'}).$lt{'use'}."</label><br />\n".
                                    $env{'form.crsrelated'});                  '<label>'.&Apache::lonhtmlcommon::checkbox('crsdiscuss',$env{'form.crsdiscuss'}).$lt{'disc'}."</label><br />\n".
         my $discheckbox =                  &Apache::lonhtmlcommon::end_pick_box();
             &Apache::lonhtmlcommon::checkbox('crsdiscuss',  
                                    $env{'form.crsrelated'});  
         $scrout.=(<<ENDENDCOURSE);          $scrout.=(<<ENDENDCOURSE);
 </td></tr>  
 <tr><td><label>$relcheckbox $lt{'use'}</label></td><td></td></tr>  
 <tr><td><label>$crscheckbox $lt{'full'}</label></td><td></td></tr>  
 <tr><td><label>$discheckbox $lt{'disc'}</label></td><td></td></tr>  
 </table>  
 <p>  <p>
 <input type="submit" name="coursesubmit" value='$lt{'srch'}' />  <input type="submit" name="coursesubmit" value='$lt{'srch'}' />
 </p>  </p>
 </center>  
 </form>  </form>
 ENDENDCOURSE  ENDENDCOURSE
     }      }
Line 243  sub course_search { Line 228  sub course_search {
             $r->print('<div class="LC_error">'.&mt('An error occurred retrieving information about resources in the course.').'<br />'.&mt('It is recommended that you [_1]re-initialize the course[_2] and then try your search again.','<a href="/adm/roles">','</a>').'</div>');              $r->print('<div class="LC_error">'.&mt('An error occurred retrieving information about resources in the course.').'<br />'.&mt('It is recommended that you [_1]re-initialize the course[_2] and then try your search again.','<a href="/adm/roles">','</a>').'</div>');
         }          }
     }      }
   
 # =================================================== Done going through course  
     $r->print(&Apache::loncommon::end_page());  
 }  }
   
 # =============================== This pulls up a resource and its dependencies  # =============================== This pulls up a resource and its dependencies
Line 338  sub handler { Line 320  sub handler {
                 text => 'Search Results'});                  text => 'Search Results'});
     }      }
     $r->print(&Apache::lonhtmlcommon::breadcrumbs("$crstype Search"));      $r->print(&Apache::lonhtmlcommon::breadcrumbs("$crstype Search"));
     &Apache::londocs::startContentScreen($r,'coursesearch');      &Apache::lonnavdisplay::startContentScreen($r,'coursesearch');
     if ($env{'form.phase'} eq 'results') {      if ($env{'form.phase'} eq 'results') {
        &course_search($r);         &course_search($r);
     } else {      } else {
        $r->print(&menu());         $r->print(&menu());
     }      }
     &Apache::londocs::endContentScreen($r);      &Apache::lonnavdisplay::endContentScreen($r);
     $r->print(&Apache::loncommon::end_page());      $r->print(&Apache::loncommon::end_page());
     return OK;      return OK;
 }  }

Removed from v.1.2  
changed lines
  Added in v.1.4


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