Skip to content

Instantly share code, notes, and snippets.

@cafuego
Created January 12, 2016 01:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cafuego/b4dc47fe8a75178691f9 to your computer and use it in GitHub Desktop.
Save cafuego/b4dc47fe8a75178691f9 to your computer and use it in GitHub Desktop.
<?php
function theme_service_links_build_link($variables) {
$text = $variables['text'];
$url = $variables['url'];
$image = $variables['image'];
$nodelink = $variables['nodelink'];
$style = $variables['style'];
$attributes = $variables['attributes'];
if ($nodelink) {
$query = isset($url[1]) ? $url[1] : NULL;
switch ($style) {
case SERVICE_LINKS_STYLE_TEXT:
$link = array(
'title' => $text,
'href' => $url[0],
//'query' => array($url[1]),
'query' => $query,
'attributes' => $attributes,
);
break;
default:
$link = theme_service_links_build_link($variables);
}
}
else {
$attributes = array('attributes' => $attributes);
if (isset($url[1])) {
$attributes['query'] = $url[1];
}
switch ($style) {
case SERVICE_LINKS_STYLE_TEXT:
$link = l($text, $url[0], $attributes);
break;
default:
theme_service_links_build_link($variables);
}
}
return $link;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment