public function apiKey() { if (self::$apiKey === null) { self::$apiKey = mUserdata::getGlobalSettingValue("OWMApiKey", ""); } return self::$apiKey; }
function __construct($ID) { parent::__construct($ID); $this->setParser("OpenWeatherMapLastUpdate", "Util::CLDateTimeParser"); }
$_SERVER["HTTP_HOST"] = $argv[1]; Environment::reset(); Session::reloadDBData(); if (!$e->useUser()) { #echo "Kein Benutzer!\n"; DBStorage::disconnect(); continue; } $ek = Util::eK(); if ($lastUser == $ek) { throw new Exception("Changing cloud failed!"); } if ($lastDir == FileStorage::getFilesDir()) { throw new Exception("Changing cloud failed!"); } $e->addClassPath(FileStorage::getFilesDir()); try { OpenWeatherMap::$apiKey = null; mOpenWeatherMap::update(); } catch (FieldDoesNotExistException $ex) { echo $zugang . " " . get_class($ex) . ": " . $ex->getField() . "\n"; } catch (Exception $ex) { echo $zugang . " " . get_class($ex) . ": " . $ex->getMessage() . "\n"; } $lastUser = $ek; $lastDir = FileStorage::getFilesDir(); DBStorage::disconnect(); } $e->cleanUp(); flock($fp, LOCK_UN); fclose($fp);
private function toIcon($clickable, $data) { $icon = OpenWeatherMap::iconPng($data->weather[0]->icon); $B = new Button("", "./ubiquitous/OWM/icons48/" . $icon . ".png", "icon"); if ($clickable) { $B->popup("", "Vorhersage", "mOpenWeatherMap", "-1", "all"); } #".($i == 0 ? "Heute" : "Morgen")." return "<div style=\"display:inline-block;vertical-align:top;width:49%;margin-top:20px;\"><small style=\"color:grey;\">" . Datum::getGerWeekArray(date("w", $data->dt)) . ", " . date("d", $data->dt) . ".</small><br>\n\t\t\t<b style=\"font-size:15px;font-weight:bold;color:#555;\">" . round($data->temp->min) . " - " . round($data->temp->max) . " °C<br>" . $B . "\n\t\t\t</b>\n\t\t\t</div>"; }