Howto make a single Joomla plugin respond to various events from different "plugin groups"

23 views
Skip to first unread message

it-sol...@schultz.ch

unread,
Aug 18, 2017, 4:09:06 AM8/18/17
to Joomla! General Development
Hello,

I am developing a plugin that should react on a number of events from different groups, e.g. "Authentication", "User", "Content", possibly also "System".

I found this discussion here (which is about a similar issue, but from 2012):
https://groups.google.com/forum/#!searchin/joomla-dev-general/plugin$20multiple$20groups|sort:relevance/joomla-dev-general/OBR56YR0nmc/Z_GML1EstXUJ

but I could not actually find a detailed information about how to achieve this (short from creating individual plugins for each group).

So far, my approach is to create multiple plugin classes within the plugin-file, starting with the "System class extending jPlugin"
and then defining the "other classes extending the system class"

But I think I need to register the classes methods to the relevant dispatcher, but I could not find a good tutorial on what that means in detail.

Is my approach valid anyway?
Could someone guide me to an "in-depth" description on how to "fully control plugin response to events"?

Sorry, I am developing Joomla components, but this is my first encounter with "in depth" plugin management...

I hope someone can guide me a little bit

kind regards
Ruediger Schultz

Denis Ryabov

unread,
Aug 18, 2017, 4:19:23 AM8/18/17
to joomla-de...@googlegroups.com
Hello, Ruediger!

Plugins of the system group are able to process any Joomla's event. Groups were designed to affect loading of plugins (to don't load all plugins at once), not to filter events in any way.

18.08.2017, 11:09, "it-sol...@schultz.ch" <it-sol...@schultz.ch>:
> --
> You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-gene...@googlegroups.com.
> To post to this group, send an email to joomla-de...@googlegroups.com.
> Visit this group at https://groups.google.com/group/joomla-dev-general.
> For more options, visit https://groups.google.com/d/optout.

-------
Best regards,
Denis Ryabov

it-sol...@schultz.ch

unread,
Aug 18, 2017, 5:05:20 AM8/18/17
to Joomla! General Development
Thanks Denis for your "lightspeed" reply.

I might confuse some things here, so let me be VERY specific.

I do have a "system" plugin. If all "event" methods I need to react on are defined within that "plgsystemPluginname" class, they should get fired accordingly?
I am listing the events I need here for reference:

USER / onUserBeforeSave
AUTHENTICATION / onUserAuthenticate
CONTENT / onContentPrepare

I seem to remember that "AUTHENTICATION" is kind of different.
And on CONTENT, it seems my plugin does not react, if the context is "com_content.article" (which I would need)






Am Freitag, 18. August 2017 10:19:23 UTC+2 schrieb Denis Ryabov:
Hello, Ruediger!

Plugins of the system group are able to process any Joomla's event. Groups were designed to affect loading of plugins (to don't load all plugins at once), not to filter events in any way.

18.08.2017, 11:09, "it-sol...@schultz.ch" <it-sol...@schultz.ch>:
> Hello,
>
> I am developing a plugin that should react on a number of events from different groups, e.g. "Authentication", "User", "Content", possibly also "System".
>
> I found this discussion here (which is about a similar issue, but from 2012):
> https://groups.google.com/forum/#!searchin/joomla-dev-general/plugin$20multiple$20groups|sort:relevance/joomla-dev-general/OBR56YR0nmc/Z_GML1EstXUJ
>
> but I could not actually find a detailed information about how to achieve this (short from creating individual plugins for each group).
>
> So far, my approach is to create multiple plugin classes within the plugin-file, starting with the "System class extending jPlugin"
> and then defining the "other classes extending the system class"
>
> But I think I need to register the classes methods to the relevant dispatcher, but I could not find a good tutorial on what that means in detail.
>
> Is my approach valid anyway?
> Could someone guide me to an "in-depth" description on how to "fully control plugin response to events"?
>
> Sorry, I am developing Joomla components, but this is my first encounter with "in depth" plugin management...
>
> I hope someone can guide me a little bit
>
> kind regards
> Ruediger Schultz
>
> --
> You received this message because you are subscribed to the Google Groups "Joomla! General Development" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to joomla-dev-general+unsub...@googlegroups.com.

it-sol...@schultz.ch

unread,
Aug 18, 2017, 6:22:04 AM8/18/17
to Joomla! General Development
You're right, it indeed seems to work (as far as I can tell from a quick test).
so never mind - but thank you for your help !!!
cheers
Ruediger
Reply all
Reply to author
Forward
0 new messages