|
|
@ -118,14 +118,16 @@ class rcube_plugin_api
|
|
|
|
if (!$loaded) {
|
|
|
|
if (!$loaded) {
|
|
|
|
$fn = $plugins_dir->path . DIRECTORY_SEPARATOR . $plugin_name . DIRECTORY_SEPARATOR . $plugin_name . '.php';
|
|
|
|
$fn = $plugins_dir->path . DIRECTORY_SEPARATOR . $plugin_name . DIRECTORY_SEPARATOR . $plugin_name . '.php';
|
|
|
|
if (file_exists($fn)) {
|
|
|
|
if (file_exists($fn)) {
|
|
|
|
include($fn);
|
|
|
|
include_once($fn);
|
|
|
|
|
|
|
|
|
|
|
|
if (class_exists($plugin_name, false)) {
|
|
|
|
if (class_exists($plugin_name, false)) {
|
|
|
|
$plugin = new $plugin_name($this);
|
|
|
|
$plugin = new $plugin_name($this);
|
|
|
|
// check inheritance
|
|
|
|
// check inheritance
|
|
|
|
if (is_subclass_of($plugin, 'rcube_plugin')) {
|
|
|
|
if (is_subclass_of($plugin, 'rcube_plugin')) {
|
|
|
|
|
|
|
|
if (!$plugin->task || preg_match('/('.$plugin->task.')/i', $rcmail->task)) {
|
|
|
|
$plugin->init();
|
|
|
|
$plugin->init();
|
|
|
|
$this->plugins[] = $plugin;
|
|
|
|
$this->plugins[] = $plugin;
|
|
|
|
|
|
|
|
}
|
|
|
|
$loaded = true;
|
|
|
|
$loaded = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|