use Friendica\Core\Config;
use Friendica\Core\L10n;
use Friendica\Core\PConfig;
-use Friendica\Network\Proxy;
+use Friendica\Core\Renderer;
use Friendica\Util\Network;
+use Friendica\Util\Proxy as ProxyUtils;
function curweather_install()
{
];
PConfig::set(local_user(), 'curweather', 'last', $now->getTimestamp());
- Cache::set('curweather'.md5($url), serialize($r), CACHE_HOUR);
+ Cache::set('curweather'.md5($url), serialize($r), Cache::HOUR);
return $r;
}
return;
}
- $a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . $a->get_baseurl() . '/addon/curweather/curweather.css' . '" media="all" />' . "\r\n";
+ $a->page['htmlhead'] .= '<link rel="stylesheet" type="text/css" href="' . $a->getBaseURL() . '/addon/curweather/curweather.css' . '" media="all" />' . "\r\n";
// $rpt value is needed for location
// $lang will be taken from the browser session to honour user settings
}
if ($ok) {
- $t = get_markup_template("widget.tpl", "addon/curweather/" );
- $curweather = replace_macros ($t, [
+ $t = Renderer::getMarkupTemplate("widget.tpl", "addon/curweather/" );
+ $curweather = Renderer::replaceMacros($t, [
'$title' => L10n::t("Current Weather"),
- '$icon' => Proxy::proxifyUrl('http://openweathermap.org/img/w/'.$res['icon'].'.png'),
+ '$icon' => ProxyUtils::proxifyUrl('http://openweathermap.org/img/w/'.$res['icon'].'.png'),
'$city' => $res['city'],
'$lon' => $res['lon'],
'$lat' => $res['lat'],
'$showonmap' => L10n::t('Show on map')
]);
} else {
- $t = get_markup_template('widget-error.tpl', 'addon/curweather/');
- $curweather = replace_macros( $t, [
+ $t = Renderer::getMarkupTemplate('widget-error.tpl', 'addon/curweather/');
+ $curweather = Renderer::replaceMacros( $t, [
'$problem' => L10n::t('There was a problem accessing the weather data. But have a look'),
'$rpt' => $rpt,
'$atOWM' => L10n::t('at OpenWeatherMap')
$enable_checked = (($enable) ? ' checked="checked" ' : '');
// load template and replace the macros
- $t = get_markup_template("settings.tpl", "addon/curweather/" );
+ $t = Renderer::getMarkupTemplate("settings.tpl", "addon/curweather/" );
- $s = replace_macros ($t, [
+ $s = Renderer::replaceMacros($t, [
'$submit' => L10n::t('Save Settings'),
'$header' => L10n::t('Current Weather').' '.L10n::t('Settings'),
'$noappidtext' => $noappidtext,
$appid = Config::get('curweather', 'appid');
$cachetime = Config::get('curweather', 'cachetime');
- $t = get_markup_template("admin.tpl", "addon/curweather/" );
+ $t = Renderer::getMarkupTemplate("admin.tpl", "addon/curweather/" );
- $o = replace_macros ($t, [
+ $o = Renderer::replaceMacros($t, [
'$submit' => L10n::t('Save Settings'),
'$cachetime' => [
'cachetime',