<commit_before><?php
/**
 * HUBzero CMS
 *
 * Copyright 2005-2011 Purdue University. All rights reserved.
 *
 * This file is part of: The HUBzero(R) Platform for Scientific Collaboration
 *
 * The HUBzero(R) Platform for Scientific Collaboration (HUBzero) is free
 * software: you can redistribute it and/or modify it under the terms of
 * the GNU Lesser General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any
 * later version.
 *
 * HUBzero 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 Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * HUBzero is a registered trademark of Purdue University.
 *
 * @package   hubzero-cms
 * @author    <NAME> <<EMAIL>>, <NAME> <<EMAIL>>
 * @copyright Copyright 2005-2011 Purdue University. All rights reserved.
 * @license   http://www.gnu.org/licenses/lgpl-3.0.html LGPLv3
 */
// Check to ensure this file is included in Joomla!
//defined('_JEXEC') or die('Restricted access');
require_once('/var/www/example/components/com_citations' . DS . 'helpers' . DS . 'format.php');
require_once('/var/www/example/administrator/components/com_citations' . DS . 'tables' . DS . 'citation.php');
require_once('/var/www/example/administrator/components/com_citations' . DS . 'tables' . DS . 'association.php');
require_once('/var/www/example/administrator/components/com_citations' . DS . 'tables' . DS . 'author.php');
require_once('/var/www/example/administrator/components/com_citations' . DS . 'tables' . DS . 'secondary.php');
require_once('/var/www/example/administrator/components/com_citations' . DS . 'tables' . DS . 'sponsor.php');
require_once('/var/www/example/administrator/components/com_citations' . DS . 'tables' . DS . 'tags.php');
require_once('/var/www/example/administrator/components/com_citations' . DS . 'tables' . DS . 'format.php');
require_once('/var/www/example/administrator/components/com_citations' . DS . 'tables' . DS . 'type.php');
/**
 * Groups Plugin class for blog entries
 */
class plgGroupsCitations extends \Hubzero\Plugin\Plugin
{
	/**
	 * Affects constructor behavior. If true, language files will be loaded automatically.
	 *
	 * @var    boolean
	 */
	protected $_autoloadLanguage = true;


	public function __construct(&$subject, $config)
	{
		parent::__construct($subject, $config);


		// Do some extra initialization in this constructor if required
	}

	public function &onGroupAreas()
	{
		$area = array(
			'name'             => $this->_name,
			'title'            => JText::_('PLG_GROUPS_CITATIONS'),
			'default_access'   => $this->params->get('plugin_access', 'members'),
			'display_menu_tab' => $this->params->get('display_tab', 1),
			'icon'             => 'f095'
		);
		return $area;
	}

	/**
	 * Return content that is to be displayed before group main area
	 *
	 * @return     string
	 */
	public function onBeforeGroup( $group, $authorized )
	{

		//create view object
		$view = new \Hubzero\Plugin\View(
			array(
				'folder'  => $this->_type,
				'element' => $this->_name,
				'name'    => 'browse',
				'layout'  => 'sticky'
			)
		);

		//vars for view
		$view->authorized = $authorized;
		$view->option     = 'plg_groups_citations';
		$view->group      = $group;
		$view->name       = $this->_name;
		$view->juser      = JFactory::getUser();
		$view->database   = JFactory::getDBO();

		// get plugin access
		//$access = \Hubzero\User\Group\Helper::getPluginAccess($group, 'citations');

		//if set to nobody make sure cant access
		//check if guest and force login if plugin access is registered or members
		//check to see if user is member and plugin access requires members
		if ($access == 'nobody'
			|| ($view->juser->get('guest') && $access == 'registered')
			|| (!in_array($view->juser->get('id'), $group->get('members')) && $access == 'members'))
		{
			return '';
		}

		//build array of filters
		$view->filters              = array();
		$view->filters['scope']     = 'group';
		$view->filters['scope_id']  = $view->group->get('gidNumber');
		$view->filters['state']     = 1;
		$view->filters['sticky']    = 1;
		$view->filters['published'] = 1;

		//create new announcement Object
		$hubzeroAnnouncement = new \Hubzero\Item\Announcement($view->database);
		$view->total = $hubzeroAnnouncement->count($view->filters);
		$view->rows  = $hubzeroAnnouncement->find($view->filters);<commit_msg>[HUBZERO][#6904] Uncommented a variable which should not have been commented out. Should correct the error when enabling the plugin.<commit_after><?php
/**
 * HUBzero CMS
 *
 * Copyright 2005-2011 Purdue University. All rights reserved.
 *
 * This file is part of: The HUBzero(R) Platform for Scientific Collaboration
 *
 * The HUBzero(R) Platform for Scientific Collaboration (HUBzero) is free
 * software: you can redistribute it and/or modify it under the terms of
 * the GNU Lesser General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any
 * later version.
 *
 * HUBzero 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 Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * HUBzero is a registered trademark of Purdue University.
 *
 * @package   hubzero-cms
 * @author    <NAME> <<EMAIL>>, <NAME> <<EMAIL>>
 * @copyright Copyright 2005-2011 Purdue University. All rights reserved.
 * @license   http://www.gnu.org/licenses/lgpl-3.0.html LGPLv3
 */
// Check to ensure this file is included in Joomla!
//defined('_JEXEC') or die('Restricted access');
require_once('/var/www/example/components/com_citations' . DS . 'helpers' . DS . 'format.php');
require_once('/var/www/example/administrator/components/com_citations' . DS . 'tables' . DS . 'citation.php');
require_once('/var/www/example/administrator/components/com_citations' . DS . 'tables' . DS . 'association.php');
require_once('/var/www/example/administrator/components/com_citations' . DS . 'tables' . DS . 'author.php');
require_once('/var/www/example/administrator/components/com_citations' . DS . 'tables' . DS . 'secondary.php');
require_once('/var/www/example/administrator/components/com_citations' . DS . 'tables' . DS . 'sponsor.php');
require_once('/var/www/example/administrator/components/com_citations' . DS . 'tables' . DS . 'tags.php');
require_once('/var/www/example/administrator/components/com_citations' . DS . 'tables' . DS . 'format.php');
require_once('/var/www/example/administrator/components/com_citations' . DS . 'tables' . DS . 'type.php');
/**
 * Groups Plugin class for blog entries
 */
class plgGroupsCitations extends \Hubzero\Plugin\Plugin
{
	/**
	 * Affects constructor behavior. If true, language files will be loaded automatically.
	 *
	 * @var    boolean
	 */
	protected $_autoloadLanguage = true;


	public function __construct(&$subject, $config)
	{
		parent::__construct($subject, $config);


		// Do some extra initialization in this constructor if required
	}

	public function &onGroupAreas()
	{
		$area = array(
			'name'             => $this->_name,
			'title'            => JText::_('PLG_GROUPS_CITATIONS'),
			'default_access'   => $this->params->get('plugin_access', 'members'),
			'display_menu_tab' => $this->params->get('display_tab', 1),
			'icon'             => 'f095'
		);
		return $area;
	}

	/**
	 * Return content that is to be displayed before group main area
	 *
	 * @return     string
	 */
	public function onBeforeGroup( $group, $authorized )
	{

		//create view object
		$view = new \Hubzero\Plugin\View(
			array(
				'folder'  => $this->_type,
				'element' => $this->_name,
				'name'    => 'browse',
				'layout'  => 'sticky'
			)
		);

		//vars for view
		$view->authorized = $authorized;
		$view->option     = 'plg_groups_citations';
		$view->group      = $group;
		$view->name       = $this->_name;
		$view->juser      = JFactory::getUser();
		$view->database   = JFactory::getDBO();

		// get plugin access
		$access = \Hubzero\User\Group\Helper::getPluginAccess($group, 'citations');

		//if set to nobody make sure cant access
		//check if guest and force login if plugin access is registered or members
		//check to see if user is member and plugin access requires members
		if ($access == 'nobody'
			|| ($view->juser->get('guest') && $access == 'registered')
			|| (!in_array($view->juser->get('id'), $group->get('members')) && $access == 'members'))
		{
			return '';
		}

		//build array of filters
		$view->filters              = array();
		$view->filters['scope']     = 'group';
		$view->filters['scope_id']  = $view->group->get('gidNumber');
		$view->filters['state']     = 1;
		$view->filters['sticky']    = 1;
		$view->filters['published'] = 1;

		//create new announcement Object
		$hubzeroAnnouncement = new \Hubzero\Item\Announcement($view->database);
		$view->total = $hubzeroAnnouncement->count($view->filters);
		$view->rows  = $hubzeroAnnouncement->find($view->filters);
{'fraction_non_alphanumeric': 0.1489046459942851, 'fraction_numerical': 0.006138215684199386, 'mean_word_length': 3.5940690325717064, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 103, 'https://': 0, 'lorem ipsum': 0, 'www.': 22, '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': '1870648', 'n_tokens_mistral': 3113, 'n_tokens_neox': 2848, 'n_words': 809}