You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

69 lines
1.6 KiB

class weather extends Module {
//TODO rajouter les params en détail
protected static $paramsList = array(
public $params = array();
public function __construct($params){
$ville = $params['city'];
include 'GoogleMeteo.php';
echo '<script type="text/javascript" src="js/"></script>
<link rel="stylesheet" type="text/css" href="css/weather.css">';
echo '<div id="weather" style="left:'.$params['x'].'; top:'.$params['y'].';">
<div class="weatherpic"></div>
private function setParams($params){
$this->params = $params;
public static function start($params){
$weather = new weather($params);
public static function updateConfig($updated){
foreach ($updated as $what=>$withWhat){
if(in_array($what, self::$params)){
case 'city':
* Modifie la ville
* @param String $city la ville.
* @return String "ok" ou message d'erreur (effectue aussi l'enregistrement en XML)
public function setCity($city){
// Saving the position and z-index of the note:
$xmla = simplexml_load_file('../'.AccueilModules::CONFIG_FILE);
$path = $xmla->xpath("//item[@id='weather']");
$path[0]->city = $city;
echo "ok";