Browse Source

feat: add a way to add a banner

pull/75/head
Martin Monperrus 8 years ago
parent
commit
95547fadb5
  1. 12
      bibtexbrowser-documentation.wiki
  2. 2
      bibtexbrowser-test.php
  3. 10
      bibtexbrowser.php

12
bibtexbrowser-documentation.wiki

@ -526,6 +526,18 @@ In your project's `composer.json`, just add this <pre>"monperrus/bibtexbrowser":
}
</pre>
====How to add a banner to the main view in frameset mode?====
For instance, if you want to add a "home page" button in the main view of the frameset mode, add a banner function in ''bibtexbrowser.local.php'' as follows:
<pre>
&lt;?php
function bibtexbrowser_top_banner() {
return '&lt;a href="/home">Home page&lt;/a>';
}
?>
</pre>
=====Related tools=====
Old-fashioned:

2
bibtexbrowser-test.php

@ -11,7 +11,7 @@ $ phpunit --coverage-html ./coverage btb-test.php
*/
// backward compatibility
if (!class_exists('PHPUnit_Framework_TestCase')) { //
if (!class_exists('PHPUnit_Framework_TestCase')) {
class_alias('\PHPUnit\Framework\TestCase', 'PHPUnit_Framework_TestCase');
}

10
bibtexbrowser.php

@ -2655,6 +2655,12 @@ if (!function_exists('poweredby')) {
}
}
if (!function_exists('bibtexbrowser_top_banner')) {
function bibtexbrowser_top_banner() {
return '';
}
}
/** ^^adds a touch of AJAX in bibtexbrowser to display bibtex entries inline.
It uses the HIJAX design pattern: the Javascript code fetches the normal bibtex HTML page
and extracts the bibtex.
@ -4120,6 +4126,10 @@ echo "\n".' --></style>';
</head>
<body>
<?php
// configuration point to add a banner
echo bibtexbrowser_top_banner();
?>
<?php
if (method_exists($content, 'getTitle')) {
echo "<div class=\"rheader\">" . $content->getTitle() . "</div>";
}

Loading…
Cancel
Save