function theme_readmorecontrol_link in Read More Control 7
1 theme call to theme_readmorecontrol_link()
- readmorecontrol_entity_view in ./
readmorecontrol.module - Extract, update or construct the read more link.
File
- ./
readmorecontrol.module, line 637 - Defines options to control how the Read more link is displayed on teasers.
Code
function theme_readmorecontrol_link($variables) {
$readmore = $variables['link'];
// Also available.
$entity_type = $variables['entity_type'];
$entity = $variables['entity'];
$bundle = $variables['bundle'];
if (isset($readmore['href'])) {
// Pass in $readmore as $options, they share the same keys.
return l($readmore['title'], $readmore['href'], $readmore);
}
elseif (!empty($readmore['title'])) {
// Some links are actually not links, but we wrap these in <span> for adding title and class attributes.
if (empty($readmore['html'])) {
$readmore['title'] = check_plain($readmore['title']);
}
$span_attributes = '';
if (isset($readmore['attributes'])) {
$span_attributes = drupal_attributes($readmore['attributes']);
}
return '<span' . $span_attributes . '>' . $readmore['title'] . '</span>';
}
return '';
}