You are here

function bootstrap_menu_items_link in Bootstrap menu items 7

Same name and namespace in other branches
  1. 7.3 bootstrap_menu_items.module \bootstrap_menu_items_link()

Override of theme_link().

This function will render link if it is "header" or "separator". Otherwise it will call originally overwritten menu_item_link function.

1 string reference to 'bootstrap_menu_items_link'
bootstrap_menu_items_theme_registry_alter in ./bootstrap_menu_items.module
Implements hook_theme_registry_alter().

File

./bootstrap_menu_items.module, line 58
Drupal Module: Bootstrap menu items

Code

function bootstrap_menu_items_link(array $variables) {
  if (in_array($variables['path'], array(
    '<header>',
    '<separator>',
  ))) {
    switch ($variables['path']) {
      case '<header>':
        $title = check_plain($variables['text']);
        break;
      case '<separator>':

        // Empty "menu link title" may confuse users in menu administration.
        // The text is hidden, so no problem.
        $title = check_plain($variables['text']);
        break;
    }
    return $title;
  }

  // Call the original theme function for normal menu link.
  return theme('bootstrap_menu_items_link_default', $variables);
}