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 Aubry <mattab@users.noreply.github.com>2018-05-25 09:34:12 +0300
committerGitHub <noreply@github.com>2018-05-25 09:34:12 +0300
commit48969992a6c803d1b07c2eff56373680ccfabd49 (patch)
treea0c1e6587d5e4c23b7bbc9f2321ad7c12973d900
parent305c9a5c5872f050b0cb6aa7f4d228c2ed192e4a (diff)
Move provider visibility check to UI only (#12959)
That should allow setting and using invisible geolocation providers without problems
-rwxr-xr-xplugins/UserCountry/LocationProvider.php5
-rwxr-xr-xplugins/UserCountry/templates/adminIndex.twig2
2 files changed, 3 insertions, 4 deletions
diff --git a/plugins/UserCountry/LocationProvider.php b/plugins/UserCountry/LocationProvider.php
index fbce30bc35..2ca4807696 100755
--- a/plugins/UserCountry/LocationProvider.php
+++ b/plugins/UserCountry/LocationProvider.php
@@ -170,9 +170,7 @@ abstract class LocationProvider
$plugins = PluginManager::getInstance()->getPluginsLoadedAndActivated();
foreach ($plugins as $plugin) {
foreach (self::getLocationProviders($plugin) as $instance) {
- if ($instance->isVisible()) {
- self::$providers[] = $instance;
- }
+ self::$providers[] = $instance;
}
}
}
@@ -280,6 +278,7 @@ abstract class LocationProvider
$info['status'] = $status;
$info['statusMessage'] = $statusMessage;
$info['location'] = $location;
+ $info['isVisible'] = $provider->isVisible();
$allInfo[$info['order']] = $info;
}
diff --git a/plugins/UserCountry/templates/adminIndex.twig b/plugins/UserCountry/templates/adminIndex.twig
index 653e2b1561..e8f155342c 100755
--- a/plugins/UserCountry/templates/adminIndex.twig
+++ b/plugins/UserCountry/templates/adminIndex.twig
@@ -30,7 +30,7 @@
<div class="col s12 push-m9 m3">{{ 'General_InfoFor'|translate(thisIP) }}</div>
</div>
- {% for id,provider in locationProviders %}
+ {% for id,provider in locationProviders if provider.isVisible %}
<div class="row form-group provider{{ id|e('html_attr') }}">
<div class="col s12 m4 l2">
<p>