diff --git a/bibtexbrowser.php b/bibtexbrowser.php
index c51f7b3..cf03370 100755
--- a/bibtexbrowser.php
+++ b/bibtexbrowser.php
@@ -100,6 +100,9 @@ function bibtexbrowser_configure($key, $value) {
// do we add [gsid] links (Google Scholar)?
@define('BIBTEXBROWSER_GSID_LINKS',true);
+// should pdf, doi, url, gsid links be opened in a new window?
+@define('BIBTEXBROWSER_LINKS_IN_NEW_WINDOW',true);
+
// should authors be linked to [none/homepage/resultpage]
// none: nothing
// their homepage if defined as @strings
@@ -1109,11 +1112,21 @@ class BibEntry {
if ($altlabel==NULL) { $altlabel=$bibfield; }
$str = $this->getIconOrTxt($altlabel,$iconurl);
if ($this->hasField($bibfield)) {
- return ''.$str.'';
+ return ''.$str.'';
}
return '';
}
+ /** returns a "[bib]" link */
+ function getBibLink($iconurl=NULL) {
+ $bibstr = $this->getIconOrTxt('bibtex',$iconurl);
+ $href = 'href="'.$this->getURL().'"';
+ // we add biburl and title to be able to retrieve this important information
+ // using Xpath expressions on the XHTML source
+ $link = "getKey()."\" {$href}>$bibstr";
+ return $link;
+ }
+
/** returns a "[pdf]" link if relevant. modified to exploit the new method, while keeping backward compatibility */
function getUrlLink($iconurl = NULL, $label = 'pdf') {
if ($this->hasField('url')) {
@@ -1129,34 +1142,22 @@ class BibEntry {
}
}
- /** returns a "[bib]" link if relevant */
- function getBibLink($iconurl=NULL) {
- if (BIBTEXBROWSER_BIBTEX_LINKS) {
- $bibstr = $this->getIconOrTxt('bibtex',$iconurl);
- $href = 'href="'.$this->getURL().'"';
- $link = "getKey()."\" {$href}>$bibstr";
- return $link;
- } else {
- return '';
- }
- }
/** DOI are a special kind of links, where the url depends on the doi */
function getDoiLink($iconurl=NULL) {
$str = $this->getIconOrTxt('doi',$iconurl);
- if (BIBTEXBROWSER_DOI_LINKS && $this->hasField('doi')) {
- return ''.$str.'';
+ if ($this->hasField('doi')) {
+ return ''.$str.'';
}
return '';
}
- /** GS are a special kind of links, where the url depends on the google scholar id */
+ /** GS (Google Scholar) are a special kind of links, where the url depends on the google scholar id */
function getGSLink($iconurl=NULL) {
$str = $this->getIconOrTxt('cites',$iconurl);
- // Google Scholar ID
- if (BIBTEXBROWSER_GSID_LINKS && $this->hasField('gsid')) {
- return ' '.$str.'';
+ if ($this->hasField('gsid')) {
+ return ' '.$str.'';
}
return '';
}
@@ -1678,28 +1679,22 @@ function get_HTML_tag_for_layout() {
* e.g. [bibtex] [doi][pdf]
*/
function bib2links_default(&$bibentry) {
- $href = 'href="'.$bibentry->getURL().'"';
-
$str = '';