function _wunderground_weather_get_icons_sample in Wunderground weather 7
Get a sample of icons of a icon set.
Parameters
string $set: The letter to identify an icon set.
Return value
string A div containing a sample of icons from an icon set.
1 call to _wunderground_weather_get_icons_sample()
- wunderground_weather_block_configure in ./
wunderground_weather.module - Implements hook_block_configure().
File
- ./
wunderground_weather.module, line 859 - Wunderground weather module to display weather forecasts and current weather conditions in blocks.
Code
function _wunderground_weather_get_icons_sample($icon_set) {
$path = drupal_get_path('module', 'wunderground_weather') . '/icons/' . $icon_set;
$files = scandir($path);
$sample = array(
$files[8],
$files[9],
$files[15],
$files[18],
$files[20],
);
$sample_icons = array();
foreach ($sample as $file) {
$sample_icons[] = theme('image', array(
'path' => $path . '/' . $file,
));
}
$output = '<div>' . implode(' ', $sample_icons) . '</div>';
return $output;
}