version 1.264, 2006/05/12 16:45:41
|
version 1.275, 2006/07/31 19:45:58
|
Line 78 use HTML::Entities();
|
Line 78 use HTML::Entities();
|
use Parse::RecDescent; |
use Parse::RecDescent; |
use Apache::lonnavmaps; |
use Apache::lonnavmaps; |
use Apache::lonindexer(); |
use Apache::lonindexer(); |
|
use lib '/home/httpd/lib/perl/'; |
|
use LONCAPA; |
|
|
###################################################################### |
###################################################################### |
###################################################################### |
###################################################################### |
Line 153 sub handler {
|
Line 155 sub handler {
|
## |
## |
my $domain = $r->dir_config('lonDefDomain'); |
my $domain = $r->dir_config('lonDefDomain'); |
$diropendb= "/home/httpd/perl/tmp/". |
$diropendb= "/home/httpd/perl/tmp/". |
"$env{'user.domain'}_$env{'user.name'}_searchcat.db"; |
"$env{'user.domain'}_$env{'user.name'}_sel_res.db"; |
# |
# |
# set the name of the persistent database |
# set the name of the persistent database |
# $env{'form.persistent_db_id'} can only have digits in it. |
# $env{'form.persistent_db_id'} can only have digits in it. |
Line 164 sub handler {
|
Line 166 sub handler {
|
} |
} |
|
|
my $persistent_db_file = "/home/httpd/perl/tmp/". |
my $persistent_db_file = "/home/httpd/perl/tmp/". |
&Apache::lonnet::escape($domain). |
&escape($domain). |
'_'.&Apache::lonnet::escape($env{'user.name'}). |
'_'.&escape($env{'user.name'}). |
'_'.$env{'form.persistent_db_id'}.'_persistent_search.db'; |
'_'.$env{'form.persistent_db_id'}.'_persistent_search.db'; |
## |
## |
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
Line 213 sub handler {
|
Line 215 sub handler {
|
untie %groupsearch_db if (tied(%groupsearch_db)); |
untie %groupsearch_db if (tied(%groupsearch_db)); |
if (($env{'form.cleargroupsort'} eq '1') || |
if (($env{'form.cleargroupsort'} eq '1') || |
(($env{'form.launch'} eq '1') && |
(($env{'form.launch'} eq '1') && |
($env{'form.catalogmode'} eq 'groupsearch'))) { |
($env{'form.catalogmode'} eq 'import'))) { |
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; |
Line 258 sub handler {
|
Line 260 sub handler {
|
$closebutton .="onClick='self.close()'"; |
$closebutton .="onClick='self.close()'"; |
} |
} |
$closebutton .=">\n"; |
$closebutton .=">\n"; |
} elsif ($env{'form.catalogmode'} eq 'groupsearch') { |
} elsif ($env{'form.catalogmode'} eq 'import') { |
$closebutton="<input type='button' name='close' value='CLOSE' "; |
$closebutton="<input type='button' name='close' value='CLOSE' "; |
if ($env{'form.phase'} =~ /(results|run_search)/) { |
if ($env{'form.phase'} =~ /(results|run_search)/) { |
$closebutton .="onClick='parent.close()'"; |
$closebutton .="onClick='parent.close()'"; |
Line 551 sub course_search {
|
Line 553 sub course_search {
|
} else { |
} else { |
$url .= '?symb='; |
$url .= '?symb='; |
} |
} |
$url .= &Apache::lonnet::escape($resource->symb()); |
$url .= &escape($resource->symb()); |
my $title = $resource->compTitle(); |
my $title = $resource->compTitle(); |
$r->print('<br /><a href="'.$url.'" target="cat">'. |
$r->print('<br /><a href="'.$url.'" target="cat">'. |
($title?$title:$url).'</a> - '.$disctype.'<br />'); |
($title?$title:$url).'</a> - '.$disctype.'<br />'); |
Line 587 sub checkonthis {
|
Line 589 sub checkonthis {
|
my ($extension)=($url=~/\.(\w+)$/); |
my ($extension)=($url=~/\.(\w+)$/); |
if (&Apache::loncommon::fileembstyle($extension) eq 'ssi' && |
if (&Apache::loncommon::fileembstyle($extension) eq 'ssi' && |
($url) && ($fulltext)) { |
($url) && ($fulltext)) { |
$result.=&Apache::lonnet::ssi_body($url.'?symb='.&Apache::lonnet::escape($symb)); |
$result.=&Apache::lonnet::ssi_body($url.'?symb='.&escape($symb)); |
} |
} |
$result=~s/\s+/ /gs; |
$result=~s/\s+/ /gs; |
my $applies = 0; |
my $applies = 0; |
Line 603 sub checkonthis {
|
Line 605 sub checkonthis {
|
$href=&Apache::lonenc::encrypted($href) |
$href=&Apache::lonenc::encrypted($href) |
.'?symb='.&Apache::lonenc::encrypted($symb); |
.'?symb='.&Apache::lonenc::encrypted($symb); |
} else { |
} else { |
$href.='?symb='.&Apache::lonnet::escape($symb); |
$href.='?symb='.&escape($symb); |
} |
} |
$r->print('<a href="'.$href.'" target="cat">'.($title?$title:$url). |
$r->print('<a href="'.$href.'" target="cat">'.($title?$title:$url). |
'</a><br />'); |
'</a><br />'); |
Line 658 Prints the form for the basic search. S
|
Line 660 Prints the form for the basic search. S
|
###################################################################### |
###################################################################### |
sub print_basic_search_form { |
sub print_basic_search_form { |
my ($r,$closebutton,$hidden_fields) = @_; |
my ($r,$closebutton,$hidden_fields) = @_; |
my $result = ($env{'form.catalogmode'} ne 'groupsearch'); |
my $result = ($env{'form.catalogmode'} ne 'import'); |
my $bread_crumb = |
my $bread_crumb = |
&Apache::lonhtmlcommon::breadcrumbs('Searching','Search_Basic', |
&Apache::lonhtmlcommon::breadcrumbs('Searching','Search_Basic', |
$env{'form.catalogmode'} ne 'groupsearch'); |
$env{'form.catalogmode'} ne 'import'); |
my $scrout = &Apache::loncommon::start_page('Search').$bread_crumb; |
my $scrout = &Apache::loncommon::start_page('Search').$bread_crumb; |
if (&Apache::lonnet::allowed('bre',$env{'request.role.domain'})) { |
if (&Apache::lonnet::allowed('bre',$env{'request.role.domain'})) { |
# Define interface components |
# Define interface components |
Line 792 sub print_advanced_search_form{
|
Line 794 sub print_advanced_search_form{
|
my ($r,$closebutton,$hidden_fields) = @_; |
my ($r,$closebutton,$hidden_fields) = @_; |
my $bread_crumb = |
my $bread_crumb = |
&Apache::lonhtmlcommon::breadcrumbs('Searching','Search_Advanced', |
&Apache::lonhtmlcommon::breadcrumbs('Searching','Search_Advanced', |
$env{'form.catalogmode'} ne 'groupsearch'); |
$env{'form.catalogmode'} ne 'import'); |
my %lt=&Apache::lonlocal::texthash('srch' => 'Search', |
my %lt=&Apache::lonlocal::texthash('srch' => 'Search', |
'reset' => 'Reset', |
'reset' => 'Reset', |
'help' => 'Help'); |
'help' => 'Help'); |
Line 1147 sub get_persistent_form_data {
|
Line 1149 sub get_persistent_form_data {
|
# End kludge (hopefully) |
# End kludge (hopefully) |
next if (exists($env{$name})); |
next if (exists($env{$name})); |
my @values = map { |
my @values = map { |
&Apache::lonnet::unescape($_); |
&unescape($_); |
} split(',',$persistent_db{$name}); |
} split(',',$persistent_db{$name}); |
next if (@values <1); |
next if (@values <1); |
if ($arrays_allowed{$name}) { |
if ($arrays_allowed{$name}) { |
Line 1193 sub get_persistent_data {
|
Line 1195 sub get_persistent_data {
|
next; |
next; |
} |
} |
my @values = map { |
my @values = map { |
&Apache::lonnet::unescape($_); |
&unescape($_); |
} split(',',$persistent_db{$name}); |
} split(',',$persistent_db{$name}); |
if (@values <= 1) { |
if (@values <= 1) { |
push @Values,$values[0]; |
push @Values,$values[0]; |
Line 1230 sub make_persistent {
|
Line 1232 sub make_persistent {
|
foreach my $name (keys(%save)) { |
foreach my $name (keys(%save)) { |
my @values = (ref($save{$name}) ? @{$save{$name}} : ($save{$name})); |
my @values = (ref($save{$name}) ? @{$save{$name}} : ($save{$name})); |
# We handle array references, but not recursively. |
# We handle array references, but not recursively. |
my $store = join(',', map { &Apache::lonnet::escape($_); } @values ); |
my $store = join(',', map { &escape($_); } @values ); |
$persistent_db{$name} = $store; |
$persistent_db{$name} = $store; |
} |
} |
untie(%persistent_db); |
untie(%persistent_db); |
Line 1313 sub parse_advanced_search {
|
Line 1315 sub parse_advanced_search {
|
foreach ('mode','form','element') { |
foreach ('mode','form','element') { |
# is this required? Hmmm. |
# is this required? Hmmm. |
next if (! exists($env{'form.'.$_})); |
next if (! exists($env{'form.'.$_})); |
$env{'form.'.$_}=&Apache::lonnet::unescape($env{'form.'.$_}); |
$env{'form.'.$_}=&unescape($env{'form.'.$_}); |
$env{'form.'.$_}=~s/[^\w\/\s\(\)\=\-\"\']//g; |
$env{'form.'.$_}=~s/[^\w\/\s\(\)\=\-\"\']//g; |
} |
} |
# Preprocess the category form element. |
# Preprocess the category form element. |
Line 1538 sub parse_domain_restrictions {
|
Line 1540 sub parse_domain_restrictions {
|
$domain_hash{$_}++; |
$domain_hash{$_}++; |
} |
} |
if ($domain_hash{'any'}) { |
if ($domain_hash{'any'}) { |
$pretty_domains_string = "In all LON-CAPA domains."; |
$pretty_domains_string = &mt("in all LON-CAPA domains."); |
} else { |
} else { |
if (@allowed_domains > 1) { |
if (@allowed_domains > 1) { |
$pretty_domains_string = "In LON-CAPA domains:"; |
$pretty_domains_string = &mt("in LON-CAPA domains:"); |
} else { |
} else { |
$pretty_domains_string = "In LON-CAPA domain "; |
$pretty_domains_string = &mt("in LON-CAPA domain "); |
} |
} |
foreach (sort @allowed_domains) { |
foreach (sort @allowed_domains) { |
$pretty_domains_string .= "<b>".$_."</b> "; |
$pretty_domains_string .= "<b>".$_."</b> "; |
Line 1581 sub parse_basic_search {
|
Line 1583 sub parse_basic_search {
|
foreach ('mode','form','element') { |
foreach ('mode','form','element') { |
# is this required? Hmmm. |
# is this required? Hmmm. |
next unless (exists($env{"form.$_"})); |
next unless (exists($env{"form.$_"})); |
$env{"form.$_"}=&Apache::lonnet::unescape($env{"form.$_"}); |
$env{"form.$_"}=&unescape($env{"form.$_"}); |
$env{"form.$_"}=~s/[^\w\/\s\(\)\=\-\"\']//g; |
$env{"form.$_"}=~s/[^\w\/\s\(\)\=\-\"\']//g; |
} |
} |
my ($libraries_to_query,$pretty_domains_string) = &parse_domain_restrictions(); |
my ($libraries_to_query,$pretty_domains_string) = &parse_domain_restrictions(); |
Line 1612 sub parse_basic_search {
|
Line 1614 sub parse_basic_search {
|
#} |
#} |
my $final_query = 'SELECT * FROM metadata WHERE '.join(" AND ",@Queries); |
my $final_query = 'SELECT * FROM metadata WHERE '.join(" AND ",@Queries); |
# |
# |
|
if ($env{'form.related'}) { |
|
$pretty_search_string.=' '.&mt('(including related words)'); |
|
} |
if (defined($pretty_domains_string) && $pretty_domains_string ne '') { |
if (defined($pretty_domains_string) && $pretty_domains_string ne '') { |
$pretty_search_string .= ' '.$pretty_domains_string; |
$pretty_search_string .= ' '.$pretty_domains_string; |
} |
} |
Line 2102 sub print_sort_form {
|
Line 2107 sub print_sort_form {
|
END |
END |
|
|
my $start_page = &Apache::loncommon::start_page('Results',$js, |
my $start_page = &Apache::loncommon::start_page('Results',$js, |
{'only_body' => 1}); |
{'no_title' => 1}); |
my $breadcrumbs= |
my $breadcrumbs= |
&Apache::lonhtmlcommon::breadcrumbs('Searching','Searching', |
&Apache::lonhtmlcommon::breadcrumbs('Searching','Searching', |
$env{'form.catalogmode'} ne 'groupsearch'); |
$env{'form.catalogmode'} ne 'import'); |
|
|
my $result = <<END; |
my $result = <<END; |
$start_page |
$start_page |
$breadcrumbs |
$breadcrumbs |
<form name="statusform" action="" method="POST"> |
<form name="statusform" action="" method="post" target="_top"> |
<input type="hidden" name="Queue" value="" /> |
<input type="hidden" name="catalogmode" value="import" /> |
|
<input type="hidden" name="acts" value="" /> |
END |
END |
|
|
#<h2>Sort Results</h2> |
#<h2>Sort Results</h2> |
Line 2130 END
|
Line 2136 END
|
<p> |
<p> |
There are $total_results matches to your query. $revise |
There are $total_results matches to your query. $revise |
</p><p> |
</p><p> |
Search:$pretty_query_string |
Search: $pretty_query_string |
</p> |
</p> |
</form> |
</form> |
END |
END |
Line 2332 sub run_search {
|
Line 2338 sub run_search {
|
# Print run_search header |
# Print run_search header |
# |
# |
my $start_page = &Apache::loncommon::start_page('Search Status',undef, |
my $start_page = &Apache::loncommon::start_page('Search Status',undef, |
{'only_body' => 1}); |
{'no_title' => 1}); |
my $breadcrumbs = |
my $breadcrumbs = |
&Apache::lonhtmlcommon::breadcrumbs('Searching','Searching', |
&Apache::lonhtmlcommon::breadcrumbs('Searching','Searching', |
$env{'form.catalogmode'} ne 'groupsearch'); |
$env{'form.catalogmode'} ne 'import'); |
$r->print(<<END); |
$r->print(<<END); |
$start_page |
$start_page |
$breadcrumbs |
$breadcrumbs |
<form name="statusform" action="" method="post"> |
<form name="statusform" action="" method="post"> |
<input type="hidden" name="Queue" value="" /> |
<input type="hidden" name="acts" value="" /> |
END |
END |
# Remove leading and trailing <br /> |
# Remove leading and trailing <br /> |
$pretty_string =~ s:^\s*<br />::i; |
$pretty_string =~ s:^\s*<br />::i; |
Line 2525 END
|
Line 2531 END
|
# results to get, so let the client know the top frame needs to be |
# results to get, so let the client know the top frame needs to be |
# loaded from /adm/searchcat |
# loaded from /adm/searchcat |
$r->print(&Apache::loncommon::end_page()); |
$r->print(&Apache::loncommon::end_page()); |
# if ($env{'form.catalogmode'} ne 'groupsearch') { |
# if ($env{'form.catalogmode'} ne 'import') { |
$r->print("<script>". |
$r->print("<script>". |
"window.location='/adm/searchcat?". |
"window.location='/adm/searchcat?". |
"phase=sort&". |
"phase=sort&". |
Line 2592 sub display_results {
|
Line 2598 sub display_results {
|
} |
} |
## |
## |
## $checkbox_num is a count of the number of checkboxes output on the |
## $checkbox_num is a count of the number of checkboxes output on the |
## page this is used only during catalogmode=groupsearch. |
## page this is used only during catalogmode=import. |
my $checkbox_num = 0; |
my $checkbox_num = 0; |
## |
## |
## Get the catalog controls setup |
## Get the catalog controls setup |
## |
## |
my $action = "/adm/searchcat?phase=results"; |
my $action = "/adm/searchcat?phase=results"; |
## |
## |
## Deal with groupsearch by opening the groupsearch db file. |
## Deal with import by opening the import db file. |
if ($env{'form.catalogmode'} eq 'groupsearch') { |
if ($env{'form.catalogmode'} eq 'import') { |
if (! tie(%groupsearch_db,'GDBM_File',$diropendb, |
if (! tie(%groupsearch_db,'GDBM_File',$diropendb, |
&GDBM_WRCREAT(),0640)) { |
&GDBM_WRCREAT(),0640)) { |
$r->print('Unable to store import results.</form>'. |
$r->print('Unable to store import results.</form>'. |
Line 2823 onClick="javascript:select_data('$title'
|
Line 2829 onClick="javascript:select_data('$title'
|
</font> |
</font> |
END |
END |
} |
} |
} elsif ($env{'form.catalogmode'} eq 'groupsearch') { |
} elsif ($env{'form.catalogmode'} eq 'import') { |
$groupsearch_db{"pre_${fnum}_link"}=$url; |
$groupsearch_db{"pre_${fnum}_link"}=$url; |
$groupsearch_db{"pre_${fnum}_title"}=$title; |
$groupsearch_db{"pre_${fnum}_title"}=$title; |
$output.=<<END; |
$output.=<<END; |
Line 2855 sub parse_row {
|
Line 2861 sub parse_row {
|
&set_up_table_structure(); |
&set_up_table_structure(); |
} |
} |
for (my $i=0;$i<=$#Row;$i++) { |
for (my $i=0;$i<=$#Row;$i++) { |
$Fields{$Datatypes[$i]->{'name'}}=&Apache::lonnet::unescape($Row[$i]); |
$Fields{$Datatypes[$i]->{'name'}}=&unescape($Row[$i]); |
} |
} |
$Fields{'language'} = |
$Fields{'language'} = |
&Apache::loncommon::languagedescription($Fields{'language'}); |
&Apache::loncommon::languagedescription($Fields{'language'}); |
Line 2892 sub parse_raw_result {
|
Line 2898 sub parse_raw_result {
|
# conclude from self to others regarding fields |
# conclude from self to others regarding fields |
my %Fields=&LONCAPA::lonmetadata::metadata_col_to_hash |
my %Fields=&LONCAPA::lonmetadata::metadata_col_to_hash |
(map { |
(map { |
&Apache::lonnet::unescape($_); |
&unescape($_); |
} (split(/\,/,$result)) ); |
} (split(/\,/,$result)) ); |
return %Fields; |
return %Fields; |
} |
} |
Line 2930 sub handle_custom_fields {
|
Line 2936 sub handle_custom_fields {
|
if ($result=~/^(custom\=.*)$/) { # grab all custom metadata |
if ($result=~/^(custom\=.*)$/) { # grab all custom metadata |
my $tmp=$result; |
my $tmp=$result; |
$tmp=~s/^custom\=//; |
$tmp=~s/^custom\=//; |
my ($k,$v)=map {&Apache::lonnet::unescape($_); |
my ($k,$v)=map {&unescape($_); |
} split(/\,/,$tmp); |
} split(/\,/,$tmp); |
$customhash{$k}=$v; |
$customhash{$k}=$v; |
} |
} |
Line 2962 The following environment variables are
|
Line 2968 The following environment variables are
|
|
|
=item 'form.catalogmode' |
=item 'form.catalogmode' |
|
|
Checked for 'interactive' and 'groupsearch'. |
Checked for 'interactive' and 'import'. |
|
|
=item 'form.mode' |
=item 'form.mode' |
|
|
Line 3054 function changeURL(val) {
|
Line 3060 function changeURL(val) {
|
SCRIPT |
SCRIPT |
} |
} |
} |
} |
$js.=<<SCRIPT if $env{'form.catalogmode'} eq 'groupsearch'; |
$js.=<<SCRIPT if $env{'form.catalogmode'} eq 'import'; |
<script type="text/javascript"> |
<script type="text/javascript"> |
function queue(checkbox_num,val) { |
function queue(checkbox_num,val) { |
if (document.forms.results.returnvalues.length != "undefined" && |
if (document.forms.results.returnvalues.length != "undefined" && |
typeof(document.forms.results.returnvalues.length) == "number") { |
typeof(document.forms.results.returnvalues.length) == "number") { |
if (document.forms.results.returnvalues[checkbox_num].checked) { |
if (document.forms.results.returnvalues[checkbox_num].checked) { |
parent.statusframe.document.forms.statusform.elements.Queue.value +='1a'+val+'b'; |
parent.statusframe.document.forms.statusform.elements.acts.value +='1a'+val+'b'; |
} else { |
} else { |
parent.statusframe.document.forms.statusform.elements.Queue.value +='0a'+val+'b'; |
parent.statusframe.document.forms.statusform.elements.acts.value +='0a'+val+'b'; |
} |
} |
} else { |
} else { |
if (document.forms.results.returnvalues.checked) { |
if (document.forms.results.returnvalues.checked) { |
parent.statusframe.document.forms.statusform.elements.Queue.value +='1a'+val+'b'; |
parent.statusframe.document.forms.statusform.elements.acts.value +='1a'+val+'b'; |
} else { |
} else { |
parent.statusframe.document.forms.statusform.elements.Queue.value +='0a'+val+'b'; |
parent.statusframe.document.forms.statusform.elements.acts.value +='0a'+val+'b'; |
} |
} |
} |
} |
} |
} |
function select_group() { |
function select_group() { |
parent.window.location= |
parent.window.location= |
"/adm/groupsort?mode=$env{'form.mode'}&catalogmode=groupsearch&acts="+ |
"/adm/groupsort?mode=$env{'form.mode'}&catalogmode=import&acts="+ |
parent.statusframe.document.forms.statusform.elements.Queue.value; |
parent.statusframe.document.forms.statusform.elements.acts.value; |
} |
} |
</script> |
</script> |
SCRIPT |
SCRIPT |
Line 3084 SCRIPT
|
Line 3090 SCRIPT
|
{'only_body' =>1}); |
{'only_body' =>1}); |
my $result=<<END; |
my $result=<<END; |
$start_page |
$start_page |
<form name="results" method="post" action="/adm/searchcat" > |
<form name="results" method="post" action="/adm/searchcat"> |
<input type="hidden" name="Queue" value="" /> |
|
$importbutton |
$importbutton |
END |
END |
return $result; |
return $result; |
} |
} |
|
|
###################################################################### |
|
###################################################################### |
|
sub search_status_header { |
|
my $start_page = &Apache::loncommon::start_page('Search Status',undef, |
|
{'only_body' => 1}); |
|
return <<ENDSTATUS; |
|
$start_page |
|
<h3>Search Status</h3> |
|
Sending search request to LON-CAPA servers.<br /> |
|
ENDSTATUS |
|
} |
|
|
|
sub results_link { |
sub results_link { |
my $basic_link = "/adm/searchcat?"."&table=".$env{'form.table'}. |
my $basic_link = "/adm/searchcat?"."&table=".$env{'form.table'}. |
"&persistent_db_id=".$env{'form.persistent_db_id'}; |
"&persistent_db_id=".$env{'form.persistent_db_id'}; |
Line 3207 sub detailed_citation_view {
|
Line 3200 sub detailed_citation_view {
|
my ($prefix,%values) = @_; |
my ($prefix,%values) = @_; |
my $result; |
my $result; |
my $jumpurl=$values{'url'}; |
my $jumpurl=$values{'url'}; |
$jumpurl=~s/^\/ext\//http\:\/\//; |
$jumpurl=~s|^/ext/|http://|; |
$result .= '<b>'.$prefix. |
$result .= '<b>'.$prefix. |
'<img src="'.&Apache::loncommon::icon($values{'url'}).' " />'.' '. |
'<img src="'.&Apache::loncommon::icon($values{'url'}).'" />'.' '. |
'<a href="'.$jumpurl.'" '. |
'<a href="'.$jumpurl.'" '. |
'target="search_preview">'.$values{'title'}."</a></b>\n"; |
'target="preview">'.$values{'title'}."</a></b>\n"; |
$result .= "<p>\n"; |
$result .= "<p>\n"; |
$result .= '<b>'.$values{'author'}.'</b>,'. |
$result .= '<b>'.$values{'author'}.'</b>,'. |
' <i>'.$values{'owner'}.'</i><br />'; |
' <i>'.$values{'owner'}.'</i><br />'; |
Line 3275 sub detailed_citation_view {
|
Line 3268 sub detailed_citation_view {
|
next if (! exists($values{$field->{'name'}}) || |
next if (! exists($values{$field->{'name'}}) || |
$values{$field->{'name'}} eq ''); |
$values{$field->{'name'}} eq ''); |
if (exists($field->{'type'}) && $field->{'type'} eq 'list') { |
if (exists($field->{'type'}) && $field->{'type'} eq 'list') { |
$result .= '<b>'.&mt($field->{'translate'}).'</b><ul>'; |
$result .= '<b>'.&mt($field->{'translate'}).'</b>'; |
foreach my $item (split(',',$values{$field->{'name'}})){ |
foreach my $item (split(',',$values{$field->{'name'}})){ |
$result .= '<li>'. |
$result .= |
'<a target="search_preview" '. |
&Apache::lonhtmlcommon::crumbs(&Apache::lonnet::clutter($item), |
'href="'.$jumpurl.'">'.$item.'</a></li>'; |
'preview', |
|
'', |
|
(($env{'form.catalogmode'} eq 'import')?'parent.statusframe.document.forms.statusform':''),2,0,1); |
} |
} |
$result .= '</ul>'; |
|
} elsif (exists($field->{'format'}) && $field->{'format'} ne ''){ |
} elsif (exists($field->{'format'}) && $field->{'format'} ne ''){ |
$result.= &mt($field->{'translate'}, |
$result.= &mt($field->{'translate'}, |
sprintf($field->{'format'}, |
sprintf($field->{'format'}, |
$values{$field->{'name'}}))."<br />\n"; |
$values{$field->{'name'}}))."<br />\n"; |
} else { |
} else { |
if ($field->{'special'} eq 'url link') { |
if ($field->{'special'} eq 'url link') { |
$result.= |
if ($jumpurl=~/^http\:\/\//) { |
&mt($field->{'translate'}, |
$result.='<tt>'.$jumpurl.'</tt>'; |
'<a href="'.$jumpurl.'" '. |
} else { |
'target="search_preview">'. |
$result .= |
$values{$field->{'name'}}. |
&Apache::lonhtmlcommon::crumbs($jumpurl, |
'</a>'); |
'preview', |
|
'', |
|
(($env{'form.catalogmode'} eq 'import')?'parent.statusframe.document.forms.statusform':''),3,0,1); |
|
} |
} else { |
} else { |
$result.= &mt($field->{'translate'}, |
$result.= &mt($field->{'translate'}, |
$values{$field->{'name'}}); |
$values{$field->{'name'}}); |
Line 3349 sub summary_view {
|
Line 3346 sub summary_view {
|
$result .= ' '.$tmp.' '; |
$result .= ' '.$tmp.' '; |
} |
} |
my $jumpurl=$values{'url'}; |
my $jumpurl=$values{'url'}; |
$jumpurl=~s/^\/ext\//http\:\/\//; |
my $link; |
|
if ($jumpurl=~m|^/ext/|) { |
|
$jumpurl=~s|^/ext/|http://|; |
|
$link='<br /><tt>'.$jumpurl.'</tt>'; |
|
} else { |
|
$link=&Apache::lonhtmlcommon::crumbs($jumpurl, |
|
'preview', |
|
'', |
|
(($env{'form.catalogmode'} eq 'import')?'parent.statusframe.document.forms.statusform':''),2,0,1); |
|
} |
$result.=<<END; |
$result.=<<END; |
<a href="$jumpurl" |
<a href="$jumpurl" |
target='search_preview'>$values{'title'}</a><br /> |
target='preview'>$values{'title'}</a>$link |
$values{'author'}, $values{'owner'} -- $values{'lastrevisiondate'}<br /> |
$values{'author'}, $values{'owner'} -- $values{'lastrevisiondate'}<br /> |
$values{'copyrighttag'}<br /> |
$values{'copyrighttag'}<br /> |
$values{'extrashow'} |
$values{'extrashow'} |
Line 3386 sub summary_preview {
|
Line 3391 sub summary_preview {
|
sub compact_view { |
sub compact_view { |
my ($prefix,%values) = @_; |
my ($prefix,%values) = @_; |
my $jumpurl=$values{'url'}; |
my $jumpurl=$values{'url'}; |
$jumpurl=~s/^\/ext\//http\:\/\//; |
my $link; |
|
if ($jumpurl=~m|^/ext/|) { |
|
$jumpurl=~s|^/ext/|http://|; |
|
$link='<tt>'.$jumpurl.'</tt>'; |
|
} else { |
|
$link=&Apache::lonhtmlcommon::crumbs($jumpurl, |
|
'preview', |
|
'', |
|
(($env{'form.catalogmode'} eq 'import')?'parent.statusframe.document.forms.statusform':''),1,1,1).' '; |
|
} |
my $result = |
my $result = |
$prefix.'<img src="'.&Apache::loncommon::icon($values{'url'}).'">'; |
$prefix.'<img src="'.&Apache::loncommon::icon($values{'url'}).'">'; |
if (exists($env{'form.sortfield'}) && |
if (exists($env{'form.sortfield'}) && |
Line 3396 sub compact_view {
|
Line 3409 sub compact_view {
|
if (! defined($tmp)) { $tmp = 'undefined'; } |
if (! defined($tmp)) { $tmp = 'undefined'; } |
$result .= ' '.$tmp.' '; |
$result .= ' '.$tmp.' '; |
} |
} |
$result.=' <a href="'.$jumpurl.'" target="search_preview">'. |
$result.=' <a href="'.$jumpurl.'" target="preview">'. |
$values{'title'}.'</a>'.(' 'x2). |
$values{'title'}.'</a>'.(' 'x2).$link. |
'<b>'.$values{'author'}.'</b> ('.$values{'domain'}.')<br />'; |
'<b>'.$values{'author'}.'</b> ('.$values{'domain'}.')<br />'; |
return $result; |
return $result; |
} |
} |
Line 3419 sub fielded_format_view {
|
Line 3432 sub fielded_format_view {
|
my $icon=&Apache::loncommon::icon($values{'url'}); |
my $icon=&Apache::loncommon::icon($values{'url'}); |
my %Translated = &Apache::lonmeta::fieldnames(); |
my %Translated = &Apache::lonmeta::fieldnames(); |
my $jumpurl=$values{'url'}; |
my $jumpurl=$values{'url'}; |
$jumpurl=~s/^\/ext\//http\:\/\//; |
$jumpurl=~s|^/ext/|http://|; |
|
|
my $result=<<END; |
my $result=<<END; |
$prefix <img src="$icon" /> |
$prefix <img src="$icon" /> |
<dl> |
<dl> |
<dt>URL:</dt> |
<dt>URL:</dt> |
<dd><a href="$jumpurl" |
<dd><a href="$jumpurl" |
target='search_preview'>$values{'url'}</a></dd> |
target='preview'>$values{'url'}</a></dd> |
END |
END |
foreach my $field ('title','author','domain','subject','keywords','notes', |
foreach my $field ('title','author','domain','subject','keywords','notes', |
'mimetag','language','creationdate','lastrevisiondate', |
'mimetag','language','creationdate','lastrevisiondate', |