included the 3 changes proposed by Alan P. Sexton

This commit is contained in:
Martin Monperrus
2011-03-05 13:21:24 +01:00
parent eea2522e85
commit 49a6027209
+15 -7
View File
@@ -239,6 +239,10 @@ License, or (at your option) any later version.
@define('ENCODING','iso-8859-1');//define('ENCODING','utf-8');//define('ENCODING','windows-1252'); @define('ENCODING','iso-8859-1');//define('ENCODING','utf-8');//define('ENCODING','windows-1252');
// number of bib items per page // number of bib items per page
@define('PAGE_SIZE',isset($_GET['nopage'])?10000:25); @define('PAGE_SIZE',isset($_GET['nopage'])?10000:25);
// should links be open in a new window/tab?
// you may change this in bibtexbrowser.local.php
// by adding to define('BIBTEXBROWSER_BIB_IN_NEW_WINDOW',true);
@define('BIBTEXBROWSER_BIB_IN_NEW_WINDOW',false);
@define('BIBLIOGRAPHYSTYLE','DefaultBibliographyStyle');// this is the name of a function @define('BIBLIOGRAPHYSTYLE','DefaultBibliographyStyle');// this is the name of a function
@define('BIBLIOGRAPHYSECTIONS','DefaultBibliographySections');// this is the name of a function @define('BIBLIOGRAPHYSECTIONS','DefaultBibliographySections');// this is the name of a function
@define('COMMA_NAMES',false);// do have authors in a comma separated form? @define('COMMA_NAMES',false);// do have authors in a comma separated form?
@@ -909,7 +913,10 @@ class BibEntry {
function setField($name, $value) { function setField($name, $value) {
$name = strtolower($name); $name = strtolower($name);
// fields that should not be transformed // fields that should not be transformed
if ($name!='url' ) { // we assume that "comment" is never latex code
// but instead could contain HTML code (with links using the character "~" for example)
// so "comment" is not transformed too
if ($name!='url' && $name!='comment') {
$value = xtrim($value); $value = xtrim($value);
$value = latex2html($value); $value = latex2html($value);
} else { } else {
@@ -952,16 +959,17 @@ class BibEntry {
return isset($this->fields[strtolower($name)]); return isset($this->fields[strtolower($name)]);
} }
/** Returns the authors of this entry. If no author field exists, /** Returns the authors of this entry. If "author" is not given,
* returns the editors. If none of authors and editors exists,
* return a string 'Unknown'. */ * return a string 'Unknown'. */
function getAuthor() { function getAuthor() {
if (array_key_exists(AUTHOR, $this->fields)) { if (array_key_exists(AUTHOR, $this->fields)) {
return $this->fields[AUTHOR]; return $this->fields[AUTHOR];
} }
if (array_key_exists(EDITOR, $this->fields)) { // 2010-03-02: commented the following, it results in misleading author lists
return $this->fields[EDITOR]; // issue found by Alan P. Sexton
} //if (array_key_exists(EDITOR, $this->fields)) {
// return $this->fields[EDITOR];
//}
return 'Unknown'; return 'Unknown';
} }
@@ -1199,7 +1207,7 @@ class BibEntry {
// we add biburl and title to be able to retrieve this important information // we add biburl and title to be able to retrieve this important information
// using Xpath expressions on the XHTML source // using Xpath expressions on the XHTML source
echo " <a class=\"biburl\" title=\"".$this->getKey()."\" {$href}>[bib]</a>"; echo " <a ".(BIBTEXBROWSER_BIB_IN_NEW_WINDOW?' target="_blank" ':'')." class=\"biburl\" title=\"".$this->getKey()."\" {$href}>[bib]</a>";
// returns an empty string if no url present // returns an empty string if no url present
echo $this->getUrlLink(); echo $this->getUrlLink();