Accueil/modules/weather/Weather.php

34 lines
963 B
PHP
Raw Normal View History

<?php
class weather extends Module
{
2010-09-27 12:48:53 +02:00
protected $moduleTitle = 'Météo';
2010-09-27 12:48:53 +02:00
protected $paramsList = array(
2010-09-15 23:36:14 +02:00
'visibility',
'city',
'x',
'y'
);
2010-09-20 11:40:27 +02:00
public function __construct($params){
parent::__construct(__CLASS__, $params);
}
public function build(){
$ville = $this->getParam('city');
$future_weather = [];
2010-09-27 12:48:53 +02:00
include $this->pathToModule.'includes/GoogleMeteo.php';
if (!empty($present_weather)) {
echo '<script type="text/javascript" src="'.$this->pathToModule.'js/'.$this->moduleName.'.js"></script>
2010-09-27 12:48:53 +02:00
<link rel="stylesheet" type="text/css" href="'.$this->pathToModule.'css/'.$this->moduleName.'.css">';
echo '<div id="weather" style="left:'.$this->getParam("x").'; top:'.$this->getParam("y").';">
'.$ville.'<br/>
<div class="weatherpic"></div>
<strong>'.$present_weather.'</strong><br/>
'.implode('<br/>', $future_weather).'
</div>';
}
}
}