<commit_before><?php
/**
 * @copyright	Copyright 2005-2009 by Purdue Research Foundation, West Lafayette, IN 47906.
 * @license	GNU General Public License, version 2 (GPLv2)
 *
 * Copyright 2005-2009 by Purdue Research Foundation, West Lafayette, IN 47906.
 * All rights reserved.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License,
 * version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */

// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die( 'Restricted access' );

$this->css()
	 ->css('jquery.fancybox.css', 'system')
     ->js();
$authorized = ($this->restricted && !$this->authorized) ? false : true;

$html = '';

// New launcher layout?
if ($this->config->get('launcher_layout', 0))
{
	$this->view('launcher')
	     ->set('option', $this->option)
	     ->set('publication', $this->publication)
	     ->set('config', $this->config)
	     ->set('contributable', $this->contributable)
	     ->set('authorized', $this->authorized)
	     ->set('restricted', $this->restricted)
	     ->set('database', $this->database)
	     ->set('lastPubRelease', $this->lastPubRelease)
	     ->set('version', $this->version)
	     ->set('license', $this->license)
	     ->set('sections', $this->sections)
	     ->set('cats', $this->cats)
	     ->set('params', $params)
	     ->display();
}
else
{
	$html  = '<section class="main upperpane">'."\n";
	$html .= '<div class="aside rankarea">'."\n";

	// Show stats
	$statshtml = '';
	$this->helper->getCitations();
	$this->helper->getLastCitationDate();
	$stats = new AndmoreStats($this->database, $this->publication->id,
		$this->publication->master_rating, count($this->helper->citations),
		$this->helper->lastCitationDate);
	$statshtml = $stats->display();

	$xtra = '';

	// Show audience
	if ($this->params->get('show_audience'))
	{
		$ra 		= new PublicationAudience( $this->database );
		$audience 	= $ra->getAudience(
			$this->publication->id,
			$this->publication->version_id,
			$getlabels = 1,
			$numlevels = 4
		);
		$ral 		= new PublicationAudienceLevel ( $this->database );
		$levels 	= $ral->getLevels( 4, array(), 0 );
		$skillpop 	=  PublicationsHtml::skillLevelPopup($levels, $this->params->get('audiencelink'));
		$xtra 	   .= PublicationsHtml::showSkillLevel($audience, $numlevels = 4, $skillpop);
	}

	// Supported publication?
	$supported = null;
	$rt = new PublicationTags( $this->database );
	$supported = $rt->checkTagUsage( $this->config->get('supportedtag'), $this->publication->id );

	if ($supported)
	{
		include_once(JPATH_ROOT.DS.'components'.DS.'com_tags'.DS.'helpers'.DS.'handler.php');
		$tag = new TagsTableTag( $this->database );
		$tag->loadTag($this->config->get('supportedtag'));

		$sl = $this->config->get('supportedlink');
		if ($sl) {
			$link = $sl;
		} else {
			$link = JRoute::_('index.php?option=com_tags&tag='.$tag->tag);
		}

		$xtra = '<p class="supported"><a href="'.$link.'">'.$tag->raw_tag.'</a></p>';
	}

	$html .= PublicationsHtml::metadata($this->option, $this->params, $this->publication,
		$statshtml, $this->sections, $this->version, $xtra, $this->lastPubRelease);
	$html .= '</div><!-- / .aside -->'."\n";
	$html .= '<div class="subject">'."\n";
	$html .= ' <div class="overviewcontainer">'."\n";
	$html .= PublicationsHtml::title( $this->option, $this->publication );

	// Display authors
	if ($this->params->get('show_authors')) {
		if ($this->authors) {
			$html .= '<div id="authorslist">'."\n";
			$html .= $this->helper->showContributors( $this->authors, true, false, false, $this->params->get('format_authors', 0) )."\n";
			$html .= '</div>'."\n";
		}
	}

	// Display mini abstract
	$html .= '<p class="ataglance">';
	$html .= $this->publication->abstract ? \Hubzero\Utility\String::truncate(stripslashes($this->publication->abstract), 250) : '';
	$html .= '</p>'."\n";

	// Show published date and category
	$html .= PublicationsHtml::showSubInfo( $this->publication, $this->option );

	$html .= ' </div><!-- / .overviewcontainer -->'."\n";
	$html .= ' <div class="aside launcharea">'."\n";
	$feeds = '';

	// Sort out primary files and draw a launch button
	if ($this->config->get('curation', 0) && $this->tab != 'play' && $this->params->get('curated') != 2)
	{
		// Get primary elements
		$elements = $this->publication->_curationModel->getElements(1);

		// Get attachment type model
		$attModel = new PublicationsModelAttachments($this->database);

		if ($elements)
		{
			$element = $elements[0];

			// Draw button
			$launcher = $attModel->drawLauncher(
				$element->manifest->params->type,
				$this->publication,
				$element,
				$elements,
				$authorized
			);

			$html .= $launcher;
		}<commit_msg>[COM_PUBLICATIONS] view cleanup<commit_after><?php
/**
 * @copyright	Copyright 2005-2009 by Purdue Research Foundation, West Lafayette, IN 47906.
 * @license	GNU General Public License, version 2 (GPLv2)
 *
 * Copyright 2005-2009 by Purdue Research Foundation, West Lafayette, IN 47906.
 * All rights reserved.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License,
 * version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */

// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die( 'Restricted access' );

$this->css()
	 ->css('jquery.fancybox.css', 'system')
     ->js();
$authorized = ($this->restricted && !$this->authorized) ? false : true;
$html = '';

// New launcher layout?
if ($this->config->get('launcher_layout', 0))
{
	$this->view('launcher')
	     ->set('option', $this->option)
	     ->set('publication', $this->publication)
	     ->set('config', $this->config)
	     ->set('contributable', $this->contributable)
	     ->set('authorized', $this->authorized)
	     ->set('restricted', $this->restricted)
	     ->set('database', $this->database)
	     ->set('lastPubRelease', $this->lastPubRelease)
	     ->set('version', $this->version)
	     ->set('license', $this->license)
	     ->set('sections', $this->sections)
	     ->set('cats', $this->cats)
	     ->set('params', $params)
	     ->display();
}
else
{ ?>
	<section class="main upperpane">
		<div class="aside rankarea">

	<?php
	// Show stats
	$statshtml = '';
	$this->helper->getCitations();
	$this->helper->getLastCitationDate();
	$stats = new AndmoreStats($this->database, $this->publication->id,
		$this->publication->master_rating, count($this->helper->citations),
		$this->helper->lastCitationDate);
	$statshtml = $stats->display();

	$xtra = '';

	// Show audience
	if ($this->params->get('show_audience'))
	{
		$ra 		= new PublicationAudience( $this->database );
		$audience 	= $ra->getAudience(
			$this->publication->id,
			$this->publication->version_id,
			$getlabels = 1,
			$numlevels = 4
		);
		$ral 		= new PublicationAudienceLevel ( $this->database );
		$levels 	= $ral->getLevels( 4, array(), 0 );
		$skillpop 	=  PublicationsHtml::skillLevelPopup($levels, $this->params->get('audiencelink'));
		$xtra 	   .= PublicationsHtml::showSkillLevel($audience, $numlevels = 4, $skillpop);
	}

	// Supported publication?
	$supported = null;
	$rt = new PublicationTags( $this->database );
	$supported = $rt->checkTagUsage( $this->config->get('supportedtag'), $this->publication->id );

	if ($supported)
	{
		include_once(JPATH_ROOT.DS.'components'.DS.'com_tags'.DS.'helpers'.DS.'handler.php');
		$tag = new TagsTableTag( $this->database );
		$tag->loadTag($this->config->get('supportedtag'));

		$sl = $this->config->get('supportedlink');
		if ($sl) {
			$link = $sl;
		} else {
			$link = JRoute::_('index.php?option=com_tags&tag='.$tag->tag);
		}

		$xtra = '<p class="supported"><a href="'.$link.'">'.$tag->raw_tag.'</a></p>';
	}

	echo PublicationsHtml::metadata($this->option, $this->params, $this->publication,
		$statshtml, $this->sections, $this->version, $xtra, $this->lastPubRelease); ?>

	</div><!-- / .aside -->
	<div class="subject">
		<div class="overviewcontainer">
			<?php echo PublicationsHtml::title( $this->option, $this->publication ); ?>
<?php
	// Display authors
	if ($this->params->get('show_authors') && $this->authors) { ?>
		<div id="authorslist">
			<?php echo $this->helper->showContributors($this->authors, true, false, false, false, $this->params->get('format_authors', 0)); ?>
		</div>
	<?php }	?>
	<p class="ataglance"><?php echo $this->publication->abstract ? \Hubzero\Utility\String::truncate(stripslashes($this->publication->abstract), 250) : ''; ?></p>

<?php
	// Show published date and category
	echo PublicationsHtml::showSubInfo( $this->publication, $this->option ); ?>
		</div><!-- / .overviewcontainer -->
		<div class="aside launcharea">
<?php
	// Sort out primary files and draw a launch button
	if ($this->config->get('curation', 0) && $this->tab != 'play' && $this->params->get('curated') != 2)
	{
		// Get primary elements
		$elements = $this->publication->_curationModel->getElements(1);

		// Get attachment type model
		$attModel = new PublicationsModelAttachments($this->database);

		if ($elements)
		{
			$element = $elements[0];

			// Draw button
			$launcher = $attModel->drawLauncher(
				$element->manifest->params->type,
				$this->publication,
				$element,
				$elements,
				$authorized
			);

			$html .= $launcher;
		}
{'fraction_non_alphanumeric': 0.19217986314760507, 'fraction_numerical': 0.010557184750733138, 'mean_word_length': 4.029990167158309, 'pattern_counts': {'":': 0, '<': 47, '<?xml version=': 0, '>': 265, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7483609', 'n_tokens_mistral': 3643, 'n_tokens_neox': 3259, 'n_words': 788}