mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-13 18:06:02 +00:00
counters: unify naming
This commit is contained in:
@@ -102,7 +102,7 @@ class API extends Handler {
|
|||||||
|
|
||||||
/* Method added for ttrss-reader for Android */
|
/* Method added for ttrss-reader for Android */
|
||||||
function getCounters() {
|
function getCounters() {
|
||||||
$this->wrap(self::STATUS_OK, Counters::getAllCounters());
|
$this->wrap(self::STATUS_OK, Counters::get_all());
|
||||||
}
|
}
|
||||||
|
|
||||||
function getFeeds() {
|
function getFeeds() {
|
||||||
@@ -510,7 +510,7 @@ class API extends Handler {
|
|||||||
|
|
||||||
/* API only: -4 All feeds, including virtual feeds */
|
/* API only: -4 All feeds, including virtual feeds */
|
||||||
if ($cat_id == -4 || $cat_id == -2) {
|
if ($cat_id == -4 || $cat_id == -2) {
|
||||||
$counters = Counters::getLabelCounters(true);
|
$counters = Counters::get_labels(true);
|
||||||
|
|
||||||
foreach (array_values($counters) as $cv) {
|
foreach (array_values($counters) as $cv) {
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
<?php
|
<?php
|
||||||
class Counters {
|
class Counters {
|
||||||
|
|
||||||
static function getAllCounters() {
|
static function get_all() {
|
||||||
$data = self::getGlobalCounters();
|
$data = self::get_global();
|
||||||
|
|
||||||
$data = array_merge($data, self::getVirtCounters());
|
$data = array_merge($data, self::get_virt(),
|
||||||
$data = array_merge($data, self::getLabelCounters());
|
self::get_labels(),
|
||||||
$data = array_merge($data, self::getFeedCounters());
|
self::get_feeds(),
|
||||||
$data = array_merge($data, self::getCategoryCounters());
|
self::get_cats());
|
||||||
|
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
@@ -32,7 +32,7 @@ class Counters {
|
|||||||
return [$unread, $marked];
|
return [$unread, $marked];
|
||||||
}
|
}
|
||||||
|
|
||||||
static function getCategoryCounters() {
|
private static function get_cats() {
|
||||||
$ret = [];
|
$ret = [];
|
||||||
|
|
||||||
/* Labels category */
|
/* Labels category */
|
||||||
@@ -90,7 +90,7 @@ class Counters {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static function getFeedCounters($active_feed = false) {
|
private static function get_feeds($active_feed = false) {
|
||||||
|
|
||||||
$ret = [];
|
$ret = [];
|
||||||
|
|
||||||
@@ -145,7 +145,7 @@ class Counters {
|
|||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static function getGlobalCounters($global_unread = -1) {
|
private static function get_global($global_unread = -1) {
|
||||||
$ret = [];
|
$ret = [];
|
||||||
|
|
||||||
if ($global_unread == -1) {
|
if ($global_unread == -1) {
|
||||||
@@ -178,7 +178,7 @@ class Counters {
|
|||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static function getVirtCounters() {
|
private static function get_virt() {
|
||||||
|
|
||||||
$ret = [];
|
$ret = [];
|
||||||
|
|
||||||
@@ -222,7 +222,7 @@ class Counters {
|
|||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static function getLabelCounters($descriptions = false) {
|
static function get_labels($descriptions = false) {
|
||||||
|
|
||||||
$ret = [];
|
$ret = [];
|
||||||
|
|
||||||
|
|||||||
@@ -141,7 +141,7 @@ class RPC extends Handler_Protected {
|
|||||||
@$seq = (int) $_REQUEST['seq'];
|
@$seq = (int) $_REQUEST['seq'];
|
||||||
|
|
||||||
$reply = [
|
$reply = [
|
||||||
'counters' => Counters::getAllCounters(),
|
'counters' => Counters::get_all(),
|
||||||
'seq' => $seq
|
'seq' => $seq
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -222,7 +222,7 @@ class RPC extends Handler_Protected {
|
|||||||
Feeds::_catchup($feed_id, $is_cat, false, $mode, [$search_query, $search_lang]);
|
Feeds::_catchup($feed_id, $is_cat, false, $mode, [$search_query, $search_lang]);
|
||||||
|
|
||||||
// return counters here synchronously so that frontend can figure out next unread feed properly
|
// return counters here synchronously so that frontend can figure out next unread feed properly
|
||||||
print json_encode(['counters' => Counters::getAllCounters()]);
|
print json_encode(['counters' => Counters::get_all()]);
|
||||||
|
|
||||||
//print json_encode(array("message" => "UPDATE_COUNTERS"));
|
//print json_encode(array("message" => "UPDATE_COUNTERS"));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user