Skip to content

Commit

Permalink
Refs #4040, #4041, remove is_multi_evolution javascript parameter as …
Browse files Browse the repository at this point in the history
…it is no longer necessary due to earlier row evolution refactoring.
  • Loading branch information
Benaka Moorthi committed Aug 3, 2013
1 parent 735b365 commit b808489
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 29 deletions.
4 changes: 2 additions & 2 deletions plugins/CoreHome/Controller.php
Expand Up @@ -155,8 +155,8 @@ public function getMultiRowEvolutionPopover()
public function getRowEvolutionGraph($fetch = false, $rowEvolution = null)
{
if (empty($rowEvolution)) {
$paramName = Piwik_CoreHome_DataTableRowAction_MultiRowEvolution::IS_MULTI_EVOLUTION_PARAM;
$isMultiRowEvolution = Common::getRequestVar($paramName, false, 'int');
$label = Common::getRequestVar('label', '', 'string');
$isMultiRowEvolution = strpos($label, ',') !== false;

$rowEvolution = $this->makeRowEvolution($isMultiRowEvolution, $graphType = 'graphEvolution');
$rowEvolution->useAvailableMetrics();
Expand Down
17 changes: 1 addition & 16 deletions plugins/CoreHome/DataTableRowAction/MultiRowEvolution.php
Expand Up @@ -19,8 +19,6 @@
class Piwik_CoreHome_DataTableRowAction_MultiRowEvolution
extends Piwik_CoreHome_DataTableRowAction_RowEvolution
{
const IS_MULTI_EVOLUTION_PARAM = 'is_multi_evolution';

/** The requested metric */
protected $metric;

Expand Down Expand Up @@ -72,17 +70,4 @@ public function renderPopover($controller, $view)

return parent::renderPopover($controller, $view);
}

/**
* Generic method to get an evolution graph or a sparkline for the row evolution popover.
* Do as much as possible from outside the controller.
*
* @return ViewDataTable
*/
public function getRowEvolutionGraph($graphType = false, $metrics = false)
{
$view = parent::getRowEvolutionGraph($graphType, $metrics);
$view->custom_parameters[self::IS_MULTI_EVOLUTION_PARAM] = 1; // set in JS
return $view;
}
}
}
12 changes: 1 addition & 11 deletions plugins/CoreHome/javascripts/datatable.js
Expand Up @@ -876,17 +876,7 @@ dataTable.prototype =
str += '&filter_limit=' + filter_limit;
}
if (label) {
if (self.param.is_multi_evolution) {
label = label.split(',');
}

if (label instanceof Array) {
for (var i = 0; i != label.length; ++i) {
str += '&label[]=' + encodeURIComponent(label[i]);
}
} else {
str += '&label=' + encodeURIComponent(label);
}
str += '&label=' + encodeURIComponent(label);
}
return str;
}
Expand Down

0 comments on commit b808489

Please sign in to comment.