diff --git a/language/en-GB/mod_articles.ini b/language/en-GB/mod_articles.ini index d7a2d7d0485d9..b18021bd1220d 100644 --- a/language/en-GB/mod_articles.ini +++ b/language/en-GB/mod_articles.ini @@ -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" diff --git a/modules/mod_articles/mod_articles.xml b/modules/mod_articles/mod_articles.xml index bd0d2ad7fda07..8f134fd767c5e 100644 --- a/modules/mod_articles/mod_articles.xml +++ b/modules/mod_articles/mod_articles.xml @@ -506,6 +506,7 @@ > + 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'); @@ -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)); diff --git a/modules/mod_articles/tmpl/default.php b/modules/mod_articles/tmpl/default.php index 1bbbc6a08e276..9aafe3b11f565 100644 --- a/modules/mod_articles/tmpl/default.php +++ b/modules/mod_articles/tmpl/default.php @@ -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(); @@ -37,14 +36,12 @@ $layoutSuffix = $params->get('title_only', 1) ? '_titles' : '_items'; ?> - - $items) : ?> -
- <>> - get('layout', 'default') . $layoutSuffix); ?> -
+
+ <>> + get('layout', 'default') . $layoutSuffix); ?> +