Skip to content

Commit

Permalink
com_contact view review
Browse files Browse the repository at this point in the history
  • Loading branch information
zero-24 committed Jul 23, 2017
1 parent 247480f commit 9782d77
Show file tree
Hide file tree
Showing 13 changed files with 457 additions and 538 deletions.
7 changes: 3 additions & 4 deletions components/com_contact/views/categories/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@
});
});");
?>

<div class="categories-list<?php echo $this->pageclass_sfx; ?>">
<?php
echo JLayoutHelper::render('joomla.content.categories_default', $this);
echo $this->loadTemplate('items');
?>
<?php echo JLayoutHelper::render('joomla.content.categories_default', $this); ?>
<?php echo $this->loadTemplate('items'); ?>
</div>
37 changes: 16 additions & 21 deletions components/com_contact/views/categories/tmpl/default_items.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,21 @@
defined('_JEXEC') or die;

JHtml::_('bootstrap.tooltip');

$class = ' class="first"';
if ($this->maxLevelcat != 0 && count($this->items[$this->parent->id]) > 0) :
?>

<?php $class = ' class="first"'; ?>
<?php 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())) :
if (!isset($this->items[$this->parent->id][$id + 1]))
{
$class = ' class="last"';
}
?>
<?php if ($this->params->get('show_empty_categories_cat') || $item->numitems || count($item->getChildren())) : ?>
<?php if (!isset($this->items[$this->parent->id][$id + 1])) : ?>
<?php $class = ' class="last"'; ?>
<?php endif; ?>
<div <?php echo $class; ?> >
<?php $class = ''; ?>
<h3 class="page-header item-title">
<a href="<?php echo JRoute::_(ContactHelperRoute::getCategoryRoute($item->id, $item->language)); ?>">
<?php echo $this->escape($item->title); ?></a>
<?php if ($this->params->get('show_cat_items_cat') == 1) :?>
<?php if ($this->params->get('show_cat_items_cat') == 1) : ?>
<span class="badge badge-info tip hasTooltip" title="<?php echo JHtml::_('tooltipText', 'COM_CONTACT_NUM_ITEMS'); ?>">
<?php echo JText::_('COM_CONTACT_NUM_ITEMS'); ?>&nbsp;
<?php echo $item->numitems; ?>
Expand All @@ -45,19 +42,17 @@
</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++;
?>
<?php $this->items[$item->id] = $item->getChildren(); ?>
<?php $this->parent = $item; ?>
<?php $this->maxLevelcat--; ?>
<?php echo $this->loadTemplate('items'); ?>
<?php $this->parent = $item->getParent(); ?>
<?php $this->maxLevelcat++; ?>
</div>
<?php endif; ?>
</div>
<?php endif; ?>
<?php endforeach; ?><?php endif; ?>
<?php endforeach; ?>
<?php endif; ?>
80 changes: 39 additions & 41 deletions components/com_contact/views/category/tmpl/default_children.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,48 +8,46 @@
*/

defined('_JEXEC') or die;
$class = ' class="first"';
if ($this->maxLevel != 0 && count($this->children[$this->category->id]) > 0) :
?>
<ul class="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())) :
if (!isset($this->children[$this->category->id][$id + 1]))
{
$class = ' class="last"';
}
?>
<li<?php echo $class; ?>>
<?php $class = ''; ?>
<h4 class="item-title">
<a href="<?php echo JRoute::_(ContactHelperRoute::getCategoryRoute($child->id)); ?>">
<?php echo $this->escape($child->title); ?>
</a>

<?php if ($this->params->get('show_cat_items') == 1) : ?>
<span class="badge badge-info pull-right" title="<?php echo JText::_('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 JHtml::_('content.prepare', $child->description, '', 'com_contact.category'); ?>
</div>
<?php endif; ?>
<?php $class = ' class="first"'; ?>
<?php if ($this->maxLevel != 0 && count($this->children[$this->category->id]) > 0) : ?>
<ul class="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())) : ?>
<?php if (!isset($this->children[$this->category->id][$id + 1])) : ?>
<?php $class = ' class="last"'; ?>
<?php endif ?>
<li<?php echo $class; ?>>
<?php $class = ''; ?>
<h4 class="item-title">
<a href="<?php echo JRoute::_(ContactHelperRoute::getCategoryRoute($child->id)); ?>">
<?php echo $this->escape($child->title); ?>
</a>
<?php if ($this->params->get('show_cat_items') == 1) : ?>
<span class="badge badge-info pull-right" title="<?php echo JText::_('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 JHtml::_('content.prepare', $child->description, '', 'com_contact.category'); ?>
</div>
<?php endif; ?>
<?php endif; ?>
<?php if (count($child->getChildren()) > 0 ) : ?>
<?php $this->children[$child->id] = $child->getChildren(); ?>
<?php $this->category = $child; ?>
<?php $this->maxLevel--; ?>
<?php echo $this->loadTemplate('children'); ?>
<?php $this->category = $child->getParent(); ?>
<?php $this->maxLevel++; ?>
<?php endif; ?>
</li>
<?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 endforeach; ?>
</ul>
<?php endif; ?>
198 changes: 98 additions & 100 deletions components/com_contact/views/category/tmpl/default_items.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,115 +14,113 @@
$listOrder = $this->escape($this->state->get('list.ordering'));
$listDirn = $this->escape($this->state->get('list.direction'));
?>

<?php if (empty($this->items)) : ?>
<p> <?php echo JText::_('COM_CONTACT_NO_CONTACTS'); ?> </p>
<p><?php echo JText::_('COM_CONTACT_NO_CONTACTS'); ?></p>
<?php else : ?>

<form action="<?php echo htmlspecialchars(JUri::getInstance()->toString()); ?>" method="post" name="adminForm" id="adminForm">
<?php if ($this->params->get('filter_field') || $this->params->get('show_pagination_limit')) : ?>
<fieldset class="filters btn-toolbar">
<?php if ($this->params->get('filter_field')) : ?>
<div class="btn-group">
<label class="filter-search-lbl element-invisible" for="filter-search"><span class="label label-warning"><?php echo JText::_('JUNPUBLISHED'); ?></span><?php echo JText::_('COM_CONTACT_FILTER_LABEL') . '&#160;'; ?></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();" title="<?php echo JText::_('COM_CONTACT_FILTER_SEARCH_DESC'); ?>" placeholder="<?php echo JText::_('COM_CONTACT_FILTER_SEARCH_DESC'); ?>" />
</div>
<?php endif; ?>

<?php if ($this->params->get('show_pagination_limit')) : ?>
<div class="btn-group pull-right">
<label for="limit" class="element-invisible">
<?php echo JText::_('JGLOBAL_DISPLAY_NUM'); ?>
</label>
<?php echo $this->pagination->getLimitBox(); ?>
</div>
<?php endif; ?>
</fieldset>
<fieldset class="filters btn-toolbar">
<?php if ($this->params->get('filter_field')) : ?>
<div class="btn-group">
<label class="filter-search-lbl element-invisible" for="filter-search">
<span class="label label-warning">
<?php echo JText::_('JUNPUBLISHED'); ?>
</span><?php echo JText::_('COM_CONTACT_FILTER_LABEL') . '&#160;'; ?>
</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();" title="<?php echo JText::_('COM_CONTACT_FILTER_SEARCH_DESC'); ?>" placeholder="<?php echo JText::_('COM_CONTACT_FILTER_SEARCH_DESC'); ?>" />
</div>
<?php endif; ?>
<?php if ($this->params->get('show_pagination_limit')) : ?>
<div class="btn-group pull-right">
<label for="limit" class="element-invisible">
<?php echo JText::_('JGLOBAL_DISPLAY_NUM'); ?>
</label>
<?php echo $this->pagination->getLimitBox(); ?>
</div>
<?php endif; ?>
</fieldset>
<?php endif; ?>

<ul class="category row-striped">
<?php foreach ($this->items as $i => $item) : ?>

<?php if (in_array($item->access, $this->user->getAuthorisedViewLevels())) : ?>
<?php if ($this->items[$i]->published == 0) : ?>
<li class="row-fluid system-unpublished cat-list-row<?php echo $i % 2; ?>">
<?php else : ?>
<li class="row-fluid cat-list-row<?php echo $i % 2; ?>" >
<?php endif; ?>

<?php if ($this->params->get('show_image_heading')) : ?>
<?php $contact_width = 7; ?>
<div class="span2 col-md-2">
<?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; ?>
</div>
<?php else : ?>
<?php $contact_width = 9; ?>
<?php endif; ?>

<div class="list-title span<?php echo $contact_width; ?> col-md-<?php echo $contact_width; ?>">
<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; ?>
<?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 $location = array(); ?>
<?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, ', '); ?>
</div>

<div class="span3 col-md-3">
<?php if ($this->params->get('show_telephone_headings') && !empty($item->telephone)) : ?>
<?php echo JText::sprintf('COM_CONTACT_TELEPHONE_NUMBER', $item->telephone); ?><br />
<?php endif; ?>

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

<?php if ($this->params->get('show_fax_headings') && !empty($item->fax) ) : ?>
<?php echo JText::sprintf('COM_CONTACT_FAX_NUMBER', $item->fax); ?><br />
<ul class="category row-striped">
<?php foreach ($this->items as $i => $item) : ?>
<?php if (in_array($item->access, $this->user->getAuthorisedViewLevels())) : ?>
<?php if ($this->items[$i]->published == 0) : ?>
<li class="row-fluid system-unpublished cat-list-row<?php echo $i % 2; ?>">
<?php else : ?>
<li class="row-fluid cat-list-row<?php echo $i % 2; ?>" >
<?php endif; ?>
<?php if ($this->params->get('show_image_heading')) : ?>
<?php $contact_width = 7; ?>
<div class="span2 col-md-2">
<?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; ?>
</div>

<?php echo $item->event->afterDisplayContent; ?>
</li>
<?php else : ?>
<?php $contact_width = 9; ?>
<?php endif; ?>
<?php endforeach; ?>
</ul>

<?php if ($this->params->get('show_pagination', 2)) : ?>
<div class="pagination">
<?php if ($this->params->def('show_pagination_results', 1)) : ?>
<p class="counter">
<?php echo $this->pagination->getPagesCounter(); ?>
</p>
<div class="list-title span<?php echo $contact_width; ?> col-md-<?php echo $contact_width; ?>">
<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; ?>
<?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 $location = array(); ?>
<?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, ', '); ?>
</div>
<div class="span3 col-md-3">
<?php if ($this->params->get('show_telephone_headings') && !empty($item->telephone)) : ?>
<?php echo JText::sprintf('COM_CONTACT_TELEPHONE_NUMBER', $item->telephone); ?><br />
<?php endif; ?>
<?php if ($this->params->get('show_mobile_headings') && !empty ($item->mobile)) : ?>
<?php echo JText::sprintf('COM_CONTACT_MOBILE_NUMBER', $item->mobile); ?><br />
<?php endif; ?>
<?php if ($this->params->get('show_fax_headings') && !empty($item->fax) ) : ?>
<?php echo JText::sprintf('COM_CONTACT_FAX_NUMBER', $item->fax); ?><br />
<?php endif; ?>
</div>
<?php echo $item->event->afterDisplayContent; ?>
</li>
<?php endif; ?>
<?php echo $this->pagination->getPagesLinks(); ?>
</div>
<?php endforeach; ?>
</ul>
<?php if ($this->params->get('show_pagination', 2)) : ?>
<div class="pagination">
<?php if ($this->params->def('show_pagination_results', 1)) : ?>
<p class="counter">
<?php echo $this->pagination->getPagesCounter(); ?>
</p>
<?php endif; ?>
<div>
<input type="hidden" name="filter_order" value="<?php echo $listOrder; ?>" />
<input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>" />
</div>
<?php echo $this->pagination->getPagesLinks(); ?>
</div>
<?php endif; ?>
<div>
<input type="hidden" name="filter_order" value="<?php echo $listOrder; ?>" />
<input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>" />
</div>
</form>
<?php endif; ?>

0 comments on commit 9782d77

Please sign in to comment.