summaryrefslogtreecommitdiff
path: root/app/Controllers
diff options
context:
space:
mode:
authorGravatar maTh <math-home@web.de> 2022-03-22 23:09:50 +0100
committerGravatar GitHub <noreply@github.com> 2022-03-22 23:09:50 +0100
commit7d00ad8ed75cae5dafd4ac1f2cc6e15e94333628 (patch)
treeea523dba448e8d1760e50e166bdc0a3881609120 /app/Controllers
parenteabe95e28cccb921d4874ae7210bb2bf38b68e4d (diff)
Improve: manage feed in view within a slider (#4226)
* it works * small improvements * Update slider.js * fixed JS syntax * slider.js included in main.js * fix syntax * delete including of slider.js * Update extra.js
Diffstat (limited to 'app/Controllers')
-rwxr-xr-xapp/Controllers/feedController.php31
-rwxr-xr-xapp/Controllers/indexController.php8
-rw-r--r--app/Controllers/subscriptionController.php20
3 files changed, 47 insertions, 12 deletions
diff --git a/app/Controllers/feedController.php b/app/Controllers/feedController.php
index 0d1cd3230..cd4039470 100755
--- a/app/Controllers/feedController.php
+++ b/app/Controllers/feedController.php
@@ -738,16 +738,31 @@ class FreshRSS_feed_Controller extends FreshRSS_ActionController {
* @todo handle "r" redirection in Minz_Request::forward()?
*/
public function deleteAction() {
- $redirect_url = Minz_Request::param('r', false, true);
- if (!$redirect_url) {
- $redirect_url = array('c' => 'subscription', 'a' => 'index');
- }
- if (!Minz_Request::isPost()) {
- Minz_Request::forward($redirect_url, true);
- }
-
+ $from = Minz_Request::param('from');
$id = Minz_Request::param('id');
+ switch ($from) {
+ case 'stats':
+ $redirect_url = array('c' => 'stats', 'a' => 'idle');
+ break;
+ case 'normal':
+ $get = Minz_Request::param('get');
+ if ($get) {
+ $redirect_url = array('c' => 'index', 'a' => 'normal', 'params' => array('get' => $get));
+ } else {
+ $redirect_url = array('c' => 'index', 'a' => 'normal');
+ }
+ break;
+ default:
+ $redirect_url = Minz_Request::param('r', false, true);
+ if (!$redirect_url) {
+ $redirect_url = array('c' => 'subscription', 'a' => 'index');
+ }
+ if (!Minz_Request::isPost()) {
+ Minz_Request::forward($redirect_url, true);
+ }
+ }
+
if (self::deleteFeed($id)) {
Minz_Request::good(_t('feedback.sub.feed.deleted'), $redirect_url);
} else {
diff --git a/app/Controllers/indexController.php b/app/Controllers/indexController.php
index 4f2f0d451..34770fffb 100755
--- a/app/Controllers/indexController.php
+++ b/app/Controllers/indexController.php
@@ -26,6 +26,14 @@ class FreshRSS_index_Controller extends FreshRSS_ActionController {
return;
}
+ $id = Minz_Request::param('id');
+ if ($id) {
+ $view = Minz_Request::param('a');
+ $url_redirect = array('c' => 'subscription', 'a' => 'feed', 'params' => array('id' => $id, 'from' => $view));
+ Minz_Request::forward($url_redirect, true);
+ return;
+ }
+
try {
$this->updateContext();
} catch (FreshRSS_Context_Exception $e) {
diff --git a/app/Controllers/subscriptionController.php b/app/Controllers/subscriptionController.php
index 0b8c62128..60a433f50 100644
--- a/app/Controllers/subscriptionController.php
+++ b/app/Controllers/subscriptionController.php
@@ -225,11 +225,23 @@ class FreshRSS_subscription_Controller extends FreshRSS_ActionController {
invalidateHttpCache();
$from = Minz_Request::param('from');
- if ($from === false) {
- $url_redirect = array('c' => 'subscription', 'params' => array('id' => $id));
- } else {
- $url_redirect = array('c' => 'stats', 'a' => 'idle', 'params' => array('id' => $id, 'from' => 'stats'));
+ switch ($from) {
+ case 'stats':
+ $url_redirect = array('c' => 'stats', 'a' => 'idle', 'params' => array('id' => $id, 'from' => 'stats'));
+ break;
+ case 'normal':
+ case 'reader':
+ $get = Minz_Request::param('get');
+ if ($get) {
+ $url_redirect = array('c' => 'index', 'a' => $from, 'params' => array('get' => $get));
+ } else {
+ $url_redirect = array('c' => 'index', 'a' => $from);
+ }
+ break;
+ default:
+ $url_redirect = array('c' => 'subscription', 'params' => array('id' => $id));
}
+
if ($feedDAO->updateFeed($id, $values) !== false) {
$feed->_category($cat);
$feed->faviconPrepare();