You are here

function theme_countryicons_icon_sprite in Country Icons 7

Same name and namespace in other branches
  1. 6.2 countryicons.theme.inc \theme_countryicons_icon_sprite()
  2. 6 countryicons.module \theme_countryicons_icon_sprite()
  3. 7.2 countryicons.theme.inc \theme_countryicons_icon_sprite()

Theme a country icon with sprite techniquie.

Parameters

$variables: An associative array containing:

  • 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 185
A collection of country icons, and an API for retrieving them.

Code

function theme_countryicons_icon_sprite($variables) {
  $code = drupal_strtolower($variables['code']);
  $iconset = empty($variables['iconset']) ? 'shiny' : $variables['iconset'];
  drupal_add_css(drupal_get_path('module', 'countryicons') . '/iconsets/' . $iconset . '/' . $iconset . '.css');
  return '<ul class="countryicon countryicon-' . $iconset . '"><li class="countryicon-' . $code . '-' . $iconset . '"></li></ul>';
}