From 9ba8f216fd7856ce5fef06bf82ecb8f8a2e7e630 Mon Sep 17 00:00:00 2001 From: Thomas Steur Date: Fri, 3 Jul 2015 00:54:27 +0000 Subject: generate pages instead of implementing them in each controller --- .../JqplotDataGenerator/Evolution.php | 41 +--------------------- 1 file changed, 1 insertion(+), 40 deletions(-) (limited to 'plugins/CoreVisualizations/JqplotDataGenerator/Evolution.php') diff --git a/plugins/CoreVisualizations/JqplotDataGenerator/Evolution.php b/plugins/CoreVisualizations/JqplotDataGenerator/Evolution.php index 5675153c34..5114167364 100644 --- a/plugins/CoreVisualizations/JqplotDataGenerator/Evolution.php +++ b/plugins/CoreVisualizations/JqplotDataGenerator/Evolution.php @@ -12,7 +12,6 @@ use Piwik\Archive\DataTableFactory; use Piwik\Common; use Piwik\DataTable; use Piwik\DataTable\Row; -use Piwik\Menu\MenuMain; use Piwik\Plugins\CoreVisualizations\JqplotDataGenerator; use Piwik\Url; @@ -76,7 +75,6 @@ class Evolution extends JqplotDataGenerator $periodLabel = reset($dataTables)->getMetadata(DataTableFactory::TABLE_METADATA_PERIOD_INDEX)->getLabel(); $axisXOnClick = array(); - $queryStringAsHash = $this->getQueryStringAsHash(); foreach ($dataTable->getDataTables() as $metadataDataTable) { $dateInUrl = $metadataDataTable->getMetadata(DataTableFactory::TABLE_METADATA_PERIOD_INDEX)->getDateStart(); $parameters = array( @@ -85,16 +83,7 @@ class Evolution extends JqplotDataGenerator 'date' => $dateInUrl->toString(), 'segment' => \Piwik\API\Request::getRawSegmentFromRequest() ); - $hash = ''; - if (!empty($queryStringAsHash)) { - $hash = '#' . Url::getQueryStringFromParameters($queryStringAsHash + $parameters); - } - $link = 'index.php?' . - Url::getQueryStringFromParameters(array( - 'module' => 'CoreHome', - 'action' => 'index', - ) + $parameters) - . $hash; + $link = Url::getQueryStringFromParameters($parameters); $axisXOnClick[] = $link; } $visualization->setAxisXOnClick($axisXOnClick); @@ -144,34 +133,6 @@ class Evolution extends JqplotDataGenerator return $label; } - /** - * We link the graph dots to the same report as currently being displayed (only the date would change). - * - * In some cases the widget is loaded within a report that doesn't exist as such. - * For example, the dashboards loads the 'Last visits graph' widget which can't be directly linked to. - * Instead, the graph must link back to the dashboard. - * - * In other cases, like Visitors>Overview or the Goals graphs, we can link the graph clicks to the same report. - * - * To detect whether or not we can link to a report, we simply check if the current URL from which it was loaded - * belongs to the menu or not. If it doesn't belong to the menu, we do not append the hash to the URL, - * which results in loading the dashboard. - * - * @return array Query string array to append to the URL hash or false if the dashboard should be displayed - */ - private function getQueryStringAsHash() - { - $queryString = Url::getArrayFromCurrentQueryString(); - $piwikParameters = array('idSite', 'date', 'period', 'XDEBUG_SESSION_START', 'KEY'); - foreach ($piwikParameters as $parameter) { - unset($queryString[$parameter]); - } - if (MenuMain::getInstance()->isUrlFound($queryString)) { - return $queryString; - } - return false; - } - private function isLinkEnabled() { static $linkEnabled; -- cgit v1.2.3