Fork me on GitHub

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Try Vanilla Forums Cloud product

In this Discussion

Ready to contribute?

Amazing! Sign our contributors' agreement and then join us on GitHub.

Current release is 2.1.6 (21 Nov 2014).

Users who have not yet upgraded to 2.1 should get security release 2.0.18.14 (1 Nov 2014). We will stop providing these security releases to 2.0 at the end of this year.

Enable plugin for specific applications via dashboard

edited April 2011 in Vanilla 2.0 Help
Hi there,

I've been looking for a way (without any luck) of having a system in one of my plugins that allows the admin to enable it for some applications.

For example i have a plugin and I have 6 applications in my applications folder. I want to have in the dashboard settings a list with all the 6 applications which can be selected/deselected, in turn enabling or disabling the default load of the plugin in that application.

So far, I didn't manage to find any way by which one can dynamically add/remove a plugin to a application and I wanted to ask to see if any1 knows. Also, if there is a function that prints out all application that would be nice as well (currently I manually scan for them in the folder)

Thanks,
Stefan

Comments

  • SS ✭✭
    edited April 2011
    There is a way (depends what plugin do).
    Use 'AfterEnabledApplication' event in plugin.

    public function Gdn_Dispatcher_AfterEnabledApplication_Handler(&$Sender) {
    $this->_EnabledApplication = ArrayValue('EnabledApplication', $Sender->EventArguments, 'Dashboard');
    }

    public function Base_Render_Before($Sender) {
    if (in_array($this->_EnabledApplication, array('Vanilla', 'IceCream', 'Boom', 'Milk')) {
    // do someting
    if ($Sender->DeliveryType() == DELIVERY_TYPE_ALL
    && $Sender->SyndicationMethod == SYNDICATION_NONE) {

    }
    }

    }
Sign In or Register to comment.