summaryrefslogtreecommitdiff
path: root/lib/statusnet.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/statusnet.php')
-rw-r--r--lib/statusnet.php23
1 files changed, 18 insertions, 5 deletions
diff --git a/lib/statusnet.php b/lib/statusnet.php
index ff0502915..f8bf87960 100644
--- a/lib/statusnet.php
+++ b/lib/statusnet.php
@@ -169,22 +169,33 @@ class StatusNet
return $sites;
}
+ /**
+ * Return a list of plugins
+ */
+ public static function getPlugins() {
+ // Default plugins
+ $pluginlist = common_config('plugins', 'default');
+ // Enabled plugins
+ $enabled=common_config_section('plugin-list');
+ if ($enabled) {
+ $pluginlist = array_merge($pluginlist,$enabled);
+ }
+ return $pluginlist;
+ }
/**
* Fire initialization events for all instantiated plugins.
*/
protected static function initPlugins()
{
- // Load default plugins
- foreach (common_config('plugins', 'default') as $name => $params) {
+ // Load plugins
+ foreach (self::getPlugins() as $name => $params) {
$key = 'disable-' . $name;
if (common_config('plugins', $key)) {
continue;
}
- if (is_null($params)) {
- addPlugin($name);
- } else if (is_array($params)) {
+ if (is_array($params)) {
if (count($params) == 0) {
addPlugin($name);
} else {
@@ -197,6 +208,8 @@ class StatusNet
}
}
}
+ } else {
+ addPlugin($name);
}
}