version 1.78, 2001/03/27 02:32:44
|
version 1.84, 2001/03/27 19:05:02
|
Line 560 sub advancedsearch {
|
Line 560 sub advancedsearch {
|
$customquery=&build_custommetadata_query('custommetadata', |
$customquery=&build_custommetadata_query('custommetadata', |
$ENV{'form.custommetadata'}); |
$ENV{'form.custommetadata'}); |
} |
} |
|
my $customshow=''; |
|
if ($ENV{'form.customshow'}) { |
|
$customshow=$ENV{'form.customshow'}; |
|
$customshow=~s/[^\w\s]//g; |
|
my @fields=split(/\s+/,$customshow); |
|
$customshow=join(" ",@fields); |
|
} |
if (@queries) { |
if (@queries) { |
$query=join(" AND ",@queries); |
$query=join(" AND ",@queries); |
$query="select * from metadata where $query"; |
$query="select * from metadata where $query"; |
my $reply=''; |
my $reply=''; |
unless ($customquery) { |
unless ($customquery or $customshow) { |
$reply=&Apache::lonnet::metadata_query($query); |
$reply=&Apache::lonnet::metadata_query($query); |
} |
} |
else { |
else { |
$reply=&Apache::lonnet::metadata_query($query,$customquery); |
$reply=&Apache::lonnet::metadata_query($query, |
|
$customquery,$customshow); |
} |
} |
&output_results('Advanced',$r,$envhash,$customquery,$reply); |
&output_results('Advanced',$r,$envhash,$customquery,$reply); |
} |
} |
else { |
else { |
&output_results('Advanced',$r,$envhash,$query); |
&output_results('Advanced',$r,$envhash,$query); |
} |
} |
|
$r->print(' '); |
return OK; |
return OK; |
} |
} |
|
|
Line 683 sub output_results {
|
Line 692 sub output_results {
|
$customshow=~s/[^\w\s]//g; |
$customshow=~s/[^\w\s]//g; |
my @fields=map {"<font color=\"#008000\">$_:</font>"} |
my @fields=map {"<font color=\"#008000\">$_:</font>"} |
split(/\s+/,$customshow); |
split(/\s+/,$customshow); |
$extrashow="<ul><li>".join("</li><li>",@fields)."</li></ul>\n"; |
if ($customshow) { |
|
$extrashow="<ul><li>".join("</li><li>",@fields)."</li></ul>\n"; |
|
} |
|
} |
|
my $customdata=''; |
|
foreach my $result (@results) { |
|
if ($result=~/^(custom\=.*)$/) { # grab all custom metadata |
|
$customdata.=$result; |
|
} |
} |
} |
foreach my $result (@results) { |
foreach my $result (@results) { |
|
next if $result=~/^custom\=/; |
|
chomp $result; |
my @fields=map |
my @fields=map |
{&Apache::lonnet::unescape($_)} |
{&Apache::lonnet::unescape($_)} |
(split(/\,/,$result)); |
(split(/\,/,$result)); |
Line 770 SCRIPT
|
Line 789 SCRIPT
|
<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"> |
|
$customdata |
<input type='button' value='Revise search request' |
<input type='button' value='Revise search request' |
onClick='this.form.submit();'> |
onClick='this.form.submit();'> |
$closebutton |
$closebutton |