Skip to content
Extraits de code Groupes Projets
Valider b9020ee3 rédigé par Benaka Moorthi's avatar Benaka Moorthi
Parcourir les fichiers

Rename ViewDataTable::setDataTableType/getDefaultDataTableType to...

Rename ViewDataTable::setDataTableType/getDefaultDataTableType to setDataTableCssClass/getDefaultDataTableCssClass and move newly added view data to viewProperties member.
parent 9099abb7
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -56,6 +56,8 @@ class Piwik_ViewDataTable_HtmlTable extends Piwik_ViewDataTable
$this->setLimit(Piwik_Config::getInstance()->General['datatable_default_limit']);
$this->handleLowPopulation();
$this->setSubtableTemplate("@CoreHome/_dataTable.twig");
$this->viewProperties['datatable_js_type'] = 'dataTable';
$this->viewProperties['datatable_css_class'] = $this->getDefaultDataTableCssClass();
}
protected function getViewDataTableId()
......@@ -91,19 +93,19 @@ class Piwik_ViewDataTable_HtmlTable extends Piwik_ViewDataTable
$this->view = $this->buildView();
}
public function getDefaultDataTableType()
public function getDefaultDataTableCssClass()
{
return 'dataTableNormal';
}
public function setDataTableType($type)
public function setDataTableCssClass($type)
{
$this->viewProperties['dataTableType'] = $type;
$this->viewProperties['datatable_css_class'] = $type;
}
public function setJsType($type)
{
$this->dataTableJsType = $type;
$this->viewProperties['datatable_js_type'] = $type;
}
public function setSubtableTemplate($subtableTemplate)
......@@ -121,16 +123,8 @@ class Piwik_ViewDataTable_HtmlTable extends Piwik_ViewDataTable
*/
protected function buildView()
{
if (empty($this->viewProperties['dataTableType'])) {
$this->viewProperties['dataTableType'] = $this->getDefaultDataTableType();
}
$template = $this->idSubtable ? $this->viewProperties['subtable_template'] : $this->dataTableTemplate;
$view = new Piwik_View($template);
if (!empty($this->dataTableJsType)) {
$view->dataTableJsType = $this->dataTableJsType;
}
if (!empty($this->loadingError)) {
$view->error = $this->loadingError;
......
......@@ -63,7 +63,7 @@ class Piwik_ViewDataTable_HtmlTable_AllColumns extends Piwik_ViewDataTable_HtmlT
return true;
}
public function getDefaultDataTableType()
public function getDefaultDataTableCssClass()
{
return 'dataTableAllColumns';
}
......
......@@ -257,7 +257,7 @@ class Piwik_ViewDataTable_HtmlTable_Goals extends Piwik_ViewDataTable_HtmlTable
return true;
}
public function getDefaultDataTableType()
public function getDefaultDataTableCssClass()
{
return 'dataTableGoals';
}
......
......@@ -452,7 +452,7 @@ class Piwik_Actions_Controller extends Piwik_Controller
*/
protected function configureGenericViewActions($view)
{
$view->setDataTableType('dataTableActions');
$view->setDataTableCssClass('dataTableActions');
$view->setJsType('actionDataTable');
$view->setSubtableTemplate('@CoreHome/_dataTableActions_subDataTable.twig');
......
{% set isSubtable = javascriptVariablesToSet.idSubtable is defined and javascriptVariablesToSet.idSubtable != 0 %}
<div class="dataTable {{ properties.dataTableType }} {% if isSubtable %}subDataTable{% endif %}"
data-table-type="{{ dataTableJsType|default('dataTable') }}"
<div class="dataTable {{ properties.datatable_css_class }} {% if isSubtable %}subDataTable{% endif %}"
data-table-type="{{ properties.datatable_js_type|default('dataTable') }}"
data-report="{{ properties.report_id }}"
data-params="{{ javascriptVariablesToSet|json_encode }}">
<div class="reportDocumentation">
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter