function weather_views_data in Weather 7.3
Same name and namespace in other branches
- 7.2 weather.views.inc \weather_views_data()
Implements hook_views_data().
File
- ./
weather.views.inc, line 27 - Views integration for weather module.
Code
function weather_views_data() {
return array(
'weather_places' => array(
// Definitions for table.
'table' => array(
'group' => t('Weather'),
'base' => array(
'field' => 'geoid',
'title' => t('Weather'),
'help' => t('Display weather conditions and forecasts from all over the world.'),
),
),
// Following are the definitions for table fields.
'geoid' => array(
'title' => t('GeoID'),
'help' => t('GeoID of the weather station.'),
'field' => array(
'handler' => 'views_handler_field',
),
'filter' => array(
'handler' => 'views_handler_filter_string',
),
),
'latitude' => array(
'title' => t('Latitude'),
'help' => t('Latitude of weather station.'),
'field' => array(
'handler' => 'views_handler_field_numeric',
),
),
'longitude' => array(
'title' => t('Longitude'),
'help' => t('Longitude of weather station.'),
'field' => array(
'handler' => 'views_handler_field_numeric',
),
),
'country' => array(
'title' => t('Country'),
'help' => t('Country of weather station.'),
'field' => array(
'handler' => 'views_handler_field',
),
'filter' => array(
'handler' => 'views_handler_filter_string',
),
),
'name' => array(
'title' => t('Name'),
'help' => t('Name of weather station.'),
'field' => array(
'handler' => 'views_handler_field',
),
'filter' => array(
'handler' => 'views_handler_filter_string',
),
),
),
'weather_forecasts' => array(
'table' => array(
'group' => t('Weather'),
'join' => array(
'weather_places' => array(
'left_field' => 'geoid',
'field' => 'geoid',
),
),
),
'time_from' => array(
'title' => t('Start time'),
'help' => t('The time from when the forecast is valid.'),
'field' => array(
'handler' => 'weather_handler_date',
),
'filter' => array(
'handler' => 'views_handler_filter_date',
),
'sort' => array(
'handler' => 'views_handler_sort',
),
),
'time_to' => array(
'title' => t('End time'),
'help' => t('The time until when the forecast is valid.'),
'field' => array(
'handler' => 'weather_handler_date',
),
),
'period' => array(
'title' => t('Period of day'),
'help' => t('The day period (0-3) of the forecast.'),
'field' => array(
'handler' => 'views_handler_field',
),
),
'symbol' => array(
'title' => t('Symbol'),
'help' => t('Symbol for weather display, matches the condition.'),
'field' => array(
'handler' => 'weather_handler_condition',
),
),
'condition' => array(
'title' => t('Condition'),
'help' => t('Condition for weather display, matches the symbol.'),
'real field' => 'symbol',
'field' => array(
'handler' => 'weather_handler_condition',
),
),
'precipitation' => array(
'title' => t('Precipitation'),
'help' => t('Amount of precipitation in mm.'),
'field' => array(
'handler' => 'weather_handler_precipitation',
),
),
'wind' => array(
'title' => t('Wind'),
'help' => t('Wind information (direction and speed).'),
'real field' => 'wind_direction',
'field' => array(
'handler' => 'weather_handler_wind',
),
),
'wind_direction' => array(
'title' => t('Wind direction'),
'help' => t('Wind direction in degrees.'),
'field' => array(
'handler' => 'weather_handler_wind_direction',
),
),
'wind_speed' => array(
'title' => t('Wind speed'),
'help' => t('Wind speed in m/s.'),
'field' => array(
'handler' => 'weather_handler_wind_speed',
),
),
'temperature' => array(
'title' => t('Temperature'),
'help' => t('Temperature in degree celsius.'),
'field' => array(
'handler' => 'weather_handler_temperature',
),
),
'pressure' => array(
'title' => t('Pressure'),
'help' => t('Pressure in hPa.'),
'field' => array(
'handler' => 'weather_handler_pressure',
),
),
),
'weather_forecast_information' => array(
'table' => array(
'group' => t('Weather'),
'join' => array(
'weather_places' => array(
'left_field' => 'geoid',
'field' => 'geoid',
),
),
),
'utc_offset' => array(
'title' => t('UTC offset'),
'help' => t('UTC offset in minutes.'),
'field' => array(
'handler' => 'weather_handler_utc_offset',
),
),
),
);
}