From 95547fadb599f57e725ad2ed2c51cb4635e67310 Mon Sep 17 00:00:00 2001 From: Martin Monperrus Date: Wed, 12 Jul 2017 12:05:23 +0200 Subject: [PATCH] feat: add a way to add a banner --- bibtexbrowser-documentation.wiki | 12 ++++++++++++ bibtexbrowser-test.php | 2 +- bibtexbrowser.php | 10 ++++++++++ 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/bibtexbrowser-documentation.wiki b/bibtexbrowser-documentation.wiki index 44dc360..2bd45a0 100755 --- a/bibtexbrowser-documentation.wiki +++ b/bibtexbrowser-documentation.wiki @@ -526,6 +526,18 @@ In your project's `composer.json`, just add this
"monperrus/bibtexbrowser":
 }
 
+====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: +
+<?php
+function bibtexbrowser_top_banner() {
+  return '<a href="/home">Home page</a>';
+}
+?>
+
+ + =====Related tools===== Old-fashioned: diff --git a/bibtexbrowser-test.php b/bibtexbrowser-test.php index 9337a11..2d7c72d 100755 --- a/bibtexbrowser-test.php +++ b/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'); } diff --git a/bibtexbrowser.php b/bibtexbrowser.php index 7ddaefa..b0a9506 100755 --- a/bibtexbrowser.php +++ b/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. @@ -4119,6 +4125,10 @@ echo "\n".' -->'; ?> + " . $content->getTitle() . "";