| <?php |
|
|
| |
| |
| |
| |
| |
| |
|
|
| namespace Piwik\Plugins\CoreHome\DataTableRowAction; |
|
|
| use Piwik\Common; |
| use Piwik\Context; |
| use Piwik\Piwik; |
| use Piwik\Request; |
|
|
| |
| |
| |
| |
| class MultiRowEvolution extends RowEvolution |
| { |
| |
| |
| |
| |
| protected $metric; |
|
|
| |
| |
| |
| |
| protected $initiallyShowAllMetrics = true; |
|
|
| |
| |
| |
| |
| protected $metricsForSelect; |
|
|
| |
| |
| |
| |
| |
| |
| public function __construct($idSite, $date, $graphType = 'graphEvolution') |
| { |
| $this->metric = Common::sanitizeInputValue(Request::fromRequest()->getStringParameter('column', '')); |
| parent::__construct($idSite, $date, $graphType); |
| } |
|
|
| protected function loadEvolutionReport($column = false) |
| { |
| |
| parent::loadEvolutionReport($this->metric); |
| } |
|
|
| protected function extractEvolutionReport($report) |
| { |
| $this->metric = $report['column']; |
| $this->dataTable = $report['reportData']; |
| $this->availableMetrics = $report['metadata']['metrics']; |
| $this->metricsForSelect = $report['metadata']['columns']; |
| $this->dimension = $report['metadata']['dimension']; |
| } |
|
|
| |
| |
| |
| |
| |
| |
| public function renderPopover($controller, $view) |
| { |
| |
| $view->availableMetrics = $this->metricsForSelect; |
| $view->selectedMetric = $this->metric; |
|
|
| $view->availableRecordsText = $this->dimension . ': ' |
| . Piwik::translate('RowEvolution_ComparingRecords', array(count($this->availableMetrics))); |
|
|
| return parent::renderPopover($controller, $view); |
| } |
|
|
| protected function getRowEvolutionGraphFromController(\Piwik\Plugins\CoreHome\Controller $controller) |
| { |
| |
| return Context::executeWithQueryParameters(['compareSegments' => [], 'comparePeriods' => [], 'compareDates' => []], function () use ($controller) { |
| return parent::getRowEvolutionGraphFromController($controller); |
| }); |
| } |
|
|
| public function getRowEvolutionGraph($graphType = false, $metrics = false) |
| { |
| |
| return Context::executeWithQueryParameters(['compareSegments' => [], 'comparePeriods' => [], 'compareDates' => []], function () use ($graphType, $metrics) { |
| return parent::getRowEvolutionGraph($graphType, $metrics); |
| }); |
| } |
|
|
| protected function getSparkline($metric) |
| { |
| |
| return Context::executeWithQueryParameters(['compareSegments' => [], 'comparePeriods' => [], 'compareDates' => []], function () use ($metric) { |
| return parent::getSparkline($metric); |
| }); |
| } |
| } |
|
|