Posted on: 08/29/19 09:04am
By: OMAL
Article.php under admin displays select menu.
Text Formatted Code
<form action="{form_url}" method="post" class="uk-form">
<div class="admin-list-search">
<div class="search-part">
{filter}
</div>
I want to customize this parameter, "filter". Because the website has hundreds topics and thousand of stories, default behavior is not suitable for the situation.
1. When admin is logged-in, the specific topic that is used most by admin, should be placed first of the drop-down list.
2 . When other members are logged-in, only the topic of the logged-in member should be listed.
How can I do that?
I tried to customize TOPIC_getTopicListSelect() function, but I coudn't understand it enough and didn't worked.
Re: Customize admin's searchmenu
Posted on: 08/29/19 04:04pm
By: Laugh
1. When admin is logged-in, the specific topic that is used most by admin, should be placed first of the drop-down list.
How is that to be decided?
2 . When other members are logged-in, only the topic of the logged-in member should be listed.
It should only list topics they have access to. I have a feeling this includes both read and edit access.
Re: Customize admin's searchmenu
Posted on: 08/30/19 07:45am
By: OMAL
Quote by: Laugh1. When admin is logged-in, the specific topic that is used most by admin, should be placed first of the drop-down list.
How is that to be decided?
In my situation, every active admin frequently uses only one topic, topic A, for posting articles. It doesn't change, it is always topic A. But select options for topics are more than 500 hundreds, so every time they have to search to select topic A from the hundreds of list. What I want to do is to place the topic A at the top of the list. So I want some advice to do that.
I think I could do that with dirty hack like picking up topic A from $_TOPIC and array shifting it. But I want to know easier way, if possible.
2 . When other members are logged-in, only the topic of the logged-in member should be listed.
It should only list topics they have access to. I have a feeling this includes both read and edit access.[/p]
I just want to know if you have some way to list options for topics the member have access to.
Thanks.
Re: Customize admin's searchmenu
Posted on: 08/30/19 08:51am
By: Laugh
It does only list topics that the user has access too, Topics that the user has read only (with no edit) access and topics that they have Edit (that includes read) access. If the user does not have access to the topic at all, it will not be displayed.
That being said (and maybe a feature request here for a checkbox in the search to toggle this option), if you only want to show topics for the filter that the user has edit access only
then try changing the line found in the file \admin\article.php and the function liststories (around line 122)
Text Formatted Code
$seltopics = TOPIC_getTopicListSelect($current_topic, 2);
changing it to:
Text Formatted Code
$seltopics = TOPIC_getTopicListSelect($current_topic, 2, false, '', false, 0, 2);
should show only topics they have edit access to. I think this will help since your writers should only have edit access to the topics they write for.
Let me know if this works as I cannot test it at the moment.
Re: Customize admin's searchmenu
Posted on: 09/16/19 02:58am
By: OMAL
Thanks. I'm sorry to replay late.
I'll try it.
Re: Customize admin's searchmenu
Posted on: 09/22/19 01:19am
By: OMAL
Let me know if this works as I cannot test it at the moment.[/p]
It didn't work, because your solution has 6 arguments, even though the function defines 6 arguments.
Anyway, I customized article.php and my problem is solved.
Thanks.
Re: Customize admin's searchmenu
Posted on: 09/22/19 10:18am
By: Laugh