You are here

function ctools_theme_menu_local_tasks in Chaos Tool Suite (ctools) 6

An alternative to theme_menu_local_tasks to add flexibility to tabs.

The code in theme_menu_local_tasks has no entry points to put hooks. Therefore, what CTools does is, if that theme function is not overridden, it uses hook_theme_registry_alter() to use its own version. This version then allows modules to use ctools_menu_add_local_task() to add a dynamic local task to the list.

If a theme *does* override theme_menu_local_tasks, it can still get this functionality by using ctools versions of menu_primary_local_tasks() and menu_secondary_local_tasks().

1 string reference to 'ctools_theme_menu_local_tasks'
ctools_theme_registry_alter in includes/utility.inc
Implementation of hook_theme_registry_alter()

File

includes/menu.inc, line 237
General menu helper functions.

Code

function ctools_theme_menu_local_tasks() {
  $output = '';
  if ($primary = ctools_menu_primary_local_tasks()) {
    $output .= "<ul class=\"tabs primary\">\n" . $primary . "</ul>\n";
  }
  if ($secondary = ctools_menu_secondary_local_tasks()) {
    $output .= "<ul class=\"tabs secondary\">\n" . $secondary . "</ul>\n";
  }
  return $output;
}