Roundcube Community Forum

Third Party Contributions => API Based Plugins => Topic started by: horfic on September 09, 2009, 11:23:37 AM

Title: Check Plugin
Post by: horfic on September 09, 2009, 11:23:37 AM
How can i check if a plugin is activated in the main config?
Title: Check Plugin
Post by: JohnDoh on September 09, 2009, 01:59:54 PM
look for $rcmail_config['plugins'], if the plugin is in the array then it is activated.
Title: Check Plugin
Post by: horfic on September 09, 2009, 04:01:18 PM
$rcmail_config['plugin'] didn't work so i accessed the config with rcmail::get_instance()->config->get('plugins'), but when i want to check if it is in the array like with the function in_array or array_key_exists it just blanks whole roundcube site.
Title: Check Plugin
Post by: rosali on September 09, 2009, 11:53:49 PM

$rcmail->rcmail::get_instance();
$plugins = $rcmail->config->get('plugins');
$plugins = array_flip($plugins);
if(isset($plugins['myplugin'])){
  //registered
}
else{
  //not registered
}
Title: Check Plugin
Post by: horfic on September 10, 2009, 05:06:55 AM
Thanks rosali!:)