Vanilla open source was terminated 1 January 2025 by Higher Logic. See this announcement for more information.

Enable plugin for specific applications via dashboard

edited April 2011 in Vanilla 2.0 - 2.8
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.