version 1.212, 2004/04/19 21:46:50
|
version 1.213, 2004/04/21 15:48:34
|
Line 150 sub handler {
|
Line 150 sub handler {
|
## Initialize global variables |
## Initialize global variables |
## |
## |
my $domain = $r->dir_config('lonDefDomain'); |
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 |
# set the name of the persistent database |
# $ENV{'form.persistent_db_id'} can only have digits in it. |
# $ENV{'form.persistent_db_id'} can only have digits in it. |
Line 535 sub print_basic_search_form {
|
Line 536 sub print_basic_search_form {
|
undef,undef,! $ENV{'form.launch'}); |
undef,undef,! $ENV{'form.launch'}); |
my $scrout = &search_html_header().$bodytag; |
my $scrout = &search_html_header().$bodytag; |
if (&Apache::lonnet::allowed('bre',$ENV{'request.role.domain'})) { |
if (&Apache::lonnet::allowed('bre',$ENV{'request.role.domain'})) { |
my $Statement=&searchhelp(); |
# Define interface components |
$scrout.=(<<ENDDOCUMENT); |
my $userelatedwords= |
<form name="loncapa_search" method="post" action="/adm/searchcat"> |
&mt('[_1] use related words', |
<input type="hidden" name="phase" value="basic_search" /> |
&Apache::lonhtmlcommon::checkbox |
$hidden_fields |
('related',$ENV{'form.related'})); |
<p> |
my $onlysearchdomain= |
$Statement. |
&mt('[_1] only search domain [_2]', |
</p> |
&Apache::lonhtmlcommon::checkbox |
<p> |
('domains',$ENV{'form.domains'}), |
<table> |
$r->dir_config('lonDefDomain')); |
<tr><td> |
my $adv_search_link = |
ENDDOCUMENT |
'<a href="/adm/searchcat?'. |
$scrout.=' '. |
'phase=disp_adv&'. |
|
'catalogmode='.$ENV{'form.catalogmode'}. |
|
'&launch='.$ENV{'form.launch'}. |
|
'&mode='.$ENV{'form.mode'}. |
|
'">'.&mt('Advanced Search').'</a>'; |
|
# |
|
$scrout.='<form name="loncapa_search" method="post" '. |
|
'action="/adm/searchcat">'. |
|
'<input type="hidden" name="phase" value="basic_search" />'. |
|
$hidden_fields; |
|
# |
|
$scrout .= '<center>'.$/; |
|
if ($ENV{'request.course.id'}) { |
|
$scrout .= '<h1>'.&mt('LON-CAPA Catalog Search').'</h1>'; |
|
} else { |
|
# No need to tell them they are searching |
|
$scrout.= ('<br />'x2); |
|
} |
|
$scrout.='<table>'. |
|
'<tr><td align="center" valign="top">'. |
&Apache::lonhtmlcommon::textbox('basicexp', |
&Apache::lonhtmlcommon::textbox('basicexp', |
$ENV{'form.basicexp'},40). |
$ENV{'form.basicexp'},50).'<br />'. |
' '; |
'<font size="-1">'.&searchhelp().'</font>'.'</td>'. |
my $relatedcheckbox = |
'<td><font size="-1">'. |
&Apache::lonhtmlcommon::checkbox('related', |
'<nobr>'.(' 'x3).$adv_search_link.'</nobr>'.'<br />'. |
$ENV{'form.related'}); |
'<nobr>'.(' 'x1).$userelatedwords.'</nobr>'.'<br />'. |
my $domain = $r->dir_config('lonDefDomain'); |
'<nobr>'.(' 'x1).$onlysearchdomain.'</nobr>'.'<br />'. |
my $domaincheckbox = |
'</font></td>'. |
&Apache::lonhtmlcommon::checkbox('domains', |
'</tr>'.$/; |
$ENV{'form.domains'}); |
# |
my $srch=&mt('Search'); |
# $scrout .= '<tr><td align="center">'. |
my $header=&mt('Advanced Search'); |
# '<font size="-1">'. |
my $userelatedwords=&mt('use related words'); |
# $userelatedwords.(' 'x3). |
my $onlysearchdomain=&mt('only search domain'); |
# $onlysearchdomain.(' 'x2).$adv_search_link. |
my $view=&viewoptions(); |
# '</font>'. |
$scrout.=<<END; |
# '</td></tr>'.$/; |
</td><td><a |
$scrout .= '<tr><td align="center" colspan="2">'. |
href="/adm/searchcat?phase=disp_adv&catalogmode=$ENV{'form.catalogmode'}&launch=$ENV{'form.launch'}&mode=$ENV{'form.mode'}" |
'<font size="-1">'. |
>$header</a></td></tr> |
'<input type="submit" name="basicsubmit" '. |
<tr><td>$relatedcheckbox $userelatedwords</td> |
'value="'.&mt('Search').'" />'. |
<td>$domaincheckbox $onlysearchdomain <b>$domain</b></td></tr> |
(' 'x2).$closebutton.(' 'x2).&viewoptions(). |
</table> |
'</font>'. |
</p> |
'</td></tr>'.$/; |
$view |
$scrout .= '</table>'.$/.'</center>'.'</form>'; |
<p> |
|
<input type="submit" name="basicsubmit" value='$srch' /> |
|
$closebutton |
|
END |
|
$scrout.=<<ENDDOCUMENT; |
|
</p> |
|
</form> |
|
ENDDOCUMENT |
|
} |
} |
if ($ENV{'request.course.id'}) { |
if ($ENV{'request.course.id'}) { |
my %lt=&Apache::lonlocal::texthash( |
my %lt=&Apache::lonlocal::texthash('srch' => 'Search', |
'srch' => 'Search', |
|
'header' => 'Course Search', |
'header' => 'Course Search', |
'note' => 'Enter terms or phrases, then press "Search" below', |
'note' => 'Enter terms or phrases, then press "Search" below', |
'use' => 'use related words', |
'use' => 'use related words', |
'full' =>'fulltext search (time consuming)' |
'full' =>'fulltext search (time consuming)' |
); |
); |
$scrout.=(<<ENDCOURSESEARCH); |
$scrout.=(<<ENDCOURSESEARCH); |
|
<form name="loncapa_search" method="post" action="/adm/searchcat"> |
|
<center> |
<hr /> |
<hr /> |
<h1>$lt{'header'}</h1> |
<h1>$lt{'header'}</h1> |
<form name="course_search" 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> |
Line 618 ENDCOURSESEARCH
|
Line 630 ENDCOURSESEARCH
|
</table><p> |
</table><p> |
<input type="submit" name="coursesubmit" value='$lt{'srch'}' /> |
<input type="submit" name="coursesubmit" value='$lt{'srch'}' /> |
</p> |
</p> |
|
</center> |
|
</form> |
ENDENDCOURSE |
ENDENDCOURSE |
} |
} |
$scrout.=(<<ENDDOCUMENT); |
$scrout.=(<<ENDDOCUMENT); |