From bd6a7606c0d2364fd472f7903260a72f37b31f3b Mon Sep 17 00:00:00 2001 From: Alexandre Alapetite Date: Sat, 25 Jan 2014 23:21:01 +0100 Subject: Intégration statistiques MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Quelques corrections https://github.com/marienfressinaud/FreshRSS/pull/390 en particulier correction bug chargement asynchrone JavaScript Pour https://github.com/marienfressinaud/FreshRSS/issues/90 --- app/Controllers/indexController.php | 11 +++++------ app/i18n/en.php | 10 +++++----- app/i18n/fr.php | 10 +++++----- app/views/index/stats.phtml | 15 +++++++++++++-- 4 files changed, 28 insertions(+), 18 deletions(-) diff --git a/app/Controllers/indexController.php b/app/Controllers/indexController.php index 84ed992f9..898f2577c 100755 --- a/app/Controllers/indexController.php +++ b/app/Controllers/indexController.php @@ -6,14 +6,12 @@ class FreshRSS_index_Controller extends Minz_ActionController { private $entryDAO; private $feedDAO; private $catDAO; - private $statsDAO; function __construct($router) { parent::__construct($router); $this->entryDAO = new FreshRSS_EntryDAO (); $this->feedDAO = new FreshRSS_FeedDAO (); $this->catDAO = new FreshRSS_CategoryDAO (); - $this->statsDAO = new FreshRSS_StatsDAO (); } public function indexAction () { @@ -202,11 +200,12 @@ class FreshRSS_index_Controller extends Minz_ActionController { } public function statsAction () { + $statsDAO = new FreshRSS_StatsDAO (); Minz_View::appendScript (Minz_Url::display ('/scripts/flotr2.min.js?' . @filemtime(PUBLIC_PATH . '/scripts/flotr2.min.js'))); - $this->view->repartition = $this->statsDAO->calculateEntryRepartition(); - $this->view->count = ($this->statsDAO->calculateEntryCount()); - $this->view->feedByCategory = $this->statsDAO->calculateFeedByCategory(); - $this->view->entryByCategory = $this->statsDAO->calculateEntryByCategory(); + $this->view->repartition = $statsDAO->calculateEntryRepartition(); + $this->view->count = ($statsDAO->calculateEntryCount()); + $this->view->feedByCategory = $statsDAO->calculateFeedByCategory(); + $this->view->entryByCategory = $statsDAO->calculateEntryByCategory(); } public function aboutAction () { diff --git a/app/i18n/en.php b/app/i18n/en.php index 963105f35..518c14bc8 100644 --- a/app/i18n/en.php +++ b/app/i18n/en.php @@ -22,7 +22,7 @@ return array ( 'subscription_management' => 'Subscriptions management', 'main_stream' => 'Main stream', - 'all_feeds' => 'All feeds', + 'all_feeds' => 'All feeds', 'favorite_feeds' => 'Favourites (%d)', 'not_read' => '%d unread', 'not_reads' => '%d unread', @@ -300,10 +300,10 @@ return array ( 'format_date' => '%s j\<\s\u\p\>S\<\/\s\u\p\> Y', 'format_date_hour' => '%s j\<\s\u\p\>S\<\/\s\u\p\> Y \a\t H\:i', - 'status_favorites' => 'favourites', - 'status_read' => 'read', - 'status_unread' => 'unread', - 'status_total' => 'total', + 'status_favorites' => 'favourites', + 'status_read' => 'read', + 'status_unread' => 'unread', + 'status_total' => 'total', 'stats_entry_repartition' => 'Entry repartition', 'stats_entry_per_day' => 'Entry per day (last 30 days)', diff --git a/app/i18n/fr.php b/app/i18n/fr.php index c8b03ef8b..efe4a08c4 100644 --- a/app/i18n/fr.php +++ b/app/i18n/fr.php @@ -22,7 +22,7 @@ return array ( 'subscription_management' => 'Gestion des abonnements', 'main_stream' => 'Flux principal', - 'all_feeds' => 'Tous les flux', + 'all_feeds' => 'Tous les flux', 'favorite_feeds' => 'Favoris (%d)', 'not_read' => '%d non lu', 'not_reads' => '%d non lus', @@ -300,10 +300,10 @@ return array ( 'format_date' => 'j %s Y', 'format_date_hour' => 'j %s Y \à H\:i', - 'status_favorites' => 'favoris', - 'status_read' => 'lus', - 'status_unread' => 'non lus', - 'status_total' => 'total', + 'status_favorites' => 'favoris', + 'status_read' => 'lus', + 'status_unread' => 'non lus', + 'status_total' => 'total', 'stats_entry_repartition' => 'Répartition des articles', 'stats_entry_per_day' => 'Nombre d’articles par jour (30 derniers jours)', diff --git a/app/views/index/stats.phtml b/app/views/index/stats.phtml index ab9d0a881..b1f0b8eb3 100644 --- a/app/views/index/stats.phtml +++ b/app/views/index/stats.phtml @@ -58,6 +58,15 @@ \ No newline at end of file +} +initStats(); + -- cgit v1.2.3