1 link.theme.inc | theme_link_formatter_link_separate($variables) |
Formats a link as separate title and URL elements.
File
- core/
modules/ link/ link.theme.inc, line 142 - Theme functions and preprocessing for Link module output.
Code
function theme_link_formatter_link_separate($variables) {
$class = empty($variables['element']['attributes']['class']) ? '' : ' ' . $variables['element']['attributes']['class'];
unset($variables['element']['attributes']['class']);
$link_options = $variables['element'];
unset($link_options['title']);
unset($link_options['url']);
$title = empty($variables['element']['title']) ? '' : check_plain($variables['element']['title']);
$url_parts = _link_parse_url($variables['element']['url']);
$output = '';
$output .= '<div class="link-item ' . $class . '">';
if (!empty($title)) {
$output .= '<div class="link-title">' . $title . '</div>';
}
$output .= '<div class="link-url">' . l($url_parts['url'], $variables['element']['url'], $link_options) . '</div>';
$output .= '</div>';
return $output;
}