From b256b7bda5c7b49da74ec7a795c26e8e8f8dad3b Mon Sep 17 00:00:00 2001 From: Martin Monperrus Date: Sat, 5 Nov 2016 21:35:11 +0100 Subject: [PATCH] changes Scholar citation link --- bibtexbrowser-test.php | 11 +++++++++++ bibtexbrowser.php | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/bibtexbrowser-test.php b/bibtexbrowser-test.php index 139f719..4937dd5 100755 --- a/bibtexbrowser-test.php +++ b/bibtexbrowser-test.php @@ -611,6 +611,17 @@ class BTBTest extends PHPUnit_Framework_TestCase { $this->assertEquals($bibtex, $entry->getText()); } + function testscholarlink() { + bibtexbrowser_configure('BIBTEXBROWSER_BIBTEX_VIEW', 'original'); + $bibtex = "@article{key,title={An article Book},gsid={1234},author = {Martin Monperrus and Foo Ac\'e and Monperrus, Martin}}"; + $test_data = fopen('php://memory','x+'); + fwrite($test_data, $bibtex); + fseek($test_data,0); + $db = new BibDataBase(); + $db->update_internal("inline", $test_data); + $entry=$db->getEntryByKey("key"); + $this->assertContains('[citations]', $entry->toHTML()); + } } // end class diff --git a/bibtexbrowser.php b/bibtexbrowser.php index 5ac1abd..1ee4153 100755 --- a/bibtexbrowser.php +++ b/bibtexbrowser.php @@ -1343,7 +1343,7 @@ class BibEntry { /** 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); + $str = $this->getIconOrTxt('citations',$iconurl); if ($this->hasField('gsid')) { return ' '.$str.''; }