Configurazione template

This commit is contained in:
2024-12-20 16:13:51 +01:00
parent e650f8df99
commit 7d63c3c59c
89 changed files with 2829 additions and 240 deletions

View File

@ -0,0 +1,32 @@
<?php
/**
* @package Joomla.Site
* @subpackage com_contact
*
* @copyright (C) 2008 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;
// Add strings for translations in Javascript.
Text::script('JGLOBAL_EXPAND_CATEGORIES');
Text::script('JGLOBAL_COLLAPSE_CATEGORIES');
/** @var \Joomla\Component\Contact\Site\View\Categories\HtmlView $this */
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->getDocument()->getWebAssetManager();
$wa->getRegistry()->addExtensionRegistryFile('com_categories');
$wa->useScript('com_categories.shared-categories-accordion');
?>
<div class="com-contact-categories categories-list">
<?php
echo LayoutHelper::render('joomla.content.categories_default', $this);
echo $this->loadTemplate('items');
?>
</div>

View File

@ -0,0 +1,69 @@
<?php
/**
* @package Joomla.Site
* @subpackage com_contact
*
* @copyright (C) 2010 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
use Joomla\Component\Contact\Site\Helper\RouteHelper;
/** @var \Joomla\Component\Contact\Site\View\Categories\HtmlView $this */
if ($this->maxLevelcat != 0 && count($this->items[$this->parent->id]) > 0) :
?>
<?php foreach ($this->items[$this->parent->id] as $id => $item) : ?>
<?php if ($this->params->get('show_empty_categories_cat') || $item->numitems || count($item->getChildren())) : ?>
<div class="com-contact-categories__items">
<h3 class="page-header item-title">
<a href="<?php echo Route::_(RouteHelper::getCategoryRoute($item->id, $item->language)); ?>">
<?php echo $this->escape($item->title); ?></a>
<?php if ($this->params->get('show_cat_items_cat') == 1) :?>
<span class="badge bg-info">
<?php echo Text::_('COM_CONTACT_NUM_ITEMS'); ?>&nbsp;
<?php echo $item->numitems; ?>
</span>
<?php endif; ?>
<?php if ($this->maxLevelcat > 1 && count($item->getChildren()) > 0) : ?>
<button
type="button"
id="category-btn-<?php echo $item->id; ?>"
data-bs-target="#category-<?php echo $item->id; ?>"
data-bs-toggle="collapse"
class="btn btn-secondary btn-sm float-end"
aria-label="<?php echo Text::_('JGLOBAL_EXPAND_CATEGORIES'); ?>"
>
<span class="icon-plus" aria-hidden="true"></span>
</button>
<?php endif; ?>
</h3>
<?php if ($this->params->get('show_subcat_desc_cat') == 1) : ?>
<?php if ($item->description) : ?>
<div class="category-desc">
<?php echo HTMLHelper::_('content.prepare', $item->description, '', 'com_contact.categories'); ?>
</div>
<?php endif; ?>
<?php endif; ?>
<?php if ($this->maxLevelcat > 1 && count($item->getChildren()) > 0) : ?>
<div class="collapse fade" id="category-<?php echo $item->id; ?>">
<?php
$this->items[$item->id] = $item->getChildren();
$this->parent = $item;
$this->maxLevelcat--;
echo $this->loadTemplate('items');
$this->parent = $item->getParent();
$this->maxLevelcat++;
?>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
<?php endforeach; ?><?php
endif; ?>

View File

@ -0,0 +1,34 @@
<?php
/**
* @package Joomla.Site
* @subpackage com_contact
*
* @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Layout\LayoutHelper;
/** @var \Joomla\Component\Contact\Site\View\Category\HtmlView $this */
?>
<div class="categoria-contatti">
<div class="container">
<div class="row">
<div class="col-12 col-lg-9 pe-lg-5">
<?php
$this->subtemplatename = 'items';
echo LayoutHelper::render('joomla.content.category_default', $this);
?>
</div>
<div class="col-12 col-lg-3 p-0 pt-lg-2 mb-3 ps-lg-3">
<div class="menu-laterale">
<?= JHtml::_('content.prepare', '{loadposition right}'); ?>
</div>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,55 @@
<?php
/**
* @package Joomla.Site
* @subpackage com_contact
*
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
use Joomla\Component\Contact\Site\Helper\RouteHelper;
/** @var \Joomla\Component\Contact\Site\View\Category\HtmlView $this */
if ($this->maxLevel != 0 && count($this->children[$this->category->id]) > 0) :
?>
<ul class="com-contact-category__children list-striped list-condensed">
<?php foreach ($this->children[$this->category->id] as $id => $child) : ?>
<?php if ($this->params->get('show_empty_categories') || $child->numitems || count($child->getChildren())) : ?>
<li>
<h4 class="item-title">
<a href="<?php echo Route::_(RouteHelper::getCategoryRoute($child->id, $child->language)); ?>">
<?php echo $this->escape($child->title); ?>
</a>
<?php if ($this->params->get('show_cat_items') == 1) : ?>
<span class="badge bg-info float-end" title="<?php echo Text::_('COM_CONTACT_CAT_NUM'); ?>"><?php echo $child->numitems; ?></span>
<?php endif; ?>
</h4>
<?php if ($this->params->get('show_subcat_desc') == 1) : ?>
<?php if ($child->description) : ?>
<div class="category-desc">
<?php echo HTMLHelper::_('content.prepare', $child->description, '', 'com_contact.category'); ?>
</div>
<?php endif; ?>
<?php endif; ?>
<?php if (count($child->getChildren()) > 0) :
$this->children[$child->id] = $child->getChildren();
$this->category = $child;
$this->maxLevel--;
echo $this->loadTemplate('children');
$this->category = $child->getParent();
$this->maxLevel++;
endif; ?>
</li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
<?php endif; ?>

View File

@ -0,0 +1,212 @@
<?php
/**
* @package Joomla.Site
* @subpackage com_contact
*
* @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
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\Uri\Uri;
use Joomla\Component\Contact\Administrator\Helper\ContactHelper;
use Joomla\Component\Contact\Site\Helper\RouteHelper;
/** @var \Joomla\Component\Contact\Site\View\Category\HtmlView $this */
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->getDocument()->getWebAssetManager();
$wa->useScript('com_contact.contacts-list')
->useScript('core');
$canDo = ContactHelper::getActions('com_contact', 'category', $this->category->id);
$canEdit = $canDo->get('core.edit');
$userId = $this->getCurrentUser()->id;
$showEditColumn = false;
if ($canEdit) {
$showEditColumn = true;
} elseif ($canDo->get('core.edit.own') && !empty($this->items)) {
foreach ($this->items as $item) {
if ($item->created_by == $userId) {
$showEditColumn = true;
break;
}
}
}
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
?>
<div class="com-contact-category__items">
<form action="<?php echo htmlspecialchars(Uri::getInstance()->toString()); ?>" method="post" name="adminForm" id="adminForm">
<?php if ($this->params->get('filter_field')) : ?>
<div class="com-contact-category__filter btn-group">
<label class="filter-search-lbl visually-hidden" for="filter-search">
<?php echo Text::_('COM_CONTACT_FILTER_SEARCH_DESC'); ?>
</label>
<input
type="text"
name="filter-search"
id="filter-search"
value="<?php echo $this->escape($this->state->get('list.filter')); ?>"
class="inputbox" onchange="document.adminForm.submit();"
placeholder="<?php echo Text::_('COM_CONTACT_FILTER_SEARCH_DESC'); ?>"
>
<button type="submit" name="filter_submit" class="btn btn-primary"><?php echo Text::_('JGLOBAL_FILTER_BUTTON'); ?></button>
<button type="reset" name="filter-clear-button" class="btn btn-secondary"><?php echo Text::_('JSEARCH_FILTER_CLEAR'); ?></button>
</div>
<?php endif; ?>
<?php if ($this->params->get('show_pagination_limit')) : ?>
<div class="com-contact-category__pagination btn-group float-end">
<label for="limit" class="visually-hidden">
<?php echo Text::_('JGLOBAL_DISPLAY_NUM'); ?>
</label>
<?php echo $this->pagination->getLimitBox(); ?>
</div>
<?php endif; ?>
<?php if (empty($this->items)) : ?>
<?php if ($this->params->get('show_no_contacts', 1)) : ?>
<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 Text::_('COM_CONTACT_NO_CONTACTS'); ?>
</div>
<?php endif; ?>
<?php else : ?>
<caption class="visually-hidden">
<?php echo Text::_('COM_CONTACT_TABLE_CAPTION'); ?>,
</caption>
<ul class="category row-striped">
<?php foreach ($this->items as $i => $item) : ?>
<li class="row-fluid cat-list-row0">
<div class="list-titles">
<a href="<?php echo Route::_(RouteHelper::getContactRoute($item->slug, $item->catid, $item->language)); ?>">
<?php if ($this->params->get('show_image_heading')) : ?>
<?php if ($item->image) : ?>
<?php echo LayoutHelper::render(
'joomla.html.image',
[
'src' => $item->image,
'alt' => '',
'class' => 'contact-thumbnail img-thumbnail',
]
); ?>
<?php endif; ?>
<?php endif; ?>
<?php echo $this->escape($item->name); ?>
</a>
<br/>
<?php if ($item->published == 0) : ?>
<div>
<span class="list-published badge bg-warning text-light">
<?php echo Text::_('JUNPUBLISHED'); ?>
</span>
</div>
<?php endif; ?>
<?php if ($item->publish_up && strtotime($item->publish_up) > strtotime(Factory::getDate())) : ?>
<div>
<span class="list-published badge bg-warning text-light">
<?php echo Text::_('JNOTPUBLISHEDYET'); ?>
</span>
</div>
<?php endif; ?>
<?php if (!is_null($item->publish_down) && strtotime($item->publish_down) < strtotime(Factory::getDate())) : ?>
<div>
<span class="list-published badge bg-warning text-light">
<?php echo Text::_('JEXPIRED'); ?>
</span>
</div>
<?php endif; ?>
<?php if ($item->published == -2) : ?>
<div>
<span class="badge bg-warning text-light">
<?php echo Text::_('JTRASHED'); ?>
</span>
</div>
<?php endif; ?>
<?php echo $item->event->afterDisplayTitle; ?>
<?php echo $item->event->beforeDisplayContent; ?>
<?php if ($this->params->get('show_telephone_headings') && !empty($item->telephone)) : ?>
<?php echo Text::sprintf('COM_CONTACT_TELEPHONE_NUMBER', $item->telephone); ?><br>
<?php endif; ?>
<?php if ($this->params->get('show_mobile_headings') && !empty($item->mobile)) : ?>
<?php echo Text::sprintf('COM_CONTACT_MOBILE_NUMBER', $item->mobile); ?><br>
<?php endif; ?>
<?php if ($this->params->get('show_fax_headings') && !empty($item->fax)) : ?>
<?php echo Text::sprintf('COM_CONTACT_FAX_NUMBER', $item->fax); ?><br>
<?php endif; ?>
<?php if ($this->params->get('show_position_headings') && !empty($item->con_position)) : ?>
<?php echo $item->con_position; ?><br>
<?php endif; ?>
<?php if ($this->params->get('show_email_headings') && !empty($item->email_to)) : ?>
<?php echo $item->email_to; ?><br>
<?php endif; ?>
<?php $location = []; ?>
<?php if ($this->params->get('show_suburb_headings') && !empty($item->suburb)) : ?>
<?php $location[] = $item->suburb; ?>
<?php endif; ?>
<?php if ($this->params->get('show_state_headings') && !empty($item->state)) : ?>
<?php $location[] = $item->state; ?>
<?php endif; ?>
<?php if ($this->params->get('show_country_headings') && !empty($item->country)) : ?>
<?php $location[] = $item->country; ?>
<?php endif; ?>
<?php echo implode(', ', $location); ?>
<?php echo $item->event->afterDisplayContent; ?>
<?php if ($canEdit || ($canDo->get('core.edit.own') && $item->created_by === $userId)) : ?>
<br/>
<?php echo HTMLHelper::_('contacticon.edit', $item, $this->params); ?>
<br/>
<?php endif; ?>
</div>
</li>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<?php if ($canDo->get('core.create')) : ?>
<?php echo HTMLHelper::_('contacticon.create', $this->category, $this->category->params); ?>
<?php endif; ?>
<?php if ($this->params->get('show_pagination', 2)) : ?>
<div class="com-contact-category__pagination w-100">
<?php if ($this->params->def('show_pagination_results', 1)) : ?>
<p class="com-contact-category__counter counter float-end pt-3 pe-2">
<?php echo $this->pagination->getPagesCounter(); ?>
</p>
<?php endif; ?>
<?php echo $this->pagination->getPagesLinks(); ?>
</div>
<?php endif; ?>
<div>
<input type="hidden" name="filter_order" value="<?php echo $this->escape($this->state->get('list.ordering')); ?>">
<input type="hidden" name="filter_order_Dir" value="<?php echo $this->escape($this->state->get('list.direction')); ?>">
</div>
</form>
</div>

View File

@ -0,0 +1,191 @@
<?php
/**
* @package Joomla.Site
* @subpackage com_contact
*
* @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Helper\ContentHelper;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\FileLayout;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\CMS\Router\Route;
use Joomla\Component\Contact\Site\Helper\RouteHelper;
/** @var \Joomla\Component\Contact\Site\View\Contact\HtmlView $this */
$tparams = $this->item->params;
$canDo = ContentHelper::getActions('com_contact', 'category', $this->item->catid);
$canEdit = $canDo->get('core.edit') || ($canDo->get('core.edit.own') && $this->item->created_by === $this->getCurrentUser()->id);
$htag = $tparams->get('show_page_heading') ? 'h2' : 'h1';
$htag2 = ($tparams->get('show_page_heading') && $tparams->get('show_name')) ? 'h3' : 'h2';
?>
<div class="com-contact contact">
<?php if ($tparams->get('show_page_heading')) : ?>
<h1>
<?php echo $this->escape($tparams->get('page_heading')); ?>
</h1>
<?php endif; ?>
<?php if ($this->item->name && $tparams->get('show_name')) : ?>
<div class="page-header">
<<?php echo $htag; ?>>
<?php if ($this->item->published == 0) : ?>
<span class="badge bg-warning text-light"><?php echo Text::_('JUNPUBLISHED'); ?></span>
<?php endif; ?>
<span class="contact-name"><?php echo $this->item->name; ?></span>
</<?php echo $htag; ?>>
</div>
<?php endif; ?>
<?php if ($canEdit) : ?>
<div class="icons">
<div class="float-end">
<div>
<?php echo HTMLHelper::_('contacticon.edit', $this->item, $tparams); ?>
</div>
</div>
</div>
<?php endif; ?>
<?php $show_contact_category = $tparams->get('show_contact_category'); ?>
<?php if ($show_contact_category === 'show_no_link') : ?>
<<?php echo $htag2; ?>>
<span class="contact-category"><?php echo $this->item->category_title; ?></span>
</<?php echo $htag2; ?>>
<?php elseif ($show_contact_category === 'show_with_link') : ?>
<?php $contactLink = RouteHelper::getCategoryRoute($this->item->catid, $this->item->language); ?>
<<?php echo $htag2; ?>>
<span class="contact-category"><a href="<?php echo $contactLink; ?>">
<?php echo $this->escape($this->item->category_title); ?></a>
</span>
</<?php echo $htag2; ?>>
<?php endif; ?>
<?php echo $this->item->event->afterDisplayTitle; ?>
<?php if ($tparams->get('show_contact_list') && count($this->contacts) > 1) : ?>
<form action="#" method="get" name="selectForm" id="selectForm">
<label for="select_contact"><?php echo Text::_('COM_CONTACT_SELECT_CONTACT'); ?></label>
<?php echo HTMLHelper::_(
'select.genericlist',
$this->contacts,
'select_contact',
'class="form-select" onchange="document.location.href = this.value"',
'link',
'name',
$this->item->link
);
?>
</form>
<?php endif; ?>
<?php if ($tparams->get('show_tags', 1) && !empty($this->item->tags->itemTags)) : ?>
<div class="com-contact__tags">
<?php $this->item->tagLayout = new FileLayout('joomla.content.tags'); ?>
<?php echo $this->item->tagLayout->render($this->item->tags->itemTags); ?>
</div>
<?php endif; ?>
<?php echo $this->item->event->beforeDisplayContent; ?>
<?php if ($this->params->get('show_info', 1)) : ?>
<div class="com-contact__container">
<?php echo '<' . $htag2 . '>' . Text::_('COM_CONTACT_DETAILS') . '</' . $htag2 . '>'; ?>
<?php if ($this->item->image && $tparams->get('show_image')) : ?>
<div class="com-contact__thumbnail thumbnail">
<?php echo LayoutHelper::render(
'joomla.html.image',
[
'src' => $this->item->image,
'alt' => $this->item->name,
]
); ?>
</div>
<?php endif; ?>
<?php if ($this->item->con_position && $tparams->get('show_position')) : ?>
<dl class="com-contact__position contact-position dl-horizontal">
<dt><?php echo Text::_('COM_CONTACT_POSITION'); ?>:</dt>
<dd>
<?php echo $this->item->con_position; ?>
</dd>
</dl>
<?php endif; ?>
<div class="com-contact__info">
<?php echo $this->loadTemplate('address'); ?>
<?php if ($tparams->get('allow_vcard')) : ?>
<?php echo Text::_('COM_CONTACT_DOWNLOAD_INFORMATION_AS'); ?>
<a href="<?php echo Route::_('index.php?option=com_contact&view=contact&catid=' . $this->item->catslug . '&id=' . $this->item->slug . '&format=vcf'); ?>">
<?php echo Text::_('COM_CONTACT_VCARD'); ?></a>
<?php endif; ?>
</div>
</div>
<?php endif; ?>
<?php if ($tparams->get('show_email_form') && ($this->item->email_to || $this->item->user_id)) : ?>
<?php echo '<' . $htag2 . '>' . Text::_('COM_CONTACT_EMAIL_FORM') . '</' . $htag2 . '>'; ?>
<?php echo $this->loadTemplate('form'); ?>
<?php endif; ?>
<?php if ($tparams->get('show_links')) : ?>
<?php echo '<' . $htag2 . '>' . Text::_('COM_CONTACT_LINKS') . '</' . $htag2 . '>'; ?>
<?php echo $this->loadTemplate('links'); ?>
<?php endif; ?>
<?php if ($tparams->get('show_articles') && $this->item->user_id && $this->item->articles) : ?>
<?php echo '<' . $htag2 . '>' . Text::_('JGLOBAL_ARTICLES') . '</' . $htag2 . '>'; ?>
<?php echo $this->loadTemplate('articles'); ?>
<?php endif; ?>
<?php if ($tparams->get('show_profile') && $this->item->user_id && PluginHelper::isEnabled('user', 'profile')) : ?>
<?php echo '<' . $htag2 . '>' . Text::_('COM_CONTACT_PROFILE') . '</' . $htag2 . '>'; ?>
<?php echo $this->loadTemplate('profile'); ?>
<?php endif; ?>
<?php if ($tparams->get('show_user_custom_fields') && $this->contactUser) : ?>
<?php echo $this->loadTemplate('user_custom_fields'); ?>
<?php endif; ?>
<?php if ($this->item->misc && $tparams->get('show_misc')) : ?>
<?php echo '<' . $htag2 . '>' . Text::_('COM_CONTACT_OTHER_INFORMATION') . '</' . $htag2 . '>'; ?>
<div class="com-contact__miscinfo contact-miscinfo">
<dl class="dl-horizontal">
<dt>
<?php if (!$this->params->get('marker_misc')) : ?>
<span class="icon-info-circle" aria-hidden="true"></span>
<span class="visually-hidden"><?php echo Text::_('COM_CONTACT_OTHER_INFORMATION'); ?></span>
<?php else : ?>
<span class="<?php echo $this->params->get('marker_class'); ?>">
<?php echo $this->params->get('marker_misc'); ?>
</span>
<?php endif; ?>
</dt>
<dd>
<span class="contact-misc">
<?php echo $this->item->misc; ?>
</span>
</dd>
</dl>
</div>
<?php endif; ?>
<?php echo $this->item->event->afterDisplayContent; ?>
</div>

View File

@ -0,0 +1,160 @@
<?php
/**
* @package Joomla.Site
* @subpackage com_contact
*
* @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\Language\Text;
use Joomla\CMS\String\PunycodeHelper;
/** @var \Joomla\Component\Contact\Site\View\Contact\HtmlView $this */
$icon = $this->params->get('contact_icons') == 0;
/**
* Marker_class: Class based on the selection of text, none, or icons
* jicon-text, jicon-none, jicon-icon
*/
?>
<dl class="com-contact__address contact-address dl-horizontal">
<?php
if (
($this->params->get('address_check') > 0) &&
($this->item->address || $this->item->suburb || $this->item->state || $this->item->country || $this->item->postcode)
) : ?>
<dt>
<?php if ($icon && !$this->params->get('marker_address')) : ?>
<span class="icon-address" aria-hidden="true"></span><span class="visually-hidden"><?php echo Text::_('COM_CONTACT_ADDRESS'); ?></span>
<?php else : ?>
<span class="<?php echo $this->params->get('marker_class'); ?>">
<?php echo $this->params->get('marker_address'); ?>
</span>
<?php endif; ?>
</dt>
<?php if ($this->item->address && $this->params->get('show_street_address')) : ?>
<dd>
<span class="contact-street">
<?php echo nl2br($this->item->address, false); ?>
</span>
</dd>
<?php endif; ?>
<?php if ($this->item->suburb && $this->params->get('show_suburb')) : ?>
<dd>
<span class="contact-suburb">
<?php echo $this->item->suburb; ?>
</span>
</dd>
<?php endif; ?>
<?php if ($this->item->state && $this->params->get('show_state')) : ?>
<dd>
<span class="contact-state">
<?php echo $this->item->state; ?>
</span>
</dd>
<?php endif; ?>
<?php if ($this->item->postcode && $this->params->get('show_postcode')) : ?>
<dd>
<span class="contact-postcode">
<?php echo $this->item->postcode; ?>
</span>
</dd>
<?php endif; ?>
<?php if ($this->item->country && $this->params->get('show_country')) : ?>
<dd>
<span class="contact-country">
<?php echo $this->item->country; ?>
</span>
</dd>
<?php endif; ?>
<?php endif; ?>
<?php if ($this->item->email_to && $this->params->get('show_email')) : ?>
<dt>
<?php if ($icon && !$this->params->get('marker_email')) : ?>
<span class="icon-envelope" aria-hidden="true"></span><span class="visually-hidden"><?php echo Text::_('COM_CONTACT_EMAIL_LABEL'); ?></span>
<?php else : ?>
<span class="<?php echo $this->params->get('marker_class'); ?>">
<?php echo $this->params->get('marker_email'); ?>
</span>
<?php endif; ?>
</dt>
<dd>
<span class="contact-emailto">
<?php echo $this->item->email_to; ?>
</span>
</dd>
<?php endif; ?>
<?php if ($this->item->telephone && $this->params->get('show_telephone')) : ?>
<dt>
<?php if ($icon && !$this->params->get('marker_telephone')) : ?>
<span class="icon-phone" aria-hidden="true"></span><span class="visually-hidden"><?php echo Text::_('COM_CONTACT_TELEPHONE'); ?></span>
<?php else : ?>
<span class="<?php echo $this->params->get('marker_class'); ?>">
<?php echo $this->params->get('marker_telephone'); ?>
</span>
<?php endif; ?>
</dt>
<dd>
<span class="contact-telephone">
<?php echo $this->item->telephone; ?>
</span>
</dd>
<?php endif; ?>
<?php if ($this->item->fax && $this->params->get('show_fax')) : ?>
<dt>
<?php if ($icon && !$this->params->get('marker_fax')) : ?>
<span class="icon-fax" aria-hidden="true"></span><span class="visually-hidden"><?php echo Text::_('COM_CONTACT_FAX'); ?></span>
<?php else : ?>
<span class="<?php echo $this->params->get('marker_class'); ?>">
<?php echo $this->params->get('marker_fax'); ?>
</span>
<?php endif; ?>
</dt>
<dd>
<span class="contact-fax">
<?php echo $this->item->fax; ?>
</span>
</dd>
<?php endif; ?>
<?php if ($this->item->mobile && $this->params->get('show_mobile')) : ?>
<dt>
<?php if ($icon && !$this->params->get('marker_mobile')) : ?>
<span class="icon-mobile" aria-hidden="true"></span><span class="visually-hidden"><?php echo Text::_('COM_CONTACT_MOBILE'); ?></span>
<?php else : ?>
<span class="<?php echo $this->params->get('marker_class'); ?>">
<?php echo $this->params->get('marker_mobile'); ?>
</span>
<?php endif; ?>
</dt>
<dd>
<span class="contact-mobile">
<?php echo $this->item->mobile; ?>
</span>
</dd>
<?php endif; ?>
<?php if ($this->item->webpage && $this->params->get('show_webpage')) : ?>
<dt>
<?php if ($icon && !$this->params->get('marker_webpage')) : ?>
<span class="icon-home" aria-hidden="true"></span><span class="visually-hidden"><?php echo Text::_('COM_CONTACT_WEBPAGE'); ?></span>
<?php else : ?>
<span class="<?php echo $this->params->get('marker_class'); ?>">
<?php echo $this->params->get('marker_webpage'); ?>
</span>
<?php endif; ?>
</dt>
<dd>
<span class="contact-webpage">
<a href="<?php echo $this->item->webpage; ?>" target="_blank" rel="noopener noreferrer">
<?php echo $this->escape(PunycodeHelper::urlToUTF8($this->item->webpage)); ?></a>
</span>
</dd>
<?php endif; ?>
</dl>

View File

@ -0,0 +1,29 @@
<?php
/**
* @package Joomla.Site
* @subpackage com_contact
*
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Router\Route;
use Joomla\Component\Content\Site\Helper\RouteHelper;
/** @var \Joomla\Component\Contact\Site\View\Contact\HtmlView $this */
?>
<?php if ($this->params->get('show_articles')) : ?>
<div class="com-contact__articles contact-articles">
<ul class="list-unstyled">
<?php foreach ($this->item->articles as $article) : ?>
<li>
<?php echo HTMLHelper::_('link', Route::_(RouteHelper::getArticleRoute($article->slug, $article->catid, $article->language)), htmlspecialchars($article->title, ENT_COMPAT, 'UTF-8')); ?>
</li>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>

View File

@ -0,0 +1,56 @@
<?php
/**
* @package Joomla.Site
* @subpackage com_contact
*
* @copyright (C) 2006 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
/** @var \Joomla\Component\Contact\Site\View\Contact\HtmlView $this */
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->getDocument()->getWebAssetManager();
$wa->useScript('keepalive')
->useScript('form.validate');
?>
<div class="com-contact__form contact-form">
<form id="contact-form" action="<?php echo Route::_('index.php'); ?>" method="post" class="form-validate form-horizontal well">
<?php foreach ($this->form->getFieldsets() as $fieldset) : ?>
<?php if ($fieldset->name === 'captcha' && $this->captchaEnabled) : ?>
<?php continue; ?>
<?php endif; ?>
<?php $fields = $this->form->getFieldset($fieldset->name); ?>
<?php if (count($fields)) : ?>
<fieldset class="m-0">
<?php if (isset($fieldset->label) && ($legend = trim(Text::_($fieldset->label))) !== '') : ?>
<legend><?php echo $legend; ?></legend>
<?php endif; ?>
<?php foreach ($fields as $field) : ?>
<?php echo $field->renderField(); ?>
<?php endforeach; ?>
</fieldset>
<?php endif; ?>
<?php endforeach; ?>
<?php if ($this->captchaEnabled) : ?>
<?php echo $this->form->renderFieldset('captcha'); ?>
<?php endif; ?>
<div class="control-group">
<div class="controls">
<button class="btn btn-primary validate" type="submit"><?php echo Text::_('COM_CONTACT_CONTACT_SEND'); ?></button>
<input type="hidden" name="option" value="com_contact">
<input type="hidden" name="task" value="contact.submit">
<input type="hidden" name="return" value="<?php echo $this->return_page; ?>">
<input type="hidden" name="id" value="<?php echo $this->item->slug; ?>">
<?php echo HTMLHelper::_('form.token'); ?>
</div>
</div>
</form>
</div>

View File

@ -0,0 +1,40 @@
<?php
/**
* @package Joomla.Site
* @subpackage com_contact
*
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/** @var \Joomla\Component\Contact\Site\View\Contact\HtmlView $this */
?>
<div class="com-contact__links contact-links">
<ul class="list-unstyled">
<?php
// Letters 'a' to 'e'
foreach (range('a', 'e') as $char) :
$link = $this->item->params->get('link' . $char);
$label = $this->item->params->get('link' . $char . '_name');
if (!$link) :
continue;
endif;
// Add 'http://' if not present
$link = (0 === strpos($link, 'http')) ? $link : 'http://' . $link;
// If no label is present, take the link
$label = $label ?: $link;
?>
<li>
<a href="<?php echo $link; ?>" rel="noopener noreferrer">
<?php echo $label; ?>
</a>
</li>
<?php endforeach; ?>
</ul>
</div>

View File

@ -0,0 +1,52 @@
<?php
/**
* @package Joomla.Site
* @subpackage com_contact
*
* @copyright (C) 2009 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Plugin\PluginHelper;
use Joomla\CMS\String\PunycodeHelper;
/** @var \Joomla\Component\Contact\Site\View\Contact\HtmlView $this */
?>
<?php if (PluginHelper::isEnabled('user', 'profile')) :
$fields = $this->item->profile->getFieldset('profile'); ?>
<div class="com-contact__profile contact-profile" id="users-profile-custom">
<dl class="dl-horizontal">
<?php foreach ($fields as $profile) :
if ($profile->value) :
echo '<dt>' . $profile->label . '</dt>';
$profile->text = htmlspecialchars($profile->value, ENT_COMPAT, 'UTF-8');
switch ($profile->id) :
case 'profile_website':
$v_http = substr($profile->value, 0, 4);
if ($v_http === 'http') :
echo '<dd><a href="' . $profile->text . '">' . $this->escape(PunycodeHelper::urlToUTF8($profile->text)) . '</a></dd>';
else :
echo '<dd><a href="http://' . $profile->text . '">' . $this->escape(PunycodeHelper::urlToUTF8($profile->text)) . '</a></dd>';
endif;
break;
case 'profile_dob':
echo '<dd>' . HTMLHelper::_('date', $profile->text, Text::_('DATE_FORMAT_LC4'), false) . '</dd>';
break;
default:
echo '<dd>' . $profile->text . '</dd>';
break;
endswitch;
endif;
endforeach; ?>
</dl>
</div>
<?php endif; ?>

View File

@ -0,0 +1,52 @@
<?php
/**
* @package Joomla.Site
* @subpackage com_contact
*
* @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\Application\ApplicationHelper;
use Joomla\CMS\Language\Text;
/** @var \Joomla\Component\Contact\Site\View\Contact\HtmlView $this */
$params = $this->item->params;
$displayGroups = $params->get('show_user_custom_fields');
$userFieldGroups = [];
?>
<?php if (!$displayGroups || !$this->contactUser) : ?>
<?php return; ?>
<?php endif; ?>
<?php foreach ($this->contactUser->jcfields as $field) : ?>
<?php if ($field->value && (in_array('-1', $displayGroups) || in_array($field->group_id, $displayGroups))) : ?>
<?php $userFieldGroups[$field->group_title][] = $field; ?>
<?php endif; ?>
<?php endforeach; ?>
<?php foreach ($userFieldGroups as $groupTitle => $fields) : ?>
<?php $id = ApplicationHelper::stringURLSafe($groupTitle); ?>
<?php echo '<h3>' . ($groupTitle ?: Text::_('COM_CONTACT_USER_FIELDS')) . '</h3>'; ?>
<div class="com-contact__user-fields contact-profile" id="user-custom-fields-<?php echo $id; ?>">
<dl class="dl-horizontal">
<?php foreach ($fields as $field) : ?>
<?php if (!$field->value) : ?>
<?php continue; ?>
<?php endif; ?>
<?php if ($field->params->get('showlabel')) : ?>
<?php echo '<dt>' . Text::_($field->label) . '</dt>'; ?>
<?php endif; ?>
<?php echo '<dd>' . $field->value . '</dd>'; ?>
<?php endforeach; ?>
</dl>
</div>
<?php endforeach; ?>

View File

@ -0,0 +1,35 @@
<?php
/**
* @package Joomla.Site
* @subpackage com_contact
*
* @copyright (C) 2010 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/** @var \Joomla\Component\Contact\Site\View\Featured\HtmlView $this */
?>
<div class="com-contact-featured blog-featured">
<?php if ($this->params->get('show_page_heading') != 0) : ?>
<h1>
<?php echo $this->escape($this->params->get('page_heading')); ?>
</h1>
<?php endif; ?>
<?php echo $this->loadTemplate('items'); ?>
<?php if ($this->params->def('show_pagination', 2) == 1 || ($this->params->get('show_pagination') == 2 && $this->pagination->pagesTotal > 1)) : ?>
<div class="com-contact-featured__pagination w-100">
<?php if ($this->params->def('show_pagination_results', 1)) : ?>
<p class="counter float-end pt-3 pe-2">
<?php echo $this->pagination->getPagesCounter(); ?>
</p>
<?php endif; ?>
<?php echo $this->pagination->getPagesLinks(); ?>
</div>
<?php endif; ?>
</div>

View File

@ -0,0 +1,199 @@
<?php
/**
* @package Joomla.Site
* @subpackage com_contact
*
* @copyright (C) 2010 Open Source Matters, Inc. <https://www.joomla.org>
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Router\Route;
use Joomla\CMS\Uri\Uri;
use Joomla\Component\Contact\Site\Helper\RouteHelper;
/** @var \Joomla\Component\Contact\Site\View\Featured\HtmlView $this */
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->getDocument()->getWebAssetManager();
$wa->useScript('com_contact.contacts-list')
->useScript('core');
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
?>
<div class="com-contact-featured__items">
<form action="<?php echo htmlspecialchars(Uri::getInstance()->toString()); ?>" method="post" name="adminForm" id="adminForm">
<?php if ($this->params->get('filter_field')) : ?>
<div class="com-contact-featured__filter btn-group">
<label class="filter-search-lbl visually-hidden" for="filter-search">
<?php echo Text::_('COM_CONTACT_FILTER_SEARCH_DESC'); ?>
</label>
<input
type="text"
name="filter-search"
id="filter-search"
value="<?php echo $this->escape($this->state->get('list.filter')); ?>"
class="inputbox" onchange="document.adminForm.submit();"
placeholder="<?php echo Text::_('COM_CONTACT_FILTER_SEARCH_DESC'); ?>"
>
<button type="submit" name="filter_submit" class="btn btn-primary"><?php echo Text::_('JGLOBAL_FILTER_BUTTON'); ?></button>
<button type="reset" name="filter-clear-button" class="btn btn-secondary"><?php echo Text::_('JSEARCH_FILTER_CLEAR'); ?></button>
</div>
<?php endif; ?>
<?php if ($this->params->get('show_pagination_limit')) : ?>
<div class="com-contact-featured__pagination btn-group float-end">
<label for="limit" class="visually-hidden">
<?php echo Text::_('JGLOBAL_DISPLAY_NUM'); ?>
</label>
<?php echo $this->pagination->getLimitBox(); ?>
</div>
<?php endif; ?>
<?php if (empty($this->items)) : ?>
<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 Text::_('COM_CONTACT_NO_CONTACTS'); ?>
</div>
<?php else : ?>
<table class="com-contact-featured__table table table-striped table-bordered table-hover">
<caption class="visually-hidden">
<?php echo Text::_('COM_CONTACT_TABLE_CAPTION'); ?>,
</caption>
<thead<?php echo $this->params->get('show_headings', '1') ? '' : ' class="visually-hidden"'; ?>>
<tr>
<th scope="col" class="item-title">
<?php echo HTMLHelper::_('grid.sort', 'JGLOBAL_TITLE', 'a.name', $listDirn, $listOrder); ?>
</th>
<?php if ($this->params->get('show_position_headings')) : ?>
<th scope="col" class="item-position">
<?php echo HTMLHelper::_('grid.sort', 'COM_CONTACT_POSITION', 'a.con_position', $listDirn, $listOrder); ?>
</th>
<?php endif; ?>
<?php if ($this->params->get('show_email_headings')) : ?>
<th scope="col" class="item-email">
<?php echo Text::_('JGLOBAL_EMAIL'); ?>
</th>
<?php endif; ?>
<?php if ($this->params->get('show_telephone_headings')) : ?>
<th scope="col" class="item-phone">
<?php echo Text::_('COM_CONTACT_TELEPHONE'); ?>
</th>
<?php endif; ?>
<?php if ($this->params->get('show_mobile_headings')) : ?>
<th scope="col" class="item-phone">
<?php echo Text::_('COM_CONTACT_MOBILE'); ?>
</th>
<?php endif; ?>
<?php if ($this->params->get('show_fax_headings')) : ?>
<th scope="col" class="item-phone">
<?php echo Text::_('COM_CONTACT_FAX'); ?>
</th>
<?php endif; ?>
<?php if ($this->params->get('show_suburb_headings')) : ?>
<th scope="col" class="item-suburb">
<?php echo HTMLHelper::_('grid.sort', 'COM_CONTACT_SUBURB', 'a.suburb', $listDirn, $listOrder); ?>
</th>
<?php endif; ?>
<?php if ($this->params->get('show_state_headings')) : ?>
<th scope="col" class="item-state">
<?php echo HTMLHelper::_('grid.sort', 'COM_CONTACT_STATE', 'a.state', $listDirn, $listOrder); ?>
</th>
<?php endif; ?>
<?php if ($this->params->get('show_country_headings')) : ?>
<th scope="col" class="item-state">
<?php echo HTMLHelper::_('grid.sort', 'COM_CONTACT_COUNTRY', 'a.country', $listDirn, $listOrder); ?>
</th>
<?php endif; ?>
</tr>
</thead>
<tbody>
<?php foreach ($this->items as $i => $item) : ?>
<?php if ($this->items[$i]->published == 0) : ?>
<tr class="system-unpublished featured-list-row<?php echo $i % 2; ?>">
<?php else : ?>
<tr class="featured-list-row<?php echo $i % 2; ?>">
<?php endif; ?>
<th scope="row" class="list-title">
<a href="<?php echo Route::_(RouteHelper::getContactRoute($item->slug, $item->catid, $item->language)); ?>">
<span><?php echo $this->escape($item->name); ?></span>
</a>
<?php if ($item->published == 0) : ?>
<div>
<span class="list-published badge bg-warning text-light">
<?php echo Text::_('JUNPUBLISHED'); ?>
</span>
</div>
<?php endif; ?>
</th>
<?php if ($this->params->get('show_position_headings')) : ?>
<td class="item-position">
<?php echo $item->con_position; ?>
</td>
<?php endif; ?>
<?php if ($this->params->get('show_email_headings')) : ?>
<td class="item-email">
<?php echo $item->email_to; ?>
</td>
<?php endif; ?>
<?php if ($this->params->get('show_telephone_headings')) : ?>
<td class="item-phone">
<?php echo $item->telephone; ?>
</td>
<?php endif; ?>
<?php if ($this->params->get('show_mobile_headings')) : ?>
<td class="item-phone">
<?php echo $item->mobile; ?>
</td>
<?php endif; ?>
<?php if ($this->params->get('show_fax_headings')) : ?>
<td class="item-phone">
<?php echo $item->fax; ?>
</td>
<?php endif; ?>
<?php if ($this->params->get('show_suburb_headings')) : ?>
<td class="item-suburb">
<span><?php echo $item->suburb; ?></span>
</td>
<?php endif; ?>
<?php if ($this->params->get('show_state_headings')) : ?>
<td class="item-state">
<span><?php echo $item->state; ?></span>
</td>
<?php endif; ?>
<?php if ($this->params->get('show_country_headings')) : ?>
<td class="item-state">
<span><?php echo $item->country; ?></span>
</td>
<?php endif; ?>
<?php endforeach; ?>
</tbody>
</table>
<?php endif; ?>
<div>
<input type="hidden" name="filter_order" value="<?php echo $this->escape($this->state->get('list.ordering')); ?>">
<input type="hidden" name="filter_order_Dir" value="<?php echo $this->escape($this->state->get('list.direction')); ?>">
</div>
</form>
</div>

View File

@ -0,0 +1,85 @@
<?php
/**
* @package Joomla.Site
* @subpackage com_contact
*
* @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\HTML\HTMLHelper;
use Joomla\CMS\Language\Multilanguage;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\LayoutHelper;
use Joomla\CMS\Router\Route;
/** @var \Joomla\Component\Contact\Site\View\Form\HtmlView $this */
/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $this->getDocument()->getWebAssetManager();
$wa->useScript('keepalive')
->useScript('form.validate');
$this->tab_name = 'com-contact-form';
$this->ignore_fieldsets = ['details', 'item_associations', 'language'];
$this->useCoreUI = true;
?>
<div class="edit item-page<?php echo $this->pageclass_sfx; ?>">
<?php if ($this->params->get('show_page_heading')) : ?>
<div class="page-header">
<h1>
<?php echo $this->escape($this->params->get('page_heading')); ?>
</h1>
</div>
<?php endif; ?>
<form action="<?php echo Route::_('index.php?option=com_contact&id=' . (int) $this->item->id); ?>" method="post"
name="adminForm" id="adminForm" class="form-validate form-vertical">
<fieldset>
<?php echo HTMLHelper::_('uitab.startTabSet', $this->tab_name, ['active' => 'details', 'recall' => true, 'breakpoint' => 768]); ?>
<?php echo HTMLHelper::_('uitab.addTab', $this->tab_name, 'details', empty($this->item->id) ? Text::_('COM_CONTACT_NEW_CONTACT') : Text::_('COM_CONTACT_EDIT_CONTACT')); ?>
<?php echo $this->form->renderField('name'); ?>
<?php if (is_null($this->item->id)) : ?>
<?php echo $this->form->renderField('alias'); ?>
<?php endif; ?>
<?php echo $this->form->renderFieldset('details'); ?>
<?php echo HTMLHelper::_('uitab.endTab'); ?>
<?php echo HTMLHelper::_('uitab.addTab', $this->tab_name, 'misc', Text::_('COM_CONTACT_FIELDSET_MISCELLANEOUS')); ?>
<?php echo $this->form->getInput('misc'); ?>
<?php echo HTMLHelper::_('uitab.endTab'); ?>
<?php if (Multilanguage::isEnabled()) : ?>
<?php echo HTMLHelper::_('uitab.addTab', $this->tab_name, 'language', Text::_('JFIELD_LANGUAGE_LABEL')); ?>
<?php echo $this->form->renderField('language'); ?>
<?php echo HTMLHelper::_('uitab.endTab'); ?>
<?php else : ?>
<?php echo $this->form->renderField('language'); ?>
<?php endif; ?>
<?php echo LayoutHelper::render('joomla.edit.params', $this); ?>
<?php echo HTMLHelper::_('uitab.endTabSet'); ?>
<input type="hidden" name="task" value=""/>
<input type="hidden" name="return" value="<?php echo $this->return_page; ?>"/>
<?php echo HTMLHelper::_('form.token'); ?>
</fieldset>
<div class="d-grid gap-2 d-sm-block mb-2">
<button type="button" class="btn btn-primary" onclick="Joomla.submitbutton('contact.save')">
<span class="icon-check" aria-hidden="true"></span>
<?php echo Text::_('JSAVE'); ?>
</button>
<button type="button" class="btn btn-danger" onclick="Joomla.submitbutton('contact.cancel')">
<span class="icon-times" aria-hidden="true"></span>
<?php echo Text::_('JCANCEL'); ?>
</button>
<?php if ($this->params->get('save_history', 0) && $this->item->id) : ?>
<?php echo $this->form->getInput('contenthistory'); ?>
<?php endif; ?>
</div>
</form>
</div>