403Webshell
Server IP : 46.105.57.169  /  Your IP : 216.73.217.35
Web Server : Apache
System : Linux webm002.cluster120.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User : verseaumee ( 152031)
PHP Version : 8.5.7
Disable Function : _dyuweyrj4,_dyuweyrj4r,dl
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /home/verseaumee/123click/assets/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/verseaumee/123click/assets/views.zip
PK!!o�$

!categories/tmpl/default_items.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_newsfeeds
 *
 * @copyright   Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

JHtml::_('bootstrap.tooltip');

?>
<?php $class = ' class="first"'; ?>
<?php if ($this->maxLevelcat != 0 && count($this->items[$this->parent->id]) > 0) : ?>
	<?php foreach ($this->items[$this->parent->id] as $id => $item) : ?>
		<?php if ($this->params->get('show_empty_categories_cat') || $item->numitems || count($item->getChildren())) : ?>
			<?php if (!isset($this->items[$this->parent->id][$id + 1])) : ?>
				<?php $class = ' class="last"'; ?>
			<?php endif; ?>
			<div<?php echo $class; ?>>
				<?php $class = ''; ?>
				<h3 class="page-header item-title">
					<a href="<?php echo JRoute::_(NewsfeedsHelperRoute::getCategoryRoute($item->id, $item->language)); ?>">
						<?php echo $this->escape($item->title); ?>
					</a>
					<?php if ($this->params->get('show_cat_items_cat') == 1) : ?>
						<span class="badge badge-info tip hasTooltip" title="<?php echo JHtml::_('tooltipText', 'COM_NEWSFEEDS_NUM_ITEMS'); ?>">
							<?php echo JText::_('COM_NEWSFEEDS_NUM_ITEMS'); ?>&nbsp;
							<?php echo $item->numitems; ?>
						</span>
					<?php endif; ?>
					<?php if (count($item->getChildren()) > 0 && $this->maxLevelcat > 1) : ?>
						<a id="category-btn-<?php echo $item->id; ?>" href="#category-<?php echo $item->id; ?>"
							data-toggle="collapse" data-toggle="button" class="btn btn-mini pull-right" aria-label="<?php echo JText::_('JGLOBAL_EXPAND_CATEGORIES'); ?>">
							<span class="icon-plus" aria-hidden="true"></span>
						</a>
					<?php endif; ?>
				</h3>
				<?php if ($this->params->get('show_subcat_desc_cat') == 1) : ?>
					<?php if ($item->description) : ?>
						<div class="category-desc">
							<?php echo JHtml::_('content.prepare', $item->description, '', 'com_newsfeeds.categories'); ?>
						</div>
					<?php endif; ?>
				<?php endif; ?>
				<?php if (count($item->getChildren()) > 0 && $this->maxLevelcat > 1) : ?>
					<div class="collapse fade" id="category-<?php echo $item->id; ?>">
						<?php $this->items[$item->id] = $item->getChildren(); ?>
						<?php $this->parent = $item; ?>
						<?php $this->maxLevelcat--; ?>
						<?php echo $this->loadTemplate('items'); ?>
						<?php $this->parent = $item->getParent(); ?>
						<?php $this->maxLevelcat++; ?>
					</div>
				<?php endif; ?>
			</div>
		<?php endif; ?>
	<?php endforeach; ?>
<?php endif; ?>
PK!e�categories/tmpl/default.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_newsfeeds
 *
 * @copyright   Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

JHtml::addIncludePath(JPATH_COMPONENT . '/helpers');
JHtml::_('behavior.caption');
JHtml::_('behavior.core');

// Add strings for translations in Javascript.
JText::script('JGLOBAL_EXPAND_CATEGORIES');
JText::script('JGLOBAL_COLLAPSE_CATEGORIES');

JFactory::getDocument()->addScriptDeclaration("
jQuery(function($) {
	$('.categories-list').find('[id^=category-btn-]').each(function(index, btn) {
		var btn = $(btn);
		btn.on('click', function() {
			btn.find('span').toggleClass('icon-plus');
			btn.find('span').toggleClass('icon-minus');
			if (btn.attr('aria-label') === Joomla.JText._('JGLOBAL_EXPAND_CATEGORIES'))
			{
				btn.attr('aria-label', Joomla.JText._('JGLOBAL_COLLAPSE_CATEGORIES'));
			} else {
				btn.attr('aria-label', Joomla.JText._('JGLOBAL_EXPAND_CATEGORIES'));
			}			
		});
	});
});");

?>
<div class="categories-list<?php echo $this->pageclass_sfx; ?>">
	<?php echo JLayoutHelper::render('joomla.content.categories_default', $this); ?>
	<?php echo $this->loadTemplate('items'); ?>
</div>
PK!����["["categories/tmpl/default.xmlnu�[���<?xml version="1.0" encoding="utf-8"?>
<metadata>
	<layout title="COM_NEWSFEEDS_CATEGORIES_VIEW_DEFAULT_TITLE" option="COM_NEWSFEEDS_CATEGORIES_VIEW_DEFAULT_OPTION">
		<help
			key = "JHELP_MENUS_MENU_ITEM_NEWSFEED_CATEGORIES"
		/>
		<message>
			<![CDATA[COM_NEWSFEEDS_CATEGORIES_VIEW_DEFAULT_DESC]]>
		</message>
	</layout>

	<!-- Add fields to the request variables for the layout. -->
	<fields name="request">
		<fieldset name="request"
		>
			<field 
				name="id" 
				type="category"
				label="JGLOBAL_FIELD_CATEGORIES_CHOOSE_CATEGORY_LABEL"
				description="JGLOBAL_FIELD_CATEGORIES_CHOOSE_CATEGORY_DESC"
				extension="com_newsfeeds"
				show_root="true"
				required="true"
			/>
		</fieldset>
	</fields>

	<!-- Add fields to the parameters object for the layout. -->
	<fields name="params">
		<fieldset name="basic" label="JGLOBAL_CATEGORIES_OPTIONS">
			<field 
				name="show_base_description" 
				type="list"
				label="JGLOBAL_FIELD_SHOW_BASE_DESCRIPTION_LABEL"
				description="JGLOBAL_FIELD_SHOW_BASE_DESCRIPTION_DESC"
				useglobal="true"
				class="chzn-color"
				>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>

			<field 
				name="categories_description" 
				type="textarea"
				label="JGLOBAL_FIELD_CATEGORIES_DESC_LABEL"
				description="JGLOBAL_FIELD_CATEGORIES_DESC_DESC"
				cols="25"
				rows="5"
			/>

			<field 
				name="maxLevelcat" 
				type="list"
				label="JGLOBAL_MAXIMUM_CATEGORY_LEVELS_LABEL"
				description="JGLOBAL_MAXIMUM_CATEGORY_LEVELS_DESC"
				useglobal="true"
				>
				<option value="-1">JALL</option>
				<option value="1">J1</option>
				<option value="2">J2</option>
				<option value="3">J3</option>
				<option value="4">J4</option>
				<option value="5">J5</option>
			</field>

			<field 
				name="show_empty_categories_cat" 
				type="list"
				label="JGLOBAL_SHOW_EMPTY_CATEGORIES_LABEL"
				description="COM_NEWSFEEDS_SHOW_EMPTY_CATEGORIES_DESC"
				useglobal="true"
				class="chzn-color"
				>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>

			<field 
				name="show_subcat_desc_cat" 
				type="list"
				label="JGLOBAL_SHOW_SUBCATEGORIES_DESCRIPTION_LABEL"
				description="JGLOBAL_SHOW_SUBCATEGORIES_DESCRIPTION_DESC"
				useglobal="true"
				class="chzn-color"
				>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>

			<field 
				name="show_cat_items_cat" 
				type="list"
				label="COM_NEWSFEEDS_FIELD_SHOW_CAT_ITEMS_LABEL"
				description="COM_NEWSFEEDS_FIELD_SHOW_CAT_ITEMS_DESC"
				useglobal="true"
				class="chzn-color"
				>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>
		</fieldset>

		<fieldset name="category" label="JGLOBAL_CATEGORY_OPTIONS">
			<field 
				name="spacer2" 
				type="spacer" 
				label="JGLOBAL_SUBSLIDER_DRILL_CATEGORIES_LABEL"
				class="text"
			/>

			<field 
				name="show_category_title" 
				type="list"
				label="JGLOBAL_SHOW_CATEGORY_TITLE"
				description="JGLOBAL_SHOW_CATEGORY_TITLE_DESC"
				useglobal="true"
				class="chzn-color"
				>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>

			<field 
				name="show_description" 
				type="list"
				label="JGLOBAL_SHOW_CATEGORY_DESCRIPTION_LABEL"
				description="JGLOBAL_SHOW_CATEGORY_DESCRIPTION_DESC"
				useglobal="true"
				class="chzn-color"
				>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>

			<field 
				name="show_description_image" 
				type="list"
				label="JGLOBAL_SHOW_CATEGORY_IMAGE_LABEL"
				description="JGLOBAL_SHOW_CATEGORY_IMAGE_DESC"
				useglobal="true"
				class="chzn-color"
				>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>

			<field 
				name="maxLevel" 
				type="list"
				description="JGLOBAL_MAXIMUM_CATEGORY_LEVELS_DESC"
				label="JGLOBAL_MAXIMUM_CATEGORY_LEVELS_LABEL"
				useglobal="true"
				>
				<option value="-1">JALL</option>
				<option value="0">JNONE</option>
				<option value="1">J1</option>
				<option value="2">J2</option>
				<option value="3">J3</option>
				<option value="4">J4</option>
				<option value="5">J5</option>
			</field>

			<field 
				name="show_empty_categories" 
				type="list"
				label="JGLOBAL_SHOW_EMPTY_CATEGORIES_LABEL"
				description="COM_NEWSFEEDS_SHOW_EMPTY_CATEGORIES_DESC"
				useglobal="true"
				class="chzn-color"
				>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>

			<field 
				name="show_subcat_desc" 
				type="list"
				label="JGLOBAL_SHOW_SUBCATEGORIES_DESCRIPTION_LABEL"
				description="JGLOBAL_SHOW_SUBCATEGORIES_DESCRIPTION_DESC"
				useglobal="true"
				class="chzn-color"
				>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>

			<field 
				name="show_cat_items"
				type="list"
				label="COM_NEWSFEEDS_FIELD_SHOW_CAT_ITEMS_LABEL"
				description="COM_NEWSFEEDS_FIELD_SHOW_CAT_ITEMS_DESC"
				id="show_cat_items"
				useglobal="true"
				class="chzn-color"
				>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>

		</fieldset>

		<fieldset name="advanced" label="JGLOBAL_LIST_LAYOUT_OPTIONS">
			<field 
				name="spacer1" 
				type="spacer" 
				label="JGLOBAL_SUBSLIDER_DRILL_CATEGORIES_LABEL"
				class="text"
			/>

			<field
				name="filter_field"
				type="list"
				label="JGLOBAL_FILTER_FIELD_LABEL"
				description="JGLOBAL_FILTER_FIELD_DESC"
				default=""
				useglobal="true"
				class="chzn-color"
				>
				<option value="hide">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>

			<field 
				name="show_pagination_limit"
				type="list"
				label="JGLOBAL_DISPLAY_SELECT_LABEL"
				description="JGLOBAL_DISPLAY_SELECT_DESC"
				useglobal="true"
				class="chzn-color"
				>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>

			<field
				name="show_headings"
				type="list"
				label="JGLOBAL_SHOW_HEADINGS_LABEL"
				description="JGLOBAL_SHOW_HEADINGS_DESC"
				id="show_headings"
				useglobal="true"
				class="chzn-color"
				>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>

			<field
				name="show_articles"
				type="list"
				label="COM_NEWSFEEDS_FIELD_NUM_ARTICLES_COLUMN_LABEL"
				description="COM_NEWSFEEDS_FIELD_NUM_ARTICLES_COLUMN_DESC"
				id="show_articles"
				useglobal="true"
				class="chzn-color"
				>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>

			<field
				name="show_link"
				type="list"
				label="COM_NEWSFEEDS_FIELD_SHOW_LINKS_LABEL"
				description="COM_NEWSFEEDS_FIELD_SHOW_LINKS_DESC"
				id="show_link"
				useglobal="true"
				class="chzn-color"
				>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>

			<field 
				name="show_pagination"
				type="list"
				label="JGLOBAL_PAGINATION_LABEL"
				description="JGLOBAL_PAGINATION_DESC"
				useglobal="true"
				class="chzn-color"
				>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
				<option value="2">JGLOBAL_AUTO</option>
			</field>

			<field
				name="show_pagination_results"
				type="list"
				label="JGLOBAL_PAGINATION_RESULTS_LABEL"
				description="JGLOBAL_PAGINATION_RESULTS_DESC"
				useglobal="true"
				class="chzn-color"
				>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>

		</fieldset>
		<fieldset name="newsfeed" label="COM_NEWSFEEDS_FIELDSET_MORE_OPTIONS_LABEL">

			<field 
				name="show_feed_image" 
				type="list"
				label="COM_NEWSFEEDS_FIELD_SHOW_FEED_IMAGE_LABEL"
				description="COM_NEWSFEEDS_FIELD_SHOW_FEED_IMAGE_DESC"
				useglobal="true"
				class="chzn-color"
				>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>

			<field 
				name="show_feed_description" 
				type="list"
				label="COM_NEWSFEEDS_FIELD_SHOW_FEED_DESCRIPTION_LABEL"
				description="COM_NEWSFEEDS_FIELD_SHOW_FEED_DESCRIPTION_DESC"
				useglobal="true"
				class="chzn-color"
				>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>

			<field 
				name="show_item_description" 
				type="list"
				label="COM_NEWSFEEDS_FIELD_SHOW_ITEM_DESCRIPTION_LABEL"
				description="COM_NEWSFEEDS_FIELD_SHOW_ITEM_DESCRIPTION_DESC"
				useglobal="true"
				class="chzn-color"
				>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>

			<field 
				name="feed_character_count" 
				type="number"
				label="COM_NEWSFEEDS_FIELD_CHARACTER_COUNT_LABEL"
				description="COM_NEWSFEEDS_FIELD_CHARACTER_COUNT_DESC"
				size="6"
				useglobal="true"
			/>
		</fieldset>

	</fields>
</metadata>
PK!�-õ��categories/view.html.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_newsfeeds
 *
 * @copyright   Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

/**
 * Content categories view.
 *
 * @since  1.5
 */
class NewsfeedsViewCategories extends JViewCategories
{
	/**
	 * Language key for default page heading
	 *
	 * @var    string
	 * @since  3.2
	 */
	protected $pageHeading = 'COM_NEWSFEEDS_DEFAULT_PAGE_TITLE';

	/**
	 * @var    string  The name of the extension for the category
	 * @since  3.2
	 */
	protected $extension = 'com_newsfeeds';
}
PK!P-���!�!newsfeed/view.html.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_newsfeeds
 *
 * @copyright   Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

use Joomla\Registry\Registry;

/**
 * HTML View class for the Newsfeeds component
 *
 * @since  1.0
 */
class NewsfeedsViewNewsfeed extends JViewLegacy
{
	/**
	 * @var     object
	 * @since   1.6
	 */
	protected $state;

	/**
	 * @var     object
	 * @since   1.6
	 */
	protected $item;

	/**
	 * @var     boolean
	 * @since   1.6
	 */
	protected $print;

	/**
	 * Execute and display a template script.
	 *
	 * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
	 *
	 * @return  mixed  A string if successful, otherwise an Error object.
	 *
	 * @since   1.6
	 */
	public function display($tpl = null)
	{
		$app  = JFactory::getApplication();
		$user = JFactory::getUser();

		// Get view related request variables.
		$print = $app->input->getBool('print');

		// Get model data.
		$state = $this->get('State');
		$item  = $this->get('Item');

		if ($item)
		{
			// Get Category Model data
			$categoryModel = JModelLegacy::getInstance('Category', 'NewsfeedsModel', array('ignore_request' => true));
			$categoryModel->setState('category.id', $item->catid);
			$categoryModel->setState('list.ordering', 'a.name');
			$categoryModel->setState('list.direction', 'asc');

			// @TODO: $items is not used. Remove this line?
			$items = $categoryModel->getItems();
		}

		// Check for errors.
		// @TODO: Maybe this could go into JComponentHelper::raiseErrors($this->get('Errors'))
		if (count($errors = $this->get('Errors')))
		{
			JError::raiseWarning(500, implode("\n", $errors));

			return false;
		}

		// Add router helpers.
		$item->slug = $item->alias ? ($item->id . ':' . $item->alias) : $item->id;
		$item->catslug = $item->category_alias ? ($item->catid . ':' . $item->category_alias) : $item->catid;
		$item->parent_slug = $item->category_alias ? ($item->parent_id . ':' . $item->parent_alias) : $item->parent_id;

		// Merge newsfeed params. If this is single-newsfeed view, menu params override newsfeed params
		// Otherwise, newsfeed params override menu item params
		$params = $state->get('params');
		$newsfeed_params = clone $item->params;
		$active = $app->getMenu()->getActive();
		$temp = clone $params;

		// Check to see which parameters should take priority
		if ($active)
		{
			$currentLink = $active->link;

			// If the current view is the active item and a newsfeed view for this feed, then the menu item params take priority
			if (strpos($currentLink, 'view=newsfeed') && strpos($currentLink, '&id=' . (string) $item->id))
			{
				// $item->params are the newsfeed params, $temp are the menu item params
				// Merge so that the menu item params take priority
				$newsfeed_params->merge($temp);
				$item->params = $newsfeed_params;

				// Load layout from active query (in case it is an alternative menu item)
				if (isset($active->query['layout']))
				{
					$this->setLayout($active->query['layout']);
				}
			}
			else
			{
				// Current view is not a single newsfeed, so the newsfeed params take priority here
				// Merge the menu item params with the newsfeed params so that the newsfeed params take priority
				$temp->merge($newsfeed_params);
				$item->params = $temp;

				// Check for alternative layouts (since we are not in a single-newsfeed menu item)
				if ($layout = $item->params->get('newsfeed_layout'))
				{
					$this->setLayout($layout);
				}
			}
		}
		else
		{
			// Merge so that newsfeed params take priority
			$temp->merge($newsfeed_params);
			$item->params = $temp;

			// Check for alternative layouts (since we are not in a single-newsfeed menu item)
			if ($layout = $item->params->get('newsfeed_layout'))
			{
				$this->setLayout($layout);
			}
		}

		// Check the access to the newsfeed
		$levels = $user->getAuthorisedViewLevels();

		if (!in_array($item->access, $levels) || (in_array($item->access, $levels) && (!in_array($item->category_access, $levels))))
		{
			$app->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR'), 'error');
			$app->setHeader('status', 403, true);

			return;
		}

		// Get the current menu item
		$params = $app->getParams();

		// Get the newsfeed
		$newsfeed = $item;

		$params->merge($item->params);

		try
		{
			$feed = new JFeedFactory;
			$this->rssDoc = $feed->getFeed($newsfeed->link);
		}
		catch (InvalidArgumentException $e)
		{
			$msg = JText::_('COM_NEWSFEEDS_ERRORS_FEED_NOT_RETRIEVED');
		}
		catch (RunTimeException $e)
		{
			$msg = JText::_('COM_NEWSFEEDS_ERRORS_FEED_NOT_RETRIEVED');
		}

		if (empty($this->rssDoc))
		{
			$msg = JText::_('COM_NEWSFEEDS_ERRORS_FEED_NOT_RETRIEVED');
		}

		$feed_display_order = $params->get('feed_display_order', 'des');

		if ($feed_display_order === 'asc')
		{
			$this->rssDoc->reverseItems();
		}

		// Escape strings for HTML output
		$this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx'));

		$this->params = $params;
		$this->newsfeed = $newsfeed;
		$this->state = $state;
		$this->item = $item;
		$this->user = $user;

		if (!empty($msg))
		{
			$this->msg = $msg;
		}

		$this->print = $print;

		$item->tags = new JHelperTags;
		$item->tags->getItemTags('com_newsfeeds.newsfeed', $item->id);

		// Increment the hit counter of the newsfeed.
		$model = $this->getModel();
		$model->hit();

		$this->_prepareDocument();

		return parent::display($tpl);
	}

	/**
	 * Prepares the document
	 *
	 * @return  void
	 *
	 * @since   1.6
	 */
	protected function _prepareDocument()
	{
		$app     = JFactory::getApplication();
		$menus   = $app->getMenu();
		$pathway = $app->getPathway();
		$title   = null;

		// Because the application sets a default page title,
		// we need to get it from the menu item itself
		$menu = $menus->getActive();

		if ($menu)
		{
			$this->params->def('page_heading', $this->params->get('page_title', $menu->title));
		}
		else
		{
			$this->params->def('page_heading', JText::_('COM_NEWSFEEDS_DEFAULT_PAGE_TITLE'));
		}

		$title = $this->params->get('page_title', '');

		$id = (int) @$menu->query['id'];

		// If the menu item does not concern this newsfeed
		if ($menu && (!isset($menu->query['option']) || $menu->query['option'] !== 'com_newsfeeds' || $menu->query['view'] !== 'newsfeed'
			|| $id != $this->item->id))
		{
			// If this is not a single newsfeed menu item, set the page title to the newsfeed title
			if ($this->item->name)
			{
				$title = $this->item->name;
			}

			$path = array(array('title' => $this->item->name, 'link' => ''));
			$category = JCategories::getInstance('Newsfeeds')->get($this->item->catid);

			while ((!isset($menu->query['option']) || $menu->query['option'] !== 'com_newsfeeds' || $menu->query['view'] === 'newsfeed'
				|| $id != $category->id) && $category->id > 1)
			{
				$path[] = array('title' => $category->title, 'link' => NewsfeedsHelperRoute::getCategoryRoute($category->id));
				$category = $category->getParent();
			}

			$path = array_reverse($path);

			foreach ($path as $item)
			{
				$pathway->addItem($item['title'], $item['link']);
			}
		}

		if (empty($title))
		{
			$title = $app->get('sitename');
		}
		elseif ($app->get('sitename_pagetitles', 0) == 1)
		{
			$title = JText::sprintf('JPAGETITLE', $app->get('sitename'), $title);
		}
		elseif ($app->get('sitename_pagetitles', 0) == 2)
		{
			$title = JText::sprintf('JPAGETITLE', $title, $app->get('sitename'));
		}

		if (empty($title))
		{
			$title = $this->item->name;
		}

		$this->document->setTitle($title);

		if ($this->item->metadesc)
		{
			$this->document->setDescription($this->item->metadesc);
		}
		elseif ($this->params->get('menu-meta_description'))
		{
			$this->document->setDescription($this->params->get('menu-meta_description'));
		}

		if ($this->item->metakey)
		{
			$this->document->setMetadata('keywords', $this->item->metakey);
		}
		elseif ($this->params->get('menu-meta_keywords'))
		{
			$this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords'));
		}

		if ($this->params->get('robots'))
		{
			$this->document->setMetadata('robots', $this->params->get('robots'));
		}

		if ($app->get('MetaTitle') == '1')
		{
			$this->document->setMetaData('title', $this->item->name);
		}

		if ($app->get('MetaAuthor') == '1')
		{
			$this->document->setMetaData('author', $this->item->author);
		}

		$mdata = $this->item->metadata->toArray();

		foreach ($mdata as $k => $v)
		{
			if ($v)
			{
				$this->document->setMetadata($k, $v);
			}
		}
	}
}
PK!�����newsfeed/tmpl/default.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_newsfeeds
 *
 * @copyright   Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

?>
<?php if (!empty($this->msg)) : ?>
	<?php echo $this->msg; ?>
<?php else : ?>
	<?php $lang      = JFactory::getLanguage(); ?>
	<?php $myrtl     = $this->newsfeed->rtl; ?>
	<?php $direction = ' '; ?>
	<?php $isRtl     = $lang->isRtl(); ?>
	<?php if ($isRtl && $myrtl == 0) : ?>
		<?php $direction = ' redirect-rtl'; ?>
	<?php elseif ($isRtl && $myrtl == 1) : ?>
		<?php $direction = ' redirect-ltr'; ?>
	<?php elseif ($isRtl && $myrtl == 2) : ?>
		<?php $direction = ' redirect-rtl'; ?>
	<?php elseif ($myrtl == 0) : ?>
		<?php $direction = ' redirect-ltr'; ?>
	<?php elseif ($myrtl == 1) : ?>
		<?php $direction = ' redirect-ltr'; ?>
	<?php elseif ($myrtl == 2) : ?>
		<?php $direction = ' redirect-rtl'; ?>
	<?php endif; ?>
	<?php $images = json_decode($this->item->images); ?>
	<div class="newsfeed<?php echo $this->pageclass_sfx; ?><?php echo $direction; ?>">
		<?php if ($this->params->get('display_num')) : ?>
			<h1 class="<?php echo $direction; ?>">
				<?php echo $this->escape($this->params->get('page_heading')); ?>
			</h1>
		<?php endif; ?>
		<h2 class="<?php echo $direction; ?>">
			<?php if ($this->item->published == 0) : ?>
				<span class="label label-warning"><?php echo JText::_('JUNPUBLISHED'); ?></span>
			<?php endif; ?>
			<a href="<?php echo $this->item->link; ?>" target="_blank">
				<?php echo str_replace('&apos;', "'", $this->item->name); ?>
			</a>
		</h2>
		<?php if ($this->params->get('show_tags', 1)) : ?>
			<?php $this->item->tagLayout = new JLayoutFile('joomla.content.tags'); ?>
			<?php echo $this->item->tagLayout->render($this->item->tags->itemTags); ?>
		<?php endif; ?>
		<!-- Show Images from Component -->
		<?php if (isset($images->image_first) && !empty($images->image_first)) : ?>
			<?php $imgfloat = empty($images->float_first) ? $this->params->get('float_first') : $images->float_first; ?>
			<div class="img-intro-<?php echo htmlspecialchars($imgfloat, ENT_COMPAT, 'UTF-8'); ?>">
				<img
				<?php if ($images->image_first_caption) : ?>
					<?php echo 'class="caption"' . ' title="' . htmlspecialchars($images->image_first_caption, ENT_COMPAT, 'UTF-8') . '"'; ?>
				<?php endif; ?>
				src="<?php echo htmlspecialchars($images->image_first, ENT_COMPAT, 'UTF-8'); ?>" alt="<?php echo htmlspecialchars($images->image_first_alt, ENT_COMPAT, 'UTF-8'); ?>" />
			</div>
		<?php endif; ?>
		<?php if (isset($images->image_second) && !empty($images->image_second)) : ?>
			<?php $imgfloat = empty($images->float_second) ? $this->params->get('float_second') : $images->float_second; ?>
			<div class="pull-<?php echo htmlspecialchars($imgfloat, ENT_COMPAT, 'UTF-8'); ?> item-image">
				<img
				<?php if ($images->image_second_caption) : ?>
					<?php echo 'class="caption"' . ' title="' . htmlspecialchars($images->image_second_caption) . '"'; ?>
				<?php endif; ?>
				src="<?php echo htmlspecialchars($images->image_second, ENT_COMPAT, 'UTF-8'); ?>" alt="<?php echo htmlspecialchars($images->image_second_alt, ENT_COMPAT, 'UTF-8'); ?>" />
			</div>
		<?php endif; ?>
		<!-- Show Description from Component -->
		<?php echo $this->item->description; ?>
		<!-- Show Feed's Description -->
		<?php if ($this->params->get('show_feed_description')) : ?>
			<div class="feed-description">
				<?php echo str_replace('&apos;', "'", $this->rssDoc->description); ?>
			</div>
		<?php endif; ?>
		<!-- Show Image -->
		<?php if (isset($this->rssDoc->image, $this->rssDoc->imagetitle) && $this->params->get('show_feed_image')) : ?>
			<div>
				<img src="<?php echo $this->rssDoc->image; ?>" alt="<?php echo $this->rssDoc->image->decription; ?>" />
			</div>
		<?php endif; ?>
		<!-- Show items -->
		<?php if (!empty($this->rssDoc[0])) : ?>
			<ol>
				<?php for ($i = 0; $i < $this->item->numarticles; $i++) : ?>
					<?php if (empty($this->rssDoc[$i])) : ?>
						<?php break; ?>
					<?php endif; ?>
					<?php $uri  = $this->rssDoc[$i]->uri || !$this->rssDoc[$i]->isPermaLink ? trim($this->rssDoc[$i]->uri) : trim($this->rssDoc[$i]->guid); ?>
					<?php $uri  = !$uri || stripos($uri, 'http') !== 0 ? $this->item->link : $uri; ?>
					<?php $text = $this->rssDoc[$i]->content !== '' ? trim($this->rssDoc[$i]->content) : ''; ?>
					<li>
						<?php if (!empty($uri)) : ?>
							<h3 class="feed-link">
								<a href="<?php echo htmlspecialchars($uri); ?>" target="_blank">
									<?php echo trim($this->rssDoc[$i]->title); ?>
								</a>
							</h3>
						<?php else : ?>
							<h3 class="feed-link"><?php echo trim($this->rssDoc[$i]->title); ?></h3>
						<?php endif; ?>
						<?php if ($this->params->get('show_item_description') && $text !== '') : ?>
							<div class="feed-item-description">
								<?php if ($this->params->get('show_feed_image', 0) == 0) : ?>
									<?php $text = JFilterOutput::stripImages($text); ?>
								<?php endif; ?>
								<?php $text = JHtml::_('string.truncate', $text, $this->params->get('feed_character_count')); ?>
								<?php echo str_replace('&apos;', "'", $text); ?>
							</div>
						<?php endif; ?>
					</li>
				<?php endfor; ?>
			</ol>
		<?php endif; ?>
	</div>
<?php endif; ?>
PK!���r�
�
newsfeed/tmpl/default.xmlnu�[���<?xml version="1.0" encoding="utf-8"?>
<metadata>
	<layout title="COM_NEWSFEEDS_NEWSFEED_VIEW_DEFAULT_TITLE" option="COM_NEWSFEEDS_NEWSFEED_VIEW_DEFAULT_OPTION">
		<help
			key = "JHELP_MENUS_MENU_ITEM_NEWSFEED_SINGLE_NEWSFEED"
		/>
		<message>
			<![CDATA[COM_NEWSFEEDS_NEWSFEED_VIEW_DEFAULT_DESC]]>
		</message>
	</layout>

	<!-- Add fields to the request variables for the layout. -->
	<fields name="request">
		<fieldset name="request"
			addfieldpath="/administrator/components/com_newsfeeds/models/fields"
		 >

			<field 
				name="id" 
				type="modal_newsfeed"
				label="COM_NEWSFEEDS_FIELD_SELECT_FEED_LABEL"
				description="COM_NEWSFEEDS_FIELD_SELECT_FEED_DESC"
				required="true"
				select="true"
				new="true"
				edit="true"
				clear="true"
			/>
		</fieldset>
	</fields>

	<!-- Add fields to the parameters object for the layout. -->
	<fields name="params">

		<!-- Basic options. -->
		<fieldset name="basic" label="COM_NEWSFEEDS_FIELDSET_MORE_OPTIONS_LABEL">
			<field 
				name="show_feed_image" 
				type="list"
				label="COM_NEWSFEEDS_FIELD_SHOW_FEED_IMAGE_LABEL"
				description="COM_NEWSFEEDS_FIELD_SHOW_FEED_IMAGE_DESC"
				useglobal="true"
				class="chzn-color"
				>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>

			<field 
				name="show_feed_description" 
				type="list"
				label="COM_NEWSFEEDS_FIELD_SHOW_FEED_DESCRIPTION_LABEL"
				description="COM_NEWSFEEDS_FIELD_SHOW_FEED_DESCRIPTION_DESC"
				useglobal="true"
				class="chzn-color"
				>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>

			<field 
				name="show_item_description" 
				type="list"
				label="COM_NEWSFEEDS_FIELD_SHOW_ITEM_DESCRIPTION_LABEL"
				description="COM_NEWSFEEDS_FIELD_SHOW_ITEM_DESCRIPTION_DESC"
				useglobal="true"
				class="chzn-color"
				>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>

			<field 
				name="show_tags" 
				type="list"
				label="COM_NEWSFEEDS_FIELD_SHOW_TAGS_LABEL"
				description="COM_NEWSFEEDS_FIELD_SHOW_TAGS_DESC"
				useglobal="true"
				class="chzn-color"
				>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>

			<field 
				name="feed_character_count" 
				type="number"
				label="COM_NEWSFEEDS_FIELD_CHARACTER_COUNT_LABEL"
				description="COM_NEWSFEEDS_FIELD_CHARACTER_COUNT_DESC"
				size="6"
				useglobal="true"
			/>

			<field 
				name="feed_display_order" 
				type="list"
				label="COM_NEWSFEEDS_FIELD_FEED_DISPLAY_ORDER_LABEL"
				description="COM_NEWSFEEDS_FIELD_FEED_DISPLAY_ORDER_DESC"
				useglobal="true"
				>
				<option value="des">JGLOBAL_MOST_RECENT_FIRST</option>
				<option value="asc">JGLOBAL_OLDEST_FIRST</option>
			</field>
		
		</fieldset>
	</fields>
</metadata>
PK!��$category/tmpl/default_items.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_newsfeeds
 *
 * @copyright   Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

$n         = count($this->items);
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn  = $this->escape($this->state->get('list.direction'));

?>
<?php if (empty($this->items)) : ?>
	<p><?php echo JText::_('COM_NEWSFEEDS_NO_ARTICLES'); ?></p>
<?php else : ?>
	<form action="<?php echo htmlspecialchars(JUri::getInstance()->toString(), ENT_COMPAT, 'UTF-8'); ?>" method="post" name="adminForm" id="adminForm">
		<?php if ($this->params->get('filter_field') !== 'hide' || $this->params->get('show_pagination_limit')) : ?>
			<fieldset class="filters btn-toolbar">
				<?php if ($this->params->get('filter_field') !== 'hide' && $this->params->get('filter_field') == '1') : ?>
					<div class="btn-group">
						<label class="filter-search-lbl element-invisible" for="filter-search">
							<span class="label label-warning">
								<?php echo JText::_('JUNPUBLISHED'); ?>
							</span>
							<?php echo JText::_('COM_NEWSFEEDS_FILTER_LABEL') . '&#160;'; ?>
						</label>
						<input type="text" name="filter-search" id="filter-search" value="<?php echo $this->escape($this->state->get('list.filter')); ?>" class="inputbox" onchange="document.adminForm.submit();" title="<?php echo JText::_('COM_NEWSFEEDS_FILTER_SEARCH_DESC'); ?>" placeholder="<?php echo JText::_('COM_NEWSFEEDS_FILTER_SEARCH_DESC'); ?>" />
					</div>
				<?php endif; ?>
				<?php if ($this->params->get('show_pagination_limit')) : ?>
					<div class="btn-group pull-right">
						<label for="limit" class="element-invisible">
							<?php echo JText::_('JGLOBAL_DISPLAY_NUM'); ?>
						</label>
						<?php echo $this->pagination->getLimitBox(); ?>
					</div>
				<?php endif; ?>
			</fieldset>
		<?php endif; ?>
		<ul class="category list-striped list-condensed">
			<?php foreach ($this->items as $i => $item) : ?>
				<?php if ($this->items[$i]->published == 0) : ?>
					<li class="system-unpublished cat-list-row<?php echo $i % 2; ?>">
				<?php else : ?>
					<li class="cat-list-row<?php echo $i % 2; ?>">
				<?php endif; ?>
				<?php if ($this->params->get('show_articles')) : ?>
					<span class="list-hits badge badge-info pull-right">
						<?php echo JText::sprintf('COM_NEWSFEEDS_NUM_ARTICLES_COUNT', $item->numarticles); ?>
					</span>
				<?php endif; ?>
				<span class="list pull-left">
					<div class="list-title">
						<a href="<?php echo JRoute::_(NewsFeedsHelperRoute::getNewsfeedRoute($item->slug, $item->catid)); ?>">
							<?php echo $item->name; ?>
						</a>
					</div>
				</span>
				<?php if ($this->items[$i]->published == 0) : ?>
					<span class="label label-warning">
						<?php echo JText::_('JUNPUBLISHED'); ?>
					</span>
				<?php endif; ?>
				<br />
				<?php if ($this->params->get('show_link')) : ?>
					<?php $link = JStringPunycode::urlToUTF8($item->link); ?>
					<span class="list pull-left">
						<a href="<?php echo $item->link; ?>">
							<?php echo $link; ?>
						</a>
					</span>
					<br />
				<?php endif; ?>
				</li>
			<?php endforeach; ?>
		</ul>
		<?php // Add pagination links ?>
		<?php if (!empty($this->items)) : ?>
			<?php if (($this->params->def('show_pagination', 2) == 1 || ($this->params->get('show_pagination') == 2)) && ($this->pagination->pagesTotal > 1)) : ?>
				<div class="pagination">
					<?php if ($this->params->def('show_pagination_results', 1)) : ?>
						<p class="counter pull-right">
							<?php echo $this->pagination->getPagesCounter(); ?>
						</p>
					<?php endif; ?>
					<?php echo $this->pagination->getPagesLinks(); ?>
				</div>
			<?php endif; ?>
		<?php endif; ?>
	</form>
<?php endif; ?>
PK!�!4��category/tmpl/default.xmlnu�[���<?xml version="1.0" encoding="utf-8"?>
<metadata>
	<layout title="COM_NEWSFEEDS_CATEGORY_VIEW_DEFAULT_TITLE" option="COM_NEWSFEEDS_CATEGORY_VIEW_DEFAULT_OPTION">
		<help
			key = "JHELP_MENUS_MENU_ITEM_NEWSFEED_CATEGORY"
		/>
		<message>
			<![CDATA[COM_NEWSFEEDS_CATEGORY_VIEW_DEFAULT_DESC]]>
		</message>
	</layout>

	<!-- Add fields to the request variables for the layout. -->
	<fields name="request"
		addfieldpath="/administrator/components/com_categories/models/fields"
	>
		<fieldset name="request"
			addfieldpath="/administrator/components/com_newsfeeds/models/fields"
		 >
			<field
				name="id"
				type="modal_category"
				label="JCATEGORY"
				description="COM_NEWSFEEDS_FIELD_SELECT_CATEGORY_DESC"
				extension="com_newsfeeds"
				required="true"
				select="true"
				new="true"
				edit="true"
				clear="true"
			/>
		</fieldset>
	</fields>

	<!-- Add fields to the parameters object for the layout. -->
<fields name="params">
	<fieldset name="basic" label="JGLOBAL_CATEGORY_OPTIONS">
		<field 
			name="spacer1" 
			type="spacer" 
			label="JGLOBAL_SUBSLIDER_DRILL_CATEGORIES_LABEL"
			class="text"
			/>

			<field 
				name="show_category_title" 
				type="list"
				label="JGLOBAL_SHOW_CATEGORY_TITLE"
				description="JGLOBAL_SHOW_CATEGORY_TITLE_DESC"
				useglobal="true"
				class="chzn-color"
				>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>

			<field 
				name="show_description" 
				type="list"
				label="JGLOBAL_SHOW_CATEGORY_DESCRIPTION_LABEL"
				description="JGLOBAL_SHOW_CATEGORY_DESCRIPTION_DESC"
				useglobal="true"
				class="chzn-color"
				>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>

			<field 
				name="show_description_image" 
				type="list"
				label="JGLOBAL_SHOW_CATEGORY_IMAGE_LABEL"
				description="JGLOBAL_SHOW_CATEGORY_IMAGE_DESC"
				useglobal="true"
				class="chzn-color"
				>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>

			<field 
				name="maxLevel" 
				type="list"
				label="JGLOBAL_MAXIMUM_CATEGORY_LEVELS_LABEL"
				description="JGLOBAL_MAXIMUM_CATEGORY_LEVELS_DESC"
				useglobal="true"
				>
				<option value="-1">JALL</option>
				<option value="0">JNONE</option>
				<option value="1">J1</option>
				<option value="2">J2</option>
				<option value="3">J3</option>
				<option value="4">J4</option>
				<option value="5">J5</option>
			</field>

			<field 
				name="show_empty_categories" 
				type="list"
				label="JGLOBAL_SHOW_EMPTY_CATEGORIES_LABEL"
				description="COM_NEWSFEEDS_SHOW_EMPTY_CATEGORIES_DESC"
				useglobal="true"
				class="chzn-color"
				>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>

			<field 
				name="show_subcat_desc" 
				type="list"
				label="JGLOBAL_SHOW_SUBCATEGORIES_DESCRIPTION_LABEL"
				description="JGLOBAL_SHOW_SUBCATEGORIES_DESCRIPTION_DESC"
				useglobal="true"
				class="chzn-color"
				>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>

			<field 
				name="show_cat_items"
				type="list"
				label="COM_NEWSFEEDS_FIELD_SHOW_CAT_ITEMS_LABEL"
				description="COM_NEWSFEEDS_FIELD_SHOW_CAT_ITEMS_DESC"
				id="show_cat_items"
				useglobal="true"
				class="chzn-color"
				>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>
		</fieldset>
		<fieldset name="advanced" label="JGLOBAL_LIST_LAYOUT_OPTIONS">
			<field 
				name="spacer2" 
				type="spacer" 
				label="JGLOBAL_SUBSLIDER_DRILL_CATEGORIES_LABEL"
				class="text"
			/>

			<field
				name="filter_field"
				type="list"
				label="JGLOBAL_FILTER_FIELD_LABEL"
				description="JGLOBAL_FILTER_FIELD_DESC"
				default=""
				useglobal="true"
				class="chzn-color"				
				>
				<option value="hide">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>

			<field 
				name="show_pagination_limit"
				type="list"
				label="JGLOBAL_DISPLAY_SELECT_LABEL"
				description="JGLOBAL_DISPLAY_SELECT_DESC"
				useglobal="true"
				class="chzn-color"
				>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>

			<field
				name="show_headings"
				type="list"
				label="JGLOBAL_SHOW_HEADINGS_LABEL"
				description="JGLOBAL_SHOW_HEADINGS_DESC"
				id="show_headings"
				useglobal="true"
				class="chzn-color"
				>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>

			<field
				name="show_articles"
				type="list"
				label="COM_NEWSFEEDS_FIELD_NUM_ARTICLES_COLUMN_LABEL"
				description="COM_NEWSFEEDS_FIELD_NUM_ARTICLES_COLUMN_DESC"
				id="show_articles"
				useglobal="true"
				class="chzn-color"
				>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>

			<field
				name="show_link"
				type="list"
				label="COM_NEWSFEEDS_FIELD_SHOW_LINKS_LABEL"
				description="COM_NEWSFEEDS_FIELD_SHOW_LINKS_DESC"
				id="show_link"
				useglobal="true"
				class="chzn-color"
				>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>

			<field 
				name="show_pagination"
				type="list"
				label="JGLOBAL_PAGINATION_LABEL"
				description="JGLOBAL_PAGINATION_DESC"
				useglobal="true"
				class="chzn-color"
				>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
				<option value="2">JGLOBAL_AUTO</option>
			</field>

			<field
				name="show_pagination_results"
				type="list"
				label="JGLOBAL_PAGINATION_RESULTS_LABEL"
				description="JGLOBAL_PAGINATION_RESULTS_DESC"
				useglobal="true"
				class="chzn-color"
				>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>
		</fieldset>

		<fieldset name="newsfeed" label="COM_NEWSFEEDS_FIELDSET_MORE_OPTIONS_LABEL">

			<field 
				name="show_feed_image" 
				type="list"
				label="COM_NEWSFEEDS_FIELD_SHOW_FEED_IMAGE_LABEL"
				description="COM_NEWSFEEDS_FIELD_SHOW_FEED_IMAGE_DESC"
				useglobal="true"
				class="chzn-color"
				>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>

			<field 
				name="show_feed_description" 
				type="list"
				label="COM_NEWSFEEDS_FIELD_SHOW_FEED_DESCRIPTION_LABEL"
				description="COM_NEWSFEEDS_FIELD_SHOW_FEED_DESCRIPTION_DESC"
				useglobal="true"
				class="chzn-color"
				>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>

			<field 
				name="show_item_description" 
				type="list"
				label="COM_NEWSFEEDS_FIELD_SHOW_ITEM_DESCRIPTION_LABEL"
				description="COM_NEWSFEEDS_FIELD_SHOW_ITEM_DESCRIPTION_DESC"
				useglobal="true"
				class="chzn-color"
				>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>

			<field 
				name="feed_character_count" 
				type="number"
				description="COM_NEWSFEEDS_FIELD_CHARACTER_COUNT_DESC"
				label="COM_NEWSFEEDS_FIELD_CHARACTER_COUNT_LABEL"
				size="6"
				useglobal="true"
			/>
			
			<field 
				name="feed_display_order" 
				type="list"
				label="COM_NEWSFEEDS_FIELD_FEED_DISPLAY_ORDER_LABEL"
				description="COM_NEWSFEEDS_FIELD_FEED_DISPLAY_ORDER_DESC"
				useglobal="true"
				>
				<option value="des">JGLOBAL_MOST_RECENT_FIRST</option>
				<option value="asc">JGLOBAL_OLDEST_FIRST</option>
			</field>
		</fieldset>
	</fields>
</metadata>
PK!�iH  category/tmpl/default.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_newsfeeds
 *
 * @copyright   Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers');

JHtml::_('behavior.caption');
JHtml::_('formbehavior.chosen', 'select');

$pageClass = $this->params->get('pageclass_sfx');

?>
<div class="newsfeed-category<?php echo $this->pageclass_sfx; ?>">
	<?php if ($this->params->get('show_page_heading')) : ?>
		<h1>
			<?php echo $this->escape($this->params->get('page_heading')); ?>
		</h1>
	<?php endif; ?>
	<?php if ($this->params->get('show_category_title', 1)) : ?>
		<h2>
			<?php echo JHtml::_('content.prepare', $this->category->title, '', 'com_newsfeeds.category.title'); ?>
		</h2>
	<?php endif; ?>
	<?php if ($this->params->get('show_tags', 1) && !empty($this->category->tags->itemTags)) : ?>
		<?php $this->category->tagLayout = new JLayoutFile('joomla.content.tags'); ?>
		<?php echo $this->category->tagLayout->render($this->category->tags->itemTags); ?>
	<?php endif; ?>
	<?php if ($this->params->get('show_description', 1) || $this->params->def('show_description_image', 1)) : ?>
		<div class="category-desc">
			<?php if ($this->params->get('show_description_image') && $this->category->getParams()->get('image')) : ?>
				<img src="<?php echo $this->category->getParams()->get('image'); ?>" />
			<?php endif; ?>
			<?php if ($this->params->get('show_description') && $this->category->description) : ?>
				<?php echo JHtml::_('content.prepare', $this->category->description, '', 'com_newsfeeds.category'); ?>
			<?php endif; ?>
			<div class="clr"></div>
		</div>
	<?php endif; ?>
	<?php echo $this->loadTemplate('items'); ?>
	<?php if ($this->maxLevel != 0 && !empty($this->children[$this->category->id])) : ?>
		<div class="cat-children">
			<h3>
				<?php echo JText::_('JGLOBAL_SUBCATEGORIES'); ?>
			</h3>
			<?php echo $this->loadTemplate('children'); ?>
		</div>
	<?php endif; ?>
</div>
PK!�y��"category/tmpl/default_children.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_newsfeeds
 *
 * @copyright   Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

?>
<?php $class = ' class="first"'; ?>
<?php if ($this->maxLevel != 0 && count($this->children[$this->category->id]) > 0) : ?>
	<ul>
		<?php foreach ($this->children[$this->category->id] as $id => $child) : ?>
			<?php if ($this->params->get('show_empty_categories') || $child->numitems || count($child->getChildren())) : ?>
				<?php if (!isset($this->children[$this->category->id][$id + 1])) : ?>
					<?php $class = ' class="last"'; ?>
				<?php endif; ?>
				<li<?php echo $class; ?>>
					<?php $class = ''; ?>
					<span class="item-title">
						<a href="<?php echo JRoute::_(NewsfeedsHelperRoute::getCategoryRoute($child->id)); ?>">
							<?php echo $this->escape($child->title); ?>
						</a>
					</span>
					<?php if ($this->params->get('show_subcat_desc') == 1) : ?>
						<?php if ($child->description) : ?>
							<div class="category-desc">
								<?php echo JHtml::_('content.prepare', $child->description, '', 'com_newsfeeds.category'); ?>
							</div>
						<?php endif; ?>
					<?php endif; ?>
					<?php if ($this->params->get('show_cat_items') == 1) : ?>
						<dl class="newsfeed-count">
							<dt>
								<?php echo JText::_('COM_NEWSFEEDS_CAT_NUM'); ?>
							</dt>
							<dd>
								<?php echo $child->numitems; ?>
							</dd>
						</dl>
					<?php endif; ?>
					<?php if (count($child->getChildren()) > 0) : ?>
						<?php $this->children[$child->id] = $child->getChildren(); ?>
						<?php $this->category = $child; ?>
						<?php $this->maxLevel--; ?>
						<?php echo $this->loadTemplate('children'); ?>
						<?php $this->category = $child->getParent(); ?>
						<?php $this->maxLevel++; ?>
					<?php endif; ?>
				</li>
			<?php endif; ?>
		<?php endforeach; ?>
	</ul>
<?php endif;
PK!Z�e�	�	category/view.html.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_newsfeeds
 *
 * @copyright   Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

use Joomla\Registry\Registry;

/**
 * HTML View class for the Newsfeeds component
 *
 * @since  1.0
 */
class NewsfeedsViewCategory extends JViewCategory
{
	/**
	 * @var    string  Default title to use for page title
	 * @since  3.2
	 */
	protected $defaultPageTitle = 'COM_NEWSFEEDS_DEFAULT_PAGE_TITLE';

	/**
	 * @var    string  The name of the extension for the category
	 * @since  3.2
	 */
	protected $extension = 'com_newsfeeds';

	/**
	 * @var    string  The name of the view to link individual items to
	 * @since  3.2
	 */
	protected $viewName = 'newsfeed';

	/**
	 * Execute and display a template script.
	 *
	 * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
	 *
	 * @return  mixed  A string if successful, otherwise an Error object.
	 */
	public function display($tpl = null)
	{
		$this->commonCategoryDisplay();

		// Flag indicates to not add limitstart=0 to URL
		$this->pagination->hideEmptyLimitstart = true;

		// Prepare the data.
		// Compute the newsfeed slug.
		foreach ($this->items as $item)
		{
			$item->slug = $item->alias ? ($item->id . ':' . $item->alias) : $item->id;
			$temp       = $item->params;
			$item->params = clone $this->params;
			$item->params->merge($temp);
		}

		return parent::display($tpl);
	}

	/**
	 * Prepares the document
	 *
	 * @return  void
	 */
	protected function prepareDocument()
	{
		parent::prepareDocument();

		$menu = $this->menu;
		$id = (int) @$menu->query['id'];

		if ($menu && (!isset($menu->query['option']) || $menu->query['option'] !== 'com_newsfeeds' || $menu->query['view'] === 'newsfeed'
			|| $id != $this->category->id))
		{
			$path = array(array('title' => $this->category->title, 'link' => ''));
			$category = $this->category->getParent();

			while ((!isset($menu->query['option']) || $menu->query['option'] !== 'com_newsfeeds' || $menu->query['view'] === 'newsfeed'
				|| $id != $category->id) && $category->id > 1)
			{
				$path[] = array('title' => $category->title, 'link' => NewsfeedsHelperRoute::getCategoryRoute($category->id));
				$category = $category->getParent();
			}

			$path = array_reverse($path);

			foreach ($path as $item)
			{
				$this->pathway->addItem($item['title'], $item['link']);
			}
		}
	}
}
PK!�I��

reset/tmpl/confirm.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_users
 *
 * @copyright   Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

JHtml::_('behavior.keepalive');
JHtml::_('behavior.formvalidator');

?>
<div class="reset-confirm<?php echo $this->pageclass_sfx; ?>">
	<?php if ($this->params->get('show_page_heading')) : ?>
		<div class="page-header">
			<h1>
				<?php echo $this->escape($this->params->get('page_heading')); ?>
			</h1>
		</div>
	<?php endif; ?>
	<form action="<?php echo JRoute::_('index.php?option=com_users&task=reset.confirm'); ?>" method="post" class="form-validate form-horizontal well">
		<?php foreach ($this->form->getFieldsets() as $fieldset) : ?>
			<fieldset>
				<?php if (isset($fieldset->label)) : ?>
					<p><?php echo JText::_($fieldset->label); ?></p>
				<?php endif; ?>
				<?php echo $this->form->renderFieldset($fieldset->name); ?>
			</fieldset>
		<?php endforeach; ?>
		<div class="control-group">
			<div class="controls">
				<button type="submit" class="btn btn-primary validate">
					<?php echo JText::_('JSUBMIT'); ?>
				</button>
			</div>
		</div>
		<?php echo JHtml::_('form.token'); ?>
	</form>
</div>
PK!��W�22reset/tmpl/default.xmlnu�[���<?xml version="1.0" encoding="utf-8"?>
<metadata>
	<layout title="COM_USER_RESET_VIEW_DEFAULT_TITLE" option="COM_USER_RESET_VIEW_DEFAULT_OPTION">
		<help
			key="JHELP_MENUS_MENU_ITEM_USER_PASSWORD_RESET"
		/>
		<message>
			<![CDATA[COM_USER_RESET_VIEW_DEFAULT_DESC]]>
		</message>
	</layout>
</metadata>
PK!���Yreset/tmpl/default.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_users
 *
 * @copyright   Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

JHtml::_('behavior.keepalive');
JHtml::_('behavior.formvalidator');

?>
<div class="reset<?php echo $this->pageclass_sfx; ?>">
	<?php if ($this->params->get('show_page_heading')) : ?>
		<div class="page-header">
			<h1>
				<?php echo $this->escape($this->params->get('page_heading')); ?>
			</h1>
		</div>
	<?php endif; ?>
	<form id="user-registration" action="<?php echo JRoute::_('index.php?option=com_users&task=reset.request'); ?>" method="post" class="form-validate form-horizontal well">
		<?php foreach ($this->form->getFieldsets() as $fieldset) : ?>
			<fieldset>
				<?php if (isset($fieldset->label)) : ?>
					<p><?php echo JText::_($fieldset->label); ?></p>
				<?php endif; ?>
				<?php echo $this->form->renderFieldset($fieldset->name); ?>
			</fieldset>
		<?php endforeach; ?>
		<div class="control-group">
			<div class="controls">
				<button type="submit" class="btn btn-primary validate">
					<?php echo JText::_('JSUBMIT'); ?>
				</button>
			</div>
		</div>
		<?php echo JHtml::_('form.token'); ?>
	</form>
</div>
PK!p��reset/tmpl/complete.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_users
 *
 * @copyright   Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

JHtml::_('behavior.keepalive');
JHtml::_('behavior.formvalidator');

?>
<div class="reset-complete<?php echo $this->pageclass_sfx; ?>">
	<?php if ($this->params->get('show_page_heading')) : ?>
		<div class="page-header">
			<h1>
				<?php echo $this->escape($this->params->get('page_heading')); ?>
			</h1>
		</div>
	<?php endif; ?>
	<form action="<?php echo JRoute::_('index.php?option=com_users&task=reset.complete'); ?>" method="post" class="form-validate form-horizontal well">
		<?php foreach ($this->form->getFieldsets() as $fieldset) : ?>
			<fieldset>
				<?php if (isset($fieldset->label)) : ?>
					<p><?php echo JText::_($fieldset->label); ?></p>
				<?php endif; ?>
				<?php echo $this->form->renderFieldset($fieldset->name); ?>
			</fieldset>
		<?php endforeach; ?>
		<div class="control-group">
			<div class="controls">
				<button type="submit" class="btn btn-primary validate">
					<?php echo JText::_('JSUBMIT'); ?>
				</button>
			</div>
		</div>
		<?php echo JHtml::_('form.token'); ?>
	</form>
</div>
PK!7�,�reset/view.html.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_users
 *
 * @copyright   Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

/**
 * Reset view class for Users.
 *
 * @since  1.5
 */
class UsersViewReset extends JViewLegacy
{
	protected $form;

	protected $params;

	protected $state;

	/**
	 * Method to display the view.
	 *
	 * @param   string  $tpl  The template file to include
	 *
	 * @return  mixed
	 *
	 * @since   1.5
	 */
	public function display($tpl = null)
	{
		// This name will be used to get the model
		$name = $this->getLayout();

		// Check that the name is valid - has an associated model.
		if (!in_array($name, array('confirm', 'complete')))
		{
			$name = 'default';
		}

		if ('default' === $name)
		{
			$formname = 'Form';
		}
		else
		{
			$formname = ucfirst($this->_name) . ucfirst($name) . 'Form';
		}

		// Get the view data.
		$this->form   = $this->get($formname);
		$this->state  = $this->get('State');
		$this->params = $this->state->params;

		// Check for errors.
		if (count($errors = $this->get('Errors')))
		{
			JError::raiseError(500, implode('<br />', $errors));

			return false;
		}

		// Escape strings for HTML output
		$this->pageclass_sfx = htmlspecialchars($this->params->get('pageclass_sfx'), ENT_COMPAT, 'UTF-8');

		$this->prepareDocument();

		parent::display($tpl);
	}

	/**
	 * Prepares the document.
	 *
	 * @return  void
	 *
	 * @since   1.6
	 */
	protected function prepareDocument()
	{
		$app   = JFactory::getApplication();
		$menus = $app->getMenu();
		$title = null;

		// Because the application sets a default page title,
		// we need to get it from the menu item itself
		$menu = $menus->getActive();

		if ($menu)
		{
			$this->params->def('page_heading', $this->params->get('page_title', $menu->title));
		}
		else
		{
			$this->params->def('page_heading', JText::_('COM_USERS_RESET'));
		}

		$title = $this->params->get('page_title', '');

		if (empty($title))
		{
			$title = $app->get('sitename');
		}
		elseif ($app->get('sitename_pagetitles', 0) == 1)
		{
			$title = JText::sprintf('JPAGETITLE', $app->get('sitename'), $title);
		}
		elseif ($app->get('sitename_pagetitles', 0) == 2)
		{
			$title = JText::sprintf('JPAGETITLE', $title, $app->get('sitename'));
		}

		$this->document->setTitle($title);

		if ($this->params->get('menu-meta_description'))
		{
			$this->document->setDescription($this->params->get('menu-meta_description'));
		}

		if ($this->params->get('menu-meta_keywords'))
		{
			$this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords'));
		}

		if ($this->params->get('robots'))
		{
			$this->document->setMetadata('robots', $this->params->get('robots'));
		}
	}
}
PK!�q>�11remind/tmpl/default.xmlnu�[���<?xml version="1.0" encoding="utf-8"?>
<metadata>
	<layout title="COM_USER_REMIND_VIEW_DEFAULT_TITLE" option="COM_USER_REMIND_VIEW_DEFAULT_OPTION">
		<help
			key = "JHELP_MENUS_MENU_ITEM_USER_REMINDER"
		/>
		<message>
			<![CDATA[COM_USER_REMIND_VIEW_DEFAULT_DESC]]>
		</message>
	</layout>
</metadata>
PK!_��remind/tmpl/default.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_users
 *
 * @copyright   Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

JHtml::_('behavior.keepalive');
JHtml::_('behavior.formvalidator');

?>
<div class="remind<?php echo $this->pageclass_sfx; ?>">
	<?php if ($this->params->get('show_page_heading')) : ?>
		<div class="page-header">
			<h1>
				<?php echo $this->escape($this->params->get('page_heading')); ?>
			</h1>
		</div>
	<?php endif; ?>
	<form id="user-registration" action="<?php echo JRoute::_('index.php?option=com_users&task=remind.remind'); ?>" method="post" class="form-validate form-horizontal well">
		<?php foreach ($this->form->getFieldsets() as $fieldset) : ?>
			<fieldset>
				<?php if (isset($fieldset->label)) : ?>
					<p><?php echo JText::_($fieldset->label); ?></p>
				<?php endif; ?>
				<?php echo $this->form->renderFieldset($fieldset->name); ?>
			</fieldset>
		<?php endforeach; ?>
		<div class="control-group">
			<div class="controls">
				<button type="submit" class="btn btn-primary validate">
					<?php echo JText::_('JSUBMIT'); ?>
				</button>
			</div>
		</div>
		<?php echo JHtml::_('form.token'); ?>
	</form>
</div>
PK!~�v'h
h
remind/view.html.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_users
 *
 * @copyright   Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

/**
 * Registration view class for Users.
 *
 * @since  1.5
 */
class UsersViewRemind extends JViewLegacy
{
	protected $form;

	protected $params;

	protected $state;

	/**
	 * Method to display the view.
	 *
	 * @param   string  $tpl  The template file to include
	 *
	 * @return  mixed
	 *
	 * @since   1.5
	 */
	public function display($tpl = null)
	{
		// Get the view data.
		$this->form   = $this->get('Form');
		$this->state  = $this->get('State');
		$this->params = $this->state->params;

		// Check for errors.
		if (count($errors = $this->get('Errors')))
		{
			JError::raiseError(500, implode('<br />', $errors));

			return false;
		}

		// Check for layout override
		$active = JFactory::getApplication()->getMenu()->getActive();

		if (isset($active->query['layout']))
		{
			$this->setLayout($active->query['layout']);
		}

		// Escape strings for HTML output
		$this->pageclass_sfx = htmlspecialchars($this->params->get('pageclass_sfx'), ENT_COMPAT, 'UTF-8');

		$this->prepareDocument();

		parent::display($tpl);
	}

	/**
	 * Prepares the document.
	 *
	 * @return  void
	 *
	 * @since   1.6
	 */
	protected function prepareDocument()
	{
		$app   = JFactory::getApplication();
		$menus = $app->getMenu();
		$title = null;

		// Because the application sets a default page title,
		// we need to get it from the menu item itself
		$menu = $menus->getActive();

		if ($menu)
		{
			$this->params->def('page_heading', $this->params->get('page_title', $menu->title));
		}
		else
		{
			$this->params->def('page_heading', JText::_('COM_USERS_REMIND'));
		}

		$title = $this->params->get('page_title', '');

		if (empty($title))
		{
			$title = $app->get('sitename');
		}
		elseif ($app->get('sitename_pagetitles', 0) == 1)
		{
			$title = JText::sprintf('JPAGETITLE', $app->get('sitename'), $title);
		}
		elseif ($app->get('sitename_pagetitles', 0) == 2)
		{
			$title = JText::sprintf('JPAGETITLE', $title, $app->get('sitename'));
		}

		$this->document->setTitle($title);

		if ($this->params->get('menu-meta_description'))
		{
			$this->document->setDescription($this->params->get('menu-meta_description'));
		}

		if ($this->params->get('menu-meta_keywords'))
		{
			$this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords'));
		}

		if ($this->params->get('robots'))
		{
			$this->document->setMetadata('robots', $this->params->get('robots'));
		}
	}
}
PK!/����profile/view.html.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_users
 *
 * @copyright   Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

/**
 * Profile view class for Users.
 *
 * @since  1.6
 */
class UsersViewProfile extends JViewLegacy
{
	protected $data;

	protected $form;

	protected $params;

	protected $state;

	/**
	 * An instance of JDatabaseDriver.
	 *
	 * @var    JDatabaseDriver
	 * @since  3.6.3
	 */
	protected $db;

	/**
	 * Execute and display a template script.
	 *
	 * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
	 *
	 * @return  mixed   A string if successful, otherwise an Error object.
	 *
	 * @since   1.6
	 */
	public function display($tpl = null)
	{
		$user = JFactory::getUser();

		// Get the view data.
		$this->data	        = $this->get('Data');
		$this->form	        = $this->getModel()->getForm(new JObject(array('id' => $user->id)));
		$this->state            = $this->get('State');
		$this->params           = $this->state->get('params');
		$this->twofactorform    = $this->get('Twofactorform');
		$this->twofactormethods = UsersHelper::getTwoFactorMethods();
		$this->otpConfig        = $this->get('OtpConfig');
		$this->db               = JFactory::getDbo();

		// Check for errors.
		if (count($errors = $this->get('Errors')))
		{
			JError::raiseError(500, implode('<br />', $errors));

			return false;
		}

		// View also takes responsibility for checking if the user logged in with remember me.
		$cookieLogin = $user->get('cookieLogin');

		if (!empty($cookieLogin))
		{
			// If so, the user must login to edit the password and other data.
			// What should happen here? Should we force a logout which destroys the cookies?
			$app = JFactory::getApplication();
			$app->enqueueMessage(JText::_('JGLOBAL_REMEMBER_MUST_LOGIN'), 'message');
			$app->redirect(JRoute::_('index.php?option=com_users&view=login', false));

			return false;
		}

		// Check if a user was found.
		if (!$this->data->id)
		{
			JError::raiseError(404, JText::_('JERROR_USERS_PROFILE_NOT_FOUND'));

			return false;
		}

		JPluginHelper::importPlugin('content');
		$this->data->text = '';
		JEventDispatcher::getInstance()->trigger('onContentPrepare', array ('com_users.user', &$this->data, &$this->data->params, 0));
		unset($this->data->text);

		// Check for layout override
		$active = JFactory::getApplication()->getMenu()->getActive();

		if (isset($active->query['layout']))
		{
			$this->setLayout($active->query['layout']);
		}

		// Escape strings for HTML output
		$this->pageclass_sfx = htmlspecialchars($this->params->get('pageclass_sfx'));

		$this->prepareDocument();

		return parent::display($tpl);
	}

	/**
	 * Prepares the document
	 *
	 * @return  void
	 *
	 * @since   1.6
	 */
	protected function prepareDocument()
	{
		$app   = JFactory::getApplication();
		$menus = $app->getMenu();
		$user  = JFactory::getUser();
		$title = null;

		// Because the application sets a default page title,
		// we need to get it from the menu item itself
		$menu = $menus->getActive();

		if ($menu)
		{
			$this->params->def('page_heading', $this->params->get('page_title', $user->name));
		}
		else
		{
			$this->params->def('page_heading', JText::_('COM_USERS_PROFILE'));
		}

		$title = $this->params->get('page_title', '');

		if (empty($title))
		{
			$title = $app->get('sitename');
		}
		elseif ($app->get('sitename_pagetitles', 0) == 1)
		{
			$title = JText::sprintf('JPAGETITLE', $app->get('sitename'), $title);
		}
		elseif ($app->get('sitename_pagetitles', 0) == 2)
		{
			$title = JText::sprintf('JPAGETITLE', $title, $app->get('sitename'));
		}

		$this->document->setTitle($title);

		if ($this->params->get('menu-meta_description'))
		{
			$this->document->setDescription($this->params->get('menu-meta_description'));
		}

		if ($this->params->get('menu-meta_keywords'))
		{
			$this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords'));
		}

		if ($this->params->get('robots'))
		{
			$this->document->setMetadata('robots', $this->params->get('robots'));
		}
	}
}
PK!��+profile/tmpl/default_core.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_users
 *
 * @copyright   Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

?>
<fieldset id="users-profile-core">
	<legend>
		<?php echo JText::_('COM_USERS_PROFILE_CORE_LEGEND'); ?>
	</legend>
	<dl class="dl-horizontal">
		<dt>
			<?php echo JText::_('COM_USERS_PROFILE_NAME_LABEL'); ?>
		</dt>
		<dd>
			<?php echo $this->escape($this->data->name); ?>
		</dd>
		<dt>
			<?php echo JText::_('COM_USERS_PROFILE_USERNAME_LABEL'); ?>
		</dt>
		<dd>
			<?php echo $this->escape($this->data->username); ?>
		</dd>
		<dt>
			<?php echo JText::_('COM_USERS_PROFILE_REGISTERED_DATE_LABEL'); ?>
		</dt>
		<dd>
			<?php echo JHtml::_('date', $this->data->registerDate, JText::_('DATE_FORMAT_LC1')); ?>
		</dd>
		<dt>
			<?php echo JText::_('COM_USERS_PROFILE_LAST_VISITED_DATE_LABEL'); ?>
		</dt>
		<?php if ($this->data->lastvisitDate != $this->db->getNullDate()) : ?>
			<dd>
				<?php echo JHtml::_('date', $this->data->lastvisitDate, JText::_('DATE_FORMAT_LC1')); ?>
			</dd>
		<?php else : ?>
			<dd>
				<?php echo JText::_('COM_USERS_PROFILE_NEVER_VISITED'); ?>
			</dd>
		<?php endif; ?>
	</dl>
</fieldset>
PK!J���profile/tmpl/edit.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_users
 *
 * @copyright   Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

JHtml::_('behavior.keepalive');
JHtml::_('behavior.formvalidator');
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('bootstrap.tooltip');


// Load user_profile plugin language
$lang = JFactory::getLanguage();
$lang->load('plg_user_profile', JPATH_ADMINISTRATOR);

?>
<div class="profile-edit<?php echo $this->pageclass_sfx; ?>">
	<?php if ($this->params->get('show_page_heading')) : ?>
		<div class="page-header">
			<h1>
				<?php echo $this->escape($this->params->get('page_heading')); ?>
			</h1>
		</div>
	<?php endif; ?>
	<script type="text/javascript">
		Joomla.twoFactorMethodChange = function(e)
		{
			var selectedPane = 'com_users_twofactor_' + jQuery('#jform_twofactor_method').val();

			jQuery.each(jQuery('#com_users_twofactor_forms_container>div'), function(i, el)
			{
				if (el.id != selectedPane)
				{
					jQuery('#' + el.id).hide(0);
				}
				else
				{
					jQuery('#' + el.id).show(0);
				}
			});
		}
	</script>
	<form id="member-profile" action="<?php echo JRoute::_('index.php?option=com_users&task=profile.save'); ?>" method="post" class="form-validate form-horizontal well" enctype="multipart/form-data">
		<?php // Iterate through the form fieldsets and display each one. ?>
		<?php foreach ($this->form->getFieldsets() as $group => $fieldset) : ?>
			<?php $fields = $this->form->getFieldset($group); ?>
			<?php if (count($fields)) : ?>
				<fieldset>
					<?php // If the fieldset has a label set, display it as the legend. ?>
					<?php if (isset($fieldset->label)) : ?>
						<legend>
							<?php echo JText::_($fieldset->label); ?>
						</legend>
					<?php endif; ?>
					<?php if (isset($fieldset->description) && trim($fieldset->description)) : ?>
						<p>
							<?php echo $this->escape(JText::_($fieldset->description)); ?>
						</p>
					<?php endif; ?>
					<?php // Iterate through the fields in the set and display them. ?>
					<?php foreach ($fields as $field) : ?>
						<?php // If the field is hidden, just display the input. ?>
						<?php if ($field->hidden) : ?>
							<?php echo $field->input; ?>
						<?php else : ?>
							<div class="control-group">
								<div class="control-label">
									<?php echo $field->label; ?>
									<?php if (!$field->required && $field->type !== 'Spacer') : ?>
										<span class="optional">
											<?php echo JText::_('COM_USERS_OPTIONAL'); ?>
										</span>
									<?php endif; ?>
								</div>
								<div class="controls">
									<?php if ($field->fieldname === 'password1') : ?>
										<?php // Disables autocomplete ?>
										<input type="password" style="display:none">
									<?php endif; ?>
									<?php echo $field->input; ?>
								</div>
							</div>
						<?php endif; ?>
					<?php endforeach; ?>
				</fieldset>
			<?php endif; ?>
		<?php endforeach; ?>
		<?php if (count($this->twofactormethods) > 1) : ?>
			<fieldset>
				<legend><?php echo JText::_('COM_USERS_PROFILE_TWO_FACTOR_AUTH'); ?></legend>
				<div class="control-group">
					<div class="control-label">
						<label id="jform_twofactor_method-lbl" for="jform_twofactor_method" class="hasTooltip"
							title="<?php echo '<strong>' . JText::_('COM_USERS_PROFILE_TWOFACTOR_LABEL') . '</strong><br />' . JText::_('COM_USERS_PROFILE_TWOFACTOR_DESC'); ?>">
							<?php echo JText::_('COM_USERS_PROFILE_TWOFACTOR_LABEL'); ?>
						</label>
					</div>
					<div class="controls">
						<?php echo JHtml::_('select.genericlist', $this->twofactormethods, 'jform[twofactor][method]', array('onchange' => 'Joomla.twoFactorMethodChange()'), 'value', 'text', $this->otpConfig->method, 'jform_twofactor_method', false); ?>
					</div>
				</div>
				<div id="com_users_twofactor_forms_container">
					<?php foreach ($this->twofactorform as $form) : ?>
						<?php $style = $form['method'] == $this->otpConfig->method ? 'display: block' : 'display: none'; ?>
						<div id="com_users_twofactor_<?php echo $form['method']; ?>" style="<?php echo $style; ?>">
							<?php echo $form['form']; ?>
						</div>
					<?php endforeach; ?>
				</div>
			</fieldset>
			<fieldset>
				<legend>
					<?php echo JText::_('COM_USERS_PROFILE_OTEPS'); ?>
				</legend>
				<div class="alert alert-info">
					<?php echo JText::_('COM_USERS_PROFILE_OTEPS_DESC'); ?>
				</div>
				<?php if (empty($this->otpConfig->otep)) : ?>
					<div class="alert alert-warning">
						<?php echo JText::_('COM_USERS_PROFILE_OTEPS_WAIT_DESC'); ?>
					</div>
				<?php else : ?>
					<?php foreach ($this->otpConfig->otep as $otep) : ?>
						<span class="span3">
							<?php echo substr($otep, 0, 4); ?>-<?php echo substr($otep, 4, 4); ?>-<?php echo substr($otep, 8, 4); ?>-<?php echo substr($otep, 12, 4); ?>
						</span>
					<?php endforeach; ?>
					<div class="clearfix"></div>
				<?php endif; ?>
			</fieldset>
		<?php endif; ?>
		<div class="control-group">
			<div class="controls">
				<button type="submit" class="btn btn-primary validate">
					<?php echo JText::_('JSUBMIT'); ?>
				</button>
				<a class="btn" href="<?php echo JRoute::_('index.php?option=com_users&view=profile'); ?>" title="<?php echo JText::_('JCANCEL'); ?>">
					<?php echo JText::_('JCANCEL'); ?>
				</a>
				<input type="hidden" name="option" value="com_users" />
				<input type="hidden" name="task" value="profile.save" />
			</div>
		</div>
		<?php echo JHtml::_('form.token'); ?>
	</form>
</div>
PK!ݏ�88profile/tmpl/edit.xmlnu�[���<?xml version="1.0" encoding="utf-8"?>
<metadata>
	<layout title="COM_USER_PROFILE_EDIT_DEFAULT_TITLE" option="COM_USER_PROFILE_EDIT_DEFAULT_OPTION">
		<help
			key = "JHELP_MENUS_MENU_ITEM_USER_PROFILE_EDIT"
		/>
		<message>
			<![CDATA[COM_USER_PROFILE_EDIT_DEFAULT_DESC]]>
		</message>
	</layout>
</metadata>
PK!����33profile/tmpl/default_params.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_users
 *
 * @copyright   Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');

?>
<?php $fields = $this->form->getFieldset('params'); ?>
<?php if (count($fields)) : ?>
	<fieldset id="users-profile-custom">
		<legend><?php echo JText::_('COM_USERS_SETTINGS_FIELDSET_LABEL'); ?></legend>
		<dl class="dl-horizontal">
			<?php foreach ($fields as $field) : ?>
				<?php if (!$field->hidden) : ?>
					<dt>
						<?php echo $field->title; ?>
					</dt>
					<dd>
						<?php if (JHtml::isRegistered('users.' . $field->id)) : ?>
							<?php echo JHtml::_('users.' . $field->id, $field->value); ?>
						<?php elseif (JHtml::isRegistered('users.' . $field->fieldname)) : ?>
							<?php echo JHtml::_('users.' . $field->fieldname, $field->value); ?>
						<?php elseif (JHtml::isRegistered('users.' . $field->type)) : ?>
							<?php echo JHtml::_('users.' . $field->type, $field->value); ?>
						<?php else : ?>
							<?php echo JHtml::_('users.value', $field->value); ?>
						<?php endif; ?>
					</dd>
				<?php endif; ?>
			<?php endforeach; ?>
		</dl>
	</fieldset>
<?php endif; ?>
PK!����33profile/tmpl/default.xmlnu�[���<?xml version="1.0" encoding="utf-8"?>
<metadata>
	<layout title="COM_USER_PROFILE_VIEW_DEFAULT_TITLE" option="COM_USER_PROFILE_VIEW_DEFAULT_OPTION">
		<help
			key = "JHELP_MENUS_MENU_ITEM_USER_PROFILE"
		/>
		<message>
			<![CDATA[COM_USER_PROFILE_VIEW_DEFAULT_DESC]]>
		</message>
	</layout>
</metadata>
PK!�!]��	�	profile/tmpl/default_custom.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_users
 *
 * @copyright   Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
JHtml::register('users.spacer', array('JHtmlUsers', 'spacer'));

$fieldsets = $this->form->getFieldsets();

if (isset($fieldsets['core']))
{
	unset($fieldsets['core']);
}

if (isset($fieldsets['params']))
{
	unset($fieldsets['params']);
}

$tmp          = isset($this->data->jcfields) ? $this->data->jcfields : array();
$customFields = array();

foreach ($tmp as $customField)
{
	$customFields[$customField->name] = $customField;
}

?>
<?php foreach ($fieldsets as $group => $fieldset) : ?>
	<?php $fields = $this->form->getFieldset($group); ?>
	<?php if (count($fields)) : ?>
		<fieldset id="users-profile-custom-<?php echo $group; ?>" class="users-profile-custom-<?php echo $group; ?>">
			<?php if (isset($fieldset->label) && ($legend = trim(JText::_($fieldset->label))) !== '') : ?>
				<legend><?php echo $legend; ?></legend>
			<?php endif; ?>
			<?php if (isset($fieldset->description) && trim($fieldset->description)) : ?>
				<p><?php echo $this->escape(JText::_($fieldset->description)); ?></p>
			<?php endif; ?>
			<dl class="dl-horizontal">
				<?php foreach ($fields as $field) : ?>
					<?php if (!$field->hidden && $field->type !== 'Spacer') : ?>
						<dt>
							<?php echo $field->title; ?>
						</dt>
						<dd>
							<?php if (key_exists($field->fieldname, $customFields)) : ?>
								<?php echo strlen($customFields[$field->fieldname]->value) ? $customFields[$field->fieldname]->value : JText::_('COM_USERS_PROFILE_VALUE_NOT_FOUND'); ?>
							<?php elseif (JHtml::isRegistered('users.' . $field->id)) : ?>
								<?php echo JHtml::_('users.' . $field->id, $field->value); ?>
							<?php elseif (JHtml::isRegistered('users.' . $field->fieldname)) : ?>
								<?php echo JHtml::_('users.' . $field->fieldname, $field->value); ?>
							<?php elseif (JHtml::isRegistered('users.' . $field->type)) : ?>
								<?php echo JHtml::_('users.' . $field->type, $field->value); ?>
							<?php else : ?>
								<?php echo JHtml::_('users.value', $field->value); ?>
							<?php endif; ?>
						</dd>
					<?php endif; ?>
				<?php endforeach; ?>
			</dl>
		</fieldset>
	<?php endif; ?>
<?php endforeach; ?>
PK!|�_##profile/tmpl/default.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_users
 *
 * @copyright   Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

?>
<div class="profile<?php echo $this->pageclass_sfx; ?>">
	<?php if ($this->params->get('show_page_heading')) : ?>
		<div class="page-header">
			<h1>
				<?php echo $this->escape($this->params->get('page_heading')); ?>
			</h1>
		</div>
	<?php endif; ?>
	<?php if (JFactory::getUser()->id == $this->data->id) : ?>
		<ul class="btn-toolbar pull-right">
			<li class="btn-group">
				<a class="btn" href="<?php echo JRoute::_('index.php?option=com_users&task=profile.edit&user_id=' . (int) $this->data->id); ?>">
					<span class="icon-user"></span>
					<?php echo JText::_('COM_USERS_EDIT_PROFILE'); ?>
				</a>
			</li>
		</ul>
	<?php endif; ?>
	<?php echo $this->loadTemplate('core'); ?>
	<?php echo $this->loadTemplate('params'); ?>
	<?php echo $this->loadTemplate('custom'); ?>
</div>
PK!Vz�9��login/view.html.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_users
 *
 * @copyright   Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

/**
 * Login view class for Users.
 *
 * @since  1.5
 */
class UsersViewLogin extends JViewLegacy
{
	protected $form;

	protected $params;

	protected $state;

	protected $user;

	/**
	 * Method to display the view.
	 *
	 * @param   string  $tpl  The name of the template file to parse; automatically searches through the template paths.
	 *
	 * @return  mixed  A string if successful, otherwise an Error object.
	 *
	 * @since   1.5
	 */
	public function display($tpl = null)
	{
		// Get the view data.
		$this->user   = JFactory::getUser();
		$this->form   = $this->get('Form');
		$this->state  = $this->get('State');
		$this->params = $this->state->get('params');

		// Check for errors.
		if (count($errors = $this->get('Errors')))
		{
			JError::raiseError(500, implode('<br />', $errors));

			return false;
		}

		// Check for layout override
		$active = JFactory::getApplication()->getMenu()->getActive();

		if (isset($active->query['layout']))
		{
			$this->setLayout($active->query['layout']);
		}

		$tfa = JAuthenticationHelper::getTwoFactorMethods();
		$this->tfa = is_array($tfa) && count($tfa) > 1;

		// Escape strings for HTML output
		$this->pageclass_sfx = htmlspecialchars($this->params->get('pageclass_sfx'), ENT_COMPAT, 'UTF-8');

		$this->prepareDocument();

		parent::display($tpl);
	}

	/**
	 * Prepares the document
	 *
	 * @return  void
	 *
	 * @since   1.6
	 */
	protected function prepareDocument()
	{
		$app   = JFactory::getApplication();
		$menus = $app->getMenu();
		$user  = JFactory::getUser();
		$login = $user->get('guest') ? true : false;
		$title = null;

		// Because the application sets a default page title,
		// we need to get it from the menu item itself
		$menu = $menus->getActive();

		if ($menu)
		{
			$this->params->def('page_heading', $this->params->get('page_title', $menu->title));
		}
		else
		{
			$this->params->def('page_heading', $login ? JText::_('JLOGIN') : JText::_('JLOGOUT'));
		}

		$title = $this->params->get('page_title', '');

		if (empty($title))
		{
			$title = $app->get('sitename');
		}
		elseif ($app->get('sitename_pagetitles', 0) == 1)
		{
			$title = JText::sprintf('JPAGETITLE', $app->get('sitename'), $title);
		}
		elseif ($app->get('sitename_pagetitles', 0) == 2)
		{
			$title = JText::sprintf('JPAGETITLE', $title, $app->get('sitename'));
		}

		$this->document->setTitle($title);

		if ($this->params->get('menu-meta_description'))
		{
			$this->document->setDescription($this->params->get('menu-meta_description'));
		}

		if ($this->params->get('menu-meta_keywords'))
		{
			$this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords'));
		}

		if ($this->params->get('robots'))
		{
			$this->document->setMetadata('robots', $this->params->get('robots'));
		}
	}
}
PK!	(v��login/tmpl/default_login.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_users
 *
 * @copyright   Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

JHtml::_('behavior.keepalive');
JHtml::_('behavior.formvalidator');

?>
<div class="login<?php echo $this->pageclass_sfx; ?>">
	<?php if ($this->params->get('show_page_heading')) : ?>
		<div class="page-header">
			<h1>
				<?php echo $this->escape($this->params->get('page_heading')); ?>
			</h1>
		</div>
	<?php endif; ?>
	<?php if (($this->params->get('logindescription_show') == 1 && str_replace(' ', '', $this->params->get('login_description')) != '') || $this->params->get('login_image') != '') : ?>
		<div class="login-description">
	<?php endif; ?>
	<?php if ($this->params->get('logindescription_show') == 1) : ?>
		<?php echo $this->params->get('login_description'); ?>
	<?php endif; ?>
	<?php if ($this->params->get('login_image') != '') : ?>
		<img src="<?php echo $this->escape($this->params->get('login_image')); ?>" class="login-image" alt="<?php echo JText::_('COM_USERS_LOGIN_IMAGE_ALT'); ?>" />
	<?php endif; ?>
	<?php if (($this->params->get('logindescription_show') == 1 && str_replace(' ', '', $this->params->get('login_description')) != '') || $this->params->get('login_image') != '') : ?>
		</div>
	<?php endif; ?>
	<form action="<?php echo JRoute::_('index.php?option=com_users&task=user.login'); ?>" method="post" class="form-validate form-horizontal well">
		<fieldset>
			<?php echo $this->form->renderFieldset('credentials'); ?>
			<?php if ($this->tfa) : ?>
				<?php echo $this->form->renderField('secretkey'); ?>
			<?php endif; ?>
			<?php if (JPluginHelper::isEnabled('system', 'remember')) : ?>
				<div class="control-group">
					<div class="control-label">
						<label for="remember">
							<?php echo JText::_('COM_USERS_LOGIN_REMEMBER_ME'); ?>
						</label>
					</div>
					<div class="controls">
						<input id="remember" type="checkbox" name="remember" class="inputbox" value="yes" />
					</div>
				</div>
			<?php endif; ?>
			<div class="control-group">
				<div class="controls">
					<button type="submit" class="btn btn-primary">
						<?php echo JText::_('JLOGIN'); ?>
					</button>
				</div>
			</div>
			<?php $return = $this->form->getValue('return', '', $this->params->get('login_redirect_url', $this->params->get('login_redirect_menuitem'))); ?>
			<input type="hidden" name="return" value="<?php echo base64_encode($return); ?>" />
			<?php echo JHtml::_('form.token'); ?>
		</fieldset>
	</form>
</div>
<div>
	<ul class="nav nav-tabs nav-stacked">
		<li>
			<a href="<?php echo JRoute::_('index.php?option=com_users&view=reset'); ?>">
				<?php echo JText::_('COM_USERS_LOGIN_RESET'); ?>
			</a>
		</li>
		<li>
			<a href="<?php echo JRoute::_('index.php?option=com_users&view=remind'); ?>">
				<?php echo JText::_('COM_USERS_LOGIN_REMIND'); ?>
			</a>
		</li>
		<?php $usersConfig = JComponentHelper::getParams('com_users'); ?>
		<?php if ($usersConfig->get('allowUserRegistration')) : ?>
			<li>
				<a href="<?php echo JRoute::_('index.php?option=com_users&view=registration'); ?>">
					<?php echo JText::_('COM_USERS_LOGIN_REGISTER'); ?>
				</a>
			</li>
		<?php endif; ?>
	</ul>
</div>
PK!�����login/tmpl/default_logout.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_users
 *
 * @copyright   Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

?>
<div class="logout<?php echo $this->pageclass_sfx; ?>">
	<?php if ($this->params->get('show_page_heading')) : ?>
		<div class="page-header">
			<h1>
				<?php echo $this->escape($this->params->get('page_heading')); ?>
			</h1>
		</div>
	<?php endif; ?>
	<?php if (($this->params->get('logoutdescription_show') == 1 && str_replace(' ', '', $this->params->get('logout_description')) != '')|| $this->params->get('logout_image') != '') : ?>
		<div class="logout-description">
	<?php endif; ?>
	<?php if ($this->params->get('logoutdescription_show') == 1) : ?>
		<?php echo $this->params->get('logout_description'); ?>
	<?php endif; ?>
	<?php if ($this->params->get('logout_image') != '') : ?>
		<img src="<?php echo $this->escape($this->params->get('logout_image')); ?>" class="thumbnail pull-right logout-image" alt="<?php echo JText::_('COM_USER_LOGOUT_IMAGE_ALT'); ?>" />
	<?php endif; ?>
	<?php if (($this->params->get('logoutdescription_show') == 1 && str_replace(' ', '', $this->params->get('logout_description')) != '')|| $this->params->get('logout_image') != '') : ?>
		</div>
	<?php endif; ?>
	<form action="<?php echo JRoute::_('index.php?option=com_users&task=user.logout'); ?>" method="post" class="form-horizontal well">
		<div class="control-group">
			<div class="controls">
				<button type="submit" class="btn btn-primary">
					<span class="icon-arrow-left icon-white"></span>
					<?php echo JText::_('JLOGOUT'); ?>
				</button>
			</div>
		</div>
		<?php if ($this->params->get('logout_redirect_url')) : ?>
			<input type="hidden" name="return" value="<?php echo base64_encode($this->params->get('logout_redirect_url', $this->form->getValue('return'))); ?>" />
		<?php else : ?>
			<input type="hidden" name="return" value="<?php echo base64_encode($this->params->get('logout_redirect_menuitem', $this->form->getValue('return'))); ?>" />
		<?php endif; ?>
		<?php echo JHtml::_('form.token'); ?>
	</form>
</div>
PK!¿�.��login/tmpl/logout.xmlnu�[���<?xml version="1.0" encoding="utf-8"?>
<metadata>
	<layout title="COM_USER_LOGOUT_VIEW_DEFAULT_TITLE" option="COM_USER_LOGOUT_VIEW_DEFAULT_OPTION">
		<help key = "JHELP_MENUS_MENU_ITEM_USER_LOGOUT"/>
		<message>
			<![CDATA[COM_USER_LOGOUT_VIEW_DEFAULT_DESC]]>
		</message>
	</layout>

	<!-- Add fields to the request variables for the layout. -->
	<fields name="request">
		<fieldset name="request">
			<field
				name="task"
				type="hidden"
				default="user.menulogout"
			/>
		</fieldset>
	</fields>

	<!-- Add fields to the parameters object for the layout. -->
	<fields name="params">
		<fieldset name="basic" label="COM_MENUS_BASIC_FIELDSET_LABEL">
			<field
				name="logout"
				type="modal_menu"
				label="JFIELD_LOGOUT_REDIRECT_PAGE_LABEL"
				description="JFIELD_LOGOUT_REDIRECT_PAGE_DESC"
				disable="separator,alias,heading,url"
				select="true"
				new="true"
				edit="true"
				clear="true"
				>
				<option value="">JDEFAULT</option>
			</field>
		</fieldset>
	</fields>
</metadata>
PK!��bR**login/tmpl/default.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_users
 *
 * @copyright   Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

$cookieLogin = $this->user->get('cookieLogin');

if (!empty($cookieLogin) || $this->user->get('guest'))
{
	// The user is not logged in or needs to provide a password.
	echo $this->loadTemplate('login');
}
else
{
	// The user is already logged in.
	echo $this->loadTemplate('logout');
}
PK!?��|GGlogin/tmpl/default.xmlnu�[���<?xml version="1.0" encoding="utf-8"?>
<metadata>
	<layout title="COM_USER_LOGIN_VIEW_DEFAULT_TITLE" option="COM_USER_LOGIN_VIEW_DEFAULT_OPTION">
		<help
			key = "JHELP_MENUS_MENU_ITEM_USER_LOGIN"
		/>
		<message>
			<![CDATA[COM_USER_LOGIN_VIEW_DEFAULT_DESC]]>
		</message>
	</layout>

	<!-- Add fields to the parameters object for the layout. -->
	<fields name="params">

		<!-- Basic options. -->
		<fieldset name="basic" addrulepath="components/com_users/models/rules" label="COM_MENUS_BASIC_FIELDSET_LABEL">

		<field
			name="loginredirectchoice"
			type="radio"
			label="COM_USERS_FIELD_LOGIN_REDIRECT_CHOICE_LABEL"
			description="COM_USERS_FIELD_LOGIN_REDIRECT_CHOICE_DESC"
			class="btn-group btn-group-yesno"
			default="1"
			>
			<option value="1">COM_USERS_FIELD_LOGIN_MENUITEM</option>
			<option value="0">COM_USERS_FIELD_LOGIN_URL</option>
		</field>

		<field
			name="login_redirect_url"
			type="text"
			label="JFIELD_LOGIN_REDIRECT_URL_LABEL"
			description="JFIELD_LOGIN_REDIRECT_URL_DESC"
			class="inputbox"
			validate="loginuniquefield"
			field="login_redirect_menuitem"
			hint="COM_USERS_FIELD_LOGIN_REDIRECT_PLACEHOLDER"
			message="COM_USERS_FIELD_LOGIN_REDIRECT_ERROR"
			showon="loginredirectchoice:0"
		/>

		<field
			name="login_redirect_menuitem"
			type="modal_menu"
			label="COM_USERS_FIELD_LOGIN_REDIRECTMENU_LABEL"
			description="COM_USERS_FIELD_LOGIN_REDIRECTMENU_DESC"
			disable="separator,alias,heading,url"
			showon="loginredirectchoice:1"
			select="true"
			new="true"
			edit="true"
			clear="true"
			>
			<option value="">JDEFAULT</option>
		</field>

		<field
			name="logindescription_show"
			type="list"
			label="JFIELD_BASIS_LOGIN_DESCRIPTION_SHOW_LABEL"
			description="JFIELD_BASIS_LOGIN_DESCRIPTION_SHOW_DESC"
			default="1"
			class="chzn-color"
			>
			<option value="0">JHIDE</option>
			<option value="1">JSHOW</option>
		</field>

		<field
			name="login_description"
			type="textarea"
			label="JFIELD_BASIS_LOGIN_DESCRIPTION_LABEL"
			description="JFIELD_BASIS_LOGIN_DESCRIPTION_DESC"
			rows="3"
			cols="40"
			filter="safehtml"
			showon="logindescription_show:1"
		/>

		<field
			name="login_image"
			type="media"
			label="JFIELD_LOGIN_IMAGE_LABEL"
			description="JFIELD_LOGIN_IMAGE_DESC"
		/>

		<field 
			name="spacer1" 
			type="spacer"
			hr="true"
		/>

		<field
			name="logoutredirectchoice"
			type="radio"
			label="COM_USERS_FIELD_LOGOUT_REDIRECT_CHOICE_LABEL"
			description="COM_USERS_FIELD_LOGOUT_REDIRECT_CHOICE_DESC"
			class="btn-group btn-group-yesno"
			default="1"
			>
			<option value="1">COM_USERS_FIELD_LOGIN_MENUITEM</option>
			<option value="0">COM_USERS_FIELD_LOGIN_URL</option>
		</field>

		<field
			name="logout_redirect_url"
			type="text"
			label="JFIELD_LOGOUT_REDIRECT_URL_LABEL"
			description="JFIELD_LOGOUT_REDIRECT_URL_DESC"
			class="inputbox"
			field="logout_redirect_menuitem"
			validate="logoutuniquefield"
			hint="COM_USERS_FIELD_LOGIN_REDIRECT_PLACEHOLDER"
			message="COM_USERS_FIELD_LOGOUT_REDIRECT_ERROR"
			showon="logoutredirectchoice:0"
		/>
		
		<field
			name="logout_redirect_menuitem"
			type="modal_menu"
			label="COM_USERS_FIELD_LOGOUT_REDIRECTMENU_LABEL"
			description="COM_USERS_FIELD_LOGOUT_REDIRECTMENU_DESC"
			disable="separator,alias,heading,url"
			showon="logoutredirectchoice:1"
			select="true"
			new="true"
			edit="true"
			clear="true"
			>
			<option value="">JDEFAULT</option>
		</field>

		<field
			name="logoutdescription_show"
			type="list"
			label="JFIELD_BASIS_LOGOUT_DESCRIPTION_SHOW_LABEL"
			description="JFIELD_BASIS_LOGOUT_DESCRIPTION_SHOW_DESC"
			default="1"
			class="chzn-color"
			>
			<option value="0">JHIDE</option>
			<option value="1">JSHOW</option>
		</field>

		<field
			name="logout_description"
			type="textarea"
			label="JFIELD_BASIS_LOGOUT_DESCRIPTION_LABEL"
			description="JFIELD_BASIS_LOGOUT_DESCRIPTION_DESC"
			rows="3"
			cols="40"
			filter="safehtml"
			showon="logoutdescription_show:1"
		/>

		<field
			name="logout_image"
			type="media"
			label="JFIELD_LOGOUT_IMAGE_LABEL"
			description="JFIELD_LOGOUT_IMAGE_DESC"
		/>

		</fieldset>
	</fields>
</metadata>
PK!ڕ��
�
registration/view.html.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_users
 *
 * @copyright   Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

/**
 * Registration view class for Users.
 *
 * @since  1.6
 */
class UsersViewRegistration extends JViewLegacy
{
	protected $data;

	protected $form;

	protected $params;

	protected $state;

	public $document;

	/**
	 * Method to display the view.
	 *
	 * @param   string  $tpl  The template file to include
	 *
	 * @return  mixed
	 *
	 * @since   1.6
	 */
	public function display($tpl = null)
	{
		// Get the view data.
		$this->form   = $this->get('Form');
		$this->data   = $this->get('Data');
		$this->state  = $this->get('State');
		$this->params = $this->state->get('params');

		// Check for errors.
		if (count($errors = $this->get('Errors')))
		{
			JError::raiseError(500, implode('<br />', $errors));

			return false;
		}

		// Check for layout override
		$active = JFactory::getApplication()->getMenu()->getActive();

		if (isset($active->query['layout']))
		{
			$this->setLayout($active->query['layout']);
		}

		// Escape strings for HTML output
		$this->pageclass_sfx = htmlspecialchars($this->params->get('pageclass_sfx'), ENT_COMPAT, 'UTF-8');

		$this->prepareDocument();

		return parent::display($tpl);
	}

	/**
	 * Prepares the document.
	 *
	 * @return  void
	 *
	 * @since   1.6
	 */
	protected function prepareDocument()
	{
		$app   = JFactory::getApplication();
		$menus = $app->getMenu();
		$title = null;

		// Because the application sets a default page title,
		// we need to get it from the menu item itself
		$menu = $menus->getActive();

		if ($menu)
		{
			$this->params->def('page_heading', $this->params->get('page_title', $menu->title));
		}
		else
		{
			$this->params->def('page_heading', JText::_('COM_USERS_REGISTRATION'));
		}

		$title = $this->params->get('page_title', '');

		if (empty($title))
		{
			$title = $app->get('sitename');
		}
		elseif ($app->get('sitename_pagetitles', 0) == 1)
		{
			$title = JText::sprintf('JPAGETITLE', $app->get('sitename'), $title);
		}
		elseif ($app->get('sitename_pagetitles', 0) == 2)
		{
			$title = JText::sprintf('JPAGETITLE', $title, $app->get('sitename'));
		}

		$this->document->setTitle($title);

		if ($this->params->get('menu-meta_description'))
		{
			$this->document->setDescription($this->params->get('menu-meta_description'));
		}

		if ($this->params->get('menu-meta_keywords'))
		{
			$this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords'));
		}

		if ($this->params->get('robots'))
		{
			$this->document->setMetadata('robots', $this->params->get('robots'));
		}
	}
}
PK!��B�EEregistration/tmpl/default.xmlnu�[���<?xml version="1.0" encoding="utf-8"?>
<metadata>
	<layout title="COM_USER_REGISTRATION_VIEW_DEFAULT_TITLE" option="COM_USER_REGISTRATION_VIEW_DEFAULT_OPTION">
		<help
			key="JHELP_MENUS_MENU_ITEM_USER_REGISTRATION"
		/>
		<message>
			<![CDATA[COM_USER_REGISTRATION_VIEW_DEFAULT_DESC]]>
		</message>
	</layout>
</metadata>
PK!�g�ppregistration/tmpl/default.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_users
 *
 * @copyright   Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

JHtml::_('behavior.keepalive');
JHtml::_('behavior.formvalidator');

?>
<div class="registration<?php echo $this->pageclass_sfx; ?>">
	<?php if ($this->params->get('show_page_heading')) : ?>
		<div class="page-header">
			<h1><?php echo $this->escape($this->params->get('page_heading')); ?></h1>
		</div>
	<?php endif; ?>
	<form id="member-registration" action="<?php echo JRoute::_('index.php?option=com_users&task=registration.register'); ?>" method="post" class="form-validate form-horizontal well" enctype="multipart/form-data">
		<?php // Iterate through the form fieldsets and display each one. ?>
		<?php foreach ($this->form->getFieldsets() as $fieldset) : ?>
			<?php $fields = $this->form->getFieldset($fieldset->name); ?>
			<?php if (count($fields)) : ?>
				<fieldset>
					<?php // If the fieldset has a label set, display it as the legend. ?>
					<?php if (isset($fieldset->label)) : ?>
						<legend><?php echo JText::_($fieldset->label); ?></legend>
					<?php endif; ?>
					<?php echo $this->form->renderFieldset($fieldset->name); ?>
				</fieldset>
			<?php endif; ?>
		<?php endforeach; ?>
		<div class="control-group">
			<div class="controls">
				<button type="submit" class="btn btn-primary validate">
					<?php echo JText::_('JREGISTER'); ?>
				</button>
				<a class="btn" href="<?php echo JRoute::_(''); ?>" title="<?php echo JText::_('JCANCEL'); ?>">
					<?php echo JText::_('JCANCEL'); ?>
				</a>
				<input type="hidden" name="option" value="com_users" />
				<input type="hidden" name="task" value="registration.register" />
			</div>
		</div>
		<?php echo JHtml::_('form.token'); ?>
	</form>
</div>
PK!פ?��registration/tmpl/complete.phpnu�[���<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_users
 *
 * @copyright   Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

?>
<div class="registration-complete<?php echo $this->pageclass_sfx; ?>">
	<?php if ($this->params->get('show_page_heading')) : ?>
		<h1>
			<?php echo $this->escape($this->params->get('page_heading')); ?>
		</h1>
	<?php endif; ?>
</div>
PK!Q�/���comments/view.html.phpnu&1i�<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

jimport('joomla.application.component.view');

class K2ViewComments extends K2View
{

	function report($tpl = null)
	{
		JTable::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR.'/tables');
		$row = JTable::getInstance('K2Comment', 'Table');
		$row->load(JRequest::getInt('commentID'));
		if (!$row->published)
		{
			JError::raiseError(404, JText::_('K2_NOT_FOUND'));
		}
		$this->assignRef('row', $row);
		$user = JFactory::getUser();
		$this->assignRef('user', $user);
		$params = K2HelperUtilities::getParams('com_k2');
		if (!$params->get('comments') || !$params->get('commentsReporting') || ($params->get('commentsReporting') == '2' && $user->guest))
		{
			JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
		}
		// Pass the old parameter to the view in order to avoid layout changes
		if ($params->get('antispam') == 'recaptcha' || $params->get('antispam') == 'both')
		{
			$params->set('recaptcha', true);
		}
		else
		{
			$params->set('recaptcha', false);
		}

		$this->assignRef('params', $params);
		if ($params->get('recaptcha') && $user->guest)
		{
			$document = JFactory::getDocument();
			if($params->get('recaptchaV2')) {
				$document->addScript('https://www.google.com/recaptcha/api.js?onload=onK2RecaptchaLoaded&render=explicit');
				$js = 'function onK2RecaptchaLoaded(){grecaptcha.render("recaptcha", {"sitekey" : "'.$params->get('recaptcha_public_key').'"});}';
				$document->addScriptDeclaration($js);
				$this->recaptchaClass = 'k2-recaptcha-v2';
			}
			else
			{
				$document->addScript('https://www.google.com/recaptcha/api/js/recaptcha_ajax.js');
				$js = '
				function showRecaptcha(){
					Recaptcha.create("'.$params->get('recaptcha_public_key').'", "recaptcha", {
						theme: "'.$params->get('recaptcha_theme', 'clean').'"
					});
				}
				$K2(window).load(function() {
					showRecaptcha();
				});
				';
				$document->addScriptDeclaration($js);
				$this->recaptchaClass = 'k2-recaptcha-v1';
			}

		}

		parent::display($tpl);
	}

}
PK!5�FFcomments/tmpl/report.phpnu&1i�<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

?>

<div class="k2ReportCommentFormContainer">
	<h2 class="componentheading">
		<?php echo JText::_('K2_REPORT_COMMENT'); ?>
	</h2>
	<blockquote class="commentPreview">
		<span class="quoteIconLeft">&ldquo;</span>
		<span class="theComment"><?php echo nl2br($this->row->commentText); ?></span>
		<span class="quoteIconRight">&rdquo;</span>
	</blockquote>
	<form action="<?php echo JURI::root(true); ?>/index.php" name="k2ReportCommentForm" id="k2ReportCommentForm" method="post">
		<label for="name"><?php echo JText::_('K2_YOUR_NAME'); ?></label>
		<input type="text" id="name" name="name" value="" />

		<label for="reportReason"><?php echo JText::_('K2_REPORT_REASON'); ?></label>
		<textarea name="reportReason" id="reportReason" cols="60" rows="10"></textarea>

		<?php if($this->params->get('recaptcha') && $this->user->guest): ?>
		<?php if(!$this->params->get('recaptchaV2')): ?>
		<label class="formRecaptcha"><?php echo JText::_('K2_ENTER_THE_TWO_WORDS_YOU_SEE_BELOW'); ?></label>
		<?php endif; ?>
		<div id="recaptcha" class="<?php echo $this->recaptchaClass; ?>"></div>
		<?php endif; ?>

		<button class="button"><?php echo JText::_('K2_SEND_REPORT'); ?></button>

		<span id="formLog"></span>

		<input type="hidden" name="option" value="com_k2" />
		<input type="hidden" name="view" value="comments" />
		<input type="hidden" name="task" value="sendReport" />
		<input type="hidden" name="id" value="<?php echo $this->row->id; ?>" />
		<input type="hidden" name="format" value="raw" />
		<?php echo JHTML::_('form.token'); ?>
	</form>
</div>
PK!���ggcomments/metadata.xmlnu&1i�<?xml version="1.0" encoding="utf-8"?>
<metadata>
  <view title="Comments" hidden="true"/>
</metadata>
PK!:�źXFXFitemlist/view.json.phpnu&1i�<?php
/**
 * @version     2.9.x
 * @package     K2
 * @author      JoomlaWorks https://www.joomlaworks.net
 * @copyright   Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license     GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

jimport('joomla.application.component.view');

class K2ViewItemlist extends K2View
{
    public function display($tpl = null)
    {
        $application = JFactory::getApplication();
        $params = K2HelperUtilities::getParams('com_k2');
        $document = JFactory::getDocument();
        if (K2_JVERSION == '15') {
            $document->setMimeEncoding('application/json');
            $document->setType('json');
        }
        $model = $this->getModel('itemlist');

        // Set limit for model
        $limit = JRequest::getInt('limit');
        if ($limit > 100 || $limit == 0) {
            $limit = 100;
            JRequest::setVar('limit', $limit);
        }
        $page = JRequest::getInt('page');
        if ($page <= 0) {
            $limitstart = 0;
        } else {
            $page--;
            $limitstart = $page * $limit;
        }
        JRequest::setVar('limitstart', $limitstart);

        $view = JRequest::getWord('view');
        $task = JRequest::getWord('task');

        $response = new JObject();
        unset($response->_errors);

        // Site
        $response->site = new stdClass();
        $uri = JURI::getInstance();
        $response->site->url = $uri->toString(array('scheme', 'host', 'port'));
        $config = JFactory::getConfig();
        $response->site->name = K2_JVERSION == '30' ? $config->get('sitename') : $config->getValue('config.sitename');

        $moduleID = JRequest::getInt('moduleID');
        if ($moduleID) {
            $result = $model->getModuleItems($moduleID);
            $items = $result->items;
            $title = $result->title;
            $prefix = 'cat';
        } else {

            // Get data depending on task
            switch ($task) {

                case 'category':
                    // Get category
                    $id = JRequest::getInt('id');
                    JTable::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR.'/tables');
                    $category = JTable::getInstance('K2Category', 'Table');
                    $category->load($id);

                    // State Check
                    if (!$category->published || $category->trash) {
                        JError::raiseError(404, JText::_('K2_CATEGORY_NOT_FOUND'));
                    }

                    // Access check
                    $user = JFactory::getUser();
                    if (K2_JVERSION != '15') {
                        if (!in_array($category->access, $user->getAuthorisedViewLevels())) {
                            JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
                        }
                        $languageFilter = $application->getLanguageFilter();
                        $languageTag = JFactory::getLanguage()->getTag();
                        if ($languageFilter && $category->language != $languageTag && $category->language != '*') {
                            return;
                        }
                    } else {
                        if ($category->access > $user->get('aid', 0)) {
                            JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
                        }
                    }

                    // Merge params
                    $cparams = class_exists('JParameter') ? new JParameter($category->params) : new JRegistry($category->params);
                    if ($cparams->get('inheritFrom')) {
                        $masterCategory = JTable::getInstance('K2Category', 'Table');
                        $masterCategory->load($cparams->get('inheritFrom'));
                        $cparams = class_exists('JParameter') ? new JParameter($masterCategory->params) : new JRegistry($masterCategory->params);
                    }
                    $params->merge($cparams);

                    // Category link
                    $category->link = urldecode(JRoute::_(K2HelperRoute::getCategoryRoute($category->id.':'.urlencode($category->alias))));

                    // Category image
                    $category->image = K2HelperUtilities::getCategoryImage($category->image, $params);

                    // Category plugins
                    $dispatcher = JDispatcher::getInstance();
                    JPluginHelper::importPlugin('content');
                    $category->text = $category->description;

                    if (K2_JVERSION != '15') {
                        $dispatcher->trigger('onContentPrepare', array('com_k2.category', &$category, &$params, $limitstart));
                    } else {
                        $dispatcher->trigger('onPrepareContent', array(&$category, &$params, $limitstart));
                    }

                    $category->description = $category->text;

                    // Category K2 plugins
                    $category->event = new stdClass;
                    $category->event->K2CategoryDisplay = '';
                    JPluginHelper::importPlugin('k2');
                    $results = $dispatcher->trigger('onK2CategoryDisplay', array(&$category, &$params, $limitstart));
                    $category->event->K2CategoryDisplay = trim(implode("\n", $results));
                    $category->text = $category->description;
                    $dispatcher->trigger('onK2PrepareContent', array(&$category, &$params, $limitstart));
                    $category->description = $category->text;

                    //Category children
                    $ordering = $params->get('subCatOrdering');
                    $children = $model->getCategoryFirstChildren($id, $ordering);
                    $subCategories = array();
                    if (count($children)) {
                        foreach ($children as $child) {
                            if ($params->get('subCatTitleItemCounter')) {
                                $child->numOfItems = $model->countCategoryItems($child->id);
                            }
                            $child->image = K2HelperUtilities::getCategoryImage($child->image, $params);
                            $child->link = urldecode(JRoute::_(K2HelperRoute::getCategoryRoute($child->id.':'.urlencode($child->alias))));
                            unset($child->params);
                            unset($child->access);
                            unset($child->published);
                            unset($child->trash);
                            unset($child->language);
                            $subCategories[] = $child;
                        }
                    }

                    // Set featured flag
                    JRequest::setVar('featured', $params->get('catFeaturedItems'));

                    // Set title
                    $title = $category->name;

                    // Set ordering
                    if ($params->get('singleCatOrdering')) {
                        $ordering = $params->get('singleCatOrdering');
                    } else {
                        $ordering = $params->get('catOrdering');
                    }

                    // Set parameters prefix
                    $prefix = 'cat';

                    // Prepare the JSON category object;
                    $row = new JObject();
                    unset($row->_errors);
                    $row->id = $category->id;
                    $row->alias = $category->alias;
                    $row->link = $category->link;
                    $row->name = $category->name;
                    $row->description = $category->description;
                    $row->image = $category->image;
                    $row->extraFieldsGroup = $category->extraFieldsGroup;
                    $row->ordering = $category->ordering;
                    $row->parent = $category->parent;
                    $row->children = $subCategories;
                    $row->events = $category->event;
                    //$row->plugins = $category->plugins;

                    $response->category = $row;
                    break;

                case 'user':
                    // Get user
                    $id = JRequest::getInt('id');
                    $userObject = JFactory::getUser($id);

                    // Check user status
                    if ($userObject->block) {
                        JError::raiseError(404, JText::_('K2_USER_NOT_FOUND'));
                    }

                    // Get K2 user profile
                    $userObject->profile = $model->getUserProfile();

                    // User image
                    $userObject->avatar = K2HelperUtilities::getAvatar($userObject->id, $userObject->email, $params->get('userImageWidth'));

                    // User K2 plugins
                    $userObject->event->K2UserDisplay = '';
                    if (is_object($userObject->profile) && $userObject->profile->id > 0) {
                        $dispatcher = JDispatcher::getInstance();
                        JPluginHelper::importPlugin('k2');
                        $results = $dispatcher->trigger('onK2UserDisplay', array(&$userObject->profile, &$params, $limitstart));
                        $userObject->event->K2UserDisplay = trim(implode("\n", $results));
                        $userObject->profile->url = htmlspecialchars($userObject->profile->url, ENT_QUOTES, 'UTF-8');
                    }

                    // Set title
                    $title = $userObject->name;

                    // Set ordering
                    $ordering = $params->get('userOrdering');

                    // Set parameters prefix
                    $prefix = 'user';

                    // Prepare the JSON user object;
                    $row = new JObject();
                    unset($row->_errors);
                    //$row->id = $userObject->id;
                    $row->name = $userObject->name;
                    //$row->username = $userObject->username;
                    $row->profile = $userObject->profile;
                    if (isset($userObject->profile->plugins)) {
                        unset($userObject->profile->plugins);
                    }
                    $row->avatar = $userObject->avatar;
                    $row->events = $userObject->event;

                    $response->user = $row;
                    break;

                case 'tag':
                    // Set limit
                    $limit = $params->get('tagItemCount');

                    // Set title
                    $title = JText::_('K2_DISPLAYING_ITEMS_BY_TAG').' '.JRequest::getVar('tag');

                    // Set ordering
                    $ordering = $params->get('tagOrdering');

                    // Set parameters prefix
                    $prefix = 'tag';

                    $response->tag = JRequest::getVar('tag');
                    break;

                case 'search':

                    // Set title
                    $title = JText::_('K2_SEARCH_RESULTS_FOR').' '.JRequest::getVar('searchword');

                    // Set parameters prefix
                    $prefix = 'generic';

                    $response->search = JRequest::getVar('searchword');
                    break;

                case 'date':

                    // Set title
                    if (JRequest::getInt('day')) {
                        $date = strtotime(JRequest::getInt('year').'-'.JRequest::getInt('month').'-'.JRequest::getInt('day'));
                        $dateFormat = (K2_JVERSION == '15') ? '%A, %d %B %Y' : 'l, d F Y';
                        $title = JText::_('K2_ITEMS_FILTERED_BY_DATE').' '.JHTML::_('date', $date, $dateFormat);
                    } else {
                        $date = strtotime(JRequest::getInt('year').'-'.JRequest::getInt('month'));
                        $dateFormat = (K2_JVERSION == '15') ? '%B %Y' : 'F Y';
                        $title = JText::_('K2_ITEMS_FILTERED_BY_DATE').' '.JHTML::_('date', $date, $dateFormat);
                    }
                    // Set ordering
                    $ordering = 'rdate';

                    // Set parameters prefix
                    $prefix = 'generic';

                    $response->date = JHTML::_('date', $date, $dateFormat);
                    break;

                default:
                    $user = JFactory::getUser();

                    // Set limit
                    $limit = $params->get('num_leading_items') + $params->get('num_primary_items') + $params->get('num_secondary_items') + $params->get('num_links');
                    // Set featured flag
                    JRequest::setVar('featured', $params->get('catFeaturedItems'));

                    // Set title
                    $title = $params->get('page_title');

                    // Set ordering
                    $ordering = $params->get('catOrdering');

                    // Set parameters prefix
                    $prefix = 'cat';

                    break;
            }

            if (!isset($ordering)) {
                $items = $model->getData();
            } else {
                $items = $model->getData($ordering);
            }
        }

        // Prepare items
        $user = JFactory::getUser();
        $cache = JFactory::getCache('com_k2_extended');
        $model = $this->getModel('item');
        $rows = array();
        for ($i = 0; $i < sizeof($items); $i++) {

            // Item group
            if ($task == "category" || $task == "") {
                $items[$i]->itemGroup = 'links';

                if ($i < ($params->get('num_links') + $params->get('num_leading_items') + $params->get('num_primary_items') + $params->get('num_secondary_items'))) {
                    $items[$i]->itemGroup = 'links';
                }
                if ($i < ($params->get('num_secondary_items') + $params->get('num_leading_items') + $params->get('num_primary_items'))) {
                    $items[$i]->itemGroup = 'secondary';
                }
                if ($i < ($params->get('num_primary_items') + $params->get('num_leading_items'))) {
                    $items[$i]->itemGroup = 'primary';
                }
                if ($i < $params->get('num_leading_items')) {
                    $items[$i]->itemGroup = 'leading';
                }
            } else {
                $items[$i]->itemGroup = '';
            }

            $itemParams = class_exists('JParameter') ? new JParameter($items[$i]->params) : new JRegistry($items[$i]->params);
            $itemParams->set($prefix.'ItemIntroText', true);
            $itemParams->set($prefix.'ItemFullText', true);
            $itemParams->set($prefix.'ItemTags', true);
            $itemParams->set($prefix.'ItemExtraFields', true);
            $itemParams->set($prefix.'ItemAttachments', true);
            $itemParams->set($prefix.'ItemRating', true);
            $itemParams->set($prefix.'ItemAuthor', true);
            $itemParams->set($prefix.'ItemImageGallery', true);
            $itemParams->set($prefix.'ItemVideo', true);
            $itemParams->set($prefix.'ItemImage', true);
            $items[$i]->params = $itemParams->toString();

            // Check if the model should use caching for preparing the item content, even if a user is logged in (improves performance)
            if ($user->guest || $task == 'tag' || $task == 'search' || $task == 'date') {
                $cacheFlag = true;
            } else {
                $cacheFlag = true;
                if (K2HelperPermissions::canEditItem($items[$i]->created_by, $items[$i]->catid)) {
                    $cacheFlag = false;
                }
            }

            // Prepare item
            if ($cacheFlag) {
                $hits = $items[$i]->hits;
                $items[$i]->hits = 0;
                JTable::getInstance('K2Category', 'Table');
                $items[$i] = $cache->call(array($model, 'prepareItem'), $items[$i], $view, $task);
                $items[$i]->hits = $hits;
            } else {
                $items[$i] = $model->prepareItem($items[$i], $view, $task);
            }

            // Plugins
            $items[$i] = $model->execPlugins($items[$i], $view, $task);

            // Trigger comments counter event
            $dispatcher = JDispatcher::getInstance();
            JPluginHelper::importPlugin('k2');
            $results = $dispatcher->trigger('onK2CommentsCounter', array(&$items[$i], &$params, $limitstart));
            $items[$i]->event->K2CommentsCounter = trim(implode("\n", $results));

            // Set default image
            if ($task == 'user' || $task == 'tag' || $task == 'search' || $task == 'date') {
                $items[$i]->image = (isset($items[$i]->imageGeneric)) ? $items[$i]->imageGeneric : '';
            } else {
                if (!$moduleID) {
                    K2HelperUtilities::setDefaultImage($items[$i], $view, $params);
                }
            }

            $rows[] = $model->prepareJSONItem($items[$i]);
        }

        $response->items = $rows;

        // Prevent spammers from using the tag view
        if ($task == 'tag' && !count($response->items)) {
            $tag = JRequest::getString('tag');
            $db = JFactory::getDbo();
            $db->setQuery('SELECT id FROM #__k2_tags WHERE name = '.$db->quote($tag));
            $tagID = $db->loadResult();
            if (!$tagID) {
                JError::raiseError(404, JText::_('K2_NOT_FOUND'));
                return false;
            }
        }

        // Output
        $json = json_encode($response);
        $callback = JRequest::getCmd('callback');
        if ($callback) {
            $document->setMimeEncoding('application/javascript');
            echo $callback.'('.$json.')';
        } else {
            echo $json;
        }
    }
}
PK![w�hMhMitemlist/view.raw.phpnu&1i�<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

jimport('joomla.application.component.view');

class K2ViewItemlist extends K2View
{
    public function display($tpl = null)
    {
        $application = JFactory::getApplication();
        $params = K2HelperUtilities::getParams('com_k2');
        $model = $this->getModel('itemlist');
        $limitstart = JRequest::getInt('limitstart');
        $view = JRequest::getWord('view');
        $task = JRequest::getWord('task');

        // Add link
        if (K2HelperPermissions::canAddItem()) {
            $addLink = JRoute::_('index.php?option=com_k2&view=item&task=add&tmpl=component');
        }
        $this->assignRef('addLink', $addLink);

        // Get data depending on task
        switch ($task) {

            case 'category':
                // Get category
                $id = JRequest::getInt('id');
                JTable::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR.'/tables');
                $category = JTable::getInstance('K2Category', 'Table');
                $category->load($id);

                // State Check
                if (!$category->published || $category->trash) {
                    JError::raiseError(404, JText::_('K2_CATEGORY_NOT_FOUND'));
                }

                // Access check
                $user = JFactory::getUser();
                if (K2_JVERSION != '15') {
                    if (!in_array($category->access, $user->getAuthorisedViewLevels())) {
                        if ($user->guest) {
                            $uri = JFactory::getURI();
                            $url = 'index.php?option=com_user&view=login&return='.base64_encode($uri->toString());
                            $application->enqueueMessage(JText::_('K2_YOU_NEED_TO_LOGIN_FIRST'), 'notice');
                            $application->redirect(JRoute::_($url, false));
                        } else {
                            JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
                            return;
                        }
                    }
                    $languageFilter = $application->getLanguageFilter();
                    $languageTag = JFactory::getLanguage()->getTag();
                    if ($languageFilter && $category->language != $languageTag && $category->language != '*') {
                        return;
                    }
                } else {
                    if ($category->access > $user->get('aid', 0)) {
                        if ($user->guest) {
                            $uri = JFactory::getURI();
                            $url = 'index.php?option=com_user&view=login&return='.base64_encode($uri->toString());
                            $application->enqueueMessage(JText::_('K2_YOU_NEED_TO_LOGIN_FIRST'), 'notice');
                            $application->redirect(JRoute::_($url, false));
                        } else {
                            JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
                            return;
                        }
                    }
                }

                // Hide the add new item link if user cannot post in the specific category
                if (!K2HelperPermissions::canAddItem($id)) {
                    unset($this->addLink);
                }

                // Merge params
                $cparams = class_exists('JParameter') ? new JParameter($category->params) : new JRegistry($category->params);
                if ($cparams->get('inheritFrom')) {
                    $masterCategory = JTable::getInstance('K2Category', 'Table');
                    $masterCategory->load($cparams->get('inheritFrom'));
                    $cparams = class_exists('JParameter') ? new JParameter($masterCategory->params) : new JRegistry($masterCategory->params);
                }
                $params->merge($cparams);

                // Category link
                $category->link = urldecode(JRoute::_(K2HelperRoute::getCategoryRoute($category->id.':'.urlencode($category->alias))));

                // Category image
                $category->image = K2HelperUtilities::getCategoryImage($category->image, $params);

                // Category plugins
                $dispatcher = JDispatcher::getInstance();
                JPluginHelper::importPlugin('content');
                $category->text = $category->description;

                if (K2_JVERSION != '15') {
                    $dispatcher->trigger('onContentPrepare', array('com_k2.category', &$category, &$params, $limitstart));
                } else {
                    $dispatcher->trigger('onPrepareContent', array(&$category, &$params, $limitstart));
                }

                $category->description = $category->text;

                // Category K2 plugins
                $category->event->K2CategoryDisplay = '';
                JPluginHelper::importPlugin('k2');
                $results = $dispatcher->trigger('onK2CategoryDisplay', array(&$category, &$params, $limitstart));
                $category->event->K2CategoryDisplay = trim(implode("\n", $results));
                $category->text = $category->description;
                $dispatcher->trigger('onK2PrepareContent', array(&$category, &$params, $limitstart));
                $category->description = $category->text;

                $this->assignRef('category', $category);
                $this->assignRef('user', $user);

                // Category children
                $ordering = $params->get('subCatOrdering');
                $children = $model->getCategoryFirstChildren($id, $ordering);
                if (count($children)) {
                    foreach ($children as $child) {
                        if ($params->get('subCatTitleItemCounter')) {
                            $child->numOfItems = $model->countCategoryItems($child->id);
                        }
                        $child->image = K2HelperUtilities::getCategoryImage($child->image, $params);
                        $child->link = urldecode(JRoute::_(K2HelperRoute::getCategoryRoute($child->id.':'.urlencode($child->alias))));
                        $subCategories[] = $child;
                    }
                    $this->assignRef('subCategories', $subCategories);
                }

                // Set limit
                $limit = $params->get('num_leading_items') + $params->get('num_primary_items') + $params->get('num_secondary_items') + $params->get('num_links');

                // Set featured flag
                JRequest::setVar('featured', $params->get('catFeaturedItems'));

                // Set layout
                $this->setLayout('category');

                // Set title
                $title = $category->name;

                // Set ordering
                if ($params->get('singleCatOrdering')) {
                    $ordering = $params->get('singleCatOrdering');
                } else {
                    $ordering = $params->get('catOrdering');
                }

                break;

            case 'user':
                // Get user
                $id = JRequest::getInt('id');
                $userObject = JFactory::getUser($id);

                // Check user status
                if ($userObject->block) {
                    JError::raiseError(404, JText::_('K2_USER_NOT_FOUND'));
                }

                // Get K2 user profile
                $userObject->profile = $model->getUserProfile();

                // User image
                $userObject->avatar = K2HelperUtilities::getAvatar($userObject->id, $userObject->email, $params->get('userImageWidth'));

                // User K2 plugins
                $userObject->event->K2UserDisplay = '';
                if (is_object($userObject->profile) && $userObject->profile->id > 0) {
                    $dispatcher = JDispatcher::getInstance();
                    JPluginHelper::importPlugin('k2');
                    $results = $dispatcher->trigger('onK2UserDisplay', array(&$userObject->profile, &$params, $limitstart));
                    $userObject->event->K2UserDisplay = trim(implode("\n", $results));
                    $userObject->profile->url = htmlspecialchars($userObject->profile->url, ENT_QUOTES, 'UTF-8');
                }

                $this->assignRef('user', $userObject);

                // Set layout
                $this->setLayout('user');

                // Set limit
                $limit = $params->get('userItemCount');

                // Set title
                $title = $userObject->name;

                // Set ordering
                $ordering = $params->get('userOrdering');

                break;

            case 'tag':
                // Set layout
                $this->setLayout('tag');

                // Set limit
                $limit = $params->get('tagItemCount');

                // Prevent spammers from using the tag view
                $tag = JRequest::getString('tag');
                $db = JFactory::getDbo();
                $db->setQuery('SELECT id, name FROM #__k2_tags WHERE name = '.$db->quote($tag));
                $tag = $db->loadObject();
                if (!$tag->id) {
                    JError::raiseError(404, JText::_('K2_NOT_FOUND'));
                    return false;
                }

                // set title
                $title = JText::_('K2_DISPLAYING_ITEMS_BY_TAG').' '.$tag->name;

                // Set ordering
                $ordering = $params->get('tagOrdering');
                break;

            case 'search':
                // Set layout
                $this->setLayout('generic');
                $tpl = JRequest::getCmd('tpl', null);

                // Set limit
                $limit = $params->get('genericItemCount');

                // Set title
                $title = JText::_('K2_SEARCH_RESULTS_FOR').' '.JRequest::getVar('searchword');
                break;

            case 'date':
                // Set layout
                $this->setLayout('generic');

                // Set limit
                $limit = $params->get('genericItemCount');

                // Set title
                if (JRequest::getInt('day')) {
                    $date = strtotime(JRequest::getInt('year').'-'.JRequest::getInt('month').'-'.JRequest::getInt('day'));
                    $dateFormat = (K2_JVERSION == '15') ? '%A, %d %B %Y' : 'l, d F Y';
                    $title = JText::_('K2_ITEMS_FILTERED_BY_DATE').' '.JHTML::_('date', $date, $dateFormat);
                } else {
                    $date = strtotime(JRequest::getInt('year').'-'.JRequest::getInt('month'));
                    $dateFormat = (K2_JVERSION == '15') ? '%B %Y' : 'F Y';
                    $title = JText::_('K2_ITEMS_FILTERED_BY_DATE').' '.JHTML::_('date', $date, $dateFormat);
                }
                // Set ordering
                $ordering = 'rdate';
                break;

            default:
                // Set layout
                $this->setLayout('category');
                $user = JFactory::getUser();
                $this->assignRef('user', $user);

                // Set limit
                $limit = $params->get('num_leading_items') + $params->get('num_primary_items') + $params->get('num_secondary_items') + $params->get('num_links');
                //Set featured flag
                JRequest::setVar('featured', $params->get('catFeaturedItems'));

                // Set title
                $title = $params->get('page_title');

                // Set ordering
                $ordering = $params->get('catOrdering');

                break;
        }

        // Set limit for model
        JRequest::setVar('limit', $limit);

        if (!isset($ordering)) {
            $items = $model->getData();
        } else {
            $items = $model->getData($ordering);
        }

        // Pagination
        jimport('joomla.html.pagination');
        $total = count($items) ? $model->getTotal() : 0;
        $pagination = new JPagination($total, $limitstart, $limit);

        // Prepare items
        $user = JFactory::getUser();
        $cache = JFactory::getCache('com_k2_extended');
        $model = $this->getModel('item');
        for ($i = 0; $i < sizeof($items); $i++) {

            // Item group
            if ($task == "category" || $task == "") {
                if ($i < ($params->get('num_links') + $params->get('num_leading_items') + $params->get('num_primary_items') + $params->get('num_secondary_items'))) {
                    $items[$i]->itemGroup = 'links';
                }
                if ($i < ($params->get('num_secondary_items') + $params->get('num_leading_items') + $params->get('num_primary_items'))) {
                    $items[$i]->itemGroup = 'secondary';
                }
                if ($i < ($params->get('num_primary_items') + $params->get('num_leading_items'))) {
                    $items[$i]->itemGroup = 'primary';
                }
                if ($i < $params->get('num_leading_items')) {
                    $items[$i]->itemGroup = 'leading';
                }
            }

            // Check if model should use cache for preparing item even if user is logged in
            if ($user->guest || $task == 'tag' || $task == 'search' || $task == 'date') {
                $cacheFlag = true;
            } else {
                $cacheFlag = true;
                if (K2HelperPermissions::canEditItem($items[$i]->created_by, $items[$i]->catid)) {
                    $cacheFlag = false;
                }
            }

            // Prepare item
            if ($cacheFlag) {
                $hits = $items[$i]->hits;
                $items[$i]->hits = 0;
                JTable::getInstance('K2Category', 'Table');
                $items[$i] = $cache->call(array($model, 'prepareItem'), $items[$i], $view, $task);
                $items[$i]->hits = $hits;
            } else {
                $items[$i] = $model->prepareItem($items[$i], $view, $task);
            }

            // Plugins
            $items[$i] = $model->execPlugins($items[$i], $view, $task);

            // Trigger comments counter event
            $dispatcher = JDispatcher::getInstance();
            JPluginHelper::importPlugin('k2');
            $results = $dispatcher->trigger('onK2CommentsCounter', array(&$items[$i], &$params, $limitstart));
            $items[$i]->event->K2CommentsCounter = trim(implode("\n", $results));
        }

        // Pathway
        $pathway = $application->getPathWay();
        $pathway->addItem($title);

        // Feed link
        $config = JFactory::getConfig();
        $menu = $application->getMenu();
        $default = $menu->getDefault();
        $active = $menu->getActive();
        if ($task == 'tag') {
            $link = K2HelperRoute::getTagRoute(JRequest::getVar('tag'));
        } else {
            $link = '';
        }
        $sef = K2_JVERSION == '30' ? $config->get('sef') : $config->getValue('config.sef');
        if (!is_null($active) && $active->id == $default->id && $sef) {
            $link .= '&Itemid='.$active->id.'&format=feed&limitstart=';
        } else {
            $link .= '&format=feed&limitstart=';
        }

        $feed = JRoute::_($link);
        $this->assignRef('feed', $feed);

        // Assign data
        if ($task == "category" || $task == "") {
            $leading = @array_slice($items, 0, $params->get('num_leading_items'));
            $primary = @array_slice($items, $params->get('num_leading_items'), $params->get('num_primary_items'));
            $secondary = @array_slice($items, $params->get('num_leading_items') + $params->get('num_primary_items'), $params->get('num_secondary_items'));
            $links = @array_slice($items, $params->get('num_leading_items') + $params->get('num_primary_items') + $params->get('num_secondary_items'), $params->get('num_links'));
            $this->assignRef('leading', $leading);
            $this->assignRef('primary', $primary);
            $this->assignRef('secondary', $secondary);
            $this->assignRef('links', $links);
        } else {
            $this->assignRef('items', $items);
        }

        // Set default values to avoid division by zero
        if ($params->get('num_leading_columns') == 0) {
            $params->set('num_leading_columns', 1);
        }
        if ($params->get('num_primary_columns') == 0) {
            $params->set('num_primary_columns', 1);
        }
        if ($params->get('num_secondary_columns') == 0) {
            $params->set('num_secondary_columns', 1);
        }
        if ($params->get('num_links_columns') == 0) {
            $params->set('num_links_columns', 1);
        }

        $this->assignRef('params', $params);
        $this->assignRef('pagination', $pagination);

        // Lookup template folders
        $this->_addPath('template', JPATH_COMPONENT.'/templates');
        $this->_addPath('template', JPATH_COMPONENT.'/templates/default');

        $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2/templates');
        $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2/templates/default');

        $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2');
        $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2/default');

        $theme = $params->get('theme');
        if ($theme) {
            $this->_addPath('template', JPATH_COMPONENT.'/templates/'.$theme);
            $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2/templates/'.$theme);
            $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2/'.$theme);
        }

        // Allow temporary template loading with ?template=
        $template = JRequest::getCmd('template');
        if (isset($template)) {
            // Look for overrides in template folder (new K2 template structure)
            $this->_addPath('template', JPATH_SITE.'/templates/'.$template.'/html/com_k2');
            $this->_addPath('template', JPATH_SITE.'/templates/'.$template.'/html/com_k2/default');
            if ($theme) {
                $this->_addPath('template', JPATH_SITE.'/templates/'.$template.'/html/com_k2/'.$theme);
            }
        }

        $db = JFactory::getDbo();
        $nullDate = $db->getNullDate();
        $this->assignRef('nullDate', $nullDate);

        parent::display($tpl);
    }

    public function module()
    {
        jimport('joomla.application.module.helper');
        $application = JFactory::getApplication();
        $moduleID = JRequest::getInt('moduleID');
        $model = K2Model::getInstance('Itemlist', 'K2Model');
        if ($moduleID) {
            $result = $model->getModuleItems($moduleID);
            $items = $result->items;
            $componentParams = JComponentHelper::getParams('com_k2');
            if (is_string($result->params)) {
                $params = class_exists('JParameter') ? new JParameter($result->params) : new JRegistry($result->params);
            } else {
                $params = $result->params;
            }

            if ($params->get('getTemplate')) {
                require(JModuleHelper::getLayoutPath('mod_k2_content', $params->get('getTemplate').'/default'));
            } else {
                require(JModuleHelper::getLayoutPath($result->module, 'default'));
            }
        }
        $application->close();
    }
}
PK!�y��1r1ritemlist/view.html.phpnu&1i�<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

jimport('joomla.application.component.view');

class K2ViewItemlist extends K2View
{
    public function display($tpl = null)
    {
        $application = JFactory::getApplication();
        $params = K2HelperUtilities::getParams('com_k2');
        $model = $this->getModel('itemlist');
        $limitstart = JRequest::getInt('limitstart');
        $view = JRequest::getWord('view');
        $task = JRequest::getWord('task');
        $db = JFactory::getDbo();

        // Add link
        if (K2HelperPermissions::canAddItem()) {
            $addLink = JRoute::_('index.php?option=com_k2&view=item&task=add&tmpl=component');
        }
        $this->assignRef('addLink', $addLink);

        // Get data depending on task
        switch ($task) {

            case 'category':
                // Get category
                $id = JRequest::getInt('id');
                JTable::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR.'/tables');
                $category = JTable::getInstance('K2Category', 'Table');
                $category->load($id);
                $category->event = new stdClass;

                // State check
                if (!$category->published || $category->trash) {
                    JError::raiseError(404, JText::_('K2_CATEGORY_NOT_FOUND'));
                }

                // Access check
                $user = JFactory::getUser();
                if (K2_JVERSION != '15') {
                    if (!in_array($category->access, $user->getAuthorisedViewLevels())) {
                        if ($user->guest) {
                            $uri = JFactory::getURI();
                            $url = 'index.php?option=com_users&view=login&return='.base64_encode($uri->toString());
                            $application->enqueueMessage(JText::_('K2_YOU_NEED_TO_LOGIN_FIRST'), 'notice');
                            $application->redirect(JRoute::_($url, false));
                        } else {
                            JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
                            return;
                        }
                    }
                    $languageFilter = $application->getLanguageFilter();
                    $languageTag = JFactory::getLanguage()->getTag();
                    if ($languageFilter && $category->language != $languageTag && $category->language != '*') {
                        return;
                    }
                } else {
                    if ($category->access > $user->get('aid', 0)) {
                        if ($user->guest) {
                            $uri = JFactory::getURI();
                            $url = 'index.php?option=com_user&view=login&return='.base64_encode($uri->toString());
                            $application->enqueueMessage(JText::_('K2_YOU_NEED_TO_LOGIN_FIRST'), 'notice');
                            $application->redirect(JRoute::_($url, false));
                        } else {
                            JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
                            return;
                        }
                    }
                }

                // Hide the add new item link if user cannot post in the specific category
                if (!K2HelperPermissions::canAddItem($id)) {
                    unset($this->addLink);
                }

                // Merge params
                $cparams = class_exists('JParameter') ? new JParameter($category->params) : new JRegistry($category->params);

                // Get the meta information before merging params since we do not want them to be inherited
                $category->metaDescription = $cparams->get('catMetaDesc');
                $category->metaKeywords = $cparams->get('catMetaKey');
                $category->metaRobots = $cparams->get('catMetaRobots');
                $category->metaAuthor = $cparams->get('catMetaAuthor');

                if ($cparams->get('inheritFrom')) {
                    $masterCategory = JTable::getInstance('K2Category', 'Table');
                    $masterCategory->load($cparams->get('inheritFrom'));
                    $cparams = class_exists('JParameter') ? new JParameter($masterCategory->params) : new JRegistry($masterCategory->params);
                }
                $params->merge($cparams);

                // Category link
                $category->link = urldecode(JRoute::_(K2HelperRoute::getCategoryRoute($category->id.':'.urlencode($category->alias))));

                // Category image
                $category->image = K2HelperUtilities::getCategoryImage($category->image, $params);

                // Category plugins
                $dispatcher = JDispatcher::getInstance();
                JPluginHelper::importPlugin('content');
                $category->text = $category->description;
                if (K2_JVERSION != '15') {
                    $dispatcher->trigger('onContentPrepare', array(
                        'com_k2.category',
                        &$category,
                        &$params,
                        $limitstart
                    ));
                } else {
                    $dispatcher->trigger('onPrepareContent', array(
                        &$category,
                        &$params,
                        $limitstart
                    ));
                }

                $category->description = $category->text;

                // Category K2 plugins
                $category->event->K2CategoryDisplay = '';
                JPluginHelper::importPlugin('k2');
                $results = $dispatcher->trigger('onK2CategoryDisplay', array(
                    &$category,
                    &$params,
                    $limitstart
                ));
                $category->event->K2CategoryDisplay = trim(implode("\n", $results));
                $category->text = $category->description;
                $dispatcher->trigger('onK2PrepareContent', array(
                    &$category,
                    &$params,
                    $limitstart
                ));
                $category->description = $category->text;

                $this->assignRef('category', $category);
                $this->assignRef('user', $user);

                // Category children
                $ordering = $params->get('subCatOrdering');
                $children = $model->getCategoryFirstChildren($id, $ordering);
                if (count($children)) {
                    foreach ($children as $child) {
                        if ($params->get('subCatTitleItemCounter')) {
                            $child->numOfItems = $model->countCategoryItems($child->id);
                        }
                        $child->image = K2HelperUtilities::getCategoryImage($child->image, $params);
                        $child->name = htmlspecialchars($child->name, ENT_QUOTES);
                        $child->link = urldecode(JRoute::_(K2HelperRoute::getCategoryRoute($child->id.':'.urlencode($child->alias))));
                        $subCategories[] = $child;
                    }
                    $this->assignRef('subCategories', $subCategories);
                }

                // Set limit
                $limit = $params->get('num_leading_items') + $params->get('num_primary_items') + $params->get('num_secondary_items') + $params->get('num_links');

                // Set featured flag
                JRequest::setVar('featured', $params->get('catFeaturedItems'));

                // Set layout
                $this->setLayout('category');

                // Set title
                $title = $category->name;
                $category->name = htmlspecialchars($category->name, ENT_QUOTES);

                // Set ordering
                if ($params->get('singleCatOrdering')) {
                    $ordering = $params->get('singleCatOrdering');
                } else {
                    $ordering = $params->get('catOrdering');
                }

                $addHeadFeedLink = $params->get('catFeedLink');

                break;

            case 'user':
                // Get user
                $id = JRequest::getInt('id');
                $userObject = JFactory::getUser($id);
                $userObject->event = new stdClass;

                // Check user status
                if ($userObject->block) {
                    JError::raiseError(404, JText::_('K2_USER_NOT_FOUND'));
                }

                // Get K2 user profile
                $userObject->profile = $model->getUserProfile();

                // User image
                $userObject->avatar = K2HelperUtilities::getAvatar($userObject->id, $userObject->email, $params->get('userImageWidth'));

                // User K2 plugins
                $userObject->event->K2UserDisplay = '';
                if (is_object($userObject->profile) && $userObject->profile->id > 0) {
                    $dispatcher = JDispatcher::getInstance();
                    JPluginHelper::importPlugin('k2');
                    $results = $dispatcher->trigger('onK2UserDisplay', array(
                        &$userObject->profile,
                        &$params,
                        $limitstart
                    ));
                    $userObject->event->K2UserDisplay = trim(implode("\n", $results));
                    $userObject->profile->url = htmlspecialchars($userObject->profile->url, ENT_QUOTES, 'UTF-8');
                }
                $this->assignRef('user', $userObject);

                $date = JFactory::getDate();
                $now = K2_JVERSION == '15' ? $date->toMySQL() : $date->toSql();
                $this->assignRef('now', $now);

                // Set layout
                $this->setLayout('user');

                // Set limit
                $limit = $params->get('userItemCount');

                // Set title
                $title = $userObject->name;

                // Set ordering
                $ordering = $params->get('userOrdering');

                $addHeadFeedLink = $params->get('userFeedLink', 1);

                break;

            case 'tag':
                // Set layout
                $this->setLayout('tag');

                // Set limit
                $limit = $params->get('tagItemCount');

                // Prevent spammers from using the tag view
                $tag = JRequest::getString('tag');
                $db = JFactory::getDbo();
                $db->setQuery('SELECT id, name FROM #__k2_tags WHERE name = '.$db->quote($tag));
                $tag = $db->loadObject();
                if (!$tag || !$tag->id) {
                    JError::raiseError(404, JText::_('K2_NOT_FOUND'));
                    return false;
                }

                // Set title
                $title = JText::_('K2_DISPLAYING_ITEMS_BY_TAG').' '.$tag->name;

                // Set ordering
                $ordering = $params->get('tagOrdering');

                $addHeadFeedLink = $params->get('tagFeedLink', 1);

                break;

            case 'search':
                // Set layout
                $this->setLayout('generic');

                // Set limit
                $limit = $params->get('genericItemCount');

                // Set title
                $title = JText::_('K2_SEARCH_RESULTS_FOR').' '.JRequest::getVar('searchword');

                $addHeadFeedLink = $params->get('genericFeedLink', 1);

                break;

            case 'date':
                // Set layout
                $this->setLayout('generic');

                // Set limit
                $limit = $params->get('genericItemCount');

                // Fix wrong timezone
                if (function_exists('date_default_timezone_get')) {
                    $originalTimezone = date_default_timezone_get();
                }
                if (function_exists('date_default_timezone_set')) {
                    date_default_timezone_set('UTC');
                }

                // Set title
                if (JRequest::getInt('day')) {
                    $date = strtotime(JRequest::getInt('year').'-'.JRequest::getInt('month').'-'.JRequest::getInt('day'));
                    $dateFormat = (K2_JVERSION == '15') ? '%A, %d %B %Y' : 'l, d F Y';
                    $title = JText::_('K2_ITEMS_FILTERED_BY_DATE').' '.JHTML::_('date', $date, $dateFormat);
                } else {
                    $date = strtotime(JRequest::getInt('year').'-'.JRequest::getInt('month'));
                    $dateFormat = (K2_JVERSION == '15') ? '%B %Y' : 'F Y';
                    $title = JText::_('K2_ITEMS_FILTERED_BY_DATE').' '.JHTML::_('date', $date, $dateFormat);
                }

                // Restore the original timezone
                if (function_exists('date_default_timezone_set') && isset($originalTimezone)) {
                    date_default_timezone_set($originalTimezone);
                }

                // Set ordering
                $ordering = 'rdate';

                $addHeadFeedLink = $params->get('genericFeedLink', 1);

                break;

            default:
                // Set layout
                $this->setLayout('category');
                $user = JFactory::getUser();
                $this->assignRef('user', $user);

                // Set limit
                $limit = $params->get('num_leading_items') + $params->get('num_primary_items') + $params->get('num_secondary_items') + $params->get('num_links');
                // Set featured flag
                JRequest::setVar('featured', $params->get('catFeaturedItems'));

                // Set title
                $title = $params->get('page_title');

                // Set ordering
                $ordering = $params->get('catOrdering');

                $addHeadFeedLink = $params->get('catFeedLink', 1);

                break;
        }

        // Set limit for model
        if (!$limit) {
            $limit = 10;
        }
        JRequest::setVar('limit', $limit);

        // Get items
        if (!isset($ordering)) {
            $items = $model->getData();
        } else {
            $items = $model->getData($ordering);
        }

        // If a user has no published items, do not display their K2 user page (in the frontend) and redirect to the homepage of the site.
        $user = JFactory::getUser();
        $userPageDisplay = 0;
        switch ($params->get('profilePageDisplay', 0)) {
            case 1:
                $userPageDisplay = 1;
                break;
            case 2:
                if ($user->id > 0) {
                    $userPageDisplay = 1;
                }
                break;
        }
        if ((count($items) == 0 && $task == 'user') && $userPageDisplay == 0) {
            $application->redirect(JUri::root());
        }

        // Pagination
        jimport('joomla.html.pagination');
        $total = count($items) ? $model->getTotal() : 0;
        $pagination = new JPagination($total, $limitstart, $limit);

        //Prepare items
        $cache = JFactory::getCache('com_k2_extended');
        $model = $this->getModel('item');

        for ($i = 0; $i < sizeof($items); $i++) {

            // Ensure that all items have a group. If an item with no group is found then assign to it the leading group
            $items[$i]->itemGroup = 'leading';

            //Item group
            if ($task == "category" || $task == "") {
                if ($i < ($params->get('num_links') + $params->get('num_leading_items') + $params->get('num_primary_items') + $params->get('num_secondary_items'))) {
                    $items[$i]->itemGroup = 'links';
                }
                if ($i < ($params->get('num_secondary_items') + $params->get('num_leading_items') + $params->get('num_primary_items'))) {
                    $items[$i]->itemGroup = 'secondary';
                }
                if ($i < ($params->get('num_primary_items') + $params->get('num_leading_items'))) {
                    $items[$i]->itemGroup = 'primary';
                }
                if ($i < $params->get('num_leading_items')) {
                    $items[$i]->itemGroup = 'leading';
                }
            }

            // Check if the model should use the cache for preparing the item even if the user is logged in
            if ($user->guest || $task == 'tag' || $task == 'search' || $task == 'date') {
                $cacheFlag = true;
            } else {
                $cacheFlag = true;
                if (K2HelperPermissions::canEditItem($items[$i]->created_by, $items[$i]->catid)) {
                    $cacheFlag = false;
                }
            }

            // Prepare item
            if ($cacheFlag) {
                $hits = $items[$i]->hits;
                $items[$i]->hits = 0;
                JTable::getInstance('K2Category', 'Table');
                $items[$i] = $cache->call(array(
                    $model,
                    'prepareItem'
                ), $items[$i], $view, $task);
                $items[$i]->hits = $hits;
            } else {
                $items[$i] = $model->prepareItem($items[$i], $view, $task);
            }

            // Plugins
            $items[$i] = $model->execPlugins($items[$i], $view, $task);

            // Trigger comments counter event if needed
            if ($params->get('catItemK2Plugins') &&
                ($params->get('catItemCommentsAnchor') ||
                 $params->get('itemCommentsAnchor') ||
                 $params->get('itemComments'))) {
                // Trigger comments counter event
                $dispatcher = JDispatcher::getInstance();
                JPluginHelper::importPlugin('k2');
                $results = $dispatcher->trigger('onK2CommentsCounter', array(
                    &$items[$i],
                    &$params,
                    $limitstart
                ));
                $items[$i]->event->K2CommentsCounter = trim(implode("\n", $results));
            }
        }

        // Set title
        $document = JFactory::getDocument();
        $application = JFactory::getApplication();
        $menus = $application->getMenu();
        $menu = $menus->getActive();
        if (is_object($menu)) {
            if (is_string($menu->params)) {
                $menu_params = K2_JVERSION == '15' ? new JParameter($menu->params) : new JRegistry($menu->params);
            } else {
                $menu_params = $menu->params;
            }
            if (!$menu_params->get('page_title')) {
                $params->set('page_title', $title);
            }
        } else {
            $params->set('page_title', $title);
        }

        // We're adding a new variable here which won't get the appended/prepended site title,
        // when enabled via Joomla's SEO/SEF settings
        $params->set('page_title_clean', $title);

        if (K2_JVERSION != '15') {
            if ($application->getCfg('sitename_pagetitles', 0) == 1) {
                $tmpTitle = JText::sprintf('JPAGETITLE', $application->getCfg('sitename'), $params->get('page_title'));
                $params->set('page_title', $tmpTitle);
            } elseif ($application->getCfg('sitename_pagetitles', 0) == 2) {
                $tmpTitle = JText::sprintf('JPAGETITLE', $params->get('page_title'), $application->getCfg('sitename'));
                $params->set('page_title', $tmpTitle);
            }
        }
        $document->setTitle($params->get('page_title'));

        // Keep for b/c in v2.x: Search - Update the Google Search results container
        if ($task == 'search') {
            $params->set('googleSearch', 0);
            $googleSearchContainerID = trim($params->get('googleSearchContainer', 'k2GoogleSearchContainer'));
            if ($googleSearchContainerID == 'k2Container') {
                $googleSearchContainerID = 'k2GoogleSearchContainer';
            }
            $params->set('googleSearchContainer', $googleSearchContainerID);
        }

        // Set metadata for category
        if ($task == 'category') {
            if ($category->metaDescription) {
                $document->setDescription($category->metaDescription);
            } else {
                $metaDescItem = preg_replace("#{(.*?)}(.*?){/(.*?)}#s", '', $this->category->description);
                $metaDescItem = strip_tags($metaDescItem);
                $metaDescItem = K2HelperUtilities::characterLimit($metaDescItem, $params->get('metaDescLimit', 150));
                if (K2_JVERSION != '15') {
                    $metaDescItem = html_entity_decode($metaDescItem);
                }
                $document->setDescription($metaDescItem);
            }
            if ($category->metaKeywords) {
                $document->setMetadata('keywords', $category->metaKeywords);
            }
            if ($category->metaRobots) {
                $document->setMetadata('robots', $category->metaRobots);
            }
            if ($category->metaAuthor) {
                $document->setMetadata('author', $category->metaAuthor);
            }
        }

        if (K2_JVERSION != '15') {

            // Menu metadata options
            if ($params->get('menu-meta_description')) {
                $document->setDescription($params->get('menu-meta_description'));
            }

            if ($params->get('menu-meta_keywords')) {
                $document->setMetadata('keywords', $params->get('menu-meta_keywords'));
            }

            if ($params->get('robots')) {
                $document->setMetadata('robots', $params->get('robots'));
            }

            // Menu page display options
            if ($params->get('page_heading')) {
                $params->set('page_title', $params->get('page_heading'));
            }
            $params->set('show_page_title', $params->get('show_page_heading'));
        }

        // Pathway
        $pathway = $application->getPathWay();
        if (!isset($menu->query['task'])) {
            $menu->query['task'] = '';
        }
        if ($menu) {
            switch ($task) {
                case 'category':
                    if ($menu->query['task'] != 'category' || $menu->query['id'] != JRequest::getInt('id')) {
                        $pathway->addItem($title, '');
                    }
                    break;
                case 'user':
                    if ($menu->query['task'] != 'user' || $menu->query['id'] != JRequest::getInt('id')) {
                        $pathway->addItem($title, '');
                    }
                    break;

                case 'tag':
                    if ($menu->query['task'] != 'tag' || $menu->query['tag'] != JRequest::getVar('tag')) {
                        $pathway->addItem($title, '');
                    }
                    break;

                case 'search':
                case 'date':
                    $pathway->addItem($title, '');
                    break;
            }
        }

        // Feed link
        $config = JFactory::getConfig();
        $menu = $application->getMenu();
        $default = $menu->getDefault();
        $active = $menu->getActive();
        if ($task == 'tag') {
            $link = K2HelperRoute::getTagRoute(JRequest::getVar('tag'));
        } else {
            $link = '';
        }
        $sef = K2_JVERSION == '30' ? $config->get('sef') : $config->getValue('config.sef');
        if (!is_null($active) && $active->id == $default->id && $sef) {
            $link .= '&Itemid='.$active->id.'&format=feed&limitstart=';
        } else {
            $link .= '&format=feed&limitstart=';
        }

        $feed = JRoute::_($link);
        $this->assignRef('feed', $feed);

        // Add head feed link
        if ($addHeadFeedLink) {
            $attribs = array(
                'type' => 'application/rss+xml',
                'title' => 'RSS 2.0'
            );
            $document->addHeadLink(JRoute::_($link.'&type=rss'), 'alternate', 'rel', $attribs);
            $attribs = array(
                'type' => 'application/atom+xml',
                'title' => 'Atom 1.0'
            );
            $document->addHeadLink(JRoute::_($link.'&type=atom'), 'alternate', 'rel', $attribs);
        }

        // Assign data
        if ($task == "category" || $task == "") {

            // Leading items
            $offset = 0;
            $length = $params->get('num_leading_items');
            $leading = array_slice($items, $offset, $length);

            // Primary
            $offset = (int)$params->get('num_leading_items');
            $length = (int)$params->get('num_primary_items');
            $primary = array_slice($items, $offset, $length);

            // Secondary
            $offset = (int)($params->get('num_leading_items') + $params->get('num_primary_items'));
            $length = (int)$params->get('num_secondary_items');
            $secondary = array_slice($items, $offset, $length);

            // Links
            $offset = (int)($params->get('num_leading_items') + $params->get('num_primary_items') + $params->get('num_secondary_items'));
            $length = (int)$params->get('num_links');
            $links = array_slice($items, $offset, $length);

            // Assign data
            $this->assignRef('leading', $leading);
            $this->assignRef('primary', $primary);
            $this->assignRef('secondary', $secondary);
            $this->assignRef('links', $links);
        } else {
            $this->assignRef('items', $items);
        }

        // Set default values to avoid division by zero
        if ($params->get('num_leading_columns') == 0) {
            $params->set('num_leading_columns', 1);
        }
        if ($params->get('num_primary_columns') == 0) {
            $params->set('num_primary_columns', 1);
        }
        if ($params->get('num_secondary_columns') == 0) {
            $params->set('num_secondary_columns', 1);
        }
        if ($params->get('num_links_columns') == 0) {
            $params->set('num_links_columns', 1);
        }

        $this->assignRef('params', $params);
        $this->assignRef('pagination', $pagination);

        // Set Facebook meta data
        if ($params->get('facebookMetatags', '1')) {
            $document = JFactory::getDocument();
            $uri = JURI::getInstance();
            $document->setMetaData('og:url', $uri->toString());
            $document->setMetaData('og:title', (K2_JVERSION == '15') ? htmlspecialchars($document->getTitle(), ENT_QUOTES, 'UTF-8') : $document->getTitle());
            $document->setMetaData('og:type', 'website');
            if ($task == 'category' && $this->category->image && strpos($this->category->image, 'placeholder/category.png') === false) {
                $image = substr(JURI::root(), 0, -1).str_replace(JURI::root(true), '', $this->category->image);
                $document->setMetaData('og:image', $image);
                $document->setMetaData('image', $image);
            }
            $document->setMetaData('og:description', strip_tags($document->getDescription()));
        }

        // Lookup template folders
        $this->_addPath('template', JPATH_COMPONENT.'/templates');
        $this->_addPath('template', JPATH_COMPONENT.'/templates/default');

        $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2/templates');
        $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2/templates/default');

        $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2');
        $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2/default');

        $theme = $params->get('theme');
        if ($theme) {
            $this->_addPath('template', JPATH_COMPONENT.'/templates/'.$theme);
            $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2/templates/'.$theme);
            $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2/'.$theme);
        }

        // Allow temporary template loading with ?template=
        $template = JRequest::getCmd('template');
        if (isset($template)) {
            // Look for overrides in template folder (new K2 template structure)
            $this->_addPath('template', JPATH_SITE.'/templates/'.$template.'/html/com_k2');
            $this->_addPath('template', JPATH_SITE.'/templates/'.$template.'/html/com_k2/default');
            if ($theme) {
                $this->_addPath('template', JPATH_SITE.'/templates/'.$template.'/html/com_k2/'.$theme);
            }
        }

        $nullDate = $db->getNullDate();
        $this->assignRef('nullDate', $nullDate);
        $dispatcher = JDispatcher::getInstance();
        JPluginHelper::importPlugin('k2');
        $dispatcher->trigger('onK2BeforeViewDisplay');

        parent::display($tpl);
    }
}
PK!B�c�**itemlist/view.feed.phpnu&1i�<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

jimport('joomla.application.component.view');

class K2ViewItemlist extends K2View
{

    function display($tpl = null)
    {

        $application = JFactory::getApplication();
        $params = K2HelperUtilities::getParams('com_k2');
        $document = JFactory::getDocument();
        $model = $this->getModel('itemlist');
        $limitstart = JRequest::getInt('limitstart');
        $moduleID = JRequest::getInt('moduleID');

        if ($moduleID)
        {

            $result = $model->getModuleItems($moduleID);
            $items = $result->items;
            $title = $result->title;

        }
        else
        {

            //Get data depending on task
            $task = JRequest::getCmd('task');
            switch ($task)
            {

                case 'category' :
                    //Get category
                    $id = JRequest::getInt('id');
                    JTable::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR.'/tables');
                    $category = JTable::getInstance('K2Category', 'Table');
                    $category->load($id);

                    // State check
                    if (!$category->published || $category->trash)
                    {
                        JError::raiseError(404, JText::_('K2_CATEGORY_NOT_FOUND'));
                    }

                    //Access check
                    $user = JFactory::getUser();
                    if (K2_JVERSION != '15')
                    {
                        if (!in_array($category->access, $user->getAuthorisedViewLevels()))
                        {
                            if ($user->guest)
                            {
                                $uri = JFactory::getURI();
                                $url = 'index.php?option=com_users&view=login&return='.base64_encode($uri->toString());
								$application->enqueueMessage(JText::_('K2_YOU_NEED_TO_LOGIN_FIRST'), 'notice');
                                $application->redirect(JRoute::_($url, false));
                            }
                            else
                            {
                                JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
                                return;
                            }
                        }
                        $languageFilter = $application->getLanguageFilter();
                        $languageTag = JFactory::getLanguage()->getTag();
                        if ($languageFilter && $category->language != $languageTag && $category->language != '*')
                        {
                            return;
                        }
                    }
                    else
                    {
                        if ($category->access > $user->get('aid', 0))
                        {
                            if ($user->guest)
                            {
                                $uri = JFactory::getURI();
                                $url = 'index.php?option=com_user&view=login&return='.base64_encode($uri->toString());
								$application->enqueueMessage(JText::_('K2_YOU_NEED_TO_LOGIN_FIRST'), 'notice');
                                $application->redirect(JRoute::_($url, false));
                            }
                            else
                            {
                                JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
                                return;
                            }
                        }
                    }

                    //Merge params
                    $cparams = class_exists('JParameter') ? new JParameter($category->params) : new JRegistry($category->params);
                    if ($cparams->get('inheritFrom'))
                    {
                        $masterCategory = JTable::getInstance('K2Category', 'Table');
                        $masterCategory->load($cparams->get('inheritFrom'));
                        $cparams = class_exists('JParameter') ? new JParameter($masterCategory->params) : new JRegistry($masterCategory->params);
                    }
                    $params->merge($cparams);

                    //Category link
                    $category->link = urldecode(JRoute::_(K2HelperRoute::getCategoryRoute($category->id.':'.urlencode($category->alias))));

                    //Set featured flag
                    JRequest::setVar('featured', $params->get('catFeaturedItems'));

                    //Set title
                    $title = $category->name;

                    // Set ordering
                    if ($params->get('singleCatOrdering'))
                    {
                        $ordering = $params->get('singleCatOrdering');
                    }
                    else
                    {
                        $ordering = $params->get('catOrdering');
                    }

                    break;

                case 'user' :
                    //Get user
                    $id = JRequest::getInt('id');
                    $userObject = JFactory::getUser($id);

                    //Check user status
                    if ($userObject->block)
                    {
                        JError::raiseError(404, JText::_('K2_USER_NOT_FOUND'));
                    }

                    //Set title
                    $title = $userObject->name;

                    // Set ordering
                    $ordering = $params->get('userOrdering');

                    break;

                case 'tag' :

                    // Prevent spammers from using the tag view
                    $tag = JRequest::getString('tag');
                    $db = JFactory::getDbo();
                    $db->setQuery('SELECT id, name FROM #__k2_tags WHERE name = '.$db->quote($tag));
                    $tag = $db->loadObject();
                    if (!$tag->id)
                    {
                      JError::raiseError(404, JText::_('K2_NOT_FOUND'));
                      return false;
                    }

                    //set title
                    $title = JText::_('K2_DISPLAYING_ITEMS_BY_TAG').' '.$tag->name;

                    // Set ordering
                    $ordering = $params->get('tagOrdering');
                    break;

                case 'search' :
                    //Set title
                    $title = JText::_('K2_SEARCH_RESULTS_FOR').' '.JRequest::getVar('searchword');
                    break;

                case 'date' :
                    // Set title
                    if (JRequest::getInt('day'))
                    {
                        $date = strtotime(JRequest::getInt('year').'-'.JRequest::getInt('month').'-'.JRequest::getInt('day'));
                        $dateFormat = (K2_JVERSION == '15') ? '%A, %d %B %Y' : 'l, d F Y';
                        $title = JText::_('K2_ITEMS_FILTERED_BY_DATE').' '.JHTML::_('date', $date, $dateFormat);
                    }
                    else
                    {
                        $date = strtotime(JRequest::getInt('year').'-'.JRequest::getInt('month'));
                        $dateFormat = (K2_JVERSION == '15') ? '%B %Y' : 'F Y';
                        $title = JText::_('K2_ITEMS_FILTERED_BY_DATE').' '.JHTML::_('date', $date, $dateFormat);
                    }
                    // Set ordering
                    $ordering = 'rdate';
                    break;

                default :

                    //Set featured flag
                    JRequest::setVar('featured', $params->get('catFeaturedItems'));

                    //Set title
                    $title = $params->get('page_title');

                    // Set ordering
                    $ordering = $params->get('catOrdering');

                    break;
            }

            // Various Feed Validations
            $title = JFilterOutput::ampReplace($title);

            // Get items
            if (!isset($ordering))
            {
                $items = $model->getData();
            }
            else
            {
                $items = $model->getData($ordering);
            }

        }

        // Prepare feed items
        $model = $this->getModel('item');
        foreach ($items as $item)
        {

            $item = $model->prepareFeedItem($item);
            $item->title = $this->escape($item->title);
            $item->title = html_entity_decode($item->title);
            $feedItem = new JFeedItem();
            $feedItem->title = $item->title;
            $feedItem->link = $item->link;
            $feedItem->description = $item->description;
            $feedItem->date = $item->created;
            $feedItem->category = $item->category->name;
            $feedItem->author = $item->author->name;
            if ($params->get('feedBogusEmail'))
            {
                $feedItem->authorEmail = $params->get('feedBogusEmail');
            }
            else
            {
                if ($application->getCfg('feed_email') == 'author')
                {
                    $feedItem->authorEmail = $item->author->email;
                }
                else
                {
                    $feedItem->authorEmail = $application->getCfg('mailfrom');
                }
            }

            // Add item
            $document->addItem($feedItem);
        }

        // Set title
        $document = JFactory::getDocument();
        $menus = $application->getMenu();
        $menu = $menus->getActive();
        if (is_object($menu))
        {
            $menu_params = class_exists('JParameter') ? new JParameter($menu->params) : new JRegistry($menu->params);
            if (!$menu_params->get('page_title'))
                $params->set('page_title', $title);
        }
        else
        {
            $params->set('page_title', $title);
        }
        if (K2_JVERSION != '15')
        {
            if ($application->getCfg('sitename_pagetitles', 0) == 1)
            {
                $title = JText::sprintf('JPAGETITLE', $application->getCfg('sitename'), $params->get('page_title'));
                $params->set('page_title', $title);
            }
            elseif ($application->getCfg('sitename_pagetitles', 0) == 2)
            {
                $title = JText::sprintf('JPAGETITLE', $params->get('page_title'), $application->getCfg('sitename'));
                $params->set('page_title', $title);
            }
        }
        $document->setTitle($params->get('page_title'));

    }

}
PK!��d���itemlist/metadata.xmlnu&1i�<?xml version="1.0" encoding="utf-8"?>
<metadata>
  <view title="K2_ITEM_LISTINGS">
    <message>K2_CREATE_A_MENU_ITEM_LINKING_TO_A_GRID_PAGE_WITH_THE_LATEST_ITEMS_FROM_SPECIFIC_USERS_OR_CATEGORIES_IN_K2</message>
  </view>
</metadata>
PK!�(z&33itemlist/tmpl/user_item.phpnu&1i�<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

?>
PK!�(z&33itemlist/tmpl/category_item.phpnu&1i�<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

?>
PK!�(z&33itemlist/tmpl/user.phpnu&1i�<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

?>
PK!���Iitemlist/tmpl/user.xmlnu&1i�<?xml version="1.0" encoding="utf-8"?>
<metadata>
	<layout title="K2_USER_PAGE_BLOG">
		<message>
			<![CDATA[K2_CREATE_A_MENU_ITEM_LINKING_TO_A_USER_PAGE_BLOG]]>
		</message>
	</layout>
	<state>
		<name>K2_USER_PAGE_BLOG</name>
		<description>K2_CREATE_A_MENU_ITEM_LINKING_TO_A_USER_PAGE_BLOG</description>
		<params addPath="/administrator/components/com_k2/elements">
			<param name="theme" type="template" default="default" label="K2_SELECT_A_TEMPLATE"/>
			<param name="userCategoriesFilter" type="categories" multiple="multiple" default="" label="K2_FILTER_CATEGORIES" description=""/>
			<param name="userOrdering" type="list" default="" label="K2_ITEM_ORDERING" description="">
				<option value="">K2_DEFAULT</option>
				<option value="date">K2_OLDEST_FIRST</option>
				<option value="rdate">K2_MOST_RECENT_FIRST</option>
				<option value="publishUp">K2_RECENTLY_PUBLISHED</option>
				<option value="alpha">K2_TITLE_ALPHABETICAL</option>
				<option value="ralpha">K2_TITLE_REVERSEALPHABETICAL</option>
				<option value="order">K2_ORDERING</option>
				<option value="rorder">K2_ORDERING_REVERSE</option>
				<option value="featured">K2_FEATURED_FIRST</option>
				<option value="hits">K2_MOST_POPULAR</option>
				<option value="best">K2_HIGHEST_RATED</option>
				<option value="rand">K2_RANDOM_ORDERING</option>
			</param>
			<param name="userFeedLink" type="radio" default="1" label="K2_RSS_FEED_LINK" description="">
				<option value="0">K2_DISABLE</option>
				<option value="1">K2_ENABLE</option>
			</param>
			<param name="userFeedIcon" type="radio" default="1" label="K2_RSS_FEED_ICON" description="">
				<option value="0">K2_DISABLE</option>
				<option value="1">K2_ENABLE</option>
			</param>
		</params>
		<url addpath="/administrator/components/com_k2/elements">
			<param name="id" type="k2modalselector" scope="user" default="" label="K2_SELECT_USER" description=""/>
			<param name="task" type="hidden" default="user"/>
		</url>
		<fields name="request" addfieldpath="/administrator/components/com_k2/elements">
			<fieldset name="request">
				<field name="id" type="k2modalselector" scope="user" default="" label="K2_SELECT_USER" description=""/>
				<field name="task" type="hidden" default="user"/>
			</fieldset>
		</fields>
		<fields name="params" addfieldpath="/administrator/components/com_k2/elements">
			<fieldset name="basic">
				<field name="theme" type="template" default="default" label="K2_SELECT_A_TEMPLATE"/>
				<field name="userCategoriesFilter" type="categories" multiple="multiple" default="" label="K2_FILTER_CATEGORIES" description=""/>
				<field name="userOrdering" type="list" default="" label="K2_ITEM_ORDERING" description="">
					<option value="">K2_DEFAULT</option>
					<option value="date">K2_OLDEST_FIRST</option>
					<option value="rdate">K2_MOST_RECENT_FIRST</option>
					<option value="publishUp">K2_RECENTLY_PUBLISHED</option>
					<option value="alpha">K2_TITLE_ALPHABETICAL</option>
					<option value="ralpha">K2_TITLE_REVERSEALPHABETICAL</option>
					<option value="order">K2_ORDERING</option>
					<option value="rorder">K2_ORDERING_REVERSE</option>
					<option value="featured">K2_FEATURED_FIRST</option>
					<option value="hits">K2_MOST_POPULAR</option>
					<option value="best">K2_HIGHEST_RATED</option>
					<option value="rand">K2_RANDOM_ORDERING</option>
				</field>
				<field name="userFeedLink" type="radio" default="1" label="K2_RSS_FEED_LINK" description="" class="btn-group btn-group-yesno">
					<option value="0">K2_DISABLE</option>
					<option value="1">K2_ENABLE</option>
				</field>
				<field name="userFeedIcon" type="radio" default="1" label="K2_RSS_FEED_ICON" description="" class="btn-group btn-group-yesno">
					<option value="0">K2_DISABLE</option>
					<option value="1">K2_ENABLE</option>
				</field>
			</fieldset>
		</fields>
	</state>
</metadata>
PK!o�nnitemlist/tmpl/generic.xmlnu&1i�<?xml version="1.0" encoding="utf-8"?>
<metadata>
	<layout title="Generic" hidden="true">
		<message>
			<![CDATA[This XML file is intentionally left blank to override the pre-v2.5 generic.xml file, which K2 used to create the 'tag' menu item. The 'tag' menu item now has its own tag.xml menu definition file.]]>
		</message>
	</layout>
	<state></state>
</metadata>
PK!�(z&33itemlist/tmpl/generic_item.phpnu&1i�<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

?>
PK!z�`%=%=itemlist/tmpl/category.xmlnu&1i�<?xml version="1.0" encoding="utf-8"?>
<metadata>
	<layout title="K2_CATEGORIES">
		<message>
			<![CDATA[K2_DISPLAYS_A_LIST_OF_ITEMS_FROM_ONE_OR_MORE_CATEGORIES]]>
		</message>
	</layout>
	<state>
		<name>K2_CATEGORIES</name>
		<description>K2_DISPLAYS_A_LIST_OF_ITEMS_FROM_ONE_OR_MORE_CATEGORIES</description>
		<params addpath="/administrator/components/com_k2/elements">
			<param name="" type="header" default="K2_SELECT_ONE_OR_MORE_CATEGORIES" label="" description=""/>
			<param name="categories" type="category" default="" label="K2_SELECT_CATEGORIES" description="K2_IF_YOU_SELECT_MULTIPLE_CATEGORIES_YOU_CAN_ADJUST_ADDITIONAL_PARAMETERS_BELOW_IF_YOU_SELECT_ONLY_ONE_CATEGORY_THEN_K2_WILL_FETCH_THE_OPTIONS_AS_DEFINED_IN_THAT_SPECIFIC_CATEGORYS_OPTIONS_IN_K2_CATEGORIES"/>
			<param name="catCatalogMode" type="radio" default="0" label="K2_FETCH_ITEMS_FROM_CHILDREN_CATEGORIES" description="K2_IF_YOU_SELECT_NO_THEN_ONLY_THE_ITEMS_DIRECTLY_BELONGING_TO_THIS_CATEGORY_WILL_BE_RETRIEVED_IF_YOU_SELECT_YES_THEN_ITEMS_FROM_ALL_SUBCATEGORIES_WILL_BE_RETRIEVED_SETTING_THIS_OPTION_TO_YES_IS_IDEAL_FOR_NEWSPORTALMAGAZINEBLOG_LAYOUTS">
				<option value="1">K2_NO</option>
				<option value="0">K2_YES</option>
			</param>
			<param name="" type="header" default="K2_LAYOUT_OPTIONS_FOR_SINGLE_CATEGORY_SELECTION" label="" description=""/>
			<param name="singleCatOrdering" type="list" default="" label="K2_ITEM_ORDERING" description="">
				<option value="">K2_INHERIT_FROM_CATEGORY</option>
				<option value="date">K2_OLDEST_FIRST</option>
				<option value="rdate">K2_MOST_RECENT_FIRST</option>
				<option value="publishUp">K2_RECENTLY_PUBLISHED</option>
				<option value="alpha">K2_TITLE_ALPHABETICAL</option>
				<option value="ralpha">K2_TITLE_REVERSEALPHABETICAL</option>
				<option value="order">K2_ORDERING</option>
				<option value="rorder">K2_ORDERING_REVERSE</option>
				<option value="featured">K2_FEATURED_FIRST</option>
				<option value="hits">K2_MOST_POPULAR</option>
				<option value="best">K2_HIGHEST_RATED</option>
				<option value="modified">K2_LATEST_MODIFIED</option>
				<option value="rand">K2_RANDOM_ORDERING</option>
			</param>
			<param name="" type="header" default="K2_LAYOUT_OPTIONS_FOR_MULTIPLE_CATEGORY_SELECTION" label="" description=""/>
			<param name="theme" type="template" default="default" label="K2_SELECT_A_TEMPLATE"/>
			<param name="@spacer" type="spacer" default="" label="" description=""/>
			<param name="num_leading_items" type="text" size="4" default="2" label="K2_LEADING_COUNT" description="K2_NUMBER_OF_ITEMS_TO_DISPLAY_AS_LEADING"/>
			<param name="num_leading_columns" type="text" size="4" default="1" label="K2_COLUMNS_FOR_LEADING" description=""/>
			<param name="leadingImgSize" type="list" default="Large" label="K2_IMAGE_SIZE_FOR_LEADING_ITEMS" description="K2_THE_DIMENSIONS_FOR_EACH_IMAGE_SIZE_ARE_DEFINED_INSIDE_K2S_GLOBAL_PARAMETERS">
				<option value="XSmall">K2_XSMALL</option>
				<option value="Small">K2_SMALL</option>
				<option value="Medium">K2_MEDIUM</option>
				<option value="Large">K2_LARGE</option>
				<option value="XLarge">K2_XLARGE</option>
				<option value="none">K2_NO_IMAGE</option>
			</param>
			<param name="@spacer" type="spacer" default="" label="" description=""/>
			<param name="num_primary_items" type="text" size="4" default="4" label="K2_PRIMARY_COUNT" description="K2_NUMBER_OF_ITEMS_TO_DISPLAY_AS_PRIMARY"/>
			<param name="num_primary_columns" type="text" size="4" default="2" label="K2_COLUMNS_FOR_PRIMARY" description=""/>
			<param name="primaryImgSize" type="list" default="Medium" label="K2_IMAGE_SIZE_FOR_PRIMARY_ITEMS" description="K2_THE_DIMENSIONS_FOR_EACH_IMAGE_SIZE_ARE_DEFINED_INSIDE_K2S_GLOBAL_PARAMETERS">
				<option value="XSmall">K2_XSMALL</option>
				<option value="Small">K2_SMALL</option>
				<option value="Medium">K2_MEDIUM</option>
				<option value="Large">K2_LARGE</option>
				<option value="XLarge">K2_XLARGE</option>
				<option value="none">K2_NO_IMAGE</option>
			</param>
			<param name="@spacer" type="spacer" default="" label="" description=""/>
			<param name="num_secondary_items" type="text" size="4" default="4" label="K2_SECONDARY_COUNT" description="K2_NUMBER_OF_ITEMS_TO_DISPLAY_AS_SECONDARY"/>
			<param name="num_secondary_columns" type="text" size="4" default="1" label="K2_COLUMNS_FOR_SECONDARY" description=""/>
			<param name="secondaryImgSize" type="list" default="Small" label="K2_IMAGE_SIZE_FOR_SECONDARY_ITEMS" description="K2_THE_DIMENSIONS_FOR_EACH_IMAGE_SIZE_ARE_DEFINED_INSIDE_K2S_GLOBAL_PARAMETERS">
				<option value="XSmall">K2_XSMALL</option>
				<option value="Small">K2_SMALL</option>
				<option value="Medium">K2_MEDIUM</option>
				<option value="Large">K2_LARGE</option>
				<option value="XLarge">K2_XLARGE</option>
				<option value="none">K2_NO_IMAGE</option>
			</param>
			<param name="@spacer" type="spacer" default="" label="" description=""/>
			<param name="num_links" type="text" size="4" default="4" label="K2_LINKS_COUNT" description="K2_NUMBER_OF_ITEMS_TO_DISPLAY_AS_LINKS"/>
			<param name="num_links_columns" type="text" size="4" default="1" label="K2_COLUMNS_FOR_LINKS" description=""/>
			<param name="linksImgSize" type="list" default="XSmall" label="K2_IMAGE_SIZE_FOR_LINK_ITEMS" description="K2_THE_DIMENSIONS_FOR_EACH_IMAGE_SIZE_ARE_DEFINED_INSIDE_K2S_GLOBAL_PARAMETERS">
				<option value="XSmall">K2_XSMALL</option>
				<option value="Small">K2_SMALL</option>
				<option value="Medium">K2_MEDIUM</option>
				<option value="Large">K2_LARGE</option>
				<option value="XLarge">K2_XLARGE</option>
				<option value="none">K2_NO_IMAGE</option>
			</param>
			<param name="@spacer" type="spacer" default="" label="" description=""/>
			<param name="catFeaturedItems" type="list" default="1" label="K2_FEATURED_ITEMS" description="">
				<option value="0">K2_HIDE</option>
				<option value="1">K2_SHOW</option>
				<option value="2">K2_SHOW_ONLY_FEATURED_ITEMS</option>
			</param>
			<param name="catOrdering" type="list" default="" label="K2_ITEM_ORDERING" description="">
				<option value="">K2_DEFAULT</option>
				<option value="date">K2_OLDEST_FIRST</option>
				<option value="rdate">K2_MOST_RECENT_FIRST</option>
				<option value="publishUp">K2_RECENTLY_PUBLISHED</option>
				<option value="alpha">K2_TITLE_ALPHABETICAL</option>
				<option value="ralpha">K2_TITLE_REVERSEALPHABETICAL</option>
				<option value="order">K2_ORDERING</option>
				<option value="rorder">K2_ORDERING_REVERSE</option>
				<option value="featured">K2_FEATURED_FIRST</option>
				<option value="hits">K2_MOST_POPULAR</option>
				<option value="best">K2_HIGHEST_RATED</option>
				<option value="modified">K2_LATEST_MODIFIED</option>
				<option value="rand">K2_RANDOM_ORDERING</option>
			</param>
			<param name="catPagination" type="list" default="2" label="K2_PAGINATION" description="">
				<option value="0">K2_HIDE</option>
				<option value="1">K2_SHOW</option>
				<option value="2">K2_AUTO</option>
			</param>
			<param name="catPaginationResults" type="radio" default="1" label="K2_PAGINATION_RESULTS" description="">
				<option value="0">K2_HIDE</option>
				<option value="1">K2_SHOW</option>
			</param>
			<param name="@spacer" type="spacer" default="" label="" description=""/>
			<param name="catFeedLink" type="radio" default="1" label="K2_RSS_FEED_LINK" description="">
				<option value="0">K2_DISABLE</option>
				<option value="1">K2_ENABLE</option>
			</param>
			<param name="catFeedIcon" type="radio" default="1" label="K2_RSS_FEED_ICON" description="">
				<option value="0">K2_HIDE</option>
				<option value="1">K2_SHOW</option>
			</param>
		</params>
		<url>
			<param name="task" type="hidden" default=""/>
			<param name="id" type="hidden" default=""/>
		</url>
		<fields name="request">
			<fieldset name="request">
				<field name="task" type="hidden" default=""/>
				<field name="id" type="hidden" default=""/>
			</fieldset>
		</fields>
		<fields name="params">
			<fieldset name="basic" addfieldpath="/administrator/components/com_k2/elements">
				<field name="" type="header" default="K2_SELECT_ONE_OR_MORE_CATEGORIES" label="" description=""/>
				<field name="categories" type="k2category" default="" label="K2_SELECT_CATEGORIES" description="K2_IF_YOU_SELECT_MULTIPLE_CATEGORIES_YOU_CAN_ADJUST_ADDITIONAL_PARAMETERS_BELOW_IF_YOU_SELECT_ONLY_ONE_CATEGORY_THEN_K2_WILL_FETCH_THE_OPTIONS_AS_DEFINED_IN_THAT_SPECIFIC_CATEGORYS_OPTIONS_IN_K2_CATEGORIES"/>
				<field name="catCatalogMode" type="radio" default="0" label="K2_FETCH_ITEMS_FROM_CHILDREN_CATEGORIES" description="K2_IF_YOU_SELECT_NO_THEN_ONLY_THE_ITEMS_DIRECTLY_BELONGING_TO_THIS_CATEGORY_WILL_BE_RETRIEVED_IF_YOU_SELECT_YES_THEN_ITEMS_FROM_ALL_SUBCATEGORIES_WILL_BE_RETRIEVED_SETTING_THIS_OPTION_TO_YES_IS_IDEAL_FOR_NEWSPORTALMAGAZINEBLOG_LAYOUTS" class="btn-group btn-group-yesno-reverse">
					<option value="1">K2_NO</option>
					<option value="0">K2_YES</option>
				</field>
				<field name="" type="header" default="K2_LAYOUT_OPTIONS_FOR_SINGLE_CATEGORY_SELECTION" label="" description=""/>
				<field name="singleCatOrdering" type="list" default="" label="K2_ITEM_ORDERING" description="">
					<option value="">K2_INHERIT_FROM_CATEGORY</option>
					<option value="date">K2_OLDEST_FIRST</option>
					<option value="rdate">K2_MOST_RECENT_FIRST</option>
					<option value="publishUp">K2_RECENTLY_PUBLISHED</option>
					<option value="alpha">K2_TITLE_ALPHABETICAL</option>
					<option value="ralpha">K2_TITLE_REVERSEALPHABETICAL</option>
					<option value="order">K2_ORDERING</option>
					<option value="rorder">K2_ORDERING_REVERSE</option>
					<option value="featured">K2_FEATURED_FIRST</option>
					<option value="hits">K2_MOST_POPULAR</option>
					<option value="best">K2_HIGHEST_RATED</option>
					<option value="modified">K2_LATEST_MODIFIED</option>
					<option value="rand">K2_RANDOM_ORDERING</option>
				</field>
				<field name="" type="header" default="K2_LAYOUT_OPTIONS_FOR_MULTIPLE_CATEGORY_SELECTION" label="" description=""/>
				<field name="theme" type="template" default="default" label="K2_SELECT_A_TEMPLATE"/>
				<field name="@spacer" type="spacer" default="" label="" description=""/>
				<field name="num_leading_items" type="text" size="4" default="2" label="K2_LEADING_COUNT" description="K2_NUMBER_OF_ITEMS_TO_DISPLAY_AS_LEADING"/>
				<field name="num_leading_columns" type="text" size="4" default="1" label="K2_COLUMNS_FOR_LEADING" description=""/>
				<field name="leadingImgSize" type="list" default="Large" label="K2_IMAGE_SIZE_FOR_LEADING_ITEMS" description="K2_THE_DIMENSIONS_FOR_EACH_IMAGE_SIZE_ARE_DEFINED_INSIDE_K2S_GLOBAL_PARAMETERS">
					<option value="XSmall">K2_XSMALL</option>
					<option value="Small">K2_SMALL</option>
					<option value="Medium">K2_MEDIUM</option>
					<option value="Large">K2_LARGE</option>
					<option value="XLarge">K2_XLARGE</option>
					<option value="none">K2_NO_IMAGE</option>
				</field>
				<field name="@spacer" type="spacer" default="" label="" description=""/>
				<field name="num_primary_items" type="text" size="4" default="4" label="K2_PRIMARY_COUNT" description="K2_NUMBER_OF_ITEMS_TO_DISPLAY_AS_PRIMARY"/>
				<field name="num_primary_columns" type="text" size="4" default="2" label="K2_COLUMNS_FOR_PRIMARY" description=""/>
				<field name="primaryImgSize" type="list" default="Medium" label="K2_IMAGE_SIZE_FOR_PRIMARY_ITEMS" description="K2_THE_DIMENSIONS_FOR_EACH_IMAGE_SIZE_ARE_DEFINED_INSIDE_K2S_GLOBAL_PARAMETERS">
					<option value="XSmall">K2_XSMALL</option>
					<option value="Small">K2_SMALL</option>
					<option value="Medium">K2_MEDIUM</option>
					<option value="Large">K2_LARGE</option>
					<option value="XLarge">K2_XLARGE</option>
					<option value="none">K2_NO_IMAGE</option>
				</field>
				<field name="@spacer" type="spacer" default="" label="" description=""/>
				<field name="num_secondary_items" type="text" size="4" default="4" label="K2_SECONDARY_COUNT" description="K2_NUMBER_OF_ITEMS_TO_DISPLAY_AS_SECONDARY"/>
				<field name="num_secondary_columns" type="text" size="4" default="1" label="K2_COLUMNS_FOR_SECONDARY" description=""/>
				<field name="secondaryImgSize" type="list" default="Small" label="K2_IMAGE_SIZE_FOR_SECONDARY_ITEMS" description="K2_THE_DIMENSIONS_FOR_EACH_IMAGE_SIZE_ARE_DEFINED_INSIDE_K2S_GLOBAL_PARAMETERS">
					<option value="XSmall">K2_XSMALL</option>
					<option value="Small">K2_SMALL</option>
					<option value="Medium">K2_MEDIUM</option>
					<option value="Large">K2_LARGE</option>
					<option value="XLarge">K2_XLARGE</option>
					<option value="none">K2_NO_IMAGE</option>
				</field>
				<field name="@spacer" type="spacer" default="" label="" description=""/>
				<field name="num_links" type="text" size="4" default="4" label="K2_LINKS_COUNT" description="K2_NUMBER_OF_ITEMS_TO_DISPLAY_AS_LINKS"/>
				<field name="num_links_columns" type="text" size="4" default="1" label="K2_COLUMNS_FOR_LINKS" description=""/>
				<field name="linksImgSize" type="list" default="XSmall" label="K2_IMAGE_SIZE_FOR_LINK_ITEMS" description="K2_THE_DIMENSIONS_FOR_EACH_IMAGE_SIZE_ARE_DEFINED_INSIDE_K2S_GLOBAL_PARAMETERS">
					<option value="XSmall">K2_XSMALL</option>
					<option value="Small">K2_SMALL</option>
					<option value="Medium">K2_MEDIUM</option>
					<option value="Large">K2_LARGE</option>
					<option value="XLarge">K2_XLARGE</option>
					<option value="none">K2_NO_IMAGE</option>
				</field>
				<field name="@spacer" type="spacer" default="" label="" description=""/>
				<field name="catFeaturedItems" type="list" default="1" label="K2_FEATURED_ITEMS" description="">
					<option value="0">K2_HIDE</option>
					<option value="1">K2_SHOW</option>
					<option value="2">K2_SHOW_ONLY_FEATURED_ITEMS</option>
				</field>
				<field name="catOrdering" type="list" default="" label="K2_ITEM_ORDERING" description="">
					<option value="">K2_DEFAULT</option>
					<option value="date">K2_OLDEST_FIRST</option>
					<option value="rdate">K2_MOST_RECENT_FIRST</option>
					<option value="publishUp">K2_RECENTLY_PUBLISHED</option>
					<option value="alpha">K2_TITLE_ALPHABETICAL</option>
					<option value="ralpha">K2_TITLE_REVERSEALPHABETICAL</option>
					<option value="order">K2_ORDERING</option>
					<option value="rorder">K2_ORDERING_REVERSE</option>
					<option value="featured">K2_FEATURED_FIRST</option>
					<option value="hits">K2_MOST_POPULAR</option>
					<option value="best">K2_HIGHEST_RATED</option>
					<option value="modified">K2_LATEST_MODIFIED</option>
					<option value="rand">K2_RANDOM_ORDERING</option>
				</field>
				<field name="catPagination" type="list" default="2" label="K2_PAGINATION" description="">
					<option value="0">K2_HIDE</option>
					<option value="1">K2_SHOW</option>
					<option value="2">K2_AUTO</option>
				</field>
				<field name="catPaginationResults" type="radio" default="1" label="K2_PAGINATION_RESULTS" description="" class="btn-group btn-group-yesno">
					<option value="0">K2_HIDE</option>
					<option value="1">K2_SHOW</option>
				</field>
				<field name="@spacer" type="spacer" default="" label="" description=""/>
				<field name="catFeedLink" type="radio" default="1" label="K2_RSS_FEED_LINK" description="" class="btn-group btn-group-yesno">
					<option value="0">K2_DISABLE</option>
					<option value="1">K2_ENABLE</option>
				</field>
				<field name="catFeedIcon" type="radio" default="1" label="K2_RSS_FEED_ICON" description="" class="btn-group btn-group-yesno">
					<option value="0">K2_HIDE</option>
					<option value="1">K2_SHOW</option>
				</field>
			</fieldset>
		</fields>
	</state>
</metadata>
PK!�(z&33itemlist/tmpl/category.phpnu&1i�<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

?>
PK!Ԁ�@@itemlist/tmpl/tag.xmlnu&1i�<?xml version="1.0" encoding="utf-8"?>
<metadata>
	<layout title="K2_TAG">
		<message>
			<![CDATA[K2_CREATE_A_MENU_ITEM_LINKING_TO_A_TAG_IN_K2]]>
		</message>
	</layout>
	<state>
		<name>K2_TAG</name>
		<description>K2_CREATE_A_MENU_ITEM_LINKING_TO_A_TAG_IN_K2</description>
		<params addpath="/administrator/components/com_k2/elements">
			<param name="theme" type="template" default="default" label="K2_SELECT_A_TEMPLATE"/>
			<param name="categoriesFilter" type="category" default="" label="K2_FILTER_CATEGORIES" description=""/>
			<param name="tagOrdering" type="list" default="" label="K2_ITEM_ORDERING" description="">
				<option value="">K2_INHERIT_FROM_PARAMS</option>
				<option value="id">K2_DEFAULT</option>
				<option value="date">K2_OLDEST_FIRST</option>
				<option value="rdate">K2_MOST_RECENT_FIRST</option>
				<option value="publishUp">K2_RECENTLY_PUBLISHED</option>
				<option value="alpha">K2_TITLE_ALPHABETICAL</option>
				<option value="ralpha">K2_TITLE_REVERSEALPHABETICAL</option>
				<option value="order">K2_ORDERING</option>
				<option value="rorder">K2_ORDERING_REVERSE</option>
				<option value="featured">K2_FEATURED_FIRST</option>
				<option value="hits">K2_MOST_POPULAR</option>
				<option value="best">K2_HIGHEST_RATED</option>
				<option value="rand">K2_RANDOM_ORDERING</option>
			</param>
			<param name="tagFeedLink" type="radio" default="1" label="K2_RSS_FEED_LINK" description="">
				<option value="0">K2_DISABLE</option>
				<option value="1">K2_ENABLE</option>
			</param>
			<param name="tagFeedIcon" type="radio" default="1" label="K2_RSS_FEED_ICON" description="">
				<option value="0">K2_DISABLE</option>
				<option value="1">K2_ENABLE</option>
			</param>
		</params>
		<url addpath="/administrator/components/com_k2/elements">
			<param name="tag" type="k2modalselector" scope="tag" default="" label="K2_SELECT_TAG_IN_MENUS" description=""/>
			<param name="task" type="hidden" default="tag"/>
		</url>
		<fields name="request">
			<fieldset name="request" addfieldpath="/administrator/components/com_k2/elements">
				<field name="tag" type="k2modalselector" scope="tag" default="" label="K2_SELECT_TAG_IN_MENUS" description=""/>
				<field name="task" type="hidden" default="tag"/>
			</fieldset>
		</fields>
		<fields name="params">
			<fieldset name="basic" addfieldpath="/administrator/components/com_k2/elements">
				<field name="theme" type="template" default="default" label="K2_SELECT_A_TEMPLATE"/>
				<field name="categoriesFilter" type="k2category" default="" label="K2_FILTER_CATEGORIES" description=""/>
				<field name="tagOrdering" type="list" default="" label="K2_ITEM_ORDERING" description="">
					<option value="">K2_INHERIT_FROM_PARAMS</option>
					<option value="id">K2_DEFAULT</option>
					<option value="date">K2_OLDEST_FIRST</option>
					<option value="rdate">K2_MOST_RECENT_FIRST</option>
					<option value="publishUp">K2_RECENTLY_PUBLISHED</option>
					<option value="alpha">K2_TITLE_ALPHABETICAL</option>
					<option value="ralpha">K2_TITLE_REVERSEALPHABETICAL</option>
					<option value="order">K2_ORDERING</option>
					<option value="rorder">K2_ORDERING_REVERSE</option>
					<option value="featured">K2_FEATURED_FIRST</option>
					<option value="hits">K2_MOST_POPULAR</option>
					<option value="best">K2_HIGHEST_RATED</option>
					<option value="rand">K2_RANDOM_ORDERING</option>
				</field>
				<field name="tagFeedLink" type="radio" default="1" label="K2_RSS_FEED_LINK" description="" class="btn-group btn-group-yesno">
					<option value="0">K2_DISABLE</option>
					<option value="1">K2_ENABLE</option>
				</field>
				<field name="tagFeedIcon" type="radio" default="1" label="K2_RSS_FEED_ICON" description="" class="btn-group btn-group-yesno">
					<option value="0">K2_DISABLE</option>
					<option value="1">K2_ENABLE</option>
				</field>
			</fieldset>
		</fields>
	</state>
</metadata>
PK!�(z&33itemlist/tmpl/tag.phpnu&1i�<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

?>
PK!��2�latest/metadata.xmlnu&1i�<?xml version="1.0" encoding="utf-8"?>
<metadata>
  <view title="K2_LATEST_ITEMS_FROM_ONE_OR_MORE_USERS_OR_CATEGORIES">
    <message>K2_CREATE_A_MENU_ITEM_LINKING_TO_A_GRID_PAGE_WITH_THE_LATEST_ITEMS_FROM_SPECIFIC_CATEGORIES_OR_USERS_IN_K2</message>
  </view>
</metadata>
PK!N؃r9r9latest/tmpl/latest.xmlnu&1i�<?xml version="1.0" encoding="utf-8"?>
<metadata>
	<layout title="K2_LATEST_ITEMS_FROM_ONE_OR_MORE_USERS_OR_CATEGORIES">
		<message>
			<![CDATA[K2_CREATE_A_MENU_ITEM_LINKING_TO_A_GRID_PAGE_WITH_THE_LATEST_ITEMS_FROM_SPECIFIC_CATEGORIES_OR_USERS_IN_K2]]>
		</message>
	</layout>
	<state>
		<name>K2_LATEST_ITEMS_FROM_ONE_OR_MORE_USERS_OR_CATEGORIES</name>
		<description>K2_CREATE_A_MENU_ITEM_LINKING_TO_A_GRID_PAGE_WITH_THE_LATEST_ITEMS_FROM_SPECIFIC_CATEGORIES_OR_USERS_IN_K2</description>
		<params addPath="/administrator/components/com_k2/elements">
		    <param name="theme" type="template" default="default" label="K2_SELECT_A_TEMPLATE"/>
			<param name="" type="header" default="K2_CONTENT_SOURCE" label="" description=""/>
			<param name="source" type="list" default="0" label="K2_CHOOSE_CONTENT_SOURCE" description="K2_PLEASE_SELECT_WHETHER_TO_RETRIEVE_CONTENT_FROM_K2_USERS_OR_CATEGORIES">
				<option value="0">K2_USERS</option>
				<option value="1">K2_CATEGORIES</option>
			</param>
			<param name="latestItemsCols" type="text" default="2" size="4" label="K2_NUMBER_OF_COLUMNS"/>
			<param name="latestItemsLimit" type="text" default="3" size="4" label="K2_MAXIMUM_NUMBER_OF_ITEMS_PER_USER_OR_CATEGORY"/>
			<param name="latestItemsDisplayEffect" type="list" default="all" label="K2_ITEM_VIEW_OPTIONS_SET_BELOW_EFFECT" description="">
				<option value="first">K2_EFFECT_THE_FIRST_ITEM_ONLY_SUBSEQUENT_ITEMS_DISPLAY_TITLE_ONLY</option>
				<option value="all">K2_ALL_FETCHED_ITEMS</option>
			</param>
			<param name="" type="header" default="K2_USER_SETTINGS" label="" description=""/>
			<param name="userIDs" type="k2modalselector" scope="users" default="" label="K2_SELECTED_USERS_SORT_WITH_DRAG_DROP" description="K2_DRAG_USERS_ONE_BY_ONE_TO_REORDER_THE_LIST_CLICK_THE_REMOVE_ICON_TO_REMOVE_A_USER_FROM_THE_LIST"/>
			<param name="userName" type="radio" default="1" label="K2_NAME" description="">
				<option value="0">K2_HIDE</option>
				<option value="1">K2_SHOW</option>
			</param>
			<param name="userImage" type="radio" default="1" label="K2_IMAGE_AVATAR" description="">
				<option value="0">K2_HIDE</option>
				<option value="1">K2_SHOW</option>
			</param>
			<param name="userDescription" type="radio" default="1" label="K2_DESCRIPTION" description="">
				<option value="0">K2_HIDE</option>
				<option value="1">K2_SHOW</option>
			</param>
			<param name="userURL" type="radio" default="1" label="K2_URL" description="">
				<option value="0">K2_HIDE</option>
				<option value="1">K2_SHOW</option>
			</param>
			<param name="userEmail" type="radio" default="0" label="K2_EMAIL" description="">
				<option value="0">K2_HIDE</option>
				<option value="1">K2_SHOW</option>
			</param>
			<param name="userFeed" type="radio" default="1" label="K2_RSS_FEED_ICON" description="">
				<option value="0">K2_HIDE</option>
				<option value="1">K2_SHOW</option>
			</param>
			<param name="" type="header" default="K2_CATEGORY_SETTINGS" label="" description=""/>
			<param name="categoryIDs" type="k2modalselector" scope="categories" default="" label="K2_SELECTED_CATEGORIES_SORT_WITH_DRAG_DROP" description="K2_DRAG_CATEGORIES_ONE_BY_ONE_TO_REORDER_THE_LIST_CLICK_THE_REMOVE_ICON_TO_REMOVE_A_CATEGORY_FROM_THE_LIST"/>
			<param name="categoryTitle" type="radio" default="1" label="K2_TITLE" description="">
				<option value="0">K2_HIDE</option>
				<option value="1">K2_SHOW</option>
			</param>
			<param name="categoryDescription" type="radio" default="1" label="K2_DESCRIPTION" description="">
				<option value="0">K2_HIDE</option>
				<option value="1">K2_SHOW</option>
			</param>
			<param name="categoryImage" type="radio" default="1" label="K2_IMAGE" description="">
				<option value="0">K2_HIDE</option>
				<option value="1">K2_SHOW</option>
			</param>
			<param name="categoryFeed" type="radio" default="1" label="K2_RSS_FEED_ICON" description="">
				<option value="0">K2_HIDE</option>
				<option value="1">K2_SHOW</option>
			</param>
			<param name="" type="header" default="K2_ITEM_VIEW_OPTIONS_COMMON_FOR_USER_OR_CATEGORY_SOURCE" label="" description=""/>
			<param name="latestItemTitle" type="radio" default="1" label="K2_TITLE" description="">
				<option value="0">K2_HIDE</option>
				<option value="1">K2_SHOW</option>
			</param>
			<param name="latestItemTitleLinked" type="radio" default="1" label="K2_LINK_ON_TITLE" description="">
				<option value="0">K2_HIDE</option>
				<option value="1">K2_SHOW</option>
			</param>
			<param name="latestItemDateCreated" type="radio" default="1" label="K2_ITEM_CREATED_DATE_AND_TIME" description="">
				<option value="0">K2_HIDE</option>
				<option value="1">K2_SHOW</option>
			</param>
			<param name="latestItemImage" type="radio" default="1" label="K2_IMAGE" description="">
				<option value="0">K2_HIDE</option>
				<option value="1">K2_SHOW</option>
			</param>
			<param name="latestItemImageSize" type="list" default="Medium" label="K2_IMAGE_SIZE" description="">
				<option value="XSmall">K2_XSMALL</option>
				<option value="Small">K2_SMALL</option>
				<option value="Medium">K2_MEDIUM</option>
				<option value="Large">K2_LARGE</option>
				<option value="XLarge">K2_XLARGE</option>
			</param>
			<param name="latestItemVideo" type="radio" default="1" label="K2_VIDEO" description="">
				<option value="0">K2_HIDE</option>
				<option value="1">K2_SHOW</option>
			</param>
			<param name="latestItemVideoWidth" type="text" default="" size="4" label="K2_VIDEO_WIDTH" description=""/>
			<param name="latestItemVideoHeight" type="text" default="" size="4" label="K2_VIDEO_HEIGHT" description=""/>
			<param name="latestItemAudioWidth" type="text" default="" size="4" label="K2_AUDIO_WIDTH" description=""/>
			<param name="latestItemAudioHeight" type="text" default="" size="4" label="K2_AUDIO_HEIGHT" description=""/>
			<param name="latestItemVideoAutoPlay" type="radio" default="0" label="K2_MEDIA_AUTOPLAY" description="">
				<option value="0">K2_NO</option>
				<option value="1">K2_YES</option>
			</param>
			<param name="latestItemIntroText" type="radio" default="1" label="K2_INTROTEXT" description="">
				<option value="0">K2_HIDE</option>
				<option value="1">K2_SHOW</option>
			</param>
			<param name="latestItemCategory" type="radio" default="1" label="K2_CATEGORY" description="">
				<option value="0">K2_HIDE</option>
				<option value="1">K2_SHOW</option>
			</param>
			<param name="latestItemTags" type="radio" default="1" label="K2_TAGS" description="">
				<option value="0">K2_HIDE</option>
				<option value="1">K2_SHOW</option>
			</param>
			<param name="latestItemReadMore" type="radio" default="1" label="K2_READ_MORE_LINK" description="">
				<option value="0">K2_HIDE</option>
				<option value="1">K2_SHOW</option>
			</param>
			<param name="latestItemCommentsAnchor" type="radio" default="0" label="K2_ANCHOR_LINK_WITH_COMMENTS_COUNTER_TO_ITEMS_COMMENT_FORM" description="">
				<option value="0">K2_HIDE</option>
				<option value="1">K2_SHOW</option>
			</param>
			<param name="" type="header" default="K2_ADVANCED" label="" description=""/>
			<param name="feedLink" type="radio" default="1" label="K2_RSS_FEED_LINK" description="">
				<option value="0">K2_DISABLE</option>
				<option value="1">K2_ENABLE</option>
			</param>
			<param name="latestItemK2Plugins" type="radio" default="0" label="K2_ENABLE_K2_PLUGINS" description="">
				<option value="0">K2_NO</option>
				<option value="1">K2_YES</option>
			</param>
		</params>
		<fields name="params">
			<fieldset name="basic" addfieldpath="/administrator/components/com_k2/elements">
			    <field name="theme" type="template" default="default" label="K2_SELECT_A_TEMPLATE"/>
				<field name="" type="header" default="K2_CONTENT_SOURCE" label="" description=""/>
				<field name="source" type="list" default="0" label="K2_CHOOSE_CONTENT_SOURCE" description="K2_PLEASE_SELECT_WHETHER_TO_RETRIEVE_CONTENT_FROM_K2_USERS_OR_CATEGORIES">
					<option value="0">K2_USERS</option>
					<option value="1">K2_CATEGORIES</option>
				</field>
				<field name="latestItemsCols" type="text" default="2" size="4" label="K2_NUMBER_OF_COLUMNS"/>
				<field name="latestItemsLimit" type="text" default="3" size="4" label="K2_MAXIMUM_NUMBER_OF_ITEMS_PER_USER_OR_CATEGORY"/>
				<field name="latestItemsDisplayEffect" type="list" default="all" label="K2_ITEM_VIEW_OPTIONS_SET_BELOW_EFFECT" description="">
					<option value="first">K2_EFFECT_THE_FIRST_ITEM_ONLY_SUBSEQUENT_ITEMS_DISPLAY_TITLE_ONLY</option>
					<option value="all">K2_ALL_FETCHED_ITEMS</option>
				</field>
				<field name="" type="header" default="K2_USER_SETTINGS" label="" description=""/>
				<field name="userIDs" type="k2modalselector" scope="users" default="" label="K2_SELECTED_USERS_SORT_WITH_DRAG_DROP" description="K2_DRAG_USERS_ONE_BY_ONE_TO_REORDER_THE_LIST_CLICK_THE_REMOVE_ICON_TO_REMOVE_A_USER_FROM_THE_LIST"/>
				<field name="userName" type="radio" default="1" label="K2_NAME" description="">
					<option value="0">K2_HIDE</option>
					<option value="1">K2_SHOW</option>
				</field>
				<field name="userImage" type="radio" default="1" label="K2_IMAGE_AVATAR" description="">
					<option value="0">K2_HIDE</option>
					<option value="1">K2_SHOW</option>
				</field>
				<field name="userDescription" type="radio" default="1" label="K2_DESCRIPTION" description="">
					<option value="0">K2_HIDE</option>
					<option value="1">K2_SHOW</option>
				</field>
				<field name="userURL" type="radio" default="1" label="K2_URL" description="">
					<option value="0">K2_HIDE</option>
					<option value="1">K2_SHOW</option>
				</field>
				<field name="userEmail" type="radio" default="0" label="K2_EMAIL" description="">
					<option value="0">K2_HIDE</option>
					<option value="1">K2_SHOW</option>
				</field>
				<field name="userFeed" type="radio" default="1" label="K2_RSS_FEED_ICON" description="">
					<option value="0">K2_HIDE</option>
					<option value="1">K2_SHOW</option>
				</field>
				<field name="" type="header" default="K2_CATEGORY_SETTINGS" label="" description=""/>
				<field name="categoryIDs" type="k2modalselector" scope="categories" default="" label="K2_SELECTED_CATEGORIES_SORT_WITH_DRAG_DROP" description="K2_DRAG_CATEGORIES_ONE_BY_ONE_TO_REORDER_THE_LIST_CLICK_THE_REMOVE_ICON_TO_REMOVE_A_CATEGORY_FROM_THE_LIST"/>
				<field name="categoryTitle" type="radio" default="1" label="K2_TITLE" description="">
					<option value="0">K2_HIDE</option>
					<option value="1">K2_SHOW</option>
				</field>
				<field name="categoryDescription" type="radio" default="1" label="K2_DESCRIPTION" description="">
					<option value="0">K2_HIDE</option>
					<option value="1">K2_SHOW</option>
				</field>
				<field name="categoryImage" type="radio" default="1" label="K2_IMAGE" description="">
					<option value="0">K2_HIDE</option>
					<option value="1">K2_SHOW</option>
				</field>
				<field name="categoryFeed" type="radio" default="1" label="K2_RSS_FEED_ICON" description="">
					<option value="0">K2_HIDE</option>
					<option value="1">K2_SHOW</option>
				</field>
				<field name="" type="header" default="K2_ITEM_VIEW_OPTIONS_COMMON_FOR_USER_OR_CATEGORY_SOURCE" label="" description=""/>
				<field name="latestItemTitle" type="radio" default="1" label="K2_TITLE" description="">
					<option value="0">K2_HIDE</option>
					<option value="1">K2_SHOW</option>
				</field>
				<field name="latestItemTitleLinked" type="radio" default="1" label="K2_LINK_ON_TITLE" description="">
					<option value="0">K2_HIDE</option>
					<option value="1">K2_SHOW</option>
				</field>
				<field name="latestItemDateCreated" type="radio" default="1" label="K2_ITEM_CREATED_DATE_AND_TIME" description="">
					<option value="0">K2_HIDE</option>
					<option value="1">K2_SHOW</option>
				</field>
				<field name="latestItemImage" type="radio" default="1" label="K2_IMAGE" description="">
					<option value="0">K2_HIDE</option>
					<option value="1">K2_SHOW</option>
				</field>
				<field name="latestItemImageSize" type="list" default="Medium" label="K2_IMAGE_SIZE" description="">
					<option value="XSmall">K2_XSMALL</option>
					<option value="Small">K2_SMALL</option>
					<option value="Medium">K2_MEDIUM</option>
					<option value="Large">K2_LARGE</option>
					<option value="XLarge">K2_XLARGE</option>
				</field>
				<field name="latestItemVideo" type="radio" default="1" label="K2_VIDEO" description="">
					<option value="0">K2_HIDE</option>
					<option value="1">K2_SHOW</option>
				</field>
				<field name="latestItemVideoWidth" type="text" default="" size="4" label="K2_VIDEO_WIDTH" description=""/>
				<field name="latestItemVideoHeight" type="text" default="" size="4" label="K2_VIDEO_HEIGHT" description=""/>
				<field name="latestItemAudioWidth" type="text" default="" size="4" label="K2_AUDIO_WIDTH" description=""/>
				<field name="latestItemAudioHeight" type="text" default="" size="4" label="K2_AUDIO_HEIGHT" description=""/>
				<field name="latestItemVideoAutoPlay" type="radio" default="0" label="K2_MEDIA_AUTOPLAY" description="">
					<option value="0">K2_NO</option>
					<option value="1">K2_YES</option>
				</field>
				<field name="latestItemIntroText" type="radio" default="1" label="K2_INTROTEXT" description="">
					<option value="0">K2_HIDE</option>
					<option value="1">K2_SHOW</option>
				</field>
				<field name="latestItemCategory" type="radio" default="1" label="K2_CATEGORY" description="">
					<option value="0">K2_HIDE</option>
					<option value="1">K2_SHOW</option>
				</field>
				<field name="latestItemTags" type="radio" default="1" label="K2_TAGS" description="">
					<option value="0">K2_HIDE</option>
					<option value="1">K2_SHOW</option>
				</field>
				<field name="latestItemReadMore" type="radio" default="1" label="K2_READ_MORE_LINK" description="">
					<option value="0">K2_HIDE</option>
					<option value="1">K2_SHOW</option>
				</field>
				<field name="latestItemCommentsAnchor" type="radio" default="0" label="K2_ANCHOR_LINK_WITH_COMMENTS_COUNTER_TO_ITEMS_COMMENT_FORM" description="">
					<option value="0">K2_HIDE</option>
					<option value="1">K2_SHOW</option>
				</field>
				<field name="" type="header" default="K2_ADVANCED" label="" description=""/>
				<field name="feedLink" type="radio" default="1" label="K2_RSS_FEED_LINK" description="">
					<option value="0">K2_DISABLE</option>
					<option value="1">K2_ENABLE</option>
				</field>
				<field name="latestItemK2Plugins" type="radio" default="0" label="K2_ENABLE_K2_PLUGINS" description="">
					<option value="0">K2_NO</option>
					<option value="1">K2_YES</option>
				</field>
			</fieldset>
		</fields>
	</state>
</metadata>
PK!�(z&33latest/tmpl/latest.phpnu&1i�<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

?>
PK!�(z&33latest/tmpl/latest_item.phpnu&1i�<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

?>
PK!J����5�5latest/view.html.phpnu&1i�<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

jimport('joomla.application.component.view');

class K2ViewLatest extends K2View
{
    public function display($tpl = null)
    {
        $application = JFactory::getApplication();
        $params = K2HelperUtilities::getParams('com_k2');
        $document = JFactory::getDocument();
        $user = JFactory::getUser();
        $cache = JFactory::getCache('com_k2_extended');
        $limit = $params->get('latestItemsLimit');
        $limitstart = JRequest::getInt('limitstart');
        $model = $this->getModel('itemlist');
        $itemModel = $this->getModel('item');

        if ($params->get('source')) {
            $categoryIDs = $params->get('categoryIDs');
            if (is_string($categoryIDs) && !empty($categoryIDs)) {
                $categoryIDs = array();
                $categoryIDs[] = $params->get('categoryIDs');
            }
            $categories = array();
            JTable::addIncludePath(JPATH_ADMINISTRATOR.'/components/com_k2/tables');
            if (is_array($categoryIDs)) {
                foreach ($categoryIDs as $categoryID) {
                    $category = JTable::getInstance('K2Category', 'Table');
                    $category->load($categoryID);
                    $category->event = new stdClass;
                    $languageCheck = true;
                    if (K2_JVERSION != '15') {
                        $accessCheck = in_array($category->access, $user->getAuthorisedViewLevels());
                        if ($application->getLanguageFilter()) {
                            $languageTag = JFactory::getLanguage()->getTag();
                            $languageCheck = in_array($category->language, array($languageTag, '*'));
                        }
                    } else {
                        $accessCheck = $category->access <= $user->get('aid', 0);
                    }

                    if ($category->published && $accessCheck && $languageCheck) {

                        //Merge params
                        $cparams = class_exists('JParameter') ? new JParameter($category->params) : new JRegistry($category->params);
                        if ($cparams->get('inheritFrom')) {
                            $masterCategory = JTable::getInstance('K2Category', 'Table');
                            $masterCategory->load($cparams->get('inheritFrom'));
                            $cparams = class_exists('JParameter') ? new JParameter($masterCategory->params) : new JRegistry($masterCategory->params);
                        }
                        $params->merge($cparams);

                        //Category image
                        $category->image = K2HelperUtilities::getCategoryImage($category->image, $params);

                        //Category plugins
                        $dispatcher = JDispatcher::getInstance();
                        JPluginHelper::importPlugin('content');
                        $category->text = $category->description;

                        if (K2_JVERSION != '15') {
                            $dispatcher->trigger('onContentPrepare', array('com_k2.category', &$category, &$params, $limitstart));
                        } else {
                            $dispatcher->trigger('onPrepareContent', array(&$category, &$params, $limitstart));
                        }
                        $category->description = $category->text;

                        //Category K2 plugins
                        $category->event->K2CategoryDisplay = '';
                        JPluginHelper::importPlugin('k2');
                        $results = $dispatcher->trigger('onK2CategoryDisplay', array(&$category, &$params, $limitstart));
                        $category->event->K2CategoryDisplay = trim(implode("\n", $results));
                        $category->text = $category->description;
                        $dispatcher->trigger('onK2PrepareContent', array(&$category, &$params, $limitstart));
                        $category->description = $category->text;

                        //Category link
                        $link = urldecode(K2HelperRoute::getCategoryRoute($category->id.':'.urlencode($category->alias)));
                        $category->link = JRoute::_($link);
                        $category->feed = JRoute::_($link.'&format=feed');

                        JRequest::setVar('view', 'itemlist');
                        JRequest::setVar('task', 'category');
                        JRequest::setVar('id', $category->id);
                        JRequest::setVar('featured', 1);
                        JRequest::setVar('limit', $limit);
                        JRequest::setVar('clearFlag', true);

                        $category->name = htmlspecialchars($category->name, ENT_QUOTES);
                        if ($limit) {
                            $category->items = $model->getData('rdate');

                            JRequest::setVar('view', 'latest');
                            JRequest::setVar('task', '');

                            for ($i = 0; $i < sizeof($category->items); $i++) {
                                $hits = $category->items[$i]->hits;
                                $category->items[$i]->hits = 0;
                                $category->items[$i] = $cache->call(array($itemModel, 'prepareItem'), $category->items[$i], 'latest', '');
                                $category->items[$i]->hits = $hits;
                                $category->items[$i] = $itemModel->execPlugins($category->items[$i], 'latest', '');

                                //Trigger comments counter event
                                $dispatcher = JDispatcher::getInstance();
                                JPluginHelper::importPlugin('k2');
                                $results = $dispatcher->trigger('onK2CommentsCounter', array(&$category->items[$i], &$params, $limitstart));
                                $category->items[$i]->event->K2CommentsCounter = trim(implode("\n", $results));
                            }
                        } else {
                            $category->items = array();
                        }
                        $categories[] = $category;
                    }
                }
            }
            $source = 'categories';
            $this->assignRef('blocks', $categories);
        } else {
            $usersIDs = $params->get('userIDs');
            if (is_string($usersIDs) && !empty($usersIDs)) {
                $usersIDs = array();
                $usersIDs[] = $params->get('userIDs');
            }

            $users = array();
            if (is_array($usersIDs)) {
                foreach ($usersIDs as $userID) {
                    $userObject = JFactory::getUser($userID);
                    if (!$userObject->block) {
                        $userObject->event = new stdClass;

                        //User profile
                        $userObject->profile = $model->getUserProfile($userID);

                        //User image
                        $userObject->avatar = K2HelperUtilities::getAvatar($userObject->id, $userObject->email, $params->get('userImageWidth'));

                        //User K2 plugins
                        $userObject->event->K2UserDisplay = '';
                        if (is_object($userObject->profile) && $userObject->profile->id > 0) {
                            $dispatcher = JDispatcher::getInstance();
                            JPluginHelper::importPlugin('k2');
                            $results = $dispatcher->trigger('onK2UserDisplay', array(&$userObject->profile, &$params, $limitstart));
                            $userObject->event->K2UserDisplay = trim(implode("\n", $results));
                            $userObject->profile->url = htmlspecialchars($userObject->profile->url, ENT_QUOTES, 'UTF-8');
                        }

                        $link = K2HelperRoute::getUserRoute($userObject->id);
                        $userObject->link = JRoute::_($link);
                        $userObject->feed = JRoute::_($link.'&format=feed');
                        $userObject->name = htmlspecialchars($userObject->name, ENT_QUOTES);
                        if ($limit) {
                            $userObject->items = $model->getAuthorLatest(0, $limit, $userID);

                            for ($i = 0; $i < sizeof($userObject->items); $i++) {
                                $hits = $userObject->items[$i]->hits;
                                $userObject->items[$i]->hits = 0;
                                $userObject->items[$i] = $cache->call(array($itemModel, 'prepareItem'), $userObject->items[$i], 'latest', '');
                                $userObject->items[$i]->hits = $hits;

                                //Plugins
                                $userObject->items[$i] = $itemModel->execPlugins($userObject->items[$i], 'latest', '');

                                //Trigger comments counter event
                                $dispatcher = JDispatcher::getInstance();
                                JPluginHelper::importPlugin('k2');
                                $results = $dispatcher->trigger('onK2CommentsCounter', array(&$userObject->items[$i], &$params, $limitstart));
                                $userObject->items[$i]->event->K2CommentsCounter = trim(implode("\n", $results));
                            }
                        } else {
                            $userObject->items = array();
                        }
                        $users[] = $userObject;
                    }
                }
            }
            $source = 'users';
            $this->assignRef('blocks', $users);
        }

        // Browser title
        $browserTitle = $params->get('page_title');
        if (K2_JVERSION != '15') {
            if ($application->getCfg('sitename_pagetitles', 0) == 1) {
                $browserTitle = JText::sprintf('JPAGETITLE', $application->getCfg('sitename'), $params->get('page_title'));
            } elseif ($application->getCfg('sitename_pagetitles', 0) == 2) {
                $browserTitle = JText::sprintf('JPAGETITLE', $params->get('page_title'), $application->getCfg('sitename'));
            }
        }
        $document->setTitle($browserTitle);


        // Set menu metadata for Joomla 2.5+
        if (K2_JVERSION != '15') {
            if ($params->get('menu-meta_description')) {
                $document->setDescription($params->get('menu-meta_description'));
            }

            if ($params->get('menu-meta_keywords')) {
                $document->setMetadata('keywords', $params->get('menu-meta_keywords'));
            }

            if ($params->get('robots')) {
                $document->setMetadata('robots', $params->get('robots'));
            }

            // Menu page display options
            if ($params->get('page_heading')) {
                $params->set('page_title', $params->get('page_heading'));
            }
            $params->set('show_page_title', $params->get('show_page_heading'));
        }

        // Set Facebook meta data
        if ($params->get('facebookMetatags', '1')) {
            $document = JFactory::getDocument();
            $uri = JURI::getInstance();
            $document->setMetaData('og:url', $uri->toString());
            $document->setMetaData('og:title', (K2_JVERSION == '15') ? htmlspecialchars($document->getTitle(), ENT_QUOTES, 'UTF-8') : $document->getTitle());
            $document->setMetaData('og:type', 'website');
            $document->setMetaData('og:description', strip_tags($document->getDescription()));
        }

        // Lookup template folders
        $this->_addPath('template', JPATH_COMPONENT.'/templates');
        $this->_addPath('template', JPATH_COMPONENT.'/templates/default');

        $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2/templates');
        $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2/templates/default');

        $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2');
        $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2/default');

        $theme = $params->get('theme');
        if ($theme) {
            $this->_addPath('template', JPATH_COMPONENT.'/templates/'.$theme);
            $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2/templates/'.$theme);
            $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2/'.$theme);
        }

        // Allow temporary template loading with ?template=
        $template = JRequest::getCmd('template');
        if (isset($template)) {
            // Look for overrides in template folder (new K2 template structure)
            $this->_addPath('template', JPATH_SITE.'/templates/'.$template.'/html/com_k2');
            $this->_addPath('template', JPATH_SITE.'/templates/'.$template.'/html/com_k2/default');
            if ($theme) {
                $this->_addPath('template', JPATH_SITE.'/templates/'.$template.'/html/com_k2/'.$theme);
            }
        }

        //Assign params
        $this->assignRef('params', $params);
        $this->assignRef('source', $source);

        //Set layout
        $this->setLayout('latest');

        //Display
        parent::display($tpl);
    }
}
PK!�IJ���item/metadata.xmlnu&1i�<?xml version="1.0" encoding="utf-8"?>
<metadata>
  <view title="K2_ITEM">
    <message>K2_CREATE_A_MENU_ITEM_LINKING_DIRECTLY_TO_AN_ITEM_IN_K2</message>
  </view>
</metadata>
PK!2
�DDitem/tmpl/item.xmlnu&1i�<?xml version="1.0" encoding="utf-8"?>
<metadata>
	<layout title="K2_ITEM">
		<message>K2_CREATE_A_MENU_ITEM_LINKING_DIRECTLY_TO_AN_ITEM_IN_K2</message>
	</layout>
	<state>
		<name>K2_ITEM</name>
		<description>K2_CREATE_A_MENU_ITEM_LINKING_DIRECTLY_TO_AN_ITEM_IN_K2</description>
		<url addpath="/administrator/components/com_k2/elements">
			<param name="id" type="k2modalselector" scope="item" default="" label="K2_SELECT_ITEM" description="K2_SELECT_AN_ITEM_TO_LINK_TO_DIRECTLY"/>
		</url>
		<params></params>
		<fields name="request">
			<fieldset name="request" addfieldpath="/administrator/components/com_k2/elements">
				<field name="id" type="k2modalselector" scope="item" default="" label="K2_SELECT_ITEM" description="K2_SELECT_AN_ITEM_TO_LINK_TO_DIRECTLY" required="true"/>
			</fieldset>
		</fields>
	</state>
</metadata>
PK!�(z&33 item/tmpl/item_comments_form.phpnu&1i�<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

?>
PK!�(z&33item/tmpl/item.phpnu&1i�<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

?>
PK!�(z&33item/tmpl/itemform.phpnu&1i�<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

?>
PK!�Sitem/tmpl/itemform.xmlnu&1i�<?xml version="1.0" encoding="utf-8"?>
<metadata>
	<layout title="K2_ITEM_EDIT_FORM">
		<message>K2_CREATE_A_MENU_ITEM_LINKING_TO_ITEM_EDIT_FORM</message>
	</layout>
	<state>
		<name>K2_ITEM_EDIT_FORM</name>
		<description>K2_CREATE_A_MENU_ITEM_LINKING_TO_ITEM_EDIT_FORM</description>
		<params addpath="/administrator/components/com_k2/elements">
			<param name="theme" type="template" default="default" label="K2_SELECT_A_TEMPLATE" />
			<param name="category" type="categories" default="" label="K2_PRESELECTED_CATEGORY" />
			<param name="itemform" type="itemform" />
		</params>
		<url addpath="/administrator/components/com_k2/elements">
			<param name="task" type="hidden" default="add" />
		</url>
		<params></params>
		<fields name="params">
			<fieldset name="basic" addfieldpath="/administrator/components/com_k2/elements">
				<field name="theme" type="template" default="default" label="K2_SELECT_A_TEMPLATE" />
				<field name="category" type="categories" default="" label="K2_PRESELECTED_CATEGORY" />
				<field name="itemform" type="itemform" />
			</fieldset>
		</fields>
		<fields name="request">
			<fieldset name="request" addfieldpath="/administrator/components/com_k2/elements">
				<field name="task" type="hidden" default="add" />
			</fieldset>
		</fields>
	</state>
</metadata>
PK!��[=�e�eitem/view.html.phpnu&1i�<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

jimport('joomla.application.component.view');

class K2ViewItem extends K2View
{
    public function display($tpl = null)
    {
        $application = JFactory::getApplication();
        $user = JFactory::getUser();
        $document = JFactory::getDocument();
        $params = K2HelperUtilities::getParams('com_k2');
        $limitstart = JRequest::getInt('limitstart', 0);
        $view = JRequest::getWord('view');
        $task = JRequest::getWord('task');

        $db = JFactory::getDbo();
        $jnow = JFactory::getDate();
        $now = K2_JVERSION == '15' ? $jnow->toMySQL() : $jnow->toSql();
        $nullDate = $db->getNullDate();

        $this->setLayout('item');

        // Add link
        if (K2HelperPermissions::canAddItem()) {
            $addLink = JRoute::_('index.php?option=com_k2&view=item&task=add&tmpl=component');
        }
        $this->assignRef('addLink', $addLink);

        // Get item
        $model = $this->getModel();
        $item = $model->getData();

        // Does the item exists?
        if (!is_object($item) || !$item->id) {
            JError::raiseError(404, JText::_('K2_ITEM_NOT_FOUND'));
        }

        // Prepare item
        $item = $model->prepareItem($item, $view, $task);

        // Plugins
        $item = $model->execPlugins($item, $view, $task);

        // User K2 plugins
        $item->event->K2UserDisplay = '';
        if (isset($item->author) && is_object($item->author->profile) && isset($item->author->profile->id)) {
            $dispatcher = JDispatcher::getInstance();
            JPluginHelper::importPlugin('k2');
            $results = $dispatcher->trigger('onK2UserDisplay', array(
                &$item->author->profile,
                &$params,
                $limitstart
            ));
            $item->event->K2UserDisplay = trim(implode("\n", $results));
            $item->author->profile->url = htmlspecialchars($item->author->profile->url, ENT_QUOTES, 'UTF-8');
        }

        // Access check
        if ($this->getLayout() == 'form') {
            JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
        }
        if (K2_JVERSION != '15') {
            if (!in_array($item->access, $user->getAuthorisedViewLevels()) || !in_array($item->category->access, $user->getAuthorisedViewLevels())) {
                if ($user->guest) {
                    $uri = JFactory::getURI();
                    $url = 'index.php?option=com_users&view=login&return='.base64_encode($uri->toString());
                    $application->enqueueMessage(JText::_('K2_YOU_NEED_TO_LOGIN_FIRST'), 'notice');
                    $application->redirect(JRoute::_($url, false));
                } else {
                    JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
                    return;
                }
            }
        } else {
            if ($item->access > $user->get('aid', 0) || $item->category->access > $user->get('aid', 0)) {
                if ($user->guest) {
                    $uri = JFactory::getURI();
                    $url = 'index.php?option=com_user&view=login&return='.base64_encode($uri->toString());
                    $application->enqueueMessage(JText::_('K2_YOU_NEED_TO_LOGIN_FIRST'), 'notice');
                    $application->redirect(JRoute::_($url, false));
                } else {
                    JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
                    return;
                }
            }
        }

        // Published check
        if (!$item->published || $item->trash) {
            JError::raiseError(404, JText::_('K2_ITEM_NOT_FOUND'));
        }

        if ($item->publish_up != $nullDate && $item->publish_up > $now) {
            JError::raiseError(404, JText::_('K2_ITEM_NOT_FOUND'));
        }

        if ($item->publish_down != $nullDate && $item->publish_down < $now) {
            JError::raiseError(404, JText::_('K2_ITEM_NOT_FOUND'));
        }

        if (!$item->category->published || $item->category->trash) {
            JError::raiseError(404, JText::_('K2_ITEM_NOT_FOUND'));
        }

        // Increase hits counter
        $model->hit($item->id);

        // Set default image
        K2HelperUtilities::setDefaultImage($item, $view);

        // Pass the old parameter to the view in order to avoid layout changes
        if ($params->get('antispam') == 'recaptcha' || $params->get('antispam') == 'both') {
            $params->set('recaptcha', true);
            $item->params->set('recaptcha', true);
        } else {
            $params->set('recaptcha', false);
            $item->params->set('recaptcha', false);
        }

        // Comments
        $item->event->K2CommentsCounter = '';
        $item->event->K2CommentsBlock = '';
        if ($item->params->get('itemComments')) {
            // Trigger comments events
            $dispatcher = JDispatcher::getInstance();
            JPluginHelper::importPlugin('k2');
            $results = $dispatcher->trigger('onK2CommentsCounter', array(
                &$item,
                &$params,
                $limitstart
            ));
            $item->event->K2CommentsCounter = trim(implode("\n", $results));
            $results = $dispatcher->trigger('onK2CommentsBlock', array(
                &$item,
                &$params,
                $limitstart
            ));
            $item->event->K2CommentsBlock = trim(implode("\n", $results));

            // Load K2 native comments system only if there are no plugins overriding it
            if (empty($item->event->K2CommentsCounter) && empty($item->event->K2CommentsBlock)) {

                // Load reCAPTCHA script
                if (!JRequest::getInt('print') && ($item->params->get('comments') == '1' || ($item->params->get('comments') == '2' && K2HelperPermissions::canAddComment($item->catid)))) {
                    if ($params->get('recaptcha') && ($user->guest || $params->get('recaptchaForRegistered', 1))) {
                        if ($params->get('recaptchaV2')) {
                            $document->addScript('https://www.google.com/recaptcha/api.js?onload=onK2RecaptchaLoaded&render=explicit');
                            $js = 'function onK2RecaptchaLoaded(){grecaptcha.render("recaptcha", {"sitekey" : "'.$item->params->get('recaptcha_public_key').'"});}';
                            $document->addScriptDeclaration($js);
                            $this->recaptchaClass = 'k2-recaptcha-v2';
                        } else {
                            $document->addScript('https://www.google.com/recaptcha/api/js/recaptcha_ajax.js');
                            $js = '
							function showRecaptcha(){
								Recaptcha.create("'.$item->params->get('recaptcha_public_key').'", "recaptcha", {
									theme: "'.$item->params->get('recaptcha_theme', 'clean').'"
								});
							}
							$K2(window).load(function() {
								showRecaptcha();
							});
							';
                            $document->addScriptDeclaration($js);
                            $this->recaptchaClass = 'k2-recaptcha-v1';
                        }
                    }
                }

                // Check for inline comment moderation
                if (!$user->guest && $user->id == $item->created_by && $params->get('inlineCommentsModeration')) {
                    $inlineCommentsModeration = true;
                    $commentsPublished = false;
                } else {
                    $inlineCommentsModeration = false;
                    $commentsPublished = true;
                }
                $this->assignRef('inlineCommentsModeration', $inlineCommentsModeration);

                // Flag spammer link
                $reportSpammerFlag = false;
                if (K2_JVERSION != '15') {
                    if ($user->authorise('core.admin', 'com_k2')) {
                        $reportSpammerFlag = true;
                        $document = JFactory::getDocument();
                        $document->addScriptDeclaration('var K2Language = ["'.JText::_('K2_REPORT_USER_WARNING', true).'"];');
                    }
                } else {
                    if ($user->gid > 24) {
                        $reportSpammerFlag = true;
                    }
                }

                $limit = $params->get('commentsLimit');
                $comments = $model->getItemComments($item->id, $limitstart, $limit, $commentsPublished);

                for ($i = 0; $i < sizeof($comments); $i++) {
                    $comments[$i]->commentText = nl2br($comments[$i]->commentText);

                    // Convert URLs to links properly
                    $comments[$i]->commentText = preg_replace("/([^\w\/])(www\.[a-z0-9\-]+\.[a-z0-9\-]+)/i", "$1http://$2", $comments[$i]->commentText);
                    $comments[$i]->commentText = preg_replace("/([\w]+:\/\/[\w-?&;#~=\.\/\@]+[\w\/])/i", "<a target=\"_blank\" rel=\"nofollow\" href=\"$1\">$1</A>", $comments[$i]->commentText);
                    $comments[$i]->commentText = preg_replace("/([\w-?&;#~=\.\/]+\@(\[?)[a-zA-Z0-9\-\.]+\.([a-zA-Z]{2,3}|[0-9]{1,3})(\]?))/i", "<a href=\"mailto:$1\">$1</A>", $comments[$i]->commentText);

                    $comments[$i]->userImage = K2HelperUtilities::getAvatar($comments[$i]->userID, $comments[$i]->commentEmail, $params->get('commenterImgWidth'));
                    if ($comments[$i]->userID > 0) {
                        $comments[$i]->userLink = K2HelperRoute::getUserRoute($comments[$i]->userID);
                    } else {
                        $comments[$i]->userLink = $comments[$i]->commentURL;
                    }
                    if ($reportSpammerFlag && $comments[$i]->userID > 0) {
                        $comments[$i]->reportUserLink = JRoute::_('index.php?option=com_k2&view=comments&task=reportSpammer&id='.$comments[$i]->userID.'&format=raw');
                    } else {
                        $comments[$i]->reportUserLink = false;
                    }
                }

                $item->comments = $comments;

                if (!isset($item->numOfComments)) {
                    $item->numOfComments = 0;
                }

                jimport('joomla.html.pagination');
                $total = $item->numOfComments;
                $pagination = new JPagination($total, $limitstart, $limit);
            }
        }

        // Author's latest items
        if ($item->params->get('itemAuthorLatest') && $item->created_by_alias == '') {
            $model = $this->getModel('itemlist');
            $authorLatestItems = $model->getAuthorLatest($item->id, $item->params->get('itemAuthorLatestLimit'), $item->created_by);
            if (count($authorLatestItems)) {
                for ($i = 0; $i < sizeof($authorLatestItems); $i++) {
                    $authorLatestItems[$i]->link = urldecode(JRoute::_(K2HelperRoute::getItemRoute($authorLatestItems[$i]->id.':'.urlencode($authorLatestItems[$i]->alias), $authorLatestItems[$i]->catid.':'.urlencode($authorLatestItems[$i]->categoryalias))));
                }
                $this->assignRef('authorLatestItems', $authorLatestItems);
            }
        }

        // Related items
        if ($item->params->get('itemRelated') && isset($item->tags) && count($item->tags)) {
            $model = $this->getModel('itemlist');
            $relatedItems = $model->getRelatedItems($item->id, $item->tags, $item->params);
            if (count($relatedItems)) {
                for ($i = 0; $i < sizeof($relatedItems); $i++) {
                    $relatedItems[$i]->link = urldecode(JRoute::_(K2HelperRoute::getItemRoute($relatedItems[$i]->id.':'.urlencode($relatedItems[$i]->alias), $relatedItems[$i]->catid.':'.urlencode($relatedItems[$i]->categoryalias))));
                }
                $this->assignRef('relatedItems', $relatedItems);
            }
        }

        // Navigation (previous and next item)
        if ($item->params->get('itemNavigation')) {
            $model = $this->getModel('item');

            $nextItem = $model->getNextItem($item->id, $item->catid, $item->ordering);
            if (!is_null($nextItem)) {
                $item->nextLink = urldecode(JRoute::_(K2HelperRoute::getItemRoute($nextItem->id.':'.urlencode($nextItem->alias), $nextItem->catid.':'.urlencode($item->category->alias))));
                $item->nextTitle = $nextItem->title;

                $date = JFactory::getDate($item->modified);
                $timestamp = '?t='.$date->toUnix();

                if (JFile::exists(JPATH_SITE.'/media/k2/items/cache/'.md5("Image".$nextItem->id).'_XS.jpg')) {
                    $item->nextImageXSmall = JURI::base(true).'/media/k2/items/cache/'.md5("Image".$nextItem->id).'_XS.jpg'.$timestamp;
                }
                if (JFile::exists(JPATH_SITE.'/media/k2/items/cache/'.md5("Image".$nextItem->id).'_S.jpg')) {
                    $item->nextImageSmall = JURI::base(true).'/media/k2/items/cache/'.md5("Image".$nextItem->id).'_S.jpg'.$timestamp;
                }

                if (JFile::exists(JPATH_SITE.'/media/k2/items/cache/'.md5("Image".$nextItem->id).'_M.jpg')) {
                    $item->nextImageMedium = JURI::base(true).'/media/k2/items/cache/'.md5("Image".$nextItem->id).'_M.jpg'.$timestamp;
                }

                if (JFile::exists(JPATH_SITE.'/media/k2/items/cache/'.md5("Image".$nextItem->id).'_L.jpg')) {
                    $item->nextImageLarge = JURI::base(true).'/media/k2/items/cache/'.md5("Image".$nextItem->id).'_L.jpg'.$timestamp;
                }

                if (JFile::exists(JPATH_SITE.'/media/k2/items/cache/'.md5("Image".$nextItem->id).'_XL.jpg')) {
                    $item->nextImageXLarge = JURI::base(true).'/media/k2/items/cache/'.md5("Image".$nextItem->id).'_XL.jpg'.$timestamp;
                }

                if (JFile::exists(JPATH_SITE.'/media/k2/items/cache/'.md5("Image".$nextItem->id).'_Generic.jpg')) {
                    $item->nextImageGeneric = JURI::base(true).'/media/k2/items/cache/'.md5("Image".$nextItem->id).'_Generic.jpg'.$timestamp;
                }
            }

            $previousItem = $model->getPreviousItem($item->id, $item->catid, $item->ordering);
            if (!is_null($previousItem)) {
                $item->previousLink = urldecode(JRoute::_(K2HelperRoute::getItemRoute($previousItem->id.':'.urlencode($previousItem->alias), $previousItem->catid.':'.urlencode($item->category->alias))));
                $item->previousTitle = $previousItem->title;

                $date = JFactory::getDate($item->modified);
                $timestamp = '?t='.$date->toUnix();

                if (JFile::exists(JPATH_SITE.'/media/k2/items/cache/'.md5("Image".$previousItem->id).'_XS.jpg')) {
                    $item->previousImageXSmall = JURI::base(true).'/media/k2/items/cache/'.md5("Image".$previousItem->id).'_XS.jpg'.$timestamp;
                }
                if (JFile::exists(JPATH_SITE.'/media/k2/items/cache/'.md5("Image".$previousItem->id).'_S.jpg')) {
                    $item->previousImageSmall = JURI::base(true).'/media/k2/items/cache/'.md5("Image".$previousItem->id).'_S.jpg'.$timestamp;
                }

                if (JFile::exists(JPATH_SITE.'/media/k2/items/cache/'.md5("Image".$previousItem->id).'_M.jpg')) {
                    $item->previousImageMedium = JURI::base(true).'/media/k2/items/cache/'.md5("Image".$previousItem->id).'_M.jpg'.$timestamp;
                }

                if (JFile::exists(JPATH_SITE.'/media/k2/items/cache/'.md5("Image".$previousItem->id).'_L.jpg')) {
                    $item->previousImageLarge = JURI::base(true).'/media/k2/items/cache/'.md5("Image".$previousItem->id).'_L.jpg'.$timestamp;
                }

                if (JFile::exists(JPATH_SITE.'/media/k2/items/cache/'.md5("Image".$previousItem->id).'_XL.jpg')) {
                    $item->previousImageXLarge = JURI::base(true).'/media/k2/items/cache/'.md5("Image".$previousItem->id).'_XL.jpg'.$timestamp;
                }

                if (JFile::exists(JPATH_SITE.'/media/k2/items/cache/'.md5("Image".$previousItem->id).'_Generic.jpg')) {
                    $item->previousImageGeneric = JURI::base(true).'/media/k2/items/cache/'.md5("Image".$previousItem->id).'_Generic.jpg'.$timestamp;
                }
            }
        }

        // Absolute URL
        $uri = JURI::getInstance();
        $item->absoluteURL = $uri->toString();

        // Email link
        if (K2_JVERSION != '15') {
            require_once(JPATH_SITE.'/components/com_mailto/helpers/mailto.php');
            $template = $application->getTemplate();
            $item->emailLink = JRoute::_('index.php?option=com_mailto&tmpl=component&template='.$template.'&link='.MailToHelper::addLink($item->absoluteURL));
        } else {
            require_once(JPATH_SITE.'/components/com_mailto/helpers/mailto.php');
            $item->emailLink = JRoute::_('index.php?option=com_mailto&tmpl=component&link='.MailToHelper::addLink($item->absoluteURL));
        }

        // Twitter link (legacy code)
        if ($params->get('twitterUsername')) {
            $item->twitterURL = 'http://twitter.com/intent/tweet?text='.urlencode($item->title).'&amp;url='.urlencode($item->absoluteURL).'&amp;via='.$params->get('twitterUsername');
        } else {
            $item->twitterURL = 'http://twitter.com/intent/tweet?text='.urlencode($item->title).'&amp;url='.urlencode($item->absoluteURL);
        }

        // Social link
        $item->socialLink = urlencode($item->absoluteURL);

        // Set page title
        $menus = $application->getMenu();
        $menu = $menus->getActive();
        if (is_object($menu) && isset($menu->query['view']) && $menu->query['view'] == 'item' && isset($menu->query['id']) && $menu->query['id'] == $item->id) {
            if (is_string($menu->params)) {
                $menu_params = K2_JVERSION == '15' ? new JParameter($menu->params) : new JRegistry($menu->params);
            } else {
                $menu_params = $menu->params;
            }
            if (!$menu_params->get('page_title')) {
                $params->set('page_title', $item->cleanTitle);
            }
        } else {
            $params->set('page_title', $item->cleanTitle);
        }

        if (K2_JVERSION != '15') {
            if ($application->getCfg('sitename_pagetitles', 0) == 1) {
                $title = JText::sprintf('JPAGETITLE', $application->getCfg('sitename'), $params->get('page_title'));
                $params->set('page_title', $title);
            } elseif ($application->getCfg('sitename_pagetitles', 0) == 2) {
                $title = JText::sprintf('JPAGETITLE', $params->get('page_title'), $application->getCfg('sitename'));
                $params->set('page_title', $title);
            }
        }
        $document->setTitle($params->get('page_title'));

        // Set pathway
        $menus = $application->getMenu();
        $menu = $menus->getActive();
        $pathway = $application->getPathWay();
        if ($menu) {
            if (isset($menu->query['view']) && ($menu->query['view'] != 'item' || $menu->query['id'] != $item->id)) {
                if (!isset($menu->query['task']) || $menu->query['task'] != 'category' || $menu->query['id'] != $item->catid) {
                    $pathway->addItem($item->category->name, $item->category->link);
                }
                $pathway->addItem($item->cleanTitle, '');
            }
        }

        // Set metadata
        if ($item->metadesc) {
            $document->setDescription((K2_JVERSION == '15') ? htmlspecialchars($item->metadesc, ENT_QUOTES, 'UTF-8') : $item->metadesc);
        } else {
            $metaDescItem = preg_replace("#{(.*?)}(.*?){/(.*?)}#s", '', $item->introtext.' '.$item->fulltext);
            $metaDescItem = preg_replace("/<script\b[^>]*>(.*?)<\/script>/is", '', $item->introtext.' '.$item->fulltext);
            $metaDescItem = strip_tags($metaDescItem);
            $metaDescItem = K2HelperUtilities::characterLimit($metaDescItem, $params->get('metaDescLimit', 150));
            $document->setDescription(K2_JVERSION == '15' ? $metaDescItem : html_entity_decode($metaDescItem));
        }
        if ($item->metakey) {
            $document->setMetadata('keywords', $item->metakey);
        } else {
            if (isset($item->tags) && count($item->tags)) {
                $tmp = array();
                foreach ($item->tags as $tag) {
                    $tmp[] = $tag->name;
                }
                $document->setMetadata('keywords', implode(',', $tmp));
            }
        }

        // Menu metadata for Joomla 2.5+ (overrides the current metadata if set)
        if (K2_JVERSION != '15') {
            if ($params->get('menu-meta_description')) {
                $document->setDescription($params->get('menu-meta_description'));
            }

            if ($params->get('menu-meta_keywords')) {
                $document->setMetadata('keywords', $params->get('menu-meta_keywords'));
            }

            if ($params->get('robots')) {
                $document->setMetadata('robots', $params->get('robots'));
            }

            // Menu page display options
            if ($params->get('page_heading')) {
                $params->set('page_title', $params->get('page_heading'));
            }
            $params->set('show_page_title', $params->get('show_page_heading'));
        }

        if ($application->getCfg('MetaTitle') == '1') {
            $document->setMetadata('title', $item->cleanTitle);
        }
        if ($application->getCfg('MetaAuthor') == '1' && isset($item->author->name)) {
            $document->setMetadata('author', $item->author->name);
        }
        $mdata = class_exists('JParameter') ? new JParameter($item->metadata) : new JRegistry($item->metadata);
        $mdata = $mdata->toArray();
        foreach ($mdata as $k => $v) {
            if ($k == 'robots' || $k == 'author') {
                if ($v) {
                    $document->setMetadata($k, $v);
                }
            }
        }

        // Set Facebook meta data
        if ($params->get('facebookMetatags', '1')) {
            $document = JFactory::getDocument();
            $uri = JURI::getInstance();
            $document->setMetaData('og:url', $uri->toString());
            $document->setMetaData('og:title', (K2_JVERSION == '15') ? htmlspecialchars($document->getTitle(), ENT_QUOTES, 'UTF-8') : $document->getTitle());
            $document->setMetaData('og:type', 'article');
            $facebookImage = 'image'.$params->get('facebookImage', 'Small');
            if ($item->$facebookImage) {
                $basename = basename($item->$facebookImage);
                if (strpos($basename, '?t=')!==false) {
                    $tmpBasename = explode('?t=', $basename);
                    $basenameWithNoTimestamp = $tmpBasename[0];
                } else {
                    $basenameWithNoTimestamp = $basename;
                }
                if (JFile::exists(JPATH_SITE.'/media/k2/items/cache/'.$basenameWithNoTimestamp)) {
                    $image = JURI::root().'media/k2/items/cache/'.$basename;
                    $document->setMetaData('og:image', $image);
                    $document->setMetaData('image', $image);
                }
            }
            $document->setMetaData('og:description', strip_tags($document->getDescription()));
        }

        // Get the frontend's language for use in social media buttons - use explicit variable references for future update flexibility
        $getSiteLanguage = JFactory::getLanguage();
        $languageTag = $getSiteLanguage->getTag();
        $item->langTagForFB = str_replace('-', '_', $languageTag);
        $item->langTagForTW = strtolower($languageTag);
        $item->langTagForGP = $languageTag;

        // Lookup template folders
        $this->_addPath('template', JPATH_COMPONENT.'/templates');
        $this->_addPath('template', JPATH_COMPONENT.'/templates/default');

        $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2/templates');
        $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2/templates/default');

        $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2');
        $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2/default');

        if ($item->params->get('theme')) {
            $this->_addPath('template', JPATH_COMPONENT.'/templates/'.$item->params->get('theme'));
            $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2/templates/'.$item->params->get('theme'));
            $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2/'.$item->params->get('theme'));
        }

        // Allow temporary template loading with ?template=
        $template = JRequest::getCmd('template');
        if (isset($template)) {
            // Look for overrides in template folder (new K2 template structure)
            $this->_addPath('template', JPATH_SITE.'/templates/'.$template.'/html/com_k2');
            $this->_addPath('template', JPATH_SITE.'/templates/'.$template.'/html/com_k2/default');
            if ($item->params->get('theme')) {
                $this->_addPath('template', JPATH_SITE.'/templates/'.$template.'/html/com_k2/'.$item->params->get('theme'));
            }
        }

        // Assign data
        $this->assignRef('item', $item);
        $this->assignRef('user', $user);
        $this->assignRef('params', $item->params);
        $this->assignRef('pagination', $pagination);

        parent::display($tpl);
    }
}
PK!J�_���item/view.json.phpnu&1i�<?php
/**
 * @version     2.9.x
 * @package     K2
 * @author      JoomlaWorks https://www.joomlaworks.net
 * @copyright   Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license     GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

jimport('joomla.application.component.view');

class K2ViewItem extends K2View
{

    function display($tpl = null)
    {

        $application = JFactory::getApplication();
        $user = JFactory::getUser();
        $document = JFactory::getDocument();
        if (K2_JVERSION == '15')
        {
            $document->setMimeEncoding('application/json');
            $document->setType('json');
        }
        $params = K2HelperUtilities::getParams('com_k2');
        $view = JRequest::getWord('view');
        $task = JRequest::getWord('task');

        $db = JFactory::getDbo();
        $jnow = JFactory::getDate();
        $now =  K2_JVERSION == '15'?$jnow->toMySQL():$jnow->toSql();
        $nullDate = $db->getNullDate();

        // Get item
        $model = $this->getModel();
        $item = $model->getData();

        // Does the item exists?
        if (!is_object($item) || !$item->id)
        {
            JError::raiseError(404, JText::_('K2_ITEM_NOT_FOUND'));
        }

        // Override some params because we want to show all elements in JSON
        $itemParams = class_exists('JParameter') ? new JParameter($item->params) : new JRegistry($item->params);
        $itemParams->set('itemIntroText', true);
        $itemParams->set('itemFullText', true);
        $itemParams->set('itemTags', true);
        $itemParams->set('itemExtraFields', true);
        $itemParams->set('itemAttachments', true);
        $itemParams->set('itemRating', true);
        $itemParams->set('itemAuthor', true);
        $itemParams->set('itemImageGallery', true);
        $itemParams->set('itemVideo', true);
        $item->params = $itemParams->toString();

        // Prepare item
        $item = $model->prepareItem($item, $view, $task);

        // Plugins
        $item = $model->execPlugins($item, $view, $task);

        // Access check
        if (K2_JVERSION != '15')
        {
            if (!in_array($item->access, $user->getAuthorisedViewLevels()) || !in_array($item->category->access, $user->getAuthorisedViewLevels()))
            {
               JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
            }
        }
        else
        {
            if ($item->access > $user->get('aid', 0) || $item->category->access > $user->get('aid', 0))
            {
                JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
            }
        }

        // Published check
        if (!$item->published || $item->trash)
        {
            JError::raiseError(404, JText::_('K2_ITEM_NOT_FOUND'));
        }

        if ($item->publish_up != $nullDate && $item->publish_up > $now)
        {
            JError::raiseError(404, JText::_('K2_ITEM_NOT_FOUND'));
        }

        if ($item->publish_down != $nullDate && $item->publish_down < $now)
        {
            JError::raiseError(404, JText::_('K2_ITEM_NOT_FOUND'));
        }

        if (!$item->category->published || $item->category->trash)
        {
            JError::raiseError(404, JText::_('K2_ITEM_NOT_FOUND'));
        }
        
        // Increase hits counter
        $model->hit($item->id);

        // Set default image
        K2HelperUtilities::setDefaultImage($item, $view);

        // Build the output object
        $row = $model->prepareJSONItem($item);

        // Output
        $response = new stdClass();

        // Site
        $response->site = new stdClass();
        $uri = JURI::getInstance();
        $response->site->url = $uri->toString(array('scheme', 'host', 'port'));
        $config = JFactory::getConfig();
        $response->site->name = K2_JVERSION == '30' ? $config->get('sitename') : $config->getValue('config.sitename');

        $response->item = $row;

        $json = json_encode($response);
        $callback = JRequest::getCmd('callback');
        if ($callback)
        {
            $document->setMimeEncoding('application/javascript');
            echo $callback.'('.$json.')';
        }
        else
        {
            echo $json;
        }
    }

}
PK!�ER�0�0item/view.raw.phpnu&1i�<?php
/**
 * @version    2.9.x
 * @package    K2
 * @author     JoomlaWorks https://www.joomlaworks.net
 * @copyright  Copyright (c) 2006 - 2018 JoomlaWorks Ltd. All rights reserved.
 * @license    GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
 */

// no direct access
defined('_JEXEC') or die;

jimport('joomla.application.component.view');

class K2ViewItem extends K2View
{
    public function display($tpl = null)
    {
        $application = JFactory::getApplication();
        $user = JFactory::getUser();
        $document = JFactory::getDocument();
        $params = K2HelperUtilities::getParams('com_k2');
        $limitstart = JRequest::getInt('limitstart', 0);
        $view = JRequest::getWord('view');
        $task = JRequest::getWord('task');

        $db = JFactory::getDbo();
        $jnow = JFactory::getDate();
        $now =  K2_JVERSION == '15'?$jnow->toMySQL():$jnow->toSql();
        $nullDate = $db->getNullDate();

        $this->setLayout('item');

        // Add link
        if (K2HelperPermissions::canAddItem()) {
            $addLink = JRoute::_('index.php?option=com_k2&view=item&task=add&tmpl=component');
        }
        $this->assignRef('addLink', $addLink);

        // Get item
        $model = $this->getModel();
        $item = $model->getData();
        $item->event = new stdClass;

        // Does the item exists?
        if (!is_object($item) || !$item->id) {
            JError::raiseError(404, JText::_('K2_ITEM_NOT_FOUND'));
        }

        // Prepare item
        $item = $model->prepareItem($item, $view, $task);

        // Plugins
        $item = $model->execPlugins($item, $view, $task);

        // User K2 plugins
        $item->event->K2UserDisplay = '';
        if (isset($item->author) && is_object($item->author->profile) && isset($item->author->profile->id)) {
            $dispatcher = JDispatcher::getInstance();
            JPluginHelper::importPlugin('k2');
            $results = $dispatcher->trigger('onK2UserDisplay', array(&$item->author->profile, &$params, $limitstart));
            $item->event->K2UserDisplay = trim(implode("\n", $results));
            $item->author->profile->url = htmlspecialchars($item->author->profile->url, ENT_QUOTES, 'UTF-8');
        }

        // Access check
        if ($this->getLayout() == 'form') {
            JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
        }
        if (K2_JVERSION != '15') {
            if (!in_array($item->access, $user->getAuthorisedViewLevels()) || !in_array($item->category->access, $user->getAuthorisedViewLevels())) {
                if ($user->guest) {
                    $uri = JFactory::getURI();
                    $url = 'index.php?option=com_users&view=login&return='.base64_encode($uri->toString());
                    $application->enqueueMessage(JText::_('K2_YOU_NEED_TO_LOGIN_FIRST'), 'notice');
                    $application->redirect(JRoute::_($url, false));
                } else {
                    JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
                    return;
                }
            }
        } else {
            if ($item->access > $user->get('aid', 0) || $item->category->access > $user->get('aid', 0)) {
                if ($user->guest) {
                    $uri = JFactory::getURI();
                    $url = 'index.php?option=com_user&view=login&return='.base64_encode($uri->toString());
                    $application->enqueueMessage(JText::_('K2_YOU_NEED_TO_LOGIN_FIRST'), 'notice');
                    $application->redirect(JRoute::_($url, false));
                } else {
                    JError::raiseError(403, JText::_('K2_ALERTNOTAUTH'));
                    return;
                }
            }
        }

        // Published check
        if (!$item->published || $item->trash) {
            JError::raiseError(404, JText::_('K2_ITEM_NOT_FOUND'));
        }

        if ($item->publish_up != $nullDate && $item->publish_up > $now) {
            JError::raiseError(404, JText::_('K2_ITEM_NOT_FOUND'));
        }

        if ($item->publish_down != $nullDate && $item->publish_down < $now) {
            JError::raiseError(404, JText::_('K2_ITEM_NOT_FOUND'));
        }

        if (!$item->category->published || $item->category->trash) {
            JError::raiseError(404, JText::_('K2_ITEM_NOT_FOUND'));
        }

        // Increase hits counter
        $model->hit($item->id);

        // Set default image
        K2HelperUtilities::setDefaultImage($item, $view);

        // Comments
        $item->event->K2CommentsCounter = '';
        $item->event->K2CommentsBlock = '';
        if ($item->params->get('itemComments')) {

            // Trigger comments events
            $dispatcher = JDispatcher::getInstance();
            JPluginHelper::importPlugin('k2');
            $results = $dispatcher->trigger('onK2CommentsCounter', array(&$item, &$params, $limitstart));
            $item->event->K2CommentsCounter = trim(implode("\n", $results));
            $results = $dispatcher->trigger('onK2CommentsBlock', array(&$item, &$params, $limitstart));
            $item->event->K2CommentsBlock = trim(implode("\n", $results));

            // Load K2 native comments system only if there are no plugins overriding it
            if (empty($item->event->K2CommentsCounter) && empty($item->event->K2CommentsBlock)) {
                $limit = $params->get('commentsLimit');
                $comments = $model->getItemComments($item->id, $limitstart, $limit);
                $pattern = "@\b(https?://)?(([0-9a-zA-Z_!~*'().&=+$%-]+:)?[0-9a-zA-Z_!~*'().&=+$%-]+\@)?(([0-9]{1,3}\.){3}[0-9]{1,3}|([0-9a-zA-Z_!~*'()-]+\.)*([0-9a-zA-Z][0-9a-zA-Z-]{0,61})?[0-9a-zA-Z]\.[a-zA-Z]{2,6})(:[0-9]{1,4})?((/[0-9a-zA-Z_!~*'().;?:\@&=+$,%#-]+)*/?)@";

                for ($i = 0; $i < sizeof($comments); $i++) {
                    $comments[$i]->commentText = nl2br($comments[$i]->commentText);
                    $comments[$i]->commentText = preg_replace($pattern, '<a target="_blank" rel="nofollow" href="\0">\0</a>', $comments[$i]->commentText);
                    $comments[$i]->userImage = K2HelperUtilities::getAvatar($comments[$i]->userID, $comments[$i]->commentEmail, $params->get('commenterImgWidth'));
                    if ($comments[$i]->userID > 0) {
                        $comments[$i]->userLink = K2HelperRoute::getUserRoute($comments[$i]->userID);
                    } else {
                        $comments[$i]->userLink = $comments[$i]->commentURL;
                    }
                }

                $item->comments = $comments;

                jimport('joomla.html.pagination');
                $total = $item->numOfComments;
                $pagination = new JPagination($total, $limitstart, $limit);
            }
        }

        // Author's latest items
        if ($item->params->get('itemAuthorLatest') && $item->created_by_alias == '') {
            $model = $this->getModel('itemlist');
            $authorLatestItems = $model->getAuthorLatest($item->id, $item->params->get('itemAuthorLatestLimit'), $item->created_by);
            if (count($authorLatestItems)) {
                for ($i = 0; $i < sizeof($authorLatestItems); $i++) {
                    $authorLatestItems[$i]->link = urldecode(JRoute::_(K2HelperRoute::getItemRoute($authorLatestItems[$i]->id.':'.urlencode($authorLatestItems[$i]->alias), $authorLatestItems[$i]->catid.':'.urlencode($authorLatestItems[$i]->categoryalias))));
                }
                $this->assignRef('authorLatestItems', $authorLatestItems);
            }
        }

        // Related items
        if ($item->params->get('itemRelated') && isset($item->tags) && count($item->tags)) {
            $model = $this->getModel('itemlist');
            $relatedItems = $model->getRelatedItems($item->id, $item->tags, $item->params);
            if (count($relatedItems)) {
                for ($i = 0; $i < sizeof($relatedItems); $i++) {
                    $relatedItems[$i]->link = urldecode(JRoute::_(K2HelperRoute::getItemRoute($relatedItems[$i]->id.':'.urlencode($relatedItems[$i]->alias), $relatedItems[$i]->catid.':'.urlencode($relatedItems[$i]->categoryalias))));
                }
                $this->assignRef('relatedItems', $relatedItems);
            }
        }

        // Navigation (previous and next item)
        if ($item->params->get('itemNavigation')) {
            $model = $this->getModel('item');

            $nextItem = $model->getNextItem($item->id, $item->catid, $item->ordering);
            if (!is_null($nextItem)) {
                $item->nextLink = urldecode(JRoute::_(K2HelperRoute::getItemRoute($nextItem->id.':'.urlencode($nextItem->alias), $nextItem->catid.':'.urlencode($item->category->alias))));
                $item->nextTitle = $nextItem->title;
            }

            $previousItem = $model->getPreviousItem($item->id, $item->catid, $item->ordering);
            if (!is_null($previousItem)) {
                $item->previousLink = urldecode(JRoute::_(K2HelperRoute::getItemRoute($previousItem->id.':'.urlencode($previousItem->alias), $previousItem->catid.':'.urlencode($item->category->alias))));
                $item->previousTitle = $previousItem->title;
            }
        }

        // Absolute URL
        $uri = JURI::getInstance();
        $item->absoluteURL = $uri->toString();

        // Email link
        if (K2_JVERSION != '15') {
            require_once(JPATH_SITE.'/components/com_mailto/helpers/mailto.php');
            $template = $application->getTemplate();
            $item->emailLink = JRoute::_('index.php?option=com_mailto&tmpl=component&template='.$template.'&link='.MailToHelper::addLink($item->absoluteURL));
        } else {
            require_once(JPATH_SITE.'/components/com_mailto/helpers/mailto.php');
            $item->emailLink = JRoute::_('index.php?option=com_mailto&tmpl=component&link='.MailToHelper::addLink($item->absoluteURL));
        }

        // Twitter link (legacy code)
        if ($params->get('twitterUsername')) {
            $item->twitterURL = 'http://twitter.com/intent/tweet?text='.urlencode($item->title).'&amp;url='.urlencode($item->absoluteURL).'&amp;via='.$params->get('twitterUsername');
        } else {
            $item->twitterURL = 'http://twitter.com/intent/tweet?text='.urlencode($item->title).'&amp;url='.urlencode($item->absoluteURL);
        }

        // Social link
        $item->socialLink = urlencode($item->absoluteURL);

        // Lookup template folders
        $this->_addPath('template', JPATH_COMPONENT.'/templates');
        $this->_addPath('template', JPATH_COMPONENT.'/templates/default');

        $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2/templates');
        $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2/templates/default');

        $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2');
        $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2/default');

        if ($item->params->get('theme')) {
            $this->_addPath('template', JPATH_COMPONENT.'/templates/'.$item->params->get('theme'));
            $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2/templates/'.$item->params->get('theme'));
            $this->_addPath('template', JPATH_SITE.'/templates/'.$application->getTemplate().'/html/com_k2/'.$item->params->get('theme'));
        }

        // Allow temporary template loading with ?template=
        $template = JRequest::getCmd('template');
        if (isset($template)) {
            // Look for overrides in template folder (new K2 template structure)
            $this->_addPath('template', JPATH_SITE.'/templates/'.$template.'/html/com_k2');
            $this->_addPath('template', JPATH_SITE.'/templates/'.$template.'/html/com_k2/default');
            if ($item->params->get('theme')) {
                $this->_addPath('template', JPATH_SITE.'/templates/'.$template.'/html/com_k2/'.$item->params->get('theme'));
            }
        }

        // Assign data
        $this->assignRef('item', $item);
        $this->assignRef('user', $user);
        $this->assignRef('params', $item->params);
        $this->assignRef('pagination', $pagination);

        parent::display($tpl);
    }
}
PK!!o�$

!categories/tmpl/default_items.phpnu�[���PK!e�e
categories/tmpl/default.phpnu�[���PK!����["["�categories/tmpl/default.xmlnu�[���PK!�-õ��[2categories/view.html.phpnu�[���PK!P-���!�!>5newsfeed/view.html.phpnu�[���PK!�����_Wnewsfeed/tmpl/default.phpnu�[���PK!���r�
�
�lnewsfeed/tmpl/default.xmlnu�[���PK!��$�wcategory/tmpl/default_items.phpnu�[���PK!�!4��@�category/tmpl/default.xmlnu�[���PK!�iH  9�category/tmpl/default.phpnu�[���PK!�y��"��category/tmpl/default_children.phpnu�[���PK!Z�e�	�	��category/view.html.phpnu�[���PK!�I��

��reset/tmpl/confirm.phpnu�[���PK!��W�22H�reset/tmpl/default.xmlnu�[���PK!���Y��reset/tmpl/default.phpnu�[���PK!p���reset/tmpl/complete.phpnu�[���PK!7�,�r�reset/view.html.phpnu�[���PK!�q>�11��remind/tmpl/default.xmlnu�[���PK!_��8�remind/tmpl/default.phpnu�[���PK!~�v'h
h
��remind/view.html.phpnu�[���PK!/����E�profile/view.html.phpnu�[���PK!��+�profile/tmpl/default_core.phpnu�[���PK!J���nprofile/tmpl/edit.phpnu�[���PK!ݏ�88�profile/tmpl/edit.xmlnu�[���PK!����331profile/tmpl/default_params.phpnu�[���PK!����33� profile/tmpl/default.xmlnu�[���PK!�!]��	�	."profile/tmpl/default_custom.phpnu�[���PK!|�_##,profile/tmpl/default.phpnu�[���PK!Vz�9��|0login/view.html.phpnu�[���PK!	(v���<login/tmpl/default_login.phpnu�[���PK!������Ilogin/tmpl/default_logout.phpnu�[���PK!¿�.���Rlogin/tmpl/logout.xmlnu�[���PK!��bR**�Vlogin/tmpl/default.phpnu�[���PK!?��|GGnYlogin/tmpl/default.xmlnu�[���PK!ڕ��
�
�iregistration/view.html.phpnu�[���PK!��B�EEuregistration/tmpl/default.xmlnu�[���PK!�g�pp�vregistration/tmpl/default.phpnu�[���PK!פ?��c~registration/tmpl/complete.phpnu�[���PK!Q�/�����comments/view.html.phpnu&1i�PK!5�FF߉comments/tmpl/report.phpnu&1i�PK!���ggm�comments/metadata.xmlnu&1i�PK!:�źXFXF�itemlist/view.json.phpnu&1i�PK![w�hMhM��itemlist/view.raw.phpnu&1i�PK!�y��1r1rd&itemlist/view.html.phpnu&1i�PK!B�c�**ۘitemlist/view.feed.phpnu&1i�PK!��d���>�itemlist/metadata.xmlnu&1i�PK!�(z&33o�itemlist/tmpl/user_item.phpnu&1i�PK!�(z&33��itemlist/tmpl/category_item.phpnu&1i�PK!�(z&33o�itemlist/tmpl/user.phpnu&1i�PK!���I��itemlist/tmpl/user.xmlnu&1i�PK!o�nnI�itemlist/tmpl/generic.xmlnu&1i�PK!�(z&33�itemlist/tmpl/generic_item.phpnu&1i�PK!z�`%=%=��itemlist/tmpl/category.xmlnu&1i�PK!�(z&33�itemlist/tmpl/category.phpnu&1i�PK!Ԁ�@@mitemlist/tmpl/tag.xmlnu&1i�PK!�(z&33�)itemlist/tmpl/tag.phpnu&1i�PK!��2�j+latest/metadata.xmlnu&1i�PK!N؃r9r9�,latest/tmpl/latest.xmlnu&1i�PK!�(z&33uflatest/tmpl/latest.phpnu&1i�PK!�(z&33�glatest/tmpl/latest_item.phpnu&1i�PK!J����5�5lilatest/view.html.phpnu&1i�PK!�IJ���w�item/metadata.xmlnu&1i�PK!2
�DDh�item/tmpl/item.xmlnu&1i�PK!�(z&33 �item/tmpl/item_comments_form.phpnu&1i�PK!�(z&33q�item/tmpl/item.phpnu&1i�PK!�(z&33�item/tmpl/itemform.phpnu&1i�PK!�S_�item/tmpl/itemform.xmlnu&1i�PK!��[=�e�e��item/view.html.phpnu&1i�PK!J�_����item/view.json.phpnu&1i�PK!�ER�0�0�$item/view.raw.phpnu&1i�PKFF�U

Youez - 2016 - github.com/yon3zu
LinuXploit