]> git.wh0rd.org - tt-rss.git/commitdiff
api: add article language to getArticle/getHeadlines
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Tue, 3 Dec 2013 21:30:54 +0000 (01:30 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Tue, 3 Dec 2013 21:30:54 +0000 (01:30 +0400)
classes/api.php

index 8e279521a51997c281d71e7619c07d147728a60b..0306eff94b0bc0fb487925eaea3b61b76665d6d6 100644 (file)
@@ -313,7 +313,7 @@ class API extends Handler {
                if ($article_id) {
 
                        $query = "SELECT id,title,link,content,feed_id,comments,int_id,
-                               marked,unread,published,score,note,
+                               marked,unread,published,score,note,lang,
                                ".SUBSTRING_FOR_DATE."(updated,1,16) as updated,
                                author,(SELECT title FROM ttrss_feeds WHERE id = feed_id) AS feed_title
                                FROM ttrss_entries,ttrss_user_entries
@@ -346,7 +346,8 @@ class API extends Handler {
                                                "attachments" => $attachments,
                                                "score" => (int)$line["score"],
                                                "feed_title" => $line["feed_title"],
-                                               "note" => $line["note"]
+                                               "note" => $line["note"],
+                                               "lang" => $line["lang"]
                                        );
 
                                        foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_RENDER_ARTICLE_API) as $p) {
@@ -705,6 +706,7 @@ class API extends Handler {
 
                                $headline_row["score"] = (int)$line["score"];
                                $headline_row["note"] = $line["note"];
+                               $headline_row["lang"] = $line["lang"];
 
                                foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_RENDER_ARTICLE_API) as $p) {
                                        $headline_row = $p->hook_render_article_api(array("headline" => $headline_row));