]> git.wh0rd.org - tt-rss.git/blobdiff - classes/pluginhost.php
add PluginHost.HOOK_ARTICLE_EXPORT_FEED
[tt-rss.git] / classes / pluginhost.php
index 75620a191e704c77ca911efbb548a5e8a33cc578..675e0af17152ad8fe7f00ca29e4924de8dca7078 100644 (file)
@@ -49,6 +49,7 @@ class PluginHost {
        const HOOK_HEADLINES_BEFORE = 28;
        const HOOK_RENDER_ENCLOSURE = 29;
        const HOOK_ARTICLE_FILTER_ACTION = 30;
+       const HOOK_ARTICLE_EXPORT_FEED = 31;
 
        const KIND_ALL = 1;
        const KIND_SYSTEM = 2;
@@ -133,7 +134,7 @@ class PluginHost {
                        return array();
                }
        }
-       function load_all($kind, $owner_uid = false) {
+       function load_all($kind, $owner_uid = false, $skip_init = false) {
 
                $plugins = array_merge(glob("plugins/*"), glob("plugins.local/*"));
                $plugins = array_filter($plugins, "is_dir");
@@ -141,10 +142,10 @@ class PluginHost {
 
                asort($plugins);
 
-               $this->load(join(",", $plugins), $kind, $owner_uid);
+               $this->load(join(",", $plugins), $kind, $owner_uid, $skip_init);
        }
 
-       function load($classlist, $kind, $owner_uid = false) {
+       function load($classlist, $kind, $owner_uid = false, $skip_init = false) {
                $plugins = explode(",", $classlist);
 
                $this->owner_uid = (int) $owner_uid;
@@ -181,18 +182,18 @@ class PluginHost {
                                        switch ($kind) {
                                        case $this::KIND_SYSTEM:
                                                if ($this->is_system($plugin)) {
-                                                       $plugin->init($this);
+                                                       if (!$skip_init) $plugin->init($this);
                                                        $this->register_plugin($class, $plugin);
                                                }
                                                break;
                                        case $this::KIND_USER:
                                                if (!$this->is_system($plugin)) {
-                                                       $plugin->init($this);
+                                                       if (!$skip_init) $plugin->init($this);
                                                        $this->register_plugin($class, $plugin);
                                                }
                                                break;
                                        case $this::KIND_ALL:
-                                               $plugin->init($this);
+                                               if (!$skip_init) $plugin->init($this);
                                                $this->register_plugin($class, $plugin);
                                                break;
                                        }