]> git.wh0rd.org - tt-rss.git/commitdiff
add PluginHost.HOOK_ARTICLE_EXPORT_FEED
authorAndrew Dolgov <noreply@madoka.volgo-balt.ru>
Tue, 1 Mar 2016 11:39:36 +0000 (14:39 +0300)
committerAndrew Dolgov <noreply@madoka.volgo-balt.ru>
Tue, 1 Mar 2016 11:39:36 +0000 (14:39 +0300)
classes/handler/public.php
classes/pluginhost.php

index 1cc5686220ab4ee30dbfbf74975e6cf907364765..f37d1f67f691188445f480c7aa051de25bd96113 100644 (file)
@@ -127,12 +127,17 @@ class Handler_Public extends Handler {
 
                        $tpl->setVariable('SELF_URL', htmlspecialchars(get_self_url_prefix()), true);
                        while ($line = $this->dbh->fetch_assoc($result)) {
+
                                $line["content_preview"] = truncate_string(strip_tags($line["content"]), 100, '...');
 
                                foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_QUERY_HEADLINES) as $p) {
                                        $line = $p->hook_query_headlines($line);
                                }
 
+                               foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_ARTICLE_EXPORT_FEED) as $p) {
+                                       $line = $p->hook_article_export_feed($line);
+                               }
+
                                $tpl->setVariable('ARTICLE_ID',
                                        htmlspecialchars($orig_guid ? $line['link'] :
                                                        $this->make_article_tag_uri($line['id'], $line['date_entered'])), true);
@@ -214,10 +219,17 @@ class Handler_Public extends Handler {
                        $feed['articles'] = array();
 
                        while ($line = $this->dbh->fetch_assoc($result)) {
+
                                $line["content_preview"] = truncate_string(strip_tags($line["content_preview"]), 100, '...');
+
                                foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_QUERY_HEADLINES) as $p) {
                                        $line = $p->hook_query_headlines($line, 100);
                                }
+
+                               foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_ARTICLE_EXPORT_FEED) as $p) {
+                                       $line = $p->hook_article_export_feed($line);
+                               }
+
                                $article = array();
 
                                $article['id'] = $line['link'];
index 0f3d8f37c604abb1f1b2247464a9cf34595672ad..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;