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:
authorbenakamoorthi <benaka.moorthi@gmail.com>2012-10-19 20:07:08 +0400
committerbenakamoorthi <benaka.moorthi@gmail.com>2012-10-19 20:07:08 +0400
commit02d4083b93328575350f1c708c14d84a5e628b82 (patch)
tree836a56573fc3529ffea4875fb2a991e2e6e422f6 /plugins/UserCountry
parent0a97e4f188eb958f16b758d3ea6c046826de12a1 (diff)
Fixes #3452, add UserCountry to Plugins_Tracker config and in order to avoid possible fatal error, moved UNKNOWN_CODE to Tracker_Visit and use 'country_code' instead of LocationProvider constant.
git-svn-id: http://dev.piwik.org/svn/trunk@7237 59fd770c-687e-43c8-a1e3-f5a4ff64c105
Diffstat (limited to 'plugins/UserCountry')
-rw-r--r--plugins/UserCountry/API.php4
-rw-r--r--plugins/UserCountry/UserCountry.php2
-rw-r--r--plugins/UserCountry/functions.php12
3 files changed, 8 insertions, 10 deletions
diff --git a/plugins/UserCountry/API.php b/plugins/UserCountry/API.php
index 4043e88b88..0309dc01d8 100644
--- a/plugins/UserCountry/API.php
+++ b/plugins/UserCountry/API.php
@@ -76,7 +76,7 @@ class Piwik_UserCountry_API
$dataTable = $this->getDataTable($recordName, $idSite, $period, $date, $segment);
$separator = Piwik_UserCountry::LOCATION_SEPARATOR;
- $unk = Piwik_UserCountry::UNKNOWN_CODE;
+ $unk = Piwik_Tracker_Visit::UNKNOWN_CODE;
// split the label and put the elements into the 'region' and 'country' metadata fields
$dataTable->filter('ColumnCallbackAddMetadata',
@@ -119,7 +119,7 @@ class Piwik_UserCountry_API
$dataTable = $this->getDataTable($recordName, $idSite, $period, $date, $segment);
$separator = Piwik_UserCountry::LOCATION_SEPARATOR;
- $unk = Piwik_UserCountry::UNKNOWN_CODE;
+ $unk = Piwik_Tracker_Visit::UNKNOWN_CODE;
// split the label and put the elements into the 'city_name', 'region', 'country',
// 'lat' & 'long' metadata fields
diff --git a/plugins/UserCountry/UserCountry.php b/plugins/UserCountry/UserCountry.php
index 7fbc4455d8..3d8e421892 100644
--- a/plugins/UserCountry/UserCountry.php
+++ b/plugins/UserCountry/UserCountry.php
@@ -22,8 +22,6 @@ class Piwik_UserCountry extends Piwik_Plugin
const DISTINCT_COUNTRIES_METRIC = 'UserCountry_distinctCountries';
- const UNKNOWN_CODE = 'xx';
-
// separate region, city & country info in stored report labels
const LOCATION_SEPARATOR = '|';
diff --git a/plugins/UserCountry/functions.php b/plugins/UserCountry/functions.php
index 9cf0583819..f91fedb19d 100644
--- a/plugins/UserCountry/functions.php
+++ b/plugins/UserCountry/functions.php
@@ -25,7 +25,7 @@ function Piwik_getFlagFromCode($code)
{
return $pathWithCode;
}
- return sprintf($pathInPiwik, Piwik_UserCountry::UNKNOWN_CODE);
+ return sprintf($pathInPiwik, Piwik_Tracker_Visit::UNKNOWN_CODE);
}
/**
@@ -51,7 +51,7 @@ function Piwik_ContinentTranslate($label)
*/
function Piwik_CountryTranslate($label)
{
- if($label == Piwik_UserCountry::UNKNOWN_CODE || $label == '')
+ if($label == Piwik_Tracker_Visit::UNKNOWN_CODE || $label == '')
{
return Piwik_Translate('General_Unknown');
}
@@ -126,7 +126,7 @@ function Piwik_UserCountry_getPrettyRegionName( $label )
list($regionCode, $countryCode) = explode(Piwik_UserCountry::LOCATION_SEPARATOR, $label);
$result = Piwik_UserCountry_LocationProvider_GeoIp::getRegionNameFromCodes($countryCode, $regionCode);
- if ($countryCode != Piwik_UserCountry::UNKNOWN_CODE && $countryCode != '')
+ if ($countryCode != Piwik_Tracker_Visit::UNKNOWN_CODE && $countryCode != '')
{
$result .= ', '.Piwik_CountryTranslate($countryCode);
}
@@ -160,15 +160,15 @@ function Piwik_UserCountry_getPrettyCityName( $label )
$regionCode = $parts[1];
$countryCode = $parts[2];
- if ($cityName == Piwik_UserCountry::UNKNOWN_CODE || $cityName == '')
+ if ($cityName == Piwik_Tracker_Visit::UNKNOWN_CODE || $cityName == '')
{
$cityName = Piwik_Translate('General_Unknown');
}
$result = $cityName;
- if ($countryCode != Piwik_UserCountry::UNKNOWN_CODE && $countryCode != '')
+ if ($countryCode != Piwik_Tracker_Visit::UNKNOWN_CODE && $countryCode != '')
{
- if ($regionCode != '' && $regionCode != Piwik_UserCountry::UNKNOWN_CODE)
+ if ($regionCode != '' && $regionCode != Piwik_Tracker_Visit::UNKNOWN_CODE)
{
$regionName = Piwik_UserCountry_LocationProvider_GeoIp::getRegionNameFromCodes($countryCode, $regionCode);
$result .= ', '.$regionName;