diff options
| author | 2022-02-05 10:57:36 +0100 | |
|---|---|---|
| committer | 2022-02-05 10:57:36 +0100 | |
| commit | be9c06fd5c1bfed8e0147c938b96e4876df98133 (patch) | |
| tree | 3113a9d106ee19f3d5a43dce6620a1b03d72341e /app/Controllers/statsController.php | |
| parent | dc27baa7d67f4bc601ced80229844a88a7ca23d4 (diff) | |
Improved: Idle feeds list in a new layout (#4192)
* that should work fine
* fixed phpcs
* fixed phpcs
Diffstat (limited to 'app/Controllers/statsController.php')
| -rw-r--r-- | app/Controllers/statsController.php | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/app/Controllers/statsController.php b/app/Controllers/statsController.php index d03c4fa3d..170d35d6f 100644 --- a/app/Controllers/statsController.php +++ b/app/Controllers/statsController.php @@ -20,6 +20,14 @@ class FreshRSS_stats_Controller extends FreshRSS_ActionController { 'style-src' => "'self' 'unsafe-inline'", ]); + $catDAO = FreshRSS_Factory::createCategoryDao(); + $feedDAO = FreshRSS_Factory::createFeedDao(); + + $catDAO->checkDefault(); + $feedDAO->updateTTL(); + $this->view->categories = $catDAO->listSortedCategories(false); + $this->view->default_category = $catDAO->getDefault(); + FreshRSS_View::prependTitle(_t('admin.stats.title') . ' ยท '); } @@ -92,6 +100,23 @@ class FreshRSS_stats_Controller extends FreshRSS_ActionController { } /** + * This action handles the feed action on the idle statistic page. + * set the 'from' parameter to remember that it had a redirection coming from stats controller, + * to use the subscription controller to save it, + * but shows the stats idle page + */ + public function feedAction() { + $id = Minz_Request::param('id'); + $ajax = Minz_Request::param('ajax'); + if ($ajax) { + $url_redirect = array('c' => 'subscription', 'a' => 'feed', 'params' => array('id' => $id, 'from' => 'stats', 'ajax' => $ajax)); + } else { + $url_redirect = array('c' => 'subscription', 'a' => 'feed', 'params' => array('id' => $id, 'from' => 'stats')); + } + Minz_Request::forward($url_redirect, true); + } + + /** * This action handles the idle feed statistic page. * * It displays the list of idle feed for different period. The supported @@ -138,6 +163,9 @@ class FreshRSS_stats_Controller extends FreshRSS_ActionController { $last5Year->modify('-5 year'); foreach ($feeds as $feed) { + $feedDAO = FreshRSS_Factory::createFeedDao(); + $feed['favicon'] = $feedDAO->searchById($feed['id'])->favicon(); + $feedDate->setTimestamp($feed['last_date']); if ($feedDate >= $lastWeek) { continue; @@ -162,6 +190,14 @@ class FreshRSS_stats_Controller extends FreshRSS_ActionController { } $this->view->idleFeeds = $idleFeeds; + + $id = Minz_Request::param('id'); + $this->view->displaySlider = false; + if (false !== $id) { + $this->view->displaySlider = true; + $feedDAO = FreshRSS_Factory::createFeedDao(); + $this->view->feed = $feedDAO->searchById($id); + } } /** |
