Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 10 additions & 24 deletions components/com_contact/src/View/Contact/HtmlView.php
Original file line number Diff line number Diff line change
Expand Up @@ -240,79 +240,65 @@ public function display($tpl = null)
switch ($item->params->get('contact_icons')) {
case 1:
// Text
$item->params->set('marker_address', Text::_('COM_CONTACT_ADDRESS') . ': ');
$item->params->set('marker_email', Text::_('JGLOBAL_EMAIL') . ': ');
$item->params->set('marker_telephone', Text::_('COM_CONTACT_TELEPHONE') . ': ');
$item->params->set('marker_fax', Text::_('COM_CONTACT_FAX') . ': ');
$item->params->set('marker_mobile', Text::_('COM_CONTACT_MOBILE') . ': ');
$item->params->set('marker_webpage', Text::_('COM_CONTACT_WEBPAGE') . ': ');
$item->params->set('marker_misc', Text::_('COM_CONTACT_OTHER_INFORMATION') . ': ');
$item->params->set('marker_class', 'jicons-text');
break;

case 2:
// None
$item->params->set('marker_address', '');
$item->params->set('marker_email', '');
$item->params->set('marker_telephone', '');
$item->params->set('marker_mobile', '');
$item->params->set('marker_fax', '');
$item->params->set('marker_misc', '');
$item->params->set('marker_webpage', '');
$item->params->set('marker_class', 'jicons-none');
$item->params->set('marker_class', 'jicons-none visually-hidden');
break;

default:
if ($item->params->get('icon_address')) {
$item->params->set(
'marker_address',
HTMLHelper::_('image', $item->params->get('icon_address', ''), Text::_('COM_CONTACT_ADDRESS'), false)
HTMLHelper::_('image', $item->params->get('icon_address', ''), '', false)
);
}

if ($item->params->get('icon_email')) {
$item->params->set(
'marker_email',
HTMLHelper::_('image', $item->params->get('icon_email', ''), Text::_('COM_CONTACT_EMAIL'), false)
HTMLHelper::_('image', $item->params->get('icon_email', ''), '', false)
);
}

if ($item->params->get('icon_telephone')) {
$item->params->set(
'marker_telephone',
HTMLHelper::_('image', $item->params->get('icon_telephone', ''), Text::_('COM_CONTACT_TELEPHONE'), false)
HTMLHelper::_('image', $item->params->get('icon_telephone', ''), '', false)
);
}

if ($item->params->get('icon_fax', '')) {
if ($item->params->get('icon_fax')) {
$item->params->set(
'marker_fax',
HTMLHelper::_('image', $item->params->get('icon_fax', ''), Text::_('COM_CONTACT_FAX'), false)
HTMLHelper::_('image', $item->params->get('icon_fax', ''), '', false)
);
}

if ($item->params->get('icon_misc')) {
$item->params->set(
'marker_misc',
HTMLHelper::_('image', $item->params->get('icon_misc', ''), Text::_('COM_CONTACT_OTHER_INFORMATION'), false)
HTMLHelper::_('image', $item->params->get('icon_misc', ''), '', false)
);
}

if ($item->params->get('icon_mobile')) {
$item->params->set(
'marker_mobile',
HTMLHelper::_('image', $item->params->get('icon_mobile', ''), Text::_('COM_CONTACT_MOBILE'), false)
HTMLHelper::_('image', $item->params->get('icon_mobile', ''), '', false)
);
}

if ($item->params->get('icon_webpage')) {
$item->params->set(
'marker_webpage',
HTMLHelper::_('image', $item->params->get('icon_webpage', ''), Text::_('COM_CONTACT_WEBPAGE'), false)
HTMLHelper::_('image', $item->params->get('icon_webpage', ''), '', false)
);
}

$item->params->set('marker_class', 'jicons-icons');
$item->params->set('marker_class', 'jicons-icons visually-hidden');
break;
}

Expand Down
12 changes: 6 additions & 6 deletions components/com_contact/tmpl/contact/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
$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';

$icon = $this->params->get('contact_icons') == 0;
?>

<div class="com-contact contact">
Expand Down Expand Up @@ -170,14 +170,14 @@
<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 if ($icon && !$this->params->get('marker_misc')) : ?>
<span class="icon-home" aria-hidden="true"></span>
<?php elseif ($icon && $this->params->get('marker_misc')) : ?>
<span class="jicons-image">
<?php echo $this->params->get('marker_misc'); ?>
</span>
<?php endif; ?>
<span class="<?php echo $this->params->get('marker_class'); ?>"><?php echo Text::_('COM_CONTACT_OTHER_INFORMATION'); ?></span>
</dt>
<dd>
<span class="contact-misc">
Expand Down
44 changes: 25 additions & 19 deletions components/com_contact/tmpl/contact/default_address.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@
) : ?>
<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'); ?>">
<span class="icon-address" aria-hidden="true"></span>
<?php elseif ($icon && $this->params->get('marker_address')) : ?>
<span class="jicons-image">
<?php echo $this->params->get('marker_address'); ?>
</span>
<?php endif; ?>
<span class="<?php echo $this->params->get('marker_class'); ?>"><?php echo Text::_('COM_CONTACT_ADDRESS'); ?>: </span>
</dt>

<?php if ($this->item->address && $this->params->get('show_street_address')) : ?>
Expand Down Expand Up @@ -78,12 +79,13 @@
<?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'); ?>">
<span class="icon-envelope" aria-hidden="true"></span>
<?php elseif ($icon && $this->params->get('marker_email')) : ?>
<span class="jicons-icon">
<?php echo $this->params->get('marker_email'); ?>
</span>
<?php endif; ?>
<span class="<?php echo $this->params->get('marker_class'); ?>"><?php echo Text::_('COM_CONTACT_EMAIL_LABEL'); ?>: </span>
</dt>
<dd>
<span class="contact-emailto">
Expand All @@ -95,12 +97,13 @@
<?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'); ?>">
<span class="icon-phone" aria-hidden="true"></span>
<?php elseif ($icon && $this->params->get('marker_telephone')) : ?>
<span class="jicons-image">
<?php echo $this->params->get('marker_telephone'); ?>
</span>
<?php endif; ?>
<span class="<?php echo $this->params->get('marker_class'); ?>"><?php echo Text::_('COM_CONTACT_TELEPHONE'); ?>: </span>
</dt>
<dd>
<span class="contact-telephone">
Expand All @@ -111,28 +114,30 @@
<?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'); ?>">
<span class="icon-fax" aria-hidden="true"></span>
<?php elseif ($icon && $this->params->get('marker_fax')) : ?>
<span class="jicons-image">
<?php echo $this->params->get('marker_fax'); ?>
</span>
<?php endif; ?>
<span class="<?php echo $this->params->get('marker_class'); ?>"><?php echo Text::_('COM_CONTACT_FAX'); ?>: </span>
</dt>
<dd>
<span class="contact-fax">
<?php echo $this->item->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'); ?>">
<span class="icon-mobile" aria-hidden="true"></span>
<?php elseif ($icon && $this->params->get('marker_mobile')) : ?>
<span class="jicons-image">
<?php echo $this->params->get('marker_mobile'); ?>
</span>
<?php endif; ?>
<span class="<?php echo $this->params->get('marker_class'); ?>"><?php echo Text::_('COM_CONTACT_MOBILE'); ?>: </span>
</dt>
<dd>
<span class="contact-mobile">
Expand All @@ -143,12 +148,13 @@
<?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'); ?>">
<span class="icon-home" aria-hidden="true"></span>
<?php elseif ($icon && $this->params->get('marker_webpage')) : ?>
<span class="jicons-image">
<?php echo $this->params->get('marker_webpage'); ?>
</span>
<?php endif; ?>
<span class="<?php echo $this->params->get('marker_class'); ?>"><?php echo Text::_('COM_CONTACT_WEBPAGE'); ?>: </span>
</dt>
<dd>
<span class="contact-webpage">
Expand Down