diff --git a/bibtexbrowser.php b/bibtexbrowser.php index ea0125c..c5a5420 100755 --- a/bibtexbrowser.php +++ b/bibtexbrowser.php @@ -115,6 +115,9 @@ function bibtexbrowser_configure($key, $value) { // for ordered_list, the index is given by HTML directly (in increasing order) @define('BIBTEXBROWSER_LAYOUT','table'); +// Which is the first html level that should be used in embedded mode? +@define('BIBTEXBROWSER_HTMLHEADINGLEVEL', 2); + @define('BIBTEXBROWSER_DEBUG',false); @define('COMMA_NAMES',false);// do have authors in a comma separated form? @@ -1711,6 +1714,7 @@ function bib2links_default(&$bibentry) { /** prints the header of a layouted HTML, depending on BIBTEXBROWSER_LAYOUT e.g. */ function print_header_layout() { + if (BIBTEXBROWSER_LAYOUT == 'list') return; echo '<' . get_HTML_tag_for_layout() . ' class="result">'."\n"; } @@ -2632,6 +2636,14 @@ class SimpleDisplay { var $options = array(); + var $headingLevel = BIBTEXBROWSER_HTMLHEADINGLEVEL; + function incHeadingLevel ($by=1) { + $this->headingLevel += $by; + } + function decHeadingLevel ($by=1) { + $this->headingLevel -= $by; + } + function setDB(&$bibdatabase) { $this->setEntries($bibdatabase->bibdb); } @@ -2689,7 +2701,7 @@ class SimpleDisplay { $pred = NULL; foreach ($this->entries as $bib) { if ($this->changeSection($pred, $bib)) { - echo $this->sectionHeader($bib); + echo $this->sectionHeader($bib, $pred); } // by default, index are in decreasing order // so that when you add a publicaton recent , the indices of preceding publications don't change @@ -2712,7 +2724,7 @@ class SimpleDisplay { return $f($pred, $bib) != 0; } - function sectionHeader($bib) { + function sectionHeader($bib, $pred) { switch(BIBTEXBROWSER_LAYOUT) { case 'table': return ''."\n"; @@ -2720,6 +2732,15 @@ class SimpleDisplay { case 'definition': return '
'.$bib->getYear().'
'."\n"; break; + case 'list': + $string = ''; + if ($pred) $string .= "\n"; + if ($bib->hasField(YEAR)) + $year = $bib->getYear(); + else + $year = __('No date'); + return $string.'headingLevel.'>'.$year."headingLevel.">\n
'.$bib->getYear().'