Tech List

[index] [prev] [next] [options] [help]
See the Mailing Lists Page for how to subscribe and unsubscribe.

eprints_tech messages

Please note: this page shows emails that have been sent to the eprints_tech mailing list. Some of these may be spam emails we have failed to filter.

[EP-tech] Re: Phrases based on eprint type

From: Alfons Wittmann <alfons.wittmann AT ku-eichstaett.de>
Date: Fri, 07 Nov 2008 01:04:16 +0100


Threading: [EP-tech] Re: Phrases based on eprint type from d.dickinson AT qut.edu.au
      • This Message
             [EP-tech] Re: Phrases based on eprint type from alfons.wittmann AT ku-eichstaett.de

http://mailman.ecs.soton.ac.uk/mailman/listinfo/eprints-tech
*** EPrints community wiki - http://wiki.eprints.org/
Stephen Shorrock schrieb am 06.11.2008 18:51:
> The EPrint's ID seems to be accessible through the session object, so 
> adding to the code you already provided we could do something like the 
> following:
> 
> my $type_specific_phrasename = $phrasename;
> my %types;
> my  AT types = map ( 
> 
EPrints::DataObj::EPrint->new($session,$_)->get_value("type") , 

>  AT {$session->{query}->{eprintid}}  );
> @types{ AT types}=();
> if (scalar(keys(%types))==1){
>     $type_specific_phrasename.="#".$types[0];
> }
> 
> It seems to work for the workflow scenario I've tried, and I would be 
> interested whether the same technique would work for the field titles.

Shorter code, based on your solution (thanks!!):

my $eptype = EPrints::DataObj::EPrint->new( $session,
   $session->{query}->{eprintid}->[0] )->get_type;
$phrasename .= "#$eptype"
   if $session->get_lang->has_phrase("$phrasename#$eptype");

Works nice for me, also for field titles, which are rendered in
EPrints::Metafield::render_name

Regards, Alfons

--
Universitätsbibliothek Eichstätt-Ingolstadt
EDV-Referat                    Tel: 08421/93-1486 - Fax: 08421/93-1791
Universitätsallee 1            EMail: alfons.wittmann AT ku-eichstaett.de
85071 Eichstätt                http://www.ku-eichstaett.de/Bibliothek/



[index] [prev] [next] [options] [help]