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.

Weather.php 963B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. class weather extends Module
  3. {
  4. protected $moduleTitle = 'Météo';
  5. protected $paramsList = array(
  6. 'visibility',
  7. 'city',
  8. 'x',
  9. 'y'
  10. );
  11. public function __construct($params){
  12. parent::__construct(__CLASS__, $params);
  13. }
  14. public function build(){
  15. $ville = $this->getParam('city');
  16. $future_weather = [];
  17. include $this->pathToModule.'includes/GoogleMeteo.php';
  18. if (!empty($present_weather)) {
  19. echo '<script type="text/javascript" src="'.$this->pathToModule.'js/'.$this->moduleName.'.js"></script>
  20. <link rel="stylesheet" type="text/css" href="'.$this->pathToModule.'css/'.$this->moduleName.'.css">';
  21. echo '<div id="weather" style="left:'.$this->getParam("x").'; top:'.$this->getParam("y").';">
  22. '.$ville.'<br/>
  23. <div class="weatherpic"></div>
  24. <strong>'.$present_weather.'</strong><br/>
  25. '.implode('<br/>', $future_weather).'
  26. </div>';
  27. }
  28. }
  29. }