You are here

function theme_sls_style_image_and_text in Service links 7.2

Same name and namespace in other branches
  1. 6.2 plugins/service_links_sprites.module \theme_sls_style_image_and_text()

File

plugins/service_links_sprites.module, line 214
Adds new styles based on sprites.

Code

function theme_sls_style_image_and_text($variables) {
  $text = $variables['text'];
  $url = $variables['url'];
  $image = $variables['image'];
  $nodelink = $variables['nodelink'];
  $attributes = $variables['attributes'];
  $width = sls_get_image_size(service_links_expand_path($image));
  $attributes['class'][] = "sprites service-links w{$width}";
  if ($nodelink) {
    $query = isset($url[1]) ? $url[1] : NULL;
    return array(
      'title' => $text,
      'href' => $url[0],
      'query' => $query,
      'attributes' => $attributes,
    );
  }
  else {
    if (isset($url[1])) {
      $attributes['query'] = $url[1];
    }
    return l($text, $url[0], $attributes);
  }
}