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:
authormattab <matthieu.aubry@gmail.com>2013-07-31 01:31:17 +0400
committermattab <matthieu.aubry@gmail.com>2013-07-31 01:31:17 +0400
commitc35e613b7ff66c6c86a712f0fd3250692ed9d8a9 (patch)
tree4e56d45743fc85f80014518e5c5bd419cc4a8f7b /plugins/VisitTime
parent765be0dc8f92a6d4bb3e678a0c23f2d4b95e0e18 (diff)
parent13f657ccfa6b58864291a173a0849d7169b031b2 (diff)
Merge branch 'master' into php-5.3-namespaces
Conflicts: core/Access.php core/Config.php core/EventDispatcher.php core/JqplotDataGenerator/Evolution.php core/Piwik.php core/Plugin/MetadataLoader.php core/ViewDataTable.php core/ViewDataTable/Cloud.php core/ViewDataTable/GenerateGraphHTML.php core/ViewDataTable/HtmlTable.php core/ViewDataTable/HtmlTable/AllColumns.php core/ViewDataTable/HtmlTable/Goals.php plugins/Actions/Controller.php plugins/CoreHome/Controller.php plugins/CoreHome/DataTableRowAction/RowEvolution.php plugins/CoreHome/templates/_dataTable.twig plugins/CustomVariables/Controller.php plugins/DBStats/Controller.php plugins/DevicesDetection/Controller.php plugins/ExampleUI/Controller.php plugins/Goals/Controller.php plugins/Live/Controller.php plugins/Provider/Controller.php plugins/Referers/Controller.php plugins/UserCountry/Controller.php plugins/UserCountryMap/Controller.php plugins/UserSettings/Archiver.php plugins/UserSettings/Controller.php plugins/VisitTime/Controller.php plugins/VisitTime/VisitTime.php plugins/VisitorInterest/Controller.php plugins/VisitsSummary/Controller.php tests/PHPUnit/proxy/index.php
Diffstat (limited to 'plugins/VisitTime')
-rw-r--r--plugins/VisitTime/Controller.php6
-rw-r--r--plugins/VisitTime/VisitTime.php70
2 files changed, 37 insertions, 39 deletions
diff --git a/plugins/VisitTime/Controller.php b/plugins/VisitTime/Controller.php
index 1cc2169741..97698e1de8 100644
--- a/plugins/VisitTime/Controller.php
+++ b/plugins/VisitTime/Controller.php
@@ -28,16 +28,16 @@ class Piwik_VisitTime_Controller extends Controller
public function getVisitInformationPerServerTime($fetch = false)
{
- return ViewDataTable::render($this->pluginName, __FUNCTION__, $fetch);
+ return Piwik_ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch);
}
public function getVisitInformationPerLocalTime($fetch = false)
{
- return ViewDataTable::render($this->pluginName, __FUNCTION__, $fetch);
+ return Piwik_ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch);
}
public function getByDayOfWeek($fetch = false)
{
- return ViewDataTable::render($this->pluginName, __FUNCTION__, $fetch);
+ return Piwik_ViewDataTable::renderReport($this->pluginName, __FUNCTION__, $fetch);
}
}
diff --git a/plugins/VisitTime/VisitTime.php b/plugins/VisitTime/VisitTime.php
index f4e4232d39..c1285f61cd 100644
--- a/plugins/VisitTime/VisitTime.php
+++ b/plugins/VisitTime/VisitTime.php
@@ -117,7 +117,7 @@ class Piwik_VisitTime extends Plugin
);
}
- public function getReportDisplayProperties(&$properties, $apiAction)
+ public function getReportDisplayProperties(&$properties)
{
$commonProperties = array(
'filter_sort_column' => 'label',
@@ -129,45 +129,39 @@ class Piwik_VisitTime extends Plugin
'default_view_type' => 'graphVerticalBar'
);
- $reportViewProperties = array(
- 'VisitTime.getVisitInformationPerServerTime' => array_merge($commonProperties, array(
- 'filter_limit' => 24,
- 'graph_limit' => null,
- 'show_goals' => true,
- 'translations' => array('label' => Piwik_Translate('VisitTime_ColumnServerTime')),
-
- // custom parameter
- 'hideFutureHoursWhenToday' => 1,
- )),
+ $properties['VisitTime.getVisitInformationPerServerTime'] = array_merge($commonProperties, array(
+ 'filter_limit' => 24,
+ 'graph_limit' => null,
+ 'show_goals' => true,
+ 'translations' => array('label' => Piwik_Translate('VisitTime_ColumnServerTime')),
- 'VisitTime.getVisitInformationPerLocalTime' => array_merge($commonProperties, array(
- 'filter_limit' => 24,
- 'graph_limit' => null,
- 'title' => Piwik_Translate('VisitTime_ColumnLocalTime'),
- 'translations' => array('label' => Piwik_Translate('VisitTime_LocalTime')),
- )),
+ // custom parameter
+ 'hideFutureHoursWhenToday' => 1,
+ ));
- 'VisitTime.getByDayOfWeek' => array_merge($commonProperties, array(
- 'filter_limit' => 7,
- 'graph_limit' => null,
- 'enable_sort' => false,
- 'show_all_ticks' => true,
- 'show_footer_message' =>
- Piwik_Translate('General_ReportGeneratedFrom', self::getDateRangeForFooterMessage()),
- 'translations' => array('label' => Piwik_Translate('VisitTime_DayOfWeek')),
- )),
- );
+ $properties['VisitTime.getVisitInformationPerLocalTime'] = array_merge($commonProperties, array(
+ 'filter_limit' => 24,
+ 'graph_limit' => null,
+ 'title' => Piwik_Translate('VisitTime_ColumnLocalTime'),
+ 'translations' => array('label' => Piwik_Translate('VisitTime_LocalTime')),
+ ));
+
+ $properties['VisitTime.getByDayOfWeek'] = array_merge($commonProperties, array(
+ 'filter_limit' => 7,
+ 'graph_limit' => null,
+ 'enable_sort' => false,
+ 'show_all_ticks' => true,
+ 'show_footer_message' =>
+ Piwik_Translate('General_ReportGeneratedFrom', self::getDateRangeForFooterMessage()),
+ 'translations' => array('label' => Piwik_Translate('VisitTime_DayOfWeek')),
+ ));
// add the visits by day of week as a related report, if the current period is not 'day'
if (Common::getRequestVar('period', 'day') != 'day') {
- $reportViewProperties['VisitTime.getVisitInformationPerLocalTime']['relatedReports'] = array(
+ $properties['VisitTime.getVisitInformationPerLocalTime']['relatedReports'] = array(
'VisitTime.getByDayOfWeek' => Piwik_Translate('VisitTime_VisitsByDayOfWeek')
);
}
-
- if (isset($reportViewProperties[$apiAction])) {
- $properties = $reportViewProperties[$apiAction];
- }
}
public function archivePeriod(ArchiveProcessor\Period $archiveProcessor)
@@ -190,12 +184,16 @@ class Piwik_VisitTime extends Plugin
private static function getDateRangeForFooterMessage()
{
// get query params
- $idSite = Common::getRequestVar('idSite');
- $date = Common::getRequestVar('date');
- $period = Common::getRequestVar('period');
+ $idSite = Common::getRequestVar('idSite', false);
+ $date = Common::getRequestVar('date', false);
+ $period = Common::getRequestVar('period', false);
// create a period instance
- $oPeriod = Period::makePeriodFromQueryParams(Site::getTimezoneFor($idSite), $period, $date);
+ try {
+ $oPeriod = Period::makePeriodFromQueryParams(Piwik_Site::getTimezoneFor($idSite), $period, $date);
+ } catch (Exception $ex) {
+ return ''; // if query params are incorrect, forget about the footer message
+ }
// set the footer message using the period start & end date
$start = $oPeriod->getDateStart()->toString();