diff --git a/Repositories/otago_eprints/otago_eprints/cfg/ArchiveRenderConfig.pm b/Repositories/otago_eprints/otago_eprints/cfg/ArchiveRenderConfig.pm index 8607e94..f42f7d0 100755 --- a/Repositories/otago_eprints/otago_eprints/cfg/ArchiveRenderConfig.pm +++ b/Repositories/otago_eprints/otago_eprints/cfg/ArchiveRenderConfig.pm @@ -150,7 +150,22 @@ $doctd = $session->make_element( "td" ); $doctr->appendChild( $doctd ); - $doctd->appendChild( $doc->render_citation_link() ); + + # NJS 2007-07-30: Add Google Analytics tracking code to link. + my $rendered_cite = $doc->render_citation_link(); + # Ugh, DOM sucks... + # Find the first element in the DocumentFragment and add the + # onclick attribute to it. + $rendered_cite->getElementsByTagName('a')->item(0)->setAttribute( + 'onclick', + "javascript:urchinTracker( '" . + $doc->get_url . + "' );" + ); + + $doctd->appendChild( $rendered_cite ); +# !!! original code follows +# $doctd->appendChild( $doc->render_citation_link() ); my %files = $doc->files; if( defined $files{$doc->get_main} ) { @@ -816,6 +831,10 @@ # is the place to do it! my $a = $session->render_link( $url ); + + # NJS 2007-07-30: Add Google Analytics tracking code to link. + $a->setAttribute( 'onclick', "javascript:urchinTracker( '$url' );" ); + $a->appendChild( $session->make_element( "img", src=>$session->get_archive->get_conf("base_url")."/images/fileicons/$type.png",