--- loncom/interface/lonsearchcat.pm 2001/03/27 13:25:41 1.82 +++ loncom/interface/lonsearchcat.pm 2001/03/27 20:33:40 1.87 @@ -560,21 +560,33 @@ sub advancedsearch { $customquery=&build_custommetadata_query('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) { $query=join(" AND ",@queries); $query="select * from metadata where $query"; my $reply=''; - unless ($customquery) { + unless ($customquery or $customshow) { $reply=&Apache::lonnet::metadata_query($query); } else { - $reply=&Apache::lonnet::metadata_query($query,$customquery); + $reply=&Apache::lonnet::metadata_query($query, + $customquery,$customshow); } &output_results('Advanced',$r,$envhash,$customquery,$reply); } - else { - &output_results('Advanced',$r,$envhash,$query); + elsif ($customquery) { + my $reply=''; + $reply=&Apache::lonnet::metadata_query('', + $customquery,$customshow); + &output_results('Advanced',$r,$envhash,$customquery,$reply); } + $r->print(' '); # just in case.. hrrmm.. return OK; } @@ -678,24 +690,32 @@ sub output_results { my $customshow=''; my $extrashow=''; + my @customfields; if ($ENV{'form.customshow'}) { $customshow=$ENV{'form.customshow'}; $customshow=~s/[^\w\s]//g; - my @fields=map {"$_:"} + my @fields=map {"$_:"} split(/\s+/,$customshow); + my @customfields=split(/\s+/,$customshow); if ($customshow) { $extrashow="