diff options
author | Matthieu Aubry <mattab@users.noreply.github.com> | 2018-05-25 09:34:12 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-25 09:34:12 +0300 |
commit | 48969992a6c803d1b07c2eff56373680ccfabd49 (patch) | |
tree | a0c1e6587d5e4c23b7bbc9f2321ad7c12973d900 /plugins/UserCountry | |
parent | 305c9a5c5872f050b0cb6aa7f4d228c2ed192e4a (diff) |
Move provider visibility check to UI only (#12959)
That should allow setting and using invisible geolocation providers without problems
Diffstat (limited to 'plugins/UserCountry')
-rwxr-xr-x | plugins/UserCountry/LocationProvider.php | 5 | ||||
-rwxr-xr-x | plugins/UserCountry/templates/adminIndex.twig | 2 |
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> |