From a6dd34917739c3dcde11467153358214cf95ce30 Mon Sep 17 00:00:00 2001 From: Markus Jochim Date: Fri, 19 Sep 2014 19:26:09 +0200 Subject: [PATCH] Added a table of contents to search results in academic display --- bibtexbrowser.php | 42 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/bibtexbrowser.php b/bibtexbrowser.php index aa5fa40..c2bb04c 100755 --- a/bibtexbrowser.php +++ b/bibtexbrowser.php @@ -118,6 +118,8 @@ function bibtexbrowser_configure($key, $value) { // Which is the first html level that should be used in embedded mode? @define('BIBTEXBROWSER_HTMLHEADINGLEVEL', 2); +@define('BIBTEXBROWSER_ACADEMIC_TOC', true); + @define('BIBTEXBROWSER_DEBUG',false); @define('COMMA_NAMES',false);// do have authors in a comma separated form? @@ -2816,11 +2818,45 @@ class AcademicDisplay { $this->db = createBibDataBase(); $this->db->bibdb = $this->entries; - foreach (_DefaultBibliographySections() as $section) { - $this->search2html($section['query'],$section['title']); + if (BIBTEXBROWSER_ACADEMIC_TOC != true) { + foreach (_DefaultBibliographySections() as $section) { + $this->search2html($section['query'],$section['title']); + } + } else { + $sections = array(); + echo ""; + + foreach ($sections as $section) { + echo "\n"; + echo ""; + echo $section['title']." (".$section['count'].")"; + echo "\n", + $section['display']->display(); + } } } - }