A free, self-hostable news aggregator…
Refactor idle feed stats
Alexis Degrugillierd9f570a84d32
diff --git a/app/Controllers/statsController.php b/app/Controllers/statsController.phpindex cb8870fa9..655d453c6 100644--- a/app/Controllers/statsController.php+++ b/app/Controllers/statsController.php@@ -51,23 +51,23 @@ class FreshRSS_stats_Controller extends Minz_ActionController {continue;}if ($feedDate < $lastWeek) {- $idleFeeds['lastWeek'][] = $feed['name'];+ $idleFeeds['last_week'][] = $feed['name'];}if ($feedDate < $lastMonth) {- $idleFeeds['lastMonth'][] = $feed['name'];+ $idleFeeds['last_month'][] = $feed['name'];}if ($feedDate < $last3Month) {- $idleFeeds['last3Month'][] = $feed['name'];+ $idleFeeds['last_3_month'][] = $feed['name'];}if ($feedDate < $last6Month) {- $idleFeeds['last6Month'][] = $feed['name'];+ $idleFeeds['last_6_month'][] = $feed['name'];}if ($feedDate < $lastYear) {- $idleFeeds['lastYear'][] = $feed['name'];+ $idleFeeds['last_year'][] = $feed['name'];}}- $this->view->idleFeeds = $idleFeeds;+ $this->view->idleFeeds = array_reverse($idleFeeds);}}diff --git a/app/views/stats/idle.phtml b/app/views/stats/idle.phtmlindex 5c11b3f86..08ce440e8 100644--- a/app/views/stats/idle.phtml+++ b/app/views/stats/idle.phtml@@ -5,53 +5,15 @@<h1><?php echo Minz_Translate::t ('stats_idle'); ?></h1>- <div class="stat">- <h2><?php echo Minz_Translate::t ('last_week'); ?></h2>-- <ul>- <?php foreach ($this->idleFeeds['lastWeek'] as $feed): ?>- <li><?php echo $feed; ?></li>- <?php endforeach; ?>- </ul>- </div>-- <div class="stat">- <h2><?php echo Minz_Translate::t ('last_month'); ?></h2>-- <ul>- <?php foreach ($this->idleFeeds['lastMonth'] as $feed): ?>- <li><?php echo $feed; ?></li>- <?php endforeach; ?>- </ul>- </div>-- <div class="stat">- <h2><?php echo Minz_Translate::t ('last_3_month'); ?></h2>-- <ul>- <?php foreach ($this->idleFeeds['last3Month'] as $feed): ?>- <li><?php echo $feed; ?></li>- <?php endforeach; ?>- </ul>- </div>-- <div class="stat">- <h2><?php echo Minz_Translate::t ('last_6_month'); ?></h2>-- <ul>- <?php foreach ($this->idleFeeds['last6Month'] as $feed): ?>- <li><?php echo $feed; ?></li>- <?php endforeach; ?>- </ul>- </div>-- <div class="stat">- <h2><?php echo Minz_Translate::t ('last_year'); ?></h2>-- <ul>- <?php foreach ($this->idleFeeds['lastYear'] as $feed): ?>- <li><?php echo $feed; ?></li>- <?php endforeach; ?>- </ul>- </div>+ <?php foreach ($this->idleFeeds as $period => $feeds): ?>+ <div class="stat">+ <h2><?php echo Minz_Translate::t ($period); ?></h2>++ <ul>+ <?php foreach ($feeds as $feed): ?>+ <li><?php echo $feed; ?></li>+ <?php endforeach; ?>+ </ul>+ </div>+ <?php endforeach; ?></div>\ No newline at end of file