diff options
author | mattab <matthieu.aubry@gmail.com> | 2013-07-31 01:31:17 +0400 |
---|---|---|
committer | mattab <matthieu.aubry@gmail.com> | 2013-07-31 01:31:17 +0400 |
commit | c35e613b7ff66c6c86a712f0fd3250692ed9d8a9 (patch) | |
tree | 4e56d45743fc85f80014518e5c5bd419cc4a8f7b /plugins/VisitorInterest/VisitorInterest.php | |
parent | 765be0dc8f92a6d4bb3e678a0c23f2d4b95e0e18 (diff) | |
parent | 13f657ccfa6b58864291a173a0849d7169b031b2 (diff) |
Merge branch 'master' into php-5.3-namespaces
Conflicts:
core/Access.php
core/Config.php
core/EventDispatcher.php
core/JqplotDataGenerator/Evolution.php
core/Piwik.php
core/Plugin/MetadataLoader.php
core/ViewDataTable.php
core/ViewDataTable/Cloud.php
core/ViewDataTable/GenerateGraphHTML.php
core/ViewDataTable/HtmlTable.php
core/ViewDataTable/HtmlTable/AllColumns.php
core/ViewDataTable/HtmlTable/Goals.php
plugins/Actions/Controller.php
plugins/CoreHome/Controller.php
plugins/CoreHome/DataTableRowAction/RowEvolution.php
plugins/CoreHome/templates/_dataTable.twig
plugins/CustomVariables/Controller.php
plugins/DBStats/Controller.php
plugins/DevicesDetection/Controller.php
plugins/ExampleUI/Controller.php
plugins/Goals/Controller.php
plugins/Live/Controller.php
plugins/Provider/Controller.php
plugins/Referers/Controller.php
plugins/UserCountry/Controller.php
plugins/UserCountryMap/Controller.php
plugins/UserSettings/Archiver.php
plugins/UserSettings/Controller.php
plugins/VisitTime/Controller.php
plugins/VisitTime/VisitTime.php
plugins/VisitorInterest/Controller.php
plugins/VisitsSummary/Controller.php
tests/PHPUnit/proxy/index.php
Diffstat (limited to 'plugins/VisitorInterest/VisitorInterest.php')
-rw-r--r-- | plugins/VisitorInterest/VisitorInterest.php | 87 |
1 files changed, 85 insertions, 2 deletions
diff --git a/plugins/VisitorInterest/VisitorInterest.php b/plugins/VisitorInterest/VisitorInterest.php index f61bbeabd0..a46eae1104 100644 --- a/plugins/VisitorInterest/VisitorInterest.php +++ b/plugins/VisitorInterest/VisitorInterest.php @@ -30,6 +30,7 @@ class Piwik_VisitorInterest extends Plugin 'WidgetsList.add' => 'addWidgets', 'Menu.add' => 'addMenu', 'API.getReportMetadata' => 'getReportMetadata', + 'ViewDataTable.getReportDisplayProperties' => 'getReportDisplayProperties', ); return $hooks; } @@ -95,7 +96,7 @@ class Piwik_VisitorInterest extends Plugin ); } - function addWidgets() + public function addWidgets() { WidgetsList::add('General_Visitors', 'VisitorInterest_WidgetLengths', 'VisitorInterest', 'getNumberOfVisitsPerVisitDuration'); WidgetsList::add('General_Visitors', 'VisitorInterest_WidgetPages', 'VisitorInterest', 'getNumberOfVisitsPerPage'); @@ -103,7 +104,7 @@ class Piwik_VisitorInterest extends Plugin WidgetsList::add('General_Visitors', 'VisitorInterest_WidgetVisitsByDaysSinceLast', 'VisitorInterest', 'getNumberOfVisitsByDaysSinceLast'); } - function addMenu() + public function addMenu() { Piwik_RenameMenuEntry('General_Visitors', 'VisitFrequency_SubmenuFrequency', 'General_Visitors', 'VisitorInterest_Engagement'); @@ -144,4 +145,86 @@ class Piwik_VisitorInterest extends Plugin $out .= FrontController::getInstance()->fetchDispatch('VisitorInterest', 'index'); $out .= '</div>'; } + + public function getReportDisplayProperties(&$properties) + { + $properties['VisitorInterest.getNumberOfVisitsPerVisitDuration'] = + $this->getDisplayPropertiesForGetNumberOfVisitsPerVisitDuration(); + $properties['VisitorInterest.getNumberOfVisitsPerPage'] = + $this->getDisplayPropertiesForGetNumberOfVisitsPerPage(); + $properties['VisitorInterest.getNumberOfVisitsByVisitCount'] = + $this->getDisplayPropertiesForGetNumberOfVisitsByVisitCount(); + $properties['VisitorInterest.getNumberOfVisitsByDaysSinceLast'] = + $this->getDisplayPropertiesForGetNumberOfVisitsByDaysSinceLast(); + } + + private function getDisplayPropertiesForGetNumberOfVisitsPerVisitDuration() + { + return array( + 'default_view_type' => 'cloud', + 'filter_sort_column' => 'label', + 'filter_sort_order' => 'asc', + 'translations' => array('label' => Piwik_Translate('VisitorInterest_ColumnVisitDuration')), + 'graph_limit' => 10, + 'enable_sort' => false, + 'show_exclude_low_population' => false, + 'show_offset_information' => false, + 'show_pagination_control' => false, + 'show_search' => false, + 'show_table_all_columns' => false, + ); + } + + private function getDisplayPropertiesForGetNumberOfVisitsPerPage() + { + return array( + 'default_view_type' => 'cloud', + 'filter_sort_column' => 'label', + 'filter_sort_order' => 'asc', + 'translations' => array('label' => Piwik_Translate('VisitorInterest_ColumnPagesPerVisit')), + 'graph_limit' => 10, + 'enable_sort' => false, + 'show_exclude_low_population' => false, + 'show_offset_information' => false, + 'show_pagination_control' => false, + 'show_search' => false, + 'show_table_all_columns' => false, + ); + } + + private function getDisplayPropertiesForGetNumberOfVisitsByVisitCount() + { + return array( + 'columns_to_display' => array('label', 'nb_visits', 'nb_visits_percentage'), + 'filter_sort_column' => 'label', + 'filter_sort_order' => 'asc', + 'translations' => array('label' => Piwik_Translate('VisitorInterest_VisitNum'), + 'nb_visits_percentage' => Piwik_Metrics::getPercentVisitColumn()), + 'show_exclude_low_population' => false, + 'show_offset_information' => false, + 'show_pagination_control' => false, + 'filter_limit' => 15, + 'show_search' => false, + 'enable_sort' => false, + 'show_table_all_columns' => false, + 'show_all_views_icons' => false, + ); + } + + private function getDisplayPropertiesForGetNumberOfVisitsByDaysSinceLast() + { + return array( + 'filter_sort_column' => 'label', + 'filter_sort_order' => 'asc', + 'translations' => array('label' => Piwik_Translate('General_DaysSinceLastVisit')), + 'show_exclude_low_population' => false, + 'show_offset_information' => false, + 'show_pagination_control' => false, + 'show_all_views_icons' => false, + 'filter_limit' => 15, + 'show_search' => false, + 'enable_sort' => false, + 'show_table_all_columns' => false + ); + } } |