first commit

This commit is contained in:
alazhar
2020-01-02 22:20:31 +07:00
commit 10eb3340ad
5753 changed files with 631345 additions and 0 deletions

View File

@ -0,0 +1 @@
<!DOCTYPE html><title></title>

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<metadata>
<view title="Contact">
<message><![CDATA[Choose a contact layout.]]></message>
</view>
</metadata>

View File

@ -0,0 +1,218 @@
<?php
/**
* @package Joomla.Site
* @subpackage com_contact
*
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
$cparams = JComponentHelper::getParams('com_media');
jimport('joomla.html.html.bootstrap');
?>
<div class="contact<?php echo $this->pageclass_sfx?>">
<?php if ($this->params->get('show_page_heading')) : ?>
<h1>
<?php echo $this->escape($this->params->get('page_heading')); ?>
</h1>
<?php endif; ?>
<?php if ($this->contact->name && $this->params->get('show_name')) : ?>
<div class="page-header">
<h2>
<?php if ($this->item->published == 0) : ?>
<span class="label label-warning"><?php echo JText::_('JUNPUBLISHED'); ?></span>
<?php endif; ?>
<span class="contact-name"><?php echo $this->contact->name; ?></span>
</h2>
</div>
<?php endif; ?>
<?php if ($this->params->get('show_contact_category') == 'show_no_link') : ?>
<h3>
<span class="contact-category"><?php echo $this->contact->category_title; ?></span>
</h3>
<?php endif; ?>
<?php if ($this->params->get('show_contact_category') == 'show_with_link') : ?>
<?php $contactLink = ContactHelperRoute::getCategoryRoute($this->contact->catid); ?>
<h3>
<span class="contact-category"><a href="<?php echo $contactLink; ?>">
<?php echo $this->escape($this->contact->category_title); ?></a>
</span>
</h3>
<?php endif; ?>
<?php if ($this->params->get('show_contact_list') && count($this->contacts) > 1) : ?>
<form action="#" method="get" name="selectForm" id="selectForm">
<?php echo JText::_('COM_CONTACT_SELECT_CONTACT'); ?>
<?php echo JHtml::_('select.genericlist', $this->contacts, 'id', 'class="inputbox" onchange="document.location.href = this.value"', 'link', 'name', $this->contact->link);?>
</form>
<?php endif; ?>
<?php if ($this->params->get('show_tags', 1) && !empty($this->item->tags)) : ?>
<?php $this->item->tagLayout = new JLayoutFile('joomla.content.tags'); ?>
<?php echo $this->item->tagLayout->render($this->item->tags->itemTags); ?>
<?php endif; ?>
<?php if ($this->params->get('presentation_style') == 'sliders') : ?>
<?php echo JHtml::_('bootstrap.startAccordion', 'slide-contact', array('active' => 'basic-details')); ?>
<?php endif; ?>
<?php if ($this->params->get('presentation_style') == 'tabs') : ?>
<?php echo JHtml::_('bootstrap.startTabSet', 'myTab', array('active' => 'basic-details')); ?>
<?php endif; ?>
<?php if ($this->params->get('presentation_style') == 'sliders') : ?>
<?php echo JHtml::_('bootstrap.addSlide', 'slide-contact', JText::_('COM_CONTACT_DETAILS'), 'basic-details'); ?>
<?php endif; ?>
<?php if ($this->params->get('presentation_style') == 'tabs') : ?>
<?php echo JHtml::_('bootstrap.addTab', 'myTab', 'basic-details', JText::_('COM_CONTACT_DETAILS', true)); ?>
<?php endif; ?>
<?php if ($this->params->get('presentation_style') == 'plain'):?>
<?php echo '<h3>'. JText::_('COM_CONTACT_DETAILS').'</h3>'; ?>
<?php endif; ?>
<?php if ($this->contact->image && $this->params->get('show_image')) : ?>
<div class="thumbnail pull-right">
<?php echo JHtml::_('image', $this->contact->image, JText::_('COM_CONTACT_IMAGE_DETAILS'), array('align' => 'middle')); ?>
</div>
<?php endif; ?>
<?php if ($this->contact->con_position && $this->params->get('show_position')) : ?>
<dl class="contact-position dl-horizontal">
<dd>
<?php echo $this->contact->con_position; ?>
</dd>
</dl>
<?php endif; ?>
<?php echo $this->loadTemplate('address'); ?>
<?php if ($this->params->get('allow_vcard')) : ?>
<?php echo JText::_('COM_CONTACT_DOWNLOAD_INFORMATION_AS');?>
<a href="<?php echo JRoute::_('index.php?option=com_contact&amp;view=contact&amp;id='.$this->contact->id . '&amp;format=vcf'); ?>">
<?php echo JText::_('COM_CONTACT_VCARD');?></a>
<?php endif; ?>
<?php if ($this->params->get('presentation_style') == 'sliders') : ?>
<?php echo JHtml::_('bootstrap.endSlide'); ?>
<?php endif; ?>
<?php if ($this->params->get('presentation_style') == 'tabs') : ?>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php endif; ?>
<?php if ($this->params->get('show_email_form') && ($this->contact->email_to || $this->contact->user_id)) : ?>
<?php if ($this->params->get('presentation_style') == 'sliders') : ?>
<?php echo JHtml::_('bootstrap.addSlide', 'slide-contact', JText::_('COM_CONTACT_EMAIL_FORM'), 'display-form'); ?>
<?php endif; ?>
<?php if ($this->params->get('presentation_style') == 'tabs') : ?>
<?php echo JHtml::_('bootstrap.addTab', 'myTab', 'display-form', JText::_('COM_CONTACT_EMAIL_FORM', true)); ?>
<?php endif; ?>
<?php if ($this->params->get('presentation_style') == 'plain'):?>
<?php echo '<h3>'. JText::_('COM_CONTACT_EMAIL_FORM').'</h3>'; ?>
<?php endif; ?>
<?php echo $this->loadTemplate('form'); ?>
<?php if ($this->params->get('presentation_style') == 'sliders') : ?>
<?php echo JHtml::_('bootstrap.endSlide'); ?>
<?php endif; ?>
<?php if ($this->params->get('presentation_style') == 'tabs') : ?>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php endif; ?>
<?php endif; ?>
<?php if ($this->params->get('show_links')) : ?>
<?php echo $this->loadTemplate('links'); ?>
<?php endif; ?>
<?php if ($this->params->get('show_articles') && $this->contact->user_id && $this->contact->articles) : ?>
<?php if ($this->params->get('presentation_style') == 'sliders') : ?>
<?php echo JHtml::_('bootstrap.addSlide', 'slide-contact', JText::_('JGLOBAL_ARTICLES'), 'display-articles'); ?>
<?php endif; ?>
<?php if ($this->params->get('presentation_style') == 'tabs') : ?>
<?php echo JHtml::_('bootstrap.addTab', 'myTab', 'display-articles', JText::_('JGLOBAL_ARTICLES', true)); ?>
<?php endif; ?>
<?php if ($this->params->get('presentation_style') == 'plain'):?>
<?php echo '<h3>'. JText::_('JGLOBAL_ARTICLES').'</h3>'; ?>
<?php endif; ?>
<?php echo $this->loadTemplate('articles'); ?>
<?php if ($this->params->get('presentation_style') == 'sliders') : ?>
<?php echo JHtml::_('bootstrap.endSlide'); ?>
<?php endif; ?>
<?php if ($this->params->get('presentation_style') == 'tabs') : ?>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php endif; ?>
<?php endif; ?>
<?php if ($this->params->get('show_profile') && $this->contact->user_id && JPluginHelper::isEnabled('user', 'profile')) : ?>
<?php if ($this->params->get('presentation_style') == 'sliders') : ?>
<?php echo JHtml::_('bootstrap.addSlide', 'slide-contact', JText::_('COM_CONTACT_PROFILE'), 'display-profile'); ?>
<?php endif; ?>
<?php if ($this->params->get('presentation_style') == 'tabs') : ?>
<?php echo JHtml::_('bootstrap.addTab', 'myTab', 'display-profile', JText::_('COM_CONTACT_PROFILE', true)); ?>
<?php endif; ?>
<?php if ($this->params->get('presentation_style') == 'plain'):?>
<?php echo '<h3>'. JText::_('COM_CONTACT_PROFILE').'</h3>'; ?>
<?php endif; ?>
<?php echo $this->loadTemplate('profile'); ?>
<?php if ($this->params->get('presentation_style') == 'sliders') : ?>
<?php echo JHtml::_('bootstrap.endSlide'); ?>
<?php endif; ?>
<?php if ($this->params->get('presentation_style') == 'tabs') : ?>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php endif; ?>
<?php endif; ?>
<?php if ($this->contact->misc && $this->params->get('show_misc')) : ?>
<?php if ($this->params->get('presentation_style') == 'sliders') : ?>
<?php echo JHtml::_('bootstrap.addSlide', 'slide-contact', JText::_('COM_CONTACT_OTHER_INFORMATION'), 'display-misc'); ?>
<?php endif; ?>
<?php if ($this->params->get('presentation_style') == 'tabs') : ?>
<?php echo JHtml::_('bootstrap.addTab', 'myTab', 'display-misc', JText::_('COM_CONTACT_OTHER_INFORMATION', true)); ?>
<?php endif; ?>
<?php if ($this->params->get('presentation_style') == 'plain'):?>
<?php echo '<h3>'. JText::_('COM_CONTACT_OTHER_INFORMATION').'</h3>'; ?>
<?php endif; ?>
<div class="contact-miscinfo">
<dl class="dl-horizontal">
<dt>
<span class="<?php echo $this->params->get('marker_class'); ?>">
<?php echo $this->params->get('marker_misc'); ?>
</span>
</dt>
<dd>
<span class="contact-misc">
<?php echo $this->contact->misc; ?>
</span>
</dd>
</dl>
</div>
<?php if ($this->params->get('presentation_style') == 'sliders') : ?>
<?php echo JHtml::_('bootstrap.endSlide'); ?>
<?php endif; ?>
<?php if ($this->params->get('presentation_style') == 'tabs') : ?>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php endif; ?>
<?php endif; ?>
<?php if ($this->params->get('presentation_style') == 'sliders') : ?>
<?php echo JHtml::_('bootstrap.endAccordion'); ?>
<?php endif; ?>
<?php if ($this->params->get('presentation_style') == 'tabs') : ?>
<?php echo JHtml::_('bootstrap.endTabSet'); ?>
<?php endif; ?>
</div>

View File

@ -0,0 +1,358 @@
<?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 = "JHELP_MENUS_MENU_ITEM_CONTACT_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"
addfieldpath="/administrator/components/com_contact/models/fields"
>
<field name="id"
type="modal_contact"
description="COM_CONTACT_SELECT_CONTACT_DESC"
label="COM_CONTACT_SELECT_CONTACT_LABEL"
required="true"
edit="true"
clear="false"
/>
</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="presentation_style"
type="list"
description="COM_CONTACT_FIELD_PRESENTATION_DESC"
label="COM_CONTACT_FIELD_PRESENTATION_LABEL"
>
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="sliders">COM_CONTACT_FIELD_VALUE_SLIDERS</option>
<option value="tabs">COM_CONTACT_FIELD_VALUE_TABS</option>
<option value="plain">COM_CONTACT_FIELD_VALUE_PLAIN</option>
</field>
<field name="show_contact_category"
type="list"
description="COM_CONTACT_FIELD_CONTACT_SHOW_CATEGORY_DESC"
label="COM_CONTACT_FIELD_CONTACT_SHOW_CATEGORY_LABEL"
>
<option value="">JGLOBAL_USE_GLOBAL</option>
<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"
description="COM_CONTACT_FIELD_CONTACT_SHOW_LIST_DESC"
label="COM_CONTACT_FIELD_CONTACT_SHOW_LIST_LABEL"
>
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field name="show_tags" type="list"
label="COM_CONTACT_FIELD_SHOW_TAGS_LABEL"
description="COM_CONTACT_FIELD_SHOW_TAGS_DESC"
>
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field name="show_name"
type="list"
description="COM_CONTACT_FIELD_PARAMS_NAME_DESC"
label="COM_CONTACT_FIELD_PARAMS_NAME_LABEL"
>
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field name="show_position"
type="list"
description="COM_CONTACT_FIELD_PARAMS_CONTACT_POSITION_DESC"
label="COM_CONTACT_FIELD_PARAMS_CONTACT_POSITION_LABEL"
>
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field name="show_email"
type="list"
description="COM_CONTACT_FIELD_PARAMS_CONTACT_E_MAIL_DESC"
label="JGLOBAL_EMAIL"
>
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field name="show_street_address"
type="list"
description="COM_CONTACT_FIELD_PARAMS_STREET_ADDRESS_DESC"
label="COM_CONTACT_FIELD_PARAMS_STREET_ADDRESS_LABEL"
>
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field name="show_suburb"
type="list"
description="COM_CONTACT_FIELD_PARAMS_TOWN-SUBURB_DESC"
label="COM_CONTACT_FIELD_PARAMS_TOWN-SUBURB_LABEL"
>
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field name="show_state"
type="list"
description="COM_CONTACT_FIELD_PARAMS_STATE-COUNTY_DESC"
label="COM_CONTACT_FIELD_PARAMS_STATE-COUNTY_LABEL"
>
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field name="show_postcode"
type="list"
description="COM_CONTACT_FIELD_PARAMS_POST-ZIP_CODE_DESC"
label="COM_CONTACT_FIELD_PARAMS_POST-ZIP_CODE_LABEL"
>
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field name="show_country"
type="list"
description="COM_CONTACT_FIELD_PARAMS_COUNTRY_DESC"
label="COM_CONTACT_FIELD_PARAMS_COUNTRY_LABEL"
>
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field name="show_telephone"
type="list"
description="COM_CONTACT_FIELD_PARAMS_TELEPHONE_DESC"
label="COM_CONTACT_FIELD_PARAMS_TELEPHONE_LABEL"
>
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field name="show_mobile"
type="list"
description="COM_CONTACT_FIELD_PARAMS_MOBILE_DESC"
label="COM_CONTACT_FIELD_PARAMS_MOBILE_LABEL"
>
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field name="show_fax"
type="list"
description="COM_CONTACT_FIELD_PARAMS_FAX_DESC"
label="COM_CONTACT_FIELD_PARAMS_FAX_LABEL"
>
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field name="show_webpage"
type="list"
description="COM_CONTACT_FIELD_PARAMS_WEBPAGE_DESC"
label="COM_CONTACT_FIELD_PARAMS_WEBPAGE_LABEL"
>
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field name="show_misc"
type="list"
description="COM_CONTACT_FIELD_PARAMS_MISC_INFO_DESC"
label="COM_CONTACT_FIELD_PARAMS_MISC_INFO_LABEL"
>
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field name="show_image"
type="list"
description="COM_CONTACT_FIELD_PARAMS_IMAGE_DESC"
label="COM_CONTACT_FIELD_PARAMS_IMAGE_LABEL"
>
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field name="allow_vcard"
type="list"
description="COM_CONTACT_FIELD_PARAMS_VCARD_DESC"
label="COM_CONTACT_FIELD_PARAMS_VCARD_LABEL"
>
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field name="show_articles"
type="list"
description="COM_CONTACT_FIELD_ARTICLES_SHOW_DESC"
label="COM_CONTACT_FIELD_ARTICLES_SHOW_LABEL"
>
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field name="show_links"
type="list"
description="COM_CONTACT_FIELD_SHOW_LINKS_DESC"
label="COM_CONTACT_FIELD_SHOW_LINKS_LABEL"
>
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field name="linka_name"
type="text"
description="COM_CONTACT_FIELD_LINK_NAME_DESC"
label="COM_CONTACT_FIELD_LINKA_NAME_LABEL"
size="30"
/>
<field name="linkb_name"
type="text"
description="COM_CONTACT_FIELD_LINK_NAME_DESC"
label="COM_CONTACT_FIELD_LINKB_NAME_LABEL"
size="30"
/>
<field name="linkc_name"
type="text"
description="COM_CONTACT_FIELD_LINK_NAME_DESC"
label="COM_CONTACT_FIELD_LINKC_NAME_LABEL"
size="30"
/>
<field name="linkd_name"
type="text"
description="COM_CONTACT_FIELD_LINK_NAME_DESC"
label="COM_CONTACT_FIELD_LINKD_NAME_LABEL"
size="30"
/>
<field name="linke_name"
type="text"
description="COM_CONTACT_FIELD_LINK_NAME_DESC"
label="COM_CONTACT_FIELD_LINKE_NAME_LABEL"
size="30"
/>
</fieldset>
<!-- Form options. -->
<fieldset name="Contact_Form"
label="COM_CONTACT_MAIL_FIELDSET_LABEL"
>
<field name="show_email_form" type="list"
description="COM_CONTACT_FIELD_EMAIL_SHOW_FORM_DESC"
label="COM_CONTACT_FIELD_EMAIL_SHOW_FORM_LABEL"
>
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field name="show_email_copy"
type="list"
description="COM_CONTACT_FIELD_EMAIL_EMAIL_COPY_DESC"
label="COM_CONTACT_FIELD_EMAIL_EMAIL_COPY_LABEL"
>
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>
<field name="banned_email"
type="textarea"
cols="30"
description="COM_CONTACT_FIELD_CONFIG_BANNED_EMAIL_DESC"
label="COM_CONTACT_FIELD_CONFIG_BANNED_EMAIL_LABEL"
rows="3"
/>
<field name="banned_subject"
type="textarea"
cols="30"
description="COM_CONTACT_FIELD_CONFIG_BANNED_SUBJECT_DESC"
label="COM_CONTACT_FIELD_CONFIG_BANNED_SUBJECT_LABEL"
rows="3"
/>
<field name="banned_text"
type="textarea"
cols="30"
description="COM_CONTACT_FIELD_CONFIG_BANNED_TEXT_DESC"
label="COM_CONTACT_FIELD_CONFIG_BANNED_TEXT_LABEL"
rows="3"
/>
<field name="validate_session"
type="list"
description="COM_CONTACT_FIELD_CONFIG_SESSION_CHECK_DESC"
label="COM_CONTACT_FIELD_CONFIG_SESSION_CHECK_LABEL"
>
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
<field name="custom_reply"
type="list"
description="COM_CONTACT_FIELD_CONFIG_CUSTOM_REPLY_DESC"
label="COM_CONTACT_FIELD_CONFIG_CUSTOM_REPLY_LABEL"
>
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JNO</option>
<option value="1">JYES</option>
</field>
<field name="redirect"
type="text"
description="COM_CONTACT_FIELD_CONFIG_REDIRECT_DESC"
label="COM_CONTACT_FIELD_CONFIG_REDIRECT_LABEL"
size="30"
/>
</fieldset>
</fields>
</metadata>

View File

@ -0,0 +1,127 @@
<?php
/**
* @package Joomla.Site
* @subpackage com_contact
*
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* marker_class: Class based on the selection of text, none, or icons
* jicon-text, jicon-none, jicon-icon
*/
?>
<dl class="contact-address dl-horizontal">
<?php if (($this->params->get('address_check') > 0) &&
($this->contact->address || $this->contact->suburb || $this->contact->state || $this->contact->country || $this->contact->postcode)) : ?>
<?php if ($this->params->get('address_check') > 0) : ?>
<dt>
<span class="<?php echo $this->params->get('marker_class'); ?>" >
<?php echo $this->params->get('marker_address'); ?>
</span>
</dt>
<?php endif; ?>
<?php if ($this->contact->address && $this->params->get('show_street_address')) : ?>
<dd>
<span class="contact-street">
<?php echo $this->contact->address .'<br/>'; ?>
</span>
</dd>
<?php endif; ?>
<?php if ($this->contact->suburb && $this->params->get('show_suburb')) : ?>
<dd>
<span class="contact-suburb">
<?php echo $this->contact->suburb .'<br/>'; ?>
</span>
</dd>
<?php endif; ?>
<?php if ($this->contact->state && $this->params->get('show_state')) : ?>
<dd>
<span class="contact-state">
<?php echo $this->contact->state . '<br/>'; ?>
</span>
</dd>
<?php endif; ?>
<?php if ($this->contact->postcode && $this->params->get('show_postcode')) : ?>
<dd>
<span class="contact-postcode">
<?php echo $this->contact->postcode .'<br/>'; ?>
</span>
</dd>
<?php endif; ?>
<?php if ($this->contact->country && $this->params->get('show_country')) : ?>
<dd>
<span class="contact-country">
<?php echo $this->contact->country .'<br/>'; ?>
</span>
</dd>
<?php endif; ?>
<?php endif; ?>
<?php if ($this->contact->email_to && $this->params->get('show_email')) : ?>
<dt>
<span class="<?php echo $this->params->get('marker_class'); ?>" >
<?php echo nl2br($this->params->get('marker_email')); ?>
</span>
</dt>
<dd>
<span class="contact-emailto">
<?php echo $this->contact->email_to; ?>
</span>
</dd>
<?php endif; ?>
<?php if ($this->contact->telephone && $this->params->get('show_telephone')) : ?>
<dt>
<span class="<?php echo $this->params->get('marker_class'); ?>" >
<?php echo $this->params->get('marker_telephone'); ?>
</span>
</dt>
<dd>
<span class="contact-telephone">
<?php echo nl2br($this->contact->telephone); ?>
</span>
</dd>
<?php endif; ?>
<?php if ($this->contact->fax && $this->params->get('show_fax')) : ?>
<dt>
<span class="<?php echo $this->params->get('marker_class'); ?>" >
<?php echo $this->params->get('marker_fax'); ?>
</span>
</dt>
<dd>
<span class="contact-fax">
<?php echo nl2br($this->contact->fax); ?>
</span>
</dd>
<?php endif; ?>
<?php if ($this->contact->mobile && $this->params->get('show_mobile')) :?>
<dt>
<span class="<?php echo $this->params->get('marker_class'); ?>" >
<?php echo $this->params->get('marker_mobile'); ?>
</span>
</dt>
<dd>
<span class="contact-mobile">
<?php echo nl2br($this->contact->mobile); ?>
</span>
</dd>
<?php endif; ?>
<?php if ($this->contact->webpage && $this->params->get('show_webpage')) : ?>
<dt>
<span class="<?php echo $this->params->get('marker_class'); ?>" >
</span>
</dt>
<dd>
<span class="contact-webpage">
<a href="<?php echo $this->contact->webpage; ?>" target="_blank">
<?php echo JStringPunycode::urlToUTF8($this->contact->webpage); ?></a>
</span>
</dd>
<?php endif; ?>
</dl>

View File

@ -0,0 +1,25 @@
<?php
/**
* @package Joomla.Site
* @subpackage com_contact
*
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
require_once JPATH_SITE . '/components/com_content/helpers/route.php';
?>
<?php if ($this->params->get('show_articles')) : ?>
<div class="contact-articles">
<ul class="nav nav-tabs nav-stacked">
<?php foreach ($this->item->articles as $article) : ?>
<li>
<?php echo JHtml::_('link', JRoute::_(ContentHelperRoute::getArticleRoute($article->slug, $article->catslug)), htmlspecialchars($article->title, ENT_COMPAT, 'UTF-8')); ?>
</li>
<?php endforeach; ?>
</ul>
</div>
<?php endif; ?>

View File

@ -0,0 +1,79 @@
<?php
/**
* @package Joomla.Site
* @subpackage com_contact
*
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
JHtml::_('behavior.keepalive');
JHtml::_('behavior.formvalidation');
if (isset($this->error)) : ?>
<div class="contact-error">
<?php echo $this->error; ?>
</div>
<?php endif; ?>
<div class="contact-form">
<form id="contact-form" action="<?php echo JRoute::_('index.php'); ?>" method="post" class="form-validate form-horizontal">
<fieldset>
<legend><?php echo JText::_('COM_CONTACT_FORM_LABEL'); ?></legend>
<div class="control-group">
<div class="control-label"><?php echo $this->form->getLabel('contact_name'); ?></div>
<div class="controls"><?php echo $this->form->getInput('contact_name'); ?></div>
</div>
<div class="control-group">
<div class="control-label"><?php echo $this->form->getLabel('contact_email'); ?></div>
<div class="controls"><?php echo $this->form->getInput('contact_email'); ?></div>
</div>
<div class="control-group">
<div class="control-label"><?php echo $this->form->getLabel('contact_subject'); ?></div>
<div class="controls"><?php echo $this->form->getInput('contact_subject'); ?></div>
</div>
<div class="control-group">
<div class="control-label"><?php echo $this->form->getLabel('contact_message'); ?></div>
<div class="controls"><?php echo $this->form->getInput('contact_message'); ?></div>
</div>
<?php if ($this->params->get('show_email_copy')) { ?>
<div class="control-group">
<div class="control-label"><?php echo $this->form->getLabel('contact_email_copy'); ?></div>
<div class="controls"><?php echo $this->form->getInput('contact_email_copy'); ?></div>
</div>
<?php } ?>
<?php //Dynamically load any additional fields from plugins. ?>
<?php foreach ($this->form->getFieldsets() as $fieldset) : ?>
<?php if ($fieldset->name != 'contact'):?>
<?php $fields = $this->form->getFieldset($fieldset->name);?>
<?php foreach ($fields as $field) : ?>
<div class="control-group">
<?php if ($field->hidden) : ?>
<div class="controls">
<?php echo $field->input;?>
</div>
<?php else:?>
<div class="control-label">
<?php echo $field->label; ?>
<?php if (!$field->required && $field->type != "Spacer") : ?>
<span class="optional"><?php echo JText::_('COM_CONTACT_OPTIONAL');?></span>
<?php endif; ?>
</div>
<div class="controls"><?php echo $field->input;?></div>
<?php endif;?>
</div>
<?php endforeach;?>
<?php endif ?>
<?php endforeach;?>
<div class="form-actions"><button class="btn btn-primary validate" type="submit"><?php echo JText::_('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->contact->slug; ?>" />
<?php echo JHtml::_('form.token'); ?>
</div>
</fieldset>
</form>
</div>

View File

@ -0,0 +1,54 @@
<?php
/**
* @package Joomla.Site
* @subpackage com_contact
*
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
?>
<?php if ($this->params->get('presentation_style') == 'sliders') : ?>
<?php echo JHtml::_('bootstrap.addSlide', 'slide-contact', JText::_('COM_CONTACT_LINKS'), 'display-links'); ?>
<?php endif; ?>
<?php if ($this->params->get('presentation_style') == 'tabs') : ?>
<?php echo JHtml::_('bootstrap.addTab', 'myTab', 'display-links', JText::_('COM_CONTACT_LINKS', true)); ?>
<?php endif; ?>
<?php if ($this->params->get('presentation_style') == 'plain'):?>
<?php echo '<h3>'. JText::_('COM_CONTACT_LINKS').'</h3>'; ?>
<?php endif; ?>
<div class="contact-links">
<ul class="nav nav-tabs nav-stacked">
<?php
foreach (range('a', 'e') as $char) :// letters 'a' to 'e'
$link = $this->contact->params->get('link'.$char);
$label = $this->contact->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) ? $label : $link;
?>
<li>
<a href="<?php echo $link; ?>">
<?php echo $label; ?>
</a>
</li>
<?php endforeach; ?>
</ul>
</div>
<?php if ($this->params->get('presentation_style') == 'sliders') : ?>
<?php echo JHtml::_('bootstrap.endSlide'); ?>
<?php endif; ?>
<?php if ($this->params->get('presentation_style') == 'tabs') : ?>
<?php echo JHtml::_('bootstrap.endTab'); ?>
<?php endif; ?>

View File

@ -0,0 +1,40 @@
<?php
/**
* @package Joomla.Site
* @subpackage com_contact
*
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
?>
<?php if (JPluginHelper::isEnabled('user', 'profile')) :
$fields = $this->item->profile->getFieldset('profile'); ?>
<div class="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->profile_value, 0, 4);
if ($v_http == "http") :
echo '<dd><a href="'.$profile->text.'">'.$profile->text.'</a></dd>';
else :
echo '<dd><a href="http://'.$profile->text.'">'.$profile->text.'</a></dd>';
endif;
break;
default:
echo '<dd>'.$profile->text.'</dd>';
break;
endswitch;
endif;
endforeach; ?>
</dl>
</div>
<?php endif; ?>

View File

@ -0,0 +1 @@
<!DOCTYPE html><title></title>

View File

@ -0,0 +1,292 @@
<?php
/**
* @package Joomla.Site
* @subpackage com_contact
*
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
require_once JPATH_COMPONENT.'/models/category.php';
/**
* HTML Contact View class for the Contact component
*
* @package Joomla.Site
* @subpackage com_contact
* @since 1.5
*/
class ContactViewContact extends JViewLegacy
{
protected $state;
protected $form;
protected $item;
protected $return_page;
public function display($tpl = null)
{
$app = JFactory::getApplication();
$user = JFactory::getUser();
$state = $this->get('State');
$item = $this->get('Item');
$this->form = $this->get('Form');
// Get the parameters
$params = JComponentHelper::getParams('com_contact');
if ($item)
{
// If we found an item, merge the item parameters
$params->merge($item->params);
// Get Category Model data
$categoryModel = JModelLegacy::getInstance('Category', 'ContactModel', array('ignore_request' => true));
$categoryModel->setState('category.id', $item->catid);
$categoryModel->setState('list.ordering', 'a.name');
$categoryModel->setState('list.direction', 'asc');
$categoryModel->setState('filter.published', 1);
$contacts = $categoryModel->getItems();
}
// Check for errors.
if (count($errors = $this->get('Errors')))
{
JError::raiseWarning(500, implode("\n", $errors));
return false;
}
// check if access is not public
$groups = $user->getAuthorisedViewLevels();
$return = '';
if ((!in_array($item->access, $groups)) || (!in_array($item->category_access, $groups)))
{
JError::raiseWarning(403, JText::_('JERROR_ALERTNOAUTHOR'));
return;
}
$options['category_id'] = $item->catid;
$options['order by'] = 'a.default_con DESC, a.ordering ASC';
// Handle email cloaking
if ($item->email_to && $params->get('show_email'))
{
$item->email_to = JHtml::_('email.cloak', $item->email_to);
}
if ($params->get('show_street_address') || $params->get('show_suburb') || $params->get('show_state') || $params->get('show_postcode') || $params->get('show_country'))
{
if (!empty ($item->address) || !empty ($item->suburb) || !empty ($item->state) || !empty ($item->country) || !empty ($item->postcode))
{
$params->set('address_check', 1);
}
}
else
{
$params->set('address_check', 0);
}
// Manage the display mode for contact detail groups
switch ($params->get('contact_icons'))
{
case 1 :
// text
$params->set('marker_address', JText::_('COM_CONTACT_ADDRESS') . ": ");
$params->set('marker_email', JText::_('JGLOBAL_EMAIL') . ": ");
$params->set('marker_telephone', JText::_('COM_CONTACT_TELEPHONE') . ": ");
$params->set('marker_fax', JText::_('COM_CONTACT_FAX') . ": ");
$params->set('marker_mobile', JText::_('COM_CONTACT_MOBILE') . ": ");
$params->set('marker_misc', JText::_('COM_CONTACT_OTHER_INFORMATION') . ": ");
$params->set('marker_class', 'jicons-text');
break;
case 2 :
// none
$params->set('marker_address', '');
$params->set('marker_email', '');
$params->set('marker_telephone', '');
$params->set('marker_mobile', '');
$params->set('marker_fax', '');
$params->set('marker_misc', '');
$params->set('marker_class', 'jicons-none');
break;
default :
// icons
$image1 = JHtml::_('image', 'contacts/'.$params->get('icon_address', 'con_address.png'), JText::_('COM_CONTACT_ADDRESS').": ", null, true);
$image2 = JHtml::_('image', 'contacts/'.$params->get('icon_email', 'emailButton.png'), JText::_('JGLOBAL_EMAIL').": ", null, true);
$image3 = JHtml::_('image', 'contacts/'.$params->get('icon_telephone', 'con_tel.png'), JText::_('COM_CONTACT_TELEPHONE').": ", null, true);
$image4 = JHtml::_('image', 'contacts/'.$params->get('icon_fax', 'con_fax.png'), JText::_('COM_CONTACT_FAX').": ", null, true);
$image5 = JHtml::_('image', 'contacts/'.$params->get('icon_misc', 'con_info.png'), JText::_('COM_CONTACT_OTHER_INFORMATION').": ", null, true);
$image6 = JHtml::_('image', 'contacts/'.$params->get('icon_mobile', 'con_mobile.png'), JText::_('COM_CONTACT_MOBILE').": ", null, true);
$params->set('marker_address', $image1);
$params->set('marker_email', $image2);
$params->set('marker_telephone', $image3);
$params->set('marker_fax', $image4);
$params->set('marker_misc', $image5);
$params->set('marker_mobile', $image6);
$params->set('marker_class', 'jicons-icons');
break;
}
// Add links to contacts
if ($params->get('show_contact_list') && count($contacts) > 1)
{
foreach ($contacts as &$contact)
{
$contact->link = JRoute::_(ContactHelperRoute::getContactRoute($contact->slug, $contact->catid));
}
$item->link = JRoute::_(ContactHelperRoute::getContactRoute($item->slug, $item->catid));
}
JHtml::_('behavior.formvalidation');
//Escape strings for HTML output
$this->pageclass_sfx = htmlspecialchars($params->get('pageclass_sfx'));
$this->contact = &$item;
$this->params = &$params;
$this->return = &$return;
$this->state = &$state;
$this->item = &$item;
$this->user = &$user;
$this->contacts = &$contacts;
$item->tags = new JHelperTags;
$item->tags->getItemTags('com_contact.contact', $this->item->id);
// Override the layout only if this is not the active menu item
// If it is the active menu item, then the view and item id will match
$active = $app->getMenu()->getActive();
if ((!$active) || ((strpos($active->link, 'view=contact') === false) || (strpos($active->link, '&id=' . (string) $this->item->id) === false)))
{
if ($layout = $params->get('contact_layout'))
{
$this->setLayout($layout);
}
}
elseif (isset($active->query['layout']))
{
// We need to set the layout in case this is an alternative menu item (with an alternative layout)
$this->setLayout($active->query['layout']);
}
$this->_prepareDocument();
parent::display($tpl);
}
/**
* Prepares the document
*/
protected function _prepareDocument()
{
$app = JFactory::getApplication();
$menus = $app->getMenu();
$pathway = $app->getPathway();
$title = null;
// Because the application sets a default page title,
// we need to get it from the menu item itself
$menu = $menus->getActive();
if ($menu)
{
$this->params->def('page_heading', $this->params->get('page_title', $menu->title));
}
else
{
$this->params->def('page_heading', JText::_('COM_CONTACT_DEFAULT_PAGE_TITLE'));
}
$title = $this->params->get('page_title', '');
$id = (int) @$menu->query['id'];
// if the menu item does not concern this contact
if ($menu && ($menu->query['option'] != 'com_contact' || $menu->query['view'] != 'contact' || $id != $this->item->id))
{
// If this is not a single contact menu item, set the page title to the contact title
if ($this->item->name)
{
$title = $this->item->name;
}
$path = array(array('title' => $this->contact->name, 'link' => ''));
$category = JCategories::getInstance('Contact')->get($this->contact->catid);
while ($category && ($menu->query['option'] != 'com_contact' || $menu->query['view'] == 'contact' || $id != $category->id) && $category->id > 1)
{
$path[] = array('title' => $category->title, 'link' => ContactHelperRoute::getCategoryRoute($this->contact->catid));
$category = $category->getParent();
}
$path = array_reverse($path);
foreach ($path as $item)
{
$pathway->addItem($item['title'], $item['link']);
}
}
if (empty($title))
{
$title = $app->getCfg('sitename');
}
elseif ($app->getCfg('sitename_pagetitles', 0) == 1)
{
$title = JText::sprintf('JPAGETITLE', $app->getCfg('sitename'), $title);
}
elseif ($app->getCfg('sitename_pagetitles', 0) == 2)
{
$title = JText::sprintf('JPAGETITLE', $title, $app->getCfg('sitename'));
}
if (empty($title))
{
$title = $this->item->name;
}
$this->document->setTitle($title);
if ($this->item->metadesc)
{
$this->document->setDescription($this->item->metadesc);
}
elseif (!$this->item->metadesc && $this->params->get('menu-meta_description'))
{
$this->document->setDescription($this->params->get('menu-meta_description'));
}
if ($this->item->metakey)
{
$this->document->setMetadata('keywords', $this->item->metakey);
}
elseif (!$this->item->metakey && $this->params->get('menu-meta_keywords'))
{
$this->document->setMetadata('keywords', $this->params->get('menu-meta_keywords'));
}
if ($this->params->get('robots'))
{
$this->document->setMetadata('robots', $this->params->get('robots'));
}
$mdata = $this->item->metadata->toArray();
foreach ($mdata as $k => $v)
{
if ($v)
{
$this->document->setMetadata($k, $v);
}
}
}
}

View File

@ -0,0 +1,91 @@
<?php
/**
* @package Joomla.Site
* @subpackage com_contact
*
* @copyright Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
defined('_JEXEC') or die;
/**
* @package Joomla.Site
* @subpackage com_contact
*/
class ContactViewContact extends JViewLegacy
{
protected $state;
protected $item;
public function display()
{
// Get model data.
$item = $this->get('Item');
// Check for errors.
if (count($errors = $this->get('Errors')))
{
JError::raiseWarning(500, implode("\n", $errors));
return false;
}
JFactory::getDocument()->setMetaData('Content-Type', 'text/directory', true);
// Compute lastname, firstname and middlename
$item->name = trim($item->name);
// "Lastname, Firstname Midlename" format support
// e.g. "de Gaulle, Charles"
$namearray = explode(',', $item->name);
if (count($namearray) > 1 )
{
$lastname = $namearray[0];
$card_name = $lastname;
$name_and_midname = trim($namearray[1]);
$firstname = '';
if (!empty($name_and_midname))
{
$namearray = explode(' ', $name_and_midname);
$firstname = $namearray[0];
$middlename = (count($namearray) > 1) ? $namearray[1] : '';
$card_name = $firstname . ' ' . ($middlename ? $middlename . ' ' : '') . $card_name;
}
}
// "Firstname Middlename Lastname" format support
else {
$namearray = explode(' ', $item->name);
$middlename = (count($namearray) > 2) ? $namearray[1] : '';
$firstname = array_shift($namearray);
$lastname = count($namearray) ? end($namearray) : '';
$card_name = $firstname . ($middlename ? ' ' . $middlename : '') . ($lastname ? ' ' . $lastname : '');
}
$rev = date('c', strtotime($item->modified));
JResponse::setHeader('Content-disposition', 'attachment; filename="'.$card_name.'.vcf"', true);
$vcard = array();
$vcard[] .= 'BEGIN:VCARD';
$vcard[] .= 'VERSION:3.0';
$vcard[] = 'N:'.$lastname.';'.$firstname.';'.$middlename;
$vcard[] = 'FN:'. $item->name;
$vcard[] = 'TITLE:'.$item->con_position;
$vcard[] = 'TEL;TYPE=WORK,VOICE:'.$item->telephone;
$vcard[] = 'TEL;TYPE=WORK,FAX:'.$item->fax;
$vcard[] = 'TEL;TYPE=WORK,MOBILE:'.$item->mobile;
$vcard[] = 'ADR;TYPE=WORK:;;'.$item->address.';'.$item->suburb.';'.$item->state.';'.$item->postcode.';'.$item->country;
$vcard[] = 'LABEL;TYPE=WORK:'.$item->address."\n".$item->suburb."\n".$item->state."\n".$item->postcode."\n".$item->country;
$vcard[] = 'EMAIL;TYPE=PREF,INTERNET:'.$item->email_to;
$vcard[] = 'URL:'.$item->webpage;
$vcard[] = 'REV:'.$rev.'Z';
$vcard[] = 'END:VCARD';
echo implode("\n", $vcard);
return true;
}
}