function theme_menu_local_action

7.x menu.inc theme_menu_local_action($variables)

Returns HTML for a single local action link.

Parameters

$variables: An associative array containing:

  • element: A render element containing:

    • #link: A menu link array with 'title', 'href', and 'localized_options' keys.

Related topics

4 theme calls to theme_menu_local_action()
blog_menu_local_tasks_alter in drupal-7.x/modules/blog/blog.module
Implements hook_menu_local_tasks_alter().
forum_menu_local_tasks_alter in drupal-7.x/modules/forum/forum.module
Implements hook_menu_local_tasks_alter().
menu_local_tasks in drupal-7.x/includes/menu.inc
Collects the local tasks (tabs), action links, and the root path.
node_menu_local_tasks_alter in drupal-7.x/modules/node/node.module
Implements hook_menu_local_tasks_alter().

File

drupal-7.x/includes/menu.inc, line 1679
API for the Drupal menu system.

Code

function theme_menu_local_action($variables) {
  $link = $variables['element']['#link'];

  $output = '<li>';
  if (isset($link['href'])) {
    $output .= l($link['title'], $link['href'], isset($link['localized_options']) ? $link['localized_options'] : array());
  }
  elseif (!empty($link['localized_options']['html'])) {
    $output .= $link['title'];
  }
  else {
    $output .= check_plain($link['title']);
  }
  $output .= "</li>\n";

  return $output;
}