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:
authorMatthieu Napoli <matthieu@mnapoli.fr>2014-10-08 08:15:19 +0400
committerMatthieu Napoli <matthieu@mnapoli.fr>2014-10-08 08:15:19 +0400
commit8b2f6ecb6f0656d94c16a3242a2e37bba6c4878c (patch)
treecea21117240d9663738247e99e833cd1ee14c2bd /plugins/Provider
parente49a81d053c605fb41c40785544e07fc3837399d (diff)
Fixes #6201 Unknown providers are now shown as "Unknown" instead of "IP"
Furthermore, the link to the FAQ about this is now hidden when `displayLink` is `1`.
Diffstat (limited to 'plugins/Provider')
-rw-r--r--plugins/Provider/API.php2
-rw-r--r--plugins/Provider/Reports/GetProvider.php14
-rw-r--r--plugins/Provider/functions.php13
-rw-r--r--plugins/Provider/lang/en.json3
4 files changed, 17 insertions, 15 deletions
diff --git a/plugins/Provider/API.php b/plugins/Provider/API.php
index dd367fc21b..c7e7cd11c8 100644
--- a/plugins/Provider/API.php
+++ b/plugins/Provider/API.php
@@ -34,7 +34,7 @@ class API extends \Piwik\Plugin\API
$dataTable->queueFilter('ColumnCallbackReplace', array('label', __NAMESPACE__ . '\getPrettyProviderName'));
$dataTable->queueFilter('ReplaceColumnNames');
$dataTable->queueFilter('ReplaceSummaryRowLabel');
+ $dataTable->queueFilter('GroupBy', array('label'));
return $dataTable;
}
}
-
diff --git a/plugins/Provider/Reports/GetProvider.php b/plugins/Provider/Reports/GetProvider.php
index 9323deccf1..739124088c 100644
--- a/plugins/Provider/Reports/GetProvider.php
+++ b/plugins/Provider/Reports/GetProvider.php
@@ -8,11 +8,13 @@
*/
namespace Piwik\Plugins\Provider\Reports;
+use Piwik\Common;
use Piwik\Piwik;
+use Piwik\Plugin\Report;
use Piwik\Plugin\ViewDataTable;
use Piwik\Plugins\Provider\Columns\Provider;
-class GetProvider extends \Piwik\Plugin\Report
+class GetProvider extends Report
{
protected function init()
{
@@ -28,6 +30,14 @@ class GetProvider extends \Piwik\Plugin\Report
{
$view->requestConfig->filter_limit = 5;
$view->config->addTranslation('label', $this->dimension->getName());
- }
+ $message = Piwik::translate("General_Note") . ': ' . Piwik::translate('Provider_ProviderReportFooter', '');
+ if (! Common::getRequestVar('disableLink', 0, 'int')) {
+ $message .= ' ' . Piwik::translate(
+ 'General_SeeThisFaq',
+ array('<a href="http://piwik.org/faq/general/faq_52/" target="_blank">', '</a>')
+ );
+ }
+ $view->config->show_footer_message = $message;
+ }
}
diff --git a/plugins/Provider/functions.php b/plugins/Provider/functions.php
index 110b54a359..df549160d8 100644
--- a/plugins/Provider/functions.php
+++ b/plugins/Provider/functions.php
@@ -20,12 +20,9 @@ use Piwik\Piwik;
*/
function getHostnameName($in)
{
- if (empty($in)) {
+ if (empty($in) || strtolower($in) === 'ip') {
return Piwik::translate('General_Unknown');
}
- if (strtolower($in) === 'ip') {
- return "IP";
- }
if (($positionDot = strpos($in, '.')) !== false) {
return ucfirst(substr($in, 0, $positionDot));
}
@@ -40,15 +37,9 @@ function getHostnameName($in)
*/
function getHostnameUrl($in)
{
- if ($in == DataTable::LABEL_SUMMARY_ROW) {
+ if ($in == DataTable::LABEL_SUMMARY_ROW || empty($in) || strtolower($in) === 'ip') {
return false;
}
- if (empty($in)
- || strtolower($in) === 'ip'
- ) {
- // link to "what does 'IP' mean?"
- return "http://piwik.org/faq/general/#faq_52";
- }
// if the name looks like it can be used in a URL, use it in one, otherwise link to startpage
if (preg_match("/^[-a-zA-Z0-9_.]+$/", $in)) {
diff --git a/plugins/Provider/lang/en.json b/plugins/Provider/lang/en.json
index d27bb96363..f634e2eda7 100644
--- a/plugins/Provider/lang/en.json
+++ b/plugins/Provider/lang/en.json
@@ -4,6 +4,7 @@
"PluginDescription": "Reports the Provider of the visitors.",
"ProviderReportDocumentation": "This report shows which Internet Service Providers your visitors used to access the website. You can click on a provider name for more details. %s If Piwik can't determine a visitor's provider, it is listed as IP.",
"SubmenuLocationsProvider": "Locations & Provider",
- "WidgetProviders": "Providers"
+ "WidgetProviders": "Providers",
+ "ProviderReportFooter": "Unknown provider means the IP address could not be looked up."
}
} \ No newline at end of file