diff --git a/core/ViewDataTable.php b/core/ViewDataTable.php index bd83dea97bf..ac8ca541549 100644 --- a/core/ViewDataTable.php +++ b/core/ViewDataTable.php @@ -125,7 +125,7 @@ public function __construct() $this->viewProperties['show_table'] = true; $this->viewProperties['show_table_all_columns'] = true; $this->viewProperties['show_all_views_icons'] = true; - $this->viewProperties['hide_all_views_icons'] = false; + $this->viewProperties['show_active_view_icon'] = true; $this->viewProperties['hide_annotations_view'] = true; $this->viewProperties['show_bar_chart'] = true; $this->viewProperties['show_pie_chart'] = true; @@ -310,7 +310,7 @@ public function getOverridableProperties() 'show_table', 'show_table_all_columns', 'show_all_views_icons', - 'hide_all_views_icons', + 'show_active_view_icon', 'hide_annotations_view', 'show_barchart', 'show_piechart', @@ -1093,7 +1093,7 @@ public function disableShowAllViewsIcons() public function hideAllViewsIcons() { $this->viewProperties['show_all_views_icons'] = false; - $this->viewProperties['hide_all_views_icons'] = true; + $this->viewProperties['show_active_view_icon'] = false; } /** diff --git a/core/ViewDataTable/Properties.php b/core/ViewDataTable/Properties.php index 1a899f37b1d..ad1b77fafde 100644 --- a/core/ViewDataTable/Properties.php +++ b/core/ViewDataTable/Properties.php @@ -106,6 +106,27 @@ class Piwik_ViewDataTable_Properties */ const DISPLAY_LOGO_INSTEAD_OF_LABEL = 'display_logo_instead_of_label'; + /** + * Controls whether the footer icons that change the ViewDataTable type of a view are shown + * or not. + */ + const SHOW_ALL_VIEW_ICONS = 'show_all_views_icons'; + + /** + * Controls whether to display a tiny upside-down caret over the currently active view icon. + */ + const SHOW_ACTIVE_VIEW_ICON = 'show_active_view_icon'; + + /** + * TODO: this property is specific ONLY to the row evolution popup. Need to move it. + */ + const EXTERNAL_SERIES_TOGGLE = 'external_series_toggle'; + + /** + * TODO: this property is specific ONLY to the row evolution popup. Need to move it. + */ + const EXTERNAL_SERIES_TOGGLE_SHOW_ALL = 'external_series_toggle_show_all'; + /** * Returns the set of all valid ViewDataTable properties. The result is an array with property * name as a key. Values of the array are undefined. diff --git a/plugins/CoreHome/DataTableRowAction/RowEvolution.php b/plugins/CoreHome/DataTableRowAction/RowEvolution.php index 1c860725db8..15898d29861 100644 --- a/plugins/CoreHome/DataTableRowAction/RowEvolution.php +++ b/plugins/CoreHome/DataTableRowAction/RowEvolution.php @@ -176,23 +176,24 @@ protected function extractEvolutionReport($report) public function getRowEvolutionGraph($graphType = false, $metrics = false) { // set up the view data table - $view = Piwik_ViewDataTable::factory($graphType ?: $this->graphType); + $view = Piwik_ViewDataTable::factory( + $graphType ?: $this->graphType, $this->apiMethod, $controllerAction = 'CoreHome.getRowEvolutionGraph'); $view->setDataTable($this->dataTable); - $view->init('CoreHome', 'getRowEvolutionGraph', $this->apiMethod); - if (!empty($this->graphMetrics)) // In row Evolution popover, this is empty - { - $view->setColumnsToDisplay(array_keys($metrics ?: $this->graphMetrics)); + if (!empty($this->graphMetrics)) { // In row Evolution popover, this is empty + $view->columns_to_display = array_keys($metrics ?: $this->graphMetrics); } - $view->hideAllViewsIcons(); + + $view->show_all_views_icons = false; + $view->show_active_view_icon = false; + $view->show_related_reports = false; foreach ($this->availableMetrics as $metric => $metadata) { - $view->setColumnTranslation($metric, $metadata['name']); + $view->translations[$metric] = $metadata['name']; } - if (method_exists($view, 'addRowEvolutionSeriesToggle')) { - $view->addRowEvolutionSeriesToggle($this->initiallyShowAllMetrics); - } + $view->external_series_toggle = 'RowEvolutionSeriesToggle'; + $view->external_series_toggle_show_all = $this->initiallyShowAllMetrics; return $view; } diff --git a/plugins/CoreHome/templates/_dataTableFooter.twig b/plugins/CoreHome/templates/_dataTableFooter.twig index 8d6f1f1469e..5a74cf4a747 100644 --- a/plugins/CoreHome/templates/_dataTableFooter.twig +++ b/plugins/CoreHome/templates/_dataTableFooter.twig @@ -24,7 +24,7 @@ {% if properties.show_footer_icons %}
- {% if not properties.hide_all_views_icons %} + {% if properties.show_active_view_icon %} {% endif %}
@@ -77,14 +77,6 @@ {% endif %}
- {% elseif not properties.hide_all_views_icons and javascriptVariablesToSet.viewDataTable == "generateDataChartEvolution" %} -
- - - - - -
{% endif %}