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
1 change: 1 addition & 0 deletions language/en-GB/mod_articles.ini
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ MOD_ARTICLES_OPTION_NORMAL_VALUE="Normal"
MOD_ARTICLES_OPTION_OFF_VALUE="Off"
MOD_ARTICLES_OPTION_ONLYARCHIVEDHIDE_VALUE="None"
MOD_ARTICLES_OPTION_ONLYARCHIVEDSHOW_VALUE="Only"
MOD_ARTICLES_OPTION_ONLYCURRENTUSER_VALUE="Only from current user"
MOD_ARTICLES_OPTION_ONLYFEATURED_VALUE="Only"
MOD_ARTICLES_OPTION_ORDERINGFEATURED_VALUE="Featured Articles Order"
MOD_ARTICLES_OPTION_ORDERING_VALUE="Article Order"
Expand Down
2 changes: 2 additions & 0 deletions modules/mod_articles/mod_articles.xml
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,7 @@
>
<option value="0">MOD_ARTICLES_OPTION_EXCLUSIVE_VALUE</option>
<option value="1">MOD_ARTICLES_OPTION_INCLUSIVE_VALUE</option>
<option value="2">MOD_ARTICLES_OPTION_ONLYCURRENTUSER_VALUE</option>
</field>

<field
Expand All @@ -516,6 +517,7 @@
layout="joomla.form.field.list-fancy-select"
filter="intarray"
class="multipleAuthors"
showon="author_filtering_type!:2"
/>

<field
Expand Down
17 changes: 14 additions & 3 deletions modules/mod_articles/src/Helper/ArticlesHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,12 @@ public function getArticles(Registry $params, SiteApplication $app)
$articles->setState('list.limit', (int) $params->get('count', 0));
$articles->setState('load_tags', $params->get('show_tags', 0) || $params->get('article_grouping', 'none') === 'tags');

// Get the user object
$user = $app->getIdentity();

// Access filter
$access = !ComponentHelper::getParams('com_content')->get('show_noauth');
$authorised = Access::getAuthorisedViewLevels($app->getIdentity()->get('id'));
$authorised = Access::getAuthorisedViewLevels($user->id);
$articles->setState('filter.access', $access);

$catids = $params->get('catid');
Expand Down Expand Up @@ -140,9 +143,17 @@ public function getArticles(Registry $params, SiteApplication $app)
// Filter by multiple tags
$articles->setState('filter.tag', $params->get('filter_tag', []));

// Filter by featured
$articles->setState('filter.featured', $params->get('show_featured', 'show'));
$articles->setState('filter.author_id', $params->get('created_by', []));
$articles->setState('filter.author_id.include', $params->get('author_filtering_type', 1));

// Filter by author
if ($params->get('author_filtering_type', 1) === 2) {
$articles->setState('filter.author_id', [$user->id]);
} else {
$articles->setState('filter.author_id', $params->get('created_by', []));
$articles->setState('filter.author_id.include', $params->get('author_filtering_type', 1));
}

$articles->setState('filter.author_alias', $params->get('created_by_alias', []));
$articles->setState('filter.author_alias.include', $params->get('author_alias_filtering_type', 1));

Expand Down
11 changes: 4 additions & 7 deletions modules/mod_articles/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

use Joomla\CMS\Helper\ModuleHelper;
use Joomla\CMS\Language\Text;
use Joomla\String\StringHelper;

/** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = $app->getDocument()->getWebAssetManager();
Expand All @@ -37,14 +36,12 @@
$layoutSuffix = $params->get('title_only', 1) ? '_titles' : '_items';

?>


<?php if ($grouped) : ?>
<?php foreach ($list as $groupName => $items) : ?>
<div class="mod-articles-group">
<<?php echo $groupHeading; ?>><?php echo Text::_($groupName); ?></<?php echo $groupHeading; ?>>
<?php require ModuleHelper::getLayoutPath('mod_articles', $params->get('layout', 'default') . $layoutSuffix); ?>
</div>
<div class="mod-articles-group">
<<?php echo $groupHeading; ?>><?php echo Text::_($groupName); ?></<?php echo $groupHeading; ?>>
<?php require ModuleHelper::getLayoutPath('mod_articles', $params->get('layout', 'default') . $layoutSuffix); ?>
</div>
<?php endforeach; ?>
<?php else : ?>
<?php $items = $list; ?>
Expand Down