' . drupal_render($element['#below']) . '';
// Generate as standard dropdown.
$title .= ' ';
$attributes['class'][] = 'dropdown';
$options['attributes']['class'][] = 'dropdown-toggle';
$options['attributes']['data-toggle'] = 'dropdown';
}
}
return '
' . l($title, $href, $options) . $sub_menu . "\n";
}
/**
* Overrides theme_menu_link() for book module.
*/
function bootstrap_menu_link__book_toc(array $variables) {
$element = $variables['element'];
$sub_menu = drupal_render($element['#below']);
$title = $element['#title'];
$href = $element['#href'];
$options = !empty($element['#localized_options']) ? $element['#localized_options'] : array();
$attributes = !empty($element['#attributes']) ? $element['#attributes'] : array();
$attributes['role'] = 'presentation';
// Header.
$link = TRUE;
if ($title && $href === FALSE) {
$attributes['class'][] = 'dropdown-header';
$link = FALSE;
}
// Divider.
elseif ($title === FALSE && $href === FALSE) {
$attributes['class'][] = 'divider';
$link = FALSE;
}
// Active.
elseif (($href == $_GET['q'] || ($href == '' && drupal_is_front_page())) && (empty($options['language']))) {
$attributes['class'][] = 'active';
}
// Convert to a link.
if ($link) {
$title = l($title, $href, $options);
}
// Otherwise, filter the title if "html" is not set, otherwise l() will
// automatically sanitize using check_plain(), so no need to call that here.
elseif (empty($options['html'])) {
$title = filter_xss_admin($title);
}
return '' . $title . $sub_menu . "\n";
}