From d2a421e3cbaa782748840fc19afad4ac65f044b8 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 25 Dec 2012 10:02:08 +0400 Subject: more work on user-selectable plugins; properly process system and user plugins --- include/functions.php | 4 ++-- include/rssfuncs.php | 10 ++++++++-- 2 files changed, 10 insertions(+), 4 deletions(-) (limited to 'include') diff --git a/include/functions.php b/include/functions.php index 6848f14b9..cd39789ab 100644 --- a/include/functions.php +++ b/include/functions.php @@ -716,7 +716,7 @@ $plugins = get_pref($link, "_ENABLED_PLUGINS", $owner_uid); global $pluginhost; - $pluginhost->load($plugins); + $pluginhost->load($plugins, $pluginhost::KIND_USER); } } @@ -3353,7 +3353,7 @@ global $pluginhost; $pluginhost = new PluginHost($link); - $pluginhost->load(PLUGINS); + $pluginhost->load(PLUGINS, $pluginhost::KIND_ALL); return true; } else { diff --git a/include/rssfuncs.php b/include/rssfuncs.php index 2105de330..d3286a538 100644 --- a/include/rssfuncs.php +++ b/include/rssfuncs.php @@ -263,7 +263,14 @@ if (!$rss->error()) { - global $pluginhost; + // We use local pluginhost here because we need to load different per-user feed plugins + $user_plugins = get_pref($link, "_ENABLED_PLUGINS", $owner_uid); + + $pluginhost = new PluginHost($link); + + $pluginhost->load(PLUGINS, $pluginhost::KIND_ALL); + $pluginhost->load($plugins, $pluginhost::KIND_USER); + $pluginhost->run_hooks($pluginhost::HOOK_FEED_PARSED, "hook_feed_parsed", $rss); if ($debug_enabled) { @@ -538,7 +545,6 @@ "tags" => $entry_tags, "author" => $entry_author); - global $pluginhost; foreach ($pluginhost->get_hooks($pluginhost::HOOK_ARTICLE_FILTER) as $plugin) { $article = $plugin->hook_article_filter($article); } -- cgit v1.2.3