]> git.wh0rd.org - tt-rss.git/blobdiff - classes/api.php
move get_article_labels to Article
[tt-rss.git] / classes / api.php
index ad3ccea09d34e2ab7ee57c172f5a6660acf809e1..cb035c86be8b20119025773b9a2ea15754b552f7 100644 (file)
@@ -101,7 +101,7 @@ class API extends Handler {
                if ($feed_id) {
                        $this->wrap(self::STATUS_OK, array("unread" => getFeedUnread($feed_id, $is_cat)));
                } else {
-                       $this->wrap(self::STATUS_OK, array("unread" => getGlobalUnread()));
+                       $this->wrap(self::STATUS_OK, array("unread" => Feeds::getGlobalUnread()));
                }
        }
 
@@ -170,7 +170,7 @@ class API extends Handler {
 
                                if ($unread || !$unread_only) {
                                        array_push($cats, array("id" => $cat_id,
-                                               "title" => getCategoryTitle($cat_id),
+                                               "title" => Feeds::getCategoryTitle($cat_id),
                                                "unread" => $unread));
                                }
                        }
@@ -297,7 +297,7 @@ class API extends Handler {
                                        WHERE ref_id IN ($article_ids)");
 
                                while ($line = $this->dbh->fetch_assoc($result)) {
-                                       ccache_update($line["feed_id"], $_SESSION["uid"]);
+                                       CCache::update($line["feed_id"], $_SESSION["uid"]);
                                }
                        }
 
@@ -354,7 +354,7 @@ class API extends Handler {
                                                "guid" => $line["guid"],
                                                "title" => $line["title"],
                                                "link" => $line["link"],
-                                               "labels" => get_article_labels($line['id']),
+                                               "labels" => Article::get_article_labels($line['id']),
                                                "unread" => sql_bool_to_bool($line["unread"]),
                                                "marked" => sql_bool_to_bool($line["marked"]),
                                                "published" => sql_bool_to_bool($line["published"]),
@@ -450,7 +450,7 @@ class API extends Handler {
                        WHERE owner_uid = '".$_SESSION['uid']."' ORDER BY caption");
 
                if ($article_id)
-                       $article_labels = get_article_labels($article_id);
+                       $article_labels = Article::get_article_labels($article_id);
                else
                        $article_labels = array();
 
@@ -687,15 +687,6 @@ class API extends Handler {
                                }
                        }
 
-                       /*$qfh_ret = queryFeedHeadlines($feed_id, $limit,
-                               $view_mode, $is_cat, $search, false,
-                               $order, $offset, 0, false, $since_id, $include_nested);*/
-
-                       //function queryFeedHeadlines($feed, $limit,
-                       // $view_mode, $cat_view, $search, $search_mode,
-                       // $override_order = false, $offset = 0, $owner_uid = 0, $filter = false, $since_id = 0, $include_children = false,
-                       // $ignore_vfeed_group = false, $override_strategy = false, $override_vfeed = false, $start_ts = false, $check_top_id = false) {
-
                        $params = array(
                                "feed" => $feed_id,
                                "limit" => $limit,
@@ -710,7 +701,7 @@ class API extends Handler {
                                "skip_first_id_check" => $skip_first_id_check
                        );
 
-                       $qfh_ret = queryFeedHeadlines($params);
+                       $qfh_ret = Feeds::queryFeedHeadlines($params);
 
                        $result = $qfh_ret[0];
                        $feed_title = $qfh_ret[1];
@@ -749,10 +740,7 @@ class API extends Handler {
                                                }
                                        }
 
-                                       if (!is_array($labels)) $labels = get_article_labels($line["id"]);
-
-                                       //if (!$tags) $tags = get_article_tags($line["id"]);
-                                       //if (!$labels) $labels = get_article_labels($line["id"]);
+                                       if (!is_array($labels)) $labels = Article::get_article_labels($line["id"]);
 
                                        $headline_row = array(
                                                "id" => (int)$line["id"],