From 5a9b9f1db5f2a1ec6a42ad203c9fe5f1af59a2a5 Mon Sep 17 00:00:00 2001 From: Martin Monperrus Date: Thu, 3 Oct 2013 22:33:28 +0200 Subject: [PATCH] refactoring --- bibtexbrowser.php | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/bibtexbrowser.php b/bibtexbrowser.php index a81d074..093dd46 100755 --- a/bibtexbrowser.php +++ b/bibtexbrowser.php @@ -1346,44 +1346,45 @@ class BibEntry { /** Outputs HTML line according to layout */ function toHTML() { + $result = ''; switch(BIBTEXBROWSER_LAYOUT) { // open row case 'list': - echo '
  • '; + $result .= '
  • '; break; case 'ordered_list': - echo '
  • '; + $result .= '
  • '; break; case 'table': - echo ''; + $result .= ''; break; case 'definition': - echo '
    '; + $result .= '
    '; if (ABBRV_TYPE=='none') { die ('Cannot define an empty term!'); } break; } - echo $this->anchor(); + $result .= $this->anchor(); switch(BIBTEXBROWSER_LAYOUT) { // close bibref and open bibitem case 'table': - echo $this->getAbbrv().''; + $result .= $this->getAbbrv().''; break; case 'definition': - echo $this->getAbbrv().'
    '; + $result .= $this->getAbbrv().'
    '; break; } - echo bib2html($this); - echo $this->bib2links(); + $result .= bib2html($this); + $result .= $this->bib2links(); switch(BIBTEXBROWSER_LAYOUT) { // close row case 'list': - echo '
  • '."\n"; + $result .= ''."\n"; break; case 'ordered_list': - echo ''."\n"; + $result .= ''."\n"; break; case 'table': - echo ''."\n"; + $result .= ''."\n"; break; case 'definition': - echo ''."\n"; + $result .= ''."\n"; break; } return $result; @@ -2451,7 +2452,7 @@ class SimpleDisplay { // by default, index are in decreasing order // so that when you add a publicaton recent , the indices of preceding publications don't change $bib->setIndex($count-($i++)); - $bib->toHTML(); + echo $bib->toHTML(); $pred = $bib; } // end foreach @@ -3344,7 +3345,7 @@ class PagedDisplay { $index = ($this->page-1)*PAGE_SIZE + $i; if (isset($this->entries[$index])) { $bib = $this->entries[$index]; - $bib->toHTML(); + echo $bib->toHTML(); } else { //break;