diff options
author | Thomas Steur <thomas.steur@googlemail.com> | 2014-06-11 09:52:22 +0400 |
---|---|---|
committer | Thomas Steur <thomas.steur@googlemail.com> | 2014-06-11 09:52:22 +0400 |
commit | f52c1e83aef857b6cf073f1f9fb00c6982f8d7d2 (patch) | |
tree | a4e7dbc78df2c801b2b9d11364f94022768de28f /plugins/VisitorInterest/Reports | |
parent | 4f2e01d20a8027cf545613d883e4ef22267c1cc1 (diff) |
converted more reports, segments, dimensions, ... not finished yet
Diffstat (limited to 'plugins/VisitorInterest/Reports')
5 files changed, 236 insertions, 0 deletions
diff --git a/plugins/VisitorInterest/Reports/Base.php b/plugins/VisitorInterest/Reports/Base.php new file mode 100644 index 0000000000..a91cd23091 --- /dev/null +++ b/plugins/VisitorInterest/Reports/Base.php @@ -0,0 +1,18 @@ +<?php +/** + * Piwik - Open source web analytics + * + * @link http://piwik.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + * + */ +namespace Piwik\Plugins\VisitorInterest\Reports; + +abstract class Base extends \Piwik\Plugin\Report +{ + protected function init() + { + $this->category = 'General_Visitors'; + } + +} diff --git a/plugins/VisitorInterest/Reports/GetNumberOfVisitsByDaysSinceLast.php b/plugins/VisitorInterest/Reports/GetNumberOfVisitsByDaysSinceLast.php new file mode 100644 index 0000000000..4e4fc9a28c --- /dev/null +++ b/plugins/VisitorInterest/Reports/GetNumberOfVisitsByDaysSinceLast.php @@ -0,0 +1,46 @@ +<?php +/** + * Piwik - Open source web analytics + * + * @link http://piwik.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + * + */ +namespace Piwik\Plugins\VisitorInterest\Reports; + +use Piwik\Piwik; +use Piwik\Plugin\ViewDataTable; +use Piwik\Plugins\VisitorInterest\Columns\Visitsbydayssincelastvisit; + +class GetNumberOfVisitsByDaysSinceLast extends Base +{ + protected function init() + { + parent::init(); + $this->dimension = new Visitsbydayssincelastvisit(); + $this->name = Piwik::translate('VisitorInterest_VisitsByDaysSinceLast'); + $this->documentation = Piwik::translate('VisitorInterest_WidgetVisitsByDaysSinceLastDocumentation'); + $this->metrics = array('nb_visits'); + $this->constantRowsCount = true; + $this->order = 30; + $this->widgetTitle = 'VisitorInterest_WidgetVisitsByDaysSinceLast'; + } + + public function configureView(ViewDataTable $view) + { + $view->requestConfig->filter_sort_column = 'label'; + $view->requestConfig->filter_sort_order = 'asc'; + $view->requestConfig->filter_limit = 15; + + $view->config->show_search = false; + $view->config->enable_sort = false; + $view->config->show_offset_information = false; + $view->config->show_pagination_control = false; + $view->config->show_limit_control = false; + $view->config->show_all_views_icons = false; + $view->config->show_table_all_columns = false; + $view->config->show_exclude_low_population = false; + $view->config->addTranslation('label', Piwik::translate('General_DaysSinceLastVisit')); + } + +} diff --git a/plugins/VisitorInterest/Reports/GetNumberOfVisitsByVisitCount.php b/plugins/VisitorInterest/Reports/GetNumberOfVisitsByVisitCount.php new file mode 100644 index 0000000000..80a5ef0e7b --- /dev/null +++ b/plugins/VisitorInterest/Reports/GetNumberOfVisitsByVisitCount.php @@ -0,0 +1,54 @@ +<?php +/** + * Piwik - Open source web analytics + * + * @link http://piwik.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + * + */ +namespace Piwik\Plugins\VisitorInterest\Reports; + +use Piwik\Metrics; +use Piwik\Piwik; +use Piwik\Plugin\ViewDataTable; +use Piwik\Plugins\VisitorInterest\Columns\VisitsbyVisitNumber; + +class GetNumberOfVisitsByVisitCount extends Base +{ + protected function init() + { + parent::init(); + $this->dimension = new VisitsbyVisitNumber(); + $this->name = Piwik::translate('VisitorInterest_visitsByVisitCount'); + $this->documentation = Piwik::translate('VisitorInterest_WidgetVisitsByNumDocumentation') + . '<br />' . Piwik::translate('General_ChangeTagCloudView'); + $this->metrics = array('nb_visits', 'nb_visits_percentage'); + $this->constantRowsCount = true; + $this->order = 25; + $this->widgetTitle = 'VisitorInterest_visitsByVisitCount'; + } + + public function configureView(ViewDataTable $view) + { + $view->requestConfig->filter_sort_column = 'label'; + $view->requestConfig->filter_sort_order = 'asc'; + $view->requestConfig->filter_limit = 15; + + $view->config->addTranslations(array( + 'label' => Piwik::translate('VisitorInterest_VisitNum'), + 'nb_visits_percentage' => Metrics::getPercentVisitColumn()) + ); + + $view->config->columns_to_display = array('label', 'nb_visits', 'nb_visits_percentage'); + $view->config->show_exclude_low_population = false; + + $view->config->enable_sort = false; + $view->config->show_offset_information = false; + $view->config->show_pagination_control = false; + $view->config->show_limit_control = false; + $view->config->show_search = false; + $view->config->show_table_all_columns = false; + $view->config->show_all_views_icons = false; + } + +} diff --git a/plugins/VisitorInterest/Reports/GetNumberOfVisitsPerPage.php b/plugins/VisitorInterest/Reports/GetNumberOfVisitsPerPage.php new file mode 100644 index 0000000000..351c3b35e7 --- /dev/null +++ b/plugins/VisitorInterest/Reports/GetNumberOfVisitsPerPage.php @@ -0,0 +1,59 @@ +<?php +/** + * Piwik - Open source web analytics + * + * @link http://piwik.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + * + */ +namespace Piwik\Plugins\VisitorInterest\Reports; + +use Piwik\Piwik; +use Piwik\Plugin\ViewDataTable; +use Piwik\Plugins\CoreVisualizations\Visualizations\Cloud; +use Piwik\Plugins\CoreVisualizations\Visualizations\Graph; +use Piwik\Plugins\VisitorInterest\Columns\Pagespervisit; + +class GetNumberOfVisitsPerPage extends Base +{ + protected function init() + { + parent::init(); + $this->dimension = new Pagespervisit(); + $this->name = Piwik::translate('VisitorInterest_WidgetPages'); + $this->documentation = Piwik::translate('VisitorInterest_WidgetPagesDocumentation') + . '<br />' . Piwik::translate('General_ChangeTagCloudView'); + $this->metrics = array('nb_visits'); + $this->constantRowsCount = true; + $this->order = 20; + $this->widgetTitle = 'VisitorInterest_WidgetPages'; + } + + public function getDefaultTypeViewDataTable() + { + return Cloud::ID; + } + + public function configureView(ViewDataTable $view) + { + $view->requestConfig->filter_sort_column = 'label'; + $view->requestConfig->filter_sort_order = 'asc'; + + $view->config->addTranslation('label', Piwik::translate('VisitorInterest_ColumnVisitDuration')); + $view->config->enable_sort = false; + $view->config->show_exclude_low_population = false; + $view->config->show_offset_information = false; + $view->config->show_pagination_control = false; + $view->config->show_limit_control = false; + $view->config->show_search = false; + $view->config->show_table_all_columns = false; + $view->config->columns_to_display = array('label', 'nb_visits'); + + if ($view->isViewDataTableId(Graph::ID)) { + $view->config->show_series_picker = false; + $view->config->selectable_columns = array(); + $view->config->max_graph_elements = 10; + } + } + +} diff --git a/plugins/VisitorInterest/Reports/GetNumberOfVisitsPerVisitDuration.php b/plugins/VisitorInterest/Reports/GetNumberOfVisitsPerVisitDuration.php new file mode 100644 index 0000000000..065c60ca94 --- /dev/null +++ b/plugins/VisitorInterest/Reports/GetNumberOfVisitsPerVisitDuration.php @@ -0,0 +1,59 @@ +<?php +/** + * Piwik - Open source web analytics + * + * @link http://piwik.org + * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later + * + */ +namespace Piwik\Plugins\VisitorInterest\Reports; + +use Piwik\Piwik; +use Piwik\Plugin\ViewDataTable; +use Piwik\Plugins\CoreVisualizations\Visualizations\Cloud; +use Piwik\Plugins\CoreVisualizations\Visualizations\Graph; +use Piwik\Plugins\VisitorInterest\Columns\Visitduration; + +class GetNumberOfVisitsPerVisitDuration extends Base +{ + protected function init() + { + parent::init(); + $this->dimension = new Visitduration(); + $this->name = Piwik::translate('VisitorInterest_WidgetLengths'); + $this->documentation = Piwik::translate('VisitorInterest_WidgetLengthsDocumentation') + . '<br />' . Piwik::translate('General_ChangeTagCloudView'); + $this->metrics = array('nb_visits'); + $this->constantRowsCount = true; + $this->order = 15; + $this->widgetTitle = 'VisitorInterest_WidgetLengths'; + } + + public function getDefaultTypeViewDataTable() + { + return Cloud::ID; + } + + public function configureView(ViewDataTable $view) + { + $view->requestConfig->filter_sort_column = 'label'; + $view->requestConfig->filter_sort_order = 'asc'; + + $view->config->addTranslation('label', Piwik::translate('VisitorInterest_ColumnVisitDuration')); + $view->config->enable_sort = false; + $view->config->show_exclude_low_population = false; + $view->config->show_offset_information = false; + $view->config->show_pagination_control = false; + $view->config->show_limit_control = false; + $view->config->show_search = false; + $view->config->show_table_all_columns = false; + $view->config->columns_to_display = array('label', 'nb_visits'); + + if ($view->isViewDataTableId(Graph::ID)) { + $view->config->show_series_picker = false; + $view->config->selectable_columns = array(); + $view->config->max_graph_elements = 10; + } + } + +} |