function theme_countryicons_icon_sprite in Country Icons 6
Same name and namespace in other branches
- 6.2 countryicons.theme.inc \theme_countryicons_icon_sprite()
- 7.2 countryicons.theme.inc \theme_countryicons_icon_sprite()
- 7 countryicons.module \theme_countryicons_icon_sprite()
Theme a country icon.
Parameters
$code: A two letter ISO3166 country code.
$iconset: The icon set to use ('shiny' is the default).
Return value
A string containing the image tag rendered using a css sprite techniquie.
File
- ./
countryicons.module, line 157 - A collection of country icons, and an API for retrieving them.
Code
function theme_countryicons_icon_sprite($code, $iconset = 'shiny') {
drupal_add_css(drupal_get_path('module', 'countryicons') . '/iconsets/' . $iconset . '/' . $iconset . '.css');
$iconsetinfo = countryicons_get_iconset($iconset);
$path = str_replace('*', 'shiny-sprite', $iconsetinfo['path']);
return '<ul class="countryicon countryicon-' . $iconset . '"><li class="countryicon-' . drupal_strtolower($code) . '-' . $iconset . '"></li></ul>';
}