Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'core/ViewDataTable/Factory.php')
-rw-r--r--core/ViewDataTable/Factory.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/core/ViewDataTable/Factory.php b/core/ViewDataTable/Factory.php
index 43db3161e9..543f1280cf 100644
--- a/core/ViewDataTable/Factory.php
+++ b/core/ViewDataTable/Factory.php
@@ -12,6 +12,7 @@ use Piwik\Common;
use Piwik\Piwik;
use Piwik\Plugin\Report;
use Piwik\Plugins\CoreVisualizations\Visualizations\HtmlTable;
+use Piwik\Plugin\Reports;
/**
* Provides a means of creating {@link Piwik\Plugin\ViewDataTable} instances by ID.
@@ -58,6 +59,8 @@ use Piwik\Plugins\CoreVisualizations\Visualizations\HtmlTable;
*/
class Factory
{
+ const DEFAULT_VIEW = HtmlTable::ID;
+
/**
* Cache for getDefaultTypeViewDataTable result.
*
@@ -132,7 +135,7 @@ class Factory
// Common::getRequestVar removes backslashes from the defaultValue in case magic quotes are enabled.
// therefore do not pass this as a default value to getRequestVar()
if ('' === $type) {
- $type = $defaultType ?: HtmlTable::ID;
+ $type = $defaultType ?: self::DEFAULT_VIEW;
}
} else {
$type = $defaultViewType;
@@ -150,8 +153,8 @@ class Factory
return self::createViewDataTableInstance($visualizations[$defaultType], $controllerAction, $apiAction, $params);
}
- if (array_key_exists(HtmlTable::ID, $visualizations)) {
- return self::createViewDataTableInstance($visualizations[HtmlTable::ID], $controllerAction, $apiAction, $params);
+ if (array_key_exists(self::DEFAULT_VIEW, $visualizations)) {
+ return self::createViewDataTableInstance($visualizations[self::DEFAULT_VIEW], $controllerAction, $apiAction, $params);
}
throw new \Exception('No visualization found to render ViewDataTable');
@@ -165,7 +168,7 @@ class Factory
private static function getReport($apiAction)
{
list($module, $action) = explode('.', $apiAction);
- $report = Report::factory($module, $action);
+ $report = Reports::factory($module, $action);
return $report;
}