diff --git a/src/IndependentYearMenu.php b/src/IndependentYearMenu.php new file mode 100644 index 0000000..e70dac6 --- /dev/null +++ b/src/IndependentYearMenu.php @@ -0,0 +1,31 @@ + + $_GET['library']=1; + $_GET['bib']='bibacid-utf8.bib'; + $_GET['all']=1; + include( 'bibtexbrowser.php' ); + setDB(); + new IndependentYearMenu($_GET[Q_DB]); + +*/ +class IndependentYearMenu +{ + public function __construct($db) { + $yearIndex = $db->yearIndex(); + echo '
Year: '; + $formatedYearIndex = array(); + $formatedYearIndex[] = ''.*')).'>All'; + foreach($yearIndex as $year) { + $formatedYearIndex[] = '$year)).'>'.$year.''; + } + + // by default the separator is a | + echo implode('|',$formatedYearIndex); + echo '
'; + } +} diff --git a/src/bibtexbrowser.php b/src/bibtexbrowser.php index 681d260..89ec180 100644 --- a/src/bibtexbrowser.php +++ b/src/bibtexbrowser.php @@ -20,6 +20,7 @@ use Monperrus\BibtexBrowser\ParserDelegate; use Monperrus\BibtexBrowser\XMLPrettyPrinter; use Monperrus\BibtexBrowser\StringEntry; use Monperrus\BibtexBrowser\BibDBBuilder; +use Monperrus\BibtexBrowser\IndependentYearMenu; // it is be possible to include( 'bibtexbrowser.php' ); several times in the same script // added on Wednesday, June 01 2011, bug found by Carlos Bras @@ -2163,32 +2164,6 @@ function splitFullName($author){ } -/** outputs an horizontal year-based menu -usage: -
-  $_GET['library']=1;
-  $_GET['bib']='bibacid-utf8.bib';
-  $_GET['all']=1;
-  include( 'bibtexbrowser.php' );
-  setDB();
-  new IndependentYearMenu($_GET[Q_DB]);
-
- */ -class IndependentYearMenu { - function __construct($db) { - $yearIndex = $db->yearIndex(); - echo '
Year: '; - $formatedYearIndex = array(); - $formatedYearIndex[] = ''.*')).'>All'; - foreach($yearIndex as $year) { - $formatedYearIndex[] = '$year)).'>'.$year.''; - } - - // by default the separator is a | - echo implode('|',$formatedYearIndex); - echo '
'; - } -} if (!function_exists('poweredby')) { /** Returns the powered by part. @nodoc */