Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.

 

MetaPlugin

MetaPlugin

Is there (already) a way to control Joomla Plugins with JomGenius?
I want to Enable and Disable certain Plugins based on JomGenius params.
Can this be done, or should we hope for MetaPlugin as a new product?

You are really Genuises!

goslingcools
Beginner Modder
ranks
useravatar
Offline
5 Posts
User info in posts
Administrator has disabled public posting

Re: MetaPlugin

:-)  You can wish!

There are currently no plans for such a product, although it has been requested several times. It seems that there are certain types of plugins (mostly Content plugins) that people want to be able to apply to different pages, or at different times.

I haven't looked at what it would take to control the Plugin loading in the same way as the Template or Module loading. My guess is that there may not be an official way to control the process - but that doesn't mean it's impossible! I'll take a look at it one of these days, but please don't hold your breath waiting for it!

Cheers,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3312 Posts
User info in posts
Administrator has disabled public posting

Re: MetaPlugin

Ok, that's clear. So for now I keep on modifying the plugins that I want to control, by inserting part of your JomGenius code. Hope these plugins get not to many updates... I don't like modifying core stuff anyway :-(

Still keep whishing... ;-)

goslingcools
Beginner Modder
ranks
useravatar
Offline
5 Posts
User info in posts
Administrator has disabled public posting

Re: MetaPlugin

I just had a very quick look at what it would take to override the plugin system to allow rules to control when different plugins are activated.

The way I'd *like* to be able to do this would be very difficult to achieve. MetaMod Pro for example uses a system plugin that sets up a new module management system. It can do this because the system plugin gets run very early, before the standard module system gets used for the first time, so it can insert its own system, and the rest of Joomla just starts to use the new system.

However for plugins there's a catch-22... the new plugin management system could only be loaded by the old plugin system, and by the time the old one is loaded it's too late to override it.

Another way might be like this: I make a content plugin that is able to "pull in" other content plugins, just like MetaMod does with modules.

So to use it, you'd have to "unpublish" the content plugins that MetaPlugin is going to deal with. Then you'd edit the MetaPlugin parameters and select from a list of Content plugins that it's going to run.

MetaPlugin would be a standard Content plugin... and whenever it got triggered it would just forward the request on to its own set of plugins, according to whatever rules you have set up.

Now I can see a few issues along the way:

1 - You'd need a separate MetaPlugin for each plugin type - e.g. content, system, authentication, editors, editors-xtd, search, user and xml-rpc. Also if you wanted to control any other component-specific plugins you would need to create a MetaPlugin specifically for that plugin type.

2 - There's not much space in the plugin parameters panel to put a comprehensive interface to everything you might want to control (same situation as for MetaMod)...

3 - What sort of interface could this have? You could go for a basic PHP config like MetaMod has, or a rule-based interface like MetaTemplate Pro, or a restricted set of conditions like Advanced Module Manager.

The complexity of the task is that you're dealing with a set of plugins that you may want to programatically:
- reorder
- turn on or off
- assign to different dates/times/pages/browsers etc.


Gosling, in your case what sort of plugins are you wanting to control? And what sort of conditions are you wanting to apply to control them?


Just thinking out loud...

Cheers,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3312 Posts
User info in posts
Administrator has disabled public posting

Re: MetaPlugin

Wow, that's complex indeed!
Very nice of you to dive into this. Feel almost guilty.

One application example for me is:
I use the JsIFR3 Pro plugin from http://www.freakedout.de/joomlaextensions/
But I noticed that (my) Android phone crashes on this plugin so I want to skip it for Androidbrowsers.

So I would like to use (the non-existing) MetaPlugin to detect the browser (android) and skip the JsIFR3 Pro plugin.
This way I could leave the core of the JsIFR3 Pro plugin as is.

But since the MetaPlugin does not yet exist I did do the manipulation of the JsIFR3 Pro plugin core like this:

Stole some code from the JomGenius class.... :-(

So in the JsIFR3 Pro plugin I added these lines:

$UA  = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '';
if (strstr($UA, 'Android')) $m_browser = true;

if  ($m_browser == false)  {
..
here the original JsIFR3 Pro plugin code
..
}

This I would have to do with each plugin I want to skip for some reason.

You see, a MetaPlugin that could disable/enable Joomla plugins based on JomGenius params would be perfect.

But I understand that executing plugins is totally different from modules and this makes it hard.

Regards,

Gosling Cools

goslingcools
Beginner Modder
ranks
useravatar
Offline
5 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1666
Total Polls:
6
Total Posts:
5909
Dormant:
User Info:
 
Total Users:
10091
Newest User:
lamanaudio
Members Online:
3
Guests Online:
148


Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked