]> git.wh0rd.org Git - tt-rss.git/commitdiff
api: add article api hook to getArticle, change parameters passed
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Tue, 2 Apr 2013 19:02:52 +0000 (23:02 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Tue, 2 Apr 2013 19:02:52 +0000 (23:02 +0400)
classes/api.php
include/functions.php

index 902cb0853a32230502a95c195f07a73e59b44b1e..4427834eb4f9d1253543af60941bdd5e2d77f1d2 100644 (file)
@@ -340,6 +340,12 @@ class API extends Handler {
                                        "attachments" => $attachments
                                );
 
+                               global $pluginhost;
+                               foreach ($pluginhost->get_hooks($pluginhost::HOOK_RENDER_ARTICLE_API) as $p) {
+                                       $article = $p->hook_render_article_api(array("article" => $article));
+                               }
+
+
                                array_push($articles, $article);
 
                        }
@@ -680,7 +686,7 @@ class API extends Handler {
 
                                global $pluginhost;
                                foreach ($pluginhost->get_hooks($pluginhost::HOOK_RENDER_ARTICLE_API) as $p) {
-                                       $headline_row = $p->hook_render_article_api($headline_row);
+                                       $headline_row = $p->hook_render_article_api(array("headline" => $headline_row));
                                }
 
                                array_push($headlines, $headline_row);
index 6399ad5bb0962aa5293cc0e8aaf8478a236b6562..d77cb199e309d60b8bdf2c77bd8631548f04195d 100644 (file)
         * @return boolean True if defined successfully or not.
         */
        function define_default($name, $value) {
-               // Note: performence freaks should define everything in
-               // config.php becasue if will make defined() run much faster,
-               // see comment by 'tris+php at tfconsulting dot com dot au'
-               // here:
-               // http://www.php.net/manual/en/function.defined.php#89886
                defined($name) or define($name, $value);
        }