Skip to content
Closed
19 changes: 19 additions & 0 deletions administrator/components/com_contact/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,25 @@
<option value="0">JHIDE</option>
</field>

<field name="show_image_heading" type="radio"
class="btn-group btn-group-yesno"
default="1"
label="COM_CONTACT_FIELD_CONFIG_SHOW_IMAGE_LABEL"
description="COM_CONTACT_FIELD_CONFIG_SHOW_IMAGE_DESC"
>
<option value="1">JSHOW</option>
<option value="0">JHIDE</option>
</field>

<field name="list_cols_width" type="list"
description="COM_CONTACT_FIELD_SHOW_LIST_COLS_DESC"
label="COM_CONTACT_FIELD_SHOW_LIST_COLS_LABEL"
default="0"
>
<option value="0">COM_CONTACT_FIELD_SHOW_LIST_COLS_SMALL</option>
<option value="1">COM_CONTACT_FIELD_SHOW_LIST_COLS_WIDE</option>
</field>

<field name="show_position_headings" type="radio"
default="1"
class="btn-group btn-group-yesno"
Expand Down
6 changes: 6 additions & 0 deletions administrator/language/en-GB/en-GB.com_contact.ini
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ COM_CONTACT_FIELD_CONFIG_FAX_DESC="Show or hide a Fax column in the list of Cont
COM_CONTACT_FIELD_CONFIG_FAX_LABEL="Fax"
COM_CONTACT_FIELD_CONFIG_INDIVIDUAL_CONTACT_DESC="These settings apply for single Contact unless they are changed for a specific menu item or Contact."
COM_CONTACT_FIELD_CONFIG_INDIVIDUAL_CONTACT_DISPLAY="Contact"
COM_CONTACT_FIELD_SHOW_LIST_COLS_DESC="Select the width of the columns for image, description and extras (Bootstrap)"
COM_CONTACT_FIELD_SHOW_LIST_COLS_LABEL="Columns width (Bootstrap)"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be Column not columns

COM_CONTACT_FIELD_SHOW_LIST_COLS_SMALL="2,7,3"
COM_CONTACT_FIELD_SHOW_LIST_COLS_WIDE="3,6,3"
COM_CONTACT_FIELD_CONFIG_SHOW_IMAGE_LABEL="Image"
COM_CONTACT_FIELD_CONFIG_SHOW_IMAGE_DESC="Show or hide a Image column in the list of Contacts."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be
an Image

COM_CONTACT_FIELD_CONFIG_MOBILE_DESC="Show or hide show a Mobile column in the list of Contacts."
COM_CONTACT_FIELD_CONFIG_MOBILE_LABEL="Mobile"
COM_CONTACT_FIELD_CONFIG_PHONE_DESC="Show or hide a Phone column in the list of Contacts."
Expand Down
18 changes: 18 additions & 0 deletions components/com_contact/views/category/tmpl/default.xml
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,24 @@
<option value="1">JSHOW</option>
</field>

<field name="show_image_heading" type="list"
label="COM_CONTACT_FIELD_CONFIG_SHOW_IMAGE_LABEL"
description="COM_CONTACT_FIELD_CONFIG_SHOW_IMAGE_DESC"
>
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">JHIDE</option>
<option value="1">JSHOW</option>
</field>

<field name="list_cols_width" type="list"
description="COM_CONTACT_FIELD_SHOW_LIST_COLS_DESC"
label="COM_CONTACT_FIELD_SHOW_LIST_COLS_LABEL"
>
<option value="">JGLOBAL_USE_GLOBAL</option>
<option value="0">COM_CONTACT_FIELD_SHOW_LIST_COLS_SMALL</option>
<option value="1">COM_CONTACT_FIELD_SHOW_LIST_COLS_WIDE</option>
</field>

<field name="show_position_headings" type="list"
label="COM_CONTACT_FIELD_CONFIG_POSITION_LABEL"
description="COM_CONTACT_FIELD_CONFIG_POSITION_DESC"
Expand Down
84 changes: 55 additions & 29 deletions components/com_contact/views/category/tmpl/default_items.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,52 +46,78 @@
<?php if ($this->items[$i]->published == 0) : ?>
<li class="system-unpublished cat-list-row<?php echo $i % 2; ?>">
<?php else: ?>
<li class="cat-list-row<?php echo $i % 2; ?>" >
<li class="row cat-list-row<?php echo $i % 2; ?>" >
<?php endif; ?>

<span class="pull-right">
<?php if ($this->params->get('show_telephone_headings') AND !empty($item->telephone)) : ?>
<?php echo JText::sprintf('COM_CONTACT_TELEPHONE_NUMBER', $item->telephone); ?><br />
<?php
$imgcol = 0;
$desccol = 9;
$extracol = 3;
if ($this->params->get('show_image_heading'))
{
if ($this->params->get('list_cols_width') == 1)
{
$imgcol = 3;
$desccol = 6;
$extracol = 3;
}
elseif ($this->params->get('list_cols_width') == 0)
{
$imgcol = 2;
$desccol = 7;
$extracol = 3;
}
}
?>
<?php if ($this->params->get('show_image_heading')) : ?>
<div class="span<?php echo $imgcol; ?> col-md-<?php echo $imgcol; ?>">
<?php if ($this->items[$i]->image) : ?>
<a href="<?php echo JRoute::_(ContactHelperRoute::getContactRoute($item->slug, $item->catid)); ?>">
<?php echo JHtml::_('image', $this->items[$i]->image, JText::_('COM_CONTACT_IMAGE_DETAILS'), array('class' => 'contact-thumbnail img-thumbnail')); ?></a>
<?php endif; ?>

<?php if ($this->params->get('show_mobile_headings') AND !empty ($item->mobile)) : ?>
<?php echo JText::sprintf('COM_CONTACT_MOBILE_NUMBER', $item->mobile); ?><br />
<?php endif; ?>

<?php if ($this->params->get('show_fax_headings') AND !empty($item->fax) ) : ?>
<?php echo JText::sprintf('COM_CONTACT_FAX_NUMBER', $item->fax); ?><br />
<?php endif; ?>
</span>
</div>
<?php endif; ?>

<div class="list-item">
<div class="list-title">
<div class="list-title span<?php echo $desccol; ?> col-md-<?php echo $desccol; ?>">
<a href="<?php echo JRoute::_(ContactHelperRoute::getContactRoute($item->slug, $item->catid)); ?>">
<?php echo $item->name; ?></a>
<?php if ($this->items[$i]->published == 0) : ?>
<span class="label label-warning"><?php echo JText::_('JUNPUBLISHED'); ?></span>
<?php endif; ?>
</div>
<?php echo $item->event->afterDisplayTitle; ?>

<?php echo $item->event->afterDisplayTitle; ?>
<?php echo $item->event->beforeDisplayContent; ?>
<?php if ($this->params->get('show_position_headings')) : ?>
<?php echo $item->con_position; ?><br />
<?php endif; ?>
<?php if ($this->params->get('show_email_headings')) : ?>
<?php echo $item->email_to; ?><br />
<?php endif; ?>
<?php if ($this->params->get('show_suburb_headings') AND !empty($item->suburb)) : ?>
<?php echo $item->suburb . ', '; ?>
<?php endif; ?>

<?php echo $item->event->beforeDisplayContent; ?>
<?php if ($this->params->get('show_state_headings') AND !empty($item->state)) : ?>
<?php echo $item->state . ', '; ?>
<?php endif; ?>

<?php if ($this->params->get('show_position_headings')) : ?>
<?php echo $item->con_position; ?><br />
<?php endif; ?>
<?php if ($this->params->get('show_email_headings')) : ?>
<?php echo $item->email_to; ?>
<?php endif; ?>
<?php if ($this->params->get('show_suburb_headings') AND !empty($item->suburb)) : ?>
<?php echo $item->suburb . ', '; ?>
<?php if ($this->params->get('show_country_headings') AND !empty($item->country)) : ?>
<?php echo $item->country; ?><br />
<?php endif; ?>
</div>
</div>
<div class="span<?php echo $extracol; ?> col-md-<?php echo $extracol; ?>">
<?php if ($this->params->get('show_telephone_headings') AND !empty($item->telephone)) : ?>
<?php echo JText::sprintf('COM_CONTACT_TELEPHONE_NUMBER', $item->telephone); ?><br />
<?php endif; ?>

<?php if ($this->params->get('show_state_headings') AND !empty($item->state)) : ?>
<?php echo $item->state . ', '; ?>
<?php if ($this->params->get('show_mobile_headings') AND !empty ($item->mobile)) : ?>
<?php echo JText::sprintf('COM_CONTACT_MOBILE_NUMBER', $item->mobile); ?><br />
<?php endif; ?>

<?php if ($this->params->get('show_country_headings') AND !empty($item->country)) : ?>
<?php echo $item->country; ?><br />
<?php if ($this->params->get('show_fax_headings') AND !empty($item->fax) ) : ?>
<?php echo JText::sprintf('COM_CONTACT_FAX_NUMBER', $item->fax); ?><br />
<?php endif; ?>
</div>

Expand Down
3 changes: 3 additions & 0 deletions templates/protostar/css/template.css
Original file line number Diff line number Diff line change
Expand Up @@ -7511,3 +7511,6 @@ body.modal-open {
#finder-search .in.collapse {
overflow: visible;
}
.contact-category .row {
margin-left:0;
}
4 changes: 4 additions & 0 deletions templates/protostar/less/template.less
Original file line number Diff line number Diff line change
Expand Up @@ -641,3 +641,7 @@ body.modal-open {
#finder-search .in.collapse {
overflow: visible;
}
/* Correct row on contact category */
.contact-category .row {
margin-left:0;
}