diff options
author | Thomas Steur <thomas.steur@googlemail.com> | 2014-06-19 05:37:17 +0400 |
---|---|---|
committer | Thomas Steur <thomas.steur@googlemail.com> | 2014-06-19 05:37:17 +0400 |
commit | 253b165e621953efcb692f985036e217920ba696 (patch) | |
tree | de76a07700ed5b41f3f6a2cc4a880351e1b8b20b /plugins/Live/Controller.php | |
parent | 95aed5eba938839e2ffe74beca4fbf3399c77a54 (diff) |
added possibility to pass a report instance to renderReport() in controller, fixed a bug in menu where the sorting was wrong in case the first added menu item of a category was a submenu entry, made sure it is possible for plugin Menu classes to rename/modify report menu entries, created some reports for live plugin, centralized no permission to view report check and made it possible to overwrite this message for each report
Diffstat (limited to 'plugins/Live/Controller.php')
-rw-r--r-- | plugins/Live/Controller.php | 35 |
1 files changed, 3 insertions, 32 deletions
diff --git a/plugins/Live/Controller.php b/plugins/Live/Controller.php index 224cf869ae..8b7b88dbb4 100644 --- a/plugins/Live/Controller.php +++ b/plugins/Live/Controller.php @@ -13,6 +13,7 @@ use Piwik\Common; use Piwik\Config; use Piwik\MetricsFormatter; use Piwik\Piwik; +use Piwik\Plugins\Live\Reports\GetLastVisitsDetails; use Piwik\Plugins\Goals\API as APIGoals; use Piwik\Url; use Piwik\View; @@ -39,31 +40,6 @@ class Controller extends \Piwik\Plugin\Controller return $this->render($view); } - public function getSimpleLastVisitCount() - { - $lastMinutes = Config::getInstance()->General[self::SIMPLE_VISIT_COUNT_WIDGET_LAST_MINUTES_CONFIG_KEY]; - - $lastNData = Request::processRequest('Live.getCounters', array('lastMinutes' => $lastMinutes)); - - $view = new View('@Live/getSimpleLastVisitCount'); - $view->lastMinutes = $lastMinutes; - $view->visitors = MetricsFormatter::getPrettyNumber($lastNData[0]['visitors']); - $view->visits = MetricsFormatter::getPrettyNumber($lastNData[0]['visits']); - $view->actions = MetricsFormatter::getPrettyNumber($lastNData[0]['actions']); - $view->refreshAfterXSecs = Config::getInstance()->General['live_widget_refresh_after_seconds']; - $view->translations = array( - 'one_visitor' => Piwik::translate('Live_NbVisitor'), - 'visitors' => Piwik::translate('Live_NbVisitors'), - 'one_visit' => Piwik::translate('General_OneVisit'), - 'visits' => Piwik::translate('General_NVisits'), - 'one_action' => Piwik::translate('General_OneAction'), - 'actions' => Piwik::translate('VisitsSummary_NbActionsDescription'), - 'one_minute' => Piwik::translate('General_OneMinute'), - 'minutes' => Piwik::translate('General_NMinutes') - ); - return $this->render($view); - } - public function ajaxTotalVisitors() { $view = new View('@Live/ajaxTotalVisitors'); @@ -83,21 +59,16 @@ class Controller extends \Piwik\Plugin\Controller { $view = new View('@Live/indexVisitorLog.twig'); $view->filterEcommerce = Common::getRequestVar('filterEcommerce', 0, 'int'); - $view->visitorLog = $this->getLastVisitsDetails(); + $view->visitorLog = $this->renderReport(new GetLastVisitsDetails()); return $view->render(); } - public function getLastVisitsDetails() - { - return $this->renderReport(__FUNCTION__); - } - /** * Widget */ public function getVisitorLog() { - return $this->getLastVisitsDetails(); + return $this->renderReport(new GetLastVisitsDetails()); } public function getLastVisitsStart() |