diff options
Diffstat (limited to 'app')
| -rwxr-xr-x | app/Controllers/feedController.php | 31 | ||||
| -rwxr-xr-x | app/Controllers/indexController.php | 8 | ||||
| -rw-r--r-- | app/Controllers/subscriptionController.php | 20 | ||||
| -rw-r--r-- | app/layout/aside_feed.phtml | 10 | ||||
| -rw-r--r-- | app/views/configure/queries.phtml | 1 | ||||
| -rw-r--r-- | app/views/extension/index.phtml | 1 | ||||
| -rw-r--r-- | app/views/helpers/feed/update.phtml | 16 | ||||
| -rw-r--r-- | app/views/index/normal.phtml | 7 |
8 files changed, 76 insertions, 18 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(); diff --git a/app/layout/aside_feed.phtml b/app/layout/aside_feed.phtml index bb03bdfc6..10dc8e724 100644 --- a/app/layout/aside_feed.phtml +++ b/app/layout/aside_feed.phtml @@ -141,7 +141,15 @@ <li class="item"><a target="_blank" rel="noreferrer" href="http://example.net/"><?= _t('gen.action.see_website') ?></a></li> <?php if (FreshRSS_Auth::hasAccess()) { ?> <li class="separator"></li> - <li class="item"><a href="<?= _url('subscription', 'index', 'id', '------') ?>"><?= _t('gen.action.manage') ?></a></li> + <?php + $get = Minz_Request::param('get'); + if (!$get) { + $url = _url('subscription', 'feed', 'id', '------', 'from', $actual_view); + } else { + $url = _url('subscription', 'feed', 'id', '------', 'get', $get, 'from', $actual_view); + } + ?> + <li class="item"><a class="configure open-slider" href="<?= $url ?>"><?= _t('gen.action.manage') ?></a></li> <li class="item"><a href="<?= _url('feed', 'actualize', 'id', '------') ?>"><?= _t('gen.action.actualize') ?></a></li> <li class="item"> <?php $confirm = FreshRSS_Context::$user_conf->reading_confirm ? 'confirm" disabled="disabled' : ''; ?> diff --git a/app/views/configure/queries.phtml b/app/views/configure/queries.phtml index 3e4b3684b..e9f4aed41 100644 --- a/app/views/configure/queries.phtml +++ b/app/views/configure/queries.phtml @@ -71,5 +71,4 @@ } ?> </div> - </main> diff --git a/app/views/extension/index.phtml b/app/views/extension/index.phtml index 706d238e5..f72a25ed1 100644 --- a/app/views/extension/index.phtml +++ b/app/views/extension/index.phtml @@ -89,5 +89,4 @@ } ?> </div> - </main> diff --git a/app/views/helpers/feed/update.phtml b/app/views/helpers/feed/update.phtml index 23906b36d..c22761bfa 100644 --- a/app/views/helpers/feed/update.phtml +++ b/app/views/helpers/feed/update.phtml @@ -23,7 +23,12 @@ if ($from === false) { $url = _url('subscription', 'feed', 'id', $this->feed->id()); } else { - $url = _url('subscription', 'feed', 'id', $this->feed->id(), 'from', $from); + $get = Minz_Request::param('get'); + if (!$get) { + $url = _url('subscription', 'feed', 'id', $this->feed->id(), 'from', $from); + } else { + $url = _url('subscription', 'feed', 'id', $this->feed->id(), 'from', $from, 'get', $get); + } } ?> <form method="post" action="<?= $url ?>" autocomplete="off"> @@ -129,9 +134,16 @@ <div class="group-controls"> <button type="submit" class="btn btn-important"><?= _t('gen.action.submit') ?></button> <button type="reset" class="btn"><?= _t('gen.action.cancel') ?></button> + <?php + if ($from === false) { + $url = _url('feed', 'delete', 'id', $this->feed->id()); + } else { + $url = _url('feed', 'delete', 'id', $this->feed->id(), 'from', $from); + } + ?> <button type="submit" class="btn btn-attention confirm" data-str-confirm="<?= _t('gen.js.confirm_action_feed_cat') ?>" - formaction="<?= _url('feed', 'delete', 'id', $this->feed->id()) ?>" + formaction="<?= $url ?>" formmethod="post"><?= _t('gen.action.remove') ?></button> </div> </div> diff --git a/app/views/index/normal.phtml b/app/views/index/normal.phtml index 06323dcb0..92c10b1b7 100644 --- a/app/views/index/normal.phtml +++ b/app/views/index/normal.phtml @@ -114,7 +114,12 @@ $today = @strtotime('today'); if ($nbEntries > 0): call_user_func($this->callbackBeforePagination, $this, $nbEntries, $lastEntry); $this->renderHelper('stream-footer'); -?></main><?php +?><?php $class = $this->displaySlider ? ' class="active"' : ''; ?> +<a href="#" id="close-slider"<?= $class ?>> + <?= _i('close') ?> +</a> +<div id="slider"<?= $class ?>> +</div></main><?php else: ob_end_clean(); //Discard the articles headers, as we have no articles ?> |
