function display()
 {
     $this->db = createBibDataBase();
     $this->db->bibdb = $this->entries;
     if (BIBTEXBROWSER_ACADEMIC_TOC != true) {
         foreach (_DefaultBibliographySections() as $section) {
             $this->search2html($section['query'], $section['title']);
         }
     } else {
         $sections = array();
         echo "<ul>";
         foreach (_DefaultBibliographySections() as $section) {
             $entries = $this->db->multisearch($section['query']);
             if (count($entries) > 0) {
                 $anchor = preg_replace("/[^a-zA-Z]/", "", $section['title']);
                 echo "<li><a href=\"#" . $anchor . "\">" . $section['title'] . " (" . count($entries) . ")</a></li>";
                 $display = createBasicDisplay();
                 $display->incHeadingLevel();
                 $display->setEntries($entries);
                 $display->headerCSS = 'theader';
                 $sections[] = array('display' => $display, 'anchor' => $anchor, 'title' => $section['title'], 'count' => count($entries));
             }
         }
         echo "</ul>";
         foreach ($sections as $section) {
             echo "\n<a name=\"" . $section['anchor'] . "\"></a>";
             echo "<h" . BIBTEXBROWSER_HTMLHEADINGLEVEL . ">";
             echo $section['title'] . " (" . $section['count'] . ")";
             echo "</h" . BIBTEXBROWSER_HTMLHEADINGLEVEL . ">\n", $section['display']->display();
         }
     }
 }
Exemplo n.º 2
0
 /** Displays a set of bibtex entries in an HTML table */
 function display()
 {
     $delegate = createBasicDisplay();
     $delegate->setEntries($this->entries);
     $index = count($this->entries);
     foreach ($this->yearIndex as $year) {
         $x = array();
         uasort($x, 'compare_bib_entry_by_month');
         foreach ($this->entries as $e) {
             if ($e->getYear() == $year) {
                 $x[] = $e;
             }
         }
         if (count($x) > 0) {
             echo '<div  class="btb-header">' . $year . '</div>';
             $delegate->setEntries($x);
             $delegate->display();
         }
         $index = $index - count($x);
     }
 }