DIRECT NEWS EDIT ACTION LINK for specific user

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Locked
pWorker
Forum Members
Forum Members
Posts: 48
Joined: Wed Aug 31, 2016 1:30 pm

DIRECT NEWS EDIT ACTION LINK for specific user

Post by pWorker »

Hi all,

i have a problem:
There is no real search for news-articles in the backend (the admin search didn`t even find a news article even when i insert the whole url to it...). So if the admin has to correct a specific article he saw in frontend, he has to look up every single article in the article list in the backend to find the right one.

My idea is now, that when the admin/ a specific user is logged in, every article in the frontend shows him an action-link to edit that specific article.

Code in news-summarydetail-tpl:

Code: Select all

{foreach}
...
{feu_smarty::get_current_userid()}
{if $current_userid == 1} 
{cms_action_url module=News action=editarticle}
{/if}
...
{/foreach}
Would that be a secure solution for it?


Thanks is advance!
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: DIRECT NEWS EDIT ACTION LINK for specific user

Post by calguy1000 »

you can use {$uid=get_userid(false)} to get the uid of the currently logged in admin user. it will be empty'/0 if the user is not logged in.
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
pWorker
Forum Members
Forum Members
Posts: 48
Joined: Wed Aug 31, 2016 1:30 pm

Re: DIRECT NEWS EDIT ACTION LINK for specific user

Post by pWorker »

Hi calguy,

thx for your hint, I will use that if the link is created propper.

Now, this code:

Code: Select all

{cms_action_url module=News action=editarticle mid=m1_}
gives me this url:

Code: Select all

http://www.xxx.de/index.php?mact=News,cntnt01,editarticle,0&cntnt01returnid=13
...which results in errors like...

Code: Select all

Syntax error in template "module_file_tpl:News;editarticle.tpl"  on line 151 "*{$titletext}: {cms_help key='help_article_title' title=$titletext}" unknown tag "cms_help"
As far as i could understand, the returnid has to be set to the admin editarticle interface. Also the action id has to be set to m1_, not cntnt01.

But are there returnids for the admin pages? And why didn`t the call accept the "mid" parameter?


Thanks in advance!
chandra

Re: DIRECT NEWS EDIT ACTION LINK for specific user

Post by chandra »

pWorker wrote: Now, this code:

Code: Select all

{cms_action_url module=News action=editarticle mid=m1_}
gives me this url:

Code: Select all

http://www.xxx.de/index.php?mact=News,cntnt01,editarticle,0&cntnt01returnid=13
It seems plugin is only usable for frontend actions. Url must be something like

Code: Select all

http://www.domain.com/admin/moduleinterface.php?mact=News,m1_,editarticle,0&_sx_=4bd3085239f8ee95&m1_articleid=1
Have seen some times ago a modification of the old CMSMS edit plugin out there which create links for different backend actions.
User avatar
Rolf
Dev Team Member
Dev Team Member
Posts: 7825
Joined: Wed Apr 23, 2008 7:53 am
Location: The Netherlands
Contact:

Re: DIRECT NEWS EDIT ACTION LINK for specific user

Post by Rolf »

- + - + - + - + - + - + -
LATEST TUTORIAL AT CMS CAN BE SIMPLE:
Migrating Company Directory module to LISE
- + - + - + - + - + - + -
Image
pWorker
Forum Members
Forum Members
Posts: 48
Joined: Wed Aug 31, 2016 1:30 pm

Re: DIRECT NEWS EDIT ACTION LINK for specific user

Post by pWorker »

Hey Rolf,

I`ll definitely give that one a try. Sounds good!
Meanwhile I also registered to another cmsms forum with my question and i got the information, that the cms_action_url plugin gets actualized over the next 4 weeks.

Thanks for your help!
Locked

Return to “Modules/Add-Ons”