[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]



PluginTestA can be disabled by adding archive-level config (e.g. to ~/archives/ARCHIVEID/cfg/cfg.d/z_plugin_test.pl):
$c->{plugins}->{"Screen::PluginTestA"}->{params}->{disable} = 1;
but my understanding is that it should be disabled by default, and explicitly enabled when needed.

If you can test this, I'd appreciate it. Might be worth including the version of EPrints you're running too.
Cheers,
John


~/lib/plugins/EPrints/Plugin/Screen/PluginTestA.pm
####################################################################
package EPrints::Plugin::Screen::PluginTestA;

our @ISA = ( 'EPrints::Plugin::Screen' );

use strict;

sub new
{
       my( $class, %params ) = @_;
       my $self = $class->SUPER::new(%params);
       return $self;
}

sub render
{
       my( $self ) = @_;
       my $repo = $self->{repository};
       my $page = $repo->xml->create_element( "div" );
       $page->appendChild( $repo->xml->create_text_node( "This should be disabled by default" ) );
       return $page;
}

sub render_title
{
       my( $self ) = @_;
       my $f = $self->{repository}->make_doc_fragment;
       $f->appendChild( $self->{repository}->xml->create_text_node( "This is: PluginTestA" ) );
       return $f;
}
1;
####################################################################

~/lib/plugins/EPrints/Plugin/Screen/PluginTestB.pm
####################################################################
package EPrints::Plugin::Screen::PluginTestB;

our @ISA = ( 'EPrints::Plugin::Screen' );

use strict;

sub new
{
       my( $class, %params ) = @_;
       my $self = $class->SUPER::new(%params);
       $self->{disable} = 1;
       return $self;
}

sub render
{
       my( $self ) = @_;
       my $repo = $self->{repository};
       my $page = $repo->xml->create_element( "div" );
       $page->appendChild( $repo->xml->create_text_node( "This is explicitly disabled" ) );
       return $page;
}

sub render_title
{
       my( $self ) = @_;

       my $f = $self->{repository}->make_doc_fragment;
       $f->appendChild( $self->{repository}->xml->create_text_node( "This is: PluginTestB" ) );

       return $f;
}
1;
####################################################################


*** Options: http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
*** Archive: http://www.eprints.org/tech.php/
*** EPrints community wiki: http://wiki.eprints.org/
*** EPrints developers Forum: http://forum.eprints.org/

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ecs.soton.ac.uk/pipermail/eprints-tech/attachments/20151102/43ef7c57/attachment-0001.html