summaryrefslogtreecommitdiff
path: root/classes/pref/feeds.php
diff options
context:
space:
mode:
authorwn_ <[email protected]>2023-03-05 19:14:08 +0000
committerwn_ <[email protected]>2023-03-05 19:16:48 +0000
commitfe08299ec46eb8df2988c788ced2c019743bee6a (patch)
tree3cdb29e9a7e5f1ceb2eaff769267f57cfe7d4538 /classes/pref/feeds.php
parentd210ae50ad14ded6cf204242bc072c82b9e8e70c (diff)
Replace special feed and category numbers with constants.
Diffstat (limited to 'classes/pref/feeds.php')
-rwxr-xr-xclasses/pref/feeds.php15
1 files changed, 8 insertions, 7 deletions
diff --git a/classes/pref/feeds.php b/classes/pref/feeds.php
index 679eb12e9..bfdd36124 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'] = [];
}
@@ -1027,7 +1028,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>