From 86a8351ca2abbacda557819cefb66379a450103c Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 4 May 2017 14:50:56 +0300 Subject: move the following to Feeds: + static function catchup_feed($feed, $cat_view, $owner_uid = false, $mode = 'all', $search = false) { + static function getFeedArticles($feed, $is_cat = false, $unread_only = false, + static function subscribe_to_feed($url, $cat_id = 0, + static function getFeedIcon($id) { + static function getFeedTitle($id, $cat = false) { + static function getCategoryUnread($cat, $owner_uid = false) { + static function getCategoryChildrenUnread($cat, $owner_uid = false) { --- classes/api.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'classes/api.php') diff --git a/classes/api.php b/classes/api.php index 65bca190d..ad3ccea09 100644 --- a/classes/api.php +++ b/classes/api.php @@ -152,7 +152,7 @@ class API extends Handler { $unread = getFeedUnread($line["id"], true); if ($enable_nested) - $unread += getCategoryChildrenUnread($line["id"]); + $unread += Feeds::getCategoryChildrenUnread($line["id"]); if ($unread || !$unread_only) { array_push($cats, array("id" => $line["id"], @@ -427,7 +427,7 @@ class API extends Handler { $feed_id = $this->dbh->escape_string($_REQUEST["feed_id"]); $is_cat = $this->dbh->escape_string($_REQUEST["is_cat"]); - catchup_feed($feed_id, $is_cat); + Feeds::catchup_feed($feed_id, $is_cat); $this->wrap(self::STATUS_OK, array("status" => "OK")); } @@ -564,7 +564,7 @@ class API extends Handler { $unread = getFeedUnread($i); if ($unread || !$unread_only) { - $title = getFeedTitle($i); + $title = Feeds::getFeedTitle($i); $row = array( "id" => $i, @@ -588,7 +588,7 @@ class API extends Handler { while ($line = db_fetch_assoc($result)) { $unread = getFeedUnread($line["id"], true) + - getCategoryChildrenUnread($line["id"]); + Feeds::getCategoryChildrenUnread($line["id"]); if ($unread || !$unread_only) { $row = array( @@ -840,7 +840,7 @@ class API extends Handler { $password = $this->dbh->escape_string($_REQUEST["password"]); if ($feed_url) { - $rc = subscribe_to_feed($feed_url, $category_id, $login, $password); + $rc = Feeds::subscribe_to_feed($feed_url, $category_id, $login, $password); $this->wrap(self::STATUS_OK, array("status" => $rc)); } else { -- cgit v1.2.3-54-g00ecf