+ if ($ok) {
+ $t = Renderer::getMarkupTemplate("widget.tpl", "addon/curweather/" );
+ $curweather = Renderer::replaceMacros($t, [
+ '$title' => L10n::t("Current Weather"),
+ '$icon' => ProxyUtils::proxifyUrl('http://openweathermap.org/img/w/'.$res['icon'].'.png'),
+ '$city' => $res['city'],
+ '$lon' => $res['lon'],
+ '$lat' => $res['lat'],
+ '$description' => $res['descripion'],
+ '$temp' => $res['temperature'],
+ '$relhumidity' => ['caption'=>L10n::t('Relative Humidity'), 'val'=>$res['humidity']],
+ '$pressure' => ['caption'=>L10n::t('Pressure'), 'val'=>$res['pressure']],
+ '$wind' => ['caption'=>L10n::t('Wind'), 'val'=> $res['wind']],
+ '$lastupdate' => L10n::t('Last Updated').': '.$res['update'].'UTC',
+ '$databy' => L10n::t('Data by'),
+ '$showonmap' => L10n::t('Show on map')
+ ]);
+ } else {
+ $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')
+ ]);
+ }