diff options
author | sgiehl <stefan@piwik.org> | 2015-01-12 21:53:04 +0300 |
---|---|---|
committer | sgiehl <stefan@piwik.org> | 2015-01-12 21:53:04 +0300 |
commit | 037c64e3faccae9392712660aa1958c2c34ce493 (patch) | |
tree | 0536820f4d845a63b9ac9e59e3a3a2397da52569 | |
parent | a0b8ddbde4dffdcc597687ace203e8d8d4f238d4 (diff) |
refs #6928 - set fixed view type for visitor log
-rw-r--r-- | core/Plugin/Report.php | 16 | ||||
-rw-r--r-- | plugins/Live/Reports/GetLastVisitsDetails.php | 5 |
2 files changed, 20 insertions, 1 deletions
diff --git a/core/Plugin/Report.php b/core/Plugin/Report.php index 64a0ce603b..2bb87bde3a 100644 --- a/core/Plugin/Report.php +++ b/core/Plugin/Report.php @@ -271,6 +271,16 @@ class Report } /** + * Returns if the default viewDataTable type is fixed. e.g. the type won't be changeable through config or url params. + * Defaults to false + * @return bool + */ + public function isDefaultTypeFixed() + { + return false; + } + + /** * Here you can configure how your report should be displayed and which capabilities your report has. For instance * whether your report supports a "search" or not. EG `$view->config->show_search = false`. You can also change the * default request config. For instance you can change how many rows are displayed by default: @@ -302,7 +312,11 @@ class Report $apiAction = $apiProxy->buildApiActionName($this->module, $this->action); - $view = ViewDataTableFactory::build(null, $apiAction, $this->module . '.' . $this->action); + if ($this->isDefaultTypeFixed()) { + $view = ViewDataTableFactory::build($this->getDefaultTypeViewDataTable(), $apiAction, $this->module . '.' . $this->action, true); + } else { + $view = ViewDataTableFactory::build(null, $apiAction, $this->module . '.' . $this->action); + } $rendered = $view->render(); return $rendered; diff --git a/plugins/Live/Reports/GetLastVisitsDetails.php b/plugins/Live/Reports/GetLastVisitsDetails.php index 9c2b4373e3..bb88e712f5 100644 --- a/plugins/Live/Reports/GetLastVisitsDetails.php +++ b/plugins/Live/Reports/GetLastVisitsDetails.php @@ -27,6 +27,11 @@ class GetLastVisitsDetails extends Base return VisitorLog::ID; } + public function isDefaultTypeFixed() + { + return true; + } + public function configureReportingMenu(MenuReporting $menu) { if ($this->isEnabled()) { |