changes Scholar citation link
This commit is contained in:
@@ -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('<a href="http://scholar.google.com/scholar?cites=1234">[citations]</a>', $entry->toHTML());
|
||||
}
|
||||
|
||||
} // end class
|
||||
|
||||
|
||||
+1
-1
@@ -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 ' <a'.get_target().' href="http://scholar.google.com/scholar?cites='.$this->getField("gsid").'">'.$str.'</a>';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user