Beispiel #1
0
 public static function similarPubsHtml($db)
 {
     if (!isset($_SESSION['similar_pubs'])) {
         return;
     }
     $html = '<h3>Similar Publications in Database</h3>';
     foreach ($_SESSION['similar_pubs'] as $sim_pub_id) {
         $sim_pub = new pdPublication();
         $sim_pub->dbLoad($db, $sim_pub_id);
         $html .= $sim_pub->getCitationHtml('..', false) . '<p/>';
         unset($sim_pub);
     }
     return $html;
 }
 public function __construct()
 {
     parent::__construct('delete_publication', 'Delete Publication', 'Admin/delete_pbublication.php');
     if ($this->loginError) {
         return;
     }
     $this->loadHttpVars();
     if (isset($this->pub_id) && !is_numeric($this->pub_id)) {
         $this->pageError = true;
         return;
     }
     $form =& $this->confirmForm('deleter');
     $form->addElement('hidden', 'pub_id', $this->pub_id);
     if ($form->validate()) {
         $values = $form->exportValues();
         $pub = new pdPublication();
         $result = $pub->dbLoad($this->db, $values['pub_id']);
         if (!$result) {
             $this->pageError = true;
             return;
         }
         $title = $pub->title;
         $pub->dbDelete($this->db);
         echo 'You have successfully removed the following ', 'publication from the database: <p/><b>', $title, '</b>';
     } else {
         if ($this->pub_id == null) {
             echo 'No pub id defined';
             $this->pageError = true;
             return;
         }
         $pub = new pdPublication();
         $result = $pub->dbLoad($this->db, $this->pub_id);
         if (!$result) {
             $this->pageError = true;
             return;
         }
         $renderer =& $form->defaultRenderer();
         $form->accept($renderer);
         echo '<h3>Delete Publication</h3>Delete the following paper?<p/>', $pub->getCitationHtml();
         $this->form =& $form;
         $this->renderer =& $renderer;
     }
 }