IT translation update blackout addon THX Sylke Vicious
[friendica-addons.git/.git] / geonames / geonames.php
index 38888ec..cf54258 100644 (file)
@@ -12,7 +12,6 @@ use Friendica\Core\Logger;
 use Friendica\Core\Renderer;
 use Friendica\DI;
 use Friendica\Util\ConfigFileLoader;
-use Friendica\Util\Network;
 use Friendica\Util\XML;
 
 function geonames_install()
@@ -78,7 +77,7 @@ function geonames_post_hook(App $a, array &$item)
 
        /* OK, we're allowed to do our stuff. */
 
-       $s = Network::fetchUrl('http://api.geonames.org/findNearbyPlaceName?lat=' . $coords[0] . '&lng=' . $coords[1] . '&username=' . $geo_account);
+       $s = DI::httpRequest()->fetch('http://api.geonames.org/findNearbyPlaceName?lat=' . $coords[0] . '&lng=' . $coords[1] . '&username=' . $geo_account);
 
        if (!$s) {
                return;
@@ -108,8 +107,6 @@ function geonames_addon_settings_post(App $a, array $post)
        }
 
        DI::pConfig()->set(local_user(), 'geonames', 'enable', intval($_POST['geonames-enable']));
-
-       info(DI::l10n()->t('Geonames settings updated.'));
 }
 
 /**
@@ -139,7 +136,7 @@ function geonames_addon_settings(App $a, &$s)
        /* Get the current state of our config variable */
        $enabled = intval(DI::pConfig()->get(local_user(), 'geonames', 'enable'));
 
-       $t = Renderer::getMarkupTemplate('settings.tpl', __DIR__);
+       $t = Renderer::getMarkupTemplate('settings.tpl', 'addon/geonames/');
        $s .= Renderer::replaceMacros($t, [
                '$title' => DI::l10n()->t('Geonames Settings'),
                '$description' => DI::l10n()->t('Replace numerical coordinates by the nearest populated location name in your posts.'),