--- loncom/interface/lonsearchcat.pm 2004/01/02 19:23:47 1.202 +++ loncom/interface/lonsearchcat.pm 2004/04/19 14:42:24 1.208 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Search Catalog # -# $Id: lonsearchcat.pm,v 1.202 2004/01/02 19:23:47 www Exp $ +# $Id: lonsearchcat.pm,v 1.208 2004/04/19 14:42:24 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -48,7 +48,7 @@ described at http://www.lon-capa.org. lonsearchcat presents the user with an interface to search the LON-CAPA digital library. lonsearchcat also initiates the execution of a search by sending the search parameters to LON-CAPA servers. The progress of -search (on a server basis) is displayed to the user in a seperate window. +search (on a server basis) is displayed to the user in a separate window. =head1 Internals @@ -73,6 +73,7 @@ use Apache::lonmysql(); use Apache::lonmeta; use Apache::lonhtmlcommon; use Apache::lonlocal; +use LONCAPA::lonmetadata(); ###################################################################### ###################################################################### @@ -359,7 +360,8 @@ my $totalfound; sub course_search { my $r=shift; - my $bodytag=&Apache::loncommon::bodytag('Course Search'); + my $bodytag=&Apache::loncommon::bodytag('Course Search'). + &Apache::loncommon::help_open_bug('Searching'); my $pretty_search_string = ''.$ENV{'form.courseexp'}.''; my $search_string = $ENV{'form.courseexp'}; my @New_Words; @@ -375,7 +377,7 @@ sub course_search { my @allwords=($search_string,@New_Words); $totalfound=0; $r->print('LON-CAPA Course Search'. - $bodytag.$pretty_search_string); + $bodytag.'
'.$pretty_search_string.'

'); $r->rflush(); # ======================================================= Go through the course undef %alreadyseen; @@ -452,6 +454,23 @@ sub untiehash { } # End of course search scoping +sub search_html_header { + my $Str = < + +The LearningOnline Network with CAPA + + +ENDHEADER + return $Str; +} + ###################################################################### ###################################################################### @@ -459,34 +478,22 @@ sub untiehash { =item &print_basic_search_form() -Returns a scalar which holds html for the basic search form. +Prints the form for the basic search. Sorry the name is so cryptic. =cut ###################################################################### ###################################################################### - -sub print_basic_search_form{ +sub print_basic_search_form { my ($r,$closebutton,$hidden_fields) = @_; - my $bodytag=&Apache::loncommon::bodytag('Search'); - my $scrout=<<"ENDDOCUMENT"; - - -The LearningOnline Network with CAPA - - -$bodytag -ENDDOCUMENT -if (&Apache::lonnet::allowed('bre',$ENV{'request.role.domain'})) { - my $CatalogSearch=&mt('Catalog Search'); - my $Statement=&searchhelp(); - $scrout.=(<$CatalogSearch
@@ -498,20 +505,23 @@ $Statement. @@ -582,13 +592,12 @@ ENDDOCUMENT =item &advanced_search_form() -Returns a scalar which holds html for the advanced search form. +Prints the advanced search form. =cut ###################################################################### ###################################################################### - sub print_advanced_search_form{ my ($r,$closebutton,$hidden_fields) = @_; my %lt=&Apache::lonlocal::texthash('srch' => 'Search', @@ -600,65 +609,86 @@ sub print_advanced_search_form{ $closebutton -

END my $bodytag=&Apache::loncommon::bodytag('Advanced Catalog Search'); my $searchhelp=&searchhelp(); - my $scrout=<<"ENDHEADER"; - - -The LearningOnline Network with CAPA - - + my $scrout=&search_html_header(); + $scrout .= <<"ENDHEADER"; $bodytag -$searchhelp $advanced_buttons -$hidden_fields - ENDHEADER - $scrout.=&viewoptions(); + $scrout.=(' 'x2).&viewoptions().'

'.$hidden_fields. + ''; my %fields=&Apache::lonmeta::fieldnames(); + # + $scrout.= '

'.$searchhelp.'

'. + "
ENDDOCUMENT - $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.=<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
\n"; + my %related_word_search = + ('title'=>1, + 'author'=>0, + 'owner'=>0, + 'authorspace'=>0, + 'modifyinguser'=>0, + 'keywords'=>1, + 'notes'=>1, + 'abstract'=>1, + 'standards'=>1, + 'mime'=>1, + ); - $scrout.='
'; - $scrout.="\n"; - foreach ('title','author','owner','authorspace','modifyinguser', - 'keywords','notes','abstract','standards', - 'lowestgradelevel','highestgradelevel','mime') { - $scrout.=''; + foreach my $field ('title','author','owner','authorspace','modifyinguser', + 'keywords','notes','abstract','standards','mime') { + $scrout.=''.$/; + } + foreach my $field ('lowestgradelevel','highestgradelevel') { + $scrout.=''. + ''. + ''.$/; } - $scrout.=''; - $scrout.=''.$/; + $scrout.=''; - my %dates=&Apache::lonlocal::texthash('creationdatestart' => 'Creation Date After', - 'creationdateend' => 'Creation Date Before', - 'lastrevisiondatestart' => 'Last Revision Date After', - 'lastrevisiondateend' => 'Last Revision Date Before'); - foreach (sort keys %dates) { - $scrout.=''; + ''.$/; + $scrout .= "
".&mt('Field').''.&mt('Value').'' - .&mt('Related').'
'.&mt('Words')."
'.&titlefield($fields{$_}).''. - &Apache::lonmeta::prettyinput($_,$ENV{'form.'.$_},$_,'advsearch', - 1,'',$ENV{'form.'.$_.'_related'}). - '
'.&titlefield($fields{$field}).''. + &Apache::lonmeta::prettyinput($field, + $ENV{'form.'.$field}, + $field, + 'advsearch', + $related_word_search{$field}, + '', + $ENV{'form.'.$field.'_related'}, + 50); + if ($related_word_search{$field}) { + $scrout .= 'related words'; + } else { + $scrout .= ' '; + } + $scrout .= '
'.&titlefield($fields{$field}).''. + &Apache::lonmeta::prettyinput($field, + $ENV{'form.'.$field}, + $field, + 'advsearch', + 0). + '
'. - &titlefield(&mt('MIME Type Category')).''. + $scrout.='
'. + &titlefield(&mt('MIME Type Category')).''. &Apache::loncommon::filecategoryselect('category', $ENV{'form.category'}). - ' 
'. - &titlefield(&mt('Limit Search to Domains')).''. + '
'. + &titlefield(&mt('Domains')).''. &Apache::loncommon::domain_select('domains', $ENV{'form.domains'},1). - ' 
'.&titlefield($dates{$_}).''. - &Apache::lonhtmlcommon::date_setter('advsearch',$_,0,'',1). - ' 
\n
\n\n"; + my %dates=&Apache::lonlocal::texthash + ('creationdatestart' => 'Creation Date After', + 'creationdateend' => 'Creation Date Before', + 'lastrevisiondatestart' => 'Last Revision Date After', + 'lastrevisiondateend' => 'Last Revision Date Before'); + foreach my $field (sort keys %dates) { + $scrout.=''. + ''.$/; } - $scrout.="
'.&titlefield($dates{$field}).''. + &Apache::lonhtmlcommon::date_setter('advsearch',$field,0,'',1). + '
\n"; - $scrout.=< @@ -668,12 +698,13 @@ ENDDOCUMENT $r->print($scrout); return; } + ###################################################################### ###################################################################### =pod -=item &titlefield +=item &titlefield() Inputs: title text @@ -683,17 +714,17 @@ Outputs: titletext with font wrapper ###################################################################### ###################################################################### - sub titlefield { my $title=shift; - return ''.$title.''; + return $title; } + ###################################################################### ###################################################################### =pod -=item viewoptiontext +=item viewoptiontext() Inputs: codename for view option @@ -703,21 +734,23 @@ Outputs: displayed text ###################################################################### ###################################################################### - sub viewoptiontext { my $code=shift; - my %desc=&Apache::lonlocal::texthash('detailed' => "Detailed Citation View", - 'xml' => 'XML/SGML', - 'compact' => 'Compact View', - 'fielded' => 'Fielded Format', - 'summary' => 'Summary View'); + my %desc=&Apache::lonlocal::texthash + ('detailed' => "Detailed Citation View", + 'xml' => 'XML/SGML', + 'compact' => 'Compact View', + 'fielded' => 'Fielded Format', + 'summary' => 'Summary View'); return $desc{$code}; } + +###################################################################### ###################################################################### =pod -=item viewoptions +=item viewoptions() Inputs: none @@ -727,29 +760,30 @@ Outputs: text for box with view options ###################################################################### ###################################################################### - sub viewoptions { - my $scrout="\n\n".'
'.&mt('View Options').''. - &mt('Records per Page').'
'; - unless ($ENV{'form.viewselect'}) { $ENV{'form.viewselect'}='detailed'; } + my $scrout="\n".''; + if (! defined($ENV{'form.viewselect'})) { + $ENV{'form.viewselect'}='detailed'; + } $scrout.=&Apache::lonmeta::selectbox('viewselect', $ENV{'form.viewselect'}, \&viewoptiontext, sort(keys(%Views))); - $scrout.=''; + $scrout.= '  '; $scrout.=&Apache::lonmeta::selectbox('show', $ENV{'form.show'}, undef, (10,20,50,100,1000,10000)); - $scrout.="
\n\n"; + $scrout .= (' 'x2).&mt('Records per Page').''.$/; return $scrout; } ###################################################################### +###################################################################### =pod -=item searchhelp +=item searchhelp() Inputs: none @@ -759,7 +793,6 @@ Outputs: return little blurb on how to e ###################################################################### ###################################################################### - sub searchhelp { return &mt('Enter terms or phrases separated by AND, OR, or NOT'); } @@ -769,7 +802,7 @@ sub searchhelp { =pod -=item &get_persistent_form_data +=item &get_persistent_form_data() Inputs: filename of database @@ -824,7 +857,7 @@ sub get_persistent_form_data { =pod -=item &get_persistent_data +=item &get_persistent_data() Inputs: filename of database, ref to array of values to recover. @@ -875,7 +908,7 @@ Inputs: Hash of values to save, filename Store variables away to the %persistent_db. Values will be escaped. Values that are array pointers will have their -elements escaped and concatenated in a comma seperated string. +elements escaped and concatenated in a comma separated string. =cut @@ -907,7 +940,7 @@ Inputs: filename of persistent database. Store most form variables away to the %persistent_db. Values will be escaped. Values that are array pointers will have their -elements escaped and concatenated in a comma seperated string. +elements escaped and concatenated in a comma separated string. =cut @@ -984,7 +1017,8 @@ sub parse_advanced_search { } } unless ($fillflag) { - &output_blank_field_error($r,$closebutton,'phase=disp_adv',$hidden_fields); + &output_blank_field_error($r,$closebutton, + 'phase=disp_adv',$hidden_fields); return ; } # Turn the form input into a SQL-based query @@ -1035,7 +1069,7 @@ sub parse_advanced_search { $pretty_search_string .=$font.'mime contains '. $searchphrase.'
'; } - ##### + # # Evaluate option lists if ($ENV{'form.language'} and $ENV{'form.language'} ne 'any') { push @queries,"(language like \"$ENV{'form.language'}\")"; @@ -1074,24 +1108,30 @@ sub parse_advanced_search { # date query information. push @queries,$datequery; } + # # Process form information for custom metadata querying my $customquery=undef; -# if ($ENV{'form.custommetadata'}) { -# $pretty_search_string .=$font."Custom Metadata Search: ". -# $ENV{'form.custommetadata'}."
\n"; -# $customquery=&build_custommetadata_query('custommetadata', -# $ENV{'form.custommetadata'}); -# } + ## + ## The custom metadata search was removed q long time ago mostly + ## because I was unable to figureout exactly how it worked and could + ## not imagine people actually using it. MH + ## + # if ($ENV{'form.custommetadata'}) { + # $pretty_search_string .=$font."Custom Metadata Search: ". + # $ENV{'form.custommetadata'}."
\n"; + # $customquery=&build_custommetadata_query('custommetadata', + # $ENV{'form.custommetadata'}); + # } my $customshow=undef; -# if ($ENV{'form.customshow'}) { -# $pretty_search_string .=$font."Custom Metadata Display: ". -# $ENV{'form.customshow'}."
\n"; -# $customshow=$ENV{'form.customshow'}; -# $customshow=~s/[^\w\s]//g; -# my @fields=split(/\s+/,$customshow); -# $customshow=join(" ",@fields); -# } - ## --------------------------------------------------------------- + # if ($ENV{'form.customshow'}) { + # $pretty_search_string .=$font."Custom Metadata Display: ". + # $ENV{'form.customshow'}."
\n"; + # $customshow=$ENV{'form.customshow'}; + # $customshow=~s/[^\w\s]//g; + # my @fields=split(/\s+/,$customshow); + # $customshow=join(" ",@fields); + # } + ## ## Deal with restrictions to given domains ## my ($libraries_to_query,$pretty_domains_string) = @@ -1121,6 +1161,7 @@ sub parse_domain_restrictions { } else { @allowed_domains = ($ENV{'form.domains'}); } + # my %domain_hash = (); my $pretty_domains_string; foreach (@allowed_domains) { @@ -1161,6 +1202,7 @@ Parse the basic search form and return a ###################################################################### sub parse_basic_search { my ($r,$closebutton)=@_; + # # Clean up fields for safety for my $field ('basicexp') { $ENV{"form.$field"}=~s/[^\w\s\(\)\-]//g; @@ -1173,7 +1215,8 @@ sub parse_basic_search { } my ($libraries_to_query,$pretty_domains_string) = &parse_domain_restrictions(); - # Check to see if enough is filled in + # + # Check to see if enough of a query is filled in unless (&filled($ENV{'form.basicexp'})) { &output_blank_field_error($r,$closebutton,'phase=disp_basic'); return OK; @@ -1189,6 +1232,7 @@ sub parse_basic_search { $pretty_search_string .= " with no related words."; } } + # # Build SQL query string based on form page my $query=''; my $concatarg=join(',', @@ -1201,18 +1245,17 @@ sub parse_basic_search { } $pretty_search_string .= "
\n"; my $final_query = 'SELECT * FROM metadata WHERE '.$query; -# &Apache::lonnet::logthis($final_query); + # &Apache::lonnet::logthis($final_query); return ($final_query,$pretty_search_string, $libraries_to_query); } - ###################################################################### ###################################################################### =pod -=item &related_version +=item &related_version() Modifies an input string to include related words. Words in the string are replaced with parenthesized lists of 'OR'd words. For example @@ -1409,6 +1452,11 @@ sub build_date_queries { =item ©right_check() +Inputs: $Metadata, a hash pointer of metadata for a resource. + +Returns: 1 if the resource is available to the user making the query, + 0 otherwise. + =cut ###################################################################### @@ -1432,13 +1480,12 @@ sub copyright_check { return 1; } - ###################################################################### ###################################################################### =pod -=item &ensure_db_and_table +=item &ensure_db_and_table() Ensure we can get lonmysql to connect to the database and the table we need exists. @@ -1494,7 +1541,10 @@ sub ensure_db_and_table { =pod -=item &print_sort_form +=item &print_sort_form() + +The sort feature is not implemented at this time. This form just prints +a link to change the search query. =cut @@ -1595,61 +1645,11 @@ the following format: ##################################################################### ##################################################################### - -my @Datatypes = - ( { name => 'id', - type => 'MEDIUMINT', - restrictions => 'UNSIGNED NOT NULL', - primary_key => 'yes', - auto_inc => 'yes' }, - { name => 'title', type=>'TEXT'}, - { name => 'author', type=>'TEXT'}, - { name => 'subject', type=>'TEXT'}, - { name => 'url', type=>'TEXT', restrictions => 'NOT NULL' }, - { name => 'keywords', type=>'TEXT'}, - { name => 'version', type=>'TEXT'}, - { name => 'notes', type=>'TEXT'}, - { name => 'abstract', type=>'TEXT'}, - { name => 'mime', type=>'TEXT'}, - { name => 'language', type=>'TEXT'}, - { name => 'owner', type=>'TEXT'}, - { name => 'copyright', type=>'TEXT'}, - { name => 'dependencies', type=>'TEXT'}, - { name => 'modifyinguser', type=>'TEXT'}, - { name => 'authorspace', type=>'TEXT'}, - { name => 'lowestgradelevel', type=>'INT'}, - { name => 'highestgradelevel', type=>'INT'}, - { name => 'standards', type=>'TEXT'}, - { name => 'count', type=>'INT'}, - { name => 'course', type=>'INT'}, - { name => 'course_list', type=>'TEXT'}, - { name => 'goto', type=>'INT'}, - { name => 'goto_list', type=>'TEXT'}, - { name => 'comefrom', type=>'INT'}, - { name => 'comefrom_list', type=>'TEXT'}, - { name => 'sequsage', type=>'INT'}, - { name => 'sequsage_list', type=>'TEXT'}, - { name => 'stdno', type=>'INT'}, - { name => 'stdno_list', type=>'TEXT'}, - { name => 'avetries', type=>'FLOAT'}, - { name => 'avetries_list', type=>'TEXT'}, - { name => 'difficulty', type=>'FLOAT'}, - { name => 'difficulty_list', type=>'TEXT'}, - { name => 'clear', type=>'FLOAT'}, - { name => 'technical', type=>'FLOAT'}, - { name => 'correct', type=>'FLOAT'}, - { name => 'helpful', type=>'FLOAT'}, - { name => 'depth', type=>'FLOAT'}, - { name => 'hostname', type=> 'TEXT'}, - #-------------------------------------------------- - { name => 'creationdate', type=>'DATETIME'}, - { name => 'lastrevisiondate', type=>'DATETIME'}, - #-------------------------------------------------- - ); - -my @Fullindicies = - qw/title/; -# qw/title author subject abstract mime language owner copyright/; +# +# These should probably be scoped but I don't have time right now... +# +my @Datatypes; +my @Fullindicies; ###################################################################### ###################################################################### @@ -1669,7 +1669,21 @@ Returns: the identifier of the table on ###################################################################### ###################################################################### +sub set_up_table_structure { + my ($datatypes,$fullindicies) = + &LONCAPA::lonmetadata::describe_metadata_storage(); + unshift(@$datatypes,{name => 'id', + type => 'MEDIUMINT', + restrictions => 'UNSIGNED NOT NULL', + primary_key => 'yes', + auto_inc => 'yes' }); + @Datatypes = @{$datatypes}; + @Fullindicies = @{$fullindicies}; + return; +} + sub create_results_table { + &set_up_table_structure(); my $table = &Apache::lonmysql::create_table ( { columns => \@Datatypes, FULLTEXT => [{'columns' => \@Fullindicies},], @@ -1739,7 +1753,7 @@ sub update_seconds { =pod -=item &revise_button +=item &revise_button() Inputs: None @@ -1766,7 +1780,10 @@ sub revise_button { =pod -=item &run_search +=item &run_search() + +Executes a search query by sending it the the other servers and putting the +results into MySQL. =cut @@ -1802,7 +1819,6 @@ END $r->rflush(); # # Determine the servers we need to contact. - # my @Servers_to_contact; if (defined($serverlist)) { if (ref($serverlist) eq 'ARRAY') { @@ -1830,13 +1846,17 @@ END return; } if (! $table_status) { + &Apache::lonnet::logthis("lonmysql error = ". + &Apache::lonmysql::get_error()); + &Apache::lonnet::logthis("lonmysql debug = ". + &Apache::lonmysql::get_debug()); + &Apache::lonnet::logthis('table status = "'.$table_status.'"'); $r->print("The table id,$table, we tried to use is invalid.". "The search has been aborted."); return; } ## ## Prepare for the big loop. - ## my $hitcountsum; my $server; my $status; @@ -1881,7 +1901,6 @@ END sleep(1); } # - # # Loop through the servers we have contacted but do not # have results from yet, looking for results. while (my ($server,$status) = each(%Server_status)) { @@ -1955,7 +1974,9 @@ END } &update_status($r,&mt('Search Complete').$server); &update_seconds($r,0); + # &Apache::lonmysql::disconnect_from_db(); + # # We have run out of time or run out of servers to talk to and # results to get. $r->print(""); @@ -1971,9 +1992,12 @@ END ###################################################################### ###################################################################### + =pod -=item &prev_next_buttons +=item &prev_next_buttons() + +Returns html for the previous and next buttons on the search results page. =cut @@ -1988,37 +2012,42 @@ sub prev_next_buttons { my $prev_min = $current_min - $show; $prev_min = 1 if $prev_min < 1; if ($prev_min < $current_min) { - $links .= qq{ -prev -}; + $links .= + qq{}. + &mt('prev').''; } else { - $links .= 'prev'; + $links .= &mt('prev'); } ## ## Pages.... Someday. ## - $links .= qq{   -reload -}; + $links .= + qq{  + }. + &mt('reload').''; ## ## Next my $next_min = $current_min + $show; $next_min = $current_min if ($next_min > $total); if ($next_min != $current_min) { - $links .= qq{   -next -}; + $links .= + qq{  + }. + &mt('next').''; } else { - $links .= ' next'; + $links .= ' '.&mt('next'); } return $links; } + ###################################################################### ###################################################################### =pod -=item &display_results +=item &display_results() + +Prints the results out for selection and perusal. =cut @@ -2046,8 +2075,7 @@ sub display_results { ## my $action = "/adm/searchcat?phase=results"; ## - ## Deal with groupsearch - ## + ## Deal with groupsearch by opening the groupsearch db file. if ($ENV{'form.catalogmode'} eq 'groupsearch') { if (! tie(%groupsearch_db,'GDBM_File',$diropendb, &GDBM_WRCREAT(),0640)) { @@ -2058,12 +2086,10 @@ sub display_results { } ## ## Prepare the table for querying - ## my $table = $ENV{'form.table'}; return if (! &ensure_db_and_table($r,$table)); ## ## Get the number of results - ## my $total_results = &Apache::lonmysql::number_of_rows($table); if (! defined($total_results)) { $r->print("A MySQL error has occurred."); @@ -2074,7 +2100,6 @@ sub display_results { } ## ## Determine how many results we need to get - ## $ENV{'form.start'} = 1 if (! exists($ENV{'form.start'})); $ENV{'form.show'} = 'all' if (! exists($ENV{'form.show'})); my $min = $ENV{'form.start'}; @@ -2087,7 +2112,6 @@ sub display_results { } ## ## Output links (if necessary) for 'prev' and 'next' pages. - ## $r->print ('
'. &prev_next_buttons($min,$ENV{'form.show'},$total_results, @@ -2107,12 +2131,10 @@ sub display_results { } ## ## Get results from MySQL table - ## my @Results = &Apache::lonmysql::get_rows($table, 'id>='.$min.' AND id<='.$max); ## ## Loop through the results and output them. - ## foreach my $row (@Results) { if ($connection->aborted()) { &cleanup(); @@ -2190,7 +2212,7 @@ END =pod -=item &parse_row +=item &parse_row() Parse a row returned from the database. @@ -2201,6 +2223,9 @@ Parse a row returned from the database. sub parse_row { my @Row = @_; my %Fields; + if (! scalar(@Datatypes)) { + &set_up_table_structure(); + } for (my $i=0;$i<=$#Row;$i++) { $Fields{$Datatypes[$i]->{'name'}}=&Apache::lonnet::unescape($Row[$i]); } @@ -2236,12 +2261,11 @@ The 'title' field is set to "Untitled" i ########################################################### sub parse_raw_result { my ($result,$hostname) = @_; -# conclude from self to others regarding fields - my %Fields=&Apache::lonmeta::metadata_col_to_hash( - map { - &Apache::lonnet::unescape($_); - } (split(/\,/,$result)) - ); + # conclude from self to others regarding fields + my %Fields=&LONCAPA::lonmetadata::metadata_col_to_hash + (map { + &Apache::lonnet::unescape($_); + } (split(/\,/,$result)) ); return %Fields; } @@ -2291,7 +2315,7 @@ sub handle_custom_fields { =pod -=item &search_results_header +=item &search_results_header() Output the proper html headers and javascript code to deal with different calling modes. @@ -2493,6 +2517,7 @@ ENDFRAMES =item Metadata Viewing Functions Output is a HTML-ified string. + Input arguments are title, author, subject, url, keywords, version, notes, short abstract, mime, language, creation date, last revision date, owner, copyright, hostname, and @@ -2683,10 +2708,9 @@ END sub filled { my ($field)=@_; if ($field=~/\S/ && $field ne 'any') { - return 1; - } - else { - return 0; + return 1; + } else { + return 0; } }