Exemplo n.º 1
0
$numaff = 0;
$numnon = 0;
// Did we get any results back?
if ($this->citations) {
    // Get a needed library
    include_once PATH_CORE . DS . 'components' . DS . 'com_citations' . DS . 'helpers' . DS . 'format.php';
    // Set some vars
    $affiliated = '';
    $nonaffiliated = '';
    $formatter = new \Components\Citations\Helpers\Format();
    $formatter->setTemplate($this->format);
    // Loop through the citations and build the HTML
    foreach ($this->citations as $cite) {
        $showLinks = $cite->title && $cite->author && $cite->publisher ? true : false;
        $item = "\t" . '<li>' . "\n";
        $formatted = $cite->formatted ? $cite->formatted : \Components\Citations\Helpers\Format::formatReference($cite, '');
        if ($cite->doi && $cite->url) {
            $formatted = str_replace('doi:' . $cite->doi, '<a href="' . $cite->url . '" rel="external">' . 'doi:' . $cite->doi . '</a>', $formatted);
        }
        $item .= $formatted;
        $item .= "\t\t" . '<p class="details">' . "\n";
        if ($showLinks) {
            $item .= "\t\t\t" . '<a href="' . Route::url('index.php?option=com_citations&task=download&id=' . $cite->id . '&format=bibtex&no_html=1') . '" title="' . Lang::txt('PLG_PUBLICATION_CITATIONS_DOWNLOAD_BIBTEX') . '">BibTex</a> <span>|</span> ' . "\n";
            $item .= "\t\t\t" . '<a href="' . Route::url('index.php?option=com_citations&task=download&id=' . $cite->id . '&format=endnote&no_html=1') . '" title="' . Lang::txt('PLG_PUBLICATION_CITATIONS_DOWNLOAD_ENDNOTE') . '">EndNote</a>' . "\n";
        }
        if ($cite->eprint) {
            if ($cite->eprint) {
                $item .= "\t\t\t" . ' <span>|</span> <a href="' . stripslashes($cite->eprint) . '">' . Lang::txt('PLG_PUBLICATION_CITATIONS_ELECTRONIC_PAPER') . '</a>' . "\n";
            }
        }
        $item .= "\t\t" . '</p>' . "\n";
Exemplo n.º 2
0
$sitename = Config::get('sitename');
// Build our citation object
$citation = '';
if ($this->pub->doi) {
    include_once PATH_CORE . DS . 'components' . DS . 'com_citations' . DS . 'helpers' . DS . 'format.php';
    $cite = new stdClass();
    $cite->title = $this->pub->get('title');
    $date = $this->pub->published() ? $this->pub->published() : $this->pub->submitted();
    $cite->year = Date::of($date)->format('Y');
    $cite->location = '';
    $cite->date = '';
    $cite->url = $site . Route::url($this->pub->link('version'));
    $cite->type = '';
    $cite->author = $this->pub->getUnlinkedContributors();
    $cite->doi = $this->pub->get('doi');
    $citation = \Components\Citations\Helpers\Format::formatReference($cite);
}
// Embargo
$pubdate = Request::getVar('publish_date');
// Get configs
$termsUrl = $this->pub->config()->get('deposit_terms', '');
?>

<!-- Load content selection browser //-->
<div id="<?php 
echo $elName;
?>
" class="draft-review <?php 
echo $complete ? 'draft-complete' : 'draft-incomplete';
?>
 <?php 
Exemplo n.º 3
0
" class="blockelement<?php 
echo $required ? ' el-required' : ' el-optional';
echo $complete ? ' el-complete' : ' el-incomplete';
?>
 freezeblock">
<?php 
if (count($this->pub->_citations) > 0) {
    $i = 1;
    $formatter = new \Components\Citations\Helpers\Format();
    $formatter->setTemplate($citationFormat);
    ?>
	<div class="list-wrapper">
		<ul class="itemlist" id="citations-list">
		<?php 
    foreach ($this->pub->_citations as $cite) {
        $citeText = $cite->formatted ? '<p>' . $cite->formatted . '</p>' : \Components\Citations\Helpers\Format::formatReference($cite, '');
        ?>
			<li>
				<span class="item-title citation-formatted"><?php 
        echo $citeText;
        ?>
</span>
			</li>
	<?php 
        $i++;
    }
    ?>
		</ul>
	</div>
	<?php 
} else {
Exemplo n.º 4
0
 /**
  * Process a single record
  *
  * @param   integer  $id
  * @return  object
  */
 public function record($id)
 {
     if (strstr($id, ':')) {
         list($id, $revision) = explode(':', $id);
     }
     $id = intval($id);
     if (!isset($revision)) {
         $revision = 0;
     }
     $this->database->setQuery("SELECT r.id, r.id AS identifier, r.title, r.introtext AS description, r.fulltxt, r.created, r.publish_up, r.alias, rt.alias AS type\n\t\t\tFROM `#__resources` AS r\n\t\t\tINNER JOIN `#__resource_types` AS rt ON r.type = rt.id\n\t\t\tWHERE r.id = " . $this->database->quote($id));
     $record = $this->database->loadObject();
     $record->base = $this->name();
     $record->type = $record->base . ':' . $record->type;
     if ($revision) {
         $this->database->setQuery("SELECT *\n\t\t\t\tFROM `#__tool_version`\n\t\t\t\tWHERE toolname=" . $this->database->quote($record->alias) . " AND revision=" . $this->database->quote($revision) . "\n\t\t\t\tLIMIT 1");
         $tool = $this->database->loadObject();
         if ($tool->id) {
             $record->title .= ' [version ' . $tool->version . ']';
             $record->fulltxt = $tool->fulltxt;
             $record->publish_up = $tool->released;
         }
     }
     $record->date = $record->created;
     if ($record->publish_up && $record->publish_up != $this->database->getNullDate()) {
         $record->date = $record->publish_up;
     }
     if (!$record->description) {
         $record->description = $record->fulltxt;
         $record->description = preg_replace("#<nb:(.*?)>(.*?)</nb:(.*?)>#s", '', $record->description);
     }
     $record->description = strip_tags($record->description);
     $record->description = trim($record->description);
     unset($record->publish_up);
     unset($record->created);
     unset($record->fulltxt);
     $isTool = 0;
     if ($record->alias) {
         $this->database->setQuery("SELECT id\n\t\t\t\tFROM `#__tool`\n\t\t\t\tWHERE toolname=" . $this->database->quote($record->alias) . "\n\t\t\t\tLIMIT 1");
         $isTool = $this->database->loadResult();
     }
     if ($revision) {
         /*"SELECT a.`doi`
         		FROM `#__doi_mapping` AS a
         		LEFT JOIN `#__tool_version` AS v ON v.id=a.versionid
         		WHERE a.rid=" . $this->database->quote($id) . " AND v.revision=" . $this->database->quote($revision) . "
         		LIMIT 1"*/
         $this->database->setQuery("SELECT a.`doi`\n\t\t\t\tFROM `#__doi_mapping` AS a\n\t\t\t\tWHERE a.rid=" . $this->database->quote($id) . " AND a.local_revision=" . $this->database->quote($revision) . "\n\t\t\t\tLIMIT 1");
     } else {
         $this->database->setQuery("SELECT a.`doi`\n\t\t\t\tFROM `#__doi_mapping` AS a\n\t\t\t\tWHERE a.rid=" . $this->database->quote($id) . "\n\t\t\t\tORDER BY `versionid` DESC LIMIT 1");
     }
     $record->identifier = $this->identifier($id, $this->database->loadResult(), $revision);
     $this->database->setQuery("SELECT DISTINCT t.raw_tag\n\t\t\tFROM `#__tags` t, `#__tags_object` tos\n\t\t\tWHERE t.id = tos.tagid AND tos.objectid=" . $this->database->quote($id) . " AND tos.tbl='resources' AND t.admin=0\n\t\t\tORDER BY t.raw_tag");
     $record->subject = $this->database->loadColumn();
     $record->relation = array();
     $this->database->setQuery("SELECT r.id, r.title, r.type, r.logical_type AS logicaltype, r.created, r.created_by,\n\t\t\tr.published, r.publish_up, r.path, r.access, t.type AS logicaltitle, rt.type AS typetitle, r.standalone\n\t\t\tFROM `#__resources` AS r\n\t\t\tINNER JOIN `#__resource_types` AS rt ON r.type=rt.id\n\t\t\tINNER JOIN `#__resource_assoc` AS a ON r.id=a.child_id\n\t\t\tLEFT JOIN `#__resource_types` AS t ON r.logical_type=t.id\n\t\t\tWHERE r.published=1 AND a.parent_id=" . $this->database->quote($id) . "\n\t\t\tORDER BY a.ordering, a.grouping");
     if ($children = $this->database->loadObjectList()) {
         require_once PATH_CORE . DS . 'components' . DS . 'com_resources' . DS . 'helpers' . DS . 'html.php';
         require_once PATH_CORE . DS . 'components' . DS . 'com_resources' . DS . 'tables' . DS . 'type.php';
         foreach ($children as $child) {
             $uri = \Components\Resources\Helpers\Html::processPath('com_resources', $child, $id, 3);
             if (substr($uri, 0, 4) != 'http') {
                 $uri = self::$base . '/' . ltrim($uri, '/');
             }
             $record->relation[] = array('type' => 'hasPart', 'value' => $uri);
         }
     }
     $this->database->setQuery("SELECT DISTINCT r.id\n\t\t\tFROM `#__resources` AS r\n\t\t\tINNER JOIN `#__resource_assoc` AS a ON r.id=a.parent_id\n\t\t\tWHERE r.published=1 AND a.child_id=" . $this->database->quote($id) . "\n\t\t\tORDER BY a.ordering, a.grouping");
     if ($parents = $this->database->loadObjectList()) {
         foreach ($parents as $parent) {
             $record->relation[] = array('type' => 'isPartOf', 'value' => $this->identifier($parent->id, 0));
         }
     }
     if ($isTool) {
         if ($revision) {
             $this->database->setQuery("SELECT n.uidNumber AS id,\n\t\t\t\t\t\tCASE WHEN t.name!='' AND t.name IS NOT NULL THEN t.name\n\t\t\t\t\t\tELSE n.name\n\t\t\t\t\t\tEND AS `name`\n\t\t\t\t\tFROM `#__tool_authors` AS t, `#__xprofiles` AS n, `#__tool_version` AS v\n\t\t\t\t\tWHERE n.uidNumber=t.uid AND t.toolname=" . $this->database->quote($record->alias) . " AND v.id=t.version_id and v.state<>3\n\t\t\t\t\tAND t.revision=" . $this->database->quote($revision) . "\n\t\t\t\t\tORDER BY t.ordering");
             $record->creator = $this->database->loadColumn();
             /*$record->relation[] = array(
             			'type'  => 'isVersionOf',
             			'value' => $this->identifier($id, '', 0)
             		);*/
         }
         $this->database->setQuery("SELECT v.id, v.revision, d.*\n\t\t\t\tFROM `#__tool_version` as v\n\t\t\t\tLEFT JOIN `#__doi_mapping` as d\n\t\t\t\tON d.alias = v.toolname\n\t\t\t\tAND d.local_revision=v.revision\n\t\t\t\tWHERE v.toolname = " . $this->database->quote($record->alias) . "\n\t\t\t\tORDER BY v.state DESC, v.revision DESC");
         $versions = $this->database->loadObjectList();
         foreach ($versions as $i => $v) {
             if (!$v->revision || $v->revision == $revision) {
                 continue;
             }
             $record->relation[] = array('type' => 'hasVersion', 'value' => $this->identifier($id, $v->doi, $v->revision));
         }
     }
     if (!isset($record->creator)) {
         $this->database->setQuery("SELECT \n\t\t\t\t\tCASE WHEN a.name!='' AND a.name IS NOT NULL THEN a.name\n\t\t\t\t\tELSE n.name\n\t\t\t\t\tEND AS `name`\n\t\t\t\tFROM `#__author_assoc` AS a\n\t\t\t\tLEFT JOIN `#__xprofiles` AS n ON n.uidNumber=a.authorid\n\t\t\t\tWHERE a.subtable='resources' AND a.subid=" . $this->database->quote($id) . " AND a.role!='submitter'\n\t\t\t\tORDER BY a.ordering, a.name");
         $record->creator = $this->database->loadColumn();
     }
     $this->database->setQuery("SELECT *\n\t\t\tFROM `#__citations` AS a\n\t\t\tINNER JOIN `#__citations_assoc` AS n ON n.`cid`=a.`id`\n\t\t\tWHERE n.`tbl`='resource' AND n.`oid`=" . $this->database->quote($id) . " AND a.`published`=1\n\t\t\tORDER BY `year` DESC");
     $references = $this->database->loadObjectList();
     if (count($references) && file_exists(PATH_CORE . DS . 'components' . DS . 'com_citations' . DS . 'helpers' . DS . 'format.php')) {
         include_once PATH_CORE . DS . 'components' . DS . 'com_citations' . DS . 'helpers' . DS . 'format.php';
         $formatter = new \Components\Citations\Helpers\Format();
         $formatter->setTemplate('apa');
         foreach ($references as $reference) {
             //<dcterms:isReferencedBy>uytruytry</dcterms:isReferencedBy>
             //<dcterms:isVersionOf>jgkhfjf</dcterms:isVersionOf>
             $cite = strip_tags(html_entity_decode($reference->formatted ? $reference->formatted : \Components\Citations\Helpers\Format::formatReference($reference, '')));
             $cite = str_replace('&quot;', '"', $cite);
             $record->relation[] = array('type' => 'references', 'value' => trim($cite));
         }
     }
     return $record;
 }
Exemplo n.º 5
0
defined('_HZEXEC_') or die;
$numaff = 0;
$numnon = 0;
// Did we get any results back?
if ($this->citations) {
    // Get a needed library
    include_once PATH_CORE . DS . 'components' . DS . 'com_citations' . DS . 'helpers' . DS . 'format.php';
    // Set some vars
    $affiliated = '';
    $nonaffiliated = '';
    $formatter = new \Components\Citations\Helpers\Format();
    //$formatter->setFormat($this->format);
    // Loop through the citations and build the HTML
    foreach ($this->citations as $cite) {
        $item = "\t" . '<li>' . "\n";
        $item .= \Components\Citations\Helpers\Format::formatReference($cite, '');
        $item .= "\t\t" . '<p class="details">' . "\n";
        $item .= "\t\t\t" . '<a href="' . Route::url('index.php?option=com_citations&task=download&id=' . $cite->id . '&citationFormat=bibtex&no_html=1') . '" title="' . Lang::txt('PLG_RESOURCES_CITATIONS_DOWNLOAD_BIBTEX') . '">BibTex</a> <span>|</span> ' . "\n";
        $item .= "\t\t\t" . '<a href="' . Route::url('index.php?option=com_citations&task=download&id=' . $cite->id . '&citationFormat=endnote&no_html=1') . '" title="' . Lang::txt('PLG_RESOURCES_CITATIONS_DOWNLOAD_ENDNOTE') . '">EndNote</a>' . "\n";
        if ($cite->eprint) {
            if ($cite->eprint) {
                $item .= "\t\t\t" . ' <span>|</span> <a href="' . stripslashes($cite->eprint) . '">' . Lang::txt('PLG_RESOURCES_CITATIONS_ELECTRONIC_PAPER') . '</a>' . "\n";
            }
        }
        $item .= "\t\t" . '</p>' . "\n";
        $item .= "\t" . '</li>' . "\n";
        // Decide which group to add it to
        if ($cite->affiliated) {
            $affiliated .= $item;
            $numaff++;
        } else {
Exemplo n.º 6
0
 /**
  * Generate a citation for a resource
  *
  * @param      string  $option    Component name
  * @param      object  $cite      Citation data
  * @param      string  $id        Resource ID
  * @param      string  $citations Citations to prepend
  * @param      integer $type      Resource type
  * @param      string  $rev       Tool revision
  * @return     string HTML
  */
 public static function citation($option, $cite, $id, $citations, $type, $rev = '')
 {
     include_once PATH_CORE . DS . 'components' . DS . 'com_citations' . DS . 'helpers' . DS . 'format.php';
     $html = '<p>' . Lang::txt('COM_RESOURCES_CITATION_INSTRUCTIONS') . '</p>' . "\n";
     if (trim($citations)) {
         $html .= '<ul class="citations results">' . "\n";
         $html .= "\t" . '<li>' . "\n";
         $html .= $citations;
         $html .= "\t" . '</li>' . "\n";
         $html .= '</ul>' . "\n";
     }
     if ($cite) {
         $html .= '<ul class="citations results">' . "\n";
         $html .= "\t" . '<li>' . "\n";
         $html .= \Components\Citations\Helpers\Format::formatReference($cite);
         if (is_numeric($rev) || is_string($rev) && $rev != 'dev') {
             $html .= "\t\t" . '<p class="details">' . "\n";
             $html .= "\t\t\t" . '<a href="index.php?option=' . $option . '&task=citation&id=' . $id . '&format=bibtex&no_html=1&rev=' . $rev . '" title="' . Lang::txt('COM_RESOURCES_DOWNLOAD_BIBTEX_FORMAT') . '">BibTex</a> <span>|</span> ' . "\n";
             $html .= "\t\t\t" . '<a href="index.php?option=' . $option . '&task=citation&id=' . $id . '&format=endnote&no_html=1&rev=' . $rev . '" title="' . Lang::txt('COM_RESOURCES_DOWNLOAD_ENDNOTE_FORMAT') . '">EndNote</a>' . "\n";
             $html .= "\t\t" . '</p>' . "\n";
         }
         $html .= "\t" . '</li>' . "\n";
         $html .= '</ul>' . "\n";
     }
     /*if ($type == 7)
     		{
     			$html .= '<p>'.Lang::txt('In addition, we would appreciate it if you would add the following acknowledgment to your publication:').'</p>' . "\n";
     			$html .= '<ul class="citations results">' . "\n";
     			$html .= "\t".'<li>' . "\n";
     			$html .= "\t\t".'<p>'.Lang::txt('Simulation services for results presented here were provided by the Network for Computational Nanotechnology (NCN) at nanoHUB.org').'</p>' . "\n";
     			$html .= "\t".'</li>' . "\n";
     			$html .= '</ul>' . "\n";
     		}*/
     return $html;
 }
Exemplo n.º 7
0
 /**
  * Process a single record
  *
  * @param   integer  $id
  * @return  object
  */
 public function record($id)
 {
     if (strstr($id, ':')) {
         list($id, $revision) = explode(':', $id);
     }
     $id = intval($id);
     if (!isset($revision)) {
         $revision = 0;
     }
     $this->database->setQuery("SELECT pv.*, pv.doi AS identifier, rt.alias AS type\n\t\t\tFROM `#__publication_versions` AS pv\n\t\t\tINNER JOIN `#__publications` AS p ON p.id = pv.publication_id\n\t\t\tINNER JOIN `#__publication_categories` AS rt ON rt.id = p.category\n\t\t\tWHERE p.id = " . $this->database->quote($id) . ($revision ? " AND pv.version_number=" . $this->database->quote($revision) : ""));
     $record = $this->database->loadObject();
     $record->version_id = $record->id;
     $record->id = $id;
     $record->base = $this->name();
     $record->type = $record->base . ':' . $record->type;
     $record->title .= ' [version ' . $record->version_label . ']';
     $record->description = strip_tags($record->description);
     $record->description = trim($record->description);
     $record->identifier = $this->identifier($id, $record->identifier, $revision);
     $this->database->setQuery("SELECT pv.created, pv.submitted, pv.published_up, pv.accepted\n\t\t\tFROM `#__publication_versions` AS pv\n\t\t\tWHERE pv.id = " . $this->database->quote($record->version_id) . "\n\t\t\tORDER BY pv.submitted DESC LIMIT 1");
     $dates = $this->database->loadObject();
     $record->date = $dates->created;
     if ($dates->submitted && $dates->submitted != '0000-00-00 00:00:00') {
         $record->date = $dates->submitted;
     }
     if ($dates->accepted && $dates->accepted != '0000-00-00 00:00:00') {
         $record->date = $dates->accepted;
     }
     if ($dates->published_up && $dates->published_up != '0000-00-00 00:00:00' && $dates->published_up > $record->date) {
         $record->date = $dates->published_up;
     }
     $this->database->setQuery("SELECT pa.name\n\t\t\tFROM `#__publication_authors` AS pa\n\t\t\tWHERE pa.role != 'submitter' AND pa.publication_version_id=" . $this->database->quote($record->version_id) . "\n\t\t\tORDER BY pa.name");
     $record->creator = $this->database->loadColumn();
     $this->database->setQuery("SELECT DISTINCT t.raw_tag\n\t\t\tFROM `#__tags` t, `#__tags_object` tos\n\t\t\tWHERE t.id = tos.tagid AND tos.objectid=" . $this->database->quote($id) . " AND tos.tbl='publications' AND t.admin=0\n\t\t\tORDER BY t.raw_tag");
     $record->subject = $this->database->loadColumn();
     // Relations
     $record->relation = array();
     $this->database->setQuery("SELECT v.id, v.publication_id, v.version_number, v.doi\n\t\t\tFROM `#__publication_versions` as v\n\t\t\tWHERE v.state=1 AND v.publication_id = " . $this->database->quote($record->id) . "\n\t\t\tORDER BY v.version_number DESC");
     $versions = $this->database->loadObjectList();
     foreach ($versions as $i => $v) {
         if (!$v->version_number || $v->version_number == $revision) {
             continue;
         }
         $record->relation[] = array('type' => 'hasVersion', 'value' => $this->identifier($id, $v->doi, $v->version_number));
     }
     $this->database->setQuery("SELECT *\n\t\t\tFROM `#__citations` AS a\n\t\t\tLEFT JOIN `#__citations_assoc` AS n ON n.`cid`=a.`id`\n\t\t\tWHERE n.`tbl`='publication' AND n.`oid`=" . $this->database->quote($id) . " AND n.`type`='owner' AND a.`published`=1\n\t\t\tORDER BY `year` DESC");
     $references = $this->database->loadObjectList();
     if (count($references) && file_exists(PATH_CORE . DS . 'components' . DS . 'com_citations' . DS . 'helpers' . DS . 'format.php')) {
         include_once PATH_CORE . DS . 'components' . DS . 'com_citations' . DS . 'helpers' . DS . 'format.php';
         $formatter = new \Components\Citations\Helpers\Format();
         $formatter->setTemplate('apa');
         foreach ($references as $reference) {
             $cite = strip_tags(html_entity_decode($reference->formatted ? $reference->formatted : \Components\Citations\Helpers\Format::formatReference($reference, '')));
             $cite = str_replace('&quot;', '"', $cite);
             $record->relation[] = array('type' => 'isReferencedBy', 'value' => trim($cite));
         }
     }
     $this->database->setQuery("SELECT *\n\t\t\tFROM `#__citations` AS a\n\t\t\tLEFT JOIN `#__citations_assoc` AS n ON n.`cid`=a.`id`\n\t\t\tWHERE n.`tbl`='publication' AND n.`oid`=" . $this->database->quote($id) . " AND n.`type`!='owner' AND a.`published`=1\n\t\t\tORDER BY `year` DESC");
     $references = $this->database->loadObjectList();
     if (count($references) && file_exists(PATH_CORE . DS . 'components' . DS . 'com_citations' . DS . 'helpers' . DS . 'format.php')) {
         include_once PATH_CORE . DS . 'components' . DS . 'com_citations' . DS . 'helpers' . DS . 'format.php';
         $formatter = new \Components\Citations\Helpers\Format();
         $formatter->setTemplate('apa');
         foreach ($references as $reference) {
             $cite = strip_tags(html_entity_decode($reference->formatted ? $reference->formatted : \Components\Citations\Helpers\Format::formatReference($reference, '')));
             $cite = str_replace('&quot;', '"', $cite);
             $record->relation[] = array('type' => 'references', 'value' => trim($cite));
         }
     }
     return $record;
 }
Exemplo n.º 8
0
 /**
  * Process a single record
  *
  * @param   integer  $id
  * @return  object
  */
 public function record($id)
 {
     if (strstr($id, ':')) {
         list($id, $revision) = explode(':', $id);
     }
     $id = intval($id);
     if (!isset($revision)) {
         $revision = 0;
     }
     $this->database->setQuery("SELECT pv.*, pv.doi AS identifier, rt.alias AS type, pv.publication_id\n\t\t\tFROM `#__publication_versions` AS pv\n\t\t\tINNER JOIN `#__publications` AS p ON p.id = pv.publication_id\n\t\t\tINNER JOIN `#__publication_categories` AS rt ON rt.id = p.category\n\t\t\tWHERE pv.id = " . $this->database->quote($id));
     $record = $this->database->loadObject();
     $record->version_id = $record->id;
     $id = $record->publication_id;
     $record->id = $id;
     if (!$record->identifier) {
         $record->identifier = self::$base . '/' . ltrim(\Route::url('index.php?option=com_publications&id=' . $id . ($record->version_id ? '&v=' . $record->version_id : '')), '/');
     }
     $record->base = $this->name();
     $record->type = $record->base . ':' . $record->type;
     $record->description = strip_tags($record->description);
     $record->description = trim($record->description);
     $this->database->setQuery("SELECT pv.submitted\n\t\t\tFROM `#__publication_versions` pv, `#__publications` p\n\t\t\tWHERE p.id = pv.publication_id AND p.id = " . $this->database->quote($id) . "\n\t\t\tORDER BY pv.submitted DESC LIMIT 1");
     $record->date = $this->database->loadResult();
     $this->database->setQuery("SELECT pa.name\n\t\t\tFROM `#__publication_authors` pa, `#__publication_versions` pv, `#__publications` p\n\t\t\tWHERE pa.publication_version_id = pv.id AND pa.role != 'submitter' AND pv.publication_id = p.id AND p.id=" . $this->database->quote($id) . "\n\t\t\tORDER BY pa.name");
     $record->creator = $this->database->loadColumn();
     $this->database->setQuery("SELECT DISTINCT t.raw_tag\n\t\t\tFROM `#__tags` t, `#__tags_object` tos\n\t\t\tWHERE t.id = tos.tagid AND tos.objectid=" . $this->database->quote($id) . " AND tos.tbl='publications' AND t.admin=0\n\t\t\tORDER BY t.raw_tag");
     $record->subject = $this->database->loadColumn();
     // Relations
     $record->relation = array();
     $this->database->setQuery("SELECT *\n\t\t\tFROM `#__citations` AS a\n\t\t\tLEFT JOIN `#__citations_assoc` AS n ON n.`cid`=a.`id`\n\t\t\tWHERE n.`tbl`='publication' AND n.`oid`=" . $this->database->quote($id) . " AND n.`type`='owner' AND a.`published`=1\n\t\t\tORDER BY `year` DESC");
     $references = $this->database->loadObjectList();
     if (count($references) && file_exists(PATH_CORE . DS . 'components' . DS . 'com_citations' . DS . 'helpers' . DS . 'format.php')) {
         include_once PATH_CORE . DS . 'components' . DS . 'com_citations' . DS . 'helpers' . DS . 'format.php';
         $formatter = new \Components\Citations\Helpers\Format();
         $formatter->setTemplate('apa');
         foreach ($references as $reference) {
             $cite = strip_tags(html_entity_decode($reference->formatted ? $reference->formatted : \Components\Citations\Helpers\Format::formatReference($reference, '')));
             $cite = str_replace('&quot;', '"', $cite);
             $record->relation[] = array('type' => 'isReferencedBy', 'value' => trim($cite));
         }
     }
     $this->database->setQuery("SELECT *\n\t\t\tFROM `#__citations` AS a\n\t\t\tLEFT JOIN `#__citations_assoc` AS n ON n.`cid`=a.`id`\n\t\t\tWHERE n.`tbl`='publication' AND n.`oid`=" . $this->database->quote($id) . " AND n.`type`!='owner' AND a.`published`=1\n\t\t\tORDER BY `year` DESC");
     $references = $this->database->loadObjectList();
     if (count($references) && file_exists(PATH_CORE . DS . 'components' . DS . 'com_citations' . DS . 'helpers' . DS . 'format.php')) {
         include_once PATH_CORE . DS . 'components' . DS . 'com_citations' . DS . 'helpers' . DS . 'format.php';
         $formatter = new \Components\Citations\Helpers\Format();
         $formatter->setTemplate('apa');
         foreach ($references as $reference) {
             $cite = strip_tags(html_entity_decode($reference->formatted ? $reference->formatted : \Components\Citations\Helpers\Format::formatReference($reference, '')));
             $cite = str_replace('&quot;', '"', $cite);
             $record->relation[] = array('type' => 'references', 'value' => trim($cite));
         }
     }
     return $record;
 }