summaryrefslogtreecommitdiff
path: root/app/Controllers/feedController.php
diff options
context:
space:
mode:
authorGravatar maTh <1645099+math-GH@users.noreply.github.com> 2025-10-01 10:48:07 +0200
committerGravatar GitHub <noreply@github.com> 2025-10-01 10:48:07 +0200
commit2bcc090622c0e62dbff94e52bb6892a51b40ba2a (patch)
tree7d9d93c839e45e41c4a75db7dce04a9bb8bc6c2a /app/Controllers/feedController.php
parent72884813e13596d211471482ffdc6d723ed678c9 (diff)
configurable notification timeout (#7942)
Ref #7931 Ref #5466 Ref #6409 added configuration in "Display" <img width="636" height="167" alt="grafik" src="https://github.com/user-attachments/assets/7bbc9f26-d91b-4dd2-b715-1d3f9b7a9ad3" /> * i18n: fr * Update app/i18n/pl/conf.php Co-authored-by: Inverle <inverle@proton.me> * make fix-all * max() * Minor whitespace (I am not a fan of excessive vertical indenting) --------- Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr> Co-authored-by: Inverle <inverle@proton.me>
Diffstat (limited to 'app/Controllers/feedController.php')
-rw-r--r--app/Controllers/feedController.php60
1 files changed, 45 insertions, 15 deletions
diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php
index fe190dc77..678388cbb 100644
--- a/app/Controllers/feedController.php
+++ b/app/Controllers/feedController.php
@@ -344,7 +344,11 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController {
// Entries are in DB, we redirect to feed configuration page.
$url_redirect['a'] = 'feed';
$url_redirect['params']['id'] = '' . $feed->id();
- Minz_Request::good(_t('feedback.sub.feed.added', $feed->name()), $url_redirect);
+ Minz_Request::good(
+ _t('feedback.sub.feed.added', $feed->name()),
+ $url_redirect,
+ showNotification: FreshRSS_Context::userConf()->good_notification_timeout > 0
+ );
} else {
// GET request: we must ask confirmation to user before adding feed.
FreshRSS_View::prependTitle(_t('sub.feed.title_add') . ' ยท ');
@@ -365,7 +369,11 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController {
// Already subscribe so we redirect to the feed configuration page.
$url_redirect['a'] = 'feed';
$url_redirect['params']['id'] = $feed->id();
- Minz_Request::good(_t('feedback.sub.feed.already_subscribed', $feed->name()), $url_redirect);
+ Minz_Request::good(
+ _t('feedback.sub.feed.already_subscribed', $feed->name()),
+ $url_redirect,
+ showNotification: FreshRSS_Context::userConf()->good_notification_timeout > 0
+ );
}
}
}
@@ -400,7 +408,11 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController {
if ($n === false) {
Minz_Request::bad(_t('feedback.sub.feed.error'), $url_redirect);
} else {
- Minz_Request::good(_t('feedback.sub.feed.n_entries_deleted', $n), $url_redirect);
+ Minz_Request::good(
+ _t('feedback.sub.feed.n_entries_deleted', $n),
+ $url_redirect,
+ showNotification: FreshRSS_Context::userConf()->good_notification_timeout > 0
+ );
}
}
@@ -952,13 +964,23 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController {
$this->view->_layout(null);
} elseif ($feed instanceof FreshRSS_Feed && $id > 0) {
// Redirect to the main page with correct notification.
- Minz_Request::good(_t('feedback.sub.feed.actualized', $feed->name()), [
- 'params' => ['get' => 'f_' . $id]
- ], 'actualizeAction');
+ Minz_Request::good(
+ _t('feedback.sub.feed.actualized', $feed->name()),
+ ['params' => ['get' => 'f_' . $id]],
+ notificationName: 'actualizeAction',
+ showNotification: FreshRSS_Context::userConf()->good_notification_timeout > 0);
} elseif ($nbUpdatedFeeds >= 1) {
- Minz_Request::good(_t('feedback.sub.feed.n_actualized', $nbUpdatedFeeds), []);
+ Minz_Request::good(
+ _t('feedback.sub.feed.n_actualized', $nbUpdatedFeeds),
+ [],
+ showNotification: FreshRSS_Context::userConf()->good_notification_timeout > 0
+ );
} else {
- Minz_Request::good(_t('feedback.sub.feed.no_refresh'), []);
+ Minz_Request::good(
+ _t('feedback.sub.feed.no_refresh'),
+ [],
+ showNotification: FreshRSS_Context::userConf()->good_notification_timeout > 0
+ );
}
return $nbUpdatedFeeds;
}
@@ -1088,7 +1110,11 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController {
}
if (self::deleteFeed($id)) {
- Minz_Request::good(_t('feedback.sub.feed.deleted'), $redirect_url);
+ Minz_Request::good(
+ _t('feedback.sub.feed.deleted'),
+ $redirect_url,
+ showNotification: FreshRSS_Context::userConf()->good_notification_timeout > 0
+ );
} else {
Minz_Request::bad(_t('feedback.sub.feed.error'), $redirect_url);
}
@@ -1117,9 +1143,11 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController {
$feed->clearCache();
- Minz_Request::good(_t('feedback.sub.feed.cache_cleared', $feed->name()), [
- 'params' => ['get' => 'f_' . $feed->id()],
- ]);
+ Minz_Request::good(
+ _t('feedback.sub.feed.cache_cleared', $feed->name()),
+ ['params' => ['get' => 'f_' . $feed->id()]],
+ showNotification: FreshRSS_Context::userConf()->good_notification_timeout > 0
+ );
}
/**
@@ -1177,9 +1205,11 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController {
Minz_ModelPdo::$usesSharedPdo = true;
//Give feedback to user.
- Minz_Request::good(_t('feedback.sub.feed.reloaded', $feed->name()), [
- 'params' => ['get' => 'f_' . $feed->id()]
- ]);
+ Minz_Request::good(
+ _t('feedback.sub.feed.reloaded', $feed->name()),
+ ['params' => ['get' => 'f_' . $feed->id()]],
+ showNotification: FreshRSS_Context::userConf()->good_notification_timeout > 0
+ );
}
/**