Skip to content
Permalink
Browse files

added ability to select default import/export plugin. cfg/cfg.d/plugi…

…ns.pl: $c->{default_export_plugin} = 'EndNote'; $c->{plugins}->{Screen::Import}->{params}->{default_import_plugin} = Import::PubMedID;
  • Loading branch information...
jiadiyao committed Dec 7, 2015
1 parent 7a73baa commit 31436002bc3f7f0420cc3db9659a15a3160e9c9c
Showing with 10 additions and 0 deletions.
  1. +6 −0 perl_lib/EPrints/Plugin/Screen/AbstractSearch.pm
  2. +4 −0 perl_lib/EPrints/Plugin/Screen/Import.pm
@@ -465,6 +465,9 @@ sub render_export_bar
my $feeds = $session->make_doc_fragment;
my $tools = $session->make_doc_fragment;
my $options = {};
# EPrints Services/af05v 2009-03-02 default export plugin
my $default_export_plugin = $session->config( 'default_export_plugin' ) || '_NULL_';
# EPrints Services/af05v end
foreach my $plugin_id ( @plugins )
{
$plugin_id =~ m/^[^:]+::(.*)$/;
@@ -500,6 +503,9 @@ sub render_export_bar
else
{
my $option = $session->make_element( "option", value=>$id );
# EPrints Services/af05v 2009-03-02 select default export plugin
$option->setAttribute( selected => 'selected' ) if( $id eq $default_export_plugin );
# EPrints Services/af05v end
$option->appendChild( $dom_name );
$options->{EPrints::XML::to_string($dom_name)} = $option;
}
@@ -620,6 +620,10 @@ sub render_import_bar
else
{
my $option = $session->make_element( "option", value=>$id );
# EPrints Services/tmb select default plugin
my $default = $self->param( "default_import_plugin" );
$option->setAttribute( "selected", "selected" ) if EPrints::Utils::is_set( $default ) && $default eq $plugin_id;
# EPrints Services/tmb end
$option->appendChild( $dom_name );
$options->{EPrints::XML::to_string($dom_name)} = $option;
}

0 comments on commit 3143600

Please sign in to comment.
You can’t perform that action at this time.