A plugin must declare an action the long way

live627

  • Should five per cent appear too small / Be thankful I don't take it all / 'Cause I'm the taxman, yeah I'm the taxman
  • Posts: 1,670
A plugin must declare an action the long way
« on May 29th, 2013, 11:09 AM »
I see
Quote
// Remember, if the function is the same as the filename, you may declare it just once.
iin the man index file. However, a plugin must still declare their action the long way.

Note that this isn't through the XML interface.
A confident man keeps quiet.whereas a frightened man keeps talking, hiding his fear.

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: A plugin must declare an action the long way
« Reply #1, on May 29th, 2013, 04:15 PM »
Um, why aren't you using the XML interface? Just curious.
Posted: May 29th, 2013, 02:47 PM

So I looked at this and realised that by necessity it must do that seeing how it needs all three parameters to be able to get the plugin id. But in almost every case a plugin should be using the XML interface; it should only ever need the hook directly if it's going to dynamically generate actions that aren't pre-known at the point of registering the plugin.
When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest. | Game Memorial

Dragooon

  • I can code! Really!
  • polygon.com has to be one of the best sites I've seen recently.
  • Posts: 1,841
The way it's meant to be

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: A plugin must declare an action the long way
« Reply #3, on May 29th, 2013, 06:00 PM »
Would a portal really be creating its own *dynamic actions*? I haven't seen any portal do that for SMF. Static actions (action=forum) and pages (page=x), yes, but not dynamically allocated action=item.

And for those rare cases it's going to happen, doing it the long way really is a minor deal, no?

Mind you, I've made it clear that I want to see a CMS of sorts in the core in more recent times, so I'm not really sensing this to be a real world problem ;)

live627

  • Should five per cent appear too small / Be thankful I don't take it all / 'Cause I'm the taxman, yeah I'm the taxman
  • Posts: 1,670