function theme_sls_style_image_and_text in Service links 6.2
Same name and namespace in other branches
- 7.2 plugins/service_links_sprites.module \theme_sls_style_image_and_text()
File
- plugins/
service_links_sprites.module, line 207 - Adds new styles based on sprites.
Code
function theme_sls_style_image_and_text($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' => $text,
'href' => $url[0],
'query' => $url[1],
'attributes' => $attributes,
);
}
else {
if (isset($url[1])) {
$attributes['query'] = $url[1];
}
return l($text, $url[0], $attributes);
}
}