--- loncom/interface/lonsearchcat.pm 2004/04/19 21:46:50 1.212 +++ loncom/interface/lonsearchcat.pm 2004/04/21 15:48:34 1.213 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Search Catalog # -# $Id: lonsearchcat.pm,v 1.212 2004/04/19 21:46:50 matthew Exp $ +# $Id: lonsearchcat.pm,v 1.213 2004/04/21 15:48:34 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -150,7 +150,8 @@ sub handler { ## Initialize global variables ## my $domain = $r->dir_config('lonDefDomain'); - $diropendb= "/home/httpd/perl/tmp/$ENV{'user.domain'}_$ENV{'user.name'}_searchcat.db"; + $diropendb= "/home/httpd/perl/tmp/". + "$ENV{'user.domain'}_$ENV{'user.name'}_searchcat.db"; # # set the name of the persistent database # $ENV{'form.persistent_db_id'} can only have digits in it. @@ -535,64 +536,75 @@ sub print_basic_search_form { undef,undef,! $ENV{'form.launch'}); my $scrout = &search_html_header().$bodytag; if (&Apache::lonnet::allowed('bre',$ENV{'request.role.domain'})) { - my $Statement=&searchhelp(); - $scrout.=(< - -$hidden_fields -

-$Statement. -

-

- -'. + ''. + ''.$/; + # +# $scrout .= ''.$/; + $scrout .= ''.$/; + $scrout .= '
-ENDDOCUMENT - $scrout.=' '. + # Define interface components + my $userelatedwords= + &mt('[_1] use related words', + &Apache::lonhtmlcommon::checkbox + ('related',$ENV{'form.related'})); + my $onlysearchdomain= + &mt('[_1] only search domain [_2]', + &Apache::lonhtmlcommon::checkbox + ('domains',$ENV{'form.domains'}), + $r->dir_config('lonDefDomain')); + my $adv_search_link = + ''.&mt('Advanced Search').''; + # + $scrout.='
'. + ''. + $hidden_fields; + # + $scrout .= '
'.$/; + if ($ENV{'request.course.id'}) { + $scrout .= '

'.&mt('LON-CAPA Catalog Search').'

'; + } else { + # No need to tell them they are searching + $scrout.= ('
'x2); + } + $scrout.=''. + ' - - -
'. &Apache::lonhtmlcommon::textbox('basicexp', - $ENV{'form.basicexp'},40). - ' '; - my $relatedcheckbox = - &Apache::lonhtmlcommon::checkbox('related', - $ENV{'form.related'}); - my $domain = $r->dir_config('lonDefDomain'); - my $domaincheckbox = - &Apache::lonhtmlcommon::checkbox('domains', - $ENV{'form.domains'}); - my $srch=&mt('Search'); - my $header=&mt('Advanced Search'); - my $userelatedwords=&mt('use related words'); - my $onlysearchdomain=&mt('only search domain'); - my $view=&viewoptions(); - $scrout.=<$header
$relatedcheckbox $userelatedwords$domaincheckbox $onlysearchdomain $domain
-

-$view -

  -$closebutton -END - $scrout.=< - -ENDDOCUMENT + $ENV{'form.basicexp'},50).'
'. + ''.&searchhelp().''.'

'. + ''.(' 'x3).$adv_search_link.''.'
'. + ''.(' 'x1).$userelatedwords.''.'
'. + ''.(' 'x1).$onlysearchdomain.''.'
'. + '
'. +# ''. +# $userelatedwords.(' 'x3). +# $onlysearchdomain.(' 'x2).$adv_search_link. +# ''. +# '
'. + ''. + ''. + (' 'x2).$closebutton.(' 'x2).&viewoptions(). + ''. + '
'.$/.''.''; } if ($ENV{'request.course.id'}) { - my %lt=&Apache::lonlocal::texthash( - 'srch' => 'Search', + my %lt=&Apache::lonlocal::texthash('srch' => 'Search', 'header' => 'Course Search', 'note' => 'Enter terms or phrases, then press "Search" below', 'use' => 'use related words', 'full' =>'fulltext search (time consuming)' ); $scrout.=(< +


$lt{'header'}

-
$hidden_fields

@@ -618,6 +630,8 @@ ENDCOURSESEARCH

 

+
+ ENDENDCOURSE } $scrout.=(<