Roundcube Community Forum

 

Check Plugin

Started by horfic, September 09, 2009, 11:23:37 AM

Previous topic - Next topic

horfic

How can i check if a plugin is activated in the main config?

JohnDoh

look for $rcmail_config['plugins'], if the plugin is in the array then it is activated.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more...

horfic

$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.

rosali


$rcmail
->rcmail::get_instance();
$plugins $rcmail->config->get('plugins');
$plugins array_flip($plugins);
if(isset(
$plugins['myplugin'])){
  
//registered
}
else{
  
//not registered
}
Regards,
Rosali

horfic