use Friendica\Core\Addon;
use Friendica\Core\Cache;
use Friendica\Core\Config;
+use Friendica\Core\L10n;
+use Friendica\Util\Network;
function geocoordinates_install()
{
return;
}
- $s = fetch_url("https://api.opencagedata.com/geocode/v1/json?q=".$coords[0].",".$coords[1]."&key=".$key."&language=".$language);
+ $s = Network::fetchUrl("https://api.opencagedata.com/geocode/v1/json?q=".$coords[0].",".$coords[1]."&key=".$key."&language=".$language);
if (!$s) {
logger("API could not be queried", LOGGER_DEBUG);
$t = get_markup_template("admin.tpl", "addon/geocoordinates/");
$o = replace_macros($t, [
- '$submit' => t('Save Settings'),
- '$api_key' => ['api_key', t('API Key'), Config::get('geocoordinates', 'api_key'), ''],
- '$language' => ['language', t('Language code (IETF format)'), Config::get('geocoordinates', 'language'), ''],
+ '$submit' => L10n::t('Save Settings'),
+ '$api_key' => ['api_key', L10n::t('API Key'), Config::get('geocoordinates', 'api_key'), ''],
+ '$language' => ['language', L10n::t('Language code (IETF format)'), Config::get('geocoordinates', 'language'), ''],
]);
}
$language = ((x($_POST, 'language')) ? notags(trim($_POST['language'])) : '');
Config::set('geocoordinates', 'language', $language);
- info(t('Settings updated.'). EOL);
+ info(L10n::t('Settings updated.'). EOL);
}