diff --git a/bibtexbrowser.php b/bibtexbrowser.php index 2f715a6..eaa0d5c 100755 --- a/bibtexbrowser.php +++ b/bibtexbrowser.php @@ -234,6 +234,13 @@ License, or (at your option) any later version. */ +// Wednesday, June 01 2011: bug found by Carlos Brás +// it should be possible to include( 'bibtexbrowser.php' ); several times in the same script +if (!defined('BIBTEXBROWSER')) { +// this if block ends at the very end of this file, after all class and function declarations. +define('BIBTEXBROWSER','v__MTIME__'); + + // *************** CONFIGURATION // I recommend to put your changes in bibtexbrowser.local.php // it will help you to upgrade the script with a new version @@ -1484,6 +1491,67 @@ class IndependentYearMenu { } } +/** Class to encapsulates the header formatting and the powered by footer */ +class BibtexBrowserDisplay { + /** the title */ + var $title; + + function getTitle() { return $this->title; } + + function display() { /* unimplemented */ } + + /** returns the url of this display (e.g. base on the query)*/ + function getURL() { return '';} + + /** returns the url of the RSS */ + function getRSS() { return '';} + + /** Returns the powered by part */ + function poweredby() { + $poweredby = "\n".'
'; + $poweredby .= ''; + $poweredby .= 'Powered by bibtexbrowser'; + $poweredby .= '
'."\n"; + return $poweredby; + } + + function formatedHeader() { return "
{$this->title}
\n";} + + /** 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. + * In other terms, URLs and content are left perfectly optimized for crawlers + * Note how beautiful is this piece of code thanks to JQuery. + */ + function javascript() { + // we use jquery with the official content delivery URLs + // Microsoft and Google also provide jquery with their content delivery networks +?> +title; } - - function display() { /* unimplemented */ } - - /** returns the url of this display (e.g. base on the query)*/ - function getURL() { return '';} - - /** returns the url of the RSS */ - function getRSS() { return '';} - - /** Returns the powered by part */ - function poweredby() { - $poweredby = "\n".'
'; - $poweredby .= ''; - $poweredby .= 'Powered by bibtexbrowser'; - $poweredby .= '
'."\n"; - return $poweredby; - } - - function formatedHeader() { return "
{$this->title}
\n";} - - /** 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. - * In other terms, URLs and content are left perfectly optimized for crawlers - * Note how beautiful is this piece of code thanks to JQuery. - */ - function javascript() { - // we use jquery with the official content delivery URLs - // Microsoft and Google also provide jquery with their content delivery networks -?> -'; /** NoWrapper calls method display() on the content. */ class NoWrapper { function NoWrapper(&$content) { - header('Content-type: text/html; charset='.ENCODING); + @header('Content-type: text/html; charset='.ENCODING); echo $content->display(); } } @@ -2887,7 +2895,9 @@ class Dispatcher { return 'END_DISPATCH'; } -} +} // end class Dispatcher + +} // end if (!defined('BIBTEXBROWSER')) new Dispatcher();