diff options
author | fox <[email protected]> | 2023-03-07 20:13:10 +0300 |
---|---|---|
committer | fox <[email protected]> | 2023-03-07 20:13:10 +0300 |
commit | cddbf5bf5a7e2c433275a3bec089f318d4f211af (patch) | |
tree | 8963be1f66c848638dfea5c68c09ac29915bc715 /classes/pref/feeds.php | |
parent | c4026b408b824769de6152d0c3bf0eb504a1e935 (diff) | |
parent | b14a8a76ebdf41adc7b8e0e95db1decb1a3d95f6 (diff) |
Merge pull request 'Replace special feed and category numbers with constants.' (#104) from wn/tt-rss:feature/special-feed-and-cat-consts into master
Reviewed-on: https://dev.tt-rss.org/tt-rss/tt-rss/pulls/104
Diffstat (limited to 'classes/pref/feeds.php')
-rwxr-xr-x | classes/pref/feeds.php | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/classes/pref/feeds.php b/classes/pref/feeds.php index 36dfbef76..ed6560fd3 100755 --- a/classes/pref/feeds.php +++ b/classes/pref/feeds.php @@ -135,18 +135,19 @@ class Pref_Feeds extends Handler_Protected { if (clean($_REQUEST['mode'] ?? 0) == 2) { if ($enable_cats) { - $cat = $this->feedlist_init_cat(-1); + $cat = $this->feedlist_init_cat(Feeds::CATEGORY_SPECIAL); } else { $cat['items'] = array(); } - foreach (array(-4, -3, -1, -2, 0, -6) as $i) { - array_push($cat['items'], $this->feedlist_init_feed($i)); + foreach ([Feeds::FEED_ALL, Feeds::FEED_FRESH, Feeds::FEED_STARRED, Feeds::FEED_PUBLISHED, + Feeds::FEED_ARCHIVED, Feeds::FEED_RECENTLY_READ] as $feed_id) { + array_push($cat['items'], $this->feedlist_init_feed($feed_id)); } - /* Plugin feeds for -1 */ + /* Plugin feeds for -1 (Feeds::CATEGORY_SPECIAL) */ - $feeds = PluginHost::getInstance()->get_feeds(-1); + $feeds = PluginHost::getInstance()->get_feeds(Feeds::CATEGORY_SPECIAL); if ($feeds) { foreach ($feeds as $feed) { @@ -180,7 +181,7 @@ class Pref_Feeds extends Handler_Protected { $sth->execute([$_SESSION['uid']]); if (get_pref(Prefs::ENABLE_FEED_CATS)) { - $cat = $this->feedlist_init_cat(-2); + $cat = $this->feedlist_init_cat(Feeds::CATEGORY_LABELS); } else { $cat['items'] = []; } @@ -1032,7 +1033,7 @@ class Pref_Feeds extends Handler_Protected { <?= format_notice('Published articles can be subscribed by anyone who knows the following URL:') ?></h3> <button dojoType='dijit.form.Button' class='alt-primary' - onclick="CommonDialogs.generatedFeed(-2, false)"> + onclick="CommonDialogs.generatedFeed(<?= Feeds::FEED_PUBLISHED ?>, false)"> <?= \Controls\icon('share') ?> <?= __('Display URL') ?> </button> |