You are here

function menu_token_get_handler in Menu Token 7

Retrieves the handler of a menu token plugin.

Parameters

$name: The name of a plugin.

Return value

A menu_token_handler object that represents the handler of the plugin defined by $name or FALSE if no plugin named $name exists.

4 calls to menu_token_get_handler()
menu_token_form_menu_edit_item_alter in ./menu_token.module
Implementation of hook_form_FORM_ID_alter().
menu_token_form_menu_edit_item_submit in ./menu_token.module
Custom submit for form menu_edit_item.
menu_token_form_menu_edit_item_validate in ./menu_token.module
Custom validation for form menu_edit_item.
menu_token_translated_menu_link_alter in ./menu_token.module
Implements hook_translated_menu_link_alter().

File

./menu_token.module, line 290
Main module file for the Menu Token module.

Code

function menu_token_get_handler($name) {
  $handlers =& drupal_static(__FUNCTION__);
  if (!isset($handlers[$name])) {
    if ($plugin = menu_token_get_plugin($name)) {
      $handlers[$name] = new $plugin['class']($plugin);
    }
  }
  if (isset($handlers[$name])) {
    return $handlers[$name];
  }
  return FALSE;
}