public function weather_es_citPro::__construct in Weather_es 6.3
Same name and namespace in other branches
- 7 weather_es.inc \weather_es_citPro::__construct()
File
- ./
weather_es.inc, line 154
Class
- weather_es_citPro
- Class that gets the cities of a province
Code
public function __construct($province_code) {
// Can't use DOM because AEMET's files aren't valid XHTML files...
$this->xprovince_code = $province_code;
$this->xerror_message = '';
if ($province_code == '---') {
$this->xcities = array(
t('Any city'),
);
}
else {
if (function_exists('fsockopen')) {
//$this->cities(drupal_http_request(self::$url));
$this
->cities(drupal_http_request(self::$url . $this->xprovince_code));
}
else {
$this->xerror_message = t('Function fsockopen does not exist, you can\'t use this module...');
}
}
}