GitBucket
4.21.2
Toggle navigation
Snippets
Sign in
Files
Branches
1
Releases
Issues
Pull requests
Labels
Priorities
Milestones
Wiki
Forks
nigel.stanger
/
Digital_Repository
Browse code
- Restored Google Analytics support.
master
1 parent
e02b4e1
commit
79a5461f7deabcec9eb79a3a1926242f1e67146c
nstanger
authored
on 10 Jul 2008
Patch
Showing
2 changed files
Repositories/otago_eprints3/otago_eprints/cfg/cfg.d/eprint_render.pl
Repositories/otago_eprints3/otago_eprints/cfg/lang/en/templates/default.xml
Ignore Space
Show notes
View
Repositories/otago_eprints3/otago_eprints/cfg/cfg.d/eprint_render.pl
###################################################################### =item $xhtmlfragment = eprint_render( $eprint, $session, $preview ) This subroutine takes an eprint object and renders the XHTML view of this eprint for public viewing. Takes two arguments: the L<$eprint|EPrints::DataObj::EPrint> to render and the current L<$session|EPrints::Session>. Returns three XHTML DOM fragments (see L<EPrints::XML>): C<$page>, C<$title>, (and optionally) C<$links>. If $preview is true then this is only being shown as a preview. (This is used to stop the "edit eprint" link appearing when it makes no sense.) =cut ###################################################################### $c->{eprint_render} = sub { my( $eprint, $session, $preview ) = @_; my $succeeds_field = $session->get_repository->get_dataset( "eprint" )->get_field( "succeeds" ); my $commentary_field = $session->get_repository->get_dataset( "eprint" )->get_field( "commentary" ); my $has_multiple_versions = $eprint->in_thread( $succeeds_field ); my( $page, $p, $a ); $page = $session->make_doc_fragment; # Citation $p = $session->make_element( "p", class=>"ep_block", style=>"margin-bottom: 1em" ); $p->appendChild( $eprint->render_citation() ); $page->appendChild( $p ); # Put in a message describing how this document has other versions # in the repository if appropriate if( $has_multiple_versions ) { my $latest = $eprint->last_in_thread( $succeeds_field ); my $block = $session->make_element( "div", class=>"ep_block", style=>"margin-bottom: 1em" ); $page->appendChild( $block ); if( $latest->get_value( "eprintid" ) == $eprint->get_value( "eprintid" ) ) { $block->appendChild( $session->html_phrase( "page:latest_version" ) ); } else { $block->appendChild( $session->render_message( "warning", $session->html_phrase( "page:not_latest_version", link => $session->render_link( $latest->get_url() ) ) ) ); } } # Contact email address my $has_contact_email = 0; if( $session->get_repository->can_call( "email_for_doc_request" ) ) { if( defined( $session->get_repository->call( "email_for_doc_request", $session, $eprint ) ) ) { $has_contact_email = 1; } } # Available documents my @documents = $eprint->get_all_documents(); my $docs_to_show = scalar @documents; $p = $session->make_element( "p", class=>"ep_block", style=>"margin-bottom: 1em" ); $page->appendChild( $p ); if( $docs_to_show == 0 ) { $p->appendChild( $session->html_phrase( "page:nofulltext" ) ); if( $has_contact_email && $eprint->get_value( "eprint_status" ) eq "archive" ) { # "Request a copy" button my $form = $session->render_form( "get", $session->get_repository->get_conf( "perl_url" ) . "/request_doc" ); $form->appendChild( $session->render_hidden_field( "eprintid", $eprint->get_id ) ); $form->appendChild( $session->render_action_buttons( "null" => $session->phrase( "request:button" ) ) ); $p->appendChild( $form ); } } else { $p->appendChild( $session->html_phrase( "page:fulltext" ) ); my( $doctable, $doctr, $doctd ); $doctable = $session->make_element( "table", class=>"ep_block", style=>"margin-bottom: 1em" ); foreach my $doc ( @documents ) { $doctr = $session->make_element( "tr" ); $doctd = $session->make_element( "td", valign=>"top", style=>"text-align:center" ); $doctr->appendChild( $doctd ); ## NJS 2008-07-10: Add Google Analytics tracking code to icon link. my $rendered_icon = $doc->render_icon_link( preview => 1 ); # Strip the front off the URL to get just the document path. my $doc_url = $doc->get_url; $doc_url =~ m|^http://[^/]+(/.+)$|; my $docpath = $1; # NJS 2008-07-10 # Find the first <a> element in the DocumentFragment and add the # onclick attribute to it. Note that the DOM documentation says # the NodeList is indexed from 0, but item(0) gives the wrong # element (?!?!). $rendered_icon->getElementsByTagName( 'a' )->item( 1 )->setAttribute( 'onclick', "javascript:urchinTracker( '" . $docpath . "' );" ); $doctd->appendChild( $rendered_icon ); ## END NJS 2008-07-10 # NJS 2008-07-10: !!! original code follows # $doctd->appendChild( $doc->render_icon_link( preview => 1 ) ); $doctd = $session->make_element( "td", valign=>"top" ); $doctr->appendChild( $doctd ); ## NJS 2007-07-30: Add Google Analytics tracking code to text link. my $rendered_cite = $doc->render_citation_link(); # Ugh, DOM sucks... # NJS 2008-07-10: Updated to work with EPrints 3. # Find the first <a> element in the DocumentFragment and add the # onclick attribute to it. Note that the DOM documentation says # the NodeList is indexed from 0, but item(0) gives the last # element instead of the first one; item(1)->(4) give the results # we want here. $rendered_cite->getElementsByTagName( 'a' )->item( 1 )->setAttribute( 'onclick', "javascript:urchinTracker( '" . $docpath . "' );" ); $doctd->appendChild( $rendered_cite ); ## END NJS 2007-07-30 # NJS 2007-07-30: !!! original code follows # $doctd->appendChild( $doc->render_citation_link() ); my %files = $doc->files; if( defined $files{$doc->get_main} ) { my $size = $files{$doc->get_main}; $doctd->appendChild( $session->make_element( 'br' ) ); $doctd->appendChild( $session->make_text( EPrints::Utils::human_filesize($size) )); } if( $has_contact_email && !$doc->is_public && $eprint->get_value( "eprint_status" ) eq "archive" ) { # "Request a copy" button $doctd = $session->make_element( "td" ); my $form = $session->render_form( "get", $session->get_repository->get_conf( "perl_url" ) . "/request_doc" ); $form->appendChild( $session->render_hidden_field( "docid", $doc->get_id ) ); $form->appendChild( $session->render_action_buttons( "null" => $session->phrase( "request:button" ) ) ); $doctd->appendChild( $form ); $doctr->appendChild( $doctd ); } $doctable->appendChild( $doctr ); } $page->appendChild( $doctable ); } # Alternative locations if( $eprint->is_set( "official_url" ) ) { $p = $session->make_element( "p", class=>"ep_block", style=>"margin-bottom: 1em" ); $page->appendChild( $p ); $p->appendChild( $session->html_phrase( "eprint_fieldname_official_url" ) ); $p->appendChild( $session->make_text( ": " ) ); $p->appendChild( $eprint->render_value( "official_url" ) ); } # Link to download statistics. [NJS 2005-12-08] # Note: highly dependent on the way that the UTas EPrintsStats package # structures things! In particular, this will break completely if the # URL format changes. $p = $session->make_element( "p" ); $page->appendChild( $p ); $p->appendChild( $session->html_phrase( "abstract/stats_link:prefix" ) ); my $statslink = $session->make_element( "a", href=>"/es/index.php?action=show_detail_eprint;id=" . $eprint->get_value( "eprintid" ) . ";year=0;month=0;range=4w" ); $statslink->appendChild( $session->html_phrase( "abstract/stats_link:link_text" ) ); $p->appendChild( $statslink ); $p->appendChild( $session->html_phrase( "abstract/stats_link:suffix" ) ); # Then the abstract if( $eprint->is_set( "abstract" ) ) { my $div = $session->make_element( "div", class=>"ep_block" ); $page->appendChild( $div ); my $h2 = $session->make_element( "h2" ); $h2->appendChild( $session->html_phrase( "eprint_fieldname_abstract" ) ); $div->appendChild( $h2 ); $p = $session->make_element( "p", style=>"text-align: left; margin: 1em auto 0em auto" ); $p->appendChild( $eprint->render_value( "abstract" ) ); $div->appendChild( $p ); } else { $page->appendChild( $session->make_element( 'br' ) ); } my( $table, $tr, $td, $th ); # this table needs more class cjg $table = $session->make_element( "table", class=>"ep_block", style=>"margin-bottom: 1em", border=>"0", cellpadding=>"3" ); $page->appendChild( $table ); # Commentary if( $eprint->is_set( "commentary" ) ) { my $target = EPrints::DataObj::EPrint->new( $session, $eprint->get_value( "commentary" ), $session->get_repository()->get_dataset( "archive" ) ); if( defined $target ) { $table->appendChild( $session->render_row( $session->html_phrase( "eprint_fieldname_commentary" ), $target->render_citation_link() ) ); } } my $frag = $session->make_doc_fragment; $frag->appendChild( $eprint->render_value( "type" ) ); my $type = $eprint->get_value( "type" ); if( $type eq "conference_item" ) { $frag->appendChild( $session->make_text( " (" )); $frag->appendChild( $eprint->render_value( "pres_type" ) ); $frag->appendChild( $session->make_text( ")" )); } if( $type eq "monograph" ) { $frag->appendChild( $session->make_text( " (" )); $frag->appendChild( $eprint->render_value( "monograph_type" ) ); $frag->appendChild( $session->make_text( ")" )); } if( $type eq "thesis" ) { $frag->appendChild( $session->make_text( " (" )); $frag->appendChild( $eprint->render_value( "thesis_type" ) ); $frag->appendChild( $session->make_text( ")" )); } $table->appendChild( $session->render_row( $session->html_phrase( "eprint_fieldname_type" ), $frag )); # Additional Info if( $eprint->is_set( "note" ) ) { $table->appendChild( $session->render_row( $session->html_phrase( "eprint_fieldname_note" ), $eprint->render_value( "note" ) ) ); } # Keywords if( $eprint->is_set( "keywords" ) ) { $table->appendChild( $session->render_row( $session->html_phrase( "eprint_fieldname_keywords" ), $eprint->render_value( "keywords" ) ) ); } # Subjects... $table->appendChild( $session->render_row( $session->html_phrase( "eprint_fieldname_subjects" ), $eprint->render_value( "subjects" ) ) ); $table->appendChild( $session->render_row( $session->html_phrase( "page:id_code" ), $eprint->render_value( "eprintid" ) ) ); my $user = new EPrints::DataObj::User( $eprint->{session}, $eprint->get_value( "userid" ) ); my $usersname; if( defined $user ) { $usersname = $user->render_description(); } else { $usersname = $session->html_phrase( "page:invalid_user" ); } $table->appendChild( $session->render_row( $session->html_phrase( "page:deposited_by" ), $usersname ) ); if( $eprint->is_set( "datestamp" ) ) { $table->appendChild( $session->render_row( $session->html_phrase( "page:deposited_on" ), $eprint->render_value( "datestamp" ) ) ); } if( $eprint->is_set( "lastmod" ) ) { $table->appendChild( $session->render_row( $session->html_phrase( "eprint_fieldname_lastmod" ), $eprint->render_value( "lastmod" ) ) ); } # Now show the version and commentary response threads if( $has_multiple_versions ) { my $div = $session->make_element( "div", class=>"ep_block", style=>"margin-bottom: 1em" ); $page->appendChild( $div ); $div->appendChild( $session->html_phrase( "page:available_versions" ) ); $div->appendChild( $eprint->render_version_thread( $succeeds_field ) ); } if( $eprint->in_thread( $commentary_field ) ) { my $div = $session->make_element( "div", class=>"ep_block", style=>"margin-bottom: 1em" ); $page->appendChild( $div ); $div->appendChild( $session->html_phrase( "page:commentary_threads" ) ); $div->appendChild( $eprint->render_version_thread( $commentary_field ) ); } if(0){ # Experimental SFX Link my $url ="http://demo.exlibrisgroup.com:9003/demo?"; #my $url = "http://aire.cab.unipd.it:9003/unipr?"; $url .= "title=".$eprint->get_value( "title" ); $url .= "&"; my $authors = $eprint->get_value( "creators" ); my $first_author = $authors->[0]; $url .= "aulast=".$first_author->{name}->{family}; $url .= "&"; $url .= "aufirst=".$first_author->{name}->{family}; $url .= "&"; $url .= "date=".$eprint->get_value( "date" ); my $sfx_block = $session->make_element( "p" ); $page->appendChild( $sfx_block ); my $sfx_link = $session->render_link( $url ); $sfx_block->appendChild( $sfx_link ); $sfx_link->appendChild( $session->make_text( "SFX" ) ); } if(0){ # Experimental OVID Link my $url ="http://linksolver.ovid.com/OpenUrl/LinkSolver?"; $url .= "atitle=".$eprint->get_value( "title" ); $url .= "&"; my $authors = $eprint->get_value( "creators" ); my $first_author = $authors->[0]; $url .= "aulast=".$first_author->{name}->{family}; $url .= "&"; $url .= "date=".substr($eprint->get_value( "date" ),0,4); if( $eprint->is_set( "issn" ) ) { $url .= "&issn=".$eprint->get_value( "issn" ); } if( $eprint->is_set( "volume" ) ) { $url .= "&volume=".$eprint->get_value( "volume" ); } if( $eprint->is_set( "number" ) ) { $url .= "&issue=".$eprint->get_value( "number" ); } if( $eprint->is_set( "pagerange" ) ) { my $pr = $eprint->get_value( "pagerange" ); $pr =~ m/^([^-]+)-/; $url .= "&spage=$1"; } my $ovid_block = $session->make_element( "p" ); $page->appendChild( $ovid_block ); my $ovid_link = $session->render_link( $url ); $ovid_block->appendChild( $ovid_link ); $ovid_link->appendChild( $session->make_text( "OVID" ) ); } unless( $preview ) { # Add a link to the edit-page for this record. Handy for staff. my $edit_para = $session->make_element( "p", align=>"right" ); $edit_para->appendChild( $session->html_phrase( "page:edit_link", link => $session->render_link( $eprint->get_control_url ) ) ); $page->appendChild( $edit_para ); } my $title = $eprint->render_description(); my $links = $session->make_doc_fragment(); $links->appendChild( $session->plugin( "Export::Simple" )->dataobj_to_html_header( $eprint ) ); $links->appendChild( $session->plugin( "Export::DC" )->dataobj_to_html_header( $eprint ) ); return( $page, $title, $links ); };
###################################################################### =item $xhtmlfragment = eprint_render( $eprint, $session, $preview ) This subroutine takes an eprint object and renders the XHTML view of this eprint for public viewing. Takes two arguments: the L<$eprint|EPrints::DataObj::EPrint> to render and the current L<$session|EPrints::Session>. Returns three XHTML DOM fragments (see L<EPrints::XML>): C<$page>, C<$title>, (and optionally) C<$links>. If $preview is true then this is only being shown as a preview. (This is used to stop the "edit eprint" link appearing when it makes no sense.) =cut ###################################################################### $c->{eprint_render} = sub { my( $eprint, $session, $preview ) = @_; my $succeeds_field = $session->get_repository->get_dataset( "eprint" )->get_field( "succeeds" ); my $commentary_field = $session->get_repository->get_dataset( "eprint" )->get_field( "commentary" ); my $has_multiple_versions = $eprint->in_thread( $succeeds_field ); my( $page, $p, $a ); $page = $session->make_doc_fragment; # Citation $p = $session->make_element( "p", class=>"ep_block", style=>"margin-bottom: 1em" ); $p->appendChild( $eprint->render_citation() ); $page->appendChild( $p ); # Put in a message describing how this document has other versions # in the repository if appropriate if( $has_multiple_versions ) { my $latest = $eprint->last_in_thread( $succeeds_field ); my $block = $session->make_element( "div", class=>"ep_block", style=>"margin-bottom: 1em" ); $page->appendChild( $block ); if( $latest->get_value( "eprintid" ) == $eprint->get_value( "eprintid" ) ) { $block->appendChild( $session->html_phrase( "page:latest_version" ) ); } else { $block->appendChild( $session->render_message( "warning", $session->html_phrase( "page:not_latest_version", link => $session->render_link( $latest->get_url() ) ) ) ); } } # Contact email address my $has_contact_email = 0; if( $session->get_repository->can_call( "email_for_doc_request" ) ) { if( defined( $session->get_repository->call( "email_for_doc_request", $session, $eprint ) ) ) { $has_contact_email = 1; } } # Available documents my @documents = $eprint->get_all_documents(); my $docs_to_show = scalar @documents; $p = $session->make_element( "p", class=>"ep_block", style=>"margin-bottom: 1em" ); $page->appendChild( $p ); if( $docs_to_show == 0 ) { $p->appendChild( $session->html_phrase( "page:nofulltext" ) ); if( $has_contact_email && $eprint->get_value( "eprint_status" ) eq "archive" ) { # "Request a copy" button my $form = $session->render_form( "get", $session->get_repository->get_conf( "perl_url" ) . "/request_doc" ); $form->appendChild( $session->render_hidden_field( "eprintid", $eprint->get_id ) ); $form->appendChild( $session->render_action_buttons( "null" => $session->phrase( "request:button" ) ) ); $p->appendChild( $form ); } } else { $p->appendChild( $session->html_phrase( "page:fulltext" ) ); my( $doctable, $doctr, $doctd ); $doctable = $session->make_element( "table", class=>"ep_block", style=>"margin-bottom: 1em" ); foreach my $doc ( @documents ) { $doctr = $session->make_element( "tr" ); $doctd = $session->make_element( "td", valign=>"top", style=>"text-align:center" ); $doctr->appendChild( $doctd ); $doctd->appendChild( $doc->render_icon_link( preview => 1 ) ); $doctd = $session->make_element( "td", valign=>"top" ); $doctr->appendChild( $doctd ); # NJS 2007-07-30: Add Google Analytics tracking code to link. my $rendered_cite = $doc->render_citation_link(); # Strip the front off the URL to get just the document path. my $doc_url = $doc->get_url; $doc_url =~ m|^http://[^/]+(/.+)$|; my $docpath = $1; # Ugh, DOM sucks... # Find the first <a> element in the DocumentFragment and add the # onclick attribute to it. $rendered_cite->getFirstChild()->getElementsByTagName('a')->item(0)->setAttribute( 'onclick', "javascript:urchinTracker( '" . $docpath . "' );" ); $doctd->appendChild( $rendered_cite ); ##END # !!! original code follows # $doctd->appendChild( $doc->render_citation_link() ); my %files = $doc->files; if( defined $files{$doc->get_main} ) { my $size = $files{$doc->get_main}; $doctd->appendChild( $session->make_element( 'br' ) ); $doctd->appendChild( $session->make_text( EPrints::Utils::human_filesize($size) )); } if( $has_contact_email && !$doc->is_public && $eprint->get_value( "eprint_status" ) eq "archive" ) { # "Request a copy" button $doctd = $session->make_element( "td" ); my $form = $session->render_form( "get", $session->get_repository->get_conf( "perl_url" ) . "/request_doc" ); $form->appendChild( $session->render_hidden_field( "docid", $doc->get_id ) ); $form->appendChild( $session->render_action_buttons( "null" => $session->phrase( "request:button" ) ) ); $doctd->appendChild( $form ); $doctr->appendChild( $doctd ); } $doctable->appendChild( $doctr ); } $page->appendChild( $doctable ); } # Alternative locations if( $eprint->is_set( "official_url" ) ) { $p = $session->make_element( "p", class=>"ep_block", style=>"margin-bottom: 1em" ); $page->appendChild( $p ); $p->appendChild( $session->html_phrase( "eprint_fieldname_official_url" ) ); $p->appendChild( $session->make_text( ": " ) ); $p->appendChild( $eprint->render_value( "official_url" ) ); } # Link to download statistics. [NJS 2005-12-08] # Note: highly dependent on the way that the UTas EPrintsStats package # structures things! In particular, this will break completely if the # URL format changes. $p = $session->make_element( "p" ); $page->appendChild( $p ); $p->appendChild( $session->html_phrase( "abstract/stats_link:prefix" ) ); my $statslink = $session->make_element( "a", href=>"/es/index.php?action=show_detail_eprint;id=" . $eprint->get_value( "eprintid" ) . ";year=0;month=0;range=4w" ); $statslink->appendChild( $session->html_phrase( "abstract/stats_link:link_text" ) ); $p->appendChild( $statslink ); $p->appendChild( $session->html_phrase( "abstract/stats_link:suffix" ) ); # Then the abstract if( $eprint->is_set( "abstract" ) ) { my $div = $session->make_element( "div", class=>"ep_block" ); $page->appendChild( $div ); my $h2 = $session->make_element( "h2" ); $h2->appendChild( $session->html_phrase( "eprint_fieldname_abstract" ) ); $div->appendChild( $h2 ); $p = $session->make_element( "p", style=>"text-align: left; margin: 1em auto 0em auto" ); $p->appendChild( $eprint->render_value( "abstract" ) ); $div->appendChild( $p ); } else { $page->appendChild( $session->make_element( 'br' ) ); } my( $table, $tr, $td, $th ); # this table needs more class cjg $table = $session->make_element( "table", class=>"ep_block", style=>"margin-bottom: 1em", border=>"0", cellpadding=>"3" ); $page->appendChild( $table ); # Commentary if( $eprint->is_set( "commentary" ) ) { my $target = EPrints::DataObj::EPrint->new( $session, $eprint->get_value( "commentary" ), $session->get_repository()->get_dataset( "archive" ) ); if( defined $target ) { $table->appendChild( $session->render_row( $session->html_phrase( "eprint_fieldname_commentary" ), $target->render_citation_link() ) ); } } my $frag = $session->make_doc_fragment; $frag->appendChild( $eprint->render_value( "type" ) ); my $type = $eprint->get_value( "type" ); if( $type eq "conference_item" ) { $frag->appendChild( $session->make_text( " (" )); $frag->appendChild( $eprint->render_value( "pres_type" ) ); $frag->appendChild( $session->make_text( ")" )); } if( $type eq "monograph" ) { $frag->appendChild( $session->make_text( " (" )); $frag->appendChild( $eprint->render_value( "monograph_type" ) ); $frag->appendChild( $session->make_text( ")" )); } if( $type eq "thesis" ) { $frag->appendChild( $session->make_text( " (" )); $frag->appendChild( $eprint->render_value( "thesis_type" ) ); $frag->appendChild( $session->make_text( ")" )); } $table->appendChild( $session->render_row( $session->html_phrase( "eprint_fieldname_type" ), $frag )); # Additional Info if( $eprint->is_set( "note" ) ) { $table->appendChild( $session->render_row( $session->html_phrase( "eprint_fieldname_note" ), $eprint->render_value( "note" ) ) ); } # Keywords if( $eprint->is_set( "keywords" ) ) { $table->appendChild( $session->render_row( $session->html_phrase( "eprint_fieldname_keywords" ), $eprint->render_value( "keywords" ) ) ); } # Subjects... $table->appendChild( $session->render_row( $session->html_phrase( "eprint_fieldname_subjects" ), $eprint->render_value( "subjects" ) ) ); $table->appendChild( $session->render_row( $session->html_phrase( "page:id_code" ), $eprint->render_value( "eprintid" ) ) ); my $user = new EPrints::DataObj::User( $eprint->{session}, $eprint->get_value( "userid" ) ); my $usersname; if( defined $user ) { $usersname = $user->render_description(); } else { $usersname = $session->html_phrase( "page:invalid_user" ); } $table->appendChild( $session->render_row( $session->html_phrase( "page:deposited_by" ), $usersname ) ); if( $eprint->is_set( "datestamp" ) ) { $table->appendChild( $session->render_row( $session->html_phrase( "page:deposited_on" ), $eprint->render_value( "datestamp" ) ) ); } if( $eprint->is_set( "lastmod" ) ) { $table->appendChild( $session->render_row( $session->html_phrase( "eprint_fieldname_lastmod" ), $eprint->render_value( "lastmod" ) ) ); } # Now show the version and commentary response threads if( $has_multiple_versions ) { my $div = $session->make_element( "div", class=>"ep_block", style=>"margin-bottom: 1em" ); $page->appendChild( $div ); $div->appendChild( $session->html_phrase( "page:available_versions" ) ); $div->appendChild( $eprint->render_version_thread( $succeeds_field ) ); } if( $eprint->in_thread( $commentary_field ) ) { my $div = $session->make_element( "div", class=>"ep_block", style=>"margin-bottom: 1em" ); $page->appendChild( $div ); $div->appendChild( $session->html_phrase( "page:commentary_threads" ) ); $div->appendChild( $eprint->render_version_thread( $commentary_field ) ); } if(0){ # Experimental SFX Link my $url ="http://demo.exlibrisgroup.com:9003/demo?"; #my $url = "http://aire.cab.unipd.it:9003/unipr?"; $url .= "title=".$eprint->get_value( "title" ); $url .= "&"; my $authors = $eprint->get_value( "creators" ); my $first_author = $authors->[0]; $url .= "aulast=".$first_author->{name}->{family}; $url .= "&"; $url .= "aufirst=".$first_author->{name}->{family}; $url .= "&"; $url .= "date=".$eprint->get_value( "date" ); my $sfx_block = $session->make_element( "p" ); $page->appendChild( $sfx_block ); my $sfx_link = $session->render_link( $url ); $sfx_block->appendChild( $sfx_link ); $sfx_link->appendChild( $session->make_text( "SFX" ) ); } if(0){ # Experimental OVID Link my $url ="http://linksolver.ovid.com/OpenUrl/LinkSolver?"; $url .= "atitle=".$eprint->get_value( "title" ); $url .= "&"; my $authors = $eprint->get_value( "creators" ); my $first_author = $authors->[0]; $url .= "aulast=".$first_author->{name}->{family}; $url .= "&"; $url .= "date=".substr($eprint->get_value( "date" ),0,4); if( $eprint->is_set( "issn" ) ) { $url .= "&issn=".$eprint->get_value( "issn" ); } if( $eprint->is_set( "volume" ) ) { $url .= "&volume=".$eprint->get_value( "volume" ); } if( $eprint->is_set( "number" ) ) { $url .= "&issue=".$eprint->get_value( "number" ); } if( $eprint->is_set( "pagerange" ) ) { my $pr = $eprint->get_value( "pagerange" ); $pr =~ m/^([^-]+)-/; $url .= "&spage=$1"; } my $ovid_block = $session->make_element( "p" ); $page->appendChild( $ovid_block ); my $ovid_link = $session->render_link( $url ); $ovid_block->appendChild( $ovid_link ); $ovid_link->appendChild( $session->make_text( "OVID" ) ); } unless( $preview ) { # Add a link to the edit-page for this record. Handy for staff. my $edit_para = $session->make_element( "p", align=>"right" ); $edit_para->appendChild( $session->html_phrase( "page:edit_link", link => $session->render_link( $eprint->get_control_url ) ) ); $page->appendChild( $edit_para ); } my $title = $eprint->render_description(); my $links = $session->make_doc_fragment(); $links->appendChild( $session->plugin( "Export::Simple" )->dataobj_to_html_header( $eprint ) ); $links->appendChild( $session->plugin( "Export::DC" )->dataobj_to_html_header( $eprint ) ); return( $page, $title, $links ); };
Ignore Space
Show notes
View
Repositories/otago_eprints3/otago_eprints/cfg/lang/en/templates/default.xml
<?xml version="1.0" encoding="utf-8" standalone="no" ?> <!DOCTYPE html SYSTEM "entities.dtd" > <html xmlns="http://www.w3.org/1999/xhtml" xmlns:epc="http://eprints.org/ep3/control"> <head> <title><epc:pin ref="title" textonly="yes"/> - <epc:phrase ref="archive_name"/></title> <script src="{$config{base_url}}/javascript/auto.js" type="text/javascript"><!-- nope --></script> <style type="text/css" media="screen">@import url(<epc:print expr="$config{base_url}"/>/style/auto.css);</style> <style type="text/css" media="print">@import url(<epc:print expr="$config{base_url}"/>/style/print.css);</style> <!--[if IE]> <style type="text/css" media="screen">@import url(/style/ie_hacks.css);</style> <![endif]--> <link rel="icon" href="/favicon.ico" type="image/x-icon"/> <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"/> <link rel="Top" href="{$config{frontpage}}"/> <link rel="Search" href="{$config{perl_url}}/search"/> <epc:pin ref="head"/> </head> <body bgcolor="#ffffff" text="#000000"> <div class="ep_noprint"> <noscript> <style type='text/css'>@import url(<epc:print expr="$config{base_url}"/>/style/nojs.css);</style> </noscript> </div> <div class="sob_tm_header ep_noprint"> <a class="otago_tm_logo" href="http://www.otago.ac.nz/"> <img alt="University of Otago Logo" src="/images/university_web_logo.gif" /> </a> <a class="sob_tm_logo" href="http://www.business.otago.ac.nz/"> <img alt="School of Business Logo" src="/images/sob-logo.png" /> </a> <div id="sob_tm_menu"> <div id="sob_tm_menu_items"> <ul><li><a href="{$config{frontpage}}">Home</a></li></ul> <ul> <li> <a href="{$config{perl_url}}/search/advanced">Search</a> <ul> <li><a href="{$config{perl_url}}/search/simple">Simple</a></li> <li><a href="{$config{perl_url}}/search/advanced">Advanced</a></li> </ul> </li> </ul> <ul> <li> <a href="{$config{base_url}}/view/">Browse</a> <ul> <li><a href="{$config{base_url}}/view/year/">by Year</a></li> <li><a href="{$config{base_url}}/view/subjects/">by Subject</a></li> <li><a href="{$config{base_url}}/view/type/">by Pub. Type</a></li> <li><a href="{$config{base_url}}/view/affiliations/">by Org. Unit</a></li> </ul> </li> </ul> <ul> <li> <a href="{$config{base_url}}/es">Statistics</a> <ul> <li><a href="{$config{base_url}}/es/index.php?action=cumulative_usage;range=all">by Year/Month</a></li> <li><a href="{$config{base_url}}/es/index.php?action=cumulative_usage_country">by Source</a></li> </ul> </li> </ul> <ul><li><a href="{$config{base_url}}/information.html">About</a></li></ul> </div> </div> <div class="sob_tm_searchbar"> <table cellpadding="0" cellspacing="0"> <tr> <td class="sob_login_status"><epc:pin ref="login_status"/></td> <td class="sob_search_box"> <form method="get" accept-charset="utf-8" action="{$config{perl_url}}/search" style="display:inline"> <input class="ep_tm_searchbarbox" accept-charset="utf-8" size="20" type="text" name="q" /> <input class="ep_tm_searchbarbutton" value="Search" type="submit" name="_action_search" /> <input type="hidden" name="_order" value="bytitle" /> <input type="hidden" name="basic_srchtype" value="ALL" /> <input type="hidden" name="_satisfyall" value="ALL" /> </form> </td> </tr> </table> </div> </div> <epc:pin ref="pagetop"/> <!-- Google Analytics tag. Needs to go here rather than at bottom as usual, because there are pages (with download links to files) that use the tracker before the bottom of the page. --> <script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> </script> <script type="text/javascript"> _uacct = "UA-2259264-1"; urchinTracker(); </script> <div class="sob_tm_main"> <epc:pin ref="toolbar" /> <h1><epc:pin ref="title"/></h1> <epc:pin ref="page"/> </div> <div class="sob_tm_footer ep_noprint"> <p class="sob_tm_footer_left"> <a href="{$config{frontpage}}">Home</a> | <a href="{$config{perl_url}}/search/advanced">Search</a> | <a href="{$config{base_url}}/view/">Browse</a> | <a href="{$config{base_url}}/es">Statistics</a> | <a href="{$config{base_url}}/information.html">About</a> </p> <p class="sob_tm_footer_right"> <a href="http://www.business.otago.ac.nz/">School of Business</a> | <a href="http://www.otago.ac.nz/">University of Otago</a> </p> </div> </body> </html>
<?xml version="1.0" encoding="utf-8" standalone="no" ?> <!DOCTYPE html SYSTEM "entities.dtd" > <html xmlns="http://www.w3.org/1999/xhtml" xmlns:epc="http://eprints.org/ep3/control"> <head> <title><epc:pin ref="title" textonly="yes"/> - <epc:phrase ref="archive_name"/></title> <script src="{$config{base_url}}/javascript/auto.js" type="text/javascript"><!-- nope --></script> <style type="text/css" media="screen">@import url(<epc:print expr="$config{base_url}"/>/style/auto.css);</style> <style type="text/css" media="print">@import url(<epc:print expr="$config{base_url}"/>/style/print.css);</style> <!--[if IE]> <style type="text/css" media="screen">@import url(/style/ie_hacks.css);</style> <![endif]--> <link rel="icon" href="/favicon.ico" type="image/x-icon"/> <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"/> <link rel="Top" href="{$config{frontpage}}"/> <link rel="Search" href="{$config{perl_url}}/search"/> <epc:pin ref="head"/> </head> <body bgcolor="#ffffff" text="#000000"> <div class="ep_noprint"> <noscript> <style type='text/css'>@import url(<epc:print expr="$config{base_url}"/>/style/nojs.css);</style> </noscript> </div> <div class="sob_tm_header ep_noprint"> <a class="otago_tm_logo" href="http://www.otago.ac.nz/"> <img alt="University of Otago Logo" src="/images/university_web_logo.gif" /> </a> <a class="sob_tm_logo" href="http://www.business.otago.ac.nz/"> <img alt="School of Business Logo" src="/images/sob-logo.png" /> </a> <div id="sob_tm_menu"> <div id="sob_tm_menu_items"> <ul><li><a href="{$config{frontpage}}">Home</a></li></ul> <ul> <li> <a href="{$config{perl_url}}/search/advanced">Search</a> <ul> <li><a href="{$config{perl_url}}/search/simple">Simple</a></li> <li><a href="{$config{perl_url}}/search/advanced">Advanced</a></li> </ul> </li> </ul> <ul> <li> <a href="{$config{base_url}}/view/">Browse</a> <ul> <li><a href="{$config{base_url}}/view/year/">by Year</a></li> <li><a href="{$config{base_url}}/view/subjects/">by Subject</a></li> <li><a href="{$config{base_url}}/view/type/">by Pub. Type</a></li> <li><a href="{$config{base_url}}/view/affiliations/">by Org. Unit</a></li> </ul> </li> </ul> <ul> <li> <a href="{$config{base_url}}/es">Statistics</a> <ul> <li><a href="{$config{base_url}}/es/index.php?action=cumulative_usage;range=all">by Year/Month</a></li> <li><a href="{$config{base_url}}/es/index.php?action=cumulative_usage_country">by Source</a></li> </ul> </li> </ul> <ul><li><a href="{$config{base_url}}/information.html">About</a></li></ul> </div> </div> <div class="sob_tm_searchbar"> <table cellpadding="0" cellspacing="0"> <tr> <td class="sob_login_status"><epc:pin ref="login_status"/></td> <td class="sob_search_box"> <form method="get" accept-charset="utf-8" action="{$config{perl_url}}/search" style="display:inline"> <input class="ep_tm_searchbarbox" accept-charset="utf-8" size="20" type="text" name="q" /> <input class="ep_tm_searchbarbutton" value="Search" type="submit" name="_action_search" /> <input type="hidden" name="_order" value="bytitle" /> <input type="hidden" name="basic_srchtype" value="ALL" /> <input type="hidden" name="_satisfyall" value="ALL" /> </form> </td> </tr> </table> </div> </div> <epc:pin ref="pagetop"/> <div class="sob_tm_main"> <epc:pin ref="toolbar" /> <h1><epc:pin ref="title"/></h1> <epc:pin ref="page"/> </div> <div class="sob_tm_footer ep_noprint"> <p class="sob_tm_footer_left"> <a href="{$config{frontpage}}">Home</a> | <a href="{$config{perl_url}}/search/advanced">Search</a> | <a href="{$config{base_url}}/view/">Browse</a> | <a href="{$config{base_url}}/es">Statistics</a> | <a href="{$config{base_url}}/information.html">About</a> </p> <p class="sob_tm_footer_right"> <a href="http://www.business.otago.ac.nz/">School of Business</a> | <a href="http://www.otago.ac.nz/">University of Otago</a> </p> </div> </body> </html>
Show line notes below