function key()
 {
     $entries = array();
     // case 1: this is a single key
     if ($this->getDB()->contains($_GET[Q_KEY])) {
         $entries[] = $this->getDB()->getEntryByKey($_GET[Q_KEY]);
         if (isset($_GET['astext'])) {
             $bibdisplay = new BibtexDisplay();
             $bibdisplay->setEntries($entries);
             $bibdisplay->display();
         } else {
             $bibdisplay = createBibEntryDisplay();
             $bibdisplay->setEntries($entries);
             $fun = $this->wrapper;
             $fun($bibdisplay);
         }
         return 'END_DISPATCH';
     }
     // case two: multiple keys
     if (preg_match('/[|,]/', $_GET[Q_KEY])) {
         $this->query[Q_SEARCH] = str_replace(',', '|', $_GET[Q_KEY]);
     } else {
         nonExistentBibEntryError();
     }
 }
Пример #2
0
 function key()
 {
     if ($_GET[Q_DB]->contains($_GET[Q_KEY])) {
         $bibentry = $_GET[Q_DB]->getEntryByKey($_GET[Q_KEY]);
         $entries = array($bibentry);
         if (isset($_GET['astext'])) {
             $bibdisplay = new BibtexDisplay();
             $bibdisplay->setEntries($entries);
             $bibdisplay->display();
         } else {
             $bibdisplay = createBibEntryDisplay();
             $bibdisplay->setEntries($entries);
             new $this->wrapper($bibdisplay, $bibdisplay->metadata());
         }
         return 'END_DISPATCH';
     } else {
         nonExistentBibEntryError();
     }
 }