--- loncom/interface/lonsearchcat.pm 2003/09/29 15:28:40 1.188 +++ loncom/interface/lonsearchcat.pm 2003/12/11 21:02:33 1.192.2.1 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Search Catalog # -# $Id: lonsearchcat.pm,v 1.188 2003/09/29 15:28:40 www Exp $ +# $Id: lonsearchcat.pm,v 1.192.2.1 2003/12/11 21:02:33 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -200,7 +200,7 @@ sub handler { &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, ['catalogmode','launch','acts','mode','form','element','pause', 'phase','persistent_db_id','table','start','show', - 'cleargroupsort']); + 'cleargroupsort','titleelement']); ## ## The following is a trick - we wait a few seconds if asked to so ## the daemon running the search can get ahead of the daemon @@ -282,6 +282,10 @@ END $hidden_fields .= ''."\n"; } + if (exists($ENV{'form.titleelement'})) { + $hidden_fields .= ''."\n"; + } if (exists($ENV{'form.mode'})) { $hidden_fields .= ''."\n"; @@ -563,7 +567,7 @@ ENDDOCUMENT my $header=&mt('Advanced Search'); $scrout.=<$header $relatedcheckbox use related words $domaincheckbox only search domain $domain @@ -2038,7 +2042,6 @@ sub update_count_status { sub update_status { my ($r,$text) = @_; $text =~ s/\'/\\\'/g; - $text=&mt($text); $r->print ("\n"); $r->rflush(); @@ -2181,7 +2184,7 @@ END if (@Servers_to_contact) { # Contact one server my $server = shift(@Servers_to_contact); - &update_status($r,'contacting '.$server); + &update_status($r,&mt('contacting').' '.$server); my $reply=&Apache::lonnet::metadata_query($query,$customquery, $customshow,[$server]); ($server) = keys(%$reply); @@ -2193,7 +2196,7 @@ END # left to contact. if (scalar (keys(%Server_status))) { &update_status($r, - 'waiting on '.(join(' ',keys(%Server_status)))); + &mt('waiting on').' '.(join(' ',keys(%Server_status)))); } sleep(1); } @@ -2210,12 +2213,12 @@ END $status=~/^([\.\w]+)$/; my $datafile=$r->dir_config('lonDaemons').'/tmp/'.$1; if (-e $datafile && ! -e "$datafile.end") { - &update_status($r,'Receiving results from '.$server); + &update_status($r,&mt('Receiving results from').' '.$server); next; } last if ($connection->aborted()); if (-e "$datafile.end") { - &update_status($r,'Reading results from '.$server); + &update_status($r,&mt('Reading results from').' '.$server); if (-z "$datafile") { delete($Server_status{$server}); next; @@ -2270,7 +2273,7 @@ END &update_seconds($r,$time_remaining); } } - &update_status($r,'Search Complete'.$server); + &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 @@ -2689,8 +2692,16 @@ Checked for existance & 'edit' mode. =item 'form.form' +Contains the name of the form that has the input fields to set + =item 'form.element' +the name of the input field to put the URL into + +=item 'form.titleelement' + +the name of the input field to put the title into + =back =cut @@ -2727,14 +2738,31 @@ SCRIPT } elsif ($ENV{'form.mode'} eq 'edit') { my $form = $ENV{'form.form'}; my $element = $ENV{'form.element'}; + my $titleelement = $ENV{'form.titleelement'}; + my $changetitle; + if (!$titleelement) { + $changetitle='function changeTitle(val) {}'; + } else { + $changetitle=< function select_data(title,url) { changeURL(url); + changeTitle(title); parent.close(); } -function changeTitle(val) { -} +$changetitle function changeURL(val) { if (parent.targetwin.document) { parent.targetwin.document.forms["$form"].elements["$element"].value=val; @@ -2852,8 +2880,9 @@ extra custom metadata to show. ###################################################################### sub detailed_citation_view { my ($prefix,%values) = @_; + my $icon=&Apache::loncommon::icon($values{'url'}); my $result=<$prefix$prefix$values{'title'}

$values{'author'}, $values{'owner'}
@@ -2886,8 +2915,9 @@ END ###################################################################### sub summary_view { my ($prefix,%values) = @_; + my $icon=&Apache::loncommon::icon($values{'url'}); my $result=<$values{'author'}
$values{'title'}
$values{'owner'} -- $values{'lastrevisiondate'}
@@ -2912,8 +2942,9 @@ END ###################################################################### sub compact_view { my ($prefix,%values) = @_; + my $icon=&Apache::loncommon::icon($values{'url'}); my $result=< +$prefix $values{'title'} $values{'author'}
END @@ -2934,8 +2965,9 @@ END ###################################################################### sub fielded_format_view { my ($prefix,%values) = @_; + my $icon=&Apache::loncommon::icon($values{'url'}); my $result=< URL: $values{'url'}
@@ -3155,7 +3187,6 @@ sub start_fresh_session { sub cleanup { if (tied(%groupsearch_db)) { - &Apache::lonnet::logthis('Cleanup searchcat: groupsearch_db'); unless (untie(%groupsearch_db)) { &Apache::lonnet::logthis('Failed cleanup searchcat: groupsearch_db'); }