version 1.152, 2002/08/07 12:37:16
|
version 1.156, 2002/09/16 12:52:33
|
Line 115 that produces it. Adding a new view typ
|
Line 115 that produces it. Adding a new view typ
|
adding a line to the definition of this hash and making sure the function |
adding a line to the definition of this hash and making sure the function |
takes the proper parameters. |
takes the proper parameters. |
|
|
|
=item $bodytag |
|
|
|
LON-CAPA standard body tag, gotten from &Apache::lonnet::bodytag. |
|
No title, no table, just a <body> tag. |
|
|
=back |
=back |
|
|
=cut |
=cut |
Line 136 my %Views = ("Detailed Citation View" =>
|
Line 141 my %Views = ("Detailed Citation View" =>
|
"Compact View" => \&compact_view); |
"Compact View" => \&compact_view); |
my %persistent_db; |
my %persistent_db; |
my $hidden_fields; |
my $hidden_fields; |
|
my $bodytag; |
|
|
###################################################################### |
###################################################################### |
###################################################################### |
###################################################################### |
|
|
Line 171 sub handler {
|
Line 178 sub handler {
|
$r->content_type('text/html'); |
$r->content_type('text/html'); |
$r->send_http_header; |
$r->send_http_header; |
return OK if $r->header_only; |
return OK if $r->header_only; |
|
## |
|
## Prevent caching of the search interface window. Hopefully this means |
|
## we will get the launch=1 passed in a little more. |
|
&Apache::loncommon::no_cache($r); |
## |
## |
## Pick up form fields passed in the links. |
## Pick up form fields passed in the links. |
## |
## |
Line 201 sub handler {
|
Line 212 sub handler {
|
($ENV{'form.launch'} eq '1')) { |
($ENV{'form.launch'} eq '1')) { |
$ENV{'form.persistent_db_id'} = time; |
$ENV{'form.persistent_db_id'} = time; |
} |
} |
|
$bodytag=&Apache::loncommon::bodytag(undef,undef,undef,1); |
my $persistent_db_file = "/home/httpd/perl/tmp/". |
my $persistent_db_file = "/home/httpd/perl/tmp/". |
&Apache::lonnet::escape($domain). |
&Apache::lonnet::escape($domain). |
'_'.&Apache::lonnet::escape($ENV{'user.name'}). |
'_'.&Apache::lonnet::escape($ENV{'user.name'}). |
Line 213 sub handler {
|
Line 225 sub handler {
|
$r->print(<<END); |
$r->print(<<END); |
<html> |
<html> |
<head><title>LON-CAPA Search Error</title></head> |
<head><title>LON-CAPA Search Error</title></head> |
<body> |
$bodytag |
We were unable to retrieve data describing your search. This is a serious |
We were unable to retrieve data describing your search. This is a serious |
error and has been logged. Please alert your LON-CAPA administrator. |
error and has been logged. Please alert your LON-CAPA administrator. |
</body> |
</body> |
Line 226 END
|
Line 238 END
|
## Clear out old values from groupsearch database |
## Clear out old values from groupsearch database |
## |
## |
untie %groupsearch_db if (tied(%groupsearch_db)); |
untie %groupsearch_db if (tied(%groupsearch_db)); |
if ($ENV{'form.launch'} eq '1' && |
if (($ENV{'form.launch'} eq '1') && |
($ENV{'form.catalogmode'} eq 'groupsearch') && |
($ENV{'form.catalogmode'} eq 'groupsearch')) { |
($ENV{'form.phase'} eq 'results')) { |
|
if (tie(%groupsearch_db,'GDBM_File',$diropendb,&GDBM_WRCREAT(),0640)) { |
if (tie(%groupsearch_db,'GDBM_File',$diropendb,&GDBM_WRCREAT(),0640)) { |
&start_fresh_session(); |
&start_fresh_session(); |
untie %groupsearch_db; |
untie %groupsearch_db; |
} else { |
} else { |
$r->print('<html><head></head><body>Unable to tie hash to db '. |
# This is a stupid error to give to the user. |
'file</body></html>'); |
# It really tells them nothing. |
|
$r->print('<html><head></head>'.$bodytag. |
|
'Unable to tie hash to db file</body></html>'); |
return OK; |
return OK; |
} |
} |
} |
} |
Line 329 END
|
Line 342 END
|
if (! defined(&create_results_table())) { |
if (! defined(&create_results_table())) { |
$r->print(<<END); |
$r->print(<<END); |
<html><head><title>Search Error</title></head> |
<html><head><title>Search Error</title></head> |
<body> |
$bodytag |
Unable to create table in which to store search results. |
Unable to create table in which to store search results. |
The search has been aborted. |
The search has been aborted. |
</body> |
</body> |
Line 341 END
|
Line 354 END
|
if (! &make_form_data_persistent($r,$persistent_db_file)) { |
if (! &make_form_data_persistent($r,$persistent_db_file)) { |
$r->print(<<END); |
$r->print(<<END); |
<html><head><title>Search Error</title></head> |
<html><head><title>Search Error</title></head> |
<body> |
$bodytag |
Unable to properly store search information. The search has been aborted. |
Unable to properly store search information. The search has been aborted. |
</body> |
</body> |
</html> |
</html> |
Line 390 Returns a scalar which holds html for th
|
Line 403 Returns a scalar which holds html for th
|
|
|
sub print_basic_search_form{ |
sub print_basic_search_form{ |
my ($r,$closebutton) = @_; |
my ($r,$closebutton) = @_; |
|
my $bodytag=&Apache::loncommon::bodytag('Catalog Search'); |
my $scrout=<<"ENDDOCUMENT"; |
my $scrout=<<"ENDDOCUMENT"; |
<html> |
<html> |
<head> |
<head> |
Line 402 sub print_basic_search_form{
|
Line 416 sub print_basic_search_form{
|
} |
} |
</script> |
</script> |
</head> |
</head> |
<body bgcolor="#FFFFFF"> |
$bodytag |
<img align='right' src='/adm/lonIcons/lonlogos.gif' /> |
|
<h1>Search Catalog</h1> |
|
<form method="post" action="/adm/searchcat"> |
<form method="post" action="/adm/searchcat"> |
<input type="hidden" name="phase" value="basic_search" /> |
<input type="hidden" name="phase" value="basic_search" /> |
$hidden_fields |
$hidden_fields |
<h3>Basic Search</h3> |
|
<p> |
<p> |
Enter terms or phrases separated by AND, OR, or NOT |
Enter terms or phrases separated by AND, OR, or NOT |
then press SEARCH below. |
then press SEARCH below. |
Line 474 END
|
Line 485 END
|
if (!defined($ENV{'form.viewselect'})) { |
if (!defined($ENV{'form.viewselect'})) { |
$ENV{'form.viewselect'} ="Detailed Citation View"; |
$ENV{'form.viewselect'} ="Detailed Citation View"; |
} |
} |
|
my $bodytag=&Apache::loncommon::bodytag('Advanced Catalog Search'); |
my $scrout=<<"ENDHEADER"; |
my $scrout=<<"ENDHEADER"; |
<html> |
<html> |
<head> |
<head> |
Line 486 END
|
Line 498 END
|
} |
} |
</script> |
</script> |
</head> |
</head> |
<body bgcolor="#FFFFFF"> |
$bodytag |
<img align='right' src='/adm/lonIcons/lonlogos.gif' /> |
|
<h1>Advanced Catalog Search</h1> |
|
<hr /> |
|
Enter terms or phrases separated by search operators |
Enter terms or phrases separated by search operators |
such as AND, OR, or NOT.<br /> |
such as AND, OR, or NOT.<br /> |
<form method="post" action="/adm/searchcat"> |
<form method="post" action="/adm/searchcat"> |
Line 1671 sub print_sort_form {
|
Line 1680 sub print_sort_form {
|
</script> |
</script> |
<title>Results</title> |
<title>Results</title> |
</head> |
</head> |
<body> |
$bodytag |
<form name="statusform" action="" method="post"> |
<form name="statusform" action="" method="post"> |
|
<input type="hidden" name="Queue" value="" /> |
END |
END |
|
|
#<h2>Sort Results</h2> |
#<h2>Sort Results</h2> |
Line 1888 sub run_search {
|
Line 1898 sub run_search {
|
$r->print(<<END); |
$r->print(<<END); |
<html> |
<html> |
<head><title>Search Status</title></head> |
<head><title>Search Status</title></head> |
<body> |
$bodytag |
<form name="statusform" action="" method="post"> |
<form name="statusform" action="" method="post"> |
<input type="hidden" name="Queue" value="" /> |
<input type="hidden" name="Queue" value="" /> |
END |
END |
Line 2051 END
|
Line 2061 END
|
# We have run out of time or run out of servers to talk to and |
# We have run out of time or run out of servers to talk to and |
# results to get. |
# results to get. |
$r->print("</body></html>"); |
$r->print("</body></html>"); |
$r->print("<script>window.location='/adm/searchcat?phase=sort&persistent_db_id=$ENV{'form.persistent_db_id'}';</script>"); |
if ($ENV{'form.catalogmode'} ne 'groupsearch') { |
|
$r->print("<script>". |
|
"window.location='/adm/searchcat?". |
|
"phase=sort&". |
|
"persistent_db_id=$ENV{'form.persistent_db_id'}';". |
|
"</script>"); |
|
} |
return; |
return; |
} |
} |
|
|
Line 2484 sub search_results_header {
|
Line 2500 sub search_results_header {
|
parent.close(); |
parent.close(); |
} |
} |
function changeTitle(val) { |
function changeTitle(val) { |
if (opener.inf.document.forms.resinfo.elements.t) { |
if (parent.opener.inf.document.forms.resinfo.elements.t) { |
opener.inf.document.forms.resinfo.elements.t.value=val; |
parent.opener.inf.document.forms.resinfo.elements.t.value=val; |
} |
} |
} |
} |
function changeURL(val) { |
function changeURL(val) { |
if (opener.inf.document.forms.resinfo.elements.u) { |
if (parent.opener.inf.document.forms.resinfo.elements.u) { |
opener.inf.document.forms.resinfo.elements.u.value=val; |
parent.opener.inf.document.forms.resinfo.elements.u.value=val; |
} |
} |
} |
} |
</script> |
</script> |
Line 2536 SCRIPT
|
Line 2552 SCRIPT
|
SCRIPT |
SCRIPT |
$result.=<<END; |
$result.=<<END; |
</head> |
</head> |
|
$bodytag |
<form name="results" method="post" action="" > |
<form name="results" method="post" action="" > |
<input type="hidden" name="Queue" value="" /> |
<input type="hidden" name="Queue" value="" /> |
$importbutton |
$importbutton |
Line 2548 END
|
Line 2565 END
|
sub search_status_header { |
sub search_status_header { |
return <<ENDSTATUS; |
return <<ENDSTATUS; |
<html><head><title>Search Status</title></head> |
<html><head><title>Search Status</title></head> |
<body> |
$bodytag |
<h3>Search Status</h3> |
<h3>Search Status</h3> |
Sending search request to LON-CAPA servers.<br /> |
Sending search request to LON-CAPA servers.<br /> |
ENDSTATUS |
ENDSTATUS |
Line 2820 sub output_blank_field_error {
|
Line 2837 sub output_blank_field_error {
|
BEGINNING |
BEGINNING |
$r->print(<<RESULTS); |
$r->print(<<RESULTS); |
</head> |
</head> |
<body bgcolor="#ffffff"> |
$bodytag |
<img align='right' src='/adm/lonIcons/lonlogos.gif' /> |
<img align='right' src='/adm/lonIcons/lonlogos.gif' /> |
<h1>Search Catalog</h1> |
<h1>Search Catalog</h1> |
<form method="post" action="/adm/searchcat"> |
<form method="post" action="/adm/searchcat"> |
Line 2867 sub output_date_error {
|
Line 2884 sub output_date_error {
|
<head> |
<head> |
<title>The LearningOnline Network with CAPA</title> |
<title>The LearningOnline Network with CAPA</title> |
</head> |
</head> |
<body bgcolor="#ffffff"> |
$bodytag |
<img align='right' src='/adm/lonIcons/lonlogos.gif' /> |
<img align='right' src='/adm/lonIcons/lonlogos.gif' /> |
<h1>Search Catalog</h1> |
<h1>Search Catalog</h1> |
<form method="post" action="/adm/searchcat"> |
<form method="post" action="/adm/searchcat"> |