Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mod_articles_latest] Option for choose an specific author(s) #20687

Merged
merged 5 commits into from
Jun 18, 2018
Merged
Show file tree
Hide file tree
Changes from 3 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
3 changes: 3 additions & 0 deletions language/en-GB/en-GB.mod_articles_latest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
; Note : All ini files need to be saved as UTF-8

MOD_ARTICLES_LATEST="Articles - Latest"
MOD_LATEST_NEWS_FIELD_AUTHOR_DESC="Select one or more authors from the list below."
Copy link
Contributor

Choose a reason for hiding this comment

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

Change to Select one or more authors.. The list is not below but next to the label.

Copy link
Member Author

Choose a reason for hiding this comment

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

Done, thank you. Also i change the label, for -> Created by author(s)

MOD_LATEST_NEWS_FIELD_AUTHOR_LABEL="Created by author(s)"
Copy link
Contributor

Choose a reason for hiding this comment

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

Please capitalize Created by Authors since it is a label.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sorry, done

MOD_LATEST_NEWS_FIELD_CATEGORY_DESC="Selects Articles from one or more Categories. If no selection will show all categories as default."
MOD_LATEST_NEWS_FIELD_COUNT_DESC="The number of Articles to display (the default is 5)."
MOD_LATEST_NEWS_FIELD_COUNT_LABEL="Count"
Expand All @@ -15,6 +17,7 @@ MOD_LATEST_NEWS_FIELD_USER_DESC="Filter by author."
MOD_LATEST_NEWS_FIELD_USER_LABEL="Authors"
MOD_LATEST_NEWS_VALUE_ADDED_BY_ME="Added or modified by me"
MOD_LATEST_NEWS_VALUE_ANYONE="Anyone"
MOD_LATEST_NEWS_VALUE_CREATED_BY="Created by"
MOD_LATEST_NEWS_VALUE_NOTADDED_BY_ME="Not added or modified by me"
MOD_LATEST_NEWS_VALUE_ONLY_SHOW_FEATURED="Only show Featured Articles"
MOD_LATEST_NEWS_VALUE_RECENT_ADDED="Recently Added First"
Expand Down
4 changes: 4 additions & 0 deletions modules/mod_articles_latest/helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ public static function getList(&$params)
$model->setState('filter.author_id.include', false);
break;

case 'created_by' :
$model->setState('filter.author_id', $params->get('author', array()));
break;

case '0' :
break;

Expand Down
10 changes: 10 additions & 0 deletions modules/mod_articles_latest/mod_articles_latest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,17 @@
<option value="0">MOD_LATEST_NEWS_VALUE_ANYONE</option>
<option value="by_me">MOD_LATEST_NEWS_VALUE_ADDED_BY_ME</option>
<option value="not_me">MOD_LATEST_NEWS_VALUE_NOTADDED_BY_ME</option>
<option value="created_by">MOD_LATEST_NEWS_VALUE_CREATED_BY</option>
</field>

<field
name="author"
type="author"
label="MOD_LATEST_NEWS_FIELD_AUTHOR_LABEL"
description="MOD_LATEST_NEWS_FIELD_AUTHOR_DESC"
multiple="true"
showon="user_id:created_by"
/>
</fieldset>

<fieldset name="advanced">
Expand Down