EPrints Technical Mailing List Archive

Message: #01328


< Previous (by date) | Next (by date) > | < Previous (in thread) | Next (in thread) > | Messages - Most Recent First | Threads - Most Recent First

[EP-tech] Bug in $doc.icon: size not allowed


Hi,
EPrints-3.3.10
In ~/lib/defaultcfg/citations/eprint/summary_page.xml, the following expression is used:
<epc:print expr="$doc.icon('HoverPreview','noNewWindow')}" />

This results in 'run_icon' being called from ~perl_lib/EPrints/Script/Compiled.pm, which in turn calls 
$doc->render_icon_link.

render_icon_link allows a 'size' to be specified:
$opts{size} = "small" unless defined $opts{size};
 - but run_icon can not pass this value to the function call.

Not quite sure how to fix it (brain shutting down for the day), 
Something like (in run_icon):
foreach my $opt ( @opts )
        {
                my $optv = $opt->[0];
                if( $optv eq "HoverPreview" ) { $args{preview}=1; }
                elsif( $optv eq "noHoverPreview" ) { $args{preview}=0; }
                elsif( $optv eq "NewWindow" ) { $args{new_window}=1; }
                elsif( $optv eq "noNewWindow" ) { $args{new_window}=0; }
+ (PSEUDO-CODE) elsif( $optv in $config{thumbnail_types} ) $args{size}=$optv; }
                else { $self->runtime_error( "Unknown option to doc->icon(): $optv" ); }
        }

Cheers,
John