function theme_sls_style_image in Service links 6.2
Same name and namespace in other branches
- 7.2 plugins/service_links_sprites.module \theme_sls_style_image()
File
- plugins/
service_links_sprites.module, line 182 - Adds new styles based on sprites.
Code
function theme_sls_style_image($text, $url, $image, $nodelink, $attributes) {
$width = sls_get_image_size(service_links_expand_path($image));
$attributes['class'] = empty($attributes['class']) ? "sprites service-links w{$width}" : $attributes['class'] . " sprites service-links w{$width}";
if ($nodelink) {
$query = isset($url[1]) ? $url[1] : NULL;
return array(
'title' => '<span class="hide">' . $text . '</span>',
'href' => $url[0],
'query' => $query,
'attributes' => $attributes,
'html' => TRUE,
);
}
else {
$attributes = array_merge($attributes, array(
'html' => TRUE,
));
if (isset($url[1])) {
$attributes['query'] = $url[1];
}
return l('<span class="hide">' . $text . '</span>', $url[0], $attributes);
}
}