diff options
Diffstat (limited to 'app/Controllers')
| -rw-r--r-- | app/Controllers/apiController.php | 6 | ||||
| -rw-r--r-- | app/Controllers/authController.php | 24 | ||||
| -rw-r--r-- | app/Controllers/categoryController.php | 30 | ||||
| -rw-r--r-- | app/Controllers/configureController.php | 69 | ||||
| -rw-r--r-- | app/Controllers/entryController.php | 18 | ||||
| -rw-r--r-- | app/Controllers/extensionController.php | 18 | ||||
| -rw-r--r-- | app/Controllers/feedController.php | 60 | ||||
| -rw-r--r-- | app/Controllers/importExportController.php | 5 | ||||
| -rw-r--r-- | app/Controllers/subscriptionController.php | 12 | ||||
| -rw-r--r-- | app/Controllers/tagController.php | 17 | ||||
| -rw-r--r-- | app/Controllers/updateController.php | 5 | ||||
| -rw-r--r-- | app/Controllers/userController.php | 39 |
12 files changed, 242 insertions, 61 deletions
diff --git a/app/Controllers/apiController.php b/app/Controllers/apiController.php index 585a7a9bb..139e2734e 100644 --- a/app/Controllers/apiController.php +++ b/app/Controllers/apiController.php @@ -58,7 +58,11 @@ class FreshRSS_api_Controller extends FreshRSS_ActionController { if (is_string($error)) { Minz_Request::bad($error, $return_url); } else { - Minz_Request::good(_t('feedback.api.password.updated'), $return_url); + Minz_Request::good( + _t('feedback.api.password.updated'), + $return_url, + showNotification: FreshRSS_Context::userConf()->good_notification_timeout > 0 + ); } } } diff --git a/app/Controllers/authController.php b/app/Controllers/authController.php index 1bdbc28b1..64526a884 100644 --- a/app/Controllers/authController.php +++ b/app/Controllers/authController.php @@ -56,7 +56,11 @@ class FreshRSS_auth_Controller extends FreshRSS_ActionController { invalidateHttpCache(); if ($ok) { - Minz_Request::good(_t('feedback.conf.updated'), [ 'c' => 'auth', 'a' => 'index' ]); + Minz_Request::good( + _t('feedback.conf.updated'), + [ 'c' => 'auth', 'a' => 'index' ], + showNotification: FreshRSS_Context::userConf()->good_notification_timeout > 0 + ); } else { Minz_Request::bad(_t('feedback.conf.error'), [ 'c' => 'auth', 'a' => 'index' ]); } @@ -176,7 +180,11 @@ class FreshRSS_auth_Controller extends FreshRSS_ActionController { if (empty($url)) { $url = [ 'c' => 'index', 'a' => 'index' ]; } - Minz_Request::good(_t('feedback.auth.login.success'), $url); + Minz_Request::good( + _t('feedback.auth.login.success'), + $url, + showNotification: FreshRSS_Context::userConf()->good_notification_timeout > 0 + ); } else { Minz_Log::warning("Password mismatch for user={$username}, nonce={$nonce}, c={$challenge}"); header('HTTP/1.1 403 Forbidden'); @@ -214,7 +222,11 @@ class FreshRSS_auth_Controller extends FreshRSS_ActionController { Minz_Translate::init(FreshRSS_Context::userConf()->language); - Minz_Request::good(_t('feedback.auth.login.success'), ['c' => 'index', 'a' => 'index']); + Minz_Request::good( + _t('feedback.auth.login.success'), + ['c' => 'index', 'a' => 'index'], + showNotification: FreshRSS_Context::userConf()->good_notification_timeout > 0 + ); } else { Minz_Log::warning('Unsafe password mismatch for user ' . $username); Minz_Request::bad( @@ -263,7 +275,11 @@ class FreshRSS_auth_Controller extends FreshRSS_ActionController { invalidateHttpCache(); FreshRSS_Auth::removeAccess(); Minz_Session::regenerateID('FreshRSS'); - Minz_Request::good(_t('feedback.auth.logout.success'), [ 'c' => 'index', 'a' => 'index' ]); + Minz_Request::good( + _t('feedback.auth.logout.success'), + [ 'c' => 'index', 'a' => 'index' ], + showNotification: FreshRSS_Context::userConf()->good_notification_timeout > 0 + ); } else { Minz_Error::error(403); } diff --git a/app/Controllers/categoryController.php b/app/Controllers/categoryController.php index 316136b11..5ad83e977 100644 --- a/app/Controllers/categoryController.php +++ b/app/Controllers/categoryController.php @@ -70,7 +70,11 @@ class FreshRSS_category_Controller extends FreshRSS_ActionController { if ($catDAO->addCategoryObject($cat)) { $url_redirect['a'] = 'index'; - Minz_Request::good(_t('feedback.sub.category.created', $cat->name()), $url_redirect); + Minz_Request::good( + _t('feedback.sub.category.created', $cat->name()), + $url_redirect, + showNotification: FreshRSS_Context::userConf()->good_notification_timeout > 0 + ); } else { Minz_Request::bad(_t('feedback.sub.category.error'), $url_redirect); } @@ -156,7 +160,11 @@ class FreshRSS_category_Controller extends FreshRSS_ActionController { $url_redirect = ['c' => 'subscription', 'params' => ['id' => $id, 'type' => 'category']]; if (false !== $categoryDAO->updateCategory($id, $values)) { - Minz_Request::good(_t('feedback.sub.category.updated'), $url_redirect); + Minz_Request::good( + _t('feedback.sub.category.updated'), + $url_redirect, + showNotification: FreshRSS_Context::userConf()->good_notification_timeout > 0 + ); } else { Minz_Request::bad(_t('feedback.sub.category.error'), $url_redirect); } @@ -201,7 +209,11 @@ class FreshRSS_category_Controller extends FreshRSS_ActionController { FreshRSS_Context::userConf()->queries = $queries; FreshRSS_Context::userConf()->save(); - Minz_Request::good(_t('feedback.sub.category.deleted'), $url_redirect); + Minz_Request::good( + _t('feedback.sub.category.deleted'), + $url_redirect, + showNotification: FreshRSS_Context::userConf()->good_notification_timeout > 0 + ); } Minz_Request::forward($url_redirect, true); @@ -243,7 +255,11 @@ class FreshRSS_category_Controller extends FreshRSS_ActionController { } FreshRSS_Context::userConf()->save(); - Minz_Request::good(_t('feedback.sub.category.emptied'), $url_redirect); + Minz_Request::good( + _t('feedback.sub.category.emptied'), + $url_redirect, + showNotification: FreshRSS_Context::userConf()->good_notification_timeout > 0 + ); } else { Minz_Request::bad(_t('feedback.sub.category.error'), $url_redirect); } @@ -284,7 +300,11 @@ class FreshRSS_category_Controller extends FreshRSS_ActionController { $this->view->_layout(null); } else { if ($ok) { - Minz_Request::good(_t('feedback.sub.category.updated'), $url_redirect); + Minz_Request::good( + _t('feedback.sub.category.updated'), + $url_redirect, + showNotification: FreshRSS_Context::userConf()->good_notification_timeout > 0 + ); } else { Minz_Request::bad(_t('feedback.sub.category.error'), $url_redirect); } diff --git a/app/Controllers/configureController.php b/app/Controllers/configureController.php index 50edbbff7..bcda947ff 100644 --- a/app/Controllers/configureController.php +++ b/app/Controllers/configureController.php @@ -74,14 +74,20 @@ class FreshRSS_configure_Controller extends FreshRSS_ActionController { FreshRSS_Context::userConf()->bottomline_date = Minz_Request::paramBoolean('bottomline_date'); FreshRSS_Context::userConf()->bottomline_link = Minz_Request::paramBoolean('bottomline_link'); FreshRSS_Context::userConf()->show_nav_buttons = Minz_Request::paramBoolean('show_nav_buttons'); - FreshRSS_Context::userConf()->html5_notif_timeout = Minz_Request::paramInt('html5_notif_timeout'); + FreshRSS_Context::userConf()->html5_notif_timeout = max(0, Minz_Request::paramInt('html5_notif_timeout')); + FreshRSS_Context::userConf()->good_notification_timeout = max(0, Minz_Request::paramInt('good_notification_timeout')); + FreshRSS_Context::userConf()->bad_notification_timeout = max(1, Minz_Request::paramInt('bad_notification_timeout')); FreshRSS_Context::userConf()->save(); Minz_Session::_param('language', FreshRSS_Context::userConf()->language); Minz_Translate::reset(FreshRSS_Context::userConf()->language); invalidateHttpCache(); - Minz_Request::good(_t('feedback.conf.updated'), [ 'c' => 'configure', 'a' => 'display' ], 'displayAction'); + Minz_Request::good( + _t('feedback.conf.updated'), + [ 'c' => 'configure', 'a' => 'display' ], + notificationName: 'displayAction', + showNotification: FreshRSS_Context::userConf()->good_notification_timeout > 0); } $this->view->themes = FreshRSS_Themes::get(); @@ -163,7 +169,11 @@ class FreshRSS_configure_Controller extends FreshRSS_ActionController { FreshRSS_Context::userConf()->save(); invalidateHttpCache(); - Minz_Request::good(_t('feedback.conf.updated'), [ 'c' => 'configure', 'a' => 'reading' ]); + Minz_Request::good( + _t('feedback.conf.updated'), + [ 'c' => 'configure', 'a' => 'reading' ], + showNotification: FreshRSS_Context::userConf()->good_notification_timeout > 0 + ); } $this->view->viewModes = FreshRSS_ViewMode::getAllModes(); @@ -197,7 +207,11 @@ class FreshRSS_configure_Controller extends FreshRSS_ActionController { invalidateHttpCache(); } - Minz_Request::good(_t('feedback.conf.updated'), [ 'c' => 'configure', 'a' => 'integration' ]); + Minz_Request::good( + _t('feedback.conf.updated'), + [ 'c' => 'configure', 'a' => 'integration' ], + showNotification: FreshRSS_Context::userConf()->good_notification_timeout > 0 + ); } FreshRSS_View::prependTitle(_t('conf.sharing.title') . ' · '); @@ -229,7 +243,11 @@ class FreshRSS_configure_Controller extends FreshRSS_ActionController { FreshRSS_Context::userConf()->save(); invalidateHttpCache(); - Minz_Request::good(_t('feedback.conf.shortcuts_updated'), ['c' => 'configure', 'a' => 'shortcut']); + Minz_Request::good( + _t('feedback.conf.shortcuts_updated'), + ['c' => 'configure', 'a' => 'shortcut'], + showNotification: FreshRSS_Context::userConf()->good_notification_timeout > 0 + ); } FreshRSS_View::prependTitle(_t('conf.shortcut.title') . ' · '); @@ -277,7 +295,11 @@ class FreshRSS_configure_Controller extends FreshRSS_ActionController { FreshRSS_Context::userConf()->save(); invalidateHttpCache(); - Minz_Request::good(_t('feedback.conf.updated'), [ 'c' => 'configure', 'a' => 'archiving' ]); + Minz_Request::good( + _t('feedback.conf.updated'), + [ 'c' => 'configure', 'a' => 'archiving' ], + showNotification: FreshRSS_Context::userConf()->good_notification_timeout > 0 + ); } $volatile = [ @@ -341,7 +363,11 @@ class FreshRSS_configure_Controller extends FreshRSS_ActionController { FreshRSS_Context::userConf()->queries = $queries; FreshRSS_Context::userConf()->save(); - Minz_Request::good(_t('feedback.conf.updated'), [ 'c' => 'configure', 'a' => 'queries' ]); + Minz_Request::good( + _t('feedback.conf.updated'), + [ 'c' => 'configure', 'a' => 'queries' ], + showNotification: FreshRSS_Context::userConf()->good_notification_timeout > 0 + ); } else { $this->view->queries = []; foreach (FreshRSS_Context::userConf()->queries as $key => $query) { @@ -433,7 +459,10 @@ class FreshRSS_configure_Controller extends FreshRSS_ActionController { FreshRSS_Context::userConf()->queries = $queries; FreshRSS_Context::userConf()->save(); - Minz_Request::good(_t('feedback.conf.updated'), [ 'c' => 'configure', 'a' => 'queries', 'params' => ['id' => (string)$id] ]); + Minz_Request::good( + _t('feedback.conf.updated'), + [ 'c' => 'configure', 'a' => 'queries', 'params' => ['id' => (string)$id] ], + showNotification: FreshRSS_Context::userConf()->good_notification_timeout > 0); } FreshRSS_View::prependTitle($query->getName() . ' · ' . _t('conf.query.title') . ' · '); @@ -458,7 +487,11 @@ class FreshRSS_configure_Controller extends FreshRSS_ActionController { FreshRSS_Context::userConf()->queries = $queries; FreshRSS_Context::userConf()->save(); - Minz_Request::good(_t('feedback.conf.updated'), [ 'c' => 'configure', 'a' => 'queries' ]); + Minz_Request::good( + _t('feedback.conf.updated'), + [ 'c' => 'configure', 'a' => 'queries' ], + showNotification: FreshRSS_Context::userConf()->good_notification_timeout > 0 + ); } /** @@ -488,7 +521,11 @@ class FreshRSS_configure_Controller extends FreshRSS_ActionController { FreshRSS_Context::userConf()->queries = $queries; FreshRSS_Context::userConf()->save(); - Minz_Request::good(_t('feedback.conf.query_created', $params['name']), [ 'c' => 'configure', 'a' => 'queries' ]); + Minz_Request::good( + _t('feedback.conf.query_created', $params['name']), + [ 'c' => 'configure', 'a' => 'queries' ], + showNotification: FreshRSS_Context::userConf()->good_notification_timeout > 0 + ); } /** @@ -525,7 +562,11 @@ class FreshRSS_configure_Controller extends FreshRSS_ActionController { invalidateHttpCache(); - Minz_Request::good(_t('feedback.conf.updated'), [ 'c' => 'configure', 'a' => 'system' ]); + Minz_Request::good( + _t('feedback.conf.updated'), + [ 'c' => 'configure', 'a' => 'system' ], + showNotification: FreshRSS_Context::userConf()->good_notification_timeout > 0 + ); } } @@ -535,7 +576,11 @@ class FreshRSS_configure_Controller extends FreshRSS_ActionController { FreshRSS_Context::userConf()->save(); invalidateHttpCache(); - Minz_Request::good(_t('feedback.conf.updated'), ['c' => 'configure', 'a' => 'privacy']); + Minz_Request::good( + _t('feedback.conf.updated'), + ['c' => 'configure', 'a' => 'privacy'], + showNotification: FreshRSS_Context::userConf()->good_notification_timeout > 0 + ); } FreshRSS_View::prependTitle(_t('conf.privacy') . ' · '); diff --git a/app/Controllers/entryController.php b/app/Controllers/entryController.php index 0e8a4a1b9..1d4792267 100644 --- a/app/Controllers/entryController.php +++ b/app/Controllers/entryController.php @@ -196,7 +196,8 @@ class FreshRSS_entry_Controller extends FreshRSS_ActionController { 'a' => 'index', 'params' => $params, ], - 'readAction' + notificationName: 'readAction ', + showNotification: FreshRSS_Context::userConf()->good_notification_timeout > 0 ); } } @@ -254,7 +255,11 @@ class FreshRSS_entry_Controller extends FreshRSS_ActionController { $feedDAO->updateCachedValues(); invalidateHttpCache(); - Minz_Request::good(_t('feedback.admin.optimization_complete'), $url_redirect); + Minz_Request::good( + _t('feedback.admin.optimization_complete'), + $url_redirect, + showNotification: FreshRSS_Context::userConf()->good_notification_timeout > 0 + ); } /** @@ -290,9 +295,10 @@ class FreshRSS_entry_Controller extends FreshRSS_ActionController { $databaseDAO->minorDbMaintenance(); invalidateHttpCache(); - Minz_Request::good(_t('feedback.sub.purge_completed', $nb_total), [ - 'c' => 'configure', - 'a' => 'archiving', - ]); + Minz_Request::good( + _t('feedback.sub.purge_completed', $nb_total), + ['c' => 'configure', 'a' => 'archiving'], + showNotification: FreshRSS_Context::userConf()->good_notification_timeout > 0 + ); } } diff --git a/app/Controllers/extensionController.php b/app/Controllers/extensionController.php index 38f04a277..39b5e858a 100644 --- a/app/Controllers/extensionController.php +++ b/app/Controllers/extensionController.php @@ -191,7 +191,11 @@ class FreshRSS_extension_Controller extends FreshRSS_ActionController { $conf->extensions_enabled = $ext_list; $conf->save(); - Minz_Request::good(_t('feedback.extensions.enable.ok', $ext_name), $url_redirect); + Minz_Request::good( + _t('feedback.extensions.enable.ok', $ext_name), + $url_redirect, + showNotification: FreshRSS_Context::userConf()->good_notification_timeout > 0 + ); } else { Minz_Log::warning('Cannot enable extension ' . $ext_name . ': ' . $res); Minz_Request::bad(_t('feedback.extensions.enable.ko', $ext_name, _url('index', 'logs')), $url_redirect); @@ -253,7 +257,11 @@ class FreshRSS_extension_Controller extends FreshRSS_ActionController { $conf->extensions_enabled = $ext_list; $conf->save(); - Minz_Request::good(_t('feedback.extensions.disable.ok', $ext_name), $url_redirect); + Minz_Request::good( + _t('feedback.extensions.disable.ok', $ext_name), + $url_redirect, + showNotification: FreshRSS_Context::userConf()->good_notification_timeout > 0 + ); } else { Minz_Log::warning('Cannot disable extension ' . $ext_name . ': ' . $res); Minz_Request::bad(_t('feedback.extensions.disable.ko', $ext_name, _url('index', 'logs')), $url_redirect); @@ -290,7 +298,11 @@ class FreshRSS_extension_Controller extends FreshRSS_ActionController { $res = recursive_unlink($ext->getPath()); if ($res) { - Minz_Request::good(_t('feedback.extensions.removed', $ext_name), $url_redirect); + Minz_Request::good( + _t('feedback.extensions.removed', $ext_name), + $url_redirect, + showNotification: FreshRSS_Context::userConf()->good_notification_timeout > 0 + ); } else { Minz_Request::bad(_t('feedback.extensions.cannot_remove', $ext_name), $url_redirect); } 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 + ); } /** diff --git a/app/Controllers/importExportController.php b/app/Controllers/importExportController.php index 8e03299f9..294f4de2c 100644 --- a/app/Controllers/importExportController.php +++ b/app/Controllers/importExportController.php @@ -200,7 +200,10 @@ class FreshRSS_importExport_Controller extends FreshRSS_ActionController { // And finally, we get import status and redirect to the home page $content_notif = $error === true ? _t('feedback.import_export.feeds_imported_with_errors') : _t('feedback.import_export.feeds_imported'); - Minz_Request::good($content_notif); + Minz_Request::good( + $content_notif, + showNotification: FreshRSS_Context::userConf()->good_notification_timeout > 0 + ); } /** diff --git a/app/Controllers/subscriptionController.php b/app/Controllers/subscriptionController.php index 6573c0eb3..ccd421a41 100644 --- a/app/Controllers/subscriptionController.php +++ b/app/Controllers/subscriptionController.php @@ -383,7 +383,11 @@ class FreshRSS_subscription_Controller extends FreshRSS_ActionController { Minz_Request::bad(_t('feedback.sub.feed.error'), $url_redirect); return; } - Minz_Request::good(_t('feedback.sub.feed.updated'), $url_redirect); + Minz_Request::good( + _t('feedback.sub.feed.updated'), + $url_redirect, + showNotification: FreshRSS_Context::userConf()->good_notification_timeout > 0 + ); } elseif ($values['url'] != '' && $feedDAO->updateFeed($id, $values) !== false) { $feed->_categoryId($values['category']); // update url and website values for faviconPrepare @@ -391,7 +395,11 @@ class FreshRSS_subscription_Controller extends FreshRSS_ActionController { $feed->_website($values['website'], false); $feed->faviconPrepare(); - Minz_Request::good(_t('feedback.sub.feed.updated'), $url_redirect); + Minz_Request::good( + _t('feedback.sub.feed.updated'), + $url_redirect, + showNotification: FreshRSS_Context::userConf()->good_notification_timeout > 0 + ); } else { if ($values['url'] == '') { Minz_Log::warning('Invalid feed URL!'); diff --git a/app/Controllers/tagController.php b/app/Controllers/tagController.php index 47301bba0..aaeff7f75 100644 --- a/app/Controllers/tagController.php +++ b/app/Controllers/tagController.php @@ -126,7 +126,11 @@ class FreshRSS_tag_Controller extends FreshRSS_ActionController { $url_redirect = ['c' => 'tag', 'a' => 'update', 'params' => ['id' => $id]]; if ($ok) { - Minz_Request::good(_t('feedback.tag.updated'), $url_redirect); + Minz_Request::good( + _t('feedback.tag.updated'), + $url_redirect, + showNotification: FreshRSS_Context::userConf()->good_notification_timeout > 0 + ); } else { Minz_Request::bad(_t('feedback.tag.error'), $url_redirect); } @@ -167,7 +171,11 @@ class FreshRSS_tag_Controller extends FreshRSS_ActionController { } $tagDAO->addTag(['name' => $name]); - Minz_Request::good(_t('feedback.tag.created', $name), $url_redirect); + Minz_Request::good( + _t('feedback.tag.created', $name), + $url_redirect, + showNotification: FreshRSS_Context::userConf()->good_notification_timeout > 0 + ); } /** @@ -203,7 +211,10 @@ class FreshRSS_tag_Controller extends FreshRSS_ActionController { $tagDAO->deleteTag($sourceId); } - Minz_Request::good(_t('feedback.tag.renamed', $sourceName, $targetName), ['c' => 'tag', 'a' => 'index']); + Minz_Request::good( + _t('feedback.tag.renamed', $sourceName, $targetName), + ['c' => 'tag', 'a' => 'index'], + showNotification: FreshRSS_Context::userConf()->good_notification_timeout > 0); } public function indexAction(): void { diff --git a/app/Controllers/updateController.php b/app/Controllers/updateController.php index bd140b6d5..7c204de8c 100644 --- a/app/Controllers/updateController.php +++ b/app/Controllers/updateController.php @@ -289,7 +289,10 @@ class FreshRSS_update_Controller extends FreshRSS_ActionController { @unlink(UPDATE_FILENAME); @file_put_contents(join_path(DATA_PATH, self::LASTUPDATEFILE), ''); Minz_Log::notice(_t('feedback.update.finished')); - Minz_Request::good(_t('feedback.update.finished')); + Minz_Request::good( + _t('feedback.update.finished'), + showNotification: FreshRSS_Context::userConf()->good_notification_timeout > 0 + ); } else { Minz_Log::error(_t('feedback.update.error', is_string($res) ? $res : 'unknown')); Minz_Request::bad(_t('feedback.update.error', is_string($res) ? $res : 'unknown'), [ 'c' => 'update', 'a' => 'index' ]); diff --git a/app/Controllers/userController.php b/app/Controllers/userController.php index f3db70c3a..f820ef882 100644 --- a/app/Controllers/userController.php +++ b/app/Controllers/userController.php @@ -86,9 +86,17 @@ class FreshRSS_user_Controller extends FreshRSS_ActionController { if ($ok) { $isSelfUpdate = Minz_User::name() === $username; if ($newPasswordPlain == '' || !$isSelfUpdate) { - Minz_Request::good(_t('feedback.user.updated', $username), ['c' => 'user', 'a' => 'manage']); + Minz_Request::good( + _t('feedback.user.updated', $username), + ['c' => 'user', 'a' => 'manage'], + showNotification: FreshRSS_Context::userConf()->good_notification_timeout > 0 + ); } else { - Minz_Request::good(_t('feedback.profile.updated'), ['c' => 'index', 'a' => 'index']); + Minz_Request::good( + _t('feedback.profile.updated'), + ['c' => 'index', 'a' => 'index'], + showNotification: FreshRSS_Context::userConf()->good_notification_timeout > 0 + ); } } else { Minz_Request::bad(_t('feedback.user.updated.error', $username), ['c' => 'user', 'a' => 'manage']); @@ -179,9 +187,17 @@ class FreshRSS_user_Controller extends FreshRSS_ActionController { if ($ok) { if (FreshRSS_Context::systemConf()->force_email_validation && $email !== $old_email) { - Minz_Request::good(_t('feedback.profile.updated'), ['c' => 'user', 'a' => 'validateEmail']); + Minz_Request::good( + _t('feedback.profile.updated'), + ['c' => 'user', 'a' => 'validateEmail'], + showNotification: FreshRSS_Context::userConf()->good_notification_timeout > 0 + ); } else { - Minz_Request::good(_t('feedback.profile.updated'), ['c' => 'user', 'a' => 'profile']); + Minz_Request::good( + _t('feedback.profile.updated'), + ['c' => 'user', 'a' => 'profile'], + showNotification: FreshRSS_Context::userConf()->good_notification_timeout > 0 + ); } } else { Minz_Request::bad(_t('feedback.profile.error'), ['c' => 'user', 'a' => 'profile']); @@ -532,7 +548,8 @@ class FreshRSS_user_Controller extends FreshRSS_ActionController { if ($user_config->email_validation_token === '') { Minz_Request::good( _t('user.email.validation.feedback.unnecessary'), - ['c' => 'index', 'a' => 'index'] + ['c' => 'index', 'a' => 'index'], + showNotification: FreshRSS_Context::userConf()->good_notification_timeout > 0 ); } @@ -548,7 +565,8 @@ class FreshRSS_user_Controller extends FreshRSS_ActionController { if ($user_config->save()) { Minz_Request::good( _t('user.email.validation.feedback.ok'), - ['c' => 'index', 'a' => 'index'] + ['c' => 'index', 'a' => 'index'], + showNotification: FreshRSS_Context::userConf()->good_notification_timeout > 0 ); } else { Minz_Request::bad( @@ -594,7 +612,8 @@ class FreshRSS_user_Controller extends FreshRSS_ActionController { if ($ok) { Minz_Request::good( _t('user.email.validation.feedback.email_sent'), - $redirect_url + $redirect_url, + showNotification: FreshRSS_Context::userConf()->good_notification_timeout > 0 ); } else { Minz_Request::bad( @@ -709,7 +728,11 @@ class FreshRSS_user_Controller extends FreshRSS_ActionController { FreshRSS_UserDAO::touch($username); if ($ok) { - Minz_Request::good(_t('feedback.user.updated', $username), ['c' => 'user', 'a' => 'manage']); + Minz_Request::good( + _t('feedback.user.updated', $username), + ['c' => 'user', 'a' => 'manage'], + showNotification: FreshRSS_Context::userConf()->good_notification_timeout > 0 + ); } else { Minz_Request::bad( _t('feedback.user.updated.error', $username), |
