Howdy, Stranger!

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

Sign In with Facebook Sign In with Google Sign In with OpenID Sign In with Twitter
Support for Vanilla Forums Cloud product

In this Discussion

  • S April 2011

Follow Us


Enable plugin for specific applications via dashboard

edited April 2011 in Questions
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.