aboutsummaryrefslogtreecommitdiff
path: root/app/Controllers/statsController.php
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2015-01-31 14:45:37 +0100
committerGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2015-01-31 14:45:37 +0100
commita97bbd9bd54c5fa56d54b3c214cf4e8af96af8b2 (patch)
tree6e83890bc1b3814a12c3b7bedc0d5944f30f507b /app/Controllers/statsController.php
parent42fd539a1b14f883077048a35864b4294b6efe94 (diff)
parente91b72b63cd11ae3c4f59e48439e93955242c673 (diff)
Merge branch 'dev'
Conflicts: CHANGELOG README.fr.md README.md app/Controllers/feedController.php app/Controllers/indexController.php app/i18n/en.php app/i18n/fr.php app/views/helpers/view/normal_view.phtml app/views/stats/index.phtml app/views/stats/repartition.phtml constants.php p/scripts/main.js
Diffstat (limited to 'app/Controllers/statsController.php')
-rw-r--r--app/Controllers/statsController.php32
1 files changed, 15 insertions, 17 deletions
diff --git a/app/Controllers/statsController.php b/app/Controllers/statsController.php
index 3069be34d..4a597ae7d 100644
--- a/app/Controllers/statsController.php
+++ b/app/Controllers/statsController.php
@@ -6,6 +6,19 @@
class FreshRSS_stats_Controller extends Minz_ActionController {
/**
+ * This action is called before every other action in that class. It is
+ * the common boiler plate for every action. It is triggered by the
+ * underlying framework.
+ */
+ public function firstAction() {
+ if (!FreshRSS_Auth::hasAccess()) {
+ Minz_Error::error(403);
+ }
+
+ Minz_View::prependTitle(_t('admin.stats.title') . ' · ');
+ }
+
+ /**
* This action handles the statistic main page.
*
* It displays the statistic main page.
@@ -99,11 +112,12 @@ class FreshRSS_stats_Controller extends Minz_ActionController {
$categoryDAO = new FreshRSS_CategoryDAO();
$feedDAO = FreshRSS_Factory::createFeedDao();
Minz_View::appendScript(Minz_Url::display('/scripts/flotr2.min.js?' . @filemtime(PUBLIC_PATH . '/scripts/flotr2.min.js')));
- $id = Minz_Request::param ('id', null);
+ $id = Minz_Request::param('id', null);
$this->view->categories = $categoryDAO->listCategories();
$this->view->feed = $feedDAO->searchById($id);
$this->view->days = $statsDAO->getDays();
$this->view->months = $statsDAO->getMonths();
+ $this->view->repartition = $statsDAO->calculateEntryRepartitionPerFeed($id);
$this->view->repartitionHour = $statsDAO->calculateEntryRepartitionPerFeedPerHour($id);
$this->view->averageHour = $statsDAO->calculateEntryAveragePerFeedPerHour($id);
$this->view->repartitionDayOfWeek = $statsDAO->calculateEntryRepartitionPerFeedPerDayOfWeek($id);
@@ -111,20 +125,4 @@ class FreshRSS_stats_Controller extends Minz_ActionController {
$this->view->repartitionMonth = $statsDAO->calculateEntryRepartitionPerFeedPerMonth($id);
$this->view->averageMonth = $statsDAO->calculateEntryAveragePerFeedPerMonth($id);
}
-
- /**
- * This action is called before every other action in that class. It is
- * the common boiler plate for every action. It is triggered by the
- * underlying framework.
- */
- public function firstAction() {
- if (!$this->view->loginOk) {
- Minz_Error::error(
- 403, array('error' => array(Minz_Translate::t('access_denied')))
- );
- }
-
- Minz_View::prependTitle(Minz_Translate::t('stats') . ' · ');
- }
-
}