Skip to content

Commit

Permalink
Merge branch '4.0-dev' into j4/fix/associations
Browse files Browse the repository at this point in the history
  • Loading branch information
laoneo authored Jun 26, 2018
2 parents fb82795 + 782a498 commit 720f944
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 89 deletions.
2 changes: 1 addition & 1 deletion components/com_newsfeeds/tmpl/categories/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
HTMLHelper::_('script', 'com_newsfeeds/categories-default.js', ['relative' => true, 'version' => 'auto']);

?>
<div class="categories-list">
<div class="com-newsfeeds-categories categories-list">
<?php echo JLayoutHelper::render('joomla.content.categories_default', $this); ?>
<?php echo $this->loadTemplate('items'); ?>
</div>
10 changes: 5 additions & 5 deletions components/com_newsfeeds/tmpl/categories/default_items.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
use Joomla\Component\Newsfeeds\Site\Helper\Route as NewsfeedsHelperRoute;

?>
<?php $class = ' class="first"'; ?>
<?php $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())) : ?>
<?php if (!isset($this->items[$this->parent->id][$id + 1])) : ?>
<?php $class = ' class="last"'; ?>
<?php $class = 'last'; ?>
<?php endif; ?>
<div<?php echo $class; ?>>
<div class="com-newsfeeds-categories__items <?php echo $class; ?>">
<?php $class = ''; ?>
<h3 class="page-header item-title">
<a href="<?php echo JRoute::_(NewsfeedsHelperRoute::getCategoryRoute($item->id, $item->language)); ?>">
Expand All @@ -40,13 +40,13 @@
</h3>
<?php if ($this->params->get('show_subcat_desc_cat') == 1) : ?>
<?php if ($item->description) : ?>
<div class="category-desc">
<div class="com-newsfeeds-categories__description category-desc">
<?php echo JHtml::_('content.prepare', $item->description, '', 'com_newsfeeds.categories'); ?>
</div>
<?php endif; ?>
<?php endif; ?>
<?php if (count($item->getChildren()) > 0 && $this->maxLevelcat > 1) : ?>
<div class="collapse fade" id="category-<?php echo $item->id; ?>">
<div class="com-newsfeeds-categories__children collapse fade" id="category-<?php echo $item->id; ?>">
<?php $this->items[$item->id] = $item->getChildren(); ?>
<?php $this->parent = $item; ?>
<?php $this->maxLevelcat--; ?>
Expand Down
6 changes: 3 additions & 3 deletions components/com_newsfeeds/tmpl/category/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
$pageClass = $this->params->get('pageclass_sfx');

?>
<div class="newsfeed-category">
<div class="com-newsfeeds-category newsfeed-category">
<?php if ($this->params->get('show_page_heading')) : ?>
<h1>
<?php echo $this->escape($this->params->get('page_heading')); ?>
Expand All @@ -29,7 +29,7 @@
<?php echo $this->category->tagLayout->render($this->category->tags->itemTags); ?>
<?php endif; ?>
<?php if ($this->params->get('show_description', 1) || $this->params->def('show_description_image', 1)) : ?>
<div class="category-desc">
<div class="com-newsfeeds-category__description category-desc">
<?php if ($this->params->get('show_description_image') && $this->category->getParams()->get('image')) : ?>
<img src="<?php echo $this->category->getParams()->get('image'); ?>">
<?php endif; ?>
Expand All @@ -41,7 +41,7 @@
<?php endif; ?>
<?php echo $this->loadTemplate('items'); ?>
<?php if ($this->maxLevel != 0 && !empty($this->children[$this->category->id])) : ?>
<div class="cat-children">
<div class="com-newsfeeds-category__children cat-children">
<h3>
<?php echo JText::_('JGLOBAL_SUBCATEGORIES'); ?>
</h3>
Expand Down
152 changes: 78 additions & 74 deletions components/com_newsfeeds/tmpl/category/default_items.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,82 +14,86 @@
$listDirn = $this->escape($this->state->get('list.direction'));

?>
<?php if (empty($this->items)) : ?>
<p><?php echo JText::_('COM_NEWSFEEDS_NO_ARTICLES'); ?></p>
<?php else : ?>
<form action="<?php echo htmlspecialchars(JUri::getInstance()->toString(), ENT_COMPAT, 'UTF-8'); ?>" method="post" name="adminForm" id="adminForm">
<?php if ($this->params->get('filter_field') !== 'hide' || $this->params->get('show_pagination_limit')) : ?>
<fieldset class="filters btn-toolbar">
<?php if ($this->params->get('filter_field') !== 'hide' && $this->params->get('filter_field') == '1') : ?>
<div class="btn-group">
<label class="filter-search-lbl sr-only" for="filter-search">
<span class="badge badge-warning">
<?php echo JText::_('JUNPUBLISHED'); ?>
</span>
<?php echo JText::_('COM_NEWSFEEDS_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_NEWSFEEDS_FILTER_SEARCH_DESC'); ?>" placeholder="<?php echo JText::_('COM_NEWSFEEDS_FILTER_SEARCH_DESC'); ?>">
</div>
<?php endif; ?>
<?php if ($this->params->get('show_pagination_limit')) : ?>
<div class="btn-group float-right">
<label for="limit" class="sr-only">
<?php echo JText::_('JGLOBAL_DISPLAY_NUM'); ?>
</label>
<?php echo $this->pagination->getLimitBox(); ?>
</div>
<?php endif; ?>
</fieldset>
<?php endif; ?>
<ul class="category list-striped list-condensed">
<?php foreach ($this->items as $i => $item) : ?>
<?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; ?>">
<?php endif; ?>
<?php if ($this->params->get('show_articles')) : ?>
<span class="list-hits badge badge-info float-right">
<?php echo JText::sprintf('COM_NEWSFEEDS_NUM_ARTICLES_COUNT', $item->numarticles); ?>
</span>
<?php endif; ?>
<span class="list float-left">
<div class="list-title">
<a href="<?php echo JRoute::_(NewsFeedsHelperRoute::getNewsfeedRoute($item->slug, $item->catid)); ?>">
<?php echo $item->name; ?>
</a>
</div>
</span>
<?php if ($this->items[$i]->published == 0) : ?>
<span class="badge badge-warning">
<?php echo JText::_('JUNPUBLISHED'); ?>
</span>
<?php endif; ?>
<br>
<?php if ($this->params->get('show_link')) : ?>
<?php $link = JStringPunycode::urlToUTF8($item->link); ?>

<div class="com-newsfeeds-category__items">
<?php if (empty($this->items)) : ?>
<p><?php echo JText::_('COM_NEWSFEEDS_NO_ARTICLES'); ?></p>
<?php else : ?>
<form action="<?php echo htmlspecialchars(JUri::getInstance()->toString(), ENT_COMPAT, 'UTF-8'); ?>" method="post" name="adminForm" id="adminForm">
<?php if ($this->params->get('filter_field') !== 'hide' || $this->params->get('show_pagination_limit')) : ?>
<fieldset class="com-newsfeeds-category__filters filters btn-toolbar">
<?php if ($this->params->get('filter_field') !== 'hide' && $this->params->get('filter_field') == '1') : ?>
<div class="btn-group">
<label class="filter-search-lbl sr-only" for="filter-search">
<span class="badge badge-warning">
<?php echo JText::_('JUNPUBLISHED'); ?>
</span>
<?php echo JText::_('COM_NEWSFEEDS_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_NEWSFEEDS_FILTER_SEARCH_DESC'); ?>" placeholder="<?php echo JText::_('COM_NEWSFEEDS_FILTER_SEARCH_DESC'); ?>">
</div>
<?php endif; ?>
<?php if ($this->params->get('show_pagination_limit')) : ?>
<div class="btn-group float-right">
<label for="limit" class="sr-only">
<?php echo JText::_('JGLOBAL_DISPLAY_NUM'); ?>
</label>
<?php echo $this->pagination->getLimitBox(); ?>
</div>
<?php endif; ?>
</fieldset>
<?php endif; ?>
<ul class="com-newsfeeds-category__category category list-striped list-condensed">
<?php foreach ($this->items as $i => $item) : ?>
<?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; ?>">
<?php endif; ?>
<?php if ($this->params->get('show_articles')) : ?>
<span class="list-hits badge badge-info float-right">
<?php echo JText::sprintf('COM_NEWSFEEDS_NUM_ARTICLES_COUNT', $item->numarticles); ?>
</span>
<?php endif; ?>
<span class="list float-left">
<a href="<?php echo $item->link; ?>">
<?php echo $link; ?>
</a>
<div class="list-title">
<a href="<?php echo JRoute::_(NewsFeedsHelperRoute::getNewsfeedRoute($item->slug, $item->catid)); ?>">
<?php echo $item->name; ?>
</a>
</div>
</span>
<?php if ($this->items[$i]->published == 0) : ?>
<span class="badge badge-warning">
<?php echo JText::_('JUNPUBLISHED'); ?>
</span>
<?php endif; ?>
<br>
<?php endif; ?>
</li>
<?php endforeach; ?>
</ul>
<?php // Add pagination links ?>
<?php if (!empty($this->items)) : ?>
<?php if (($this->params->def('show_pagination', 2) == 1 || ($this->params->get('show_pagination') == 2)) && ($this->pagination->pagesTotal > 1)) : ?>
<div class="w-100">
<?php if ($this->params->def('show_pagination_results', 1)) : ?>
<p class="counter float-right pt-3 pr-2">
<?php echo $this->pagination->getPagesCounter(); ?>
</p>
<?php if ($this->params->get('show_link')) : ?>
<?php $link = JStringPunycode::urlToUTF8($item->link); ?>
<span class="list float-left">
<a href="<?php echo $item->link; ?>">
<?php echo $link; ?>
</a>
</span>
<br>
<?php endif; ?>
<?php echo $this->pagination->getPagesLinks(); ?>
</div>
</li>
<?php endforeach; ?>
</ul>
<?php // Add pagination links ?>
<?php if (!empty($this->items)) : ?>
<?php if (($this->params->def('show_pagination', 2) == 1 || ($this->params->get('show_pagination') == 2)) && ($this->pagination->pagesTotal > 1)) : ?>
<div class="com-newsfeeds-category__pagination w-100">
<?php if ($this->params->def('show_pagination_results', 1)) : ?>
<p class="counter float-right pt-3 pr-2">
<?php echo $this->pagination->getPagesCounter(); ?>
</p>
<?php endif; ?>
<?php echo $this->pagination->getPagesLinks(); ?>
</div>
<?php endif; ?>
<?php endif; ?>
<?php endif; ?>
</form>
<?php endif; ?>
</form>
<?php endif; ?>
</div>

12 changes: 6 additions & 6 deletions components/com_newsfeeds/tmpl/newsfeed/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<?php $direction = ' redirect-rtl'; ?>
<?php endif; ?>
<?php $images = json_decode($this->item->images); ?>
<div class="newsfeed<?php echo $direction; ?>">
<div class="com-newsfeeds-newsfeed newsfeed<?php echo $direction; ?>">
<?php if ($this->params->get('display_num')) : ?>
<h1 class="<?php echo $direction; ?>">
<?php echo $this->escape($this->params->get('page_heading')); ?>
Expand All @@ -55,7 +55,7 @@
<!-- Show Images from Component -->
<?php if (isset($images->image_first) && !empty($images->image_first)) : ?>
<?php $imgfloat = empty($images->float_first) ? $this->params->get('float_first') : $images->float_first; ?>
<div class="img-intro-<?php echo htmlspecialchars($imgfloat, ENT_COMPAT, 'UTF-8'); ?>">
<div class="com-newsfeeds-newsfeed__first-image img-intro-<?php echo htmlspecialchars($imgfloat, ENT_COMPAT, 'UTF-8'); ?>">
<img
<?php if ($images->image_first_caption) : ?>
<?php echo 'class="caption"' . ' title="' . htmlspecialchars($images->image_first_caption, ENT_COMPAT, 'UTF-8') . '"'; ?>
Expand All @@ -66,7 +66,7 @@

<?php if (isset($images->image_second) and !empty($images->image_second)) : ?>
<?php $imgfloat = empty($images->float_second) ? $this->params->get('float_second') : $images->float_second; ?>
<div class="pull-<?php echo htmlspecialchars($imgfloat, ENT_COMPAT, 'UTF-8'); ?> item-image">
<div class="com-newsfeeds-newsfeed__second-image pull-<?php echo htmlspecialchars($imgfloat, ENT_COMPAT, 'UTF-8'); ?> item-image">
<img
<?php if ($images->image_second_caption) : ?>
<?php echo 'class="caption"' . ' title="' . htmlspecialchars($images->image_second_caption) . '"'; ?>
Expand All @@ -79,21 +79,21 @@
<!-- Show Feed's Description -->

<?php if ($this->params->get('show_feed_description')) : ?>
<div class="feed-description">
<div class="com-newsfeeds-newsfeed__description feed-description">
<?php echo str_replace('&apos;', "'", $this->rssDoc->description); ?>
</div>
<?php endif; ?>

<!-- Show Image -->
<?php if (isset($this->rssDoc->image, $this->rssDoc->imagetitle) && $this->params->get('show_feed_image')) : ?>
<div>
<div class="com-newsfeeds-newsfeed__feed-image">
<img src="<?php echo $this->rssDoc->image; ?>" alt="<?php echo $this->rssDoc->image->decription; ?>">
</div>
<?php endif; ?>

<!-- Show items -->
<?php if (!empty($this->rssDoc[0])) : ?>
<ol>
<ol class="com-newsfeeds-newsfeed__items">
<?php for ($i = 0; $i < $this->item->numarticles; $i++) : ?>
<?php if (empty($this->rssDoc[$i])) : ?>
<?php break; ?>
Expand Down

0 comments on commit 720f944

Please sign in to comment.