diff --git a/Repositories/otago_eprints3/otago_eprints/cfg/cfg.d/eprint_render.pl b/Repositories/otago_eprints3/otago_eprints/cfg/cfg.d/eprint_render.pl index bad603a..e612266 100755 --- a/Repositories/otago_eprints3/otago_eprints/cfg/cfg.d/eprint_render.pl +++ b/Repositories/otago_eprints3/otago_eprints/cfg/cfg.d/eprint_render.pl @@ -18,6 +18,12 @@ ###################################################################### +## NJS 2009-11-03 +# Added sort subroutine to sort documents by position. This doesn't appear +# to happen by default! +sub bypos ($$) { $_[0]->get_value( "pos" ) <=> $_[1]->get_value( "pos" ); } +# END NJS 2009-11-03 + $c->{eprint_render} = sub { my( $eprint, $session, $preview ) = @_; @@ -68,7 +74,12 @@ } # Available documents - my @documents = $eprint->get_all_documents(); + ## NJS 2009-11-03 + # Sort the documents by their "pos" field. + my @documents = sort bypos $eprint->get_all_documents(); + ## END 2009-11-03 +# NJS 2009-11-03: !!! original code follows +# my @documents = $eprint->get_all_documents(); my $docs_to_show = scalar @documents;