Your IP : 216.73.216.50


Current Path : /proc/1908984/root/proc/1908984/root/home/digilove/www/41423/
Upload File :
Current File : //proc/1908984/root/proc/1908984/root/home/digilove/www/41423/category.tar

tmpl/default.php000064400000015453152344535170007676 0ustar00<?php
/**
 *
 * Show the products in a category
 *
 * @package    VirtueMart
 * @subpackage
 * @author RolandD
 * @author Max Milbers
 * @todo add pagination
 * @link https://virtuemart.net
 * @copyright Copyright (c) 2004 - 2010 VirtueMart Team. All rights reserved.
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
 * VirtueMart is free software. This version may have been modified pursuant
 * to the GNU General Public License, and as distributed it includes or
 * is derivative of works licensed under the GNU General Public License or
 * other free or open source software licenses.
 * @version $Id: default.php 10682 2022-06-28 13:23:55Z Milbo $
 */

defined ('_JEXEC') or die('Restricted access');

if (vRequest::getInt('dynamic',false) and vRequest::getInt('virtuemart_product_id',false)) {
	if (!empty($this->products)) {
		if($this->fallback){
			$p = $this->products;
			$this->products = array();
			$this->products[0] = $p;
			vmdebug('Refallback');
		}

		echo shopFunctionsF::renderVmSubLayout($this->productsLayout,array('products'=>$this->products,'currency'=>$this->currency,'products_per_row'=>$this->perRow,'showRating'=>$this->showRating));

	}

	return ;
}
?> <div class="category-view"> <?php
$js = "
jQuery(document).ready(function ($) {
	$('.orderlistcontainer').hover(
		function() { $(this).find('.orderlist').stop().show()},
		function() { $(this).find('.orderlist').stop().hide()}
	)
});
";
vmJsApi::addJScript('vm-hover',$js);

if ($this->show_store_desc and !empty($this->vendor->vendor_store_desc)) { ?>
	<div class="vendor-store-desc">
		<?php echo $this->vendor->vendor_store_desc; ?>
	</div>
<?php }

if (!empty($this->showcategory_desc) and empty($this->keyword)){
	if(!empty($this->category)) {
	?>
<div class="category_description">
	<?php echo $this->category->category_description; ?>
</div>
<?php }
	if(!empty($this->manu_descr)) {
		?>
        <div class="manufacturer-description">
			<?php echo $this->manu_descr; ?>
        </div>
	<?php }
}

// Show child categories
if ($this->showcategory and empty($this->keyword)) {
	if (!empty($this->category->has_children)) {
		echo ShopFunctionsF::renderVmSubLayout('categories',array('categories'=>$this->category->children, 'categories_per_row'=>$this->categories_per_row));
	}
}

if (!empty($this->products) or ($this->showsearch or $this->keyword !== false)) {
?>
<div class="browse-view">
<?php

if ($this->showsearch or $this->keyword !== false) {
	//id taken in the view.html.php could be modified
	$category_id  = vRequest::getInt ('virtuemart_category_id', 0); ?>

	<!--BEGIN Search Box -->
	<div class="virtuemart_search">
		<form action="<?php echo JRoute::_ ('index.php?option=com_virtuemart&view=category&limitstart=0', FALSE); ?>" method="get">
			<?php if(!empty($this->searchCustomList)) { ?>
			<div class="vm-search-custom-list">
				<?php echo $this->searchCustomList ?>
			</div>
			<?php } ?>

			<?php if(!empty($this->searchCustomValuesAr)) { ?>
			<div class="vm-search-custom-values">
				<?php
                echo ShopFunctionsF::renderVmSubLayoutAsGrid(
                    'searchcustomvalues',
                    array (
                        'searchcustomvalues' => $this->searchCustomValuesAr,
                        'options' => array (
                            'items_per_row' => array (
                                'xs' => 2,
                                'sm' => 2,
                                'md' => 2,
                                'lg' => 2,
                                'xl' => 2,
                            ),
                        ),
                    )
                );
                ?>
			</div>
                <?php if(count($this->searchCustomValuesAr)>1){
                    ?>
                    <div><?php echo vmText::_('COM_VM_COMBINETAGS');
						echo VmHtml::checkbox ('combineTags', $this->combineTags, 1, 0, '', 'combineTags'); ?></div>
                <?php }

			 } ?>
			<div class="vm-search-custom-search-input">
				<input name="keyword" class="inputbox" type="text" size="40" value="<?php echo $this->keyword ?>"/>
				<input type="submit" value="<?php echo vmText::_ ('COM_VIRTUEMART_SEARCH') ?>" class="button" onclick="this.form.keyword.focus();"/>
				<?php //echo VmHtml::checkbox ('searchAllCats', (int)$this->searchAllCats, 1, 0, 'class="changeSendForm"'); ?>
				<span class="vm-search-descr"> <?php echo vmText::_('COM_VM_SEARCH_DESC') ?></span>
			</div>

			<!-- input type="hidden" name="showsearch" value="true"/ -->
			<input type="hidden" name="view" value="category"/>
			<input type="hidden" name="option" value="com_virtuemart"/>
			<input type="hidden" name="virtuemart_category_id" value="<?php echo $category_id; ?>"/>
			<input type="hidden" name="Itemid" value="<?php echo $this->Itemid; ?>"/>
		</form>
	</div>
	<!-- End Search Box -->
<?php
	/*if($this->keyword !== false){
		?><h3><?php echo vmText::sprintf('COM_VM_SEARCH_KEYWORD_FOR', $this->keyword); ?></h3><?php
	}*/
	$j = 'jQuery(document).ready(function($) {
$(".changeSendForm")
	.off("change",Virtuemart.sendCurrForm)
    .on("change",Virtuemart.sendCurrForm);
})';
	vmJsApi::addJScript('sendFormChange',$j);
} ?>

<?php // Show child categories

if(!empty($this->orderByList)) { ?>
<div class="orderby-displaynumber">
	<div class="floatleft vm-order-list">
		<?php echo $this->orderByList['orderby']; ?>
		<?php echo $this->orderByList['manufacturer']; ?>
	</div>
	<div class="vm-pagination vm-pagination-top">
		<?php echo $this->vmPagination->getPagesLinks (); ?>
		<span class="vm-page-counter"><?php echo $this->vmPagination->getPagesCounter (); ?></span>
	</div>
	<div class="floatright display-number"><?php echo $this->vmPagination->getResultsCounter ();?><br/><?php echo $this->vmPagination->getLimitBox ($this->category->limit_list_step); ?></div>

	<div class="clear"></div>
</div> <!-- end of orderby-displaynumber -->
<?php } ?>

<?php if (!empty($this->category->category_name)) { ?>
<h1><?php echo vmText::_($this->category->category_name); ?></h1>
<?php } ?>

	<?php
	if (!empty($this->products)) {
		//revert of the fallback in the view.html.php, will be removed vm3.2
		if($this->fallback){
			$p = $this->products;
			$this->products = array();
			$this->products[0] = $p;
			vmdebug('Refallback');
		}

	echo shopFunctionsF::renderVmSubLayout($this->productsLayout,array('products'=>$this->products,'currency'=>$this->currency,'products_per_row'=>$this->perRow,'showRating'=>$this->showRating));

	if(!empty($this->orderByList)) { ?>
		<div class="vm-pagination vm-pagination-bottom"><?php echo $this->vmPagination->getPagesLinks (); ?><span class="vm-page-counter"><?php echo $this->vmPagination->getPagesCounter (); ?></span></div>
	<?php }
} elseif ($this->keyword !== false) {
	echo vmText::_ ('COM_VIRTUEMART_NO_RESULT') . ($this->keyword ? ' : (' . $this->keyword . ')' : '');
}
?>
</div>

<?php } ?>
</div>

<!-- end browse-view -->
tmpl/default.xml000064400000036166152344535170007713 0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
	<layout title="COM_VIRTUEMART_CATEGORY_VIEW_DEFAULT_TITLE">
		<message><![CDATA[COM_VIRTUEMART_CATEGORY_VIEW_DEFAULT_DESC]]></message>
	</layout>
    <fields name="request" addfieldpath="/administrator/components/com_virtuemart/fields">
        <fieldset name="request" >
            <field name="virtuemart_category_id" type="vmcategory"
                   default="0"
                   label="COM_VIRTUEMART_CATEGORY_FIELD_SELECT_TITLE" required="true"
                   extension="com_virtuemart"
                   description="COM_VIRTUEMART_CATEGORY_FIELD_SELECT_TITLE_DESC" />
            <field name="virtuemart_manufacturer_id" type="manufacturer"
                   default="0"
                   label="COM_VIRTUEMART_MANUFACTURER_FIELD_SELECT_TITLE" required="true"
                   extension="com_virtuemart"
                   description="COM_VIRTUEMART_MANUFACTURER_FIELD_SELECT_TITLE_DESC" />
            <field name="clearCart" type="radio"
                   default="0"
                   label="COM_VIRTUEMART_CLEAR_CART" required="false"
                   extension="com_virtuemart"
                   description="COM_VIRTUEMART_CLEAR_CART_DESC" >
                <option value="1">JYES</option>
                <option value="0">JNO</option>
            </field>
            <field name="limitstart" type="hidden" default="0" />
        </fieldset>
    </fields>
    <fields name="params" addfieldpath="/administrator/components/com_virtuemart/fields">
        <fieldset name="DISPLAY" >

            <field name="storefront" type="radio" default=""
                   label="COM_VIRTUEMART_CATEGORY_FIELD_SELECT_STOREFRONT"
                   extension="com_virtuemart"
                   description="COM_VIRTUEMART_CATEGORY_FIELD_SELECT_STOREFRONT_DESC" >
                <option value="1">JYES</option>
                <option value="0">JNO</option>
            </field>
            <field name="show_store_desc" type="list" default=""
                   label="COM_VIRTUEMART_ADMIN_CFG_SHOW_STORE_DESC"
                   extension="com_virtuemart"
                   description="COM_VIRTUEMART_ADMIN_CFG_SHOW_STORE_DESC_TIP" >
                <option value="">JGLOBAL_USE_GLOBAL</option>
                <option value="0">JNO</option>
                <option value="1">JYES</option>
            </field>
            <field name="categorylayout" type="vmlayout" view="category"
                   label="COM_VIRTUEMART_CATEGORY_FIELD_SELECT_LAYOUT"
                   extension="com_virtuemart"
                   description="COM_VIRTUEMART_CATEGORY_FIELD_SELECT_LAYOUT_DESC" />
            <field name="showcategory_desc" type="list" default=""
                   label="COM_VIRTUEMART_ADMIN_CFG_SHOW_CATEGORYDESC"
                   extension="com_virtuemart"
                   description="COM_VIRTUEMART_ADMIN_CFG_SHOW_CATEGORYDESC_TIP" >
                <option value="">JGLOBAL_USE_GLOBAL</option>
                <option value="0">JNO</option>
                <option value="1">JYES</option>
            </field>
            <field name="showcategory" type="list" default=""
                   label="COM_VIRTUEMART_CATEGORY_FIELD_SELECT_SHOWCAT"
                   extension="com_virtuemart"
                   description="COM_VIRTUEMART_CATEGORY_FIELD_SELECT_SHOWCAT_DESC" >
                <option value="">JGLOBAL_USE_GLOBAL</option>
                <option value="0">JNO</option>
                <option value="1">JYES</option>
            </field>
            <field name="categories_per_row" type="text"
                   label="COM_VIRTUEMART_ADMIN_CFG_CATEGORIES_PER_ROW"
                   extension="com_virtuemart"
                   description="COM_VIRTUEMART_ADMIN_CFG_PER_ROW_TIP" />
            <field name="showproducts" type="list" default=""
                   label="COM_VIRTUEMART_ADMIN_CFG_SHOW_PRODUCTS"
                   extension="com_virtuemart"
                   description="COM_VIRTUEMART_ADMIN_CFG_SHOW_PRODUCTS_TIP" >
                <option value="">JGLOBAL_USE_GLOBAL</option>
                <option value="0">JNO</option>
                <option value="1">JYES</option>
            </field>
            <field name="showsearch" type="list" default=""
                   label="COM_VM_CATEGORY_FIELD_SELECT_SHOWSEARCH"
                   extension="com_virtuemart"
                   description="COM_VM_CATEGORY_FIELD_SELECT_SHOWSEARCH_TIP" >
                <option value="">JGLOBAL_USE_GLOBAL</option>
                <option value="0">JNO</option>
                <option value="1">JYES</option>
            </field>
            <field name="productsublayout" type="vmproductsublayout"
                   label="COM_VIRTUEMART_CFG_PRODUCTS_SUBLAYOUT"
                   extension="com_virtuemart"
                   description="COM_VIRTUEMART_CFG_PRODUCTS_SUBLAYOUT_TIP" />

            <field name="products_per_row" type="text"
                   label="COM_VIRTUEMART_ADMIN_CFG_PRODUCTS_PER_ROW"
                   extension="com_virtuemart"
                   description="COM_VIRTUEMART_ADMIN_CFG_PER_ROW_TIP" />

            <field name="featured" type="list"
                   label="COM_VIRTUEMART_ADMIN_CFG_SHOW_FEATURED"
                   extension="com_virtuemart"
                   description="COM_VIRTUEMART_ADMIN_CFG_SHOW_FEATURED_TIP" >
                <option value="">JGLOBAL_USE_GLOBAL</option>
                <option value="0">JNO</option>
                <option value="1">JYES</option>
            </field>
            <field name="featured_rows" type="text"
                   label="COM_VIRTUEMART_ADMIN_CFG_FEAT_PROD_ROWS"
                   extension="com_virtuemart"
                   description="COM_VIRTUEMART_ADMIN_CFG_PER_ROW_TIP" />

            <field name="discontinued" type="list"
                   label="COM_VIRTUEMART_ADMIN_CFG_SHOW_DISCONTINUED"
                   extension="com_virtuemart"
                   description="COM_VIRTUEMART_ADMIN_CFG_SHOW_DISCONTINUED_TIP" >
                <option value="">JGLOBAL_USE_GLOBAL</option>
                <option value="0">JNO</option>
                <option value="1">JYES</option>
            </field>
            <field name="discontinued_rows" type="text"
                   label="COM_VIRTUEMART_ADMIN_CFG_DISC_PROD_ROWS"
                   extension="com_virtuemart"
                   description="COM_VIRTUEMART_ADMIN_CFG_PER_ROW_TIP" />

            <field name="latest" type="list"
                   label="COM_VIRTUEMART_ADMIN_CFG_SHOW_LATEST"
                   extension="com_virtuemart"
                   description="COM_VIRTUEMART_ADMIN_CFG_SHOW_LATEST_TIP" >
                <option value="">JGLOBAL_USE_GLOBAL</option>
                <option value="0">JNO</option>
                <option value="1">JYES</option>
            </field>
            <field name="latest_rows" type="text"
                   label="COM_VIRTUEMART_ADMIN_CFG_LAT_PROD_ROWS"
                   extension="com_virtuemart"
                   description="COM_VIRTUEMART_ADMIN_CFG_PER_ROW_TIP" />

            <field name="topten" type="list"
                   label="COM_VIRTUEMART_ADMIN_CFG_SHOW_TOPTEN"
                   extension="com_virtuemart"
                   description="COM_VIRTUEMART_ADMIN_CFG_SHOW_TOPTEN_TIP" >
                <option value="">JGLOBAL_USE_GLOBAL</option>
                <option value="0">JNO</option>
                <option value="1">JYES</option>
            </field>
            <field name="topten_rows" type="text"
                   label="COM_VIRTUEMART_ADMIN_CFG_TOPTEN_PROD_ROWS"
                   extension="com_virtuemart"
                   description="COM_VIRTUEMART_ADMIN_CFG_PER_ROW_TIP" />

            <field name="recent" type="list"
                   label="COM_VIRTUEMART_ADMIN_CFG_SHOW_RECENT"
                   extension="com_virtuemart"
                   description="COM_VIRTUEMART_ADMIN_CFG_SHOW_RECENT_TIP" >
                <option value="">JGLOBAL_USE_GLOBAL</option>
                <option value="0">JNO</option>
                <option value="1">JYES</option>
            </field>
            <field name="recent_rows" type="text"
                   label="COM_VIRTUEMART_ADMIN_CFG_REC_PROD_ROWS"
                   extension="com_virtuemart"
                   description="COM_VIRTUEMART_ADMIN_CFG_PER_ROW_TIP" />
        </fieldset>
        <fieldset name="STOREFRONT" >
            <field name="COM_VIRTUEMART_STOREFRONT_HELP" type="vmhelptext"
                   label="COM_VIRTUEMART_STOREFRONT_HELP_TITLE"
                   description="COM_VIRTUEMART_STOREFRONT_HELP_DESC" />
            <field name="stf_itemid" type="text"
                   label="COM_VIRTUEMART_CATEGORY_FIELD_SELECT_ITEMID"
                   extension="com_virtuemart"
                   description="COM_VIRTUEMART_CATEGORY_FIELD_SELECT_ITEMID_TIP" />
            <field name="stf_categorylayout" type="vmlayout" view="category"
                   label="COM_VIRTUEMART_CATEGORY_FIELD_SELECT_LAYOUT"
                   extension="com_virtuemart"
                   description="COM_VIRTUEMART_CATEGORY_FIELD_SELECT_LAYOUT_DESC" />
            <field name="stf_show_store_desc" type="list" default=""
                   label="COM_VIRTUEMART_ADMIN_CFG_SHOW_STORE_DESC"
                   extension="com_virtuemart"
                   description="COM_VIRTUEMART_ADMIN_CFG_SHOW_STORE_DESC_TIP" >
                <option value="">JGLOBAL_USE_GLOBAL</option>
                <option value="0">JNO</option>
                <option value="1">JYES</option>
            </field>
            <field name="stf_showcategory_desc" type="list"
                   label="COM_VIRTUEMART_ADMIN_CFG_SHOW_CATEGORYDESC"
                   extension="com_virtuemart"
                   description="COM_VIRTUEMART_ADMIN_CFG_SHOW_CATEGORYDESC_TIP" >
                <option value="">JGLOBAL_USE_GLOBAL</option>
                <option value="0">JNO</option>
                <option value="1">JYES</option>
            </field>
            <field name="stf_showcategory" type="list"
                   label="COM_VIRTUEMART_CATEGORY_FIELD_SELECT_SHOWCAT"
                   extension="com_virtuemart"
                   description="COM_VIRTUEMART_CATEGORY_FIELD_SELECT_SHOWCAT_DESC" >
                <option value="">JGLOBAL_USE_GLOBAL</option>
                <option value="0">JNO</option>
                <option value="1">JYES</option>
            </field>
            <field name="stf_categories_per_row" type="text"
                   label="COM_VIRTUEMART_ADMIN_CFG_CATEGORIES_PER_ROW"
                   extension="com_virtuemart"
                   description="COM_VIRTUEMART_ADMIN_CFG_PER_ROW_TIP" />
            <field name="stf_showproducts" type="list" default=""
                   label="COM_VIRTUEMART_ADMIN_CFG_SHOW_PRODUCTS"
                   extension="com_virtuemart"
                   description="COM_VIRTUEMART_ADMIN_CFG_SHOW_PRODUCTS_TIP" >
                <option value="">JGLOBAL_USE_GLOBAL</option>
                <option value="0">JNO</option>
                <option value="1">JYES</option>
            </field>
            <field name="stf_showsearch" type="list"
                   label="COM_VM_CATEGORY_FIELD_SELECT_SHOWSEARCH"
                   extension="com_virtuemart"
                   description="COM_VM_CATEGORY_FIELD_SELECT_SHOWSEARCH_TIP" >
                <option value="">JGLOBAL_USE_GLOBAL</option>
                <option value="0">JNO</option>
                <option value="1">JYES</option>
            </field>
            <field name="stf_productsublayout" type="vmproductsublayout"
                   label="COM_VIRTUEMART_CFG_PRODUCTS_SUBLAYOUT"
                   extension="com_virtuemart"
                   description="COM_VIRTUEMART_CFG_PRODUCTS_SUBLAYOUT_TIP" />
            <field name="stf_products_per_row" type="text"
                   label="COM_VIRTUEMART_ADMIN_CFG_PRODUCTS_PER_ROW"
                   extension="com_virtuemart"
                   description="COM_VIRTUEMART_ADMIN_CFG_PER_ROW_TIP" />

            <field name="stf_featured" type="list"
                   label="COM_VIRTUEMART_ADMIN_CFG_SHOW_FEATURED"
                   extension="com_virtuemart"
                   description="COM_VIRTUEMART_ADMIN_CFG_SHOW_FEATURED_TIP" >
                <option value="">JGLOBAL_USE_GLOBAL</option>
                <option value="0">JNO</option>
                <option value="1">JYES</option>
            </field>
            <field name="stf_featured_rows" type="text"
                   label="COM_VIRTUEMART_ADMIN_CFG_FEAT_PROD_ROWS"
                   extension="com_virtuemart"
                   description="COM_VIRTUEMART_ADMIN_CFG_PER_ROW_TIP" />

            <field name="stf_discontinued" type="list"
                   label="COM_VIRTUEMART_ADMIN_CFG_SHOW_DISCONTINUED"
                   extension="com_virtuemart"
                   description="COM_VIRTUEMART_ADMIN_CFG_SHOW_DISCONTINUED_TIP" >
                <option value="">JGLOBAL_USE_GLOBAL</option>
                <option value="0">JNO</option>
                <option value="1">JYES</option>
            </field>
            <field name="stf_discontinued_rows" type="text"
                   label="COM_VIRTUEMART_ADMIN_CFG_DISC_PROD_ROWS"
                   extension="com_virtuemart"
                   description="COM_VIRTUEMART_ADMIN_CFG_PER_ROW_TIP" />

            <field name="stf_latest" type="list"
                   label="COM_VIRTUEMART_ADMIN_CFG_SHOW_LATEST"
                   extension="com_virtuemart"
                   description="COM_VIRTUEMART_ADMIN_CFG_SHOW_LATEST_TIP" >
                <option value="">JGLOBAL_USE_GLOBAL</option>
                <option value="0">JNO</option>
                <option value="1">JYES</option>
            </field>
            <field name="stf_latest_rows" type="text"
                   label="COM_VIRTUEMART_ADMIN_CFG_LAT_PROD_ROWS"
                   extension="com_virtuemart"
                   description="COM_VIRTUEMART_ADMIN_CFG_PER_ROW_TIP" />

            <field name="stf_topten" type="list"
                   label="COM_VIRTUEMART_ADMIN_CFG_SHOW_TOPTEN"
                   extension="com_virtuemart"
                   description="COM_VIRTUEMART_ADMIN_CFG_SHOW_TOPTEN_TIP" >
                <option value="">JGLOBAL_USE_GLOBAL</option>
                <option value="0">JNO</option>
                <option value="1">JYES</option>
            </field>
            <field name="stf_topten_rows" type="text"
                   label="COM_VIRTUEMART_ADMIN_CFG_TOPTEN_PROD_ROWS"
                   extension="com_virtuemart"
                   description="COM_VIRTUEMART_ADMIN_CFG_PER_ROW_TIP" />

            <field name="stf_recent" type="list"
                   label="COM_VIRTUEMART_ADMIN_CFG_SHOW_RECENT"
                   extension="com_virtuemart"
                   description="COM_VIRTUEMART_ADMIN_CFG_SHOW_RECENT_TIP" >
                <option value="">JGLOBAL_USE_GLOBAL</option>
                <option value="0">JNO</option>
                <option value="1">JYES</option>
            </field>
            <field name="stf_recent_rows" type="text"
                   label="COM_VIRTUEMART_ADMIN_CFG_REC_PROD_ROWS"
                   extension="com_virtuemart"
                   description="COM_VIRTUEMART_ADMIN_CFG_PER_ROW_TIP" />
        </fieldset>
	</fields>
</metadata>

tmpl/index.html000064400000000037152344535170007526 0ustar00<!DOCTYPE html><title></title>
index.html000064400000000037152344535170006552 0ustar00<!DOCTYPE html><title></title>
view.html.php000064400000070766152344535170007223 0ustar00<?php
/**
 *
 * Handle the category view
 *
 * @package	VirtueMart
 * @subpackage
 * @author Max Milbers
* @link https://virtuemart.net
 * @copyright Copyright (c) 2004 - 2019 VirtueMart Team. All rights reserved.
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
 * VirtueMart is free software. This version may have been modified pursuant
 * to the GNU General Public License, and as distributed it includes or
 * is derivative of works licensed under the GNU General Public License or
 * other free or open source software licenses.
 * @version $Id: view.html.php 10847 2023-05-03 08:53:29Z Milbo $
 */

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

/**
 * Handle the category view
 *
 * @package VirtueMart
 * @author Max Milbers
 */
class VirtuemartViewCategory extends VmView {

	public $combineTags = true;
	public function display($tpl = null) {

		//For BC, we convert first the new config param names to the old ones
		//Attention, this will be removed around 2020.
		if(VmConfig::get('legacylayouts',false)){
			VmConfig::set('show_featured', VmConfig::get('featured'));
			VmConfig::set('show_discontinued', VmConfig::get('discontinued'));
			VmConfig::set('show_topTen', VmConfig::get('topten'));
			VmConfig::set('show_recent', VmConfig::get('recent'));
			VmConfig::set('show_latest', VmConfig::get('latest'));

			VmConfig::set('featured_products_rows', VmConfig::get('featured_rows'));
			VmConfig::set('discontinued_products_rows', VmConfig::get('discontinued_rows'));
			VmConfig::set('topTen_products_rows', VmConfig::get('topten_rows'));
			VmConfig::set('recent_products_rows', VmConfig::get('recent_rows'));
			VmConfig::set('latest_products_rows', VmConfig::get('latest_rows'));
			VmConfig::set('omitLoaded_topTen', VmConfig::get('omitLoaded_topten'));
			VmConfig::set('showCategory', VmConfig::get('showcategory'));
		}


		$this->show_prices  = (int)VmConfig::get('show_prices',1);

		$document = JFactory::getDocument();

		$this->app = JFactory::getApplication();
		$pathway = $this->app->getPathway();

		if( vmAccess::isFEmanager('product.edit') ){
			$add_product_link = JURI::root() . 'index.php?option=com_virtuemart&tmpl=component&view=product&task=edit&virtuemart_product_id=0&managing=1' ;
			$add_product_link = $this->linkIcon($add_product_link, 'COM_VIRTUEMART_PRODUCT_FORM_NEW_PRODUCT', 'edit', false, false);
		} else {
			$add_product_link = "";
		}
		$this->assignRef('add_product_link', $add_product_link);

		$menus	= $this->app->getMenu();
		$menu = $menus->getActive();

		//vmdebug('My active menu item',$menu);
		if(!empty($menu->id)){
			$itemId = $menu->id;
		} else {

			$itemId = vRequest::getInt('Itemid',false);
			if($itemId){
				$menus->setActive($itemId);
				$menu = $menus->getActive();
			}
			if(empty($menu->id)){
				$menu = $menus->getDefault();
				vmdebug('$menu = $menus->getDefault',$itemId);
			}
		}

		if(empty($menu)){
			$menu = new stdClass;
			$menuParams = new JRegistry();
		} else {
			$menuParams = $menu->getParams();
		}

		$stf_itemid = $menuParams->get('stf_itemid',false);
		if(!empty($stf_itemid) ){
			$mstf=$menus->getItem($stf_itemid);
			if(!empty($mstf)){
				$menu = $mstf;
			}
		}

		ShopFunctionsF::setLastVisitedItemId($itemId);
		$this->Itemid = $itemId;

		$this->productModel = VmModel::getModel('product');

		$this->keyword = $this->productModel->keyword;

		$this->virtuemart_manufacturer_id = vRequest::getInt('virtuemart_manufacturer_id', -1 );
		if($this->virtuemart_manufacturer_id ===-1 and isset($menu->query['virtuemart_manufacturer_id'])){
			$this->virtuemart_manufacturer_id = $menu->query['virtuemart_manufacturer_id'];
			vRequest::setVar('virtuemart_manufacturer_id',$this->virtuemart_manufacturer_id);
		}
		//vmdebug('caetgory view $this->virtuemart_manufacturer_id',$this->virtuemart_manufacturer_id,$menu->query['virtuemart_manufacturer_id'],vRequest::getInt('virtuemart_manufacturer_id', -1 ),$_REQUEST);
		$this->categoryId = vRequest::getInt('virtuemart_category_id', -1);
		if($this->categoryId === -1 and isset($menu->query['virtuemart_category_id'])){
			$this->categoryId = $menu->query['virtuemart_category_id'];
			vRequest::setVar('virtuemart_category_id',$this->categoryId);
		} else if ( $this->categoryId === -1 and $this->virtuemart_manufacturer_id === -1 and empty($this->keyword)){

			$this->categoryId = ShopFunctionsF::getLastVisitedCategoryId();
		}

		if(empty($this->categoryId) and $this->virtuemart_manufacturer_id===''){

			vmInfo(vmText::_('COM_VIRTUEMART_MANU_NOT_FOUND'));

			$this->handle404();
		}

		if ($this->categoryId === -1 and $this->virtuemart_manufacturer_id){
			$this->categoryId = 0;
		}

		$this->setCanonicalLink($tpl,$document,$this->categoryId,$this->virtuemart_manufacturer_id);


		if($this->categoryId===-1) $this->categoryId = 0;
		if($this->virtuemart_manufacturer_id===-1) $this->virtuemart_manufacturer_id = 0;

		$prefix = '';



		if(empty($this->keyword)) $this->keyword = false;

		if(		(isset($menu->query['virtuemart_category_id']) and $menu->query['virtuemart_category_id']!=$this->categoryId) or
		(isset($menu->query['virtuemart_manufacturer_id']) and $menu->query['virtuemart_manufacturer_id']!=$this->virtuemart_manufacturer_id) or
		!empty($this->keyword ) ) {
			$prefix = 'stf_';
		}

		$paramNames = array('itemid'=>'',
		'categorylayout' => VmConfig::get('categorylayout', 0),
		'show_store_desc' => VmConfig::get('show_store_desc',1),
		'showcategory_desc' => VmConfig::get('showcategory_desc', 1),
		'showcategory' => VmConfig::get('showcategory',1),
		'categories_per_row' => VmConfig::get('categories_per_row',3),
		'showproducts' => VmConfig::get('showproducts',1),
		'showsearch' => VmConfig::get('showsearch',0),
		'productsublayout' => VmConfig::get('productsublayout', 0),
		'products_per_row' => VmConfig::get('products_per_row', 3),
		'featured' => VmConfig::get('featured',1),
		'featured_rows' => VmConfig::get('featured_rows',1),
		'discontinued' => VmConfig::get('discontinued',0),
		'discontinued_rows' => VmConfig::get('discontinued_rows',1),
		'latest' => VmConfig::get('latest',1),
		'latest_rows' => VmConfig::get('latest_rows',1),
		'topten' => VmConfig::get('topten',1),
		'topten_rows' => VmConfig::get('topten_rows',1),
		'recent' => VmConfig::get('recent',0),
		'recent_rows' => VmConfig::get('recent_rows',1));

		$categoryModel = VmModel::getModel('category');

		// set search and keyword
		if ($this->productModel->keyword){
			$pathway->addItem(strip_tags(htmlspecialchars_decode($this->keyword)));
		}

		$this->category = $categoryModel->getCategory($this->categoryId, false);

		foreach($paramNames as $k => $v){
			if(!isset($this->category->{$k}) or $this->category->{$k}==''){
				$this->{$k} = $menuParams->get($prefix.$k,$v);
			} else if(isset($this->category->{$k})){
				$this->{$k} = $this->category->{$k};
			}
		}

		$this->storefront = $menuParams->get('storefront',0);

		$this->perRow = $this->products_per_row = empty($this->category->products_per_row)? $menuParams->get($prefix.'products_per_row',$paramNames['products_per_row']):$this->category->products_per_row;

		$vendorId = $this->category->virtuemart_vendor_id;
		if(empty($vendorId)) $vendorId = 1; //If we are in the root category, the id is empty

		//No redirect here, for category id = 0 means show ALL categories! note by Max Milbers
		if ((!empty($this->categoryId) and $this->categoryId!==-1 ) and (empty($this->category->slug) or !$this->category->published)) {

			$this->handle404();
		}

		$ratingModel = VmModel::getModel('ratings');
		$this->productModel->withRating = $this->showRating = $ratingModel->showRating();

		$this->vmPagination = '';
		$this->orderByList = array();

		$this->searchcustom = '';
		$this->searchCustomValues = '';	//deprecated
		$this->searchCustomValuesAr = array ();

		$app = JFactory::getApplication();


		if(!empty($this->keyword) or $this->showsearch){

			$this->getSearchCustom();
			$this->searchAllCats = $app->getUserStateFromRequest('com_virtuemart.customfields.searchAllCats','searchAllCats',false);
		}


		shopFunctionsF::setLastVisitedCategoryId($this->categoryId);
		shopFunctionsF::setLastVisitedManuId($this->virtuemart_manufacturer_id);

		//We need to load the cart here, to get correct discounts
		if(!VmConfig::get('use_as_catalog',false)) $cart = VirtuemartCart::getCart();

		$imgAmount = VmConfig::get('prodimg_browse',1);
		$dynamic = vRequest::getInt('dynamic',false);
		$id = vRequest::getInt('virtuemart_product_id',false);
		$legacy = VmConfig::get('legacylayouts',1);

		$this->products = array();

		$this->productModel->cartattribute = (int)VmConfig::get('BrowseProductCartattributeOnly',1);
		if ($dynamic and $id) {
			$p = $this->productModel->getProduct ($id);
			$this->products['products'][] = $p;
			$this->productModel->addImages($this->products['products'], $imgAmount );
			$this->orderByList = array('orderby' => '', 'manufacturer' => '');
			if($legacy) {
				$this->vmPagination = $this->productModel->getPagination($this->perRow);
			}
		} else {

			//The search must be executed first
			if(!empty($this->keyword) or !empty($this->productModel->searchcustoms)) {
				vmdebug('Lets load the search',$this->keyword,$this->productModel->searchcustoms);
				// Load the products in the given category
				$ids = $this->productModel->sortSearchListQuery (TRUE, $this->categoryId);
				VirtueMartModelProduct::$_alreadyLoadedIds = array_merge(VirtueMartModelProduct::$_alreadyLoadedIds,$ids);
				$this->vmPagination = $this->productModel->getPagination($this->perRow);
				$this->orderByList = $this->productModel->getOrderByList($this->categoryId);
				$this->products['products'] = $this->productModel->getProducts ($ids);
				$this->productModel->addImages($this->products['products'], $imgAmount );
			}

			if($legacy) {

				if($this->showproducts){
					$opt = array('products');
				} else {
					$opt = array();
				}
			} else {
				$sequence = VmConfig::get('ProductGroupsSequence','');
				if(empty($sequence)){
					$opt = array('featured', 'discontinued', 'latest', 'topten', 'recent');
				} else {
					$opt = explode(',',$sequence);
				}

				if($this->showproducts and empty($this->keyword) and empty($this->productModel->searchcustoms)){
					$opt[] = 'products';
				}
			}

			foreach( $opt as $o ) {
				$o = trim($o);
				if($o == 'products') {
					VirtueMartModelProduct::$omitLoaded = VmConfig::get('omitLoaded');
					$ids = $this->productModel->sortSearchListQuery( TRUE, $this->categoryId );
					VirtueMartModelProduct::$_alreadyLoadedIds = array_merge( VirtueMartModelProduct::$_alreadyLoadedIds, $ids );
					$this->vmPagination = $this->productModel->getPagination( $this->perRow );
					$this->orderByList = $this->productModel->getOrderByList( $this->categoryId );

					$this->products['products'] = $this->productModel->getProducts( $ids );
					$this->productModel->addImages( $this->products['products'], $imgAmount );
				} else {
					//Lets check, if we use the new Frontpages settings
					VirtueMartModelProduct::$omitLoaded = VmConfig::get( 'omitLoaded_'.$o, true );
					if(!empty( $this->{$o} ) and !empty( $this->{$o.'_rows'} )) {
						$this->products[$o] = $this->productModel->getProductListing( $o, $this->perRow*$this->{$o.'_rows'} );
						$this->productModel->addImages( $this->products[$o], $imgAmount );
					}
				}
			}

		}
		$this->productModel->cartattribute = -1;

		if ($this->products) {

			$this->currency = CurrencyDisplay::getInstance( );
			$display_stock = VmConfig::get('display_stock',1);
			$showCustoms = VmConfig::get('show_pcustoms',1);

			//Unset the empty product groups to avoid errors with old layouts
			foreach($this->products as $pType => $productSeries) {
				if($productSeries===false) unset($this->products[$pType]);
			}

			if($display_stock or $showCustoms){

				if(!$showCustoms){
					foreach($this->products as $pType => $productSeries){
						foreach($productSeries as $i => $productItem){
							$this->products[$pType][$i]->stock = $this->productModel->getStockIndicator($productItem);
						}
					}
				} else {

					foreach($this->products as $pType => $productSeries) {
						shopFunctionsF::sortLoadProductCustomsStockInd($this->products[$pType],$this->productModel);
					}
				}
			}
		}

		// Add feed links
		if ($this->products  && VmConfig::get('feed_cat_published', 0)==1) {

			$link = vmURI::getCurrentUrlBy('get').'&format=feed&limitstart=';

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

		$this->showBasePrice = (vmAccess::manager() or vmAccess::isSuperVendor());

		// Add the category name to the pathway
		if ($this->category->parents) {
			foreach ($this->category->parents as $c){
				if(!empty($c->virtuemart_category_id) and !empty($c->category_name) and !empty($c->published)){
					$pathway->addItem(strip_tags(vmText::_($c->category_name)),JRoute::_('index.php?option=com_virtuemart&view=category&virtuemart_category_id='.$c->virtuemart_category_id, FALSE));
				} else vmdebug('parent category is empty',$this->category->parents);
			}
		}
		$catImgAmount = VmConfig::get('catimg_browse',1);
		$categoryModel->addImages($this->category,$catImgAmount);

		if($this->showcategory){

			$this->category->children = $categoryModel->getChildCategoryList( $vendorId, $this->categoryId, $categoryModel->getDefaultOrdering(), $categoryModel->_selectedOrderingDir );
			$categoryModel->addImages($this->category->children,$catImgAmount);
			//$this->category->has_children = (boolean)count($this->category->children);

			//Whatever fallback
			$this->category->haschildren = $this->category->has_children;

		} else {
			$this->category->children = false;
		}

		if (VmConfig::get('enable_content_plugin', 0)) {
			shopFunctionsF::triggerContentPlugin($this->category, 'category','category_description');
		}

		if(empty($this->category->category_template)){
			$this->category->category_template = VmConfig::get('categorytemplate');
		}

		if(!empty($this->categorylayout)){
			$this->category->category_layout = $this->categorylayout;
		}

		vmJsApi::jPrice();

		$this->productsLayout = 'products'; //VmConfig::get('productsublayout','products');
		if(!empty($this->productsublayout)){
			$this->productsLayout = $this->productsublayout;
		}


		VmTemplate::setVmTemplate($this,$this->category->category_template,0,$this->category->category_layout);


		$customtitle = '';
		$metadesc = '';
		$metakey = '';
		$metarobot = '';
		$metaauthor = '';

		$metadesc = $menuParams->get('menu-meta_description');
		$metakey = $menuParams->get('menu-meta_keywords');
		$metarobot = $menuParams->get('robots');
		$customtitle = $menuParams->get('page_title');


		if(($this->storefront and empty($prefix)) or $this->show_store_desc or empty($this->categoryId)){

			$vendorModel = VmModel::getModel('vendor');
			if(!empty($this->category->virtuemart_vendor_id)){
				$vendorModel->setId($this->category->virtuemart_vendor_id);
			} else {
				$vendorModel->setId(1);;
			}
			$this->vendor = $vendorModel->getVendor();
		}

		$this->manu_descr = '';

		if(($this->storefront and empty($prefix)) or (empty($this->categoryId) and empty($this->virtuemart_manufacturer_id)) ){

			if(empty($this->vendor->customtitle)){
				if(empty($customtitle)) {
					$customtitle = vmText::sprintf('COM_VIRTUEMART_HOME',$this->vendor->vendor_store_name);
				}
			} else {
				$customtitle = $this->vendor->customtitle;
			}

			if(!empty($this->vendor->metadesc)) $metadesc = $this->vendor->metadesc;
			if(!empty($this->vendor->metakey)) $metakey = $this->vendor->metakey;
			if(!empty($this->vendor->metarobot)) $metarobot = $this->vendor->metarobot;
			if(!empty($this->vendor->metaauthor)) $metaauthor = $this->vendor->metaauthor;

		} else {
			if(empty($this->categoryId)){
				$metaObj = VmModel::getModel('manufacturer')->getManufacturer($this->virtuemart_manufacturer_id);
				$this->manu_descr = $metaObj->mf_desc;
			} else {
				$metaObj = $this->category;
			}

			if (!empty($metaObj->metadesc)) {
				$metadesc = $metaObj->metadesc;
			}
			if (!empty($metaObj->metakey)) {
				$metakey = $metaObj->metakey;
			}
			if (!empty($metaObj->metarobot)) {
				$metarobot = $metaObj->metarobot;
			}
			if(!empty($metaObj->customtitle)){
				$customtitle = $metaObj->customtitle;
			}

			if ($this->app->getCfg('MetaAuthor') == '1' and !empty($this->category->metaauthor)) {
				$metaauthor = $this->category->metaauthor;
			}

		}

		if(empty($metadesc)){
			$description = '';
			if(!empty($this->categoryId)){
				$description=$this->category->category_description;
				$name=$this->category->category_name;
			} else if(!empty($this->virtuemart_manufacturer_id)){
				$metaObj = VmModel::getModel('manufacturer')->getManufacturer($this->virtuemart_manufacturer_id);
				$description=$metaObj->mf_desc;
				$name=$metaObj->mf_name;
			}
			$qdesc =  strip_tags(html_entity_decode($description,ENT_QUOTES)) ;
			$qdesc = str_replace(array("\n", "\r","\t"), "", $qdesc);
			$qdesc = str_replace(array("  "), " ", $qdesc);
			$qdesc = shopFunctionsF::limitStringByWord($qdesc,120);
			$metadesc = $this->category->category_name . ". ". $qdesc . ' ' .vmText::_('COM_VIRTUEMART_READ_MORE');
		}
//		quorvia get rid of any excess data
		$metadesc = str_replace(array("\n", "\r","\t"), "", $metadesc);
		$metadesc = str_replace(array("  "), " ", $metadesc);
		$document->setMetaData('description',$metadesc);
		$document->setMetaData('keywords', $metakey);
		$document->setMetaData('robots', $metarobot);
		$document->setMetaData('author', $metaauthor);

		// Set the titles
		if (!empty($customtitle)) {
			$title = strip_tags($customtitle);
		} elseif (!empty($this->category->category_name)) {
			$title = strip_tags($this->category->category_name);
		} else {
			$title = $this->setTitleByJMenu();
		}

		$title = vmText::_($title);

		if(vRequest::getInt('error')){
			$title .=' '.vmText::_('COM_VIRTUEMART_PRODUCT_NOT_FOUND');
		}
		if($this->keyword !== false and !empty($this->keyword)){
			$title .=' ('.strip_tags(htmlspecialchars_decode($this->keyword)).')';
		}

		if ($this->virtuemart_manufacturer_id>0 and  isset($metaObj->mf_name)){

			if(VmConfig::get('addManuNameToCatBrowseTitle',true)){
				// in case of multi mf, don't take the one of the 1rst product, but the mf name is in the $metaObj
				if (isset($metaObj->mf_name)) $title .=' '.$metaObj->mf_name;
			}

			// Override Category name when viewing manufacturers products !IMPORTANT AFTER page title.
			// in case of multi mf, don't take the one of the 1rst product, but the mf name is in the $metaObj
			if (isset($metaObj->mf_name) and isset($this->category->category_name)) $this->category->category_name = $metaObj->mf_name ;

		}

		$document->setTitle( $title );
		if ($this->app->getCfg('MetaTitle') == '1') {
			$document->setMetaData('title',  $title);
		}

		//Fallback for older layouts, will be removed vm3.4
		$this->fallback=false;
		if(count($this->products)===1 and isset($this->products['products'])){
			$this->products = $this->products['products'];
			$this->fallback=true;
			vmdebug('Fallback active');
		}

		if (VmConfig::get ('jdynupdate', TRUE)) {
			vmJsApi::jDynUpdate();
		}

		if(VmConfig::get ('ajax_category', false)){
			vmJsApi::jDynUpdate('.category-view');
		}

		parent::display($tpl);
	}

	public function setTitleByJMenu(){
		$menus	= $this->app->getMenu();
		$menu = $menus->getActive();

		$title = 'VirtueMart Category View';
		if ($menu) $title = $menu->title;
		// $title = $this->params->get('page_title', '');
		// Check for empty title and add site name if param is set
		if (empty($title)) {
			$title = $this->app->getCfg('sitename');
		}
		elseif ($this->app->getCfg('sitename_pagetitles', 0) == 1) {
			$title = vmText::sprintf('JPAGETITLE', $this->app->getCfg('sitename'), $title);
		}
		elseif ($this->app->getCfg('sitename_pagetitles', 0) == 2) {
			$title = vmText::sprintf('JPAGETITLE', $title, $this->app->getCfg('sitename'));
		}
		return $title;
	}

	public function setCanonicalLink($tpl,$document,$categoryId,$manId){
		// Set Canonic link
		if (!empty($tpl)) {
			$format = $tpl;
		} else {
			$format = vRequest::getCmd('format', 'html');
		}
		if ($format == 'html') {

			// remove joomla canonical before adding it
			foreach ( $document->_links as $k => $array ) {
				if ( $array['relation'] == 'canonical' ) {
					unset($document->_links[$k]);
					break;
				}
			}

			$link = 'index.php?option=com_virtuemart&view=category';
			if($categoryId!==-1){
				$link .= '&virtuemart_category_id='.$categoryId;
			}
			if($manId!==-1 and !empty($manId)){
				$link .= '&virtuemart_manufacturer_id='.$manId;
			}
			//vmdebug('caetgory view setCanonicalLink',$link);
			$document->addHeadLink( JUri::getInstance()->toString(array('scheme', 'host', 'port')).JRoute::_($link, FALSE) , 'canonical', 'rel', '' );

		}
	}

	/*
	 * generate custom fields list to display as search in FE
	 */
	public function getSearchCustom() {

		$emptyOption  = array('virtuemart_custom_id' =>'', 'custom_title' => vmText::_('COM_VIRTUEMART_LIST_EMPTY_OPTION'));
		$this->custom_parent_id = vRequest::getInt('custom_parent_id', 0);
		$this->searchCustomList = '';

		$db =JFactory::getDBO();

		$q1= 'SELECT c.* FROM #__virtuemart_customs  as c ';
		if(!empty($this->categoryId)){
			$q1 .= 'INNER JOIN #__virtuemart_product_customfields as pc on (c.virtuemart_custom_id=pc.virtuemart_custom_id)
INNER JOIN #__virtuemart_product_categories as cat ON (pc.virtuemart_product_id=cat.virtuemart_product_id)';
		}
		$q1 .= ' WHERE';
		if(!empty($this->categoryId)){
			$q1 .= ' virtuemart_category_id="'.$this->categoryId.'" and';
		}
		$q1 .= ' searchable="1" and (field_type="S" or field_type="P") and c.published = 1 GROUP BY c.virtuemart_custom_id';

		$db->setQuery($q1);
		$this->selected = $db->loadObjectList();

//		if((int)VmConfig::get('debug_Sql',0))vmdebug('getSearchCustom '.str_replace('#__',$db->getPrefix(),$db->getQuery()),$this->selected);//,$this->categoryId,$this->selected);
		if($this->selected) {
			$app = JFactory::getApplication();
			foreach ($this->selected as $selected) {
				$valueOptions = array();
				if($selected->field_type=="S") {

					//if($selected->is_list) {
						//if($selected->is_list == "1") {
						$q2= 'SELECT pc.* FROM #__virtuemart_product_customfields  as pc ';
						$q2 .= 'INNER JOIN #__virtuemart_products as p on (pc.virtuemart_product_id=p.virtuemart_product_id)';
						if(!empty($this->categoryId)){
							$q2 .= 'INNER JOIN #__virtuemart_product_categories as cat on (pc.virtuemart_product_id=cat.virtuemart_product_id)';
						}
						$q2 .= ' WHERE virtuemart_custom_id="'.$selected->virtuemart_custom_id.'" and p.published="1" ';
						if(!empty($this->categoryId)){
							$q2 .= ' and virtuemart_category_id="'.$this->categoryId.'" ';
						}
						$q2 .= ' GROUP BY `customfield_value`';

						/*$q2 = 'SELECT * FROM `#__virtuemart_product_customfields` WHERE virtuemart_custom_id="'.$selected->virtuemart_custom_id.'" ';
						if(!empty($this->categoryId)){
							$q1 .= ' virtuemart_category_id="'.$this->categoryId.'" and';
						}
						$q2 = 'GROUP BY `customfield_value` ';*/
						$db->setQuery( $q2 );
						$Opts = $db->loadObjectList();
						//if((int)VmConfig::get('debug_Sql',0))vmdebug('getSearchCustom my  q2 '.str_replace('#__',$db->getPrefix(),$db->getQuery()),$Opts);//,$this->categoryId,$this->selected);

						if($Opts){
							foreach( $Opts as $k => $v ) {
								if(empty($v->customfield_value)){
									//vmdebug('getSearchCustom empty value for ',$k,$v);
									continue;
								}
								if(!isset($valueOptions[$v->customfield_value])) {
									$valueOptions[$v->customfield_value] = vmText::_($v->customfield_value);
								}
							}
							$valueOptions = array_merge(array($emptyOption), $valueOptions);

							$v = '';
							if(!empty($this->productModel->searchcustoms) and !empty($this->productModel->searchcustoms[$selected->virtuemart_custom_id])){
								$v = $this->productModel->searchcustoms[$selected->virtuemart_custom_id];
							}
							//$v = $app->getUserStateFromRequest ('com_virtuemart.customfields.'.$selected->virtuemart_custom_id, 'customfields['.$selected->virtuemart_custom_id.']', '', 'string');

							//deprecated $this->searchCustomValues
							$this->searchCustomValues .= '<div class="vm-search-custom-values-group"><div class="vm-custom-title-select">' .  vmText::_( $selected->custom_title ).'</div>'.JHtml::_( 'select.genericlist', $valueOptions, 'customfields['.$selected->virtuemart_custom_id.']', 'class="inputbox vm-chzn-select changeSendForm"', 'virtuemart_custom_id', 'custom_title', $v ) . '</div>';

							// Custom Search Values
							$selected->value_options    = $valueOptions;
							$selected->v                = $v;
							$this->searchCustomValuesAr[] = $selected;

						}

						//vmdebug('getSearchCustom '.$q2,$Opts,$valueOptions);
						/*} else if($selected->is_list == "2" and !empty($selected->custom_value)) {
							$valueOptions = array();
							$Opts = explode( ';', $selected->custom_value );
							foreach( $Opts as $k => $v ) {
								$valueOptions[$v] = $v;
							}
						}*/

				} else if($selected->field_type=="P"){
					//deprecated $this->searchCustomValues
					$v = vRequest::getString('customfields['.$selected->virtuemart_custom_id.']');
					$n = 'customfields['.$selected->virtuemart_custom_id.']';
					$this->searchCustomValues .= vmText::_( $selected->custom_title ).' <input name="'.$n.'" class="inputbox vm-chzn-select" type="text" size="20" value="'.$v.'"/>';

					$this->searchCustomValuesAr[] = $selected;
				} else {
				//Atm not written for other field types
				/*	$db->setQuery('SELECT `customfield_value` as virtuemart_custom_id,`custom_value` as custom_title FROM `#__virtuemart_product_customfields` WHERE virtuemart_custom_id='.$selected->virtuemart_custom_id);
					$valueOptions= $db->loadAssocList();

					$valueOptions = array_merge(array($emptyOption), $valueOptions);
					$this->searchCustomValues .= '<div class="vm-search-custom-values-group"><div class="vm-search-title">'. vmText::_($selected->custom_title).'</div> '.JHtml::_('select.genericlist', $valueOptions, 'customfields['.$selected->virtuemart_custom_id.']', 'class="inputbox vm-chzn-select"', 'virtuemart_custom_id', 'custom_title', 0) . '</div>';*/

				}
			}

			$this->combineTags = $app->getUserStateFromRequest('combineTags','combineTags', true,'int');
		}

		if(VmConfig::get('useCustomSearchTrigger',false)){
			// add search for declared plugins
			vDispatcher::importVMPlugins('vmcustom');
			$plgDisplay = vDispatcher::trigger('plgVmSelectSearchableCustom',array( &$this->options,&$this->searchCustomValuesAr,$this->custom_parent_id ) );
		}
		//vmTime('getSearchCustom after trigger','getSearchCustom');
		vmJsApi::chosenDropDowns();
	}

	public function handle404($cat = false){


		if ((int)VmConfig::get('handle_404',1)) {

			header($_SERVER["SERVER_PROTOCOL"]." 404 Not Found");
			$redirect=false;
			if((int)VmConfig::get('redirect_404',false)){
				$jLangTag = vmText::$language->getTag();
				$db = JFactory::getDbo();
				$q = 'SELECT `id` FROM `#__menu` WHERE `home`="1" and (language="*" or language = "'.$jLangTag.'" ) ORDER BY `language` DESC';
				$db->setQuery($q);
				$this->Itemid = $db->loadResult();
				$this->app->redirect( JRoute::_('index.php?Itemid=' . $this->Itemid . '&error=404', FALSE) );
			} else {
				//Fallback
				$catLink = '';
				if ($cat and !empty($cat->category_parent_id) and $this->categoryId != $cat->category_parent_id) {
					$catLink = '&view=category&virtuemart_category_id=' .$cat->category_parent_id;
				} else {
					$last_category_id = shopFunctionsF::getLastVisitedCategoryId();
					if (!$last_category_id or $this->categoryId == $last_category_id) {
						$last_category_id = vRequest::getInt('virtuemart_category_id', false);
					}
					/*if ($last_category_id and $this->categoryId != $last_category_id) {
						$catLink = '&view=category&virtuemart_category_id=' . $last_category_id;
					}*/
				}
				$cat = VmModel::getModel('category')->getCategory($last_category_id, false, true);
				if(empty($cat->virtuemart_category_id) or !$cat->published){
					$last_category_id = 0;
				}
				vRequest::setVar('virtuemart_category_id', $last_category_id);
				vRequest::setVar('virtuemart_manufacturer_id', 0);

				if(!$cat or empty($cat->slug)){
					vmInfo(vmText::_('COM_VIRTUEMART_CAT_NOT_FOUND'));
				} else {
					if($cat->virtuemart_category_id>0 and !$cat->published){
						vmInfo('COM_VIRTUEMART_CAT_NOT_PUBL',$cat->category_name,$this->categoryId);
					}
				}
				$this->display();
			}
		} else {
			throw new RuntimeException('VirtueMart category not found.', 404);
		}

		return;
	}
}


//no closing tag
tmpl/default_children.php000064400000003372152345553230011541 0ustar00<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_contact
 *
 * @copyright   (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;
$class = ' class="first"';
if ($this->maxLevel != 0 && count($this->children[$this->category->id]) > 0) :
?>
<ul class="list-striped list-condensed">
<?php foreach ($this->children[$this->category->id] as $id => $child) : ?>
	<?php
	if ($this->params->get('show_empty_categories') || $child->numitems || count($child->getChildren())) :
		if (!isset($this->children[$this->category->id][$id + 1]))
		{
			$class = ' class="last"';
		}
	?>
	<li<?php echo $class; ?>>
		<?php $class = ''; ?>
			<h4 class="item-title">
				<a href="<?php echo JRoute::_(ContactHelperRoute::getCategoryRoute($child->id)); ?>">
				<?php echo $this->escape($child->title); ?>
				</a>

				<?php if ($this->params->get('show_cat_items') == 1) : ?>
					<span class="badge badge-info pull-right" title="<?php echo JText::_('COM_CONTACT_CAT_NUM'); ?>"><?php echo $child->numitems; ?></span>
				<?php endif; ?>
			</h4>

			<?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_contact.category'); ?>
					</div>
				<?php endif; ?>
			<?php endif; ?>

			<?php if (count($child->getChildren()) > 0 ) :
				$this->children[$child->id] = $child->getChildren();
				$this->category = $child;
				$this->maxLevel--;
				echo $this->loadTemplate('children');
				$this->category = $child->getParent();
				$this->maxLevel++;
			endif; ?>
	</li>
	<?php endif; ?>
<?php endforeach; ?>
</ul>
<?php endif; ?>
tmpl/default_items.php000064400000012672152345553230011075 0ustar00<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_contact
 *
 * @copyright   (C) 2006 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

JHtml::_('behavior.core');

?>
<form action="<?php echo htmlspecialchars(JUri::getInstance()->toString()); ?>" method="post" name="adminForm" id="adminForm">
	<?php if ($this->params->get('filter_field') || $this->params->get('show_pagination_limit')) : ?>
		<fieldset class="filters btn-toolbar">
			<?php if ($this->params->get('filter_field')) : ?>
				<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_CONTACT_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_CONTACT_FILTER_SEARCH_DESC'); ?>"
						placeholder="<?php echo JText::_('COM_CONTACT_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; ?>
	<?php if (empty($this->items)) : ?>
		<p>
			<?php echo JText::_('COM_CONTACT_NO_CONTACTS'); ?>
		</p>
	<?php else : ?>
		<ul class="category row-striped">
			<?php foreach ($this->items as $i => $item) : ?>
				<?php if (in_array($item->access, $this->user->getAuthorisedViewLevels())) : ?>
					<?php if ($this->items[$i]->published == 0) : ?>
						<li class="row-fluid system-unpublished cat-list-row<?php echo $i % 2; ?>">
					<?php else : ?>
						<li class="row-fluid cat-list-row<?php echo $i % 2; ?>" >
					<?php endif; ?>
					<?php if ($this->params->get('show_image_heading')) : ?>
						<?php $contactWidth = 7; ?>
						<div class="span2 col-md-2">
							<?php if ($this->items[$i]->image) : ?>
								<a href="<?php echo JRoute::_(ContactHelperRoute::getContactRoute($item->slug, $item->catid)); ?>">
									<?php echo JHtml::_(
										'image',
										$this->items[$i]->image,
										JText::_('COM_CONTACT_IMAGE_DETAILS'),
										array('class' => 'contact-thumbnail img-thumbnail')
									); ?>
								</a>
							<?php endif; ?>
						</div>
					<?php else : ?>
						<?php $contactWidth = 9; ?>
					<?php endif; ?>
					<div class="list-title span<?php echo $contactWidth; ?> col-md-<?php echo $contactWidth; ?>">
						<a href="<?php echo JRoute::_(ContactHelperRoute::getContactRoute($item->slug, $item->catid)); ?>">
							<?php echo $item->name; ?>
						</a>
						<?php if ($this->items[$i]->published == 0) : ?>
							<span class="label label-warning">
								<?php echo JText::_('JUNPUBLISHED'); ?>
							</span>
						<?php endif; ?>
						<?php echo $item->event->afterDisplayTitle; ?>
						<?php echo $item->event->beforeDisplayContent; ?>
						<?php if ($this->params->get('show_position_headings')) : ?>
							<?php echo $item->con_position; ?><br />
						<?php endif; ?>
						<?php if ($this->params->get('show_email_headings')) : ?>
							<?php echo $item->email_to; ?><br />
						<?php endif; ?>
						<?php $location = array(); ?>
						<?php if ($this->params->get('show_suburb_headings') && !empty($item->suburb)) : ?>
							<?php $location[] = $item->suburb; ?>
						<?php endif; ?>
						<?php if ($this->params->get('show_state_headings') && !empty($item->state)) : ?>
							<?php $location[] = $item->state; ?>
						<?php endif; ?>
						<?php if ($this->params->get('show_country_headings') && !empty($item->country)) : ?>
							<?php $location[] = $item->country; ?>
						<?php endif; ?>
						<?php echo implode(', ', $location); ?>
					</div>
					<div class="span3 col-md-3">
						<?php if ($this->params->get('show_telephone_headings') && !empty($item->telephone)) : ?>
							<?php echo JText::sprintf('COM_CONTACT_TELEPHONE_NUMBER', $item->telephone); ?><br />
						<?php endif; ?>
						<?php if ($this->params->get('show_mobile_headings') && !empty ($item->mobile)) : ?>
							<?php echo JText::sprintf('COM_CONTACT_MOBILE_NUMBER', $item->mobile); ?><br />
						<?php endif; ?>
						<?php if ($this->params->get('show_fax_headings') && !empty($item->fax)) : ?>
							<?php echo JText::sprintf('COM_CONTACT_FAX_NUMBER', $item->fax); ?><br />
						<?php endif; ?>
					</div>
					<?php echo $item->event->afterDisplayContent; ?>
				</li>
				<?php endif; ?>
			<?php endforeach; ?>
		</ul>
	<?php endif; ?>
	<?php if ($this->params->get('show_pagination', 2)) : ?>
		<div class="pagination">
			<?php if ($this->params->def('show_pagination_results', 1)) : ?>
				<p class="counter">
					<?php echo $this->pagination->getPagesCounter(); ?>
				</p>
			<?php endif; ?>
			<?php echo $this->pagination->getPagesLinks(); ?>
		</div>
	<?php endif; ?>
	<div>
		<input type="hidden" name="filter_order" value="<?php echo $this->escape($this->state->get('list.ordering')); ?>" />
		<input type="hidden" name="filter_order_Dir" value="<?php echo $this->escape($this->state->get('list.direction')); ?>" />
	</div>
</form>
metadata.xml000064400000000221152345553230007050 0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
	<view title="Category">
		<message><![CDATA[TYPECATEGORYDESC]]></message>
	</view>
</metadata>view.feed.php000064400000012717152345553230007150 0ustar00<?php
/**
 *
 * Handle the category view
 *
 * @package    VirtueMart
 * @subpackage
 * @author Valérie Isaksen
 * @link https://virtuemart.net
 * @copyright Copyright (c) 2004 - 2013 VirtueMart Team. All rights reserved.
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
 * VirtueMart is free software. This version may have been modified pursuant
 * to the GNU General Public License, and as distributed it includes or
 * is derivative of works licensed under the GNU General Public License or
 * other free or open source software licenses.
 * @version $Id: view.html.php 6504 2012-10-05 09:40:59Z alatak $
 */

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

class VirtuemartViewCategory extends VmView {

	public function display ($tpl = NULL) {

		$doc = JFactory::getDocument ();

		$show_prices = VmConfig::get ('show_prices', 1);

		$catId = vRequest::getInt('virtuemart_category_id', 0);
		$manId = vRequest::getInt('virtuemart_manufacturer_id', 0);
		$isHome = !($catId or $manId);
		if($isHome){
			$feedtype = 'feed_home';
		} else {
			$feedtype = 'feed_cat';
		}

		$productModel = VmModel::getModel ('product');
		$categoryId = vRequest::getInt ('virtuemart_category_id', false);
		$feed_show_prices = VmConfig::get ($feedtype .'_show_prices', 0);
		$feed_show_images = VmConfig::get ($feedtype .'_show_images', 0);
		$feed_show_description = VmConfig::get ($feedtype .'_show_description', 0);
		$feed_description_type = VmConfig::get ($feedtype .'_description_type', 'product_s_desc');
		$feed_max_text_length = VmConfig::get ($feedtype .'_max_text_length', 0);

		// Load the products in the given category
		$products = $productModel->getProductsInCategory ($categoryId);

		if($isHome){

			$featured = array();
			$latest = array();
			$topten = array();

			if (VmConfig::get ('feed_featured_published', 1)) {
				$featured_nb = VmConfig::get('feed_featured_nb',3);
				$featured = $productModel->getProductListing ('featured', $featured_nb);
			}

			if (VmConfig::get ('feed_latest_published', 1)) {
				$latest_nb = VmConfig::get('feed_latest_nb',3);
				$latest = $productModel->getProductListing ('latest', $latest_nb);
			}

			if ( VmConfig::get ('feed_topten_published', 1)) {
				$topTen_nb = VmConfig::get('feed_topten_nb',3);
				$topten = $productModel->getProductListing ('topten',$topTen_nb);
			}

			$products = array_merge ($products, $featured, $latest, $topten);
		}

		if ($feed_show_images == 1) {
			$productModel->addImages ($products, 1);
		}
		if ($products && $feed_show_prices == 1) {
			$currency = CurrencyDisplay::getInstance ();
		}

		foreach ($products as $product) {
			$title = $this->escape ($product->product_name);
			$title = html_entity_decode ($title, ENT_COMPAT, 'UTF-8');
			$description = "";
			if ($feed_show_images == 1) {
				$effect = " ";
				$return = true;
				$withDescr = false;
				$absUrl = true;
				$description = $product->images[0]->displayMediaThumb ('style="margin-right: 10px; margin-bottom: 10px; float: left;"', false, $effect, $return, $withDescr, $absUrl);
			}
			if ($feed_show_description == 1) {
				if ($feed_description_type == 'product_s_desc') {
					$description .= $product->product_s_desc;
				} else {
					if ($feed_max_text_length > 0) {
						$description .= shopFunctionsF::limitStringByWord ($product->product_desc, $feed_max_text_length);
					} else {
						$description .= $product->product_desc;
					}
				}
			}
			if ($feed_show_prices == 1  and  $show_prices == 1) {
				$description .= $currency->createPriceDiv ('variantModification', 'COM_VIRTUEMART_PRODUCT_VARIANT_MOD', $product->prices);
				if (round ($product->prices['basePriceWithTax'], $currency->_priceConfig['salesPrice'][1]) != $product->prices['salesPrice']) {
					$description .= '<span class="price-crossed" >' . $currency->createPriceDiv ('basePriceWithTax', 'COM_VIRTUEMART_PRODUCT_BASEPRICE_WITHTAX', $product->prices) . "</span>";
				}
				if (round ($product->prices['salesPriceWithDiscount'], $currency->_priceConfig['salesPrice'][1]) != $product->prices['salesPrice']) {
					$description .= $currency->createPriceDiv ('salesPriceWithDiscount', 'COM_VIRTUEMART_PRODUCT_SALESPRICE_WITH_DISCOUNT', $product->prices);
				}
				$description .= $currency->createPriceDiv ('salesPrice', 'COM_VIRTUEMART_PRODUCT_SALESPRICE', $product->prices);
				$description .= $currency->createPriceDiv ('priceWithoutTax', 'COM_VIRTUEMART_PRODUCT_SALESPRICE_WITHOUT_TAX', $product->prices);
				$description .= $currency->createPriceDiv ('discountAmount', 'COM_VIRTUEMART_PRODUCT_DISCOUNT_AMOUNT', $product->prices);
				$description .= $currency->createPriceDiv ('taxAmount', 'COM_VIRTUEMART_PRODUCT_TAX_AMOUNT', $product->prices);
				$unitPriceDescription = vmText::sprintf ('COM_VIRTUEMART_PRODUCT_UNITPRICE', $product->product_unit);
				$description .= $currency->createPriceDiv ('unitPrice', $unitPriceDescription, $product->prices);

			}
			if ($feed_description_type == 'product_s_desc'  OR $feed_max_text_length > 0) {
				$description .= '<p class="feed-readmore"><a target="_blank" href ="' .JRoute::_($product->link). '">' . vmText::_ ('COM_VIRTUEMART_FEED_READMORE') . '</a></p>';
			}
			$item = new JFeedItem();
			$item->title = $title;
			$item->link = JRoute::_($product->link);
			$item->date = $product->created_on;
			$item->description = '<div class="feed-description">' . $description . '</div>';
			$item->category = $categoryId;
			$doc->addItem ($item);

		}
	}

	public function isVirtuemartHome(){


	}
}tmpl/blog.php000064400000013331152353357140007165 0ustar00<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_content
 *
 * @copyright   (C) 2006 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

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

JHtml::_('behavior.caption');

$dispatcher = JEventDispatcher::getInstance();

$this->category->text = $this->category->description;
$dispatcher->trigger('onContentPrepare', array($this->category->extension . '.categories', &$this->category, &$this->params, 0));
$this->category->description = $this->category->text;

$results = $dispatcher->trigger('onContentAfterTitle', array($this->category->extension . '.categories', &$this->category, &$this->params, 0));
$afterDisplayTitle = trim(implode("\n", $results));

$results = $dispatcher->trigger('onContentBeforeDisplay', array($this->category->extension . '.categories', &$this->category, &$this->params, 0));
$beforeDisplayContent = trim(implode("\n", $results));

$results = $dispatcher->trigger('onContentAfterDisplay', array($this->category->extension . '.categories', &$this->category, &$this->params, 0));
$afterDisplayContent = trim(implode("\n", $results));

?>
<div class="blog<?php echo $this->pageclass_sfx; ?>" itemscope itemtype="https://schema.org/Blog">
	<?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('show_category_title', 1) or $this->params->get('page_subheading')) : ?>
		<h2> <?php echo $this->escape($this->params->get('page_subheading')); ?>
			<?php if ($this->params->get('show_category_title')) : ?>
				<span class="subheading-category"><?php echo $this->category->title; ?></span>
			<?php endif; ?>
		</h2>
	<?php endif; ?>
	<?php echo $afterDisplayTitle; ?>

	<?php if ($this->params->get('show_cat_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 ($beforeDisplayContent || $afterDisplayContent || $this->params->get('show_description', 1) || $this->params->def('show_description_image', 1)) : ?>
		<div class="category-desc clearfix">
			<?php if ($this->params->get('show_description_image') && $this->category->getParams()->get('image')) : ?>
				<img src="<?php echo $this->category->getParams()->get('image'); ?>" alt="<?php echo htmlspecialchars($this->category->getParams()->get('image_alt'), ENT_COMPAT, 'UTF-8'); ?>"/>
			<?php endif; ?>
			<?php echo $beforeDisplayContent; ?>
			<?php if ($this->params->get('show_description') && $this->category->description) : ?>
				<?php echo JHtml::_('content.prepare', $this->category->description, '', 'com_content.category'); ?>
			<?php endif; ?>
			<?php echo $afterDisplayContent; ?>
		</div>
	<?php endif; ?>

	<?php if (empty($this->lead_items) && empty($this->link_items) && empty($this->intro_items)) : ?>
		<?php if ($this->params->get('show_no_articles', 1)) : ?>
			<p><?php echo JText::_('COM_CONTENT_NO_ARTICLES'); ?></p>
		<?php endif; ?>
	<?php endif; ?>

	<?php $leadingcount = 0; ?>
	<?php if (!empty($this->lead_items)) : ?>
		<div class="items-leading clearfix">
			<?php foreach ($this->lead_items as &$item) : ?>
				<div class="leading-<?php echo $leadingcount; ?><?php echo $item->state == 0 ? ' system-unpublished' : null; ?>"
					itemprop="blogPost" itemscope itemtype="https://schema.org/BlogPosting">
					<?php
					$this->item = &$item;
					echo $this->loadTemplate('item');
					?>
				</div>
				<?php $leadingcount++; ?>
			<?php endforeach; ?>
		</div><!-- end items-leading -->
	<?php endif; ?>

	<?php
	$introcount = count($this->intro_items);
	$counter = 0;
	?>

	<?php if (!empty($this->intro_items)) : ?>
		<?php foreach ($this->intro_items as $key => &$item) : ?>
			<?php $rowcount = ((int) $key % (int) $this->columns) + 1; ?>
			<?php if ($rowcount === 1) : ?>
				<?php $row = $counter / $this->columns; ?>
				<div class="items-row cols-<?php echo (int) $this->columns; ?> <?php echo 'row-' . $row; ?> row-fluid clearfix">
			<?php endif; ?>
			<div class="span<?php echo round(12 / $this->columns); ?>">
				<div class="item column-<?php echo $rowcount; ?><?php echo $item->state == 0 ? ' system-unpublished' : null; ?>"
					itemprop="blogPost" itemscope itemtype="https://schema.org/BlogPosting">
					<?php
					$this->item = &$item;
					echo $this->loadTemplate('item');
					?>
				</div>
				<!-- end item -->
				<?php $counter++; ?>
			</div><!-- end span -->
			<?php if (($rowcount == $this->columns) or ($counter == $introcount)) : ?>
				</div><!-- end row -->
			<?php endif; ?>
		<?php endforeach; ?>
	<?php endif; ?>

	<?php if (!empty($this->link_items)) : ?>
		<div class="items-more">
			<?php echo $this->loadTemplate('links'); ?>
		</div>
	<?php endif; ?>

	<?php if ($this->maxLevel != 0 && !empty($this->children[$this->category->id])) : ?>
		<div class="cat-children">
			<?php if ($this->params->get('show_category_heading_title_text', 1) == 1) : ?>
				<h3> <?php echo JText::_('JGLOBAL_SUBCATEGORIES'); ?> </h3>
			<?php endif; ?>
			<?php echo $this->loadTemplate('children'); ?> </div>
	<?php endif; ?>
	<?php if (($this->params->def('show_pagination', 1) == 1 || ($this->params->get('show_pagination') == 2)) && ($this->pagination->get('pages.total') > 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; ?>
</div>
tmpl/blog.xml000064400000045715152353357140007211 0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
	<layout title="COM_CONTENT_CATEGORY_VIEW_BLOG_TITLE" option="COM_CONTENT_CATEGORY_VIEW_BLOG_OPTION">
		<help key = "JHELP_MENUS_MENU_ITEM_ARTICLE_CATEGORY_BLOG" />
		<message>
			<![CDATA[COM_CONTENT_CATEGORY_VIEW_BLOG_DESC]]>
		</message>
	</layout>

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

			<field
				name="filter_tag"
				type="tag"
				label="JTAG"
				description="JTAG_FIELD_SELECT_DESC"
				multiple="true"
				mode="nested"
			/>
		</fieldset>
	</fields>

	<!-- Add fields to the parameters object for the layout. -->
	<fields name="params">
		<fieldset name="basic" label="JGLOBAL_CATEGORY_OPTIONS">
				<field
					name="layout_type"
					type="hidden"
					default="blog"
				/>

				<field
					name="show_category_heading_title_text"
					type="list"
	 				label="JGLOBAL_SHOW_CATEGORY_HEADING_TITLE_TEXT_LABEL"
					description="JGLOBAL_SHOW_CATEGORY_HEADING_TITLE_TEXT_DESC"
					useglobal="true"
					class="chzn-color"
					>
					<option value="0">JHIDE</option>
					<option value="1">JSHOW</option>
				</field>

				<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_MAXLEVEL_LABEL"
					description="JGLOBAL_MAXLEVEL_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_CONTENT_SHOW_EMPTY_CATEGORIES_DESC"
					useglobal="true"
					class="chzn-color"
					>
					<option value="0">JHIDE</option>
					<option value="1">JSHOW</option>
				</field>

				<field
					name="show_no_articles"
					type="list"
					label="COM_CONTENT_NO_ARTICLES_LABEL"
					description="COM_CONTENT_NO_ARTICLES_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_num_articles"
					type="list"
					label="COM_CONTENT_NUMBER_CATEGORY_ITEMS_LABEL"
					description="COM_CONTENT_NUMBER_CATEGORY_ITEMS_DESC"
					useglobal="true"
					class="chzn-color"
					>
					<option value="0">JHIDE</option>
					<option value="1">JSHOW</option>
				</field>

				<field
					name="show_cat_tags"
					type="list"
					label="COM_CONTENT_FIELD_SHOW_CAT_TAGS_LABEL"
					description="COM_CONTENT_FIELD_SHOW_CAT_TAGS_DESC"
					useglobal="true"
					class="chzn-color"
					>
					<option value="0">JHIDE</option>
					<option value="1">JSHOW</option>
				</field>

				<field
					name="page_subheading"
					type="text"
					label="JGLOBAL_SUBHEADING_LABEL"
					description="JGLOBAL_SUBHEADING_DESC"
					size="20"
				/>
		</fieldset>

		<fieldset name="advanced" label="JGLOBAL_BLOG_LAYOUT_OPTIONS">
				<field
					name="bloglayout"
					type="spacer"
					label="JGLOBAL_SUBSLIDER_BLOG_LAYOUT_LABEL"
					class="text"
				/>

				<field
					name="num_leading_articles"
					type="number"
					label="JGLOBAL_NUM_LEADING_ARTICLES_LABEL"
					description="JGLOBAL_NUM_LEADING_ARTICLES_DESC"
					useglobal="true"
					size="3"
				/>

				<field
					name="num_intro_articles"
					type="number"
					label="JGLOBAL_NUM_INTRO_ARTICLES_LABEL"
					description="JGLOBAL_NUM_INTRO_ARTICLES_DESC"
					useglobal="true"
					size="3"
				/>

				<field
					name="num_columns"
					type="number"
					label="JGLOBAL_NUM_COLUMNS_LABEL"
					description="JGLOBAL_NUM_COLUMNS_DESC"
					useglobal="true"
					size="3"
				/>

				<field
					name="num_links"
					type="number"
					label="JGLOBAL_NUM_LINKS_LABEL"
					description="JGLOBAL_NUM_LINKS_DESC"
					useglobal="true"
					size="3"
				/>

				<field
					name="multi_column_order"
					type="list"
					label="JGLOBAL_MULTI_COLUMN_ORDER_LABEL"
					description="JGLOBAL_MULTI_COLUMN_ORDER_DESC"
					useglobal="true"
					>
					<option value="0">JGLOBAL_DOWN</option>
					<option value="1">JGLOBAL_ACROSS</option>
				</field>

				<field
					name="show_subcategory_content"
					type="list"
					label="JGLOBAL_SHOW_SUBCATEGORY_CONTENT_LABEL"
					description="JGLOBAL_SHOW_SUBCATEGORY_CONTENT_DESC"
					useglobal="true"
					>
					<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>
				</field>

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

				<field
					name="orderby_pri"
					type="list"
					label="JGLOBAL_CATEGORY_ORDER_LABEL"
					description="JGLOBAL_CATEGORY_ORDER_DESC"
					useglobal="true"
					>
					<option value="none">JGLOBAL_NO_ORDER</option>
					<option value="alpha">JGLOBAL_TITLE_ALPHABETICAL</option>
					<option value="ralpha">JGLOBAL_TITLE_REVERSE_ALPHABETICAL</option>
					<option value="order">JGLOBAL_CATEGORY_MANAGER_ORDER</option>
				</field>

				<field
					name="orderby_sec"
					type="list"
					label="JGLOBAL_ARTICLE_ORDER_LABEL"
					description="JGLOBAL_ARTICLE_ORDER_DESC"
					useglobal="true"
					>
					<option value="front">COM_CONTENT_FEATURED_ORDER</option>
					<option value="rdate">JGLOBAL_MOST_RECENT_FIRST</option>
					<option value="date">JGLOBAL_OLDEST_FIRST</option>
					<option value="alpha">JGLOBAL_TITLE_ALPHABETICAL</option>
					<option value="ralpha">JGLOBAL_TITLE_REVERSE_ALPHABETICAL</option>
					<option value="author">JGLOBAL_AUTHOR_ALPHABETICAL</option>
					<option value="rauthor">JGLOBAL_AUTHOR_REVERSE_ALPHABETICAL</option>
					<option value="hits">JGLOBAL_MOST_HITS</option>
					<option value="rhits">JGLOBAL_LEAST_HITS</option>
					<option value="random">JGLOBAL_RANDOM_ORDER</option>
					<option value="order">JGLOBAL_ORDERING</option>
					<option	value="rorder">JGLOBAL_REVERSE_ORDERING</option>
					<option value="vote" requires="vote">JGLOBAL_VOTES_DESC</option>
					<option value="rvote" requires="vote">JGLOBAL_VOTES_ASC</option>
					<option value="rank" requires="vote">JGLOBAL_RATINGS_DESC</option>
					<option value="rrank" requires="vote">JGLOBAL_RATINGS_ASC</option>
				</field>

				<field
					name="order_date"
					type="list"
					label="JGLOBAL_ORDERING_DATE_LABEL"
					description="JGLOBAL_ORDERING_DATE_DESC"
					useglobal="true"
					>
					<option value="created">JGLOBAL_CREATED</option>
					<option value="modified">JGLOBAL_MODIFIED</option>
					<option value="published">JPUBLISHED</option>
					<option value="unpublished">JUNPUBLISHED</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>

				<field
					name="show_featured"
					type="list"
					default=""
					label="JGLOBAL_SHOW_FEATURED_ARTICLES_LABEL"
					description="JGLOBAL_SHOW_FEATURED_ARTICLES_DESC"
					useglobal="true"
					class="chzn-color"
					>
					<option value="show">JSHOW</option>
					<option value="hide">JHIDE</option>
					<option value="only">JONLY</option>
				</field>
		</fieldset>

		<fieldset name="article" label="COM_CONTENT_ATTRIBS_FIELDSET_LABEL">

			<field
				name="article_layout" type="componentlayout"
				label="JGLOBAL_FIELD_LAYOUT_LABEL"
				description="JGLOBAL_FIELD_LAYOUT_DESC"
				menuitems="true"
				extension="com_content"
				view="article"
			/>

			<field
				name="show_title"
				type="list"
				label="JGLOBAL_SHOW_TITLE_LABEL"
				description="JGLOBAL_SHOW_TITLE_DESC"
				useglobal="true"
				class="chzn-color"
				>
				<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>

			<field
				name="link_titles"
				type="list"
				label="JGLOBAL_LINKED_TITLES_LABEL"
				description="JGLOBAL_LINKED_TITLES_DESC"
				useglobal="true"
				class="chzn-color"
				>
				<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
				<option value="0">JNO</option>
				<option value="1">JYES</option>
			</field>

			<field
				name="show_intro"
				type="list"
				label="JGLOBAL_SHOW_INTRO_LABEL"
				description="JGLOBAL_SHOW_INTRO_DESC"
				useglobal="true"
				class="chzn-color"
				>
				<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>

			<field
				name="info_block_position"
				type="list"
				label="COM_CONTENT_FIELD_INFOBLOCK_POSITION_LABEL"
				description="COM_CONTENT_FIELD_INFOBLOCK_POSITION_DESC"
				default=""
				useglobal="true"
				class="chzn-color"
				>
				<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
				<option value="0">COM_CONTENT_FIELD_OPTION_ABOVE</option>
				<option value="1">COM_CONTENT_FIELD_OPTION_BELOW</option>
				<option value="2">COM_CONTENT_FIELD_OPTION_SPLIT</option>
			</field>

			<field
				name="info_block_show_title"
				type="list"
				label="COM_CONTENT_FIELD_INFOBLOCK_TITLE_LABEL"
				description="COM_CONTENT_FIELD_INFOBLOCK_TITLE_DESC"
				useglobal="true"
				class="chzn-color"
				>
				<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
				<option	value="0">JHIDE</option>
				<option	value="1">JSHOW</option>
			</field>

			<field
				name="show_category"
				type="list"
				label="JGLOBAL_SHOW_CATEGORY_LABEL"
				description="JGLOBAL_SHOW_CATEGORY_DESC"
				useglobal="true"
				class="chzn-color"
				>
				<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>

			<field
				name="link_category"
				type="list"
				label="JGLOBAL_LINK_CATEGORY_LABEL"
				description="JGLOBAL_LINK_CATEGORY_DESC"
				useglobal="true"
				class="chzn-color"
				>
				<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
				<option value="0">JNO</option>
				<option value="1">JYES</option>
			</field>

			<field
				name="show_parent_category"
				type="list"
				label="JGLOBAL_SHOW_PARENT_CATEGORY_LABEL"
				description="JGLOBAL_SHOW_PARENT_CATEGORY_DESC"
				useglobal="true"
				class="chzn-color"
				>
				<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>

			<field
				name="link_parent_category"
				type="list"
				label="JGLOBAL_LINK_PARENT_CATEGORY_LABEL"
				description="JGLOBAL_LINK_PARENT_CATEGORY_DESC"
				useglobal="true"
				class="chzn-color"
				>
				<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
				<option value="0">JNO</option>
				<option value="1">JYES</option>
			</field>

			<field
				name="show_associations"
				type="list"
				label="JGLOBAL_SHOW_ASSOCIATIONS_LABEL"
				description="JGLOBAL_SHOW_ASSOCIATIONS_DESC"
				useglobal="true"
				class="chzn-color"
				>
				<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>

			<field
				name="show_author"
				type="list"
				label="JGLOBAL_SHOW_AUTHOR_LABEL"
				description="JGLOBAL_SHOW_AUTHOR_DESC"
				useglobal="true"
				class="chzn-color"
				>
				<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>

			<field
				name="link_author"
				type="list"
				label="JGLOBAL_LINK_AUTHOR_LABEL"
				description="JGLOBAL_LINK_AUTHOR_DESC"
				useglobal="true"
				class="chzn-color"
				>
				<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
				<option value="0">JNO</option>
				<option value="1">JYES</option>
			</field>

			<field
				name="show_create_date"
				type="list"
				label="JGLOBAL_SHOW_CREATE_DATE_LABEL"
				description="JGLOBAL_SHOW_CREATE_DATE_DESC"
				useglobal="true"
				class="chzn-color"
				>
				<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>

			<field
				name="show_modify_date"
				type="list"
				label="JGLOBAL_SHOW_MODIFY_DATE_LABEL"
				description="JGLOBAL_SHOW_MODIFY_DATE_DESC"
				useglobal="true"
				class="chzn-color"
				>
				<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>

			<field
				name="show_publish_date"
				type="list"
				label="JGLOBAL_SHOW_PUBLISH_DATE_LABEL"
				description="JGLOBAL_SHOW_PUBLISH_DATE_DESC"
				useglobal="true"
				class="chzn-color"
				>
				<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>

			<field
				name="show_item_navigation"
				type="list"
				label="JGLOBAL_SHOW_NAVIGATION_LABEL"
				description="JGLOBAL_SHOW_NAVIGATION_DESC"
				useglobal="true"
				class="chzn-color"
				>
				<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>

			<field
				name="show_vote"
				type="list"
				label="JGLOBAL_SHOW_VOTE_LABEL"
				description="JGLOBAL_SHOW_VOTE_DESC"
				useglobal="true"
				class="chzn-color"
				>
				<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
				<option value="0">JHIDE</option>
				<option	value="1">JSHOW</option>
			</field>

			<field
				name="show_readmore"
				type="list"
				label="JGLOBAL_SHOW_READMORE_LABEL"
				description="JGLOBAL_SHOW_READMORE_DESC"
				useglobal="true"
				class="chzn-color"
				>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>

			<field
				name="show_readmore_title"
				type="list"
				label="JGLOBAL_SHOW_READMORE_TITLE_LABEL"
				description="JGLOBAL_SHOW_READMORE_TITLE_DESC"
				useglobal="true"
				class="chzn-color"
				>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>

			<field
				name="show_icons"
				type="list"
				label="JGLOBAL_SHOW_ICONS_LABEL"
				description="JGLOBAL_SHOW_ICONS_DESC"
				useglobal="true"
				class="chzn-color"
				>
				<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>

			<field
				name="show_print_icon"
				type="list"
				label="JGLOBAL_SHOW_PRINT_ICON_LABEL"
				description="JGLOBAL_SHOW_PRINT_ICON_DESC"
				useglobal="true"
				class="chzn-color"
				>
				<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>

			<field
				name="show_email_icon"
				type="list"
				label="JGLOBAL_Show_Email_Icon_Label"
				description="JGLOBAL_Show_Email_Icon_Desc"
				useglobal="true"
				class="chzn-color"
				>
				<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>

			<field
				name="show_hits"
				type="list"
				label="JGLOBAL_SHOW_HITS_LABEL"
				description="JGLOBAL_SHOW_HITS_DESC"
				useglobal="true"
				class="chzn-color"
				>
				<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>

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

			<field
				name="show_noauth"
				type="list"
				label="JGLOBAL_SHOW_UNAUTH_LINKS_LABEL"
				description="JGLOBAL_SHOW_UNAUTH_LINKS_DESC"
				useglobal="true"
				class="chzn-color"
				>
				<option value="use_article">COM_CONTENT_FIELD_VALUE_USE_ARTICLE_SETTINGS</option>
				<option value="0">JNO</option>
				<option value="1">JYES</option>
			</field>
		</fieldset>

		<fieldset name="integration" label="COM_MENUS_INTEGRATION_FIELDSET_LABEL">
			<field
				name="show_feed_link"
				type="list"
				label="JGLOBAL_SHOW_FEED_LINK_LABEL"
				description="JGLOBAL_SHOW_FEED_LINK_DESC"
				useglobal="true"
				class="chzn-color"
				>
				<option value="0">JHIDE</option>
				<option value="1">JSHOW</option>
			</field>

			<field
				name="feed_summary"
				type="list"
				label="JGLOBAL_FEED_SUMMARY_LABEL"
				description="JGLOBAL_FEED_SUMMARY_DESC"
				useglobal="true"
				>
				<option value="0">JGLOBAL_INTRO_TEXT</option>
				<option value="1">JGLOBAL_FULL_TEXT</option>
			</field>
		</fieldset>
	</fields>
</metadata>
tmpl/blog_children.php000064400000006731152353357140011043 0ustar00<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_content
 *
 * @copyright   (C) 2010 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

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

$class  = ' class="first"';
$lang   = JFactory::getLanguage();
$user   = JFactory::getUser();
$groups = $user->getAuthorisedViewLevels();

if ($this->maxLevel != 0 && count($this->children[$this->category->id]) > 0) : ?>

	<?php foreach ($this->children[$this->category->id] as $id => $child) : ?>
		<?php // Check whether category access level allows access to subcategories. ?>
		<?php if (in_array($child->access, $groups)) : ?>
			<?php if ($this->params->get('show_empty_categories') || $child->numitems || count($child->getChildren())) :
				if (!isset($this->children[$this->category->id][$id + 1])) :
					$class = ' class="last"';
				endif;
			?>
			<div<?php echo $class; ?>>
				<?php $class = ''; ?>
				<?php if ($lang->isRtl()) : ?>
				<h3 class="page-header item-title">
					<?php if ( $this->params->get('show_cat_num_articles', 1)) : ?>
						<span class="badge badge-info tip hasTooltip" title="<?php echo JHtml::_('tooltipText', 'COM_CONTENT_NUM_ITEMS_TIP'); ?>">
							<?php echo $child->getNumItems(true); ?>
						</span>
					<?php endif; ?>
					<a href="<?php echo JRoute::_(ContentHelperRoute::getCategoryRoute($child->id)); ?>">
					<?php echo $this->escape($child->title); ?></a>

					<?php if ($this->maxLevel > 1 && count($child->getChildren()) > 0) : ?>
						<a href="#category-<?php echo $child->id; ?>" data-toggle="collapse" 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 else : ?>
				<h3 class="page-header item-title"><a href="<?php echo JRoute::_(ContentHelperRoute::getCategoryRoute($child->id)); ?>">
					<?php echo $this->escape($child->title); ?></a>
					<?php if ( $this->params->get('show_cat_num_articles', 1)) : ?>
						<span class="badge badge-info tip hasTooltip" title="<?php echo JHtml::_('tooltipText', 'COM_CONTENT_NUM_ITEMS_TIP'); ?>">
							<?php echo JText::_('COM_CONTENT_NUM_ITEMS'); ?>&nbsp;
							<?php echo $child->getNumItems(true); ?>
						</span>
					<?php endif; ?>

					<?php if ($this->maxLevel > 1 && count($child->getChildren()) > 0) : ?>
						<a href="#category-<?php echo $child->id; ?>" data-toggle="collapse" 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 endif; ?>

				<?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_content.category'); ?>
						</div>
					<?php endif; ?>
				<?php endif; ?>

				<?php if ($this->maxLevel > 1 && count($child->getChildren()) > 0) : ?>
					<div class="collapse fade" id="category-<?php echo $child->id; ?>">
						<?php
						$this->children[$child->id] = $child->getChildren();
						$this->category = $child;
						$this->maxLevel--;
						echo $this->loadTemplate('children');
						$this->category = $child->getParent();
						$this->maxLevel++;
						?>
					</div>
				<?php endif; ?>
			</div>
			<?php endif; ?>
		<?php endif; ?>
	<?php endforeach; ?>

<?php endif;
tmpl/blog_item.php000064400000010077152353357140010207 0ustar00<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_content
 *
 * @copyright   (C) 2006 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

// Create a shortcut for params.
$params = $this->item->params;
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
$canEdit = $this->item->params->get('access-edit');
$info    = $params->get('info_block_position', 0);

// Check if associations are implemented. If they are, define the parameter.
$assocParam = (JLanguageAssociations::isEnabled() && $params->get('show_associations'));

$currentDate   = JFactory::getDate()->format('Y-m-d H:i:s');
$isUnpublished = ($this->item->state == 0 || $this->item->publish_up > $currentDate)
	|| ($this->item->publish_down < $currentDate && $this->item->publish_down !== JFactory::getDbo()->getNullDate());

?>
<?php if ($isUnpublished) : ?>
	<div class="system-unpublished">
<?php endif; ?>

<?php echo JLayoutHelper::render('joomla.content.blog_style_default_item_title', $this->item); ?>

<?php if ($canEdit || $params->get('show_print_icon') || $params->get('show_email_icon')) : ?>
	<?php echo JLayoutHelper::render('joomla.content.icons', array('params' => $params, 'item' => $this->item, 'print' => false)); ?>
<?php endif; ?>

<?php // Todo Not that elegant would be nice to group the params ?>
<?php $useDefList = ($params->get('show_modify_date') || $params->get('show_publish_date') || $params->get('show_create_date')
	|| $params->get('show_hits') || $params->get('show_category') || $params->get('show_parent_category') || $params->get('show_author') || $assocParam); ?>

<?php if ($useDefList && ($info == 0 || $info == 2)) : ?>
	<?php // Todo: for Joomla4 joomla.content.info_block.block can be changed to joomla.content.info_block ?>
	<?php echo JLayoutHelper::render('joomla.content.info_block.block', array('item' => $this->item, 'params' => $params, 'position' => 'above')); ?>
<?php endif; ?>
<?php if ($info == 0 && $params->get('show_tags', 1) && !empty($this->item->tags->itemTags)) : ?>
	<?php echo JLayoutHelper::render('joomla.content.tags', $this->item->tags->itemTags); ?>
<?php endif; ?>

<?php echo JLayoutHelper::render('joomla.content.intro_image', $this->item); ?>

<?php if (!$params->get('show_intro')) : ?>
	<?php // Content is generated by content plugin event "onContentAfterTitle" ?>
	<?php echo $this->item->event->afterDisplayTitle; ?>
<?php endif; ?>

<?php // Content is generated by content plugin event "onContentBeforeDisplay" ?>
<?php echo $this->item->event->beforeDisplayContent; ?>

<?php echo $this->item->introtext; ?>

<?php if ($info == 1 || $info == 2) : ?>
	<?php if ($useDefList) : ?>
		<?php // Todo: for Joomla4 joomla.content.info_block.block can be changed to joomla.content.info_block ?>
		<?php echo JLayoutHelper::render('joomla.content.info_block.block', array('item' => $this->item, 'params' => $params, 'position' => 'below')); ?>
	<?php endif; ?>
	<?php if ($params->get('show_tags', 1) && !empty($this->item->tags->itemTags)) : ?>
		<?php echo JLayoutHelper::render('joomla.content.tags', $this->item->tags->itemTags); ?>
	<?php endif; ?>
<?php endif; ?>

<?php if ($params->get('show_readmore') && $this->item->readmore) :
	if ($params->get('access-view')) :
		$link = JRoute::_(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid, $this->item->language));
	else :
		$menu = JFactory::getApplication()->getMenu();
		$active = $menu->getActive();
		$itemId = $active->id;
		$link = new JUri(JRoute::_('index.php?option=com_users&view=login&Itemid=' . $itemId, false));
		$link->setVar('return', base64_encode(ContentHelperRoute::getArticleRoute($this->item->slug, $this->item->catid, $this->item->language)));
	endif; ?>

	<?php echo JLayoutHelper::render('joomla.content.readmore', array('item' => $this->item, 'params' => $params, 'link' => $link)); ?>

<?php endif; ?>

<?php if ($isUnpublished) : ?>
	</div>
<?php endif; ?>

<?php // Content is generated by content plugin event "onContentAfterDisplay" ?>
<?php echo $this->item->event->afterDisplayContent; ?>
tmpl/blog_links.php000064400000001042152353357140010361 0ustar00<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_content
 *
 * @copyright   (C) 2006 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;
?>

<ol class="nav nav-tabs nav-stacked">
	<?php foreach ($this->link_items as &$item) : ?>
		<li>
			<a href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($item->slug, $item->catid, $item->language)); ?>">
				<?php echo $item->title; ?></a>
		</li>
	<?php endforeach; ?>
</ol>
tmpl/default_articles.php000064400000032626152353357140011564 0ustar00<?php
/**
 * @package     Joomla.Site
 * @subpackage  com_content
 *
 * @copyright   (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
 * @license     GNU General Public License version 2 or later; see LICENSE.txt
 */

defined('_JEXEC') or die;

use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Language\Multilanguage;

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

// Create some shortcuts.
$n          = count($this->items);
$listOrder  = $this->escape($this->state->get('list.ordering'));
$listDirn   = $this->escape($this->state->get('list.direction'));
$langFilter = false;

// Tags filtering based on language filter
if (($this->params->get('filter_field') === 'tag') && (Multilanguage::isEnabled()))
{
	$tagfilter = ComponentHelper::getParams('com_tags')->get('tag_list_language_filter');

	switch ($tagfilter)
	{
		case 'current_language' :
			$langFilter = JFactory::getApplication()->getLanguage()->getTag();
			break;

		case 'all' :
			$langFilter = false;
			break;

		default :
			$langFilter = $tagfilter;
	}
}

// Check for at least one editable article
$isEditable = false;

if (!empty($this->items))
{
	foreach ($this->items as $article)
	{
		if ($article->params->get('access-edit'))
		{
			$isEditable = true;
			break;
		}
	}
}

// For B/C we also add the css classes inline. This will be removed in 4.0.
JFactory::getDocument()->addStyleDeclaration('
.hide { display: none; }
.table-noheader { border-collapse: collapse; }
.table-noheader thead { display: none; }
');

$tableClass = $this->params->get('show_headings') != 1 ? ' table-noheader' : '';

$nullDate    = JFactory::getDbo()->getNullDate();
$currentDate = JFactory::getDate()->format('Y-m-d H:i:s');

?>
<form action="<?php echo htmlspecialchars(JUri::getInstance()->toString()); ?>" method="post" name="adminForm" id="adminForm" class="form-inline">
<?php if ($this->params->get('filter_field') !== 'hide' || $this->params->get('show_pagination_limit')) : ?>
	<fieldset class="filters btn-toolbar clearfix">
		<legend class="hide"><?php echo JText::_('COM_CONTENT_FORM_FILTER_LEGEND'); ?></legend>
		<?php if ($this->params->get('filter_field') !== 'hide') : ?>
			<div class="btn-group">
				<?php if ($this->params->get('filter_field') === 'tag') : ?>
					<select name="filter_tag" id="filter_tag" onchange="document.adminForm.submit();">
						<option value=""><?php echo JText::_('JOPTION_SELECT_TAG'); ?></option>
						<?php echo JHtml::_('select.options', JHtml::_('tag.options', array('filter.published' => array(1), 'filter.language' => $langFilter), true), 'value', 'text', $this->state->get('filter.tag')); ?>
					</select>
				<?php elseif ($this->params->get('filter_field') === 'month') : ?>
					<select name="filter-search" id="filter-search" onchange="document.adminForm.submit();">
						<option value=""><?php echo JText::_('JOPTION_SELECT_MONTH'); ?></option>
						<?php echo JHtml::_('select.options', JHtml::_('content.months', $this->state), 'value', 'text', $this->state->get('list.filter')); ?>
					</select>
				<?php else : ?>
					<label class="filter-search-lbl element-invisible" for="filter-search">
						<?php echo JText::_('COM_CONTENT_' . $this->params->get('filter_field') . '_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_CONTENT_FILTER_SEARCH_DESC'); ?>" placeholder="<?php echo JText::_('COM_CONTENT_' . $this->params->get('filter_field') . '_FILTER_LABEL'); ?>" />
				<?php endif; ?>
			</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; ?>

		<input type="hidden" name="filter_order" value="" />
		<input type="hidden" name="filter_order_Dir" value="" />
		<input type="hidden" name="limitstart" value="" />
		<input type="hidden" name="task" value="" />
	</fieldset>

	<div class="control-group hide pull-right">
		<div class="controls">
			<button type="submit" name="filter_submit" class="btn btn-primary"><?php echo JText::_('COM_CONTENT_FORM_FILTER_SUBMIT'); ?></button>
		</div>
	</div>

<?php endif; ?>

<?php if (empty($this->items)) : ?>
	<?php if ($this->params->get('show_no_articles', 1)) : ?>
		<p><?php echo JText::_('COM_CONTENT_NO_ARTICLES'); ?></p>
	<?php endif; ?>
<?php else : ?>
	<table class="category table table-striped table-bordered table-hover<?php echo $tableClass; ?>">
		<caption class="hide"><?php echo JText::sprintf('COM_CONTENT_CATEGORY_LIST_TABLE_CAPTION', $this->category->title); ?></caption>
		<thead>
			<tr>
				<th scope="col" id="categorylist_header_title">
					<?php echo JHtml::_('grid.sort', 'JGLOBAL_TITLE', 'a.title', $listDirn, $listOrder, null, 'asc', '', 'adminForm'); ?>
				</th>
				<?php if ($date = $this->params->get('list_show_date')) : ?>
					<th scope="col" id="categorylist_header_date">
						<?php if ($date === 'created') : ?>
							<?php echo JHtml::_('grid.sort', 'COM_CONTENT_' . $date . '_DATE', 'a.created', $listDirn, $listOrder); ?>
						<?php elseif ($date === 'modified') : ?>
							<?php echo JHtml::_('grid.sort', 'COM_CONTENT_' . $date . '_DATE', 'a.modified', $listDirn, $listOrder); ?>
						<?php elseif ($date === 'published') : ?>
							<?php echo JHtml::_('grid.sort', 'COM_CONTENT_' . $date . '_DATE', 'a.publish_up', $listDirn, $listOrder); ?>
						<?php endif; ?>
					</th>
				<?php endif; ?>
				<?php if ($this->params->get('list_show_author')) : ?>
					<th scope="col" id="categorylist_header_author">
						<?php echo JHtml::_('grid.sort', 'JAUTHOR', 'author', $listDirn, $listOrder); ?>
					</th>
				<?php endif; ?>
				<?php if ($this->params->get('list_show_hits')) : ?>
					<th scope="col" id="categorylist_header_hits">
						<?php echo JHtml::_('grid.sort', 'JGLOBAL_HITS', 'a.hits', $listDirn, $listOrder); ?>
					</th>
				<?php endif; ?>
				<?php if ($this->params->get('list_show_votes', 0) && $this->vote) : ?>
					<th scope="col" id="categorylist_header_votes">
						<?php echo JHtml::_('grid.sort', 'COM_CONTENT_VOTES', 'rating_count', $listDirn, $listOrder); ?>
					</th>
				<?php endif; ?>
				<?php if ($this->params->get('list_show_ratings', 0) && $this->vote) : ?>
					<th scope="col" id="categorylist_header_ratings">
						<?php echo JHtml::_('grid.sort', 'COM_CONTENT_RATINGS', 'rating', $listDirn, $listOrder); ?>
					</th>
				<?php endif; ?>
				<?php if ($isEditable) : ?>
					<th scope="col" id="categorylist_header_edit"><?php echo JText::_('COM_CONTENT_EDIT_ITEM'); ?></th>
				<?php endif; ?>
			</tr>
		</thead>
		<tbody>
		<?php foreach ($this->items as $i => $article) : ?>
			<?php if ($this->items[$i]->state == 0) : ?>
				<tr class="system-unpublished cat-list-row<?php echo $i % 2; ?>">
			<?php else : ?>
				<tr class="cat-list-row<?php echo $i % 2; ?>" >
			<?php endif; ?>
			<td headers="categorylist_header_title" class="list-title">
				<?php if (in_array($article->access, $this->user->getAuthorisedViewLevels())) : ?>
					<a href="<?php echo JRoute::_(ContentHelperRoute::getArticleRoute($article->slug, $article->catid, $article->language)); ?>">
						<?php echo $this->escape($article->title); ?>
					</a>
					<?php if (JLanguageAssociations::isEnabled() && $this->params->get('show_associations')) : ?>
						<?php $associations = ContentHelperAssociation::displayAssociations($article->id); ?>
						<?php foreach ($associations as $association) : ?>
							<?php if ($this->params->get('flags', 1) && $association['language']->image) : ?>
								<?php $flag = JHtml::_('image', 'mod_languages/' . $association['language']->image . '.gif', $association['language']->title_native, array('title' => $association['language']->title_native), true); ?>
								&nbsp;<a href="<?php echo JRoute::_($association['item']); ?>"><?php echo $flag; ?></a>&nbsp;
							<?php else : ?>
								<?php $class = 'label label-association label-' . $association['language']->sef; ?>
								&nbsp;<a class="<?php echo $class; ?>" href="<?php echo JRoute::_($association['item']); ?>"><?php echo strtoupper($association['language']->sef); ?></a>&nbsp;
							<?php endif; ?>
						<?php endforeach; ?>
					<?php endif; ?>
				<?php else : ?>
					<?php
					echo $this->escape($article->title) . ' : ';
					$menu   = JFactory::getApplication()->getMenu();
					$active = $menu->getActive();
					$itemId = $active->id;
					$link   = new JUri(JRoute::_('index.php?option=com_users&view=login&Itemid=' . $itemId, false));
					$link->setVar('return', base64_encode(ContentHelperRoute::getArticleRoute($article->slug, $article->catid, $article->language)));
					?>
					<a href="<?php echo $link; ?>" class="register">
						<?php echo JText::_('COM_CONTENT_REGISTER_TO_READ_MORE'); ?>
					</a>
					<?php if (JLanguageAssociations::isEnabled() && $this->params->get('show_associations')) : ?>
						<?php $associations = ContentHelperAssociation::displayAssociations($article->id); ?>
						<?php foreach ($associations as $association) : ?>
							<?php if ($this->params->get('flags', 1)) : ?>
								<?php $flag = JHtml::_('image', 'mod_languages/' . $association['language']->image . '.gif', $association['language']->title_native, array('title' => $association['language']->title_native), true); ?>
								&nbsp;<a href="<?php echo JRoute::_($association['item']); ?>"><?php echo $flag; ?></a>&nbsp;
							<?php else : ?>
								<?php $class = 'label label-association label-' . $association['language']->sef; ?>
								&nbsp;<a class="' . <?php echo $class; ?> . '" href="<?php echo JRoute::_($association['item']); ?>"><?php echo strtoupper($association['language']->sef); ?></a>&nbsp;
							<?php endif; ?>
						<?php endforeach; ?>
					<?php endif; ?>
				<?php endif; ?>
				<?php if ($article->state == 0) : ?>
					<span class="list-published label label-warning">
								<?php echo JText::_('JUNPUBLISHED'); ?>
							</span>
				<?php endif; ?>
				<?php if ($article->publish_up > $currentDate) : ?>
					<span class="list-published label label-warning">
								<?php echo JText::_('JNOTPUBLISHEDYET'); ?>
							</span>
				<?php endif; ?>
				<?php if ($article->publish_down < $currentDate && $article->publish_down !== $nullDate) : ?>
					<span class="list-published label label-warning">
								<?php echo JText::_('JEXPIRED'); ?>
							</span>
				<?php endif; ?>
			</td>
			<?php if ($this->params->get('list_show_date')) : ?>
				<td headers="categorylist_header_date" class="list-date small">
					<?php
					echo JHtml::_(
						'date', $article->displayDate,
						$this->escape($this->params->get('date_format', JText::_('DATE_FORMAT_LC3')))
					); ?>
				</td>
			<?php endif; ?>
			<?php if ($this->params->get('list_show_author', 1)) : ?>
				<td headers="categorylist_header_author" class="list-author">
					<?php if (!empty($article->author) || !empty($article->created_by_alias)) : ?>
						<?php $author = $article->author ?>
						<?php $author = $article->created_by_alias ?: $author; ?>
						<?php if (!empty($article->contact_link) && $this->params->get('link_author') == true) : ?>
							<?php echo JText::sprintf('COM_CONTENT_WRITTEN_BY', JHtml::_('link', $article->contact_link, $author)); ?>
						<?php else : ?>
							<?php echo JText::sprintf('COM_CONTENT_WRITTEN_BY', $author); ?>
						<?php endif; ?>
					<?php endif; ?>
				</td>
			<?php endif; ?>
			<?php if ($this->params->get('list_show_hits', 1)) : ?>
				<td headers="categorylist_header_hits" class="list-hits">
							<span class="badge badge-info">
								<?php echo JText::sprintf('JGLOBAL_HITS_COUNT', $article->hits); ?>
							</span>
						</td>
			<?php endif; ?>
			<?php if ($this->params->get('list_show_votes', 0) && $this->vote) : ?>
				<td headers="categorylist_header_votes" class="list-votes">
					<span class="badge badge-success">
						<?php echo JText::sprintf('COM_CONTENT_VOTES_COUNT', $article->rating_count); ?>
					</span>
				</td>
			<?php endif; ?>
			<?php if ($this->params->get('list_show_ratings', 0) && $this->vote) : ?>
				<td headers="categorylist_header_ratings" class="list-ratings">
					<span class="badge badge-warning">
						<?php echo JText::sprintf('COM_CONTENT_RATINGS_COUNT', $article->rating); ?>
					</span>
				</td>
			<?php endif; ?>
			<?php if ($isEditable) : ?>
				<td headers="categorylist_header_edit" class="list-edit">
					<?php if ($article->params->get('access-edit')) : ?>
						<?php echo JHtml::_('icon.edit', $article, $article->params); ?>
					<?php endif; ?>
				</td>
			<?php endif; ?>
			</tr>
		<?php endforeach; ?>
		</tbody>
	</table>
<?php endif; ?>

<?php // Code to add a link to submit an article. ?>
<?php if ($this->category->getParams()->get('access-create')) : ?>
	<?php echo JHtml::_('icon.create', $this->category, $this->category->params); ?>
<?php endif; ?>

<?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>
tmpl/bs3-default.php000064400000016520152435261050010351 0ustar00<?php
/**
 *
 * Show the products in a category
 *
 * @package    VirtueMart
 * @subpackage
 * @author RolandD
 * @author Max Milbers
 * @todo add pagination
 * @link http://www.virtuemart.net
 * @copyright Copyright (c) 2004 - 2010 VirtueMart Team. All rights reserved.
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
 * VirtueMart is free software. This version may have been modified pursuant
 * to the GNU General Public License, and as distributed it includes or
 * is derivative of works licensed under the GNU General Public License or
 * other free or open source software licenses.
 * @version $Id: default.php 8811 2015-03-30 23:11:08Z Milbo $
 */

defined ('_JEXEC') or die('Restricted access');
$doc = JFactory::getDocument();
$category_id  = vRequest::getInt ('virtuemart_category_id', 0);
$manufacturer_id  = vRequest::getInt ('virtuemart_manufacturer_id', 0);

if (vRequest::getInt('dynamic',false) and vRequest::getInt('virtuemart_product_id',false)) {
	if (!empty($this->products)) {
		if($this->fallback){
			$p = $this->products;
			$this->products = array();
			$this->products[0] = $p;
			vmdebug('Refallback');
		}

		echo shopFunctionsF::renderVmSubLayout($this->productsLayout,array('products'=>$this->products,'currency'=>$this->currency,'products_per_row'=>$this->perRow,'showRating'=>$this->showRating));

	}

	return ;
}
?>
<div class="category-view">
	<?php if ( $this->category->category_name ) { ?>
	<h1 class="page-header"><?php echo vmText::_($this->category->category_name); ?></h1>
	<?php } ?>
	<?php if ($this->show_store_desc and !empty($this->vendor->vendor_store_desc)) { ?>
	<div class="vendor-store-desc">
	<?php echo $this->vendor->vendor_store_desc; ?>
	</div>
	<?php } ?>

	<?php if (!empty($this->showcategory_desc) and empty($this->keyword)) { ?>
		<?php if (!empty($this->category->category_description)) { ?>
		<div class="category_description">
			<?php echo $this->category->category_description; ?>
		</div>
		<?php } ?>
	<?php } ?>

	<?php if(!empty($this->manu_descr)) { ?>
	<div class="manufacturer-description">
		<?php echo $this->manu_descr; ?>
	</div>
	<?php } ?>

	<?php	// Show child categories
	if ($this->showcategory and empty($this->keyword) and $manufacturer_id == 0) {
		if (!empty($this->category->haschildren)) {
			echo ShopFunctionsF::renderVmSubLayout('categories',array('categories'=>$this->category->children, 'categories_per_row'=>$this->categories_per_row));
		}
	}

	if (!empty($this->products) or ($this->showsearch or $this->keyword !== false)) {
	?>
	<div class="browse-view">
		<?php
		if ($this->showsearch or $this->keyword !== false) {
		//id taken in the view.html.php could be modified
		$category_id  = vRequest::getInt ('virtuemart_category_id', 0); ?>
		<!--BEGIN Search Box -->
		<div class="virtuemart_search">
			<form action="<?php echo JRoute::_ ('index.php?option=com_virtuemart&view=category&limitstart=0', FALSE); ?>" method="get">
				<?php if(!empty($this->searchCustomList)) { ?>
				<div class="vm-search-custom-list">
					<?php echo $this->searchCustomList ?>
				</div>
				<?php } ?>

				<?php if(!empty($this->searchCustomValuesAr)) { ?>
				<div class="vm-search-custom-values">
				<?php
				echo ShopFunctionsF::renderVmSubLayoutAsGrid(
					'searchcustomvalues',
					array (
						'searchcustomvalues' => $this->searchCustomValuesAr,
						'options' => array (
						'items_per_row' => array (
							'xs' => 2,
							'sm' => 2,
							'md' => 2,
							'lg' => 2,
							'xl' => 2,
						),
						),
					)
				);
				?>
				</div>
				<?php if(count($this->searchCustomValuesAr)>1){
				?>
				<div><?php echo vmText::_('COM_VM_COMBINETAGS');
				echo VmHtml::checkbox ('combineTags', $this->combineTags, 1, 0, '', 'combineTags'); ?></div>
				<?php }
				} ?>
				<div class="vm-search-custom-search-input input-group form-group">
					<input name="keyword" class="inputbox" type="text" size="40" value="<?php echo $this->keyword ?>"/>
					<span class="input-group-btn">
						<button type="submit" class="button btn-primary"><?php echo vmText::_ ('COM_VIRTUEMART_SEARCH') ?></button>
					</span>
					<?php //echo VmHtml::checkbox ('searchAllCats', (int)$this->searchAllCats, 1, 0, 'class="changeSendForm"'); ?>
				</div>
				<div class="vm-search-descr text-warning">
					<p><?php echo vmText::_('COM_VM_SEARCH_DESC') ?></p>
				</div>
				<!-- input type="hidden" name="showsearch" value="true"/ -->
				<input type="hidden" name="view" value="category"/>
				<input type="hidden" name="option" value="com_virtuemart"/>
				<input type="hidden" name="virtuemart_category_id" value="<?php echo $category_id; ?>"/>
				<input type="hidden" name="Itemid" value="<?php echo $this->Itemid; ?>"/>
			</form>
		</div>
		<!-- End Search Box -->
		<?php }

		$j = 'jQuery(document).ready(function() {

		jQuery(".changeSendForm")
		.off("change",Virtuemart.sendCurrForm)
		.on("change",Virtuemart.sendCurrForm);
		})';

		vmJsApi::addJScript('sendFormChange',$j);
		?>

		<?php if (!empty($this->products) && $this->showproducts) { ?>
		<div class="orderby-displaynumber">
			<div class="row">
				<div class="orderlistcontainer col-sm-4">
					<label><?php echo vmText::_('COM_VIRTUEMART_ORDERBY'); ?>
					<?php echo $this->orderByList['orderby']; ?>
					</label>
				</div>
				<div class="orderlistcontainer col-sm-4">
					<?php if (!empty($this->orderByList['manufacturer'])) :?>
					<label><?php echo vmText::_('COM_VIRTUEMART_PRODUCT_DETAILS_MANUFACTURER_LBL'); ?>
					<?php echo $this->orderByList['manufacturer']; ?>
					</label>
					<?php endif; ?>
				</div>
				<div class="col-sm-4 orderlistcontainer display-number text-right">
					<label><?php echo $this->vmPagination->getResultsCounter ();?>
					<?php echo str_replace( 'class="inputbox"', 'class="inputbox col-xs-4 col-xs-offset-8"', $this->vmPagination->getLimitBox ($this->category->limit_list_step)); ?>
					</label>
				</div>
				<div class="col-xs-12 vm-pagination vm-pagination-top">
					<div class="row">
						<div class="col-xs-4 text-left small text-muted"><?php echo $this->vmPagination->getPagesCounter (); ?></div>
						<div class="col-xs-8"><?php echo str_replace('<ul>', '<ul class="pagination">', $this->vmPagination->getPagesLinks ()); ?></div>
					</div>
				</div>
			</div>
		</div> <!-- end of orderby-displaynumber -->
		<?php } ?>

		<?php	if (!empty($this->products))
		{
			//revert of the fallback in the view.html.php, will be removed vm3.2
			if($this->fallback){
			$p = $this->products;
			$this->products = array();
			$this->products[0] = $p;
			vmdebug('Refallback');
			}

			echo shopFunctionsF::renderVmSubLayout($this->productsLayout,array('products'=>$this->products,'currency'=>$this->currency,'products_per_row'=>$this->perRow,'showRating'=>$this->showRating));

			}
		?>

		<?php if (!empty($this->orderByList)) { ?>
		<div class="vm-pagination vm-pagination-bottom text-center row">
			<div class="vm-page-counter col-sm-3 small text-muted"><?php echo $this->vmPagination->getPagesCounter (); ?></div>
			<div class="col-sm-9 text-right">
			<?php echo $this->vmPagination->getPagesLinks (); ?>
			</div>
		</div>
		<?php } ?>

		<?php	if ($this->keyword !== false && empty($this->products)) { ?>
		<div class="alert alert-info">
		<?php echo vmText::_ ('COM_VIRTUEMART_NO_RESULT') . ($this->keyword ? ' : (' . $this->keyword . ')' : ''); ?>
		</div>
		<?php } ?>

	</div> <!-- browse view end -->
	<?php } ?>
</div>
<!-- end browse-view -->tmpl/categories.php000064400000002015152435261070010361 0ustar00<?php
/**
*
* Show the products in a category
*
* @package	VirtueMart
* @subpackage
* @author RolandD
* @author Max Milbers
* @todo add pagination
* @link http://www.virtuemart.net
* @copyright Copyright (c) 2004 - 2012 VirtueMart Team. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* VirtueMart is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
 * @version $Id: default.php 6104 2012-06-13 14:15:29Z alatak $
*/

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

if ($this->category->haschildren) {

	// Calculating Categories Per Row
	//$categories_per_row = VmConfig::get ( 'categories_per_row', 3 );

	// Start the Output
	echo ShopFunctionsF::renderVmSubLayout('categories',array('categories'=> $this->category->children));

} ?>view.json.php000064400000004745152435261360007220 0ustar00<?php
/**
*
* Description
*
* @package	VirtueMart
* @subpackage
* @author
* @link https://virtuemart.net
* @copyright Copyright (c) 2004 - 2012 VirtueMart Team. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* VirtueMart is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* @version $Id: view.json.php 9572 2017-06-07 15:03:30Z kkmediaproduction $
*/

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

/**
 * HTML View class for the VirtueMart Component
 *
 * @package		VirtueMart
 * @author
 */
class VirtuemartViewCategory extends VmView {

	var $json = array();

	function __construct( ){

		$this->type = vRequest::getCmd('type', false);
		$this->row = vRequest::getInt('row', false);
	}
	
	function display($tpl = null) {

		$id = vRequest::getInt('id', false);
		$virtuemart_product_id = vRequest::getInt('virtuemart_product_id',array());
		if(is_array($virtuemart_product_id) && count($virtuemart_product_id) > 0){
			$product_id = (int)$virtuemart_product_id[0];
		} else {
			$product_id = (int)$virtuemart_product_id;
		}

		
    	if ($this->type=='getCategoriesTree') {
			if(!empty($product_id)){
				$this->ProductModel = VmModel::getModel('product');
				$product = $this->ProductModel->getProductSingle($virtuemart_product_id,false);
				$categories = $product->categories;
			} else {
				if(!$categories = vRequest::getInt('top_category_id',false)){
					$categories = vRequest::getInt('virtuemart_category_id',array());
					if(!is_array($categories)){
						$categories = (array) $categories;
					}
				}
			}
			$own_category_id = vRequest::getInt('own_category_id',false);


			$onlyPublished = vRequest::getInt('onlyPublished',VmConfig::isSite());

			if($own_category_id){
				$html = ShopFunctions::categoryListTree($categories, 0, 0, (array) $own_category_id, $onlyPublished);
			} else {
				$html = ShopFunctions::categoryListTree($categories, 0, 0, array(), $own_category_id, $onlyPublished);
			}

			$this->json['value'] = $html;
			
			
		} else $this->json['ok'] = 0 ;

		if ( empty($this->json)) {
			$this->json['value'] = null;
			$this->json['ok'] = 1 ;
		}

		header ('Content-Type: application/json');
		echo vmJsApi::safe_json_encode($this->json);
		jExit();
	}

}
// pure php no closing tag