public function __construct() { parent::__construct(null, 'Publication Submitted', 'Admin/add_pub_submit.php', pdNavMenuItem::MENU_NEVER); if ($this->loginError) { return; } if (!isset($_SESSION['state']) || $_SESSION['state'] != 'pub_add') { $this->pageError = true; return; } $pub =& $_SESSION['pub']; $user =& $_SESSION['user']; if ($pub->pub_id != null) { echo 'The following PapersDB entry has been modified:<p/>'; } else { echo 'The following PapersDB entry has been added to the database:<p/>'; } $pub->submit = $user->name; $pub->dbSave($this->db); // deal with paper if (isset($_SESSION['paper'])) { if ($_SESSION['paper'] != 'none') { $pub->paperSave($this->db, $_SESSION['paper']); } else { $pub->deletePaper($this->db); } } if (isset($_SESSION['attachments']) && count($_SESSION['attachments']) > 0) { for ($i = 0, $n = count($_SESSION['attachments']); $i < $n; $i++) { assert('isset($_SESSION["att_types"][$i])'); $pub->attSave($this->db, $_SESSION['attachments'][$i], $_SESSION['att_types'][$i]); } } if (isset($_SESSION['removed_atts']) && count($_SESSION['removed_atts']) > 0) { foreach ($_SESSION['removed_atts'] as $filename) { $pub->deleteAttByFilename($this->db, $filename); } } if ($this->debug) { debugVar('$pub', $pub); } // does pub entry require validation? if ($pub->validationRequired($this->db) && $user->isAdministrator()) { $pub->markValid($this->db); } else { $pub->markPending($this->db); } echo $pub->getCitationHtml(), getPubIcons($this->db, $pub, 0xf, '../'); pubSessionInit(); }
public function __construct() { parent::__construct('tag_non_ml'); if ($this->loginError) { return; } $this->loadHttpVars(); $pubs =& $this->getNonMachineLearningPapers(); $form = new HTML_QuickForm('tag_non_ml_form', 'post', './tag_ml_submit.php'); $form->addElement('header', null, 'Citation</th><th style="width:7%">Is ML'); $count = 0; foreach ($pubs as &$pub) { $pub->dbLoad($this->db, $pub->pub_id, pdPublication::DB_LOAD_VENUE | pdPublication::DB_LOAD_CATEGORY | pdPublication::DB_LOAD_AUTHOR_FULL); ++$count; $form->addGroup(array(HTML_QuickForm::createElement('static', null, null, $pub->getCitationHtml() . ' ' . getPubIcons($this->db, $pub, 0x7)), HTML_QuickForm::createElement('advcheckbox', 'pub_tag[' . $pub->pub_id . ']', null, null, null, array('no', 'yes'))), 'tag_ml_group', $count, '</td><td>', false); } $form->addElement('submit', 'submit', 'Submit'); $renderer =& $form->defaultRenderer(); $form->accept($renderer); $this->renderer =& $renderer; }
public function renderForm() { $form =& $this->form; foreach (array_keys(get_class_vars(get_class($this))) as $member) { $defaults[$member] = $this->{$member}; } if (isset($this->pub->pub_id)) { echo '<h3>Editing Publication Entry</h3>'; } else { echo '<h3>Adding Publication Entry</h3>'; } echo $this->pub->getCitationHtml('..', false), ' ', getPubIcons($this->db, $this->pub, 0x1), '<p/>', add_pub_base::similarPubsHtml($this->db); if (is_object($this->pub->category)) { $defaults['cat_id'] = $this->pub->category->cat_id; } if (is_object($this->pub->venue)) { $defaults['venue_id'] = $this->venue_id; } $defaults['used_by_me'] = $this->used_by_me; if (isset($this->pub->rank_id)) { if ($this->pub->rank_id > 4) { $defaults['paper_rank'] = -1; $defaults['paper_rank_other'] = $this->pub->ranking; } else { $defaults['paper_rank'] = $this->pub->rank_id; } } else { if (is_object($this->pub->venue)) { // Use ranking from venue if ($this->pub->venue->rank_id > 4) { $defaults['paper_rank'] = -1; $defaults['paper_rank_other'] = $this->pub->venue->ranking; } else { $defaults['paper_rank'] = $this->pub->venue->rank_id; } } } $defaults['extra_info'] = $this->pub->extra_info; // assign category info items if (count($this->pub->info) > 0 && is_object($this->pub->category) && count($this->pub->category->info) > 0) { foreach ($this->formInfoElementsGet() as $element => $name) { if (isset($this->pub->info[$name])) { $defaults[$element] = $this->pub->info[$name]; } } } if (!isset($this->pub->published) || $this->pub->published == '') { $defaults['pub_date'] = array('Y' => date('Y'), 'M' => date('m')); } else { $date = explode('-', $this->pub->published); $defaults['pub_date']['Y'] = $date[0]; $defaults['pub_date']['M'] = $date[1]; } $form->setDefaults($defaults); $renderer =& $form->defaultRenderer(); $form->accept($renderer); $this->renderer =& $renderer; $this->javascript(); }
public function citationGet($pub) { assert('is_object($pub)'); $citation = $pub->getCitationHtml('..') . getPubIcons($this->db, $pub); return $citation; }
/** * Called to render the form. */ public function renderForm() { assert('isset($_SESSION["pub"])'); $form =& $this->form; $defaults = array('title' => $this->pub->title, 'abstract' => $this->pub->abstract, 'keywords' => $this->pub->keywords, 'user' => $this->pub->user); $this->form->setDefaults($defaults); if (isset($_SESSION['pub']) && $_SESSION['pub']->title != '') { $this->pub =& $_SESSION['pub']; if (isset($this->pub->pub_id)) { echo '<h3>Editing Publication Entry</h3>'; } else { echo '<h3>Adding Publication Entry</h3>'; } echo $this->pub->getCitationHtml('..', false), ' ', getPubIcons($this->db, $this->pub, 0x1), '<p/>', add_pub_base::similarPubsHtml($this->db); } $renderer =& $this->form->defaultRenderer(); $this->form->accept($renderer); $this->renderer =& $renderer; $this->javascript(); }
public function renderForm() { assert('isset($_SESSION["pub"])'); $form =& $this->form; $defaults = array(); if (count($this->pub->authors) > 0) { foreach ($this->pub->authors as $author) { $auth_names[] = $author->firstname . ' ' . $author->lastname; } $defaults['authors'] = implode(', ', $auth_names); } if (is_array($this->pub->collaborations) && count($this->pub->collaborations) > 0) { foreach ($this->pub->collaborations as $col_id) { $defaults['paper_col'][$col_id] = 1; } } $form->setDefaults($defaults); if (isset($this->pub->pub_id)) { echo '<h3>Editing Publication Entry</h3>'; } else { echo '<h3>Adding Publication Entry</h3>'; } echo $this->pub->getCitationHtml('', false), ' ', getPubIcons($this->db, $this->pub, 0x1), '<p/>', add_pub_base::similarPubsHtml($this->db); $renderer =& $form->defaultRenderer(); $form->accept($renderer); $this->renderer =& $renderer; $this->javascript(); }
public function renderForm() { assert('isset($_SESSION["pub"])'); $form =& $this->form; $defaults = array(); $web_links = $this->pub->getWebLinks(); if (count($web_links) > 0) { $c = 0; foreach ($web_links as $text => $url) { $defaults['curr_web_link_text' . $c] = $text; $defaults['curr_web_link_url' . $c] = $url; $c++; } } $form->setDefaults($defaults); if (isset($this->pub->pub_id)) { echo '<h3>Editing Publication Entry</h3>'; } else { echo '<h3>Adding Publication Entry</h3>'; } echo $this->pub->getCitationHtml('', false), ' ', getPubIcons($this->db, $this->pub, 0x1), '<p/>', add_pub_base::similarPubsHtml($this->db); $renderer =& $form->defaultRenderer(); $form->accept($renderer); $this->renderer =& $renderer; $this->javascript(); }
private function showPublication(&$pub) { $content = "<h2>" . $pub->title; if ($this->access_level > 0) { $content .= getPubIcons($this->db, $pub, 0xc); } $content .= "</h2>\n" . $pub->authorsToHtml(); if (isset($pub->paper) && strtolower($pub->paper) != 'no paper' && basename($pub->paper) != 'paper_') { if ($pub->paperExists()) { $content .= 'Full Text: <a href="' . $pub->paperAttGetUrl() . '">'; $name = split('paper_', $pub->paper); if ($name[1] != '') { $content .= $name[1]; } $content .= '</a> '; $content .= getPubIcons($this->db, $pub, 0x1) . "<br/>\n"; } } // Show Additional Materials $att_types = pdAttachmentTypesList::create($this->db); if (count($pub->additional_info) > 0) { $table = new HTML_Table(array('width' => '350', 'border' => '0', 'cellpadding' => '6', 'cellspacing' => '0')); $heading = 'Other Attachments:'; $add_count = 1; foreach ($pub->additional_info as $att) { $cell = ''; if ($pub->attExists($att)) { $name = split('additional_', $att->location); $cell .= '<a href="' . $pub->attachmentGetUrl($add_count - 1) . '">'; if ($name[1] != '') { $cell .= $name[1]; } $cell .= '</a>'; if (in_array($att->type, $att_types)) { $cell .= ' [' . $att->type . ']'; } $cell .= ' <a href="' . $pub->attachmentGetUrl($add_count - 1) . '">' . $this->getPubAddAttIcons($att) . '</a>'; $add_count++; } $table->addRow(array($heading, $cell)); $heading = ''; } $content .= $table->toHtml(); } $content .= '<p/>' . stripslashes($pub->abstract) . '<p/>' . '<h3>Citation</h3>' . $pub->getCitationHtml() . '<p/>'; $table = new HTML_Table(array('width' => '600', 'border' => '0', 'cellpadding' => '6', 'cellspacing' => '0')); $category = ''; if (isset($pub->category) && isset($pub->category->category)) { $category = $pub->category->category; } $table->addRow(array('Keywords:', $pub->keywordsGet())); $table->addRow(array('Category:', $category)); if (isset($_SESSION['user']) && $_SESSION['user']->showInternalInfo()) { $table->addRow(array('Ranking:', $pub->ranking)); if (is_array($pub->collaborations) && count($pub->collaborations) > 0) { $col_desciptions = $pub->collaborationsGet($this->db); foreach ($pub->collaborations as $col_id) { $values[] = $col_desciptions[$col_id]; } $table->addRow(array('Collaboration:', implode(', ', $values))); } $table->addRow(array('Extra Info:', $pub->extraInfoGet())); } if (isset($_SESSION['user']) && $_SESSION['user']->showUserInfo()) { $table->addRow(array('User Info:', $pub->user)); } $web_links = $pub->getWebLinks(); if (count($web_links) > 0) { $c = 0; foreach ($web_links as $name => $url) { if ($c == 0) { $label = 'Web Links:'; } else { $label = ''; } $table->addRow(array($label, '<a href="' . $url . '" ' . 'target="_blank">' . $name . '</a>')); $c++; } } if (count($pub->relatedPubsGet()) > 0) { $c = 0; foreach ($pub->relatedPubsGet() as $related_pub_id) { if ($c == 0) { $label = 'Related Publication(s):'; } else { $label = ''; } $rel_pub = new pdPublication(); $rel_pub->dbLoad($this->db, $related_pub_id); $table->addRow(array($label, '<a href="view_publication.php?' . 'pub_id=' . $rel_pub->pub_id . '" ' . ' target="_blank">' . $rel_pub->title . '</a>')); $c++; } } $table->updateColAttributes(0, array('class' => 'emph', 'width' => '25%')); $content .= $table->toHtml(); $bibtex = $pub->getBibtex(); if ($bibtex !== false) { $content .= '<h3>BibTeX</h3><pre class="bibtex">' . $bibtex . '</pre><p/>'; } $updateStr = $this->lastUpdateGet($pub); if ($updateStr != '') { $updateStr = 'Last Updated: ' . $updateStr . '<br/>'; } $updateStr .= 'Submitted by ' . $pub->submit; echo $content, '<span class="small">', $updateStr, '</span>'; }
function displayPubListByCategory(&$db, &$pub_list, $enumerate = true, $max = -1, $options = null, $url_prefix = '') { assert('is_object($db)'); assert('is_array($pub_list)'); $result = ''; $count = 0; $col_desciptions = pdPublication::collaborationsGet($db); foreach (pdPubList::catDisplayOrder() as $category) { $pubs =& $pub_list[$category]; if (empty($pubs)) { continue; } if ($category == 'Other') { $result .= "<h3>Other Categories</h3>\n"; } else { $result .= '<h3>' . $category . "</h3>\n"; } foreach ($pubs as $pub) { ++$count; $pub->dbLoad($db, $pub->pub_id); $cells = array(); $table = new HTML_Table(array('class' => 'publist', 'cellpadding' => '0', 'cellspacing' => '0')); $table->setAutoGrow(true); $citation = $pub->getCitationHtml($url_prefix) . ' ' . getPubIcons($db, $pub, 0xf, $url_prefix); if (is_array($options) && !empty($options['show_internal_info']) && $options['show_internal_info'] || isset($_SESSION['user']) && $_SESSION['user']->showInternalInfo()) { $citation .= '<br/><span style="font-size:80%">'; if (isset($pub->ranking)) { $citation .= 'Ranking: ' . $pub->ranking; } if (is_array($pub->collaborations) && count($pub->collaborations) > 0) { $values = array(); foreach ($pub->collaborations as $col_id) { $values[] = $col_desciptions[$col_id]; } $citation .= '<br/>Collaboration:' . implode(', ', $values); } if (isset($_SESSION['user']) && $_SESSION['user']->showUserInfo()) { $citation .= "<br/>User Info: {$pub->user}"; } $citation .= '</span>'; } if ($enumerate) { $cells[] = $count . '.'; } $cells[] = $citation; $table->addRow($cells); if ($enumerate) { $table->updateColAttributes(0, array('class' => 'item'), NULL); } $result .= $table->toHtml(); unset($table); if ($max > 0 && $count >= $max) { break; } } } return $result; }