first commit
This commit is contained in:
190
components/com_contact/tmpl/contact/default.php
Normal file
190
components/com_contact/tmpl/contact/default.php
Normal file
@ -0,0 +1,190 @@
|
||||
<?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;
|
||||
|
||||
$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>
|
||||
463
components/com_contact/tmpl/contact/default.xml
Normal file
463
components/com_contact/tmpl/contact/default.xml
Normal file
@ -0,0 +1,463 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<metadata>
|
||||
<layout title="COM_CONTACT_CONTACT_VIEW_DEFAULT_TITLE" option="COM_CONTACT_CONTACT_VIEW_DEFAULT_OPTION">
|
||||
<help
|
||||
key = "Menu_Item:_Single_Contact"
|
||||
/>
|
||||
<message>
|
||||
<![CDATA[COM_CONTACT_CONTACT_VIEW_DEFAULT_DESC]]>
|
||||
</message>
|
||||
</layout>
|
||||
|
||||
<!-- Add fields to the request variables for the layout. -->
|
||||
<fields name="request">
|
||||
<fieldset name="request"
|
||||
addfieldprefix="Joomla\Component\Contact\Administrator\Field"
|
||||
>
|
||||
<field
|
||||
name="id"
|
||||
type="modal_contact"
|
||||
label="COM_CONTACT_SELECT_CONTACT_LABEL"
|
||||
required="true"
|
||||
select="true"
|
||||
new="true"
|
||||
edit="true"
|
||||
clear="true"
|
||||
/>
|
||||
</fieldset>
|
||||
</fields>
|
||||
|
||||
<!-- Add fields to the parameters object for the layout. -->
|
||||
<fields name="params">
|
||||
|
||||
<!-- Basic options. -->
|
||||
<fieldset name="params"
|
||||
label="COM_CONTACT_BASIC_OPTIONS_FIELDSET_LABEL"
|
||||
>
|
||||
|
||||
<field
|
||||
name="show_contact_category"
|
||||
type="list"
|
||||
label="COM_CONTACT_FIELD_CONTACT_SHOW_CATEGORY_LABEL"
|
||||
useglobal="true"
|
||||
class="form-select-color-state"
|
||||
validate="options"
|
||||
>
|
||||
<option value="hide">JHIDE</option>
|
||||
<option value="show_no_link">COM_CONTACT_FIELD_VALUE_NO_LINK</option>
|
||||
<option value="show_with_link">COM_CONTACT_FIELD_VALUE_WITH_LINK</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="show_contact_list"
|
||||
type="list"
|
||||
label="COM_CONTACT_FIELD_CONTACT_SHOW_LIST_LABEL"
|
||||
useglobal="true"
|
||||
class="form-select-color-state"
|
||||
validate="options"
|
||||
>
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="show_name"
|
||||
type="list"
|
||||
label="COM_CONTACT_FIELD_PARAMS_NAME_LABEL"
|
||||
useglobal="true"
|
||||
class="form-select-color-state"
|
||||
validate="options"
|
||||
>
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="show_tags"
|
||||
type="list"
|
||||
label="COM_CONTACT_FIELD_SHOW_TAGS_LABEL"
|
||||
useglobal="true"
|
||||
class="form-select-color-state"
|
||||
validate="options"
|
||||
>
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="show_info"
|
||||
type="list"
|
||||
label="COM_CONTACT_FIELD_SHOW_INFO_LABEL"
|
||||
useglobal="true"
|
||||
class="form-select-color-state"
|
||||
validate="options"
|
||||
>
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="show_position"
|
||||
type="list"
|
||||
label="COM_CONTACT_FIELD_PARAMS_CONTACT_POSITION_LABEL"
|
||||
useglobal="true"
|
||||
showon="show_info:1"
|
||||
class="form-select-color-state"
|
||||
validate="options"
|
||||
>
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="show_email"
|
||||
type="list"
|
||||
label="JGLOBAL_EMAIL"
|
||||
useglobal="true"
|
||||
showon="show_info:1"
|
||||
class="form-select-color-state"
|
||||
validate="options"
|
||||
>
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="add_mailto_link"
|
||||
type="list"
|
||||
label="COM_CONTACT_FIELD_PARAMS_ADD_MAILTO_LINK_LABEL"
|
||||
useglobal="true"
|
||||
showon="show_info:1"
|
||||
class="form-select-color-state"
|
||||
validate="options"
|
||||
>
|
||||
<option value="1">JYES</option>
|
||||
<option value="0">JNO</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="show_street_address"
|
||||
type="list"
|
||||
label="COM_CONTACT_FIELD_PARAMS_STREET_ADDRESS_LABEL"
|
||||
useglobal="true"
|
||||
showon="show_info:1"
|
||||
class="form-select-color-state"
|
||||
validate="options"
|
||||
>
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="show_suburb"
|
||||
type="list"
|
||||
label="COM_CONTACT_FIELD_PARAMS_TOWN-SUBURB_LABEL"
|
||||
useglobal="true"
|
||||
showon="show_info:1"
|
||||
class="form-select-color-state"
|
||||
validate="options"
|
||||
>
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="show_state"
|
||||
type="list"
|
||||
label="COM_CONTACT_FIELD_PARAMS_STATE-COUNTY_LABEL"
|
||||
useglobal="true"
|
||||
showon="show_info:1"
|
||||
class="form-select-color-state"
|
||||
validate="options"
|
||||
>
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="show_postcode"
|
||||
type="list"
|
||||
label="COM_CONTACT_FIELD_PARAMS_POST-ZIP_CODE_LABEL"
|
||||
useglobal="true"
|
||||
showon="show_info:1"
|
||||
class="form-select-color-state"
|
||||
validate="options"
|
||||
>
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="show_country"
|
||||
type="list"
|
||||
label="COM_CONTACT_FIELD_PARAMS_COUNTRY_LABEL"
|
||||
useglobal="true"
|
||||
showon="show_info:1"
|
||||
class="form-select-color-state"
|
||||
validate="options"
|
||||
>
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="show_telephone"
|
||||
type="list"
|
||||
label="COM_CONTACT_FIELD_PARAMS_TELEPHONE_LABEL"
|
||||
useglobal="true"
|
||||
showon="show_info:1"
|
||||
class="form-select-color-state"
|
||||
validate="options"
|
||||
>
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="show_mobile"
|
||||
type="list"
|
||||
label="COM_CONTACT_FIELD_PARAMS_MOBILE_LABEL"
|
||||
useglobal="true"
|
||||
showon="show_info:1"
|
||||
class="form-select-color-state"
|
||||
validate="options"
|
||||
>
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="show_fax"
|
||||
type="list"
|
||||
label="COM_CONTACT_FIELD_PARAMS_FAX_LABEL"
|
||||
useglobal="true"
|
||||
showon="show_info:1"
|
||||
class="form-select-color-state"
|
||||
validate="options"
|
||||
>
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="show_webpage"
|
||||
type="list"
|
||||
label="COM_CONTACT_FIELD_PARAMS_WEBPAGE_LABEL"
|
||||
useglobal="true"
|
||||
showon="show_info:1"
|
||||
class="form-select-color-state"
|
||||
validate="options"
|
||||
>
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="show_image"
|
||||
type="list"
|
||||
label="COM_CONTACT_FIELD_PARAMS_IMAGE_LABEL"
|
||||
useglobal="true"
|
||||
showon="show_info:1"
|
||||
class="form-select-color-state"
|
||||
validate="options"
|
||||
>
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="allow_vcard"
|
||||
type="list"
|
||||
label="COM_CONTACT_FIELD_PARAMS_VCARD_LABEL"
|
||||
useglobal="true"
|
||||
class="form-select-color-state"
|
||||
validate="options"
|
||||
>
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="show_misc"
|
||||
type="list"
|
||||
label="COM_CONTACT_FIELD_PARAMS_MISC_INFO_LABEL"
|
||||
useglobal="true"
|
||||
class="form-select-color-state"
|
||||
validate="options"
|
||||
>
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="show_articles"
|
||||
type="list"
|
||||
label="COM_CONTACT_FIELD_ARTICLES_SHOW_LABEL"
|
||||
useglobal="true"
|
||||
class="form-select-color-state"
|
||||
validate="options"
|
||||
>
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="articles_display_num"
|
||||
type="list"
|
||||
label="COM_CONTACT_FIELD_ARTICLES_DISPLAY_NUM_LABEL"
|
||||
default=""
|
||||
useglobal="true"
|
||||
validate="options"
|
||||
>
|
||||
<option value="use_contact">COM_CONTACT_FIELD_VALUE_USE_CONTACT_SETTINGS</option>
|
||||
<option value="5">J5</option>
|
||||
<option value="10">J10</option>
|
||||
<option value="15">J15</option>
|
||||
<option value="20">J20</option>
|
||||
<option value="25">J25</option>
|
||||
<option value="30">J30</option>
|
||||
<option value="50">J50</option>
|
||||
<option value="75">J75</option>
|
||||
<option value="100">J100</option>
|
||||
<option value="150">J150</option>
|
||||
<option value="200">J200</option>
|
||||
<option value="250">J250</option>
|
||||
<option value="300">J300</option>
|
||||
<option value="0">JALL</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="show_profile"
|
||||
type="list"
|
||||
label="COM_CONTACT_FIELD_PROFILE_SHOW_LABEL"
|
||||
useglobal="true"
|
||||
class="form-select-color-state"
|
||||
validate="options"
|
||||
>
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="show_user_custom_fields"
|
||||
type="fieldgroups"
|
||||
label="COM_CONTACT_FIELD_USER_CUSTOM_FIELDS_SHOW_LABEL"
|
||||
multiple="true"
|
||||
context="com_users.user"
|
||||
addfieldprefix="Joomla\Component\Fields\Administrator\Field"
|
||||
layout="joomla.form.field.list-fancy-select"
|
||||
>
|
||||
<option value="-1">JALL</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="show_links"
|
||||
type="list"
|
||||
label="COM_CONTACT_FIELD_SHOW_LINKS_LABEL"
|
||||
useglobal="true"
|
||||
class="form-select-color-state"
|
||||
validate="options"
|
||||
>
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="linka_name"
|
||||
type="text"
|
||||
label="COM_CONTACT_FIELD_LINKA_NAME_LABEL"
|
||||
useglobal="true"
|
||||
/>
|
||||
|
||||
<field
|
||||
name="linkb_name"
|
||||
type="text"
|
||||
label="COM_CONTACT_FIELD_LINKB_NAME_LABEL"
|
||||
useglobal="true"
|
||||
/>
|
||||
|
||||
<field
|
||||
name="linkc_name"
|
||||
type="text"
|
||||
label="COM_CONTACT_FIELD_LINKC_NAME_LABEL"
|
||||
useglobal="true"
|
||||
/>
|
||||
|
||||
<field
|
||||
name="linkd_name"
|
||||
type="text"
|
||||
label="COM_CONTACT_FIELD_LINKD_NAME_LABEL"
|
||||
useglobal="true"
|
||||
/>
|
||||
|
||||
<field
|
||||
name="linke_name"
|
||||
type="text"
|
||||
label="COM_CONTACT_FIELD_LINKE_NAME_LABEL"
|
||||
useglobal="true"
|
||||
/>
|
||||
</fieldset>
|
||||
|
||||
<!-- Form options. -->
|
||||
<fieldset
|
||||
name="Contact_Form"
|
||||
label="COM_CONTACT_MAIL_FIELDSET_LABEL"
|
||||
>
|
||||
|
||||
<field
|
||||
name="show_email_form"
|
||||
type="list"
|
||||
label="COM_CONTACT_FIELD_EMAIL_SHOW_FORM_LABEL"
|
||||
useglobal="true"
|
||||
class="form-select-color-state"
|
||||
validate="options"
|
||||
>
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="show_email_copy"
|
||||
type="list"
|
||||
label="COM_CONTACT_FIELD_EMAIL_EMAIL_COPY_LABEL"
|
||||
useglobal="true"
|
||||
class="form-select-color-state"
|
||||
validate="options"
|
||||
>
|
||||
<option value="0">JHIDE</option>
|
||||
<option value="1">JSHOW</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="validate_session"
|
||||
type="list"
|
||||
label="COM_CONTACT_FIELD_CONFIG_SESSION_CHECK_LABEL"
|
||||
useglobal="true"
|
||||
class="form-select-color-state"
|
||||
validate="options"
|
||||
>
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="custom_reply"
|
||||
type="list"
|
||||
label="COM_CONTACT_FIELD_CONFIG_CUSTOM_REPLY_LABEL"
|
||||
useglobal="true"
|
||||
class="form-select-color-state"
|
||||
validate="options"
|
||||
>
|
||||
<option value="0">JNO</option>
|
||||
<option value="1">JYES</option>
|
||||
</field>
|
||||
|
||||
<field
|
||||
name="redirect"
|
||||
type="text"
|
||||
label="COM_CONTACT_FIELD_CONFIG_REDIRECT_LABEL"
|
||||
useglobal="true"
|
||||
/>
|
||||
</fieldset>
|
||||
</fields>
|
||||
</metadata>
|
||||
159
components/com_contact/tmpl/contact/default_address.php
Normal file
159
components/com_contact/tmpl/contact/default_address.php
Normal file
@ -0,0 +1,159 @@
|
||||
<?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;
|
||||
|
||||
$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 PunycodeHelper::urlToUTF8($this->item->webpage); ?></a>
|
||||
</span>
|
||||
</dd>
|
||||
<?php endif; ?>
|
||||
</dl>
|
||||
28
components/com_contact/tmpl/contact/default_articles.php
Normal file
28
components/com_contact/tmpl/contact/default_articles.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?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;
|
||||
|
||||
?>
|
||||
<?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; ?>
|
||||
55
components/com_contact/tmpl/contact/default_form.php
Normal file
55
components/com_contact/tmpl/contact/default_form.php
Normal file
@ -0,0 +1,55 @@
|
||||
<?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\CMS\WebAsset\WebAssetManager $wa */
|
||||
$wa = $this->document->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>
|
||||
41
components/com_contact/tmpl/contact/default_links.php
Normal file
41
components/com_contact/tmpl/contact/default_links.php
Normal file
@ -0,0 +1,41 @@
|
||||
<?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\Language\Text;
|
||||
|
||||
?>
|
||||
<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>
|
||||
51
components/com_contact/tmpl/contact/default_profile.php
Normal file
51
components/com_contact/tmpl/contact/default_profile.php
Normal file
@ -0,0 +1,51 @@
|
||||
<?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;
|
||||
|
||||
?>
|
||||
<?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 . '">' . PunycodeHelper::urlToUTF8($profile->text) . '</a></dd>';
|
||||
else :
|
||||
echo '<dd><a href="http://' . $profile->text . '">' . 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; ?>
|
||||
@ -0,0 +1,51 @@
|
||||
<?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;
|
||||
|
||||
$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; ?>
|
||||
Reference in New Issue
Block a user