Spade

Mini Shell

Directory:~$ /home/lmsyaran/public_html/joomla4/
Upload File

[Home] [System Details] [Kill Me]
Current File:~$ /home/lmsyaran/public_html/joomla4/content.tar

content.php000064400000025407151160360450006740 0ustar00<?php
/**
 * @package     Joomla.Plugin
 * @subpackage  Finder.Content
 *
 * @copyright   Copyright (C) 2005 - 2020 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;

JLoader::register('FinderIndexerAdapter', JPATH_ADMINISTRATOR .
'/components/com_finder/helpers/indexer/adapter.php');

/**
 * Smart Search adapter for com_content.
 *
 * @since  2.5
 */
class PlgFinderContent extends FinderIndexerAdapter
{
	/**
	 * The plugin identifier.
	 *
	 * @var    string
	 * @since  2.5
	 */
	protected $context = 'Content';

	/**
	 * The extension name.
	 *
	 * @var    string
	 * @since  2.5
	 */
	protected $extension = 'com_content';

	/**
	 * The sublayout to use when rendering the results.
	 *
	 * @var    string
	 * @since  2.5
	 */
	protected $layout = 'article';

	/**
	 * The type of content that the adapter indexes.
	 *
	 * @var    string
	 * @since  2.5
	 */
	protected $type_title = 'Article';

	/**
	 * The table name.
	 *
	 * @var    string
	 * @since  2.5
	 */
	protected $table = '#__content';

	/**
	 * Load the language file on instantiation.
	 *
	 * @var    boolean
	 * @since  3.1
	 */
	protected $autoloadLanguage = true;

	/**
	 * Method to update the item link information when the item category is
	 * changed. This is fired when the item category is published or
unpublished
	 * from the list view.
	 *
	 * @param   string   $extension  The extension whose category has been
updated.
	 * @param   array    $pks        A list of primary key ids of the content
that has changed state.
	 * @param   integer  $value      The value of the state that the content
has been changed to.
	 *
	 * @return  void
	 *
	 * @since   2.5
	 */
	public function onFinderCategoryChangeState($extension, $pks, $value)
	{
		// Make sure we're handling com_content categories.
		if ($extension === 'com_content')
		{
			$this->categoryStateChange($pks, $value);
		}
	}

	/**
	 * Method to remove the link information for items that have been deleted.
	 *
	 * @param   string  $context  The context of the action being performed.
	 * @param   JTable  $table    A JTable object containing the record to be
deleted
	 *
	 * @return  boolean  True on success.
	 *
	 * @since   2.5
	 * @throws  Exception on database error.
	 */
	public function onFinderAfterDelete($context, $table)
	{
		if ($context === 'com_content.article')
		{
			$id = $table->id;
		}
		elseif ($context === 'com_finder.index')
		{
			$id = $table->link_id;
		}
		else
		{
			return true;
		}

		// Remove item from the index.
		return $this->remove($id);
	}

	/**
	 * Smart Search after save content method.
	 * Reindexes the link information for an article that has been saved.
	 * It also makes adjustments if the access level of an item or the
	 * category to which it belongs has changed.
	 *
	 * @param   string   $context  The context of the content passed to the
plugin.
	 * @param   JTable   $row      A JTable object.
	 * @param   boolean  $isNew    True if the content has just been created.
	 *
	 * @return  boolean  True on success.
	 *
	 * @since   2.5
	 * @throws  Exception on database error.
	 */
	public function onFinderAfterSave($context, $row, $isNew)
	{
		// We only want to handle articles here.
		if ($context === 'com_content.article' || $context ===
'com_content.form')
		{
			// Check if the access levels are different.
			if (!$isNew && $this->old_access != $row->access)
			{
				// Process the change.
				$this->itemAccessChange($row);
			}

			// Reindex the item.
			$this->reindex($row->id);
		}

		// Check for access changes in the category.
		if ($context === 'com_categories.category')
		{
			// Check if the access levels are different.
			if (!$isNew && $this->old_cataccess != $row->access)
			{
				$this->categoryAccessChange($row);
			}
		}

		return true;
	}

	/**
	 * Smart Search before content save method.
	 * This event is fired before the data is actually saved.
	 *
	 * @param   string   $context  The context of the content passed to the
plugin.
	 * @param   JTable   $row      A JTable object.
	 * @param   boolean  $isNew    If the content is just about to be created.
	 *
	 * @return  boolean  True on success.
	 *
	 * @since   2.5
	 * @throws  Exception on database error.
	 */
	public function onFinderBeforeSave($context, $row, $isNew)
	{
		// We only want to handle articles here.
		if ($context === 'com_content.article' || $context ===
'com_content.form')
		{
			// Query the database for the old access level if the item isn't
new.
			if (!$isNew)
			{
				$this->checkItemAccess($row);
			}
		}

		// Check for access levels from the category.
		if ($context === 'com_categories.category')
		{
			// Query the database for the old access level if the item isn't
new.
			if (!$isNew)
			{
				$this->checkCategoryAccess($row);
			}
		}

		return true;
	}

	/**
	 * Method to update the link information for items that have been changed
	 * from outside the edit screen. This is fired when the item is published,
	 * unpublished, archived, or unarchived from the list view.
	 *
	 * @param   string   $context  The context for the content passed to the
plugin.
	 * @param   array    $pks      An array of primary key ids of the content
that has changed state.
	 * @param   integer  $value    The value of the state that the content has
been changed to.
	 *
	 * @return  void
	 *
	 * @since   2.5
	 */
	public function onFinderChangeState($context, $pks, $value)
	{
		// We only want to handle articles here.
		if ($context === 'com_content.article' || $context ===
'com_content.form')
		{
			$this->itemStateChange($pks, $value);
		}

		// Handle when the plugin is disabled.
		if ($context === 'com_plugins.plugin' && $value === 0)
		{
			$this->pluginDisable($pks);
		}
	}

	/**
	 * Method to index an item. The item must be a FinderIndexerResult object.
	 *
	 * @param   FinderIndexerResult  $item    The item to index as a
FinderIndexerResult object.
	 * @param   string               $format  The item format.  Not used.
	 *
	 * @return  void
	 *
	 * @since   2.5
	 * @throws  Exception on database error.
	 */
	protected function index(FinderIndexerResult $item, $format =
'html')
	{
		$item->setLanguage();

		// Check if the extension is enabled.
		if (JComponentHelper::isEnabled($this->extension) === false)
		{
			return;
		}

		$item->context = 'com_content.article';

		// Initialise the item parameters.
		$registry = new Registry($item->params);
		$item->params = JComponentHelper::getParams('com_content',
true);
		$item->params->merge($registry);

		$item->metadata = new Registry($item->metadata);

		// Trigger the onContentPrepare event.
		$item->summary =
FinderIndexerHelper::prepareContent($item->summary, $item->params,
$item);
		$item->body    = FinderIndexerHelper::prepareContent($item->body,
$item->params, $item);

		// Build the necessary route and path information.
		$item->url = $this->getUrl($item->id, $this->extension,
$this->layout);
		$item->route = ContentHelperRoute::getArticleRoute($item->slug,
$item->catid, $item->language);
		$item->path = FinderIndexerHelper::getContentPath($item->route);

		// Get the menu title if it exists.
		$title = $this->getItemMenuTitle($item->url);

		// Adjust the title if necessary.
		if (!empty($title) &&
$this->params->get('use_menu_title', true))
		{
			$item->title = $title;
		}

		// Add the meta author.
		$item->metaauthor = $item->metadata->get('author');

		// Add the metadata processing instructions.
		$item->addInstruction(FinderIndexer::META_CONTEXT,
'metakey');
		$item->addInstruction(FinderIndexer::META_CONTEXT,
'metadesc');
		$item->addInstruction(FinderIndexer::META_CONTEXT,
'metaauthor');
		$item->addInstruction(FinderIndexer::META_CONTEXT,
'author');
		$item->addInstruction(FinderIndexer::META_CONTEXT,
'created_by_alias');

		// Translate the state. Articles should only be published if the category
is published.
		$item->state = $this->translateState($item->state,
$item->cat_state);

		// Add the type taxonomy data.
		$item->addTaxonomy('Type', 'Article');

		// Add the author taxonomy data.
		if (!empty($item->author) || !empty($item->created_by_alias))
		{
			$item->addTaxonomy('Author',
!empty($item->created_by_alias) ? $item->created_by_alias :
$item->author);
		}

		// Add the category taxonomy data.
		$item->addTaxonomy('Category', $item->category,
$item->cat_state, $item->cat_access);

		// Add the language taxonomy data.
		$item->addTaxonomy('Language', $item->language);

		// Get content extras.
		FinderIndexerHelper::getContentExtras($item);

		// Index the item.
		$this->indexer->index($item);
	}

	/**
	 * Method to setup the indexer to be run.
	 *
	 * @return  boolean  True on success.
	 *
	 * @since   2.5
	 */
	protected function setup()
	{
		// Load dependent classes.
		JLoader::register('ContentHelperRoute', JPATH_SITE .
'/components/com_content/helpers/route.php');

		return true;
	}

	/**
	 * Method to get the SQL query used to retrieve the list of content items.
	 *
	 * @param   mixed  $query  A JDatabaseQuery object or null.
	 *
	 * @return  JDatabaseQuery  A database object.
	 *
	 * @since   2.5
	 */
	protected function getListQuery($query = null)
	{
		$db = JFactory::getDbo();

		// Check if we can use the supplied SQL query.
		$query = $query instanceof JDatabaseQuery ? $query :
$db->getQuery(true)
			->select('a.id, a.title, a.alias, a.introtext AS summary,
a.fulltext AS body')
			->select('a.images')
			->select('a.state, a.catid, a.created AS start_date,
a.created_by')
			->select('a.created_by_alias, a.modified, a.modified_by,
a.attribs AS params')
			->select('a.metakey, a.metadesc, a.metadata, a.language,
a.access, a.version, a.ordering')
			->select('a.publish_up AS publish_start_date, a.publish_down AS
publish_end_date')
			->select('c.title AS category, c.published AS cat_state,
c.access AS cat_access');

		// Handle the alias CASE WHEN portion of the query
		$case_when_item_alias = ' CASE WHEN ';
		$case_when_item_alias .= $query->charLength('a.alias',
'!=', '0');
		$case_when_item_alias .= ' THEN ';
		$a_id = $query->castAsChar('a.id');
		$case_when_item_alias .= $query->concatenate(array($a_id,
'a.alias'), ':');
		$case_when_item_alias .= ' ELSE ';
		$case_when_item_alias .= $a_id . ' END as slug';
		$query->select($case_when_item_alias);

		$case_when_category_alias = ' CASE WHEN ';
		$case_when_category_alias .= $query->charLength('c.alias',
'!=', '0');
		$case_when_category_alias .= ' THEN ';
		$c_id = $query->castAsChar('c.id');
		$case_when_category_alias .= $query->concatenate(array($c_id,
'c.alias'), ':');
		$case_when_category_alias .= ' ELSE ';
		$case_when_category_alias .= $c_id . ' END as catslug';
		$query->select($case_when_category_alias)

			->select('u.name AS author')
			->from('#__content AS a')
			->join('LEFT', '#__categories AS c ON c.id =
a.catid')
			->join('LEFT', '#__users AS u ON u.id =
a.created_by');

		return $query;
	}
}
content.xml000064400000001477151160360460006753 0ustar00<?xml
version="1.0" encoding="utf-8"?>
<extension version="3.1" type="plugin"
group="finder" method="upgrade">
	<name>plg_finder_content</name>
	<author>Joomla! Project</author>
	<creationDate>August 2011</creationDate>
	<copyright>(C) 2005 - 2020 Open Source Matters. All rights
reserved.</copyright>
	<license>GNU General Public License version 2 or later; see
LICENSE.txt</license>
	<authorEmail>admin@joomla.org</authorEmail>
	<authorUrl>www.joomla.org</authorUrl>
	<version>3.0.0</version>
	<description>PLG_FINDER_CONTENT_XML_DESCRIPTION</description>
	<files>
		<filename plugin="content">content.php</filename>
	</files>
	<languages>
		<language
tag="en-GB">language/en-GB/en-GB.plg_finder_content.ini</language>
		<language
tag="en-GB">language/en-GB/en-GB.plg_finder_content.sys.ini</language>
	</languages>
</extension>
index.html000064400000000054151160403720006537 0ustar00<html><body
bgcolor="#FFFFFF"></body></html>helper.php000064400000065362151160403720006547
0ustar00<?php
/**
 *
------------------------------------------------------------------------
 * JA Filter Plugin - Content
 *
------------------------------------------------------------------------
 * Copyright (C) 2004-2016 J.O.O.M Solutions Co., Ltd. All Rights
Reserved.
 * @license - GNU/GPL, http://www.gnu.org/licenses/gpl.html
 * Author: J.O.O.M Solutions Co., Ltd
 * Websites: http://www.joomlart.com - http://www.joomlancers.com
 * This file may not be redistributed in whole or significant part.
 *
------------------------------------------------------------------------
 */
defined('_JEXEC') or die;

use Joomla\CMS\Factory;
use Joomla\CMS\Language\LanguageHelper;
use Joomla\Registry\Registry;
use Joomla\String\StringHelper;
use Joomla\Utilities\ArrayHelper;

JLoader::register('BaseFilterHelper', JPATH_ADMINISTRATOR
.'/components/com_jamegafilter/base.php');
JLoader::register('ReservationHelperRoute', JPATH_ROOT
.'/components/com_reservation/helpers/route.php');

class ReservationFilterHelper extends BaseFilterHelper {

	public function __construct($params = array())
	{
		$this->_db = JFactory::getDbo();
		$this->_params = new JRegistry($params);
		$this->plugin = JPluginHelper::getPlugin('jamegafilter',
'reservation');
		$this->plgParams = new JRegistry($this->plugin);
		$this->plgParams->loadString($this->plugin->params);
		return parent::__construct($params);
	}

	public function getFilterItems($catid)
	{
		$filterItems = array();
		$lang_sfx = $this->getLangSuffix();

		foreach ($lang_sfx AS $lang) {
			$filterItems[strtolower(str_replace('-','_',$lang))]
= $this->getItemList($catid,$lang);
		}

		return $filterItems;
	}
	
	public function getLangSuffix()
	{
		# $langs = JFactory::getLanguage()->getKnownLanguages();
    $langs = LanguageHelper::getKnownLanguages();
		$lang_sfx = array();
		foreach ($langs as $lang) {
			$lang_sfx[] = $lang['tag'];
		}
		
		return $lang_sfx;
	}

	public function getCatList($catid, $ordering = 'rgt ASC') {
		$catid = $catid ? $catid : '1';
		
		$catList = array();
		$include_root = $this->_params->get('include_root',
self::INCLUDE_ROOT);
		$subcat = $this->_params->get('subcat', self::ALL);

		if ($include_root === self::INCLUDE_ROOT && $catid !==
'1') {
			$catList[] = $catid;	
		}

		if ($subcat !== self::NONE) {
			$maxLevel = $subcat === self::ALL ? 100 : (int) $subcat;
			$categories = $this->getChildCategories($catid, $maxLevel, 0,
$ordering);
			foreach ($categories as $category) {
				$catList[] = $category->id;
			}
		}

		return $catList;
	}
	
	public function getItemList($catid, $lang)
	{
		$catList = $this->getCatList($catid);
		if (!count($catList)) {
			return array();
		}

		$itemList = new stdCLass();
    # wrong data here
		 $itemIdList = $this->getListId($catList, $lang);
		if ($itemIdList) {
			foreach ($itemIdList as $id) {
				$property = 'item_'.$id;
				$item = $this->getItem($id, $catList, $lang);
				if( !empty($item))
					$itemList->{ $property } = $item;
				else
					continue;
			}
		}

		return $itemList;
	}
	
	public function getListId($catids, $lang)
	{
		$db = $this->_db;
		$nullDate = $db->quote($db->getNullDate());
		$nowDate  = $db->quote(JFactory::getDate()->toSql());
		$query = $db->getQuery(true);
		$query->select('id')
				->from('#__reservation_consultant')
				->where('state = 1 AND catid IN (' .implode(',',
$catids) . ') AND language IN ("*",
"'.$lang.'")' )
				->where('(publish_up = ' . $nullDate . ' OR
publish_up <= ' . $nowDate . ')')
				->order('id desc');
    # ->where('(publish_down = ' . $nullDate . ' OR
publish_down >= ' . $nowDate . ')') // between where and
order
    # select id from oektv_content where state=1 AND catid IN (2,8,9) AND
language IN ("*", "en-GB")
    # AND (publish_up = '0000-00-00 00:00:00' OR publish_up <=
'2022-01-11 04:10:15')
    # AND (publish_down = '0000-00-00 00:00:00' OR publish_down
>= '2022-01-11 04:10:15') ORDER BY id DESC;
		$db->setQuery($query);
		$listId = $db->loadColumn();
		return $listId;
	}

	public function getCategoryListInfo($catList) {
		if (version_compare(JVERSION, '3.7', '<'))
			return;

		$cdata = array();
		$cdata['value'] = array();
		$cdata['frontend_value'] = array();

		$query = $this->_db->getQuery(true);
		$query ->select('c.*')
				->from('#__categories as c')
				->where('c.id in (' . implode(',', $catList) .
')')
				->where('c.published = 1');
		$this->_db->setQuery($query);
		$categories = $this->_db->loadObjectList();

		foreach ($categories as $cat) {
			$cdata['value'][] = $cat->id;
			$cdata['frontend_value'][] =
$this->getCatNameAsTree($cat);
		}

		return $cdata;
	}
	
	public function getItem($id, $catList, $lang)
	{
		$app = JFactory::getApplication();
		$baseItem = $this->getBaseItem($id);
		$baseItem->text = $baseItem->introtext . $baseItem->fulltext;

		// Process the content plugins.
		JPluginHelper::importPlugin('content');
    $dispatcher = JFactory::getApplication();
    
    if (isset($baseItem->params)){
      $dispatcher->triggerEvent('onContentPrepare', array
('com_content.article', &$baseItem,
&$baseItem->params, 0));
    }
		$images = new JRegistry($baseItem->images);

		$item = new stdCLass();
		if (in_array($baseItem->language, array('*', $lang))) {
			$item->id = $id;
      $item->slug = $id;
			$item->lang = $lang;
			$item->hits = (int) $baseItem->hits;
			$item->name = $baseItem->title;

			$img = $images->get('image_intro',
$images->get('image_fulltext', ''));
      if (strpos($img, '#joomlaImage:')){
        $img = explode('#joomlaImage:', $img)[0];
      }
			$item->thumbnail = $this->generateThumb($id, $img,
'content');
			$juri = JUri::getInstance();
			if (preg_match('/^\/\//', $item->thumbnail)) {
				$item->thumbnail =
$juri->getScheme().':'.$item->thumbnail;
			}

			if ($this->checkDisplayOnFO('desc')) {
				$text = trim($baseItem->text);
				$item->desc = $text ? $this->getDesc($text) : '';
				if (preg_match('/<img src="[^http|\/]/',
$item->desc)) {
					// change to right link with custom field media. basic use. will be
update change later.
					$item->desc = preg_replace('/<img
src="([^http|\/].*?)"/', '<img
src="'.JUri::root(true).'/$1"', $item->desc);
				}
			}

			//Item link
			$slug = $baseItem->alias ? ($baseItem->id . ':' .
$baseItem->alias) : $baseItem->id;
			$catslug = isset($baseItem->category_alias) ? ($baseItem->catid .
':' . $baseItem->category_alias) : $baseItem->catid;
			$route = ContentHelperRoute::getArticleRoute($slug, $catslug,
$item->lang);
			
			$uriLeng = mb_strlen(JUri::root(true));
			$item->url = mb_substr(JRoute::_($route), $uriLeng);
			
			$item->attr = array();
			if ($this->checkDisplayOnFO('name')) {
				$item->attr['name']['frontend_value'] =
$item->name ?? '';
				$fieldconfig = $this->getFieldConfig('name');
				$item->attr['name']['title'] =
array($fieldconfig['title']);
				$item->attr['name']['type'] =
$fieldconfig['type'];
			}

			//Ratings
			if ($this->checkPublished('rating') ||
$this->checkDisplayOnFO('rating')) {
				$item->rating = $this->getRating($id) ? $this->getRating($id)
: 0;
				$item->width_rating = $item->rating * 20;
				$item->attr['rating']['frontend_value'] =
$item->width_rating;
				$item->attr['rating']['rating'] =
floatval($item->rating);
				$fieldconfig = $this->getFieldConfig('rating');
				$item->attr['rating']['title'] =
array($fieldconfig['title']);
				$item->attr['rating']['type'] =
$fieldconfig['type'];
			}

			if ($this->checkDisplayOnFO('hits')) {
				$item->attr['hits']['frontend_value'] =
$item->hits ?? '';
				$fieldconfig = $this->getFieldConfig('hits');
				$item->attr['hits']['title'] =
array($fieldconfig['title']);
				$item->attr['hits']['type'] =
$fieldconfig['type'];
			}

      # print_r($item->desc);
			if ($this->checkPublished('attr.fulltext.value') ||
$this->checkDisplayOnFO('attr.fulltext.value')) {
				$item->attr['fulltext']['frontend_value'] =
$item->desc ?? '';
				$item->attr['fulltext']['value'] =
strip_tags($baseItem->text);
				$fieldconfig =
$this->getFieldConfig('attr.fulltext.value');
				$item->attr['fulltext']['title'] =
array($fieldconfig['title']);
				$item->attr['fulltext']['type'] =
$fieldconfig['type'];
			}

			$featured = $baseItem->featured;
			$item->featured = $featured; // this value for custom use on FO like
icon or something
			if ($this->checkDisplayOnFO('attr.featured.value') ||
$this->checkPublished('attr.featured.value')) {
                $item->attr['featured']['value'] =
array($featured);
               
$item->attr['featured']['frontend_value'] =
$featured ? array(JText::_('COM_JAMEGAFILTER_ONLY_FEATURED')) :
array(JText::_('COM_JAMEGAFILTER_NOT_FEATURED'));
                $fieldconfig =
$this->getFieldConfig('attr.featured.value');
                $item->attr['featured']['title'] =
array($fieldconfig['title']);
                $item->attr['featured']['type'] =
$fieldconfig['type'];
			}

			if ($baseItem->created != '0000-00-00 00:00:00') {
				if ($this->checkPublished('created_date')) {
					$item->created_date = array( strtotime($baseItem->created) );
				}

				if ($this->checkDisplayOnFO('created_date')) {
					$item->attr['created_date']['frontend_value'] =
array( strtotime($baseItem->created) );
					$fieldconfig = $this->getFieldConfig('created_date');
					$item->attr['created_date']['title'] =
array($fieldconfig['title']);
					$item->attr['created_date']['type'] =
$fieldconfig['type'];
				}
			}

			if ($baseItem->modified != '0000-00-00 00:00:00') {
				if ($this->checkPublished('modified_date')) {
					$item->modified_date = array( strtotime($baseItem->modified) );
				}

				if ($this->checkDisplayOnFO('modified_date')) {
					$item->attr['modified_date']['frontend_value']
= array( strtotime($baseItem->modified) );
					$fieldconfig = $this->getFieldConfig('modified_date');
					$item->attr['modified_date']['title'] =
array($fieldconfig['title']);
					$item->attr['modified_date']['type'] =
$fieldconfig['type'];
				}
			}
			
			if ($baseItem->publish_up != '0000-00-00 00:00:00') {
				if ($this->checkPublished('published_date')) {
					$item->published_date = array( strtotime($baseItem->publish_up)
);
				}

				if ($this->checkDisplayOnFO('published_date')) {
					$item->attr['published_date']['frontend_value']
= array( strtotime($baseItem->publish_up) );
					$fieldconfig = $this->getFieldConfig('published_date');
					$item->attr['published_date']['title'] =
array($fieldconfig['title']);
					$item->attr['published_date']['type'] =
$fieldconfig['type'];
				}
			}

			//Attributes
			$this->attr = array();
			$this->getAuthorInfo($baseItem);

			//Category Info
			$this->getCategoryInfo($id, $catList);
			//Tag Info
			if (!empty($baseItem->tags->tags))
				$this->getTagInfo($baseItem->tags->tags, $lang);
			//Custom fields
			$this->getCustomFieldsInfo($id, $lang);
			
			$item->access = $this->getPermission($baseItem);

			$item->attr = array_merge($item->attr, $this->attr);
			
			// support user custom field, only parse to json if template required.
			if
(JFile::exists(JPATH_SITE.'/templates/'.$app->getTemplate().'/etc/jamegafilter-ucf.log'))
			    $item->ucf = $this->getCustomJFields($baseItem->created_by,
"user");

			// support ja content type
			if (isset($baseItem->attribs['ctm_reservation_type'])
&&
!empty($baseItem->attribs['ctm_'.$baseItem->attribs['ctm_reservation_type']]))
{
			   
$item->{"cmt_".$baseItem->attribs['ctm_reservation_type']}
=
$baseItem->attribs['ctm_'.$baseItem->attribs['ctm_reservation_type']];
			}
		}
		return $item;
	}

	public function getPermission($item)
	{
		$sql = 'SELECT rules FROM #__viewlevels WHERE id =
'.$this->_db->quote($item->access);
		$this->_db->setQuery($sql);
		$access = $this->_db->loadResult();
		if (!empty($access))
			return str_replace(['[', ']'], ['',
''],$access);
	}

	public function getDesc($desc) {
		$length = 20;
		$desc = strip_tags($desc);
		$exp = explode(' ', $desc);
		$result = '';
		foreach ($exp as $key => $value) {
			if ($key > $length) {
				break;
			}
			$result .= $value . ' ';
		}
		return $result;
	}
	
	// public function getRating($itemId){
		// $rateOption = $this->plgParams->get('rating-option',
'com_reservation');
		// if($rateOption === 'com_content'){
			// $query = $this->_db->getQuery(true);
			// $query->select('rating_sum,
rating_count')->from('#__content_rating')->where('content_id
= ' . (int) $itemId);
			// $this->_db->setQuery($query);
			// $rating = $this->_db->loadObject();

			// if (!$rating){
				// return false;
			// }
			// return round((int) $rating->rating_sum / (int)
$rating->rating_count, 0);
		// }

    // if (!$this->getComponentStatus('com_komento')){
      // return false;
    // }

		// $query1[] = 'SELECT ax.`component`, ax.`cid`, count(1) AS
`count`, sum(ax.`ratings`) AS `totalRating`, ROUND(AVG(ax.`ratings`)/2,2)
AS `avgRating`';
		// $query1[] = 'FROM `#__komento_comments` AS `ax`';
		// $query1[] = 'WHERE ax.`published` = ' .
$this->_db->Quote(1);
		display the posts that have ratings given
		// $query1[] = 'AND ax.`ratings` > 0';
		// $query1[] = 'AND ax.`cid` = ' .
$this->_db->Quote($itemId);
		// $query1[] = 'AND ax.`created` = ';
		// $query1[] = '(SELECT MAX(bx.`created`) FROM `#__komento_comments`
AS `bx`';
		// $query1[] = 'WHERE bx.`email` = ax.`email`';
		// $query1[] = 'AND bx.`component` = ax.`component`';
		// $query1[] = 'AND bx.`cid` = ax.`cid`';
		// $query1[] = ')';
		// $query1[] = "AND ax.`component` = " .
$this->_db->quote('com_content');
		// $query1[] = "GROUP BY ax.`cid`";
		// $query1   = implode(' ', $query1);
		// $this->_db->setQuery($query1);
		// $data = $this->_db->loadObject();
    // if (!$data){
      // return false;
    // }
		// return isset($data) && !is_null($data) ? $data->avgRating :
0;
	// }

	public function getComponentStatus($component)
	{
		$db = JFactory::getDbo();
		$q = 'select enabled from #__extensions where
type="component" and element =
"'.$component.'"';
		$db->setQuery($q);
		$status = $db->loadResult();
		if($status) {
			return true;
		} else {
			return false;
		}
	}

	public function getBaseItem($id)
	{
		JModelLegacy::addIncludePath(JPATH_ROOT .
'/administrator/components/com_content/models',
'ContentModel');
		if (version_compare(JVERSION, '4.0', 'ge'))
			$model = new
Joomla\Component\Content\Administrator\Model\ArticleModel();
		else
			$model = JModelLegacy::getInstance('Article',
'ContentModel');
		$baseItem = $model->getItem($id);

		return $baseItem;
	}

	public function getAuthorInfo($baseItem) {
		$data = array();
		if ($baseItem->created_by_alias) {
			$data['value'][] = urlencode($baseItem->created_by_alias);
			$data['frontend_value'][] = $baseItem->created_by_alias;
		} else if ($baseItem->created_by) {
			$query = $this->_db->getQuery(true);
			$query->select('*')
				->from('#__users')
				->where('id = ' . $baseItem->created_by);
			$user = $this->_db->setQuery($query)->loadObject();
			if ($user) {
				$data['value'][] = $baseItem->created_by;
				$data['frontend_value'][] = $user->name;
			}
		}

		if (!$data) {
			return;
		}

		if ($this->checkPublished('attr.author.value') ||
$this->checkDisplayOnFO('attr.author.value')) {
			$this->attr['author'] = $data;
			$this->attr['author']['frontend_value'] =
$data['frontend_value'];
			$fieldconfig = $this->getFieldConfig('attr.author.value');
			$this->attr['author']['title'] =
array($fieldconfig['title']);
			$this->attr['author']['type'] =
$fieldconfig['type'];
		}
	}
	
	public function getCategoryInfo($article_id, $catList) {
		if (version_compare(JVERSION, '3.7', '<'))
			return;
		
		$query = $this->_db->getQuery(true);
		$query ->select('c.*')
				->from('#__categories as c')
				->join('LEFT', '#__content as a ON a.catid =
c.id')
				->where('a.id = ' . (int) $article_id)
				->where('c.id in (' . implode(',', $catList) .
')')
				->where('c.published = 1');
		$this->_db->setQuery($query);
		$category = $this->_db->loadObject();

		if ($category) {
			$categories = $this->getParentCategories($category->id,
$catList);
			$cats = array();
			foreach ($categories as $key => $cat) {
				$tmp = new stdClass;
				$tmp->id = $cat->id;
				$tmp->title = $cat->title;

				$rest = array_slice($categories, $key + 1);
				foreach ($rest as $c) {
					$tmp->title =  $c->title . ' &raquo; ' .
$tmp->title;
				}

				$cats[] = $tmp;
			}

			$cdata = array();
			$cdata['value'] = array();
			$cdata['frontend_value'] = array();
			foreach ($cats as $cat) {
				if (in_array($cat->id, $cdata['value'])) {
					continue;
				}
				
				$cdata['value'][] = $cat->id;
				$cdata['frontend_value'][] = $cat->title;
			}

			if ($this->checkPublished('attr.cat.value') ||
$this->checkDisplayOnFO('attr.cat.value')) {
				$this->attr['cat'] = $cdata;
				$this->attr['cat']['frontend_value'] =
$cdata['frontend_value'];
				$fieldconfig = $this->getFieldConfig('attr.cat.value');
				$this->attr['cat']['title'] =
array($fieldconfig['title']);
				$this->attr['cat']['type'] =
$fieldconfig['type'];
			}
		}
		
		return $this->attr;
	}

	public function getParentCategories($catid, $catList) {
		$db = $this->_db;
		$parents = array();
		while (true) {
			$query = "SELECT * 
				FROM `#__categories` 
				WHERE id = $catid 
				AND level > 0";

			$result = $db->setQuery($query)->loadObject();
			if ($result && in_array($result->id, $catList)) {
				$parents[] = $result;
				$catid = $result->parent_id;
			} else {
				break;
			}
		}

		return $parents;
	}

	public function getCatNameAsTree($cat, $catList) {
		if (!in_array($cat->parent_id, $catList)) {
			return $cat->title;
		}
		$query = $this->_db->getQuery(true);
		$query->select('*')
			->from('#__categories')
			->where('id = ' . $cat->parent_id . ' and level
> 0');
		$this->_db->setQuery($query);
		$result = $this->_db->loadObject();

		if ($result) {
			$result->title = $result->title . ' &raquo; ' .
$cat->title;
			return $this->getCatNameAsTree($result, $catList);
		} else {
			return $cat->title;
		}
	}

	public function getCustomJFields($id, $context) {
		if ($context == 'article')
			$context = 'com_content.article';
		else if ($context == 'contact')
			$context = 'com_contact.contact';
		else if ($context == 'user')
			$context = 'com_users.user';
		$currentLanguage = JFactory::getLanguage();
		$currentTag = $currentLanguage->getTag();

		$sql = 'SELECT fv.value, fg.title AS gtitle, f.title AS ftitle,
f.name
				FROM #__fields_values fv
				LEFT JOIN #__fields f ON fv.field_id = f.id
				LEFT JOIN #__fields_groups fg ON fg.id = f.group_id
				WHERE fv.item_id = '.$id.'
				AND f.context = "'.$context.'"
				AND f.language IN ("*",
"'.$currentTag.'")
				AND f.access = 1
				';
			// echo $sql;
		$db = JFactory::getDbo();
		$db->setQuery($sql);
		$result = $db->loadObjectList();
		$arr = array();
		foreach ($result AS $r) {
			$arr[$r->name] = $r->value;
		}

		return $arr;
	}
	
	public function getCustomFieldsInfo($itemId, $lang) 
	{
		if (version_compare(JVERSION, '3.7', '<'))
			return;
		
		$query = $this->_db->getQuery(true);
		$query->select('f.id, f.title , fv.value, f.type, f.fieldparams,
f.params')
				->from('#__fields as f')
				->join('LEFT', '#__fields_values as fv ON fv.field_id
= f.id')
				->join('LEFT', '#__content as c ON fv.item_id =
c.id')
				->where('c.id = '. (int) $itemId);
		$this->_db->setQuery($query);
		$fields = $this->_db->loadObjectList();
		if ($fields) {
			$fdata = array();
			foreach ($fields as $field) {
				if (empty($field->value)) {
					continue;
				}
				switch ($field->type) {
					case 'text':
					case 'editor' :
					case 'textarea' :
					    if
(empty($fdata['ct'.$field->id]['value']))
					        $fdata['ct'.$field->id]['value'] =
"";
						$fdata['ct'.$field->id]['value'] .=
$field->value;
						$fdata['ct'.$field->id]['frontend_value'] =
$field->value;
						break;
					case 'url' :
					    if
(empty($fdata['ct'.$field->id]['value']))
					        $fdata['ct'.$field->id]['value'] =
"";
						$fdata['ct'.$field->id]['value'] .=
$field->value;
						$fdata['ct'.$field->id]['frontend_value'] =
'<a target="_blank"
href="'.$field->value.'">'.$field->value.'</a>';
						break;
					case 'calendar' :
						$fdata['ct'.$field->id]['value'][] =
strtotime($field->value);
						$fdata['ct'.$field->id]['frontend_value'][] =
strtotime($field->value);
						break;
					case 'integer' :
						$fdata['ct'.$field->id]['value'][] =
$field->value;
						$fdata['ct'.$field->id]['frontend_value'][] =
$field->value;
						break;
					case 'checkboxes' :
					case 'radio' :
					case 'list' :
					case 'sql' :
						$fdata['ct'.$field->id]['value'][] =
str_replace('+','%20',urlencode($field->value));
						$name = $this->getCustomName($field->id, $field->type,
$field->value);
						$fdata['ct'.$field->id]['frontend_value'][] =
$name;
						break;
					case 'usergrouplist' :
						$gname = $this->getUserGroupName($field->value);
						if ($gname) {
							$fdata['ct'.$field->id]['value'][] =
str_replace('+','%20',urlencode($field->value));
							$fdata['ct'.$field->id]['frontend_value'][] =
$gname;
						}
						break;
					case 'user' :
						if (JFactory::getUser($field->value)->id) {
							$fdata['ct'.$field->id]['value'][] =
str_replace('+','%20',urlencode($field->value));
							$fdata['ct'.$field->id]['frontend_value'][] =
JFactory::getUser($field->value)->get('name');
						}
						break;
					case 'imagelist' :
						if ($field->value == '-1')
							break;
						$fieldparams = json_decode($field->fieldparams);
						$path = 'images/' . $fieldparams->directory .
'/';
						$fdata['ct'.$field->id]['value'][] =
str_replace('+','%20',urlencode($path .
$field->value));
						$fdata['ct'.$field->id]['frontend_value'][] =
$path . $field->value;
						break;
					case 'media':
						$fieldparams = json_decode($field->fieldparams);
						if (version_compare(JVERSION, 4, 'ge')) {
							$mediaData = new JRegistry($field->value);
							$urlData =
JHtml::cleanImageURL($mediaData->get('imagefile'));
							$url = $urlData->url;
						} else {
							$url = $field->value;
						}

						$fdata['ct'.$field->id]['value'][] =
str_replace('+','%20',urlencode($url));
						$fdata['ct'.$field->id]['frontend_value'][] =
$url;
						break;
					case 'repeatable':
						// $fieldparams = json_decode($field->fieldparams);
						// $values = json_decode($field->value);
						// die('<pre>'.print_r($values,
1).'</pre>');
						break;
					default :
						$fdata['ct'.$field->id]['value'][] =
str_replace('+','%20',urlencode($field->value));
						$fdata['ct'.$field->id]['frontend_value'][] =
$field->value;
						break;
				}
			}

			foreach ($fdata as $k => $f) {
				if ($this->checkPublished('attr.'.$k.'.value')
|| $this->checkDisplayOnFO('attr.'.$k.'.value')) {
					$this->attr[$k] = $f;
					$this->attr[$k]['frontend_value'] =
$f['frontend_value'];
					$fieldconfig =
$this->getFieldConfig('attr.'.$k.'.value');
					$this->attr[$k]['title'] =
array($fieldconfig['title']);
					$this->attr[$k]['type'] =
$fieldconfig['type'];
				}
			}
		}

		return $this->attr;
	}
	
	public function getUserGroupName($groupId)
	{
		$query = $this->_db->getQuery(true);
		$query->select('title')->from('#__usergroups')->where('id
= '. (int)$groupId);
		$this->_db->setQuery($query);
		
		return $this->_db->loadResult();
	}

	public function getTagInfo($tagId, $lang) {
		$query = $this->_db->getQuery(true);
		$query->select('id, title, parent_id')
				->from('#__tags')
				->where('id IN ('.$tagId. ') AND `language` IN
("*", "'.$lang.'") AND published = 1');
		$this->_db->setQuery($query);
		$tags = $this->_db->loadObjectList();
		
		if ($tags) {
			$tdata = array();
			foreach ($tags as $tag) {
				$tdata['value'][] = $tag->id;
				$tdata['frontend_value'][] = $this->getTagTreeName($tag);
			}
			
			if ($this->checkPublished('attr.tag.value') ||
$this->checkDisplayOnFO('attr.tag.value')) {
				$this->attr['tag'] = $tdata;
				$this->attr['tag']['frontend_value'] =
$tdata['frontend_value'];
				$fieldconfig = $this->getFieldConfig('attr.tag.value');
				$this->attr['tag']['title'] =
array($fieldconfig['title']);
				$this->attr['tag']['type'] =
$fieldconfig['type'];
			}
		}
		return $this->attr;
	}

	public function getTagTreeName($tag) {
		$q = 'SELECT * FROM `#__tags` WHERE id = ' . $tag->parent_id
. ' AND id > 1';
		$db = JFactory::getDbo()->setQuery($q);
		$result = $db->loadObject();
		if ($result) {
			$result->title = $result->title . ' &raquo; ' .
$tag->title;
			return $this->getTagTreeName($result);
		} else {
			return $tag->title;
		}
	}
	
	public function getCustomFields() 
	{
		if (version_compare(JVERSION, '3.7', '<'))
			return;
		
		$query = $this->_db->getQuery(true);
		$query->select('*')->from('#__fields')->where('context
= "com_content.article" AND state = 1');
		$this->_db->setQuery($query);
		$fields = $this->_db->loadObjectList();
		
		return $fields;
	}
	
	public function getCustomName($field_id, $field_type, $field_value) 
	{
		$query = $this->_db->getQuery(true);
		$query->select('fieldparams')
				->from('#__fields')
				->where('id = '. (int) $field_id);
		$this->_db->setQuery($query);
		$fparams = $this->_db->loadResult();
		if ($fparams) {
			$registry = new Registry;
			$registry->loadString($fparams);
			$fparams = $registry->toArray();
			switch ($field_type) {
				case 'sql' :
					$q = $fparams['query'];
					if (!empty($q)) {
						$this->_db->setQuery($q);
						$results = $this->_db->loadObjectList();
						if ($results) {
							foreach ($results as $r) {
								if ($r->value == $field_value)
									return $r->text;
							}
						}
					}
					break;
				default :
					if (!empty($fparams['options'])) {
						foreach ($fparams['options'] as $option) {
							if ($option['value'] == $field_value) {
								return $option['name'];
							}
						}
					}
					break;
			}
		}
	}
	
	// copy from helper.php. if change this need to change there too.
	public function getChildCategories($catid = 1, $maxLevel = 100, $level =
0, $ordering = 'rgt ASC') 
	{
		$level++;
		$db = JFactory::getDbo();
		$query = $db->getQuery(true);
		$query->select('*')
				->from('#__categories')
				->where('parent_id = '. (int)$catid)
				->where('extension IN ("com_reservation",
"system")')
				->where('published = 1')
				->order($ordering);

		$db->setQuery($query);
		
		$children = $db->loadObjectList();
		$cats = array();
		foreach ($children as $child) {
			$cats[] = $child;
			if ($level < $maxLevel) {
				foreach ($this->getChildCategories($child->id, $maxLevel, $level,
$ordering) as $c) {
					$cats[] = $c;
				}
			}
		}
		
		return $cats;
	}
	
}
tmpl/default.php000064400000014737151160403720007670 0ustar00<?php
/**
 *
------------------------------------------------------------------------
 * JA Filter Plugin - Reservation
 *
------------------------------------------------------------------------
 * Copyright (C) 2004-2016 J.O.O.M Solutions Co., Ltd. All Rights
Reserved.
 * @license - GNU/GPL, http://www.gnu.org/licenses/gpl.html
 * Author: J.O.O.M Solutions Co., Ltd
 * Websites: http://www.joomlart.com - http://www.joomlancers.com
 * This file may not be redistributed in whole or significant part.
 *
------------------------------------------------------------------------
 */

// No direct access to this file
defined('_JEXEC') or die('Restricted access');
$input = JFactory::getApplication()->input;
$direction = !empty($this->config->Moduledirection) ?
$this->config->Moduledirection : $this->config->direction;
if ($direction == 'vertical')
	$direction='';

if((!empty($this->config->isComponent) &&
empty($this->config->isModule)) ||
				(empty($this->config->isComponent) &&
!empty($this->config->isModule)) ) {

	$user = JFactory::getUser();
	$userID = $user->id;
	$groups = $user->getAuthorisedGroups();
}
?>

<?php if(!empty($this->config->isComponent) &&
empty($this->config->isModule)): ?>
<?php
	$hasModule = JaMegafilterHelper::hasMegafilterModule();
	if($hasModule) {
		$this->config->sticky = 0;
	}
?>
<?php if (isset($this->item['mparams']) &&
$this->item['mparams']->get('show_page_heading'))
: ?>
<div class="page-header">
	<h1> <?php echo
$this->item['mparams']->get('page_heading');
?> </h1>
</div>
<?php endif; ?>
<div class="jarow <?php echo $this->item['type']
?> <?php echo $direction; ?> ja-megafilter-wrap
clearfix">
	<?php if(!empty($this->config->fullpage) && !$hasModule):
?>
		<div data-mgfilter="reservation" class="<?php echo
$direction ?> ja-mg-sidebar sidebar-main">
			<a href="javascript:void(0)"
class="sidebar-toggle">
				<span class="filter-open">
					<i class="fa fa-filter"></i><?php echo
JText::_('COM_JAMEGAFILTER_OPEN_FILTER'); ?>
				</span>
				<span class="filter-close">
					<i class="fa fa-close"></i><?php echo
JText::_('COM_JAMEGAFILTER_CLOSE_FILTER'); ?>
				</span>
			</a>
			<div class="block ub-layered-navigation-sidebar
sidebar-content"></div>
		</div>
	<?php endif; ?>
	<?php
		if ($hasModule || (empty($this->config->fullpage) &&
!$hasModule)) {
			$full_width = 'full-width';
		} else {
			$full_width = '';
		}
	?>
	<div class="main-content <?php echo $full_width
?>"></div>
</div>
<?php else: ?>
	<div data-mgfilter="reservation" class="<?php echo
$direction ?> ja-mg-sidebar sidebar-main">
		<div class="block ub-layered-navigation-sidebar
sidebar-content"></div>
		<?php if(empty($this->config->isComponent)): ?>
			<a id="jamegafilter-search-btn" class="btn btn-default
" href="javascript:void(0)"><?php echo
JText::_('COM_JAMEGAFILTER_SEARCH') ?></a>
		<?php endif;?>
	</div>
<?php endif; ?>

<?php if((!empty($this->config->isComponent) &&
empty($this->config->isModule)) ||
(empty($this->config->isComponent) &&
!empty($this->config->isModule)) ): ?>

<script type="text/javascript">

<?php if(!empty($this->config->url)): ?>
var filter_url = '<?php echo $this->config->url?>';
<?php endif; ?>

var JABaseUrl = '<?php echo JUri::base(true); ?>';
var ja_default_sort="<?php echo $this->config->default_sort;
?>";
var ja_sort_by="<?php echo $this->config->sort_by;
?>";
var ja_layout_addition="<?php echo
$this->config->layout_addition; ?>";
var ja_layout_columns=<?php echo
json_encode($this->config->jacolumn); ?>;
var ja_userGroup = <?php echo json_encode($groups); ?>;
var p = <?php echo json_encode($this->jstemplate); ?>;
for (var key in p) {
  if (p.hasOwnProperty(key)) {
    var compiled = dust.compile(p[key], key);
    dust.loadSource(compiled);
  }
}

function bindCallback() {
	setTimeout(function(){
		if
(jQuery('.jamegafilter-wrapper').find('.pagination-wrap').length)
{
			jQuery('.jamegafilter-wrapper').removeClass('no-pagination');
		} else {
			jQuery('.jamegafilter-wrapper').addClass('no-pagination');
		}

		if (isMobile.apple.tablet &&
jQuery('#t3-off-canvas-sidebar').length) {
			jQuery('select').unbind().off().on('touchstart',
function() {
    			formTouch=true;
    			fixedElement.css('position', 'absolute');
    			fixedElement.css('top', jQuery(document).scrollTop());
			});
			jQuery('html').unbind().off().on('touchmove',
function() {
				if (formTouch==true) {
					fixedElement.css('position', 'fixed');
					fixedElement.css('top', '0');
					formTouch=false;
				}
			});
		}
		initScript();
	  }, 100);
	if
(jQuery('.items.product-items').find('.item').length ==
0) {
		jQuery('.toolbar-amount').each(function(){
			jQuery(this).find('.toolbar-number').first().text(0);
		});
	}
}

function scrolltop() {
	if (!isMobile.phone) jQuery("html, body").stop().animate({
scrollTop: jQuery('div.ja-megafilter-wrap').offset().top },
400);
}

function MegaFilterCallback() {
	bindCallback();
	<?php echo $input->getCmd('scrolltop') ?
'scrolltop();':'' ?>
}


function afterGetData(item) {
	if (typeof(item.thumbnail) != 'undefined' &&
item.thumbnail != '') {
		thumbnail = item.thumbnail;
		if (!thumbnail.match(/^http|https:/)) {
			item.thumbnail = '<?php echo JUri::root(true).
'/'?>'+item.thumbnail;
		}
	}

	// owner
  if (item.created_by == '<?php echo $userID ?>')
    return false;
  if (typeof item['access'] !== 'undefined' &&
item['access'] !== undefined && item['access']
!== null) {
    let itemAccess = item['access'].split(',');
    for (let i = 0; i < itemAccess.length; i++) {
      for (let x in ja_userGroup) {
        // super admin could see it all, public or guest.
        if (itemAccess[i] == ja_userGroup[x] || ja_userGroup[x] == 8) {
          return false;
        }
      }
    }
  }
	return true;

}

jQuery(document).ready(function() {
  var UBLNConfig = {};
  UBLNConfig.dataUrl = "<?php echo
JUri::base(true).$this->config->json;  ?>";
  UBLNConfig.fields = <?php echo
json_encode($this->config->fields); ?>;
  UBLNConfig.sortByOptions = <?php echo
str_replace('.value','.frontend_value',json_encode($this->config->sorts));
?>;
  UBLNConfig.defaultSortBy = "<?php echo
$this->config->default_sort; ?>";
  UBLNConfig.productsPerPageAllowed = [<?php echo implode(',',
$this->config->paginate); ?>];
  UBLNConfig.autopage = <?php echo $this->config->autopage ?
'true':'false' ?>;
  UBLNConfig.sticky = <?php echo $this->config->sticky ?
'true':'false' ?>;
  UBLN.main(UBLNConfig);
});
</script>

<?php
endif;assets/css/style.css000064400000000000151160403720010475
0ustar00assets/images/color-stars.png000064400000002510151160403720012266
0ustar00�PNG


IHDR�2jtEXtSoftwareAdobe
ImageReadyq�e<siTXtXML:com.adobe.xmp<?xpacket
begin="" id="W5M0MpCehiHzreSzNTczkc9d"?>
<x:xmpmeta xmlns:x="adobe:ns:meta/" x:xmptk="Adobe XMP
Core 5.6-c067 79.157747, 2015/03/30-23:40:42        "> <rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
<rdf:Description rdf:about=""
xmlns:xmpMM="http://ns.adobe.com/xap/1.0/mm/"
xmlns:stRef="http://ns.adobe.com/xap/1.0/sType/ResourceRef#"
xmlns:xmp="http://ns.adobe.com/xap/1.0/"
xmpMM:OriginalDocumentID="xmp.did:c8cdb5f6-2b33-4f95-a2bb-ed05efbb05d3"
xmpMM:DocumentID="xmp.did:84B04A70166611E68195C6716F520107"
xmpMM:InstanceID="xmp.iid:84B04A6F166611E68195C6716F520107"
xmp:CreatorTool="Adobe Photoshop CC (Macintosh)">
<xmpMM:DerivedFrom
stRef:instanceID="xmp.iid:e8f10950-e434-4bf0-860b-dd041bea606f"
stRef:documentID="xmp.did:e8f10950-e434-4bf0-860b-dd041bea606f"/>
</rdf:Description> </rdf:RDF> </x:xmpmeta> <?xpacket
end="r"?>r��kIDATxڜ��JA�7*q1Sh���JIi��o�#XY���o!
���'P��T*ha���BH���pV�I4���d�=3�Ξ$�
p�<����i���`����>ѯyDW���0O��Š��PG\�,,�4L�F����6�(AF��M4!-J�|w���Ny���,�����t�cG�0��l�2L��T�-4��`Jc�[��k8�UR��w�`
g�z[Z�D�}K����_:�5�
��ꮍ��
���^/��'/!���߼���%�^*+1ۑ�h�U��Sr���H[���g��>�P�s�Ŝn�����K
����P��(j-�ϭ�-��P��TI�[�K�65�V�u�QIEND�B`�forms/index.html000064400000000054151160403720007665
0ustar00<html><body
bgcolor="#FFFFFF"></body></html>forms/content.xml000064400000003635151160403720010074
0ustar00<?xml version="1.0" encoding="utf-8"?>
<form>
	<!--root category to generate thumbnail-->
	<fieldset name="base">
		<field 
			name="contentcategories" 
			type="contentcategories" 
			label="COM_JAMEGAFILTER_ROOT_CATEGORY" 
		/>
		<field
			name="include_root"
			type="radio"
			label="COM_JAMEGAFILTER_INCLUDE_ROOT"
			description="COM_JAMEGAFILTER_INCLUDE_ROOT_DESC"
			class="btn-group btn-group-yesno"
			default="1"
			>
			<option value="1">JYES</option>
			<option value="0">JNO</option>
		</field>
		<field
			name="subcat"
			type="list"
			label="COM_JAMEGAFILTER_SUBCAT"
			description="COM_JAMEGAFILTER_SUBCAT_DESC"
			default="-1"
			>
			<option value="0">JNONE</option>
			<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>
			<option value="6">J6</option>
			<option value="7">J7</option>
			<option value="8">J8</option>
			<option value="9">J9</option>
			<option value="10">J10</option>
		</field>

		<field
			name="generate_thumb"
			type="radio"
			label="COM_JAMEGAFILTER_GENERATE_THUMB"
			description="COM_JAMEGAFILTER_GENERATE_THUMB_DESC"
			class="btn-group btn-group-yesno"
			default="0"
			>
			<option value="1">JYES</option>
			<option value="0">JNO</option>
		</field>

		<field name="thumb_width"
			type="text"
			label="COM_JAMEGAFILTER_THUMB_WIDTH"
			description="COM_JAMEGAFILTER_THUMB_WIDTH_DESC"
			default="300"
			showon="generate_thumb:1" />

		<field name="thumb_height"
			type="text"
			label="COM_JAMEGAFILTER_THUMB_HEIGHT"
			description="COM_JAMEGAFILTER_THUMB_HEIGHT_DESC"
			default="300"
			showon="generate_thumb:1" />
	</fieldset>

	<!--filter config-->
	<fieldset name="filterfields">
		<field 
			name="filterfields" 
			type="filterfields"  
		/>
	</fieldset>
</form>forms/reservation.xml000064400000003627151160403720010764
0ustar00<?xml version="1.0" encoding="utf-8"?>
<form>
	<!--root category to generate thumbnail-->
	<fieldset name="base">
		<field 
			name="reservationcat" 
			type="reservationcat" 
			label="COM_JAMEGAFILTER_ROOT_CATEGORY" 
		/>
		<field
			name="include_root"
			type="radio"
			label="COM_JAMEGAFILTER_INCLUDE_ROOT"
			description="COM_JAMEGAFILTER_INCLUDE_ROOT_DESC"
			class="btn-group btn-group-yesno"
			default="1"
			>
			<option value="1">JYES</option>
			<option value="0">JNO</option>
		</field>
		<field
			name="subcat"
			type="list"
			label="COM_JAMEGAFILTER_SUBCAT"
			description="COM_JAMEGAFILTER_SUBCAT_DESC"
			default="-1"
			>
			<option value="0">JNONE</option>
			<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>
			<option value="6">J6</option>
			<option value="7">J7</option>
			<option value="8">J8</option>
			<option value="9">J9</option>
			<option value="10">J10</option>
		</field>

		<field
			name="generate_thumb"
			type="radio"
			label="COM_JAMEGAFILTER_GENERATE_THUMB"
			description="COM_JAMEGAFILTER_GENERATE_THUMB_DESC"
			class="btn-group btn-group-yesno"
			default="0"
			>
			<option value="1">JYES</option>
			<option value="0">JNO</option>
		</field>

		<field name="thumb_width"
			type="text"
			label="COM_JAMEGAFILTER_THUMB_WIDTH"
			description="COM_JAMEGAFILTER_THUMB_WIDTH_DESC"
			default="300"
			showon="generate_thumb:1" />

		<field name="thumb_height"
			type="text"
			label="COM_JAMEGAFILTER_THUMB_HEIGHT"
			description="COM_JAMEGAFILTER_THUMB_HEIGHT_DESC"
			default="300"
			showon="generate_thumb:1" />
	</fieldset>

	<!--filter config-->
	<fieldset name="filterfields">
		<field 
			name="filterfields" 
			type="filterfields"  
		/>
	</fieldset>
</form>fields/filterfields.php000064400000014253151160403720011203
0ustar00<?php
/*
 *
------------------------------------------------------------------------
 * JA Filter Plugin - Reservation
 *
------------------------------------------------------------------------
 * Copyright (C) 2004-2016 J.O.O.M Solutions Co., Ltd. All Rights
Reserved.
 * @license - GNU/GPL, http://www.gnu.org/licenses/gpl.html
 * Author: J.O.O.M Solutions Co., Ltd
 * Websites: http://www.joomlart.com - http://www.joomlancers.com
 * This file may not be redistributed in whole or significant part.
 *
------------------------------------------------------------------------
 */
// No direct access to this file
defined('_JEXEC') or die('Restricted access');

class JFormFieldFilterfields extends JFormFieldJaMegafilter_filterfields {

	protected $type = 'filterfields';
	protected $catOrdering = true;

	function getFieldGroups()
	{
		$class_methods = get_class_methods($this);
		$fl_array	  = preg_grep('/getJaMegafilterField(.*?)/',
$class_methods);

		$fieldgroups = array();
		foreach ($fl_array as $value) {
			$array_key			   = strtolower(substr($value, 20));
			$fieldgroups[$array_key] = $this->{$value}();
		}
		return $fieldgroups;
	}

	function getJaMegafilterFieldBaseField()
	{
		$basefield = array(
			array(
				"published" => 0,
				"sort" => 0,
				"field" => "name",
				"title" => JText::_("COM_JAMEGAFILTER_TITLE"),
				"name" => JText::_("COM_JAMEGAFILTER_TITLE"),
				"filter_type" => array(
					"value"
				)
			),

			array(
				"published" => 0,
				"sort" => 0,
				"field" => "attr.cat.value",
				"title" =>
JText::_("COM_JAMEGAFILTER_CATEGORY"),
				"name" =>
JText::_("COM_JAMEGAFILTER_CATEGORY"),
				"filter_type" => array(
					"single",
					"dropdown", "select",
					"multiple"
				)
			),

			array(
				"published" => 0,
				"sort" => 0,
				"field" => "hits",
				"title" => JText::_("COM_JAMEGAFILTER_HITS"),
				"name" => JText::_("COM_JAMEGAFILTER_HITS"),
				"filter_type" => array(
					"range"
				)
			),

			array(
				"published" => 0,
				"sort" => 0,
				"field" => "rating",
				"title" => JText::_("COM_JAMEGAFILTER_RATING"),
				"name" => JText::_("COM_JAMEGAFILTER_RATING"),
				"filter_type" => array(
					'rating', 'range'
				)
			),

			array(
				"published" => 0,
				"sort" => 0,
				"field" => "attr.tag.value",
				"title" => JText::_("COM_JAMEGAFILTER_TAG"),
				"name" => JText::_("COM_JAMEGAFILTER_TAG"),
				"filter_type" => array(
					"single",
					"dropdown", "select",
					"multiple"
				)
			),

			array(
				"published" => 0,
				"sort" => 0,
				"field" => "published_date",
				"title" =>
JText::_("COM_JAMEGAFILTER_PUBLISHED_DATE"),
				"name" =>
JText::_("COM_JAMEGAFILTER_PUBLISHED_DATE"),
				"filter_type" => array(
					"date"
				)
			),

			array(
				"published"=>0,
				"sort" => 0,
				"field"=> "created_date",
				"title"=>JText::_("COM_JAMEGAFILTER_CREATED_DATE"),
				"name"=>JText::_("COM_JAMEGAFILTER_CREATED_DATE"),
				"filter_type"=>array("date")
			),
			array(
				"published" => 0,
				"sort" => 0,
				"field" => "attr.author.value",
				"title" => JText::_("COM_JAMEGAFILTER_AUTHOR"),
				"name" => JText::_("COM_JAMEGAFILTER_AUTHOR"),
				"filter_type" => array(
					"single",
					"dropdown", "select",
					"multiple"
				)
			),
			array(
				"published"=>0,
				"sort" => 0,
				"field"=> "modified_date",
				"title"=>JText::_("COM_JAMEGAFILTER_MODIFIED_DATE"),
				"name"=>JText::_("COM_JAMEGAFILTER_MODIFIED_DATE"),
				"filter_type"=>array("date")
			),
			array(
				"published" => 0,
				"sort" => 0,
				"field" => "attr.featured.value",
				"title" =>
JText::_("COM_JAMEGAFILTER_FEATURED"),
				"name" =>
JText::_("COM_JAMEGAFILTER_FEATURED"),
				"filter_type" => array("single",
"dropdown", "select", "multiple")
			),
			array(
				"published" => 0,
				"sort" => 0,
				"field" => "attr.fulltext.value",
				"title" =>
JText::_('COM_JAMEGAFILTER_FULLTEXT'),
				"name" =>
JText::_('COM_JAMEGAFILTER_FULLTEXT'),
				"filter_type" => array("value")
			),
		);

		return $basefield;
	}

	function getJaMegafilterFieldCustomFields() {
		if (version_compare(JVERSION, '3.7', '<'))
			return;
		$customFields = array();
		require_once(JPATH_PLUGINS .
'/jamegafilter/reservation/helper.php');
		$helper = new ReservationFilterHelper();
		$fields = $helper->getCustomFields();
		if ($fields) {
			foreach ($fields as $field) {
				if ($field->type === 'repeatable') {

				} else {
					$customField = array(
						"published" => 0,
						"sort" => 0,
						"field" =>
'attr.ct'.$field->id.'.value',
						"title" => $field->title,
						"name" => $field->title,
					);

					switch ($field->type) {
						case 'text':
							$customField['filter_type'] = array('value',
'range', 'latlong', 'numberrange');
							break;
						case 'editor' :
						case 'textarea' :
						case 'url' :
							$customField['filter_type'] = array('value',
'range');
							break;
						case 'color' :
							$customField['filter_type'] = array('color');
							break;
						case 'calendar' :
							$customField['filter_type'] = array('date');
							break;
						case 'integer' :
							$customField['filter_type'] = array(
								'range',
								'single',
								'dropdown',
								'multiple',
								"size"
							);
							break;
						case 'media':
						case 'imagelist':
							$customField['filter_type'] = array('media');
							break;
						default :
							$customField['filter_type'] = array(
								"single",
								"dropdown",
								"select",
								"multiple",
								"size"
							);
							break;
					}
					$customFields[] = $customField;
				}
			}
		}

		return $customFields;
	}

	function hasCustomOrdering($field) {
		if ($field['field'] === 'attr.cat.value') {
			return true;
		}

		preg_match('/\d+/', $field['field'], $matches);
		if (!count($matches)) {
			return false;
		}

		$id = $matches[0];
		$db = JFactory::getDbo();
		$query = "SELECT `id` 
				FROM `#__fields` 
				WHERE `id` = $id
				AND `type` IN ('list', 'checkboxes')
				AND `state` = 1";
		$result = $db->setQuery($query)->loadResult();
		return !!$result;
	}
}
fields/index.html000064400000000054151160403720010005
0ustar00<html><body
bgcolor="#FFFFFF"></body></html>fields/contentcategories.php000064400000003106151160403720012242
0ustar00<?php
/**
 *
------------------------------------------------------------------------
 * JA Filter Plugin - Content
 *
------------------------------------------------------------------------
 * Copyright (C) 2004-2016 J.O.O.M Solutions Co., Ltd. All Rights
Reserved.
 * @license - GNU/GPL, http://www.gnu.org/licenses/gpl.html
 * Author: J.O.O.M Solutions Co., Ltd
 * Websites: http://www.joomlart.com - http://www.joomlancers.com
 * This file may not be redistributed in whole or significant part.
 *
------------------------------------------------------------------------
 */
 
defined('_JEXEC') or die();
JLoader::register('ContentFilterHelper', JPATH_PLUGINS .
'/jamegafilter/content/helper.php');

class JFormFieldContentcategories extends JFormField
{
    protected $type = 'Contentcategories';

    protected function getInput()
    {
        $value = 0;
		if (!empty($this->value)) {
			$value = $this->value;
		}

		$helper = new ContentFilterHelper;
		$items = $helper->getChildCategories();
		
		$html = '';
		$html = '<select class="form-select form-select-color-state
form-select-success valid form-control-success" name="'
      .$this->name.'">';
		$html .= '<option
value="0">'.JText::_('COM_JAMEGAFILTER_ALL_CATEGORIES').'</option>';
		foreach ($items as $item) {
			if ($item->published != '1')
				continue;
			$html .= '<option '.($value == $item->id ? '
selected="selected" ' : '').'
value="'.$item->id.'">'.str_repeat('.&nbsp;&nbsp;',
($item->level)).'|_.&nbsp;'.$item->title.'</option>';
		}
		$html.='</select>';
		return $html;
    }
}
fields/reservationcat.php000064400000003120151160403720011547
0ustar00<?php
/**
 *
------------------------------------------------------------------------
 * JA Filter Plugin - Reservation
 *
------------------------------------------------------------------------
 * Copyright (C) 2004-2016 J.O.O.M Solutions Co., Ltd. All Rights
Reserved.
 * @license - GNU/GPL, http://www.gnu.org/licenses/gpl.html
 * Author: J.O.O.M Solutions Co., Ltd
 * Websites: http://www.joomlart.com - http://www.joomlancers.com
 * This file may not be redistributed in whole or significant part.
 *
------------------------------------------------------------------------
 */
 
defined('_JEXEC') or die();
JLoader::register('ReservationFilterHelper', JPATH_PLUGINS .
'/jamegafilter/reservation/helper.php');

class JFormFieldreservationcat extends JFormField
{
    protected $type = 'reservationcat';

    protected function getInput()
    {
        $value = 0;
		if (!empty($this->value)) {
			$value = $this->value;
		}

		$helper = new ReservationFilterHelper;
		$items = $helper->getChildCategories();
		
		$html = '';
		$html = '<select class="form-select form-select-color-state
form-select-success valid form-control-success" name="'
      .$this->name.'">';
		$html .= '<option
value="0">'.JText::_('COM_JAMEGAFILTER_ALL_CATEGORIES').'</option>';
		foreach ($items as $item) {
			if ($item->published != '1')
				continue;
			$html .= '<option '.($value == $item->id ? '
selected="selected" ' : '').'
value="'.$item->id.'">'.str_repeat('.&nbsp;&nbsp;',
($item->level)).'|_.&nbsp;'.$item->title.'</option>';
		}
		$html.='</select>';
		return $html;
    }
}
layouts/default/product-list.php000064400000002170151160403720013031
0ustar00<?php
/*
 *
------------------------------------------------------------------------
 * JA Filter Plugin - Content
 *
------------------------------------------------------------------------
 * Copyright (C) 2004-2016 J.O.O.M Solutions Co., Ltd. All Rights
Reserved.
 * @license - GNU/GPL, http://www.gnu.org/licenses/gpl.html
 * Author: J.O.O.M Solutions Co., Ltd
 * Websites: http://www.joomlart.com - http://www.joomlancers.com
 * This file may not be redistributed in whole or significant part.
 *
------------------------------------------------------------------------
 */
 
// No direct access to this file
defined('_JEXEC') or die('Restricted access');

$jinput = JFactory::getApplication()->input;
$itc     = $jinput->get('itempercol', 5, 'INT');
?>
<div class="ja-toolbar-wrapper toolbar-products toolbar-wrapper
toolbar-top">

</div>

<div class="ja-products-wrapper products wrapper grid products-grid
cols-<?php echo $itc; ?>">
	<div class="products list items product-items cols-<?php echo
$itc; ?>"></div>
</div>

<div class="ja-toolbar-wrapper toolbar-products toolbar-wrapper
toolbar-bottom">
</div>layouts/default/product-toolbar.php000064400000007471151160403720013531
0ustar00<?php
/*
 *
------------------------------------------------------------------------
 * JA Filter Plugin - Content
 *
------------------------------------------------------------------------
 * Copyright (C) 2004-2016 J.O.O.M Solutions Co., Ltd. All Rights
Reserved.
 * @license - GNU/GPL, http://www.gnu.org/licenses/gpl.html
 * Author: J.O.O.M Solutions Co., Ltd
 * Websites: http://www.joomlart.com - http://www.joomlancers.com
 * This file may not be redistributed in whole or significant part.
 *
------------------------------------------------------------------------
 */
defined('_JEXEC') or die;
?>
<div class="pages pagination-wrap">
	{^autopage}
	<ul aria-labelledby="paging-label" class="items
pages-items pagination">
		<li class="item pages-item-first button{@if value=startPage
is=curPage} disabled{/if}">
			<a title="Go to First page"
href="#page={startPage}" class="page action start"
data-action="page" data-value="{startPage}">
				<span><?php echo JText::_('COM_JAMEGAFILTER_FIRST');
?></span>
			</a>
		</li>

		<li class="item pages-item-prev{@if value=prevPage is=curPage}
disabled{/if}">
			<a title="Prev" href="#page={prevPage}"
class="page action previous" data-action="page"
data-value="{prevPage}">
				<span><?php echo JText::_('JPREV');
?></span>
			</a>
		</li>

		{#pages}
		<li class='item {@if value=. is=curPage} active  {/if}'>
			<a class="page" href="#page={.}" title="Go
to page {.}" data-action="page"
data-value="{.}">
				<span>{.}</span>
			</a>
		</li>
		{/pages}

		<li class="item pages-item-next{@if value=nextPage is=curPage}
disabled{/if}">
			<a title="Next" href="#page={nextPage}"
class="page action next" data-action="page"
data-value="{nextPage}">
				<span><?php echo JText::_('JNEXT');
?></span>
			</a>
		</li>

		<li class="item pages-item-last{@if value=endPage is=curPage}
disabled{/if}">
			<a title="Go to Last page" href="#page={endPage}"
class="page action last" data-action="page"
data-value="{endPage}">
				<span><?php echo JText::_('COM_JAMEGAFILTER_LAST');
?></span>
			</a>
		</li>
	</ul>
	{/autopage}

	<div id="toolbar-amount" class="counter
toolbar-amount">
		<?php echo JText::_('COM_JAMEGAFILTER_ITEMS'); ?>
<span class="toolbar-number"
data-lnstate="startIdx">0</span>-<span
class="toolbar-number"
data-lnstate="endIdx">0</span> <?php echo
JText::_('COM_JAMEGAFILTER_OF'); ?> <span
class="toolbar-number"
data-lnstate="totalItems">0</span>
	</div>
</div>

<div class="orderby-displaynumber">
	<div class="toolbar-sorter sorter">
		<label for="sorter"
class="sorter-label"><?php echo
JText::_('COM_JAMEGAFILTER_SORT_BY'); ?></label>
		<select class="sorter-options" data-role="sorter"
id="sorter">
			{#sortByOptions}
			<option{@if value=sortField is=field}
selected="selected"{/if} value="{field}"
data-action="sort"
data-value="{field}">{title}</option>
			{/sortByOptions}
		</select>
		<a data-value="{sortDir}"
data-role="direction-switcher" class="action sorter-action
sort-{sortDir}" href="#" title="Set Descending
Direction" data-action="sortdir">
			<i class="fa fa-long-arrow-up"
aria-hidden="true"></i>
		</a>
	</div>

	<div class="field limiter">
	{^autopage}
		<label for="limiter" class="limiter-label">
			<span><?php echo JText::_('JSHOW');
?></span>
		</label>
		<select class="limiter-options"
data-role="limiter" id="limiter">
			{#productsPerPageAllowed}
			<option{@if value=itemPerPage is=.}
selected="selected"{/if} value="{.}"
data-action="limiter"
data-value="{.}">{.}</option>
			{/productsPerPageAllowed}
		</select>
		<span class="limiter-text"><?php echo
JText::_('COM_JAMEGAFILTER_PER_PAGE'); ?></span>
	{/autopage}
	</div>

	<div class="field jamg-layout-chooser">
		<span data-layout="grid"><i class="fa
fa-th"></i></span>
		<span data-layout="list"><i class="fa
fa-list"></i></span>
	</div>

</div>layouts/default/filter-selected.php000064400000002554151160403720013461
0ustar00<?php
/**
 *
------------------------------------------------------------------------
 * JA Filter Plugin - Content
 *
------------------------------------------------------------------------
 * Copyright (C) 2004-2016 J.O.O.M Solutions Co., Ltd. All Rights
Reserved.
 * @license - GNU/GPL, http://www.gnu.org/licenses/gpl.html
 * Author: J.O.O.M Solutions Co., Ltd
 * Websites: http://www.joomlart.com - http://www.joomlancers.com
 * This file may not be redistributed in whole or significant part.
 *
------------------------------------------------------------------------
 */

defined('_JEXEC') or die;
?>
<div class="filter-selected filter-current filter-values">
  <h3 class="block-subtitle filter-current-subtitle"
role="heading" aria-level="2"
data-count="1"><?php echo
JText::_('COM_JAMEGAFILTER_SELECTED_FILTERS'); ?></h3>
  
  <ol class="items">
    {@iter:values}
    {#value}<li class="item">
      <label data-lnprop="{prop}" class="clear-filter
action remove">
        <span class="filter-label">{name}</span>
        <span class="filter-value">{value|s}</span>
      </label>
    </li>{/value}
    {/iter}
  </ol>

</div>
{@showClearAll:values}
<div class="block-actions filter-actions">
  <div class="btn btn-default clear-all-filter action
filter-clear"><?php echo
JText::_('COM_JAMEGAFILTER_CLEAR_ALL'); ?></div>
</div>
{/showClearAll}layouts/default/index.html000064400000000054151160403720011663
0ustar00<html><body
bgcolor="#FFFFFF"></body></html>layouts/default/product-item.php000064400000003671151160403720013023
0ustar00<?php
/*
 *
------------------------------------------------------------------------
 * JA Filter Plugin - Docman
 *
------------------------------------------------------------------------
 * Copyright (C) 2004-2016 J.O.O.M Solutions Co., Ltd. All Rights
Reserved.
 * @license - GNU/GPL, http://www.gnu.org/licenses/gpl.html
 * Author: J.O.O.M Solutions Co., Ltd
 * Websites: http://www.joomlart.com - http://www.joomlancers.com
 * This file may not be redistributed in whole or significant part.
 *
------------------------------------------------------------------------
 */

defined('_JEXEC') or die;
?>
{#data}
<div class="item product product-item">
  <div data-container="product-grid"
class="product-item-info {?thumbnail}{:else} no-image
{/thumbnail}">
    <div class="product-item-details">
      {@info:data}
      <div class="item-field {._class} {render_class}">
        {?.key}<div class="item-field-label
{label_render_class}">{.key}</div>{/.key}
          {@select key=._class}
          {@eq value="name"}
          <h4 class="product-item-name">
            <a href="{url}"
class="product-item-link">
              <span class="k-icon-document-{icon|s}">
</span>
              {name|s}
            </a>
          </h4>
          {/eq}
          {@eq value="thumb"}
          {?thumbnail}
          <a tabindex="-1"
class="product-item-photo" href="{url}">
							<span class="product-image-container">
								<img alt="{name|s}" src="{thumbnail}"
class="product-image-photo">
							</span>
          </a>
          {/thumbnail}
          {/eq}
          {@eq value="desc"}
          {desc|s}
          {/eq}
          {@none}
          {.value|s}
          {/none}
          {/select}
      </div>
      {/info}
    </div>
    <div class="product-item-actions">
      <a class="btn btn-default"
href="{url}"><?php echo
JText::_('COM_JAMEGAFILTER_VIEW_DETAIL'); ?></a>
    </div>
  </div>
</div>
{/data}layouts/default/filter-list.php000064400000001761151160403730012644
0ustar00<?php
/**
 *
------------------------------------------------------------------------
 * JA Filter Plugin - Content
 *
------------------------------------------------------------------------
 * Copyright (C) 2004-2016 J.O.O.M Solutions Co., Ltd. All Rights
Reserved.
 * @license - GNU/GPL, http://www.gnu.org/licenses/gpl.html
 * Author: J.O.O.M Solutions Co., Ltd
 * Websites: http://www.joomlart.com - http://www.joomlancers.com
 * This file may not be redistributed in whole or significant part.
 *
------------------------------------------------------------------------
 */
 
defined('_JEXEC') or die;

?>
<div class="ja-filter-wrapper block filter
filter-wrapper">
	<div class="block-content filter-content">
		<div class="filter-current filter-values"></div>
		<h3 role="heading" aria-level="2"
class="block-subtitle filter-subtitle"><?php echo
JText::_('COM_JAMEGAFILTER_SHOP_BY'); ?></h3>
	  <dl class="filter-options filter-list"
id="narrow-by-list">
	  </dl>
	</div> 
</div>layouts/index.html000064400000000054151160403730010240
0ustar00<html><body
bgcolor="#FFFFFF"></body></html>script.php000064400000002371151160403730006564
0ustar00<?php
/*
 *
------------------------------------------------------------------------
 * JA Filter Plugin - Content
 *
------------------------------------------------------------------------
 * Copyright (C) 2004-2016 J.O.O.M Solutions Co., Ltd. All Rights
Reserved.
 * @license - GNU/GPL, http://www.gnu.org/licenses/gpl.html
 * Author: J.O.O.M Solutions Co., Ltd
 * Websites: http://www.joomlart.com - http://www.joomlancers.com
 * This file may not be redistributed in whole or significant part.
 *
------------------------------------------------------------------------
 */

defined('_JEXEC') or die;

class plgJamegafilterContentInstallerScript
{
	function postflight($type, $parent) 
	{
    	$db    = JFactory::getDBO();
        $query = $db->getQuery(true);
        $array = array (
            $db->quoteName('enabled').'= 1',
           
$db->quoteName('params').'='.$db->quote('{}')
        );
        $query
            ->update('#__extensions')
            ->set($array)
            ->where("type='plugin'")
            ->where("folder='jamegafilter'")
           
->where("element='".'content'."'");
            //
->where("element='".$parent->get('element')."'");
        $db->setQuery($query);
        $db->execute();
	}
}reservation.php000064400000007252151160403730007624 0ustar00<?php
/**
 *
------------------------------------------------------------------------
 * JA Filter Plugin - Reservationcat
 *
------------------------------------------------------------------------
 * Copyright (C) 2004-2016 J.O.O.M Solutions Co., Ltd. All Rights
Reserved.
 * @license - GNU/GPL, http://www.gnu.org/licenses/gpl.html
 * Author: J.O.O.M Solutions Co., Ltd
 * Websites: http://www.joomlart.com - http://www.joomlancers.com
 * This file may not be redistributed in whole or significant part.
 *
------------------------------------------------------------------------
 */

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

// Initiate class to hold plugin events
class plgJamegafilterReservation extends JPlugin {

	// Some params
	var $pluginName = 'jamegafilterreservation';

	function __construct( &$subject, $params) {
		parent::__construct($subject, $params);
	}

	function onBeforeSaveReservationItems( &$params ) {
		require_once __DIR__ . '/helper.php';
		$helper = new ReservationFilterHelper($params);
		$order =
$params['filterfields']['filter_order']['order'];
		foreach ($order as $key => $value) {
			if (!$helper->checkPublished($key)) {
				unset($order[$key]);
			}
		}

		$custom_order = $this->getCustomOrdering($helper, $order);
		$params['filterfields']['filter_order']['custom_order']
= $custom_order;
	}
	
	function onAfterSaveReservationItems($item) {
		require_once (__DIR__.'/helper.php');
		$params = $item->params;
		$helper = new ReservationFilterHelper($params);
		$objectList =
$helper->getFilterItems($params['reservationcat']);
		return $objectList;
	}
	
	function onBeforeDisplayReservationItems( $jstemplate, $filter_config,
$item )
	{
		$this->jstemplate = $jstemplate;
		$this->config = $filter_config;
		$this->item = $item;
		$input = JFactory::getApplication()->input;
		$jalayout = $input->get('jalayout', 'default');
		$path = JPluginHelper::getLayoutPath('jamegafilter',
'reservation', $jalayout);
		
		ob_start();
		include $path;
		$output = ob_get_clean();
		echo $output;
	}

	function getCustomOrdering($helper, $config ) {
		$ordering = array();
		
		foreach ($config as $key => $value) {
			if ($key === 'attr.cat.value') {
				$catid = $helper->_params->get('reservationcat', 0);

				$catid = $catid ? $catid : 1;
				$childOrder = 'rgt ASC';
				switch ($value) {
					case 'name_asc':
						$childOrder = 'title ASC';
						break;
					case 'name_desc':
						$childOrder = 'title DESC';
						break;
					case 'ordering_asc':
						$childOrder = 'rgt ASC';
						break;
					case 'ordering_desc':
						$childOrder = 'rgt DESC';
						break;
				}

				$catList = $helper->getCatList($catid, $childOrder);
				$catList = array_map(function ($id) {
					return (string) $id;
				}, $catList);
				$ordering[$key] = $catList;
				
				continue;
			}

			// if (!in_array($value, array('ordering_asc',
'ordering_desc'))) {
				// continue;
			// }

			// preg_match('/ct(\d+)/', $key, $matches);
			// if (!count($matches)) {
				// continue;
			// }

			// $id = +$matches[1];

			// $db = JFactory::getDbo();
			// $query = "SELECT `fieldparams` 
					// FROM `#__fields` 
					// WHERE id = $id
					// AND state = 1";
			// $row = $db->setQuery($query)->loadResult();
			
			// $params = new JRegistry($row);
			// $options = (array) $params->get('options');

			// $fieldOrder = array();
			// foreach ($options as $opt) {
				// $fieldOrder[] = $opt->value;
			// }

			// if ($value === 'ordering_desc') {
				// $fieldOrder = array_reverse($fieldOrder);
			// }

			// $ordering[$key] = $fieldOrder;
		}

		return $ordering;
	}
}