package EPrints::Plugin::Screen::CreateFromContainers; use EPrints::Plugin::Screen::Containers; @ISA = ( 'EPrints::Plugin::Screen::Containers' ); use strict; sub new { my( $class, %params ) = @_; my $self = $class->SUPER::new(%params); $self->{appears} = [ { place => "item_tools", position => 120, } ]; return $self; } sub can_be_viewed { my ( $self ) = @_; if ($self->allow( "container/use" )) { # check that the user is either associated with a container or # they own an eprint in a container my $session = $self->{session}; my $user = $session->current_user; my $list = $session->get_repository->call( "get_allowed_containers", $user, $session ); if (defined $list && $list->count > 0) { return $self->allow( "container/use" ); } } return 0; } sub render { my( $self ) = @_; return $self->render_details( "container_create_item_actions", 0 ); } 1;